From c0018d0fb1fd497f869100ed6ea24c14c0417344 Mon Sep 17 00:00:00 2001 From: wbt5 Date: Sun, 21 Nov 2021 01:56:50 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20Fix=20=E8=89=BE=E7=B1=B3=E7=9B=B4?= =?UTF-8?q?=E6=92=AD=20-=E6=9B=B4=E6=96=B0=E6=AD=A3=E5=88=99=E4=BB=A5?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE=E8=8E=B7=E5=8F=96room=5Fid=20-=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- imifun.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/imifun.py b/imifun.py index 351cb3f..5f1e89a 100644 --- a/imifun.py +++ b/imifun.py @@ -11,12 +11,12 @@ class IMFun: def get_real_url(self): with requests.Session() as s: - res = s.get('https://www.imifun.com/' + str(self.rid)).text - roomid = re.search(r"roomId:\s'([\w-]+)'", res) + res = s.get(f'https://www.imifun.com/{self.rid}').text + roomid = re.search(r'mixPkPlayUrl ="rtmp://wsmd.happyia.com/ivp/(\d+-\d+)"', res).group(1) if roomid: status = re.search(r"isLive:(\d),", res).group(1) if status == '1': - real_url = 'https://wsmd.happyia.com/ivp/{}.flv'.format(roomid.group(1)) + real_url = f'https://wsmd.happyia.com/ivp/{roomid}.flv' return real_url else: raise Exception('未开播')