mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-30 12:01:28 +00: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
|
# subtitles download errors are already managed as troubles in relevant IE
|
||||||
# that way it will silently go on when used with unsupporting IE
|
# that way it will silently go on when used with unsupporting IE
|
||||||
subtitles = info_dict['requested_subtitles']
|
subtitles = info_dict['requested_subtitles']
|
||||||
ie = self.get_info_extractor(info_dict['extractor_key'])
|
|
||||||
for sub_lang, sub_info in subtitles.items():
|
for sub_lang, sub_info in subtitles.items():
|
||||||
sub_format = sub_info['ext']
|
sub_format = sub_info['ext']
|
||||||
sub_filename = subtitles_filename(filename, sub_lang, sub_format, info_dict.get('ext'))
|
sub_filename = subtitles_filename(filename, sub_lang, sub_format, info_dict.get('ext'))
|
||||||
|
@ -1839,10 +1838,10 @@ def dl(name, info):
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
dl(sub_filename, sub_info)
|
dl(sub_filename, sub_info)
|
||||||
except (
|
except (ExtractorError, IOError, OSError, ValueError,
|
||||||
ExtractorError, IOError, OSError, ValueError,
|
compat_urllib_error.URLError,
|
||||||
compat_urllib_error.URLError,
|
compat_http_client.HTTPException,
|
||||||
compat_http_client.HTTPException, socket.error) as err:
|
socket.error) as err:
|
||||||
self.report_warning('Unable to download subtitle for "%s": %s' %
|
self.report_warning('Unable to download subtitle for "%s": %s' %
|
||||||
(sub_lang, error_to_compat_str(err)))
|
(sub_lang, error_to_compat_str(err)))
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -28,7 +28,7 @@ def dl_fragment(url):
|
||||||
return self._download_fragment(ctx, url, info_dict, headers)
|
return self._download_fragment(ctx, url, info_dict, headers)
|
||||||
|
|
||||||
def parse_yt_initial_data(data):
|
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)
|
return json.loads(raw_json)
|
||||||
|
|
||||||
self._prepare_and_start_frag_download(ctx)
|
self._prepare_and_start_frag_download(ctx)
|
||||||
|
|
Loading…
Reference in a new issue