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 @@ class YoutubeDL(object): # 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 @@ class YoutubeDL(object): 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 @@ class YoutubeLiveChatReplayFD(FragmentFD): 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)