1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-23 00:54:31 +01:00

[youtube] Simplify and make sure header values are strings

This commit is contained in:
Yen Chi Hsuan 2015-11-29 19:52:48 +08:00
parent bf2c8c8f82
commit 049d71d874

View File

@ -1477,9 +1477,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
formats = _map_to_format_list(url_map) formats = _map_to_format_list(url_map)
# Accept-Encoding header causes failures in live streams on Youtube and Youtube Gaming # Accept-Encoding header causes failures in live streams on Youtube and Youtube Gaming
for a_format in formats: for a_format in formats:
if 'http_headers' not in a_format: a_format.setdefault('http_headers', {})['Youtubedl-no-compression'] = 'True'
a_format['http_headers'] = {}
a_format['http_headers']['Youtubedl-no-compression'] = True
else: else:
raise ExtractorError('no conn, hlsvp or url_encoded_fmt_stream_map information found in video info') raise ExtractorError('no conn, hlsvp or url_encoded_fmt_stream_map information found in video info')