Skip to main content

Generate short url by bot for bypassing censorship

Project description

nonebot

nonebot-plugin-shorturl

✨ 为 NoneBot 插件提供短链接服务支持 ✨

license pypi python

安装

pip install nonebot-plugin-shorturl
poetry add nonebot-plugin-shorturl
pdm add nonebot-plugin-shorturl

# 特定后端
pip install nonebot-plugin-shorturl[redis]
pip install nonebot-plugin-shorturl[diskcache]

# 所有后端
pip install nonebot-plugin-shorturl[all]

使用方式

.env 文件中添加必填的配置项

配置项

通用配置项

  • SHORTURL_HOST(必填):用于为外部插件构造完整的包含域名的短链接。示例值:http://localhost:8080
  • SHORTURL_ENDPOINT:指定短链接服务的入口点模板。默认值:/shorturl/{token},可以自定义为 /s/{token}
  • SHORTURL_CACHE_TYPE:指定短链接服务的后端缓存类型,可选值:memory | diskcache | redis

差分配置项

Redis

  • SHORTURL_REDIS_HOST:Redis 后端的地址
  • SHORTURL_REDIS_PORT:Redis 后端的端口
  • SHORTURL_REDIS_DB:Redis DB 配置项
  • SHORTURL_REDIS_USERNAME:Redis 用户名
  • SHORTURL_REDIS_PASSWORD:Redis 密码

Diskcache

  • SHORTURL_DISKCACHE_FOLDER:Diskcache 文件持久化目录

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_shorturl-0.4.0.tar.gz (5.0 kB view hashes)

Uploaded Source

Built Distribution

nonebot_plugin_shorturl-0.4.0-py3-none-any.whl (7.0 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