|
@@ -37,6 +37,8 @@ USER_TABLE="EDM_SAAS_USER"
|
|
|
VIDEO_TABLE="EDM_SAAS_VIDEO"
|
|
|
ALGORITHM = "HS256"
|
|
|
|
|
|
+
|
|
|
+Discord_URL = 'https://discord.com/api/webhooks/1348921334335541351/HU6tmFAfVcLdVcZjhy-qaqcbsoAhU_SdgvonujHi4S3HN-Rt9g9J2BIfi2yLslfc0ADb'
|
|
|
LINE_URL = 'https://notify-api.line.me/api/notify'
|
|
|
LINE_TOKEN = 'o8dqdVL2k8aiWO4jy3pawZamBu53bbjoSh2u0GJ7F0j'
|
|
|
|
|
@@ -160,7 +162,7 @@ async def wait_finish(video_data:dict):
|
|
|
msg_data = f"{video_data['stored_filename']}:STARTED"
|
|
|
await publish(msg_data)
|
|
|
headers = {
|
|
|
- 'Authorization': 'Bearer ' + LINE_TOKEN
|
|
|
+ 'Content-Type': 'application/json'
|
|
|
}
|
|
|
data = {
|
|
|
'message':f'cloud-choozmo-com\n \
|
|
@@ -170,7 +172,7 @@ async def wait_finish(video_data:dict):
|
|
|
video: {video_data["id"]}\n \
|
|
|
state: start'
|
|
|
}
|
|
|
- data = requests.post(LINE_URL, headers=headers, data=data)
|
|
|
+ data = requests.post(Discord_URL, headers=headers, data=data)
|
|
|
while True:
|
|
|
await asyncio.sleep(1)
|
|
|
if task.state != "STARTED":
|
|
@@ -186,7 +188,7 @@ async def wait_finish(video_data:dict):
|
|
|
pass
|
|
|
msg_data = f"{video_data['stored_filename']}:SUCCESS:{int(time)}"
|
|
|
headers = {
|
|
|
- 'Authorization': 'Bearer ' + LINE_TOKEN
|
|
|
+ 'Content-Type': 'application/json'
|
|
|
}
|
|
|
data = {
|
|
|
'message':f'cloud-choozmo-com\n \
|
|
@@ -196,13 +198,13 @@ async def wait_finish(video_data:dict):
|
|
|
video: {video_data["id"]}\n \
|
|
|
state: success'
|
|
|
}
|
|
|
- data = requests.post(LINE_URL, headers=headers, data=data)
|
|
|
+ data = requests.post(Discord_URL, headers=headers, data=data)
|
|
|
|
|
|
else:
|
|
|
video = supabase.table(VIDEO_TABLE).update({"progress_state":"FAILUR", "error_message":str(task.result)}).eq('id', video_data['id']).execute()
|
|
|
- msg_data = f"{video_data['stored_filename']}:FAILURE:{task.result}"
|
|
|
+ msg_data = f"{video_data['stored_filename']}:FAILURE:{task.result}"
|
|
|
headers = {
|
|
|
- 'Authorization': 'Bearer ' + LINE_TOKEN
|
|
|
+ 'Content-Type': 'application/json'
|
|
|
}
|
|
|
data = {
|
|
|
'message':f'cloud-choozmo-com\n \
|
|
@@ -218,7 +220,7 @@ async def wait_finish(video_data:dict):
|
|
|
msg_data = f"{video_data['stored_filename']}:FAILURE:{task.result}"
|
|
|
|
|
|
headers = {
|
|
|
- 'Authorization': 'Bearer ' + LINE_TOKEN
|
|
|
+ 'Content-Type': 'application/json'
|
|
|
}
|
|
|
data = {
|
|
|
'message':f'cloud-choozmo-com\n \
|
|
@@ -228,7 +230,7 @@ async def wait_finish(video_data:dict):
|
|
|
video: {video_data["id"]}\n \
|
|
|
state: failure'
|
|
|
}
|
|
|
- data = requests.post(LINE_URL, headers=headers, data=data)
|
|
|
+ data = requests.post(Discord_URL, headers=headers, data=data)
|
|
|
|
|
|
await publish(msg_data)
|
|
|
|