From 1bba157f7fb2c5a45d1068a95d7e147c24f5c17d Mon Sep 17 00:00:00 2001 From: j Date: Sun, 8 Nov 2020 22:54:49 +0100 Subject: [PATCH] pass referer to get_info --- pandora/archive/external.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pandora/archive/external.py b/pandora/archive/external.py index 1fbe33f32..8eeb0e24a 100644 --- a/pandora/archive/external.py +++ b/pandora/archive/external.py @@ -36,8 +36,10 @@ info_key_map = { 'display_id': 'id', } -def get_info(url): +def get_info(url, referer=None): cmd = ['youtube-dl', '-j', '--all-subs', url] + if referer: + cmd += ['--referer', referer] p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True) @@ -88,7 +90,7 @@ def add_subtitles(item, media, tmp): def download(item_id, url, referer=None): item = Item.objects.get(public_id=item_id) - info = get_info(url) + info = get_info(url, referer) if not len(info): return '%s contains no videos' % url media = info[0]