mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-02 09:12:40 +01:00
run flake8
This commit is contained in:
parent
321bf820c5
commit
7627f548e6
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user