fix: update bilibili request headers

This commit is contained in:
ihmily 2024-06-22 15:02:19 +08:00
parent c24fb010ff
commit 542bad6729
2 changed files with 3 additions and 4 deletions

View File

@ -6,7 +6,7 @@
是否使用代理ip是/否) =
代理地址 =
同一时间访问网络的线程数 = 3
循环时间(秒) = 120
循环时间(秒) = 300
排队读取网址时间(秒) = 0
是否显示循环秒数 =
是否显示直播源地址 =

View File

@ -521,10 +521,9 @@ def get_yy_stream_data(url: str, proxy_addr: Union[str, None] = None, cookies: U
def get_bilibili_stream_data(url: str, proxy_addr: Union[str, None] = None, cookies: Union[str, None] = None) -> \
Dict[str, Any]:
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:127.0) Gecko/20100101 Firefox/127.0',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8',
'Referer': 'https://live.bilibili.com/?spm_id_from=333.1296.0.0',
'Cookie': "bilibili.com"
'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',
}
if cookies:
headers['Cookie'] = cookies