aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLesmiscore <nao20010128@gmail.com>2022-09-02 15:51:12 +0900
committerGitHub <noreply@github.com>2022-09-02 15:51:12 +0900
commit3c7a2762343280d0e749acffd0edcf72fa4d0661 (patch)
tree8cbcbc7cfa252ba53c86f55a36d7c4ab4b80c2ff
parentd6f8871964253373ddaae60c89f1f4838769e7df (diff)
downloadhypervideo-pre-3c7a2762343280d0e749acffd0edcf72fa4d0661.tar.lz
hypervideo-pre-3c7a2762343280d0e749acffd0edcf72fa4d0661.tar.xz
hypervideo-pre-3c7a2762343280d0e749acffd0edcf72fa4d0661.zip
[extractor/amazonstore] Retry to avoid captcha page (#4811)
Authored by: Lesmiscore
-rw-r--r--yt_dlp/extractor/amazon.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/yt_dlp/extractor/amazon.py b/yt_dlp/extractor/amazon.py
index de4917adc..56a8d844a 100644
--- a/yt_dlp/extractor/amazon.py
+++ b/yt_dlp/extractor/amazon.py
@@ -1,5 +1,5 @@
from .common import InfoExtractor
-from ..utils import int_or_none
+from ..utils import ExtractorError, int_or_none
class AmazonStoreIE(InfoExtractor):
@@ -38,8 +38,14 @@ class AmazonStoreIE(InfoExtractor):
def _real_extract(self, url):
id = self._match_id(url)
- webpage = self._download_webpage(url, id)
- data_json = self._parse_json(self._html_search_regex(r'var\s?obj\s?=\s?jQuery\.parseJSON\(\'(.*)\'\)', webpage, 'data'), id)
+
+ for retry in self.RetryManager(fatal=True):
+ 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)
+ except ExtractorError as e:
+ retry.error = e
+
entries = [{
'id': video['marketPlaceID'],
'url': video['url'],