add ping move to boxes etc

This commit is contained in:
Vladislav Khapin 2023-02-26 20:08:42 +04:00
parent f0e6aaa7e5
commit 979120383a
7 changed files with 426 additions and 256 deletions

View file

@ -20,14 +20,17 @@ def report_state(id: str):
def load_video(url: str, file_path: str, id: str):
opts = {
"format": 'best[height<=480][ext=mp4]',
"quiet": True,
"outtmpl": file_path,
"progress_hooks": [report_state(id)]
}
with YoutubeDL(opts) as ydl:
ydl.download([url])
try:
opts = {
"format": 'best[height<=480][ext=mp4]/bestvideo+bestaudio[ext=mp4]',
"quiet": True,
"outtmpl": file_path,
"progress_hooks": [report_state(id)]
}
with YoutubeDL(opts) as ydl:
ydl.download([url])
except Exception:
del backgroundJobs[id]
@app.get("/api/info")