bilibili-api-python


Namebilibili-api-python JSON
Version 16.3.0 PyPI version JSON
download
home_pageNone
SummaryThe fork of module bilibili-api. 哔哩哔哩的各种 API 调用便捷整合(视频、动态、直播等),另外附加一些常用的功能。
upload_time2024-09-21 14:18:36
maintainerMoyuScript, Nemo2011
docs_urlNone
authorNone
requires_python>=3.7
licenseGPL-3.0-or-later
keywords bilibili api spider
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![bilibili-api logo](https://raw.githubusercontent.com/Nemo2011/bilibili-api/main/design/logo.png)

<div align="center">

# bilibili-api

[![API 数量](https://img.shields.io/badge/API%20数量-400+-blue)][api.json]
[![LICENSE](https://img.shields.io/badge/LICENSE-GPLv3+-red)][LICENSE]
[![Python](https://img.shields.io/badge/python-3.12(dev)|3.11|3.10|3.9|3.8-blue)](https://www.python.org)
[![Stable Version](https://img.shields.io/pypi/v/bilibili-api-python?label=stable)][pypi]
[![Pre-release Version](https://img.shields.io/github/v/release/Nemo2011/bilibili-api?label=pre-release&include_prereleases&sort=semver)][pypi-dev]
[![STARS](https://img.shields.io/github/stars/nemo2011/bilibili-api?color=yellow&label=Github%20Stars)][stargazers]
[![Testing](https://github.com/Nemo2011/bilibili-api/actions/workflows/testing.yml/badge.svg?branch=dev)](https://github.com/Nemo2011/bilibili-api/actions/workflows/testing.yml)

**:warning: 接口可能改动,请及时更新最新版 [![Stable Version](https://img.shields.io/pypi/v/bilibili-api-python?label=stable)][pypi]**
</div>

**注意事项:使用此模块时请仅用于学习和测试,禁止用于非法用途及其他恶劣的社区行为如:恶意刷屏、辱骂黄暴、各种形式的滥用等,违规此模块许可证 `GNU General Public License Version 3` 及此条注意事项而产生的任何后果自负,模块的所有贡献者不负任何责任。**

开发文档: [bilibili_api 开发文档][docs] ([GitHub][docs-github]) <!-- ([Gitee][docs-gitee]) -->

原仓库地址:[https://github.com/MoyuScript/bilibili-api](https://github.com/MoyuScript/bilibili-api)

Github 仓库:[https://github.com/nemo2011/bilibili-api](https://github.com/nemo2011/bilibili-api)

<!-- Gitee 仓库:[https://gitee.com/nemo2011/bilibili-api](https://gitee.com/nemo2011/bilibili-api) 长期未同步... -->

> 此仓库是对原仓库 `bilibili-api` 的继续的维护。更多相关的信息请前往原仓库地址进行查看。

# 简介

这是一个用 Python 写的调用 [Bilibili](https://www.bilibili.com) 各种 API 的库,
范围涵盖视频、音频、直播、动态、专栏、用户、番剧等[[1]](#脚注)。

## 特色

- 范围涵盖广,基本覆盖常用的爬虫,操作。
- 可使用代理,绕过 b 站风控策略。
- 全面支持 BV 号(bvid),同时也兼容 AV 号(aid)。
- 调用简便,函数命名易懂,代码注释详细。
- 不仅仅是官方提供的 API!还附加:AV 号与 BV 号互转[[2]](#脚注)、连接直播弹幕 Websocket 服务器、视频弹幕反查、下载弹幕、字幕文件、专栏内容爬取等。
- **全部是异步操作**。

# 快速上手

首先使用以下指令安装本模块:

```
# 主版本
$ pip3 install bilibili-api-python

# 开发版本
$ pip3 install bilibili-api-dev

# 最新修改会在 dev 分支
$ pip3 install git+https://github.com/Nemo2011/bilibili-api.git@dev
```


接下来我们来获取视频的播放量等信息:

```python
import asyncio
from bilibili_api import video


async def main() -> None:
    # 实例化 Video 类
    v = video.Video(bvid="BV1uv411q7Mv")
    # 获取信息
    info = await v.get_info()
    # 打印信息
    print(info)


if __name__ == "__main__":
    asyncio.get_event_loop().run_until_complete(main())

```

输出(已格式化,已省略部分):

```json
{
    "bvid": "BV1uv411q7Mv",
    "aid": 243922477,
    "videos": 1,
    "tid": 17,
    "tname": "单机游戏",
    "copyright": 1,
    "pic": "http://i2.hdslb.com/bfs/archive/82e52df9d0221836c260c82f2890e3761a46716b.jpg",
    "title": "爆肝98小时!在 MC 中还原糖调小镇",
    "pubdate": 1595203214,
    "ctime": 1595168654,
    ...and more
}
```

如何给这个视频点赞?我们需要登录自己的账号。

这里设计是传入一个 Credential 类,获取所需的信息参照:[获取 Credential 类所需信息][get-credential]

下面的代码将会给视频点赞

```python
import asyncio
from bilibili_api import video, Credential

async def main() -> None:
    # 实例化 Credential 类
    credential = Credential(sessdata=SESSDATA, bili_jct=BILI_JCT, buvid3=BUVID3)
    # 实例化 Video 类
    v = video.Video(bvid="BVxxxxxxxx", credential=credential)
    info = await v.get_info()
    print(info)
    # 给视频点赞
    await v.like(True)

if __name__ == '__main__':
    asyncio.get_event_loop().run_until_complete(main())
```

如果没有报错,就代表调用 API 成功,你可以到视频页面确认是不是调用成功了。

> **Warning** 注意,请不要泄露这两个值给他人,否则你的账号将可能遭受盗号的风险!

# 异步迁移

由于从 v5 版本开始,基本全部改为异步,如果你不会异步,可以参考 [asyncio](https://docs.python.org/zh-cn/3/library/asyncio.html)

异步可以进行并发请求,性能更高,不过如果请求过快仍然会导致被屏蔽。

总的来说,异步比同步更有优势,所以不会的话可以去学一下,会发现新天地(误

如果你仍然想继续使用同步代码,请参考 [同步执行异步代码](https://nemo2011.github.io/bilibili-api/#/sync-executor)

以下为 `API` 关于异步请求库使用的详细信息:

| Feature | 同步 | 异步 | aiohttp | httpx | 备注 |
| ------ | ---- | ----- | ------ | ------ | ---- |
| `LiveDanmaku` & `VideoOnlineMonitor` | :x: | :white_check_mark: | :white_check_mark: | :x: | httpx 暂不支持 `WebSocket` |
| `login` | :white_check_mark: | :x: | :x: | :white_check_mark: | 目前暂时仅支持同步请求 |
| other | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |

# FA♂Q

**Q: 关于 API 调用的正确姿势是什么?**

A: 所有 API 调用,请尽量使用 **指名方式** 传参,
因为 API 较多,可能不同函数的传参顺序不一样,例子:

```python
# 推荐
video.get_info(bvid="BV1uv411q7Mv")

# 当然也可以这样
kwargs = {
    "bvid": "BV1uv411q7Mv"
}
video.get_info(**kwargs)

# 不推荐
video.get_info("BV1uv411q7Mv")
```

**Q: 为什么会提示 412 Precondition Failed ?**

A: 你的请求速度太快了。造成请求速度过快的原因可能是你写了高并发的代码。

这种情况下,你的 IP 会暂时被封禁而无法使用,你可以设置代理绕过。

```python
from bilibili_api import settings

settings.proxy = "http://your-proxy.com" # 里头填写你的代理地址

settings.proxy = "http://username:password@your-proxy.com" # 如果需要用户名、密码
```

**Q: 怎么没有我想要的功能?**

A: 你可以发 Issue 来提交你的需求,但是,最好的办法是自己写(懒)

<span id="contribute">**Q: 我有一个大胆的想法,如何给代码库贡献?**</span>

A: 请先 clone 本仓库一份,然后从 main 分支新建一个分支,在该分支上工作。
如果你觉得已经可以了,请向项目仓库的 develop 分支发起 Pull request。
如果你不明白这些操作的话,可以百度。完整指南:[CONTRIBUTING.md](https://github.com/nemo2011/bilibili-api/blob/main/.github/CONTRIBUTING.md)

**Q: 稳定性怎么样?**

A: 由于该模块比较特殊,是爬虫模块,如果 b 站的接口变更,可能会马上失效。因此请始终保证是最新版本。如果发现问题可以提 [Issues][issues-new]。

# 脚注

+ \[1\] 这里只列出一部分,请以实际 API 为准。
+ \[2\] 代码来源:<https://www.zhihu.com/question/381784377/answer/1099438784>


[docs]: https://nemo2011.github.io/bilibili-api
[docs-github]: https://github.com/nemo2011/bilibili-api/tree/main/docs
[docs-gitee]: https://gitee.com/nemo2011/bilibili-api/tree/main/docs
[api.json]: https://github.com/nemo2011/bilibili-api/tree/main/bilibili_api/data/api/
[license]: https://github.com/nemo2011/bilibili-api/tree/main/LICENSE
[stargazers]: https://github.com/nemo2011/bilibili-api/stargazers
[issues-new]: https://github.com/Nemo2011/bilibili-api/issues/new/choose
[get-credential]: https://nemo2011.github.io/bilibili-api/#/get-credential
[pypi]: https://pypi.org/project/bilibili-api-python
[pypi-dev]: https://pypi.org/project/bilibili-api-dev

# Star History

[![Star History Chart](https://api.star-history.com/svg?repos=Nemo2011/bilibili-api&type=Date)](https://star-history.com/#Nemo2011/bilibili-api&Date)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "bilibili-api-python",
    "maintainer": "MoyuScript, Nemo2011",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "bilibili, api, spider",
    "author": null,
    "author_email": "Nemo2011 <yimoxia@outlook.com>",
    "download_url": "https://files.pythonhosted.org/packages/00/16/bef33a02fc8b4c42f9919728447a1ab8aa230893b1a0500e9058daa83d78/bilibili_api_python-16.3.0.tar.gz",
    "platform": null,
    "description": "![bilibili-api logo](https://raw.githubusercontent.com/Nemo2011/bilibili-api/main/design/logo.png)\n\n<div align=\"center\">\n\n# bilibili-api\n\n[![API \u6570\u91cf](https://img.shields.io/badge/API%20\u6570\u91cf-400+-blue)][api.json]\n[![LICENSE](https://img.shields.io/badge/LICENSE-GPLv3+-red)][LICENSE]\n[![Python](https://img.shields.io/badge/python-3.12(dev)|3.11|3.10|3.9|3.8-blue)](https://www.python.org)\n[![Stable Version](https://img.shields.io/pypi/v/bilibili-api-python?label=stable)][pypi]\n[![Pre-release Version](https://img.shields.io/github/v/release/Nemo2011/bilibili-api?label=pre-release&include_prereleases&sort=semver)][pypi-dev]\n[![STARS](https://img.shields.io/github/stars/nemo2011/bilibili-api?color=yellow&label=Github%20Stars)][stargazers]\n[![Testing](https://github.com/Nemo2011/bilibili-api/actions/workflows/testing.yml/badge.svg?branch=dev)](https://github.com/Nemo2011/bilibili-api/actions/workflows/testing.yml)\n\n**:warning: \u63a5\u53e3\u53ef\u80fd\u6539\u52a8\uff0c\u8bf7\u53ca\u65f6\u66f4\u65b0\u6700\u65b0\u7248 [![Stable Version](https://img.shields.io/pypi/v/bilibili-api-python?label=stable)][pypi]**\n</div>\n\n**\u6ce8\u610f\u4e8b\u9879\uff1a\u4f7f\u7528\u6b64\u6a21\u5757\u65f6\u8bf7\u4ec5\u7528\u4e8e\u5b66\u4e60\u548c\u6d4b\u8bd5\uff0c\u7981\u6b62\u7528\u4e8e\u975e\u6cd5\u7528\u9014\u53ca\u5176\u4ed6\u6076\u52a3\u7684\u793e\u533a\u884c\u4e3a\u5982\uff1a\u6076\u610f\u5237\u5c4f\u3001\u8fb1\u9a82\u9ec4\u66b4\u3001\u5404\u79cd\u5f62\u5f0f\u7684\u6ee5\u7528\u7b49\uff0c\u8fdd\u89c4\u6b64\u6a21\u5757\u8bb8\u53ef\u8bc1 `GNU General Public License Version 3` \u53ca\u6b64\u6761\u6ce8\u610f\u4e8b\u9879\u800c\u4ea7\u751f\u7684\u4efb\u4f55\u540e\u679c\u81ea\u8d1f\uff0c\u6a21\u5757\u7684\u6240\u6709\u8d21\u732e\u8005\u4e0d\u8d1f\u4efb\u4f55\u8d23\u4efb\u3002**\n\n\u5f00\u53d1\u6587\u6863: [bilibili_api \u5f00\u53d1\u6587\u6863][docs] ([GitHub][docs-github]) <!-- ([Gitee][docs-gitee]) -->\n\n\u539f\u4ed3\u5e93\u5730\u5740\uff1a[https://github.com/MoyuScript/bilibili-api](https://github.com/MoyuScript/bilibili-api)\n\nGithub \u4ed3\u5e93\uff1a[https://github.com/nemo2011/bilibili-api](https://github.com/nemo2011/bilibili-api)\n\n<!-- Gitee \u4ed3\u5e93\uff1a[https://gitee.com/nemo2011/bilibili-api](https://gitee.com/nemo2011/bilibili-api) \u957f\u671f\u672a\u540c\u6b65... -->\n\n> \u6b64\u4ed3\u5e93\u662f\u5bf9\u539f\u4ed3\u5e93 `bilibili-api` \u7684\u7ee7\u7eed\u7684\u7ef4\u62a4\u3002\u66f4\u591a\u76f8\u5173\u7684\u4fe1\u606f\u8bf7\u524d\u5f80\u539f\u4ed3\u5e93\u5730\u5740\u8fdb\u884c\u67e5\u770b\u3002\n\n# \u7b80\u4ecb\n\n\u8fd9\u662f\u4e00\u4e2a\u7528 Python \u5199\u7684\u8c03\u7528 [Bilibili](https://www.bilibili.com) \u5404\u79cd API \u7684\u5e93\uff0c\n\u8303\u56f4\u6db5\u76d6\u89c6\u9891\u3001\u97f3\u9891\u3001\u76f4\u64ad\u3001\u52a8\u6001\u3001\u4e13\u680f\u3001\u7528\u6237\u3001\u756a\u5267\u7b49[[1]](#\u811a\u6ce8)\u3002\n\n## \u7279\u8272\n\n- \u8303\u56f4\u6db5\u76d6\u5e7f\uff0c\u57fa\u672c\u8986\u76d6\u5e38\u7528\u7684\u722c\u866b\uff0c\u64cd\u4f5c\u3002\n- \u53ef\u4f7f\u7528\u4ee3\u7406\uff0c\u7ed5\u8fc7 b \u7ad9\u98ce\u63a7\u7b56\u7565\u3002\n- \u5168\u9762\u652f\u6301 BV \u53f7\uff08bvid\uff09\uff0c\u540c\u65f6\u4e5f\u517c\u5bb9 AV \u53f7\uff08aid\uff09\u3002\n- \u8c03\u7528\u7b80\u4fbf\uff0c\u51fd\u6570\u547d\u540d\u6613\u61c2\uff0c\u4ee3\u7801\u6ce8\u91ca\u8be6\u7ec6\u3002\n- \u4e0d\u4ec5\u4ec5\u662f\u5b98\u65b9\u63d0\u4f9b\u7684 API\uff01\u8fd8\u9644\u52a0\uff1aAV \u53f7\u4e0e BV \u53f7\u4e92\u8f6c[[2]](#\u811a\u6ce8)\u3001\u8fde\u63a5\u76f4\u64ad\u5f39\u5e55 Websocket \u670d\u52a1\u5668\u3001\u89c6\u9891\u5f39\u5e55\u53cd\u67e5\u3001\u4e0b\u8f7d\u5f39\u5e55\u3001\u5b57\u5e55\u6587\u4ef6\u3001\u4e13\u680f\u5185\u5bb9\u722c\u53d6\u7b49\u3002\n- **\u5168\u90e8\u662f\u5f02\u6b65\u64cd\u4f5c**\u3002\n\n# \u5feb\u901f\u4e0a\u624b\n\n\u9996\u5148\u4f7f\u7528\u4ee5\u4e0b\u6307\u4ee4\u5b89\u88c5\u672c\u6a21\u5757\uff1a\n\n```\n# \u4e3b\u7248\u672c\n$ pip3 install bilibili-api-python\n\n# \u5f00\u53d1\u7248\u672c\n$ pip3 install bilibili-api-dev\n\n# \u6700\u65b0\u4fee\u6539\u4f1a\u5728 dev \u5206\u652f\n$ pip3 install git+https://github.com/Nemo2011/bilibili-api.git@dev\n```\n\n\n\u63a5\u4e0b\u6765\u6211\u4eec\u6765\u83b7\u53d6\u89c6\u9891\u7684\u64ad\u653e\u91cf\u7b49\u4fe1\u606f\uff1a\n\n```python\nimport asyncio\nfrom bilibili_api import video\n\n\nasync def main() -> None:\n    # \u5b9e\u4f8b\u5316 Video \u7c7b\n    v = video.Video(bvid=\"BV1uv411q7Mv\")\n    # \u83b7\u53d6\u4fe1\u606f\n    info = await v.get_info()\n    # \u6253\u5370\u4fe1\u606f\n    print(info)\n\n\nif __name__ == \"__main__\":\n    asyncio.get_event_loop().run_until_complete(main())\n\n```\n\n\u8f93\u51fa\uff08\u5df2\u683c\u5f0f\u5316\uff0c\u5df2\u7701\u7565\u90e8\u5206\uff09\uff1a\n\n```json\n{\n    \"bvid\": \"BV1uv411q7Mv\",\n    \"aid\": 243922477,\n    \"videos\": 1,\n    \"tid\": 17,\n    \"tname\": \"\u5355\u673a\u6e38\u620f\",\n    \"copyright\": 1,\n    \"pic\": \"http://i2.hdslb.com/bfs/archive/82e52df9d0221836c260c82f2890e3761a46716b.jpg\",\n    \"title\": \"\u7206\u809d\uff19\uff18\u5c0f\u65f6\uff01\u5728 MC \u4e2d\u8fd8\u539f\u7cd6\u8c03\u5c0f\u9547\",\n    \"pubdate\": 1595203214,\n    \"ctime\": 1595168654,\n    ...and more\n}\n```\n\n\u5982\u4f55\u7ed9\u8fd9\u4e2a\u89c6\u9891\u70b9\u8d5e\uff1f\u6211\u4eec\u9700\u8981\u767b\u5f55\u81ea\u5df1\u7684\u8d26\u53f7\u3002\n\n\u8fd9\u91cc\u8bbe\u8ba1\u662f\u4f20\u5165\u4e00\u4e2a Credential \u7c7b\uff0c\u83b7\u53d6\u6240\u9700\u7684\u4fe1\u606f\u53c2\u7167\uff1a[\u83b7\u53d6 Credential \u7c7b\u6240\u9700\u4fe1\u606f][get-credential]\n\n\u4e0b\u9762\u7684\u4ee3\u7801\u5c06\u4f1a\u7ed9\u89c6\u9891\u70b9\u8d5e\n\n```python\nimport asyncio\nfrom bilibili_api import video, Credential\n\nasync def main() -> None:\n    # \u5b9e\u4f8b\u5316 Credential \u7c7b\n    credential = Credential(sessdata=SESSDATA, bili_jct=BILI_JCT, buvid3=BUVID3)\n    # \u5b9e\u4f8b\u5316 Video \u7c7b\n    v = video.Video(bvid=\"BVxxxxxxxx\", credential=credential)\n    info = await v.get_info()\n    print(info)\n    # \u7ed9\u89c6\u9891\u70b9\u8d5e\n    await v.like(True)\n\nif __name__ == '__main__':\n    asyncio.get_event_loop().run_until_complete(main())\n```\n\n\u5982\u679c\u6ca1\u6709\u62a5\u9519\uff0c\u5c31\u4ee3\u8868\u8c03\u7528 API \u6210\u529f\uff0c\u4f60\u53ef\u4ee5\u5230\u89c6\u9891\u9875\u9762\u786e\u8ba4\u662f\u4e0d\u662f\u8c03\u7528\u6210\u529f\u4e86\u3002\n\n> **Warning** \u6ce8\u610f\uff0c\u8bf7\u4e0d\u8981\u6cc4\u9732\u8fd9\u4e24\u4e2a\u503c\u7ed9\u4ed6\u4eba\uff0c\u5426\u5219\u4f60\u7684\u8d26\u53f7\u5c06\u53ef\u80fd\u906d\u53d7\u76d7\u53f7\u7684\u98ce\u9669\uff01\n\n# \u5f02\u6b65\u8fc1\u79fb\n\n\u7531\u4e8e\u4ece v5 \u7248\u672c\u5f00\u59cb\uff0c\u57fa\u672c\u5168\u90e8\u6539\u4e3a\u5f02\u6b65\uff0c\u5982\u679c\u4f60\u4e0d\u4f1a\u5f02\u6b65\uff0c\u53ef\u4ee5\u53c2\u8003 [asyncio](https://docs.python.org/zh-cn/3/library/asyncio.html)\n\n\u5f02\u6b65\u53ef\u4ee5\u8fdb\u884c\u5e76\u53d1\u8bf7\u6c42\uff0c\u6027\u80fd\u66f4\u9ad8\uff0c\u4e0d\u8fc7\u5982\u679c\u8bf7\u6c42\u8fc7\u5feb\u4ecd\u7136\u4f1a\u5bfc\u81f4\u88ab\u5c4f\u853d\u3002\n\n\u603b\u7684\u6765\u8bf4\uff0c\u5f02\u6b65\u6bd4\u540c\u6b65\u66f4\u6709\u4f18\u52bf\uff0c\u6240\u4ee5\u4e0d\u4f1a\u7684\u8bdd\u53ef\u4ee5\u53bb\u5b66\u4e00\u4e0b\uff0c\u4f1a\u53d1\u73b0\u65b0\u5929\u5730\uff08\u8bef\n\n\u5982\u679c\u4f60\u4ecd\u7136\u60f3\u7ee7\u7eed\u4f7f\u7528\u540c\u6b65\u4ee3\u7801\uff0c\u8bf7\u53c2\u8003 [\u540c\u6b65\u6267\u884c\u5f02\u6b65\u4ee3\u7801](https://nemo2011.github.io/bilibili-api/#/sync-executor)\n\n\u4ee5\u4e0b\u4e3a `API` \u5173\u4e8e\u5f02\u6b65\u8bf7\u6c42\u5e93\u4f7f\u7528\u7684\u8be6\u7ec6\u4fe1\u606f\uff1a\n\n| Feature | \u540c\u6b65 | \u5f02\u6b65 | aiohttp | httpx | \u5907\u6ce8 |\n| ------ | ---- | ----- | ------ | ------ | ---- |\n| `LiveDanmaku` & `VideoOnlineMonitor` | :x: | :white_check_mark: | :white_check_mark: | :x: | httpx \u6682\u4e0d\u652f\u6301 `WebSocket` |\n| `login` | :white_check_mark: | :x: | :x: | :white_check_mark: | \u76ee\u524d\u6682\u65f6\u4ec5\u652f\u6301\u540c\u6b65\u8bf7\u6c42 |\n| other | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |\n\n# FA\u2642Q\n\n**Q: \u5173\u4e8e API \u8c03\u7528\u7684\u6b63\u786e\u59ff\u52bf\u662f\u4ec0\u4e48\uff1f**\n\nA: \u6240\u6709 API \u8c03\u7528\uff0c\u8bf7\u5c3d\u91cf\u4f7f\u7528 **\u6307\u540d\u65b9\u5f0f** \u4f20\u53c2\uff0c\n\u56e0\u4e3a API \u8f83\u591a\uff0c\u53ef\u80fd\u4e0d\u540c\u51fd\u6570\u7684\u4f20\u53c2\u987a\u5e8f\u4e0d\u4e00\u6837\uff0c\u4f8b\u5b50\uff1a\n\n```python\n# \u63a8\u8350\nvideo.get_info(bvid=\"BV1uv411q7Mv\")\n\n# \u5f53\u7136\u4e5f\u53ef\u4ee5\u8fd9\u6837\nkwargs = {\n    \"bvid\": \"BV1uv411q7Mv\"\n}\nvideo.get_info(**kwargs)\n\n# \u4e0d\u63a8\u8350\nvideo.get_info(\"BV1uv411q7Mv\")\n```\n\n**Q: \u4e3a\u4ec0\u4e48\u4f1a\u63d0\u793a 412 Precondition Failed \uff1f**\n\nA: \u4f60\u7684\u8bf7\u6c42\u901f\u5ea6\u592a\u5feb\u4e86\u3002\u9020\u6210\u8bf7\u6c42\u901f\u5ea6\u8fc7\u5feb\u7684\u539f\u56e0\u53ef\u80fd\u662f\u4f60\u5199\u4e86\u9ad8\u5e76\u53d1\u7684\u4ee3\u7801\u3002\n\n\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u4f60\u7684 IP \u4f1a\u6682\u65f6\u88ab\u5c01\u7981\u800c\u65e0\u6cd5\u4f7f\u7528\uff0c\u4f60\u53ef\u4ee5\u8bbe\u7f6e\u4ee3\u7406\u7ed5\u8fc7\u3002\n\n```python\nfrom bilibili_api import settings\n\nsettings.proxy = \"http://your-proxy.com\" # \u91cc\u5934\u586b\u5199\u4f60\u7684\u4ee3\u7406\u5730\u5740\n\nsettings.proxy = \"http://username:password@your-proxy.com\" # \u5982\u679c\u9700\u8981\u7528\u6237\u540d\u3001\u5bc6\u7801\n```\n\n**Q: \u600e\u4e48\u6ca1\u6709\u6211\u60f3\u8981\u7684\u529f\u80fd\uff1f**\n\nA: \u4f60\u53ef\u4ee5\u53d1 Issue \u6765\u63d0\u4ea4\u4f60\u7684\u9700\u6c42\uff0c\u4f46\u662f\uff0c\u6700\u597d\u7684\u529e\u6cd5\u662f\u81ea\u5df1\u5199\uff08\u61d2\uff09\n\n<span id=\"contribute\">**Q: \u6211\u6709\u4e00\u4e2a\u5927\u80c6\u7684\u60f3\u6cd5\uff0c\u5982\u4f55\u7ed9\u4ee3\u7801\u5e93\u8d21\u732e\uff1f**</span>\n\nA: \u8bf7\u5148 clone \u672c\u4ed3\u5e93\u4e00\u4efd\uff0c\u7136\u540e\u4ece main \u5206\u652f\u65b0\u5efa\u4e00\u4e2a\u5206\u652f\uff0c\u5728\u8be5\u5206\u652f\u4e0a\u5de5\u4f5c\u3002\n\u5982\u679c\u4f60\u89c9\u5f97\u5df2\u7ecf\u53ef\u4ee5\u4e86\uff0c\u8bf7\u5411\u9879\u76ee\u4ed3\u5e93\u7684 develop \u5206\u652f\u53d1\u8d77 Pull request\u3002\n\u5982\u679c\u4f60\u4e0d\u660e\u767d\u8fd9\u4e9b\u64cd\u4f5c\u7684\u8bdd\uff0c\u53ef\u4ee5\u767e\u5ea6\u3002\u5b8c\u6574\u6307\u5357\uff1a[CONTRIBUTING.md](https://github.com/nemo2011/bilibili-api/blob/main/.github/CONTRIBUTING.md)\n\n**Q: \u7a33\u5b9a\u6027\u600e\u4e48\u6837\uff1f**\n\nA: \u7531\u4e8e\u8be5\u6a21\u5757\u6bd4\u8f83\u7279\u6b8a\uff0c\u662f\u722c\u866b\u6a21\u5757\uff0c\u5982\u679c b \u7ad9\u7684\u63a5\u53e3\u53d8\u66f4\uff0c\u53ef\u80fd\u4f1a\u9a6c\u4e0a\u5931\u6548\u3002\u56e0\u6b64\u8bf7\u59cb\u7ec8\u4fdd\u8bc1\u662f\u6700\u65b0\u7248\u672c\u3002\u5982\u679c\u53d1\u73b0\u95ee\u9898\u53ef\u4ee5\u63d0 [Issues][issues-new]\u3002\n\n# \u811a\u6ce8\n\n+ \\[1\\] \u8fd9\u91cc\u53ea\u5217\u51fa\u4e00\u90e8\u5206\uff0c\u8bf7\u4ee5\u5b9e\u9645 API \u4e3a\u51c6\u3002\n+ \\[2\\] \u4ee3\u7801\u6765\u6e90\uff1a<https://www.zhihu.com/question/381784377/answer/1099438784>\n\n\n[docs]: https://nemo2011.github.io/bilibili-api\n[docs-github]: https://github.com/nemo2011/bilibili-api/tree/main/docs\n[docs-gitee]: https://gitee.com/nemo2011/bilibili-api/tree/main/docs\n[api.json]: https://github.com/nemo2011/bilibili-api/tree/main/bilibili_api/data/api/\n[license]: https://github.com/nemo2011/bilibili-api/tree/main/LICENSE\n[stargazers]: https://github.com/nemo2011/bilibili-api/stargazers\n[issues-new]: https://github.com/Nemo2011/bilibili-api/issues/new/choose\n[get-credential]: https://nemo2011.github.io/bilibili-api/#/get-credential\n[pypi]: https://pypi.org/project/bilibili-api-python\n[pypi-dev]: https://pypi.org/project/bilibili-api-dev\n\n# Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=Nemo2011/bilibili-api&type=Date)](https://star-history.com/#Nemo2011/bilibili-api&Date)\n",
    "bugtrack_url": null,
    "license": "GPL-3.0-or-later",
    "summary": "The fork of module bilibili-api. \u54d4\u54e9\u54d4\u54e9\u7684\u5404\u79cd API \u8c03\u7528\u4fbf\u6377\u6574\u5408\uff08\u89c6\u9891\u3001\u52a8\u6001\u3001\u76f4\u64ad\u7b49\uff09\uff0c\u53e6\u5916\u9644\u52a0\u4e00\u4e9b\u5e38\u7528\u7684\u529f\u80fd\u3002",
    "version": "16.3.0",
    "project_urls": null,
    "split_keywords": [
        "bilibili",
        " api",
        " spider"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b900ab0f538828ea68fa72424058a958fa977a122ac561f05be0645d5b537258",
                "md5": "7f824268b2f44d1c37eba26200682ee9",
                "sha256": "a3edbd387600a63185a6f46777c69797c0ab3e203a224e89c9007167de9f932c"
            },
            "downloads": -1,
            "filename": "bilibili_api_python-16.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7f824268b2f44d1c37eba26200682ee9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 500807,
            "upload_time": "2024-09-21T14:18:34",
            "upload_time_iso_8601": "2024-09-21T14:18:34.011400Z",
            "url": "https://files.pythonhosted.org/packages/b9/00/ab0f538828ea68fa72424058a958fa977a122ac561f05be0645d5b537258/bilibili_api_python-16.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0016bef33a02fc8b4c42f9919728447a1ab8aa230893b1a0500e9058daa83d78",
                "md5": "cba3fa91a82021d37a1614918092469c",
                "sha256": "9b087215cddbd6a03b5bbea0681700ba9f9671aea0400751c1925a657387a82c"
            },
            "downloads": -1,
            "filename": "bilibili_api_python-16.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "cba3fa91a82021d37a1614918092469c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 2173629,
            "upload_time": "2024-09-21T14:18:36",
            "upload_time_iso_8601": "2024-09-21T14:18:36.519921Z",
            "url": "https://files.pythonhosted.org/packages/00/16/bef33a02fc8b4c42f9919728447a1ab8aa230893b1a0500e9058daa83d78/bilibili_api_python-16.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-21 14:18:36",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "bilibili-api-python"
}
        
Elapsed time: 1.73388s