1
0
mirror of https://github.com/wbt5/real-url.git synced 2025-06-16 15:59:57 +08:00

🐛 Fix 热猫直播

-修复播放地址host
-优化代码
This commit is contained in:
wbt5 2021-11-20 21:51:04 +08:00
parent 5f429990e4
commit 7a0320b762
No known key found for this signature in database
GPG Key ID: 92D5C42E815A2BD6

View File

@ -10,12 +10,12 @@ class YuanBoBo:
def get_real_url(self):
with requests.Session() as s:
res = s.get('https://zhibo.yuanbobo.com/' + str(self.rid)).text
res = s.get(f'https://zhibo.yuanbobo.com/{self.rid}').text
stream_id = re.search(r"stream_id:\s+'(\d+)'", res)
if stream_id:
status = re.search(r"status:\s+'(\d)'", res).group(1)
if status == '1':
real_url = 'http://ks-hlslive.yuanbobo.com/live/{}/index.m3u8'.format(stream_id.group(1))
real_url = f'https://tliveplay.yuanbobo.com/live/{stream_id.group(1)}.m3u8'
return real_url
else:
raise Exception('未开播')