Skip to content

Commit

Permalink
chore: Merge pull request #792 from NaitLee/NaitLee/fix-danmaku-api
Browse files Browse the repository at this point in the history
fix: get_danmaku_xml 发起的请求现需要 `User-Agent` 头部
  • Loading branch information
Nemo2011 authored Aug 13, 2024
2 parents 8f77f05 + 47a1cea commit d0451b0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions bilibili_api/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -1203,6 +1203,7 @@ async def get_danmaku_xml(
url = f"https://comment.bilibili.com/{cid}.xml"
sess = get_session()
config: dict[Any, Any] = {"url": url}
config["headers"] = {"User-Agent": "Mozilla/5.0"}
# 代理
if settings.proxy:
config["proxies"] = {"all://", settings.proxy}
Expand Down

0 comments on commit d0451b0

Please sign in to comment.