瀏覽代碼

change , to ,%

ming 3 年之前
父節點
當前提交
3fa7267d77
共有 4 個文件被更改,包括 5 次插入6 次删除
  1. 二進制
      .DS_Store
  2. 0 1
      OpenshotService/openshot_video_generator.py
  3. 二進制
      api/.DS_Store
  4. 5 5
      api/main.py

二進制
.DS_Store


+ 0 - 1
OpenshotService/openshot_video_generator.py

@@ -112,7 +112,6 @@ def file_prepare(name, name_hash,text_content,image_urls,lang='zh'):
     make_dir(name_hash)
     img_num = 1
     for imgu in image_urls:
-
         if get_url_type(imgu) =='video/mp4':
             r=requests.get(imgu)
             f=open(dir_photo+name_hash+"/"+str(img_num)+".mp4",'wb')

二進制
api/.DS_Store


+ 5 - 5
api/main.py

@@ -267,16 +267,16 @@ def gen_video_queue_eng(name_hash,name,text_content, image_urls,sub_titles,avata
     time_stamp = datetime.fromtimestamp(time.time()).strftime("%Y-%m-%d %H:%M:%S")
     txt_content_seperate_by_dot = ''
     for txt in text_content:
-        txt_content_seperate_by_dot += txt+","
-    txt_content_seperate_by_dot = txt_content_seperate_by_dot[:-1]
+        txt_content_seperate_by_dot += txt+",%"
+    txt_content_seperate_by_dot = txt_content_seperate_by_dot[:-2]
     img_urls_seperate_by_dot = ''
     for iurl in image_urls:
         img_urls_seperate_by_dot += iurl+","
     img_urls_seperate_by_dot = img_urls_seperate_by_dot[:-1]
     subtitles_seperate_by_dot = ''
     for sub in sub_titles:
-        subtitles_seperate_by_dot += sub+","
-    subtitles_seperate_by_dot = subtitles_seperate_by_dot[:-1]
+        subtitles_seperate_by_dot += sub+",%"
+    subtitles_seperate_by_dot = subtitles_seperate_by_dot[:-2]
     db['video_queue'].insert({'name_hash':name_hash,'name':name,'text_content':txt_content_seperate_by_dot,'image_urls':img_urls_seperate_by_dot,'subtitles':subtitles_seperate_by_dot,'avatar':avatar,'timestamp':time_stamp})
     while True:
         if first(db.query('SELECT * FROM video_queue_status'))['status'] == 1:#only one row in this table, which is the id 1 one
@@ -291,7 +291,7 @@ def gen_video_queue_eng(name_hash,name,text_content, image_urls,sub_titles,avata
             c = rpyc.connect("localhost", 8878)
             c._config['sync_request_timeout'] = None
             remote_svc = c.root
-            my_answer = remote_svc.call_video_eng(top1['name_hash'],top1['name'],top1['text_content'].split(','), top1['image_urls'].split(','),top1['subtitles'].split(','),top1['avatar']) # method call
+            my_answer = remote_svc.call_video_eng(top1['name_hash'],top1['name'],top1['text_content'].split(',%'), top1['image_urls'].split(','),top1['subtitles'].split(',%'),top1['avatar']) # method call
             shutil.copy(tmp_video_dir+top1['name_hash']+'.mp4',video_dest+top1['name_hash']+'.mp4')
             os.remove(tmp_video_dir+top1['name_hash']+'.mp4')
         except: