mirror of
https://github.com/wbt5/real-url.git
synced 2025-07-26 10:30:32 +08:00
新增酷狗直播
This commit is contained in:
parent
fad4028a1b
commit
e0ccf6029b
18
kugou.py
Normal file
18
kugou.py
Normal file
@ -0,0 +1,18 @@
|
||||
# 获取酷狗繁星直播的真实流媒体地址,默认最高码率。
|
||||
|
||||
import requests
|
||||
|
||||
|
||||
def get_real_url(rid):
|
||||
try:
|
||||
response = requests.get('https://fx1.service.kugou.com/video/pc/live/pull/v3/streamaddr?roomId={}&ch=fx&version=1.0&streamType=1-2-5&platform=7&ua=fx-flash&kugouId=0&layout=1'.format(rid)).json()
|
||||
real_url = response.get('data').get('horizontal')[0].get('httpflv')
|
||||
except:
|
||||
real_url = '直播间不存在或未开播'
|
||||
return real_url
|
||||
|
||||
|
||||
rid = input('请输入龙珠直播房间号:\n')
|
||||
real_url = get_real_url(rid)
|
||||
print('该直播间源地址为:')
|
||||
print(real_url)
|
Loading…
x
Reference in New Issue
Block a user