<div align="center">
<a href="https://v2.nonebot.dev/store"><img src="https://github.com/A-kirami/nonebot-plugin-template/blob/resources/nbp_logo.png" width="180" height="180" alt="NoneBotPluginLogo"></a>
<br>
<p><img src="https://github.com/A-kirami/nonebot-plugin-template/blob/resources/NoneBotPlugin.svg" width="240" alt="NoneBotPluginText"></p>
</div>
<div align="center">
# nonebot-plugin-bilimusic
_✨ 一款基于 Nonebot2 的 Bilibili 视频提取音乐和歌词插件。 ✨_
</div>
## 📖 介绍
本插件可以解析 Bilibili 视频,并提取出视频中的音乐和歌词(基于字幕故可能不准)。
- `/bm` 或 `/bilimusic` 指令来解析视频。
- `/bm group` 或 `/bilimusic group` 指令来解析视频所在集合,并且打包为一个文件。
## 💿 安装
你可以使用 `nb plugin install nonebot_plugin_bilimusic` 来安装此插件。
## ⚙️ 配置
在 NoneBot2 项目的 `.env` 文件中添加下表中的配置:
| 配置项 | 必填 | 默认值 | 说明 |
|:----------------:|:--:|:---:|:----------------:|
| bilimusic_limit | 否 | 2 | 对请求速率的限制 |
| bilimusic_cookie | 否 | 空 | 获取歌词所必须的 B 站账号口令 |
## 🎉 使用
### 指令表
| 名称 | 权限 | 说明 |
|:--------------------------:|:--:|:---------------------------|
| bm / bilimusic | 无 | 解析视频,需附带参数(可以是BV号或是链接) |
| bm group / bilimusic group | 无 | 解析视频所在集合,需附带参数(可以是BV号或是链接) |
### 获取 Cookie
> [!CAUTION]
> 此功能需要 Bilibili 账号,对于获取的 Cookie 请妥善保管!如果因此导致账号被盗或是封禁,作者概不负责。
1. 打开浏览器,进入 Bilibili 主页,登陆你的账号。
2. 按 F12 打开开发者工具,切换到 Network 标签。
3. 刷新页面,在 Network 标签下找到并点击 `www.bilibili.com` 请求。
4. 打开 `Headers` 或者 `标头` 标签,找到 Cookie 字段,复制其内容(无需复制 `Cookie: ` 前缀)。
Raw data
{
"_id": null,
"home_page": "https://github.com/Lonely-Sails/nonebot-plugin-bilimusic",
"name": "nonebot_plugin_bilimusic",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": "nonebot, nonebot2, bilibili, music, lyric",
"author": "Lonely-Sails",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/8e/45/d74840cc76155a9836f3118c58385427289e17a8ee350d9bb6d8f97959af/nonebot_plugin_bilimusic-1.1.0.tar.gz",
"platform": null,
"description": "<div align=\"center\">\n <a href=\"https://v2.nonebot.dev/store\"><img src=\"https://github.com/A-kirami/nonebot-plugin-template/blob/resources/nbp_logo.png\" width=\"180\" height=\"180\" alt=\"NoneBotPluginLogo\"></a>\n <br>\n <p><img src=\"https://github.com/A-kirami/nonebot-plugin-template/blob/resources/NoneBotPlugin.svg\" width=\"240\" alt=\"NoneBotPluginText\"></p>\n</div>\n\n<div align=\"center\">\n\n# nonebot-plugin-bilimusic\n\n_\u2728 \u4e00\u6b3e\u57fa\u4e8e Nonebot2 \u7684 Bilibili \u89c6\u9891\u63d0\u53d6\u97f3\u4e50\u548c\u6b4c\u8bcd\u63d2\u4ef6\u3002 \u2728_\n\n</div>\n\n## \ud83d\udcd6 \u4ecb\u7ecd\n\n\u672c\u63d2\u4ef6\u53ef\u4ee5\u89e3\u6790 Bilibili \u89c6\u9891\uff0c\u5e76\u63d0\u53d6\u51fa\u89c6\u9891\u4e2d\u7684\u97f3\u4e50\u548c\u6b4c\u8bcd\uff08\u57fa\u4e8e\u5b57\u5e55\u6545\u53ef\u80fd\u4e0d\u51c6\uff09\u3002\n\n- `/bm` \u6216 `/bilimusic` \u6307\u4ee4\u6765\u89e3\u6790\u89c6\u9891\u3002\n- `/bm group` \u6216 `/bilimusic group` \u6307\u4ee4\u6765\u89e3\u6790\u89c6\u9891\u6240\u5728\u96c6\u5408\uff0c\u5e76\u4e14\u6253\u5305\u4e3a\u4e00\u4e2a\u6587\u4ef6\u3002\n\n## \ud83d\udcbf \u5b89\u88c5\n\n\u4f60\u53ef\u4ee5\u4f7f\u7528 `nb plugin install nonebot_plugin_bilimusic` \u6765\u5b89\u88c5\u6b64\u63d2\u4ef6\u3002\n\n## \u2699\ufe0f \u914d\u7f6e\n\n\u5728 NoneBot2 \u9879\u76ee\u7684 `.env` \u6587\u4ef6\u4e2d\u6dfb\u52a0\u4e0b\u8868\u4e2d\u7684\u914d\u7f6e\uff1a\n\n| \u914d\u7f6e\u9879 | \u5fc5\u586b | \u9ed8\u8ba4\u503c | \u8bf4\u660e |\n|:----------------:|:--:|:---:|:----------------:|\n| bilimusic_limit | \u5426 | 2 | \u5bf9\u8bf7\u6c42\u901f\u7387\u7684\u9650\u5236 |\n| bilimusic_cookie | \u5426 | \u7a7a | \u83b7\u53d6\u6b4c\u8bcd\u6240\u5fc5\u987b\u7684 B \u7ad9\u8d26\u53f7\u53e3\u4ee4 |\n\n## \ud83c\udf89 \u4f7f\u7528\n\n### \u6307\u4ee4\u8868\n\n| \u540d\u79f0 | \u6743\u9650 | \u8bf4\u660e |\n|:--------------------------:|:--:|:---------------------------|\n| bm / bilimusic | \u65e0 | \u89e3\u6790\u89c6\u9891\uff0c\u9700\u9644\u5e26\u53c2\u6570\uff08\u53ef\u4ee5\u662fBV\u53f7\u6216\u662f\u94fe\u63a5\uff09 |\n| bm group / bilimusic group | \u65e0 | \u89e3\u6790\u89c6\u9891\u6240\u5728\u96c6\u5408\uff0c\u9700\u9644\u5e26\u53c2\u6570\uff08\u53ef\u4ee5\u662fBV\u53f7\u6216\u662f\u94fe\u63a5\uff09 |\n\n### \u83b7\u53d6 Cookie\n\n> [!CAUTION]\n> \u6b64\u529f\u80fd\u9700\u8981 Bilibili \u8d26\u53f7\uff0c\u5bf9\u4e8e\u83b7\u53d6\u7684 Cookie \u8bf7\u59a5\u5584\u4fdd\u7ba1\uff01\u5982\u679c\u56e0\u6b64\u5bfc\u81f4\u8d26\u53f7\u88ab\u76d7\u6216\u662f\u5c01\u7981\uff0c\u4f5c\u8005\u6982\u4e0d\u8d1f\u8d23\u3002\n\n1. \u6253\u5f00\u6d4f\u89c8\u5668\uff0c\u8fdb\u5165 Bilibili \u4e3b\u9875\uff0c\u767b\u9646\u4f60\u7684\u8d26\u53f7\u3002\n2. \u6309 F12 \u6253\u5f00\u5f00\u53d1\u8005\u5de5\u5177\uff0c\u5207\u6362\u5230 Network \u6807\u7b7e\u3002\n3. \u5237\u65b0\u9875\u9762\uff0c\u5728 Network \u6807\u7b7e\u4e0b\u627e\u5230\u5e76\u70b9\u51fb `www.bilibili.com` \u8bf7\u6c42\u3002\n4. \u6253\u5f00 `Headers` \u6216\u8005 `\u6807\u5934` \u6807\u7b7e\uff0c\u627e\u5230 Cookie \u5b57\u6bb5\uff0c\u590d\u5236\u5176\u5185\u5bb9\uff08\u65e0\u9700\u590d\u5236 `Cookie: ` \u524d\u7f00\uff09\u3002\n",
"bugtrack_url": null,
"license": "GPL3",
"summary": "\u4e00\u6b3e\u57fa\u4e8e Nonebot2 \u7684 Bilibili \u89c6\u9891\u63d0\u53d6\u97f3\u4e50\u548c\u6b4c\u8bcd\u63d2\u4ef6\u3002",
"version": "1.1.0",
"project_urls": {
"Documentation": "https://github.com/Lonely-Sails/nonebot-plugin-bilimusic#readme",
"Homepage": "https://github.com/Lonely-Sails/nonebot-plugin-bilimusic",
"Repository": "https://github.com/Lonely-Sails/nonebot-plugin-bilimusic"
},
"split_keywords": [
"nonebot",
" nonebot2",
" bilibili",
" music",
" lyric"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "79bbcee23ec115666b09980ab1981fb3bbd7800c1dfb1e450bbae3f796ad0744",
"md5": "d1654904e21e38af6ab88f38f4cc3418",
"sha256": "0f06c3283df302b8811d9ca432d20d5f2f5076fecc50849525ad401458452c0d"
},
"downloads": -1,
"filename": "nonebot_plugin_bilimusic-1.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d1654904e21e38af6ab88f38f4cc3418",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 18886,
"upload_time": "2024-10-20T09:41:20",
"upload_time_iso_8601": "2024-10-20T09:41:20.644139Z",
"url": "https://files.pythonhosted.org/packages/79/bb/cee23ec115666b09980ab1981fb3bbd7800c1dfb1e450bbae3f796ad0744/nonebot_plugin_bilimusic-1.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8e45d74840cc76155a9836f3118c58385427289e17a8ee350d9bb6d8f97959af",
"md5": "2ec5c008d6c4ee268f9b26c7705430ad",
"sha256": "3b071c35da28eaeec90daa8823824635cb82c8970422c9b6b2fc49fb9b643307"
},
"downloads": -1,
"filename": "nonebot_plugin_bilimusic-1.1.0.tar.gz",
"has_sig": false,
"md5_digest": "2ec5c008d6c4ee268f9b26c7705430ad",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 17729,
"upload_time": "2024-10-20T09:41:21",
"upload_time_iso_8601": "2024-10-20T09:41:21.886019Z",
"url": "https://files.pythonhosted.org/packages/8e/45/d74840cc76155a9836f3118c58385427289e17a8ee350d9bb6d8f97959af/nonebot_plugin_bilimusic-1.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-20 09:41:21",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Lonely-Sails",
"github_project": "nonebot-plugin-bilimusic",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "nonebot_plugin_bilimusic"
}