|
@@ -22,7 +22,7 @@ BACKEND_ZIP_STORAGE = Path("/app").joinpath(settings.BACKEND_ZIP_STORAGE)
|
|
LOCAL_ZIP_STORAGE = Path("/").joinpath(settings.LOCAL_ZIP_STORAGE)
|
|
LOCAL_ZIP_STORAGE = Path("/").joinpath(settings.LOCAL_ZIP_STORAGE)
|
|
|
|
|
|
LINE_URL = 'https://notify-api.line.me/api/notify'
|
|
LINE_URL = 'https://notify-api.line.me/api/notify'
|
|
-LINE_TOKEN = '剛剛複製的權杖'
|
|
|
|
|
|
+LINE_TOKEN = 'o8dqdVL2k8aiWO4jy3pawZamBu53bbjoSh2u0GJ7F0j'
|
|
|
|
|
|
router = APIRouter()
|
|
router = APIRouter()
|
|
video_clients = {}
|
|
video_clients = {}
|
|
@@ -135,14 +135,14 @@ def upload_plot(
|
|
background_tasks.add_task(wait_finish, video_data)
|
|
background_tasks.add_task(wait_finish, video_data)
|
|
|
|
|
|
headers = {
|
|
headers = {
|
|
- 'Authorization': 'Bearer ' + LINE_TOKEN # 設定權杖
|
|
|
|
|
|
+ 'Authorization': 'Bearer ' + LINE_TOKEN
|
|
}
|
|
}
|
|
data = {
|
|
data = {
|
|
'message':f'cloud.choozmo.com \
|
|
'message':f'cloud.choozmo.com \
|
|
Video \
|
|
Video \
|
|
user: {current_user.id}\n \
|
|
user: {current_user.id}\n \
|
|
video: {video_data["id"]}\n \
|
|
video: {video_data["id"]}\n \
|
|
- state: queuing' # 設定要發送的訊息
|
|
|
|
|
|
+ state: queuing'
|
|
}
|
|
}
|
|
data = requests.post(LINE_URL, headers=headers, data=data)
|
|
data = requests.post(LINE_URL, headers=headers, data=data)
|
|
return JSONResponse(return_msg, background=background_tasks)
|
|
return JSONResponse(return_msg, background=background_tasks)
|
|
@@ -167,7 +167,7 @@ async def wait_finish(video_data:dict):
|
|
msg_data = f"{video_data['stored_filename']}:STARTED"
|
|
msg_data = f"{video_data['stored_filename']}:STARTED"
|
|
await publish(msg_data)
|
|
await publish(msg_data)
|
|
headers = {
|
|
headers = {
|
|
- 'Authorization': 'Bearer ' + LINE_TOKEN # 設定權杖
|
|
|
|
|
|
+ 'Authorization': 'Bearer ' + LINE_TOKEN
|
|
}
|
|
}
|
|
data = {
|
|
data = {
|
|
'message':f'cloud.choozmo.com \
|
|
'message':f'cloud.choozmo.com \
|
|
@@ -175,7 +175,7 @@ async def wait_finish(video_data:dict):
|
|
user: {video_data["owner_id"]}\n \
|
|
user: {video_data["owner_id"]}\n \
|
|
membership: {video_data["membership_status"]}\n \
|
|
membership: {video_data["membership_status"]}\n \
|
|
video: {video_data["id"]}\n \
|
|
video: {video_data["id"]}\n \
|
|
- state: start' # 設定要發送的訊息
|
|
|
|
|
|
+ state: start'
|
|
}
|
|
}
|
|
data = requests.post(LINE_URL, headers=headers, data=data)
|
|
data = requests.post(LINE_URL, headers=headers, data=data)
|
|
while True:
|
|
while True:
|
|
@@ -195,7 +195,7 @@ async def wait_finish(video_data:dict):
|
|
db.close()
|
|
db.close()
|
|
msg_data = f"{video_data['stored_filename']}:SUCCESS:{int(time)}"
|
|
msg_data = f"{video_data['stored_filename']}:SUCCESS:{int(time)}"
|
|
headers = {
|
|
headers = {
|
|
- 'Authorization': 'Bearer ' + LINE_TOKEN # 設定權杖
|
|
|
|
|
|
+ 'Authorization': 'Bearer ' + LINE_TOKEN
|
|
}
|
|
}
|
|
data = {
|
|
data = {
|
|
'message':f'cloud.choozmo.com \
|
|
'message':f'cloud.choozmo.com \
|
|
@@ -203,7 +203,7 @@ async def wait_finish(video_data:dict):
|
|
user: {video_data["owner_id"]}\n \
|
|
user: {video_data["owner_id"]}\n \
|
|
membership: {video_data["membership_status"]}\n \
|
|
membership: {video_data["membership_status"]}\n \
|
|
video: {video_data["id"]}\n \
|
|
video: {video_data["id"]}\n \
|
|
- state: success' # 設定要發送的訊息
|
|
|
|
|
|
+ state: success'
|
|
}
|
|
}
|
|
data = requests.post(LINE_URL, headers=headers, data=data)
|
|
data = requests.post(LINE_URL, headers=headers, data=data)
|
|
|
|
|