diff --git a/src/you_get/extractors/panda.py b/src/you_get/extractors/panda.py index fb2ee0c3..475b93fb 100644 --- a/src/you_get/extractors/panda.py +++ b/src/you_get/extractors/panda.py @@ -25,7 +25,7 @@ def panda_download(url, output_dir = '.', merge = True, info_only = False, **kwa raise ValueError("The live stream is not online! (status:%s)" % status) real_url = 'http://pl{}.live.panda.tv/live_panda/{}.flv'.format(plflag[1],room_key) counter = 0 - while (requests.head(real_url, allow_redirects=True).status_code == 403): + while (requests.head(real_url, allow_redirects=True).status_code == 403 and counter < len(data2["backup"])): data2 = json.loads(data['videoinfo']['plflag_list']) plflag = data2["backup"][counter].split('_') counter = counter + 1