fix: update maoerfm live record

This commit is contained in:
ihmily 2025-06-05 14:19:53 +08:00
parent c40a10235d
commit d37d9f25ad
2 changed files with 5 additions and 2 deletions

View File

@ -655,6 +655,7 @@ def start_record(url_data: tuple, count_variable: int = -1) -> None:
with semaphore:
port_info = asyncio.run(spider.get_maoerfm_stream_url(
url=record_url, proxy_addr=proxy_address, cookies=maoerfm_cookie))
video_save_type = 'mp3音频'
elif record_url.find("www.winktv.co.kr/") > -1:
platform = 'WinkTV'
@ -1293,7 +1294,7 @@ def start_record(url_data: tuple, count_variable: int = -1) -> None:
elif "音频" in video_save_type:
try:
now = time.strftime("%Y-%m-%d_%H-%M-%S", time.localtime())
extension = "mp3" if "MP3" in video_save_type else "m4a"
extension = "mp3" if "MP3" in video_save_type.upper() else "m4a"
name_format = "_%03d" if split_video_by_time else ""
save_file_path = (f"{full_path}/{anchor_name}_{title_in_name}{now}"
f"{name_format}.{extension}")

View File

@ -1117,6 +1117,8 @@ async def get_pandatv_stream_data(url: str, proxy_addr: OptionalStr = None, cook
json_str = await async_req('https://api.pandalive.co.kr/v1/member/bj',
proxy_addr=proxy_addr, headers=headers, data=data, abroad=True)
json_data = json.loads(json_str)
if "bjInfo" not in json_data:
raise RuntimeError(json_data.get("message", 'Unknown error'))
anchor_id = json_data['bjInfo']['id']
anchor_name = f"{json_data['bjInfo']['nick']}-{anchor_id}"
result['anchor_name'] = anchor_name
@ -1165,7 +1167,7 @@ async def get_maoerfm_stream_url(url: str, proxy_addr: OptionalStr = None, cooki
m3u8_url = stream_list['hls_pull_url']
flv_url = stream_list['flv_pull_url']
title = json_data['info']['room']['name']
result |= {'is_live': True, 'title': title, 'm3u8_url': m3u8_url, 'flv_url': flv_url, 'record_url': m3u8_url}
result |= {'is_live': True, 'title': title, 'm3u8_url': m3u8_url, 'flv_url': flv_url, 'record_url': flv_url}
return result