From 17a351e80be84d46b7b1d9b04cff8b9c856427a8 Mon Sep 17 00:00:00 2001 From: jemygraw Date: Tue, 14 Nov 2017 11:48:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=86=8A=E7=8C=AB=E7=9A=84?= =?UTF-8?q?=E5=BC=B9=E5=B9=95=E5=A4=B1=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- danmu/Panda.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/danmu/Panda.py b/danmu/Panda.py index be0c27c..fc58885 100644 --- a/danmu/Panda.py +++ b/danmu/Panda.py @@ -29,15 +29,12 @@ def _get_live_status(self): return j['videoinfo']['status'] == '2' def _prepare_env(self): roomId = self.url.split('/')[-1] or self.url.split('/')[-2] - url = 'http://www.panda.tv/ajax_chatroom?roomid=%s&_=%s'%(roomId, str(int(time.time()))) - roomInfo = requests.get(url).json() - url = 'http://api.homer.panda.tv/chatroom/getinfo' + url = 'http://riven.panda.tv/chatroom/getinfo' params = { - 'rid': roomInfo['data']['rid'], + 'app': 1, + 'protocol': 'ws', 'roomid': roomId, - 'retry': 0, - 'sign': roomInfo['data']['sign'], - 'ts': roomInfo['data']['ts'], + '_caller': 'panda-pc_web', '_': int(time.time()), } serverInfo = requests.get(url, params).json()['data'] serverAddress = serverInfo['chat_addr_list'][0].split(':')