move to ytldl 50mb limit

This commit is contained in:
Vladislav Khapin 2023-02-24 08:26:41 +04:00
parent e921d15e04
commit 7fa7f1cf43
6 changed files with 506 additions and 108 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,8 +21,7 @@ def report_state(id: str):
def load_video(url: str, file_path: str, id: str):
opts = {
"recode-video": "mp4",
"format": 'best[filesize<50M]',
"format": 'best[height<=480][ext=mp4]',
"quiet": True,
"outtmpl": file_path,
"progress_hooks": [report_state(id)]