|
@@ -54,10 +54,11 @@ print("db loaded")
|
|
|
mode = 'run'
|
|
|
app.add_middleware(
|
|
|
CORSMiddleware,
|
|
|
- allow_origins=["https://video.choozmo.com/"],
|
|
|
+ allow_origins=["*"],
|
|
|
allow_credentials=True,
|
|
|
allow_methods=["*"],
|
|
|
- allow_headers=['Accept','Content-Type','X-Requested-With','x-api-key'],
|
|
|
+ allow_headers=["*"],
|
|
|
+ # allow_headers=['Accept','Content-Type','X-Requested-With','x-api-key'],
|
|
|
)
|
|
|
SECRET_KEY = "df2f77bd544240801a048bd4293afd8eeb7fff3cb7050e42c791db4b83ebadcd"
|
|
|
ALGORITHM = "HS256"
|
|
@@ -1122,7 +1123,7 @@ def gen_video_queue(name_hash,name,text_content, image_urls,avatar,multiLang,vid
|
|
|
left_time = left_time - vid_duration
|
|
|
if user_id != -1:
|
|
|
db.query('UPDATE users SET left_time ='+str(left_time)+' WHERE id='+str(user_id)+';')
|
|
|
- notify_group(name+"的影片已經產生完成囉! www.choozmo.com:8168/"+video_sub_folder+name_hash+".mp4")
|
|
|
+ notify_group(top1['name']+"的影片已經產生完成囉! www.choozmo.com:8168/"+video_sub_folder+top1['name_hash']+".mp4")
|
|
|
#notify_line_user(name+"的影片已經產生完成囉! www.choozmo.com:8168/"+video_sub_folder+name_hash+".mp4", line_token)
|
|
|
except Exception as e:
|
|
|
logging.error(traceback.format_exc())
|
|
@@ -1172,9 +1173,9 @@ def gen_video_queue_eng(name_hash,name,text_content, image_urls,sub_titles,avata
|
|
|
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'],top1['freeTrial']) # method call
|
|
|
- shutil.copy(tmp_video_dir+top1['name_hash']+'.mp4',video_dest+top1['name_hash']+'.mp4')
|
|
|
+ shutil.copy(tmp_video_dir+top1['name']+'.mp4',video_dest+top1['name_hash']+'.mp4')
|
|
|
os.remove(tmp_video_dir+top1['name_hash']+'.mp4')
|
|
|
- notify_group(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:
|
|
|
print('video generation error')
|
|
|
notify_group('影片錯誤')
|