mirror of
https://github.com/wbt5/real-url.git
synced 2025-08-02 23:55:46 +08:00
新增哔哩哔哩直播源
This commit is contained in:
parent
ab398d43ea
commit
b9dc370e96
@ -9,8 +9,12 @@ import re
|
|||||||
def get_real_rid(rid):
|
def get_real_rid(rid):
|
||||||
room_url = 'https://api.live.bilibili.com/room/v1/Room/room_init?id=' + str(rid)
|
room_url = 'https://api.live.bilibili.com/room/v1/Room/room_init?id=' + str(rid)
|
||||||
response = requests.get(url=room_url).json()
|
response = requests.get(url=room_url).json()
|
||||||
live_status = response.get('data').get('live_status')
|
data = response.get('data', 0)
|
||||||
room_id = response.get('data').get('room_id')
|
if data:
|
||||||
|
live_status = data.get('live_status', 0)
|
||||||
|
room_id = data.get('room_id', 0)
|
||||||
|
else:
|
||||||
|
live_status = room_id = 0
|
||||||
return live_status, room_id
|
return live_status, room_id
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user