Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
Fix getting info with cookies
Browse files Browse the repository at this point in the history
Merge pull request #328 from Bartkk0/fix-age-restriction
  • Loading branch information
azlux committed Apr 3, 2022
2 parents 16f18a5 + aa6632b commit 0650e72
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions media/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,15 @@ def _get_info_from_url(self):
ydl_opts = {
'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
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
attempts = var.config.getint('bot', 'download_attempts')
Expand Down

0 comments on commit 0650e72

Please sign in to comment.