Fix getting info with cookies

This commit is contained in:
Bartkk0 2022-04-02 00:24:25 +02:00 committed by Bartkk0
parent 16f18a57b4
commit aa6632bc3d

View File

@ -129,6 +129,15 @@ class URLItem(BaseItem):
ydl_opts = { ydl_opts = {
'noplaylist': True 'noplaylist': True
} }
cookie = var.config.get('youtube_dl', 'cookie_file')
if cookie:
ydl_opts['cookiefile'] = var.config.get('youtube_dl', 'cookie_file')
user_agent = var.config.get('youtube_dl', 'user_agent')
if user_agent:
youtube_dl.utils.std_headers['User-Agent'] = var.config.get('youtube_dl', 'user_agent')\
succeed = False succeed = False
with youtube_dl.YoutubeDL(ydl_opts) as ydl: with youtube_dl.YoutubeDL(ydl_opts) as ydl:
attempts = var.config.getint('bot', 'download_attempts') attempts = var.config.getint('bot', 'download_attempts')