<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-bilibili-image
_✨ b站图片下载 ✨_
<a href="./LICENSE">
<img src="https://img.shields.io/github/license/jcjrobert/nonebot-plugin-bilibili-image.svg" alt="license">
</a>
<a href="https://pypi.python.org/pypi/nonebot-plugin-bilibili-image">
<img src="https://img.shields.io/pypi/v/nonebot-plugin-bilibili-image.svg" alt="pypi">
</a>
<img src="https://img.shields.io/badge/python-3.8+-blue.svg" alt="python">
</div>
## 📖 介绍
b站封面提取,动态图片/专栏图片下载
本插件使用了 [go-cqhttp](https://github.com/Mrs4s/go-cqhttp) 的 `send_group_forward_msg` 和 `send_private_forward_msg` 接口 来发送合并转发消息,使用了 `upload_group_file` 和 `upload_private_file` 接口 来上传文件
发送私聊合并转发消息需要使用 `v1.0.0-rc2` 版本以上的 go-cqhttp
上传私聊文件需要使用 `v1.0.0-rc3` 版本以上的 go-cqhttp
## 💿 安装
<details>
<summary>使用 nb-cli 安装</summary>
在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
nb plugin install nonebot-plugin-bilibili-image
</details>
<details>
<summary>使用包管理器安装</summary>
在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
<details>
<summary>pip</summary>
pip install nonebot-plugin-bilibili-image
</details>
<details>
<summary>pdm</summary>
pdm add nonebot-plugin-bilibili-image
</details>
<details>
<summary>poetry</summary>
poetry add nonebot-plugin-bilibili-image
</details>
<details>
<summary>conda</summary>
conda install nonebot-plugin-bilibili-image
</details>
打开 nonebot2 项目的 `bot.py` 文件, 在其中写入
nonebot.load_plugin('nonebot-plugin-bilibili-image')
</details>
<details>
<summary>从 github 安装</summary>
在 nonebot2 项目的插件目录下, 打开命令行, 输入以下命令克隆此储存库
git clone https://github.com/jcjrobert/nonebot-plugin-bilibili-image.git
打开 nonebot2 项目的 `bot.py` 文件, 在其中写入
nonebot.load_plugin('src.plugins.nonebot-plugin-bilibili-image')
</details>
## ⚙️ 配置
在 nonebot2 项目的`.env`文件中添加下表中的必填配置
| 配置项 | 必填 | 默认值 | 说明 |
|:-----:|:----:|:----:|:----:|
| max_forward_msg_num | 否 | 99 | 合并转发消息条数上限 |
| bilibili_image_save_local | 否 | false | 是否将下载的压缩包保存在本地 |
如果选择保存在本地,保存的压缩包将会在机器人运行目录下的 `data/download/`下
## 🎉 使用
### 指令表
| 指令 | 说明 |
|:-----:|:----:|
| b站封面/B站封面 + bv号/url/短链接 | 可以直接附上bv号,也可以直接用的分享链接,会先提取链接然后处理,不支持av号(因为基本用不到) |
| 动态图片/动态下载/动态获取 + 动态id/url/短链接 | 同上 |
| 专栏图片/专栏下载/专栏获取 + cv号/url/短链接 | 同上 |
除了b站封面获取,都会在获取后发送文件和转发信息,转发信息用于预览(图片画质会压缩),发送文件用于使用
## 📝 更新日志
<details>
<summary>展开/收起</summary>
### 0.0.2.1
- 依赖修正
### 0.0.2
- 支持将下载的压缩包保存在本地
### 0.0.1
- 插件初次发布
</details>
## 💡 特别感谢
- [noneplugin/nonebot-plugin-imagetools](https://github.com/noneplugin/nonebot-plugin-imagetools) Nonebot2 简单图片操作插件
## 📄 开源许可
本项目使用[AGPL-3.0](./LICENSE)许可证开源
Raw data
{
"_id": null,
"home_page": "https://github.com/jcjrobert/nonebot-plugin-bilibili-image",
"name": "nonebot-plugin-bilibili-image",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "pip,nonebot2,nonebot,bilibili",
"author": "jcjrobert",
"author_email": "jcjrobbie@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/c9/26/0330459d1c1079b5c886c3bd1e5c2b46318796748436c4e4aaf6b1af1245/nonebot-plugin-bilibili-image-0.0.2.1.tar.gz",
"platform": "any",
"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-bilibili-image\n\n_\u2728 b\u7ad9\u56fe\u7247\u4e0b\u8f7d \u2728_\n\n\n<a href=\"./LICENSE\">\n <img src=\"https://img.shields.io/github/license/jcjrobert/nonebot-plugin-bilibili-image.svg\" alt=\"license\">\n</a>\n<a href=\"https://pypi.python.org/pypi/nonebot-plugin-bilibili-image\">\n <img src=\"https://img.shields.io/pypi/v/nonebot-plugin-bilibili-image.svg\" alt=\"pypi\">\n</a>\n<img src=\"https://img.shields.io/badge/python-3.8+-blue.svg\" alt=\"python\">\n\n</div>\n\n## \ud83d\udcd6 \u4ecb\u7ecd\n\nb\u7ad9\u5c01\u9762\u63d0\u53d6\uff0c\u52a8\u6001\u56fe\u7247/\u4e13\u680f\u56fe\u7247\u4e0b\u8f7d\n\n\u672c\u63d2\u4ef6\u4f7f\u7528\u4e86 [go-cqhttp](https://github.com/Mrs4s/go-cqhttp) \u7684 `send_group_forward_msg` \u548c `send_private_forward_msg` \u63a5\u53e3 \u6765\u53d1\u9001\u5408\u5e76\u8f6c\u53d1\u6d88\u606f\uff0c\u4f7f\u7528\u4e86 `upload_group_file` \u548c `upload_private_file` \u63a5\u53e3 \u6765\u4e0a\u4f20\u6587\u4ef6\n\n\u53d1\u9001\u79c1\u804a\u5408\u5e76\u8f6c\u53d1\u6d88\u606f\u9700\u8981\u4f7f\u7528 `v1.0.0-rc2` \u7248\u672c\u4ee5\u4e0a\u7684 go-cqhttp\n\n\u4e0a\u4f20\u79c1\u804a\u6587\u4ef6\u9700\u8981\u4f7f\u7528 `v1.0.0-rc3` \u7248\u672c\u4ee5\u4e0a\u7684 go-cqhttp\n\n## \ud83d\udcbf \u5b89\u88c5\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-bilibili-image\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-bilibili-image\n</details>\n<details>\n<summary>pdm</summary>\n\n pdm add nonebot-plugin-bilibili-image\n</details>\n<details>\n<summary>poetry</summary>\n\n poetry add nonebot-plugin-bilibili-image\n</details>\n<details>\n<summary>conda</summary>\n\n conda install nonebot-plugin-bilibili-image\n</details>\n\n\u6253\u5f00 nonebot2 \u9879\u76ee\u7684 `bot.py` \u6587\u4ef6, \u5728\u5176\u4e2d\u5199\u5165\n\n nonebot.load_plugin('nonebot-plugin-bilibili-image')\n\n</details>\n\n<details>\n<summary>\u4ece github \u5b89\u88c5</summary>\n\u5728 nonebot2 \u9879\u76ee\u7684\u63d2\u4ef6\u76ee\u5f55\u4e0b, \u6253\u5f00\u547d\u4ee4\u884c, \u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u514b\u9686\u6b64\u50a8\u5b58\u5e93\n\n git clone https://github.com/jcjrobert/nonebot-plugin-bilibili-image.git\n\n\u6253\u5f00 nonebot2 \u9879\u76ee\u7684 `bot.py` \u6587\u4ef6, \u5728\u5176\u4e2d\u5199\u5165\n\n nonebot.load_plugin('src.plugins.nonebot-plugin-bilibili-image')\n\n</details>\n\n## \u2699\ufe0f \u914d\u7f6e\n\n\u5728 nonebot2 \u9879\u76ee\u7684`.env`\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4e0b\u8868\u4e2d\u7684\u5fc5\u586b\u914d\u7f6e\n\n| \u914d\u7f6e\u9879 | \u5fc5\u586b | \u9ed8\u8ba4\u503c | \u8bf4\u660e |\n|:-----:|:----:|:----:|:----:|\n| max_forward_msg_num | \u5426 | 99 | \u5408\u5e76\u8f6c\u53d1\u6d88\u606f\u6761\u6570\u4e0a\u9650 |\n| bilibili_image_save_local | \u5426 | false | \u662f\u5426\u5c06\u4e0b\u8f7d\u7684\u538b\u7f29\u5305\u4fdd\u5b58\u5728\u672c\u5730 |\n\n\u5982\u679c\u9009\u62e9\u4fdd\u5b58\u5728\u672c\u5730\uff0c\u4fdd\u5b58\u7684\u538b\u7f29\u5305\u5c06\u4f1a\u5728\u673a\u5668\u4eba\u8fd0\u884c\u76ee\u5f55\u4e0b\u7684 `data/download/`\u4e0b\n\n## \ud83c\udf89 \u4f7f\u7528\n\n### \u6307\u4ee4\u8868\n\n| \u6307\u4ee4 | \u8bf4\u660e |\n|:-----:|:----:|\n| b\u7ad9\u5c01\u9762/B\u7ad9\u5c01\u9762 + bv\u53f7/url/\u77ed\u94fe\u63a5 | \u53ef\u4ee5\u76f4\u63a5\u9644\u4e0abv\u53f7\uff0c\u4e5f\u53ef\u4ee5\u76f4\u63a5\u7528\u7684\u5206\u4eab\u94fe\u63a5\uff0c\u4f1a\u5148\u63d0\u53d6\u94fe\u63a5\u7136\u540e\u5904\u7406\uff0c\u4e0d\u652f\u6301av\u53f7\uff08\u56e0\u4e3a\u57fa\u672c\u7528\u4e0d\u5230\uff09 |\n| \u52a8\u6001\u56fe\u7247/\u52a8\u6001\u4e0b\u8f7d/\u52a8\u6001\u83b7\u53d6 + \u52a8\u6001id/url/\u77ed\u94fe\u63a5 | \u540c\u4e0a |\n| \u4e13\u680f\u56fe\u7247/\u4e13\u680f\u4e0b\u8f7d/\u4e13\u680f\u83b7\u53d6 + cv\u53f7/url/\u77ed\u94fe\u63a5 | \u540c\u4e0a |\n\n\u9664\u4e86b\u7ad9\u5c01\u9762\u83b7\u53d6\uff0c\u90fd\u4f1a\u5728\u83b7\u53d6\u540e\u53d1\u9001\u6587\u4ef6\u548c\u8f6c\u53d1\u4fe1\u606f\uff0c\u8f6c\u53d1\u4fe1\u606f\u7528\u4e8e\u9884\u89c8\uff08\u56fe\u7247\u753b\u8d28\u4f1a\u538b\u7f29\uff09\uff0c\u53d1\u9001\u6587\u4ef6\u7528\u4e8e\u4f7f\u7528\n\n## \ud83d\udcdd \u66f4\u65b0\u65e5\u5fd7\n\n<details>\n<summary>\u5c55\u5f00/\u6536\u8d77</summary>\n\n### 0.0.2.1\n\n- \u4f9d\u8d56\u4fee\u6b63\n\n### 0.0.2\n\n- \u652f\u6301\u5c06\u4e0b\u8f7d\u7684\u538b\u7f29\u5305\u4fdd\u5b58\u5728\u672c\u5730\n\n### 0.0.1\n\n- \u63d2\u4ef6\u521d\u6b21\u53d1\u5e03\n\n</details>\n\n## \ud83d\udca1 \u7279\u522b\u611f\u8c22\n\n- [noneplugin/nonebot-plugin-imagetools](https://github.com/noneplugin/nonebot-plugin-imagetools) Nonebot2 \u7b80\u5355\u56fe\u7247\u64cd\u4f5c\u63d2\u4ef6\n\n## \ud83d\udcc4 \u5f00\u6e90\u8bb8\u53ef\n\n\u672c\u9879\u76ee\u4f7f\u7528[AGPL-3.0](./LICENSE)\u8bb8\u53ef\u8bc1\u5f00\u6e90\n",
"bugtrack_url": null,
"license": "AGPL-3.0 license",
"summary": "b\u7ad9\u56fe\u7247\u4e0b\u8f7d",
"version": "0.0.2.1",
"split_keywords": [
"pip",
"nonebot2",
"nonebot",
"bilibili"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "e303433f5eaec6065e673a6def9ff77b",
"sha256": "a9c165f99d4cf41a2364141050e4646a7223fab3c152aecc2f975739938fec20"
},
"downloads": -1,
"filename": "nonebot_plugin_bilibili_image-0.0.2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e303433f5eaec6065e673a6def9ff77b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 21341,
"upload_time": "2023-01-02T13:29:23",
"upload_time_iso_8601": "2023-01-02T13:29:23.983038Z",
"url": "https://files.pythonhosted.org/packages/93/03/aaf4f0f6aa9fddc3075210369192306245379cf37e5308b84f376b733afd/nonebot_plugin_bilibili_image-0.0.2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "05cbbb2589a555831fb5bdec3978e0bb",
"sha256": "bdf0f74b825faee1374e35383746b9f2d368e2969353ed3ae23c35bce47b547c"
},
"downloads": -1,
"filename": "nonebot-plugin-bilibili-image-0.0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "05cbbb2589a555831fb5bdec3978e0bb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 20852,
"upload_time": "2023-01-02T13:29:26",
"upload_time_iso_8601": "2023-01-02T13:29:26.942864Z",
"url": "https://files.pythonhosted.org/packages/c9/26/0330459d1c1079b5c886c3bd1e5c2b46318796748436c4e4aaf6b1af1245/nonebot-plugin-bilibili-image-0.0.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-02 13:29:26",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "jcjrobert",
"github_project": "nonebot-plugin-bilibili-image",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "nonebot-plugin-bilibili-image"
}