mirror of
https://github.com/soimort/you-get.git
synced 2025-02-11 12:42:29 +03:00
hunantv avoid http 403
just add retry when return URL not start with pcfastvideo
This commit is contained in:
parent
544f259f93
commit
a19e21a7d0
@ -61,10 +61,14 @@ class Hunantv(VideoExtractor):
|
||||
|
||||
for lstream in self.lstreams:
|
||||
if stream_id == lstream['name']:
|
||||
rn = randint(0, 99999999)
|
||||
meta = json.loads(get_html("{}&random={}".format((lstream['url']),rn)))
|
||||
if meta['status'] == 'ok':
|
||||
self.streams[stream_id]['src'] = [meta['info']]
|
||||
meta = ''
|
||||
while True:
|
||||
rn = randint(0, 99999999)
|
||||
meta = json.loads(get_html("{}&random={}".format((lstream['url']),rn)))
|
||||
if meta['status'] == 'ok':
|
||||
if meta['info'].startswith('http://pcfastvideo.imgo.tv/'):
|
||||
break
|
||||
self.streams[stream_id]['src'] = [meta['info']]
|
||||
|
||||
site = Hunantv()
|
||||
download = site.download_by_url
|
||||
|
Loading…
Reference in New Issue
Block a user