1
0
mirror of https://github.com/wbt5/real-url.git synced 2025-12-16 23:10:29 +08:00
zhibo-url/zhanqi.py
2019-11-16 13:09:04 +08:00

25 lines
690 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 获取战旗直播战旗TV的真实流媒体地址。
# 默认画质为超清
import requests
def get_real_url(rid):
room_url = 'https://m.zhanqi.tv/api/static/v2.1/room/domain/' + str(rid) + '.json'
try:
response = requests.get(url=room_url).json()
videoId = response.get('data').get('videoId')
if videoId:
real_url = 'https://dlhdl-cdn.zhanqi.tv/zqlive/' + str(videoId) + '.flv'
else:
real_url = '未开播'
except:
real_url = '直播间不存在'
return real_url
rid = input('请输入战旗直播房间号:\n')
real_url = get_real_url(rid)
print('该直播间源地址为:\n' + real_url)