Browse Source

add save src face

ming 3 years ago
parent
commit
8324e0147c
1 changed files with 4 additions and 3 deletions
  1. 4 3
      api/main.py

+ 4 - 3
api/main.py

@@ -186,9 +186,10 @@ def gen_avatar(name_hash,imgurl):
     c = rpyc.connect("localhost", 8868)
     c._config['sync_request_timeout'] = None
     remote_svc = c.root
-    my_answer = remote_svc.call_avatar(name_hash) # method call
-    shutil.copy(tmp_avatar_dir+name_hash+'.mp4',avatar_dest+name_hash+'.mp4')
-    os.remove(tmp_avatar_dir+name_hash+'.mp4')
+    status = remote_svc.call_avatar(name_hash) # method call
+    if not status:
+        shutil.copy(tmp_avatar_dir+name_hash+'.mp4',avatar_dest+name_hash+'.mp4')
+        os.remove(tmp_avatar_dir+name_hash+'.mp4')