mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-08-24 16:21:40 +02:00
parent
1cdda32998
commit
88fb942577
@ -3930,7 +3930,7 @@ def _write_description(self, label, ie_result, descfn):
|
|||||||
elif not self.params.get('overwrites', True) and os.path.exists(descfn):
|
elif not self.params.get('overwrites', True) and os.path.exists(descfn):
|
||||||
self.to_screen(f'[info] {label.title()} description is already present')
|
self.to_screen(f'[info] {label.title()} description is already present')
|
||||||
elif ie_result.get('description') is None:
|
elif ie_result.get('description') is None:
|
||||||
self.report_warning(f'There\'s no {label} description to write')
|
self.to_screen(f'[info] There\'s no {label} description to write')
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
@ -3946,15 +3946,18 @@ def _write_subtitles(self, info_dict, filename):
|
|||||||
''' Write subtitles to file and return list of (sub_filename, final_sub_filename); or None if error'''
|
''' Write subtitles to file and return list of (sub_filename, final_sub_filename); or None if error'''
|
||||||
ret = []
|
ret = []
|
||||||
subtitles = info_dict.get('requested_subtitles')
|
subtitles = info_dict.get('requested_subtitles')
|
||||||
if not subtitles or not (self.params.get('writesubtitles') or self.params.get('writeautomaticsub')):
|
if not (self.params.get('writesubtitles') or self.params.get('writeautomaticsub')):
|
||||||
# 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
|
||||||
return ret
|
return ret
|
||||||
|
elif not subtitles:
|
||||||
|
self.to_screen('[info] There\'s no subtitles for the requested languages')
|
||||||
|
return ret
|
||||||
sub_filename_base = self.prepare_filename(info_dict, 'subtitle')
|
sub_filename_base = self.prepare_filename(info_dict, 'subtitle')
|
||||||
if not sub_filename_base:
|
if not sub_filename_base:
|
||||||
self.to_screen('[info] Skipping writing video subtitles')
|
self.to_screen('[info] Skipping writing video subtitles')
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
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'))
|
||||||
@ -4001,6 +4004,9 @@ def _write_thumbnails(self, label, info_dict, filename, thumb_filename_base=None
|
|||||||
thumbnails, ret = [], []
|
thumbnails, ret = [], []
|
||||||
if write_all or self.params.get('writethumbnail', False):
|
if write_all or self.params.get('writethumbnail', False):
|
||||||
thumbnails = info_dict.get('thumbnails') or []
|
thumbnails = info_dict.get('thumbnails') or []
|
||||||
|
if not thumbnails:
|
||||||
|
self.to_screen(f'[info] There\'s no {label} thumbnails to download')
|
||||||
|
return ret
|
||||||
multiple = write_all and len(thumbnails) > 1
|
multiple = write_all and len(thumbnails) > 1
|
||||||
|
|
||||||
if thumb_filename_base is None:
|
if thumb_filename_base is None:
|
||||||
|
Loading…
Reference in New Issue
Block a user