add:comments

This commit is contained in:
Sheyiyuan 2025-03-24 09:28:43 +08:00
parent 3fafbd7f0e
commit c2d932b75a

View File

@ -50,8 +50,10 @@ class BiliWebCrawler:
self.bvid = self._extract_bvid()
self.user_agent = UserAgent()
self.headers = {
'User-Agent': self.user_agent.random,
'Referer': 'https://www.bilibili.com/',
'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': 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:
self.headers['Cookie'] = cookie