1
0
mirror of https://github.com/wbt5/real-url.git synced 2025-12-17 07:20:27 +08:00
zhibo-url/wali.py
2020-07-31 19:37:43 +08:00

20 lines
541 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.

# 小米直播https://live.wali.com/fe
import requests
def wali(rid):
zuid = rid.split('_')[0]
with requests.Session() as s:
res = s.get('https://s.zb.mi.com/get_liveinfo?lid={}&zuid={}'.format(rid, zuid)).json()
status = res['data']['status']
if status == 1:
flv = res['data']['video']['flv']
return flv.replace('http', 'https')
else:
raise Exception('直播间不存在或未开播')
if __name__ == '__main__':
r = input('输入小米直播房间号:\n')
print(wali(r))