From be19ae11fde9eb8cb28ff967ded15b457b5f80ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Ber=C3=A1nek?= Date: Mon, 30 Nov 2020 19:14:29 +0100 Subject: [cspan] Pass Referer header with format's video URL (#26032) (closes #25729) --- youtube_dl/extractor/cspan.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'youtube_dl/extractor') diff --git a/youtube_dl/extractor/cspan.py b/youtube_dl/extractor/cspan.py index 67d6df4b0..3356cc280 100644 --- a/youtube_dl/extractor/cspan.py +++ b/youtube_dl/extractor/cspan.py @@ -165,6 +165,8 @@ class CSpanIE(InfoExtractor): formats = self._extract_m3u8_formats( path, video_id, 'mp4', entry_protocol='m3u8_native', m3u8_id='hls') if determine_ext(path) == 'm3u8' else [{'url': path, }] + for f in formats: + f.setdefault('http_headers', {})['Referer'] = url self._sort_formats(formats) entries.append({ 'id': '%s_%d' % (video_id, partnum + 1), -- cgit v1.2.3