From 8ca48a1a5427040fd708f33a264c10d5d0e85fc1 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Thu, 22 Sep 2022 01:53:37 +0530 Subject: [PATCH] [extractor] Fix `fatal=False` in `RetryManager` --- yt_dlp/extractor/amazon.py | 2 +- yt_dlp/extractor/common.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/yt_dlp/extractor/amazon.py b/yt_dlp/extractor/amazon.py index 56a8d844a..9e9e9772d 100644 --- a/yt_dlp/extractor/amazon.py +++ b/yt_dlp/extractor/amazon.py @@ -39,7 +39,7 @@ class AmazonStoreIE(InfoExtractor): def _real_extract(self, url): id = self._match_id(url) - for retry in self.RetryManager(fatal=True): + for retry in self.RetryManager(): webpage = self._download_webpage(url, id) try: data_json = self._parse_json(self._html_search_regex(r'var\s?obj\s?=\s?jQuery\.parseJSON\(\'(.*)\'\)', webpage, 'data'), id) diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py index e8fa8fdde..4132c831c 100644 --- a/yt_dlp/extractor/common.py +++ b/yt_dlp/extractor/common.py @@ -3857,8 +3857,10 @@ class InfoExtractor: return True def _error_or_warning(self, err, _count=None, _retries=0, *, fatal=True): - RetryManager.report_retry(err, _count or int(fatal), _retries, info=self.to_screen, warn=self.report_warning, - sleep_func=self.get_param('retry_sleep_functions', {}).get('extractor')) + RetryManager.report_retry( + err, _count or int(fatal), _retries, + info=self.to_screen, warn=self.report_warning, error=None if fatal else self.report_warning, + sleep_func=self.get_param('retry_sleep_functions', {}).get('extractor')) def RetryManager(self, **kwargs): return RetryManager(self.get_param('extractor_retries', 3), self._error_or_warning, **kwargs)