mirror of
https://github.com/ihmily/DouyinLiveRecorder.git
synced 2025-12-25 21:36:46 +08:00
fix: update bilibili live room data fetch
This commit is contained in:
parent
57739410f8
commit
d860023808
2
main.py
2
main.py
@ -513,7 +513,7 @@ def start_record(url_data: tuple, count_variable: int = -1) -> None:
|
||||
if record_url.find("douyin.com/") > -1:
|
||||
platform = '抖音直播'
|
||||
with semaphore:
|
||||
if 'v.douyin.com' not in record_url:
|
||||
if 'v.douyin.com' not in record_url and '/user/' not in record_url:
|
||||
json_data = asyncio.run(spider.get_douyin_stream_data(
|
||||
url=record_url,
|
||||
proxy_addr=proxy_address,
|
||||
|
||||
@ -576,12 +576,15 @@ async def get_yy_stream_data(url: str, proxy_addr: OptionalStr = None, cookies:
|
||||
@trace_error_decorator
|
||||
async def get_bilibili_room_info_h5(url: str, proxy_addr: OptionalStr = None, cookies: OptionalStr = None) -> str:
|
||||
headers = {
|
||||
'user-agent': 'Mozilla/5.0 (Linux; Android 11; SAMSUNG SM-G973U) AppleWebKit/537.36 (KHTML, like Gecko) '
|
||||
'SamsungBrowser/14.2 Chrome/87.0.4280.141 Mobile Safari/537.36',
|
||||
'accept-language': 'zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2',
|
||||
'cookie': '',
|
||||
'origin': 'https://live.bilibili.com',
|
||||
'referer': 'https://live.bilibili.com/',
|
||||
'user-agent': 'Mozilla/5.0 (Linux; Android 8.0.0; SM-G955U Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Mobile Safari/537.36 Edg/121.0.0.0',
|
||||
'referer': 'https://live.bilibili.com/26066074',
|
||||
}
|
||||
if cookies:
|
||||
headers['Cookie'] = cookies
|
||||
headers['cookie'] = cookies
|
||||
|
||||
room_id = url.split('?')[0].rsplit('/', maxsplit=1)[1]
|
||||
api = f'https://api.live.bilibili.com/xlive/web-room/v1/index/getH5InfoByRoom?room_id={room_id}'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user