mirror of
https://github.com/xfgryujk/blivechat.git
synced 2025-01-13 13:50:10 +08:00
添加cookie提高获取头像成功率
This commit is contained in:
parent
062e7ed1aa
commit
1f89d0d1cf
@ -312,6 +312,7 @@ class RoomInfoHandler(api.base.ApiHandler): # noqa
|
|||||||
'Origin': 'https://live.bilibili.com',
|
'Origin': 'https://live.bilibili.com',
|
||||||
'Referer': f'https://live.bilibili.com/{room_id}'
|
'Referer': f'https://live.bilibili.com/{room_id}'
|
||||||
},
|
},
|
||||||
|
cookies=utils.request.BILIBILI_COMMON_COOKIES,
|
||||||
params={
|
params={
|
||||||
'room_id': room_id
|
'room_id': room_id
|
||||||
}
|
}
|
||||||
|
@ -154,6 +154,7 @@ async def _do_get_avatar_url_from_web(user_id):
|
|||||||
'Origin': 'https://space.bilibili.com',
|
'Origin': 'https://space.bilibili.com',
|
||||||
'Referer': f'https://space.bilibili.com/{user_id}/'
|
'Referer': f'https://space.bilibili.com/{user_id}/'
|
||||||
},
|
},
|
||||||
|
cookies=utils.request.BILIBILI_COMMON_COOKIES,
|
||||||
params={
|
params={
|
||||||
'mid': user_id,
|
'mid': user_id,
|
||||||
'token': '',
|
'token': '',
|
||||||
|
@ -14,5 +14,9 @@ BILIBILI_COMMON_HEADERS = {
|
|||||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)'
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)'
|
||||||
' Chrome/105.0.0.0 Safari/537.36'
|
' Chrome/105.0.0.0 Safari/537.36'
|
||||||
}
|
}
|
||||||
|
BILIBILI_COMMON_COOKIES = {
|
||||||
|
'b_lsid': '639B17D4_9876590D28',
|
||||||
|
'_uuid': '883B5256-A359-E4A3-7159-123456794937E96237infoc'
|
||||||
|
}
|
||||||
|
|
||||||
http_session = aiohttp.ClientSession(timeout=aiohttp.ClientTimeout(total=10))
|
http_session = aiohttp.ClientSession(timeout=aiohttp.ClientTimeout(total=10))
|
||||||
|
Loading…
Reference in New Issue
Block a user