aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/youtube.py
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2015-11-29 12:44:24 +0800
committerYen Chi Hsuan <yan12125@gmail.com>2015-11-29 12:44:24 +0800
commitac5a69af45307b583a9a6088abe5939bec18d562 (patch)
tree67dac25f33f4809feead5fb9a2aaf3aac5c332c1 /youtube_dl/extractor/youtube.py
parent94e8c8047353eb541fa20dcf55819cc6ee6d3303 (diff)
[youtube] Disable compression for live streams
Diffstat (limited to 'youtube_dl/extractor/youtube.py')
-rw-r--r--youtube_dl/extractor/youtube.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py
index 1c2420a33..52f4fe36d 100644
--- a/youtube_dl/extractor/youtube.py
+++ b/youtube_dl/extractor/youtube.py
@@ -1475,6 +1475,11 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
manifest_url = video_info['hlsvp'][0]
url_map = self._extract_from_m3u8(manifest_url, video_id)
formats = _map_to_format_list(url_map)
+ # Accept-Encoding header causes failures in live streams on Youtube and Youtube Gaming
+ for a_format in formats:
+ if 'http_headers' not in a_format:
+ a_format['http_headers'] = {}
+ a_format['http_headers']['Youtubedl-no-compression'] = True
else:
raise ExtractorError('no conn, hlsvp or url_encoded_fmt_stream_map information found in video info')