fix: update liveme room id match (#1192)

This commit is contained in:
Hmily 2025-08-27 18:10:28 +08:00 committed by GitHub
parent a328c6a1c5
commit 63787f1743
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2061,6 +2061,12 @@ async def get_liveme_stream_url(url: str, proxy_addr: OptionalStr = None, cookie
if cookies:
headers['Cookie'] = cookies
html_str = await async_req(url, proxy_addr=proxy_addr, headers=headers, abroad=True)
if 'index.html' not in url:
match_url = re.search('<meta property="og:url" content="(.*?)">', html_str)
if match_url:
url = match_url.group(1)
room_id = url.split("/index.html")[0].rsplit('/', maxsplit=1)[-1]
sign_data = execjs.compile(open(f'{JS_SCRIPT_PATH}/liveme.js').read()).call('sign', room_id,
f'{JS_SCRIPT_PATH}/crypto-js.min.js')
@ -3232,4 +3238,4 @@ async def get_picarto_stream_url(url: str, proxy_addr: OptionalStr = None, cooki
title = json_data['channel']['title']
m3u8_url = f"https://1-edge1-us-newyork.picarto.tv/stream/hls/golive+{anchor_name}/index.m3u8"
result |= {'is_live': True, 'title': title, 'm3u8_url': m3u8_url, 'record_url': m3u8_url}
return result
return result