Spaces:
Paused
Paused
Commit
·
9085b9a
1
Parent(s):
ec4e48d
edits
Browse files
app.py
CHANGED
@@ -34,9 +34,9 @@ async def upload(background_tasks: BackgroundTasks,
|
|
34 |
|
35 |
logger.info(f"Uploading video {file.filename} {token} {user_id}")
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
|
41 |
logger.info("reading contents")
|
42 |
contents = await file.read()
|
|
|
34 |
|
35 |
logger.info(f"Uploading video {file.filename} {token} {user_id}")
|
36 |
|
37 |
+
if token != API_KEY:
|
38 |
+
logger.info(f"Unauthorized {token} {API_KEY}")
|
39 |
+
return JSONResponse(content={"message": "Unauthorized", "status": 401})
|
40 |
|
41 |
logger.info("reading contents")
|
42 |
contents = await file.read()
|
tasks.py
CHANGED
@@ -32,5 +32,5 @@ def process_video(video_path: str,vitpose: VitPose,user_id: str):
|
|
32 |
response = requests.post(url, files=files, data={"user_id":user_id,"typeMessage":"video_processed","file_name":annotated_video_path}, stream=True)
|
33 |
logger.info(f"Video sent to {url}")
|
34 |
print(response.json())
|
35 |
-
os.remove(video_path)
|
36 |
-
os.remove(annotated_video_path)
|
|
|
32 |
response = requests.post(url, files=files, data={"user_id":user_id,"typeMessage":"video_processed","file_name":annotated_video_path}, stream=True)
|
33 |
logger.info(f"Video sent to {url}")
|
34 |
print(response.json())
|
35 |
+
# os.remove(video_path)
|
36 |
+
# os.remove(annotated_video_path)
|