From ec0fc331170cf09599455fb76947dce147152de7 Mon Sep 17 00:00:00 2001 From: senaps Date: Fri, 24 Jul 2020 06:09:47 +0430 Subject: [PATCH 1/2] [executor/common] fixed load json error, (closes #23159) --- youtube_dl/extractor/common.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py index a61753b17..9edb0f915 100644 --- a/youtube_dl/extractor/common.py +++ b/youtube_dl/extractor/common.py @@ -903,6 +903,12 @@ class InfoExtractor(object): raise ExtractorError(errmsg, cause=ve) else: self.report_warning(errmsg + str(ve)) + except TypeError as ve: + errmsg = '%s: Failed to download due to geo location restrictions' % video_id + if fatal: + raise ExtractorErro(errmsg, cause=ve) + else: + self.report_warning(errmsg + str(ve)) def report_warning(self, msg, video_id=None): idstr = '' if video_id is None else '%s: ' % video_id From 72c9753d18c1d3a01d73f4373cd270465987980b Mon Sep 17 00:00:00 2001 From: senaps Date: Fri, 24 Jul 2020 06:24:49 +0430 Subject: [PATCH 2/2] Fixed flake 8 error --- youtube_dl/extractor/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py index 9edb0f915..9dce06c44 100644 --- a/youtube_dl/extractor/common.py +++ b/youtube_dl/extractor/common.py @@ -906,7 +906,7 @@ class InfoExtractor(object): except TypeError as ve: errmsg = '%s: Failed to download due to geo location restrictions' % video_id if fatal: - raise ExtractorErro(errmsg, cause=ve) + raise ExtractorError(errmsg, cause=ve) else: self.report_warning(errmsg + str(ve))