mirror of
https://github.com/wbt5/real-url.git
synced 2025-07-28 12:15:52 +08:00
Fix huya
This commit is contained in:
parent
e3703f1422
commit
533ca84268
4
huya.py
4
huya.py
@ -23,7 +23,7 @@ class HuYa:
|
|||||||
'(KHTML, like Gecko) Chrome/75.0.3770.100 Mobile Safari/537.36 '
|
'(KHTML, like Gecko) Chrome/75.0.3770.100 Mobile Safari/537.36 '
|
||||||
}
|
}
|
||||||
response = requests.get(url=room_url, headers=header).text
|
response = requests.get(url=room_url, headers=header).text
|
||||||
livelineurl = re.findall(r'liveLineUrl = "([\s\S]*?)";', response)[0]
|
livelineurl = re.findall(r'"liveLineUrl":"([\s\S]*?)"', response)[0]
|
||||||
livelineurl = base64.b64decode(livelineurl).decode('utf-8')
|
livelineurl = base64.b64decode(livelineurl).decode('utf-8')
|
||||||
if livelineurl:
|
if livelineurl:
|
||||||
if 'replay' in livelineurl:
|
if 'replay' in livelineurl:
|
||||||
@ -32,7 +32,7 @@ class HuYa:
|
|||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
stream_name = self.get_stream_name(livelineurl)
|
stream_name = self.get_stream_name(livelineurl)
|
||||||
base_url = 'http://121.12.115.15/tx.hls.huya.com/src/' + stream_name
|
base_url = 'http://121.12.115.26/tx.hls.huya.com/src/' + stream_name
|
||||||
real_url = {
|
real_url = {
|
||||||
'hls': base_url + '.m3u8',
|
'hls': base_url + '.m3u8',
|
||||||
'flv': base_url + '.flv',
|
'flv': base_url + '.flv',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user