1
0
mirror of https://github.com/wbt5/real-url.git synced 2025-08-02 23:55:46 +08:00

新增映客直播

This commit is contained in:
wbt5 2019-11-18 17:13:37 +08:00
parent 9d59d21a80
commit abafcc309e

25
yingke.py Normal file
View File

@ -0,0 +1,25 @@
# 获取映客直播的真实流媒体地址。
import requests
def get_real_url(rid):
try:
room_url = 'https://webapi.busi.inke.cn/web/live_share_pc?uid=' + str(rid)
response = requests.get(url=room_url).json()
record_url = response.get('data').get('file').get('record_url')
stream_addr = response.get('data').get('live_addr')
real_url = {
'record_url': record_url,
'stream_addr': stream_addr
}
except:
real_url = '直播间不存在或未开播'
return real_url
rid = input('请输入映客直播间uid\n')
real_url = get_real_url(rid)
print('该直播源地址为:')
print(real_url)