fix ytdl add logging etc

This commit is contained in:
Vlad Khapin 2023-02-24 21:04:13 +00:00 committed by Kirill Poletaev
parent d802845c0a
commit d560e920a9
8 changed files with 943 additions and 283 deletions

View file

@ -1,5 +1,5 @@
from fastapi import FastAPI, BackgroundTasks, Response
from youtube_dl import YoutubeDL
from yt_dlp import YoutubeDL
from uuid import uuid4, UUID
from pydantic import BaseModel
@ -21,7 +21,7 @@ def report_state(id: str):
def load_video(url: str, file_path: str, id: str):
opts = {
"format": 'mp4',
"format": 'best[height<=480][ext=mp4]',
"quiet": True,
"outtmpl": file_path,
"progress_hooks": [report_state(id)]