From 3089bc748c0fe72a0361bce3f5e2fbab25175236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Sat, 11 May 2019 03:56:22 +0700 Subject: Fix W504 and disable W503 (closes #20863) --- youtube_dl/extractor/addanime.py | 6 ++--- youtube_dl/extractor/blinkx.py | 4 ++-- youtube_dl/extractor/common.py | 40 ++++++++++++++++----------------- youtube_dl/extractor/dailymail.py | 4 ++-- youtube_dl/extractor/dctp.py | 4 ++-- youtube_dl/extractor/expressen.py | 4 ++-- youtube_dl/extractor/frontendmasters.py | 4 ++-- youtube_dl/extractor/generic.py | 14 ++++++------ youtube_dl/extractor/heise.py | 4 ++-- youtube_dl/extractor/hitbox.py | 4 ++-- youtube_dl/extractor/hitrecord.py | 4 ++-- youtube_dl/extractor/hketv.py | 12 +++++----- youtube_dl/extractor/hrti.py | 4 ++-- youtube_dl/extractor/infoq.py | 6 ++--- youtube_dl/extractor/iqiyi.py | 6 ++--- youtube_dl/extractor/itv.py | 8 +++---- youtube_dl/extractor/kaltura.py | 8 +++---- youtube_dl/extractor/karrierevideos.py | 4 ++-- youtube_dl/extractor/motherless.py | 4 ++-- youtube_dl/extractor/ndtv.py | 4 ++-- youtube_dl/extractor/nextmedia.py | 4 ++-- youtube_dl/extractor/niconico.py | 26 ++++++++++----------- youtube_dl/extractor/nrk.py | 4 ++-- youtube_dl/extractor/ooyala.py | 4 ++-- youtube_dl/extractor/openload.py | 6 ++--- youtube_dl/extractor/podomatic.py | 4 ++-- youtube_dl/extractor/ruutu.py | 4 ++-- youtube_dl/extractor/sbs.py | 4 ++-- youtube_dl/extractor/vevo.py | 4 ++-- youtube_dl/extractor/vk.py | 4 ++-- youtube_dl/extractor/yandexvideo.py | 6 ++--- youtube_dl/extractor/youku.py | 4 ++-- youtube_dl/extractor/youtube.py | 18 +++++++-------- youtube_dl/extractor/zattoo.py | 4 ++-- 34 files changed, 122 insertions(+), 122 deletions(-) (limited to 'youtube_dl/extractor') diff --git a/youtube_dl/extractor/addanime.py b/youtube_dl/extractor/addanime.py index 9f8a71262..5e7c0724e 100644 --- a/youtube_dl/extractor/addanime.py +++ b/youtube_dl/extractor/addanime.py @@ -59,9 +59,9 @@ class AddAnimeIE(InfoExtractor): parsed_url = compat_urllib_parse_urlparse(url) av_val = av_res + len(parsed_url.netloc) confirm_url = ( - parsed_url.scheme + '://' + parsed_url.netloc + - action + '?' + - compat_urllib_parse_urlencode({ + parsed_url.scheme + '://' + parsed_url.netloc + + action + '?' + + compat_urllib_parse_urlencode({ 'jschl_vc': vc, 'jschl_answer': compat_str(av_val)})) self._download_webpage( confirm_url, video_id, diff --git a/youtube_dl/extractor/blinkx.py b/youtube_dl/extractor/blinkx.py index 3b8eabe8f..db5e12b21 100644 --- a/youtube_dl/extractor/blinkx.py +++ b/youtube_dl/extractor/blinkx.py @@ -32,8 +32,8 @@ class BlinkxIE(InfoExtractor): video_id = self._match_id(url) display_id = video_id[:8] - api_url = ('https://apib4.blinkx.com/api.php?action=play_video&' + - 'video=%s' % video_id) + api_url = ('https://apib4.blinkx.com/api.php?action=play_video&' + + 'video=%s' % video_id) data_json = self._download_webpage(api_url, display_id) data = json.loads(data_json)['api']['results'][0] duration = None diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py index 59ad455c1..23b4f372a 100644 --- a/youtube_dl/extractor/common.py +++ b/youtube_dl/extractor/common.py @@ -542,11 +542,11 @@ class InfoExtractor(object): raise ExtractorError('An extractor error has occurred.', cause=e) def __maybe_fake_ip_and_retry(self, countries): - if (not self._downloader.params.get('geo_bypass_country', None) and - self._GEO_BYPASS and - self._downloader.params.get('geo_bypass', True) and - not self._x_forwarded_for_ip and - countries): + if (not self._downloader.params.get('geo_bypass_country', None) + and self._GEO_BYPASS + and self._downloader.params.get('geo_bypass', True) + and not self._x_forwarded_for_ip + and countries): country_code = random.choice(countries) self._x_forwarded_for_ip = GeoUtils.random_ipv4(country_code) if self._x_forwarded_for_ip: @@ -682,8 +682,8 @@ class InfoExtractor(object): def __check_blocked(self, content): first_block = content[:512] - if ('Access to this site is blocked' in content and - 'Websense' in first_block): + if ('Access to this site is blocked' in content + and 'Websense' in first_block): msg = 'Access to this webpage has been blocked by Websense filtering software in your network.' blocked_iframe = self._html_search_regex( r'