mirror of
https://github.com/wbt5/real-url.git
synced 2025-06-17 00:09:58 +08:00
🐛 Fix 乐嗨直播
-修正请求地址
This commit is contained in:
parent
8ee49c50a0
commit
e6bfbb58e2
7
lehai.py
7
lehai.py
@ -13,7 +13,7 @@ class LeHai:
|
|||||||
self.rid = rid
|
self.rid = rid
|
||||||
|
|
||||||
def get_real_url(self):
|
def get_real_url(self):
|
||||||
url = 'https://service.lehaitv.com/v2/room/{}/enter'.format(self.rid)
|
url = f'https://service.lehaitv.com/v2/room/{self.rid}/media/advanceInfoRoom'
|
||||||
params = {
|
params = {
|
||||||
'_st1': int(time.time() * 1e3),
|
'_st1': int(time.time() * 1e3),
|
||||||
'accessToken': 's7FUbTJ%2BjILrR7kicJUg8qr025ZVjd07DAnUQd8c7g%2Fo4OH9pdSX6w%3D%3D',
|
'accessToken': 's7FUbTJ%2BjILrR7kicJUg8qr025ZVjd07DAnUQd8c7g%2Fo4OH9pdSX6w%3D%3D',
|
||||||
@ -29,9 +29,8 @@ class LeHai:
|
|||||||
res = res.json()
|
res = res.json()
|
||||||
statuscode = res['status']['statuscode']
|
statuscode = res['status']['statuscode']
|
||||||
if statuscode == '0':
|
if statuscode == '0':
|
||||||
if res['data']['live_status'] == '1':
|
if res['data']['live_status'] == 1:
|
||||||
anchor, = res['data']['anchor']
|
real_url = res['data']['medial_url_app_for_h264']
|
||||||
real_url = anchor['media_url']
|
|
||||||
return real_url
|
return real_url
|
||||||
else:
|
else:
|
||||||
raise Exception('未开播')
|
raise Exception('未开播')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user