Skip to main content

A picsearch plugin for nonebot2

Reason this release was yanked:

bugs while using exhentai search

Project description

nonebot_plugin_picsearcher

pypi implementation wheel python license

功能

  • 从各个接口查找色图来源,目前支持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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonebot-plugin-picsearcher-0.1.1.tar.gz (9.4 kB view hashes)

Uploaded Source

Built Distribution

nonebot_plugin_picsearcher-0.1.1-py3-none-any.whl (23.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page