1
0
mirror of https://github.com/wbt5/real-url.git synced 2025-12-16 23:10:29 +08:00
zhibo-url/qf.py
2020-05-30 20:17:18 +08:00

22 lines
565 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.

# 获取56千帆直播的真实流媒体地址。
# 千帆直播直播间链接形式https://qf.56.com/520686
import requests
import re
def get_real_url(rid):
try:
response = requests.post(url='https://qf.56.com/' + rid).text
real_url = re.findall(r"flvUrl:'(.*)\?wsSecret", response)
real_url = real_url[0]
except:
real_url = '该直播间不存在或未开播'
return real_url
rid = input('请输入千帆直播房间号:\n')
real_url = get_real_url(rid)
print('该直播间源地址为:')
print(real_url)