mirror of
https://github.com/wbt5/real-url.git
synced 2025-06-17 00:09:58 +08:00
⚡ Improve NOW直播
-优化代码
This commit is contained in:
parent
ae088352a6
commit
73cfbc9125
4
now.py
4
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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user