aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2022-03-23 08:26:36 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2022-03-23 08:53:16 +0530
commitc70c418d33cb6b840f27f03ec020577bc86203c0 (patch)
tree4681118d898a4fb90d5adea38f75c1decf3ec72a
parentb9c7b1e9b449e93e252d1001f4f8d892b9c2be4d (diff)
downloadhypervideo-pre-c70c418d33cb6b840f27f03ec020577bc86203c0.tar.lz
hypervideo-pre-c70c418d33cb6b840f27f03ec020577bc86203c0.tar.xz
hypervideo-pre-c70c418d33cb6b840f27f03ec020577bc86203c0.zip
Fix `--abort-on-error` for subtitles
Closes #3163
-rw-r--r--yt_dlp/YoutubeDL.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py
index d075a82bc..80c7944f3 100644
--- a/yt_dlp/YoutubeDL.py
+++ b/yt_dlp/YoutubeDL.py
@@ -3859,9 +3859,12 @@ class YoutubeDL(object):
sub_info['filepath'] = sub_filename
ret.append((sub_filename, sub_filename_final))
except (DownloadError, ExtractorError, IOError, OSError, ValueError) + network_exceptions as err:
+ msg = f'Unable to download video subtitles for {sub_lang!r}: {err}'
if self.params.get('ignoreerrors') is not True: # False or 'only_download'
- raise DownloadError(f'Unable to download video subtitles for {sub_lang!r}: {err}', err)
- self.report_warning(f'Unable to download video subtitles for {sub_lang!r}: {err}')
+ if not self.params.get('ignoreerrors'):
+ self.report_error(msg)
+ raise DownloadError(msg)
+ self.report_warning(msg)
return ret
def _write_thumbnails(self, label, info_dict, filename, thumb_filename_base=None):