diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-01-03 17:41:27 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-01-03 19:40:06 +0530 |
commit | 6020e05d23ad451fff20b354c1c89c748ff27051 (patch) | |
tree | fed197f06baac0c6f51fea2ef6d048bc9daffd5b | |
parent | ebed8b373214316fce489fe21629fcef91bb9af3 (diff) | |
download | hypervideo-pre-6020e05d23ad451fff20b354c1c89c748ff27051.tar.lz hypervideo-pre-6020e05d23ad451fff20b354c1c89c748ff27051.tar.xz hypervideo-pre-6020e05d23ad451fff20b354c1c89c748ff27051.zip |
Raise error if subtitle download fails
Closes #2212
-rw-r--r-- | yt_dlp/YoutubeDL.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py index 57c56f882..d027e342e 100644 --- a/yt_dlp/YoutubeDL.py +++ b/yt_dlp/YoutubeDL.py @@ -3746,9 +3746,10 @@ class YoutubeDL(object): self.dl(sub_filename, sub_copy, subtitle=True) sub_info['filepath'] = sub_filename ret.append((sub_filename, sub_filename_final)) - except (ExtractorError, IOError, OSError, ValueError) + network_exceptions as err: + except (DownloadError, ExtractorError, IOError, OSError, ValueError) + network_exceptions as 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}') - continue return ret def _write_thumbnails(self, label, info_dict, filename, thumb_filename_base=None): |