some small fixes

This commit is contained in:
Valdemar Erk 2017-01-04 12:28:21 +01:00
parent 8880d3a85c
commit ed8d9140c2

View File

@ -9,7 +9,6 @@ import time
def panda_download(url, output_dir = '.', merge = True, info_only = False, **kwargs): def panda_download(url, output_dir = '.', merge = True, info_only = False, **kwargs):
roomid = url[url.rfind('/')+1:] roomid = url[url.rfind('/')+1:]
json_request_url = 'http://www.panda.tv/api_room?roomid={}&pub_key=&_={}'.format(roomid, int(time.time())) json_request_url = 'http://www.panda.tv/api_room?roomid={}&pub_key=&_={}'.format(roomid, int(time.time()))
print(json_request_url)
content = get_html(json_request_url) content = get_html(json_request_url)
errno = json.loads(content)['errno'] errno = json.loads(content)['errno']
errmsg = json.loads(content)['errmsg'] errmsg = json.loads(content)['errmsg']
@ -24,7 +23,6 @@ def panda_download(url, output_dir = '.', merge = True, info_only = False, **kwa
if data.get("roominfo")["banned_reason"]: if data.get("roominfo")["banned_reason"]:
data2 = json.loads(data['videoinfo']['plflag_list']) data2 = json.loads(data['videoinfo']['plflag_list'])
plflag = data2["backup"][0].split('_') plflag = data2["backup"][0].split('_')
print(plflag)
if status is not "2": if status is not "2":
raise ValueError("The live stream is not online! (status:%s)" % status) 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) real_url = 'http://pl{}.live.panda.tv/live_panda/{}.flv'.format(plflag[1],room_key)