From 73cfbc9125b1d77cb63ab0d54ae8e58f0967e20e Mon Sep 17 00:00:00 2001 From: wbt5 Date: Sun, 21 Nov 2021 15:42:41 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20Improve=20NOW=E7=9B=B4=E6=92=AD=20-?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- now.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/now.py b/now.py index 288d202..36be250 100644 --- a/now.py +++ b/now.py @@ -10,7 +10,7 @@ class Now: def get_real_url(self): try: - room_url = 'https://now.qq.com/cgi-bin/now/web/room/get_live_room_url?room_id={}&platform=8'.format(self.rid) + room_url = f'https://now.qq.com/cgi-bin/now/web/room/get_live_room_url?room_id={self.rid}&platform=8' response = requests.get(url=room_url).json() result = response.get('result') real_url = { @@ -18,7 +18,7 @@ class Now: 'raw_rtmp_url': result.get('raw_rtmp_url', 0), 'raw_flv_url': result.get('raw_flv_url', 0) } - except: + except Exception: raise Exception('直播间不存在或未开播') return real_url