mirror of
https://github.com/wbt5/real-url.git
synced 2025-07-29 21:00:30 +08:00
新增六间房
This commit is contained in:
parent
b751bffd68
commit
a0c6bc4744
24
v6cn.py
Normal file
24
v6cn.py
Normal file
@ -0,0 +1,24 @@
|
||||
# 获取六间房直播的真实流媒体地址。
|
||||
|
||||
import requests
|
||||
import re
|
||||
|
||||
|
||||
def get_real_url(rid):
|
||||
try:
|
||||
response = requests.get('https://v.6.cn/' + str(rid)).text
|
||||
result = re.findall(r'"flvtitle":"v(\d*?)-(\d*?)"', response)[0]
|
||||
uid = result[0]
|
||||
flvtitle = 'v{}-{}'.format(*result)
|
||||
response = requests.get('https://rio.6rooms.com/live/?s=' + str(uid)).text
|
||||
hip = 'https://' + re.findall(r'<watchip>(.*\.xiu123\.cn).*</watchip>', response)[0]
|
||||
real_url = [hip + '/' + flvtitle + '/playlist.m3u8', hip + '/httpflv/' + flvtitle]
|
||||
except:
|
||||
real_url = '直播间不存在或未开播'
|
||||
return real_url
|
||||
|
||||
|
||||
rid = input('请输入六间房直播ID:\n')
|
||||
real_url = get_real_url(rid)
|
||||
print('该直播间源地址为:')
|
||||
print(real_url)
|
Loading…
x
Reference in New Issue
Block a user