add:comments
This commit is contained in:
parent
3fafbd7f0e
commit
c2d932b75a
6
main.py
6
main.py
@ -50,8 +50,10 @@ class BiliWebCrawler:
|
|||||||
self.bvid = self._extract_bvid()
|
self.bvid = self._extract_bvid()
|
||||||
self.user_agent = UserAgent()
|
self.user_agent = UserAgent()
|
||||||
self.headers = {
|
self.headers = {
|
||||||
'User-Agent': self.user_agent.random,
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
|
||||||
'Referer': 'https://www.bilibili.com/',
|
'Referer': f'https://www.bilibili.com/video/{self.bvid}',
|
||||||
|
'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8',
|
||||||
|
'Accept-Encoding': 'gzip, deflate, br'
|
||||||
}
|
}
|
||||||
if cookie:
|
if cookie:
|
||||||
self.headers['Cookie'] = cookie
|
self.headers['Cookie'] = cookie
|
||||||
|
Loading…
x
Reference in New Issue
Block a user