mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-14 15:22:35 +00:00
[extractor/amazonstore] Retry to avoid captcha page (#4811)
Authored by: Lesmiscore
This commit is contained in:
parent
d6f8871964
commit
3c7a276234
1 changed files with 9 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..utils import int_or_none
|
from ..utils import ExtractorError, int_or_none
|
||||||
|
|
||||||
|
|
||||||
class AmazonStoreIE(InfoExtractor):
|
class AmazonStoreIE(InfoExtractor):
|
||||||
|
@ -38,8 +38,14 @@ class AmazonStoreIE(InfoExtractor):
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
id = self._match_id(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 = [{
|
entries = [{
|
||||||
'id': video['marketPlaceID'],
|
'id': video['marketPlaceID'],
|
||||||
'url': video['url'],
|
'url': video['url'],
|
||||||
|
|
Loading…
Reference in a new issue