<p align="center">
<img src="https://files.catbox.moe/7cy61g.png" width="200" height="200" alt="nonebot"></a>
</p>
<div align="center">
# nonebot-plugin-ncm
✨ 基于go-cqhttp与nonebot2的 网易云 无损音乐 点歌/下载 ✨
</div>
<p align="center">
<a href="https://github.com/kitUIN/nonebot-plugin-ncm/blob/master/LICENSE">
<img src="https://img.shields.io/badge/license-Apache--2.0-green" alt="license">
</a>
<a href="https://pypi.python.org/pypi/nonebot-plugin-ncm">
<img src="https://img.shields.io/pypi/v/nonebot-plugin-ncm" alt="pypi">
</a>
<a href="https://github.com/nonebot/nonebot2/releases/tag/v2.0.1">
<img src="https://img.shields.io/static/v1?label=nonebot2&message=v2.0.1&color=brightgreen" alt="nonebot">
</a>
<a href="https://github.com/kitUIN/nonebot-plugin-ncm/releases">
<img src="https://img.shields.io/github/v/release/kitUIN/nonebot-plugin-ncm" alt="release">
</a>
<a href="https://wakatime.com/badge/user/3b5608c7-e0b6-44a2-a217-cad786040b48/project/2a431792-e82f-48f5-839c-9ee566910fe5"><img src="https://wakatime.com/badge/user/3b5608c7-e0b6-44a2-a217-cad786040b48/project/2a431792-e82f-48f5-839c-9ee566910fe5.svg" alt="wakatime"></a>
</p>
## 安装 💿
<details>
<summary>使用 nb-cli 安装</summary>
在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
nb plugin install nonebot-plugin-ncm
或者
python -m nb_cli plugin install nonebot-plugin-ncm
</details>
<details>
<summary>使用包管理器安装</summary>
在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
<details>
<summary>pip</summary>
pip install nonebot-plugin-ncm
</details>
<details>
<summary>pdm</summary>
pdm add nonebot-plugin-ncm
</details>
<details>
<summary>poetry</summary>
poetry add nonebot-plugin-ncm
</details>
打开 nonebot2 项目根目录下的 `pyproject.toml` 文件, 在 `[tool.nonebot]` 部分追加写入
plugins = ["nonebot-plugin-ncm"]
</details>
<details>
<summary>如果希望使用`nonebot2 a16`及以下版本 </summary>
pip install nonebot-plugin-ncm==1.1.0
</details>
## 快速使用 ▶️
将链接或者卡片分享到聊天群或机器人,回复分享的消息并输入`下载`即可进行下载
分享之后是没有反应的,只有对需要解析的消息回复`下载`才会响应
**默认下载状态为关闭,请在每个群内使用`/ncm t`开启,私聊则默认开启**
![a1v9gk.png](https://files.catbox.moe/a1v9gk.png)
## 注意说明 ⚠️
- 使用的网易云账号**需要拥有黑胶VIP**
- 默认下载最高音质的音乐,可以修改`ncm_bitrate`项更改音乐品质
- 本程序实质为调用web接口下载音乐上传
### 命令列表 📃
| 命令 | 备注 |
|--------------------|-----------|
| /ncm | 获取命令菜单 |
| /ncm t | 开启下载 |
| /ncm f | 关闭下载 |
| /ncm search t | 开启点歌 |
| /ncm search f | 关闭点歌 |
| /点歌 歌名 | 点歌 |
| /ncm private qq号 t | 开启该用户私聊下载 |
| /ncm private qq号 f | 关闭该用户私聊下载 |
- 命令开始符号会自动识别[`COMMAND_START`](https://v2.nonebot.dev/docs/api/config#Config-command_start)项
## 配置文件说明 ⚙️
| 配置项 | 必填 | 默认值 | 说明 |
|:-----:|:----:|:----:|:----:|
| ncm_admin_level | 否 | 1 | 设置命令权限(1:仅限superusers和群主,2:在1的基础上+管理员,3:所有用户) |
| ncm_ctcode | 否 | 86 | 手机号区域码 |
| ncm_phone | 是 | | 网易云绑定的手机号(留空则二维码登录) |
| ncm_password | 是 | | 网易云账号密码(留空则短信登录) |
| ncm_bitrate | 否 | 320 | 下载码率(单位K) <=96: m4a, >=320:flac, 96< mp3 <320|
```
# 这是示例
ncm_admin_level=1 # 设置命令权限(1:仅限superusers和群主,2:在1的基础上+管理员,3:所有用户)
ncm_ctcode=86 # 手机号区域码,默认86
ncm_phone= # 手机登录,不填的话把这行删了
ncm_password= # 密码,不填的话把这行删了
ncm_playlist_zip=False # 上传歌单时是否压缩
ncm_bitrate=320 # 下载码率(单位K) 96及以下为m4a,320及以上为flac,中间mp3
```
## 功能列表 📃
- [x] 识别/下载 网易云单曲
- 链接
- 卡片
- 卡片转发
- [x] 识别/下载 网易云歌单
- 链接
- 卡片
- 卡片转发
- [x] 点歌(网易云)
- [ ] QQ音乐无损下载
# 鸣谢
- [pyncm](https://github.com/greats3an/pyncm)
- [nonebot2](https://github.com/nonebot/nonebot2)
Raw data
{
"_id": null,
"home_page": null,
"name": "nonebot-plugin-ncm",
"maintainer": "kitUIN",
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": "kulujun@gmail.com",
"keywords": "netease-cloud-music, netease, go-cqhttp, nonebot2",
"author": "kitUIN",
"author_email": "kulujun@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/ba/99/a83d7013c57e1e92ac244903497f2eeb61f838cf49d6fb5379d9a3c4f3ea/nonebot_plugin_ncm-1.6.18.tar.gz",
"platform": null,
"description": "\n\n<p align=\"center\">\n <img src=\"https://files.catbox.moe/7cy61g.png\" width=\"200\" height=\"200\" alt=\"nonebot\"></a>\n</p>\n\n<div align=\"center\">\n\n# nonebot-plugin-ncm\n\n\u2728 \u57fa\u4e8ego-cqhttp\u4e0enonebot2\u7684 \u7f51\u6613\u4e91 \u65e0\u635f\u97f3\u4e50 \u70b9\u6b4c/\u4e0b\u8f7d \u2728\n</div>\n\n<p align=\"center\">\n <a href=\"https://github.com/kitUIN/nonebot-plugin-ncm/blob/master/LICENSE\">\n <img src=\"https://img.shields.io/badge/license-Apache--2.0-green\" alt=\"license\">\n </a>\n <a href=\"https://pypi.python.org/pypi/nonebot-plugin-ncm\">\n <img src=\"https://img.shields.io/pypi/v/nonebot-plugin-ncm\" alt=\"pypi\">\n </a>\n <a href=\"https://github.com/nonebot/nonebot2/releases/tag/v2.0.1\">\n <img src=\"https://img.shields.io/static/v1?label=nonebot2&message=v2.0.1&color=brightgreen\" alt=\"nonebot\">\n </a>\n <a href=\"https://github.com/kitUIN/nonebot-plugin-ncm/releases\">\n <img src=\"https://img.shields.io/github/v/release/kitUIN/nonebot-plugin-ncm\" alt=\"release\">\n </a>\n <a href=\"https://wakatime.com/badge/user/3b5608c7-e0b6-44a2-a217-cad786040b48/project/2a431792-e82f-48f5-839c-9ee566910fe5\"><img src=\"https://wakatime.com/badge/user/3b5608c7-e0b6-44a2-a217-cad786040b48/project/2a431792-e82f-48f5-839c-9ee566910fe5.svg\" alt=\"wakatime\"></a>\n</p>\n\n\n## \u5b89\u88c5 \ud83d\udcbf\n \n<details>\n<summary>\u4f7f\u7528 nb-cli \u5b89\u88c5</summary>\n\u5728 nonebot2 \u9879\u76ee\u7684\u6839\u76ee\u5f55\u4e0b\u6253\u5f00\u547d\u4ee4\u884c, \u8f93\u5165\u4ee5\u4e0b\u6307\u4ee4\u5373\u53ef\u5b89\u88c5\n\n nb plugin install nonebot-plugin-ncm \n \u6216\u8005 \n python -m nb_cli plugin install nonebot-plugin-ncm \n \n</details>\n\n<details>\n<summary>\u4f7f\u7528\u5305\u7ba1\u7406\u5668\u5b89\u88c5</summary>\n\u5728 nonebot2 \u9879\u76ee\u7684\u63d2\u4ef6\u76ee\u5f55\u4e0b, \u6253\u5f00\u547d\u4ee4\u884c, \u6839\u636e\u4f60\u4f7f\u7528\u7684\u5305\u7ba1\u7406\u5668, \u8f93\u5165\u76f8\u5e94\u7684\u5b89\u88c5\u547d\u4ee4\n\n<details>\n<summary>pip</summary>\n\n pip install nonebot-plugin-ncm\n</details>\n<details>\n<summary>pdm</summary>\n\n pdm add nonebot-plugin-ncm\n</details>\n<details>\n<summary>poetry</summary>\n\n poetry add nonebot-plugin-ncm\n</details>\n\n\u6253\u5f00 nonebot2 \u9879\u76ee\u6839\u76ee\u5f55\u4e0b\u7684 `pyproject.toml` \u6587\u4ef6, \u5728 `[tool.nonebot]` \u90e8\u5206\u8ffd\u52a0\u5199\u5165\n\n plugins = [\"nonebot-plugin-ncm\"]\n\n</details>\n<details>\n <summary>\u5982\u679c\u5e0c\u671b\u4f7f\u7528`nonebot2 a16`\u53ca\u4ee5\u4e0b\u7248\u672c </summary>\n \n pip install nonebot-plugin-ncm==1.1.0\n</details>\n\n## \u5feb\u901f\u4f7f\u7528 \u25b6\ufe0f\n\u5c06\u94fe\u63a5\u6216\u8005\u5361\u7247\u5206\u4eab\u5230\u804a\u5929\u7fa4\u6216\u673a\u5668\u4eba,\u56de\u590d\u5206\u4eab\u7684\u6d88\u606f\u5e76\u8f93\u5165`\u4e0b\u8f7d`\u5373\u53ef\u8fdb\u884c\u4e0b\u8f7d \n\u5206\u4eab\u4e4b\u540e\u662f\u6ca1\u6709\u53cd\u5e94\u7684,\u53ea\u6709\u5bf9\u9700\u8981\u89e3\u6790\u7684\u6d88\u606f\u56de\u590d`\u4e0b\u8f7d`\u624d\u4f1a\u54cd\u5e94 \n**\u9ed8\u8ba4\u4e0b\u8f7d\u72b6\u6001\u4e3a\u5173\u95ed\uff0c\u8bf7\u5728\u6bcf\u4e2a\u7fa4\u5185\u4f7f\u7528`/ncm t`\u5f00\u542f,\u79c1\u804a\u5219\u9ed8\u8ba4\u5f00\u542f** \n![a1v9gk.png](https://files.catbox.moe/a1v9gk.png)\n\n\n## \u6ce8\u610f\u8bf4\u660e \u26a0\ufe0f\n- \u4f7f\u7528\u7684\u7f51\u6613\u4e91\u8d26\u53f7**\u9700\u8981\u62e5\u6709\u9ed1\u80f6VIP** \n- \u9ed8\u8ba4\u4e0b\u8f7d\u6700\u9ad8\u97f3\u8d28\u7684\u97f3\u4e50,\u53ef\u4ee5\u4fee\u6539`ncm_bitrate`\u9879\u66f4\u6539\u97f3\u4e50\u54c1\u8d28 \n- \u672c\u7a0b\u5e8f\u5b9e\u8d28\u4e3a\u8c03\u7528web\u63a5\u53e3\u4e0b\u8f7d\u97f3\u4e50\u4e0a\u4f20\n\n### \u547d\u4ee4\u5217\u8868 \ud83d\udcc3\n| \u547d\u4ee4 | \u5907\u6ce8 |\n|--------------------|-----------|\n| /ncm | \u83b7\u53d6\u547d\u4ee4\u83dc\u5355 |\n| /ncm t | \u5f00\u542f\u4e0b\u8f7d |\n| /ncm f | \u5173\u95ed\u4e0b\u8f7d |\n| /ncm search t | \u5f00\u542f\u70b9\u6b4c |\n| /ncm search f | \u5173\u95ed\u70b9\u6b4c |\n| /\u70b9\u6b4c \u6b4c\u540d | \u70b9\u6b4c |\n| /ncm private qq\u53f7 t | \u5f00\u542f\u8be5\u7528\u6237\u79c1\u804a\u4e0b\u8f7d |\n| /ncm private qq\u53f7 f | \u5173\u95ed\u8be5\u7528\u6237\u79c1\u804a\u4e0b\u8f7d |\n- \u547d\u4ee4\u5f00\u59cb\u7b26\u53f7\u4f1a\u81ea\u52a8\u8bc6\u522b[`COMMAND_START`](https://v2.nonebot.dev/docs/api/config#Config-command_start)\u9879\n\n\n## \u914d\u7f6e\u6587\u4ef6\u8bf4\u660e \u2699\ufe0f\n| \u914d\u7f6e\u9879 | \u5fc5\u586b | \u9ed8\u8ba4\u503c | \u8bf4\u660e |\n|:-----:|:----:|:----:|:----:|\n| ncm_admin_level | \u5426 | 1 | \u8bbe\u7f6e\u547d\u4ee4\u6743\u9650(1:\u4ec5\u9650superusers\u548c\u7fa4\u4e3b,2:\u57281\u7684\u57fa\u7840\u4e0a+\u7ba1\u7406\u5458,3:\u6240\u6709\u7528\u6237) |\n| ncm_ctcode | \u5426 | 86 | \u624b\u673a\u53f7\u533a\u57df\u7801 |\n| ncm_phone | \u662f | | \u7f51\u6613\u4e91\u7ed1\u5b9a\u7684\u624b\u673a\u53f7(\u7559\u7a7a\u5219\u4e8c\u7ef4\u7801\u767b\u5f55) |\n| ncm_password | \u662f | | \u7f51\u6613\u4e91\u8d26\u53f7\u5bc6\u7801(\u7559\u7a7a\u5219\u77ed\u4fe1\u767b\u5f55) |\n| ncm_bitrate | \u5426 | 320 | \u4e0b\u8f7d\u7801\u7387(\u5355\u4f4dK) <=96: m4a, >=320:flac, 96< mp3 <320|\n```\n# \u8fd9\u662f\u793a\u4f8b\nncm_admin_level=1 # \u8bbe\u7f6e\u547d\u4ee4\u6743\u9650(1:\u4ec5\u9650superusers\u548c\u7fa4\u4e3b,2:\u57281\u7684\u57fa\u7840\u4e0a+\u7ba1\u7406\u5458,3:\u6240\u6709\u7528\u6237)\nncm_ctcode=86 # \u624b\u673a\u53f7\u533a\u57df\u7801,\u9ed8\u8ba486\nncm_phone= # \u624b\u673a\u767b\u5f55,\u4e0d\u586b\u7684\u8bdd\u628a\u8fd9\u884c\u5220\u4e86\nncm_password= # \u5bc6\u7801,\u4e0d\u586b\u7684\u8bdd\u628a\u8fd9\u884c\u5220\u4e86\nncm_playlist_zip=False # \u4e0a\u4f20\u6b4c\u5355\u65f6\u662f\u5426\u538b\u7f29\nncm_bitrate=320 # \u4e0b\u8f7d\u7801\u7387(\u5355\u4f4dK) 96\u53ca\u4ee5\u4e0b\u4e3am4a,320\u53ca\u4ee5\u4e0a\u4e3aflac,\u4e2d\u95f4mp3\n```\n\n## \u529f\u80fd\u5217\u8868 \ud83d\udcc3\n- [x] \u8bc6\u522b/\u4e0b\u8f7d \u7f51\u6613\u4e91\u5355\u66f2\n - \u94fe\u63a5\n - \u5361\u7247\n - \u5361\u7247\u8f6c\u53d1\n- [x] \u8bc6\u522b/\u4e0b\u8f7d \u7f51\u6613\u4e91\u6b4c\u5355 \n - \u94fe\u63a5\n - \u5361\u7247\n - \u5361\u7247\u8f6c\u53d1\n- [x] \u70b9\u6b4c(\u7f51\u6613\u4e91)\n- [ ] QQ\u97f3\u4e50\u65e0\u635f\u4e0b\u8f7d\n\n# \u9e23\u8c22\n- [pyncm](https://github.com/greats3an/pyncm)\n- [nonebot2](https://github.com/nonebot/nonebot2)\n\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "\u57fa\u4e8ego-cqhttp\u4e0enonebot2\u7684 \u7f51\u6613\u4e91 \u65e0\u635f\u97f3\u4e50\u4e0b\u8f7d",
"version": "1.6.18",
"project_urls": {
"Homepage": "https://github.com/kitUIN/nonebot-plugin-ncm",
"Repository": "https://github.com/kitUIN/nonebot-plugin-ncm"
},
"split_keywords": [
"netease-cloud-music",
" netease",
" go-cqhttp",
" nonebot2"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "80cb083a7585d61828acfdcf149df1d294fb36efec1870628fc7344020dcd41d",
"md5": "367d42ca4c6c552c64abda9f77a7a240",
"sha256": "be1dab80e8e80fada7cef6129616f4e8a476590bce7ab102a4dfbf3063091826"
},
"downloads": -1,
"filename": "nonebot_plugin_ncm-1.6.18-py3-none-any.whl",
"has_sig": false,
"md5_digest": "367d42ca4c6c552c64abda9f77a7a240",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 15428,
"upload_time": "2025-01-16T02:36:16",
"upload_time_iso_8601": "2025-01-16T02:36:16.768510Z",
"url": "https://files.pythonhosted.org/packages/80/cb/083a7585d61828acfdcf149df1d294fb36efec1870628fc7344020dcd41d/nonebot_plugin_ncm-1.6.18-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ba99a83d7013c57e1e92ac244903497f2eeb61f838cf49d6fb5379d9a3c4f3ea",
"md5": "d1c0d5e8c8588c30a5803f43dadb64bb",
"sha256": "f95bc2f2502a2b46f73f29996c4d7ade707a42635b809e6d8c6e13c570522aee"
},
"downloads": -1,
"filename": "nonebot_plugin_ncm-1.6.18.tar.gz",
"has_sig": false,
"md5_digest": "d1c0d5e8c8588c30a5803f43dadb64bb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 15218,
"upload_time": "2025-01-16T02:36:18",
"upload_time_iso_8601": "2025-01-16T02:36:18.855392Z",
"url": "https://files.pythonhosted.org/packages/ba/99/a83d7013c57e1e92ac244903497f2eeb61f838cf49d6fb5379d9a3c4f3ea/nonebot_plugin_ncm-1.6.18.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-16 02:36:18",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "kitUIN",
"github_project": "nonebot-plugin-ncm",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "nonebot-plugin-ncm"
}