nonebot-plugin-shorturl


Namenonebot-plugin-shorturl JSON
Version 0.4.0 PyPI version JSON
download
home_pagehttps://github.com/StarHeartHunt/nonebot-plugin-shorturl
SummaryGenerate short url by bot for bypassing censorship
upload_time2024-02-29 12:09:59
maintainer
docs_urlNone
authorStarHeartHunt
requires_python>=3.8,<4.0
licenseMIT
keywords nonebot nonebot2 shorturl
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <!-- markdownlint-disable MD033 MD036 MD041 -->

<p align="center">
  <a href="https://nonebot.dev/">
    <img src="https://nonebot.dev/logo.png" height="100" alt="nonebot">
  </a>
</p>

<div align="center">

# nonebot-plugin-shorturl

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

</div>

<p align="center">
  <a href="https://github.com/StarHeartHunt/nonebot-plugin-shorturl/master/LICENSE">
    <img src="https://img.shields.io/github/license/StarHeartHunt/nonebot-plugin-shorturl.svg" alt="license">
  </a>
  <a href="https://pypi.python.org/pypi/nonebot-plugin-shorturl">
    <img src="https://img.shields.io/pypi/v/nonebot-plugin-shorturl.svg" alt="pypi">
  </a>
  <img src="https://img.shields.io/badge/python-3.8+-blue.svg" alt="python">
</p>

## 安装

```bash
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 文件持久化目录


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/StarHeartHunt/nonebot-plugin-shorturl",
    "name": "nonebot-plugin-shorturl",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "nonebot,nonebot2,shorturl",
    "author": "StarHeartHunt",
    "author_email": "starheart233@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/6a/01/96d3fdc335a73886ba459b46c6abce0fb61eed7c1f4466309db507b7aa5f/nonebot_plugin_shorturl-0.4.0.tar.gz",
    "platform": null,
    "description": "<!-- markdownlint-disable MD033 MD036 MD041 -->\n\n<p align=\"center\">\n  <a href=\"https://nonebot.dev/\">\n    <img src=\"https://nonebot.dev/logo.png\" height=\"100\" alt=\"nonebot\">\n  </a>\n</p>\n\n<div align=\"center\">\n\n# nonebot-plugin-shorturl\n\n_\u2728 \u4e3a NoneBot \u63d2\u4ef6\u63d0\u4f9b\u77ed\u94fe\u63a5\u670d\u52a1\u652f\u6301 \u2728_\n\n</div>\n\n<p align=\"center\">\n  <a href=\"https://github.com/StarHeartHunt/nonebot-plugin-shorturl/master/LICENSE\">\n    <img src=\"https://img.shields.io/github/license/StarHeartHunt/nonebot-plugin-shorturl.svg\" alt=\"license\">\n  </a>\n  <a href=\"https://pypi.python.org/pypi/nonebot-plugin-shorturl\">\n    <img src=\"https://img.shields.io/pypi/v/nonebot-plugin-shorturl.svg\" alt=\"pypi\">\n  </a>\n  <img src=\"https://img.shields.io/badge/python-3.8+-blue.svg\" alt=\"python\">\n</p>\n\n## \u5b89\u88c5\n\n```bash\npip install nonebot-plugin-shorturl\npoetry add nonebot-plugin-shorturl\npdm add nonebot-plugin-shorturl\n\n# \u7279\u5b9a\u540e\u7aef\npip install nonebot-plugin-shorturl[redis]\npip install nonebot-plugin-shorturl[diskcache]\n\n# \u6240\u6709\u540e\u7aef\npip install nonebot-plugin-shorturl[all]\n```\n\n## \u4f7f\u7528\u65b9\u5f0f\n\n\u5728 `.env` \u6587\u4ef6\u4e2d\u6dfb\u52a0\u5fc5\u586b\u7684\u914d\u7f6e\u9879\n\n## \u914d\u7f6e\u9879\n\n### \u901a\u7528\u914d\u7f6e\u9879\n\n- `SHORTURL_HOST`\uff08\u5fc5\u586b\uff09\uff1a\u7528\u4e8e\u4e3a\u5916\u90e8\u63d2\u4ef6\u6784\u9020\u5b8c\u6574\u7684\u5305\u542b\u57df\u540d\u7684\u77ed\u94fe\u63a5\u3002\u793a\u4f8b\u503c\uff1a`http://localhost:8080`\n- `SHORTURL_ENDPOINT`\uff1a\u6307\u5b9a\u77ed\u94fe\u63a5\u670d\u52a1\u7684\u5165\u53e3\u70b9\u6a21\u677f\u3002\u9ed8\u8ba4\u503c\uff1a`/shorturl/{token}`\uff0c\u53ef\u4ee5\u81ea\u5b9a\u4e49\u4e3a `/s/{token}` \u7b49\n- `SHORTURL_CACHE_TYPE`\uff1a\u6307\u5b9a\u77ed\u94fe\u63a5\u670d\u52a1\u7684\u540e\u7aef\u7f13\u5b58\u7c7b\u578b\uff0c\u53ef\u9009\u503c\uff1a`memory` | `diskcache` | `redis`\n\n### \u5dee\u5206\u914d\u7f6e\u9879\n\n#### Redis\n\n- `SHORTURL_REDIS_HOST`\uff1aRedis \u540e\u7aef\u7684\u5730\u5740\n- `SHORTURL_REDIS_PORT`\uff1aRedis \u540e\u7aef\u7684\u7aef\u53e3\n- `SHORTURL_REDIS_DB`\uff1aRedis DB \u914d\u7f6e\u9879\n- `SHORTURL_REDIS_USERNAME`\uff1aRedis \u7528\u6237\u540d\n- `SHORTURL_REDIS_PASSWORD`\uff1aRedis \u5bc6\u7801\n\n#### Diskcache\n\n- `SHORTURL_DISKCACHE_FOLDER`\uff1aDiskcache \u6587\u4ef6\u6301\u4e45\u5316\u76ee\u5f55\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Generate short url by bot for bypassing censorship",
    "version": "0.4.0",
    "project_urls": {
        "Documentation": "https://github.com/StarHeartHunt/nonebot-plugin-shorturl#readme",
        "Homepage": "https://github.com/StarHeartHunt/nonebot-plugin-shorturl",
        "Repository": "https://github.com/StarHeartHunt/nonebot-plugin-shorturl"
    },
    "split_keywords": [
        "nonebot",
        "nonebot2",
        "shorturl"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5bfa977b2b053709be2abe2a62f9e7bb5b0892811888c8d4c3f4671c893be4d1",
                "md5": "7d7006cc108f3a7753db752e8a7b8ec8",
                "sha256": "34f193ca06b2c5e7b7a793513c823c83d66d48d2116318e638b247be007d33d4"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_shorturl-0.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7d7006cc108f3a7753db752e8a7b8ec8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 7034,
            "upload_time": "2024-02-29T12:09:58",
            "upload_time_iso_8601": "2024-02-29T12:09:58.388205Z",
            "url": "https://files.pythonhosted.org/packages/5b/fa/977b2b053709be2abe2a62f9e7bb5b0892811888c8d4c3f4671c893be4d1/nonebot_plugin_shorturl-0.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6a0196d3fdc335a73886ba459b46c6abce0fb61eed7c1f4466309db507b7aa5f",
                "md5": "16b163d840caa8c864bca600707b0942",
                "sha256": "9412cb5a27b69e1fa84d007257c7653ebcb0be8f2195674f9cc50668927fc04d"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_shorturl-0.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "16b163d840caa8c864bca600707b0942",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 5015,
            "upload_time": "2024-02-29T12:09:59",
            "upload_time_iso_8601": "2024-02-29T12:09:59.392369Z",
            "url": "https://files.pythonhosted.org/packages/6a/01/96d3fdc335a73886ba459b46c6abce0fb61eed7c1f4466309db507b7aa5f/nonebot_plugin_shorturl-0.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-29 12:09:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "StarHeartHunt",
    "github_project": "nonebot-plugin-shorturl",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "nonebot-plugin-shorturl"
}
        
Elapsed time: 0.19969s