projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0424ec3
)
[utils] Refactor handle_youtubedl_headers for future extension
author
Yen Chi Hsuan
<yan12125@gmail.com>
Sun, 29 Nov 2015 04:58:29 +0000
(12:58 +0800)
committer
Yen Chi Hsuan
<yan12125@gmail.com>
Sun, 29 Nov 2015 04:58:29 +0000
(12:58 +0800)
youtube_dl/utils.py
patch
|
blob
|
history
diff --git
a/youtube_dl/utils.py
b/youtube_dl/utils.py
index c43e9e3a139a7222b3f0ffc53217a9bcdf3f0a02..d0606b4bcd3d4706912f753441608dff721d7699 100644
(file)
--- 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):
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']
del filtered_headers['Youtubedl-no-compression']
- return filtered_headers
- return headers
+ return
filtered_
headers
class YoutubeDLHandler(compat_urllib_request.HTTPHandler):
class YoutubeDLHandler(compat_urllib_request.HTTPHandler):