mirror of
https://github.com/wbt5/real-url.git
synced 2025-07-31 13:44:48 +08:00
新增热猫直播
This commit is contained in:
parent
63c21e9e3f
commit
fe32942cdb
23
yuanbobo.py
Normal file
23
yuanbobo.py
Normal file
@ -0,0 +1,23 @@
|
||||
# 热猫直播:https://zhibo.yuanbobo.com/
|
||||
import requests
|
||||
import re
|
||||
|
||||
|
||||
def yuanbobo(rid):
|
||||
with requests.Session() as s:
|
||||
res = s.get('https://zhibo.yuanbobo.com/' + str(rid)).text
|
||||
stream_id = re.search(r"stream_id:\s+'(\d+)'", res)
|
||||
if stream_id:
|
||||
status = re.search(r"status:\s+'(\d)'", res).group(1)
|
||||
if status == '1':
|
||||
real_url = 'http://ks-hlslive.yuanbobo.com/live/{}/index.m3u8'.format(stream_id.group(1))
|
||||
return real_url
|
||||
else:
|
||||
raise Exception('未开播')
|
||||
else:
|
||||
raise Exception('直播间不存在')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
r = input('输入热猫直播房间号:\n')
|
||||
print(yuanbobo(r))
|
Loading…
x
Reference in New Issue
Block a user