add:comments
This commit is contained in:
parent
247f24d089
commit
29f9ec1d5d
5
main.py
5
main.py
@ -54,6 +54,7 @@ class BiliWebCrawler:
|
|||||||
'Referer': f'https://www.bilibili.com/video/{self.bvid}',
|
'Referer': f'https://www.bilibili.com/video/{self.bvid}',
|
||||||
'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8',
|
'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8',
|
||||||
'Accept-Encoding': 'gzip, deflate, br'
|
'Accept-Encoding': 'gzip, deflate, br'
|
||||||
|
''
|
||||||
}
|
}
|
||||||
if cookie:
|
if cookie:
|
||||||
self.headers['Cookie'] = cookie
|
self.headers['Cookie'] = cookie
|
||||||
@ -126,6 +127,8 @@ class BiliWebCrawler:
|
|||||||
# 将分辨率格式化为 "宽x高" 的字符串
|
# 将分辨率格式化为 "宽x高" 的字符串
|
||||||
resolution_str = f"{max_width}x{max_height}" if max_width and max_height else "未知"
|
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_url = f'https://api.bilibili.com/x/web-interface/view/detail/tag?bvid={self.bvid}'
|
||||||
tag_resp = self._safe_request(tag_url)
|
tag_resp = self._safe_request(tag_url)
|
||||||
@ -137,6 +140,8 @@ class BiliWebCrawler:
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"获取视频标签失败: {str(e)}")
|
print(f"获取视频标签失败: {str(e)}")
|
||||||
send_notification(f"获取视频{self.bvid}标签失败: {str(e)}")
|
send_notification(f"获取视频{self.bvid}标签失败: {str(e)}")
|
||||||
|
if tag_resp:
|
||||||
|
send_info_log(f"原始响应内容: {tag_resp.text[:500]}")
|
||||||
|
|
||||||
subtitle_data = []
|
subtitle_data = []
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user