diff options
author | dirkf <fieldhouse@gmx.net> | 2022-02-01 23:22:57 +0000 |
---|---|---|
committer | dirkf <fieldhouse@gmx.net> | 2022-02-02 14:25:03 +0000 |
commit | 41f0043983c831b7c0c3614340d2f66ec153087b (patch) | |
tree | 19227da31add4fbbfa2b17dc60a276bfad12676d /youtube_dl/extractor | |
parent | 34c06b16f5eb814308392b68dce07bbff62bc406 (diff) | |
download | youtube-dl-41f0043983c831b7c0c3614340d2f66ec153087b.tar.xz |
Avoid crashing if n-sig decode fails
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r-- | youtube_dl/extractor/youtube.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py index 05688dc70..4165de15c 100644 --- a/youtube_dl/extractor/youtube.py +++ b/youtube_dl/extractor/youtube.py @@ -26,6 +26,7 @@ from ..utils import ( ExtractorError, clean_html, dict_get, + error_to_compat_str, float_or_none, int_or_none, js_to_json, @@ -1463,7 +1464,12 @@ class YoutubeIE(YoutubeBaseInfoExtractor): self._downloader.to_screen('[debug] [%s] %s' % (self.IE_NAME, 'Decrypted nsig {0} => {1}'.format(n_param, self._player_cache[sig_id]))) return self._player_cache[sig_id] except Exception as e: - raise ExtractorError(traceback.format_exc(), cause=e, video_id=video_id) + self._downloader.report_warning( + '[%s] %s (%s %s)' % ( + self.IE_NAME, + 'Unable to decode n-parameter: download likely to be throttled', + error_to_compat_str(e), + traceback.format_exc())) def _unthrottle_format_urls(self, video_id, player_url, formats): for fmt in formats: |