From 7627f548e6de828114e4841385c75a73c0911506 Mon Sep 17 00:00:00 2001 From: siikamiika Date: Wed, 5 Aug 2020 03:38:07 +0300 Subject: [PATCH] run flake8 --- youtube_dl/YoutubeDL.py | 9 ++++----- youtube_dl/downloader/youtube_live_chat.py | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 1b8a938e5..0dc869d56 100755 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -1820,7 +1820,6 @@ def dl(name, info): # subtitles download errors are already managed as troubles in relevant IE # that way it will silently go on when used with unsupporting IE subtitles = info_dict['requested_subtitles'] - ie = self.get_info_extractor(info_dict['extractor_key']) for sub_lang, sub_info in subtitles.items(): sub_format = sub_info['ext'] sub_filename = subtitles_filename(filename, sub_lang, sub_format, info_dict.get('ext')) @@ -1839,10 +1838,10 @@ def dl(name, info): else: try: dl(sub_filename, sub_info) - except ( - ExtractorError, IOError, OSError, ValueError, - compat_urllib_error.URLError, - compat_http_client.HTTPException, socket.error) as err: + except (ExtractorError, IOError, OSError, ValueError, + compat_urllib_error.URLError, + compat_http_client.HTTPException, + socket.error) as err: self.report_warning('Unable to download subtitle for "%s": %s' % (sub_lang, error_to_compat_str(err))) continue diff --git a/youtube_dl/downloader/youtube_live_chat.py b/youtube_dl/downloader/youtube_live_chat.py index 64d1d20b2..214a37203 100644 --- a/youtube_dl/downloader/youtube_live_chat.py +++ b/youtube_dl/downloader/youtube_live_chat.py @@ -28,7 +28,7 @@ def dl_fragment(url): return self._download_fragment(ctx, url, info_dict, headers) def parse_yt_initial_data(data): - raw_json = re.search(b'window\["ytInitialData"\]\s*=\s*(.*);', data).group(1) + raw_json = re.search(rb'window\["ytInitialData"\]\s*=\s*(.*);', data).group(1) return json.loads(raw_json) self._prepare_and_start_frag_download(ctx)