diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-10-26 20:17:29 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-10-26 20:27:09 +0530 |
commit | 0db3bae879d57ff400f8c61261534b6e3659c470 (patch) | |
tree | 2fbda9b3c42092857854dd08c5d931ce01f52b2d /yt_dlp/extractor/common.py | |
parent | 48f796874d78ad3d1849d0639893667f6cdf30d2 (diff) | |
download | hypervideo-pre-0db3bae879d57ff400f8c61261534b6e3659c470.tar.lz hypervideo-pre-0db3bae879d57ff400f8c61261534b6e3659c470.tar.xz hypervideo-pre-0db3bae879d57ff400f8c61261534b6e3659c470.zip |
[extractor] Fix some errors being converted to `ExtractorError`
Diffstat (limited to 'yt_dlp/extractor/common.py')
-rw-r--r-- | yt_dlp/extractor/common.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py index c0d714249..369cff418 100644 --- a/yt_dlp/extractor/common.py +++ b/yt_dlp/extractor/common.py @@ -74,6 +74,7 @@ from ..utils import ( strip_or_none, traverse_obj, unescapeHTML, + UnsupportedError, unified_strdate, unified_timestamp, update_Request, @@ -604,10 +605,19 @@ class InfoExtractor(object): if self.__maybe_fake_ip_and_retry(e.countries): continue raise + except UnsupportedError: + raise except ExtractorError as e: - video_id = e.video_id or self.get_temp_id(url) - raise ExtractorError( - e.msg, video_id=video_id, ie=self.IE_NAME, tb=e.traceback, expected=e.expected, cause=e.cause) + kwargs = { + 'video_id': e.video_id or self.get_temp_id(url), + 'ie': self.IE_NAME, + 'tb': e.traceback, + 'expected': e.expected, + 'cause': e.cause + } + if hasattr(e, 'countries'): + kwargs['countries'] = e.countries + raise type(e)(e.msg, **kwargs) except compat_http_client.IncompleteRead as e: raise ExtractorError('A network error has occurred.', cause=e, expected=True, video_id=self.get_temp_id(url)) except (KeyError, StopIteration) as e: |