add:comments

This commit is contained in:
Sheyiyuan 2025-03-24 10:14:31 +08:00
parent 247f24d089
commit 29f9ec1d5d

View File

@ -54,6 +54,7 @@ class BiliWebCrawler:
'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
@ -126,6 +127,8 @@ class BiliWebCrawler:
# 将分辨率格式化为 "宽x高" 的字符串
resolution_str = f"{max_width}x{max_height}" if max_width and max_height else "未知"
sleep(uniform(1, 2))
# 获取视频标签
tag_url = f'https://api.bilibili.com/x/web-interface/view/detail/tag?bvid={self.bvid}'
tag_resp = self._safe_request(tag_url)
@ -137,6 +140,8 @@ class BiliWebCrawler:
except Exception as e:
print(f"获取视频标签失败: {str(e)}")
send_notification(f"获取视频{self.bvid}标签失败: {str(e)}")
if tag_resp:
send_info_log(f"原始响应内容: {tag_resp.text[:500]}")
subtitle_data = []
try: