A picsearch plugin for nonebot2
Project description
nonebot_plugin_picsearcher
- 基于nonebot2
功能
- 从各个接口查找色图来源,目前支持ascii2d exhentai iqdb saucenao trace.moe
开始使用
建议必须使用 pip
- 通过 pip 从 PyPI 安装
pip install nonebot-plugin-picsearcher
- 在 nonebot2 项目中设置 load_plugin()
nonebot.load_plugin('nonebot_plugin_picsearcher')
- 参照下文在 nonebot2 项目的环境文件 .env.* 中添加配置项
- 使用时at搜图即可
配置项
由于exhentai的接口需要cookie,因此需要在配置文件 中加入如下选项
EX_COOKIE=XXXXX
特别注意
- 由于aiohttp的某些神奇实现,默认的FormData类需要被稍微调教一下
# 在\site-packages\aiohttp\formdata.py
class FormData:
"""Helper class for multipart/form-data and
application/x-www-form-urlencoded body generation."""
def __init__(self, fields:
Iterable[Any]=(),
quote_fields: bool=True,
charset: Optional[str]=None,
boundary: Optional[str]=None) -> None:
self._writer = multipart.MultipartWriter('form-data', boundary=boundary)
self._fields = [] # type: List[Any]
self._is_multipart = False
self._quote_fields = quote_fields
self._charset = charset
- 以上,给他加一个参数(该操作不会影响其他包
纯粹是 aiolibs 的人懒)
不魔改aiohttp会怎样?
那得问问那些网站愿不愿意了()
特别感谢
优化建议
可以来抓更多网站的接口or汇报bug or pr
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
Close
Hashes for nonebot-plugin-picsearcher-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ac207a04d71dafaadf63f507e8910cb0026b82c6fdb04924dd3588ee3fa5292 |
|
MD5 | b4f36381ec7f9aaca3a18b1b55326d65 |
|
BLAKE2b-256 | 92815b2c77f0045624f10c6489e8ed94bc8d21a1339bd51dfdea489432f1458b |
Close
Hashes for nonebot_plugin_picsearcher-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15b0a10a83cbe11390fe22bac59e050944129bc9907ac38cae555c81afea361f |
|
MD5 | 702241a59ce4ffa53e847ebaf97a5151 |
|
BLAKE2b-256 | 8778d5f616401b726b701aadf9833a5d502ddc2a8f798e331e607ea5333f0e5c |