[redbulltv] Fix cache retry system printing error multiple times

This commit is contained in:
Ganden Schaffner 2019-08-10 13:14:39 -07:00
parent 262b8aecd6
commit 88d61c8c14
No known key found for this signature in database
GPG Key ID: AAF2420F20D8B553

View File

@ -95,14 +95,15 @@ class RedBullTVIE(InfoExtractor):
webpage = self._download_webpage(url, video_id, note='Redownloading webpage')
# extract response cache
response_cache = json.loads(self._html_search_regex(r'<script type="application/json" id="response-cache">(.+?)</script>', webpage, 'response-cache'))
break
except RegexNotFoundError:
if i < tries - 1:
self.to_screen('Waiting before redownloading webpage')
time.sleep(2)
continue
else:
self.to_screen('Failed to download/locate response cache. Wait a few seconds and try running the command again.')
raise
break
# select the key that includes the string 'pageConfig'
metadata = json.loads(