Use cookies

This commit is contained in:
Keroosha 2025-01-27 23:59:42 +03:00
parent 5c52466d88
commit 2495d54c05
4 changed files with 295 additions and 311 deletions

View file

@ -25,7 +25,8 @@ def load_video(url: str, file_path: str, id: str):
"format": 'best[height<=480][ext=mp4]/best[ext=mp4]',
"quiet": True,
"outtmpl": file_path,
"progress_hooks": [report_state(id)]
"progress_hooks": [report_state(id)],
"cookiefile": "cookies.txt",
}
with YoutubeDL(opts) as ydl:
ydl.download([url])