Bestdori 的各种 API 调用整合,另外附带部分功能
Reason this release was yanked:
Irregular version management
Project description
Bestdori_api
:warning: 该项目仍然急需更新与 Debug ,使用时若遇到 Bug 或其他需要的接口请及时提出
简介
这是一个用 Python 编写的调用 Bestdori 各种 API 与资源下载的库,大致包括了社区帖子的处理以及各种 BanG Dream!少女乐团派对 游戏内资源的获取。 警告:此模块目前仍然亟待完善与测试,请不要将其当做一个稳定的库使用。
目前已有的 API 与功能
| API 类别 | 是否完善 | 支持的内容 |
|---|---|---|
| 用户 | 👍 | 登录、查询、帖子获取、信息获取 |
| 帖子 | 👍 | 搜索、获取、发表、评论、喜欢 |
| 谱面 | 👍 | 社区谱面获取、音源与封面获取、规整化、数据统计、格式互转 |
| 故事 | 👎👎 | 社区故事获取 |
| 角色 | 🤔 | 信息获取、资源获取 |
| 卡牌 | 👎 | 信息获取、资源获取 |
| 服装 | 👎👎 | 信息获取 |
| 活动 | 🤔 | 信息获取、资源获取 |
| 活动数据 | 👎 | 数据获取 |
| 招募 | 🤔 | 数据获取、资源获取 |
| 歌曲 | 🤔 | 信息获取、资源获取 |
| 歌曲 Meta | 👎👎 | 数据获取 |
| 登录奖励 | 🤔 | 信息获取、资源获取 |
| 自选券 | 🤔 | 信息获取 |
| 漫画 | 🤔 | 信息获取、图片获取 |
| 任务 | 🤔 | 信息获取 |
| ayachan | 🤔 | 谱面分析、测试服上传、难度分析 |
| 其他资源 | 👎👎 | 仅小部分资源有单独获取 |
快速使用
以下将以获取社区自制谱面 [FULL] 光の中へ 的信息为例。
首先,使用以下指令安装本模块:
$ pip3 install bestdori_api
接下来在一个 Python 脚本文件中,使用如下代码获取指定帖子的全部信息(这里我们已知该帖子的 ID 为 111533):
from bestdori.post import Post
def main() -> None:
# 实例化 Post 类
p = Post(id='111533')
# 调用方法获取信息
info = p.get_details()
# 打印信息
print(info)
main()
得到的输出内容如下:
{
'categoryName': 'SELF_POST',
'categoryId': 'chart',
'title': '[FULL] 光の中へ',
'song': {
'type': 'custom',
'audio': 'https://bestdori.com/api/upload/file/e4a080f84bfa2ca47b23b390a464c819ec17e70b',
'cover': 'https://bestdori.com/api/upload/file/e3535ebb4c740c4757371026a1df9ffb08010307'
},
'artists': '結束バンド',
'diff': 4,
'level': 30,
'chart': [
{
'bpm': 191,
'beat': 0,
'type': 'BPM'
},
{
'beat': 192,
'lane': 3.
'type': 'Single'
},
...
],
...
}
如果想要获取这个自制谱面的谱面,或者想要获取它的音源与封面,以下代码将会进行获取:
from bestdori.post import Post
def main() -> None:
# 实例化 Post 类
p = Post(id='111533')
# 调用方法获取谱面
chart = p.get_chart() # 获取的将是一个谱面实例
# 调用方法获取音源与封面
info = p.get_song() # 获取的将是一个包含了音源与封面的 bytes 字典
main()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bestdori_api-0.1.10.tar.gz.
File metadata
- Download URL: bestdori_api-0.1.10.tar.gz
- Upload date:
- Size: 32.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9754f882393f082bf706ca71a504a333a8bd98f46a4f8a25f10543a120edc7f5
|
|
| MD5 |
8675891d7b6be0b283bc0b0edddbca76
|
|
| BLAKE2b-256 |
f73906e8fdf0ec5dcd4555d154ab6e8c60525996fe4af8fe3da774c0d95ce433
|
File details
Details for the file bestdori_api-0.1.10-py3-none-any.whl.
File metadata
- Download URL: bestdori_api-0.1.10-py3-none-any.whl
- Upload date:
- Size: 51.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
579d4d95a7c6ef418cb6a5fb3734c3373a47312ae8eb2a209f28c7a804583907
|
|
| MD5 |
5fc92236a2b03cb10e37e2f5579e942c
|
|
| BLAKE2b-256 |
8f2c3ccb749e1394ecb0ea8191cbbc91e2e9b50b7d9a409081223a2cf3497c62
|