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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1968bf5e020a41c73f975e87c72bb8824d521cc3d8610170fc65c6c4d1c71b5 |
|
MD5 | cd51554883b4012d47208f4b2c3de2d8 |
|
BLAKE2b-256 | 78a1bf49a59247a31cd4ccec2ffaeab8be20bae57c688e1f96e26e643b8e8e64 |
Close
Hashes for nonebot_plugin_picsearcher-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44a0e2e34fe58bcbf638f2254232698d34fad7651cacb34c5f1727b200bb8a5b |
|
MD5 | 4e7c0ca06ec4b6e842430f51fd248e0e |
|
BLAKE2b-256 | 4d7191a0db5a246d883a4f88401eb401fc818143efce7d31a645516d3bf1ae35 |