|
@@ -108,7 +108,7 @@ def make_dir(name_hash):
|
|
|
except FileExistsError:
|
|
|
print("~~~~~~Warning~~~~~~~~~Directory " , dir_subtitle+name_hash , " already exists")
|
|
|
|
|
|
-def file_prepare(name, name_hash,text_content,image_urls,lang='zh'):
|
|
|
+def file_prepare(name, name_hash,text_content,image_urls,multiLang,lang='zh'):
|
|
|
make_dir(name_hash)
|
|
|
img_num = 1
|
|
|
for imgu in image_urls:
|
|
@@ -136,7 +136,7 @@ def file_prepare(name, name_hash,text_content,image_urls,lang='zh'):
|
|
|
language = 'zh-tw'
|
|
|
txt_idx = 0
|
|
|
for txt in text_content:
|
|
|
- if lang!='zh':
|
|
|
+ if lang!='zh' or multiLang==1:
|
|
|
tts = gTTS(txt)
|
|
|
tts.save(dir_sound+name_hash+"/"+str(txt_idx)+".mp3")
|
|
|
else:
|
|
@@ -251,10 +251,10 @@ def generate_subtitle_image_ENG(name_hash,text_content):
|
|
|
img_list[idx] = sv_path
|
|
|
return img_list
|
|
|
|
|
|
-def anchor_video_v2(name_hash,name,text_content, image_urls,avatar):
|
|
|
+def anchor_video_v2(name_hash,name,text_content, image_urls,multiLang,avatar):
|
|
|
print(os.getcwd())
|
|
|
print('sub image made')
|
|
|
- file_prepare(name, name_hash, text_content,image_urls)
|
|
|
+ file_prepare(name, name_hash, text_content,multiLang,image_urls)
|
|
|
sub_list=generate_subtitle_image(name_hash,text_content)
|
|
|
|
|
|
for fname in range(len(text_content)):
|
|
@@ -536,8 +536,8 @@ def anchor_video_eng(name_hash,name,text_content, image_urls,sub_titles,avatar):
|
|
|
|
|
|
|
|
|
class video_service(rpyc.Service):
|
|
|
- def exposed_call_video(self,name_hash,name,text_content, image_urls,avatar):
|
|
|
- anchor_video_v2(name_hash,name,text_content, image_urls,avatar)
|
|
|
+ def exposed_call_video(self,name_hash,name,text_content, image_urls,multiLang,avatar):
|
|
|
+ anchor_video_v2(name_hash,name,text_content, image_urls,multiLang,avatar)
|
|
|
def exposed_call_video_eng(self,name_hash,name,text_content, image_urls,sub_titles,avatar):
|
|
|
anchor_video_eng(name_hash,name,text_content, image_urls,sub_titles,avatar)
|
|
|
|