|
@@ -1169,20 +1169,21 @@ def gen_video_queue_eng(name_hash,name,text_content, image_urls,sub_titles,avata
|
|
if first(db.query('SELECT * FROM video_queue_status'))['status'] == 1:#only one row in this table, which is the id 1 one
|
|
if first(db.query('SELECT * FROM video_queue_status'))['status'] == 1:#only one row in this table, which is the id 1 one
|
|
print('another process running, leave loop')
|
|
print('another process running, leave loop')
|
|
break
|
|
break
|
|
- if first(db.query('SELECT COUNT(1) FROM video_queue where video_type=="eng"'))['COUNT(1)'] == 0:
|
|
|
|
|
|
+ if first(db.query('SELECT COUNT(1) FROM video_queue where video_type="eng"'))['COUNT(1)'] == 0:
|
|
print('all finish, leave loop')
|
|
print('all finish, leave loop')
|
|
break
|
|
break
|
|
- top1 = first(db.query('SELECT * FROM video_queue where video_type=="eng"'))
|
|
|
|
|
|
+ top1 = first(db.query('SELECT * FROM video_queue where video_type="eng"'))
|
|
try:
|
|
try:
|
|
db.query('UPDATE video_queue_status SET status = 1;')
|
|
db.query('UPDATE video_queue_status SET status = 1;')
|
|
c = rpyc.connect("localhost", 8858)
|
|
c = rpyc.connect("localhost", 8858)
|
|
c._config['sync_request_timeout'] = None
|
|
c._config['sync_request_timeout'] = None
|
|
remote_svc = c.root
|
|
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'],top1['freeTrial']) # 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'],top1['freeTrial']) # method call
|
|
- shutil.copy(tmp_video_dir+top1['name']+'.mp4',video_dest+top1['name_hash']+'.mp4')
|
|
|
|
|
|
+ shutil.copy(tmp_video_dir+top1['name_hash']+'.mp4',video_dest+top1['name_hash']+'.mp4')
|
|
os.remove(tmp_video_dir+top1['name_hash']+'.mp4')
|
|
os.remove(tmp_video_dir+top1['name_hash']+'.mp4')
|
|
notify_group(top1['name']+"(ENG)的影片已經產生完成囉! www.choozmo.com:8168/"+video_sub_folder+['name_hash']+".mp4")
|
|
notify_group(top1['name']+"(ENG)的影片已經產生完成囉! www.choozmo.com:8168/"+video_sub_folder+['name_hash']+".mp4")
|
|
- except:
|
|
|
|
|
|
+ except Exception as e:
|
|
|
|
+ logging.error(traceback.format_exc())
|
|
print('video generation error')
|
|
print('video generation error')
|
|
notify_group('影片錯誤')
|
|
notify_group('影片錯誤')
|
|
db['video_queue'].delete(id=top1['id'])
|
|
db['video_queue'].delete(id=top1['id'])
|