diff options
author | Sergey M․ <dstftw@gmail.com> | 2021-04-17 03:32:04 +0700 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2021-04-17 03:32:04 +0700 |
commit | cfee2dfe83c5593d46bd0c8e8ce6a3d8c6e42db7 (patch) | |
tree | 5049c8b8870582105ec2cf47f5a7add2ae8ea03a | |
parent | 30a3a4c70fdcad10ef1dc6c3402457a95fe1ae5c (diff) |
[utils] PEP 8
-rw-r--r-- | youtube_dl/utils.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 538cc2b63..e722eed58 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -2908,7 +2908,7 @@ class YoutubeDLRedirectHandler(compat_urllib_request.HTTPRedirectHandler): """ m = req.get_method() if (not (code in (301, 302, 303, 307, 308) and m in ("GET", "HEAD") - or code in (301, 302, 303) and m == "POST")): + or code in (301, 302, 303) and m == "POST")): raise compat_HTTPError(req.full_url, code, msg, headers, fp) # Strictly (according to RFC 2616), 301 or 302 in response to # a POST MUST NOT cause a redirection without confirmation @@ -2930,11 +2930,10 @@ class YoutubeDLRedirectHandler(compat_urllib_request.HTTPRedirectHandler): CONTENT_HEADERS = ("content-length", "content-type") # NB: don't use dict comprehension for python 2.6 compatibility newheaders = dict((k, v) for k, v in req.headers.items() - if k.lower() not in CONTENT_HEADERS) - return compat_urllib_request.Request(newurl, - headers=newheaders, - origin_req_host=req.origin_req_host, - unverifiable=True) + if k.lower() not in CONTENT_HEADERS) + return compat_urllib_request.Request( + newurl, headers=newheaders, origin_req_host=req.origin_req_host, + unverifiable=True) def extract_timezone(date_str): |