X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Futils.py;h=d0606b4bcd3d4706912f753441608dff721d7699;hb=78653a33aa00ba5205940c2baac5d9f019795b88;hp=c43e9e3a139a7222b3f0ffc53217a9bcdf3f0a02;hpb=0424ec307bb920a2a7c217a741241f3d2af84efa;p=youtube-dl diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index c43e9e3a1..d0606b4bc 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -664,12 +664,13 @@ def _create_http_connection(ydl_handler, http_class, is_https, *args, **kwargs): def handle_youtubedl_headers(headers): - if 'Youtubedl-no-compression' in headers: - filtered_headers = dict((k, v) for k, v in headers.items() if k.lower() != 'accept-encoding') + filtered_headers = headers + + if 'Youtubedl-no-compression' in filtered_headers: + filtered_headers = dict((k, v) for k, v in filtered_headers.items() if k.lower() != 'accept-encoding') del filtered_headers['Youtubedl-no-compression'] - return filtered_headers - return headers + return filtered_headers class YoutubeDLHandler(compat_urllib_request.HTTPHandler):