⭐ 介绍
为用户在线提供游戏种子资源
📜 免责声明
💿 安装
安装
pip 安装
pip install nonebot-plugin-game-torrent
- 在nonebot的pyproject.toml中的plugins = ["xxx"]添加此插件
nb-cli安装
nb plugin install nonebot-plugin-game-torrent -U
git clone安装(不推荐)
- 命令窗口
cmd下运行
git clone https://github.com/Cvandia/nonebot-plugin-game-torrent
- 在窗口运行处
将文件夹
nonebot-plugin-torrent-game复制到bot根目录下的src/plugins(或创建bot时的其他名称xxx/plugins)
注意
推荐镜像站下载
清华源https://pypi.tuna.tsinghua.edu.cn/simple
阿里源https://mirrors.aliyun.com/pypi/simple/
开发
开发环境需要 Python 3.10+ 和 uv。
git clone https://github.com/Cvandia/nonebot-plugin-game-torrent
cd nonebot-plugin-game-torrent
uv sync --locked --all-groups
常用命令:
# 运行代码检查
uv run ruff check .
# 运行测试
uv run --all-groups pytest -q
# 构建源码包和 wheel
uv build
# 添加依赖(同时更新 pyproject.toml 和 uv.lock)
uv add <package>
# 更新锁定的依赖版本
uv lock --upgrade
请将 uv.lock 提交到版本控制中,以保持开发和 CI 的依赖一致。
⚙️ 配置
当前源由 nonebot-plugin-localstore 管理,保存至插件配置目录中的
game_torrent.text,启动时读取,正常关闭时保存;源选择仍由整个机器人共享。
可通过 localstore 的 LOCALSTORE_CONFIG_DIR 或 LOCALSTORE_PLUGIN_CONFIG_DIR
配置存储位置,详见 localstore 文档。
升级时,若新位置没有配置,会自动读取旧的 ./config/game_torrent.text 并迁移,
保留原文件;已有新配置优先。
在env.中添加以下配置
| 配置 | 类型 | 必填项 | 默认值 | 说明 |
|---|---|---|---|---|
| torrent_send_format | str | 否 | "game: {game_name}\nsize: {size}\nlast_update: {last_update}\nmagnet: {magnet}\n" | 默认发送的格式 |
| magnet_to_qrcode | bool | 否 | False | 是否将magnet链接转换为二维码 |
⭐ 使用
指令:
以下示例使用 / 前缀;实际请使用机器人配置的 command_start。所有人均可在群聊或私聊使用。
| 指令 | 作用 | 示例 |
|---|---|---|
/搜游戏 游戏名 |
搜索游戏;省略游戏名时会提示输入 | /搜游戏 奥日 |
/游戏源 |
显示当前网站和网站列表 | /游戏源 |
/切换源 编号或名称 |
切换网站;省略参数时会显示列表并提示输入 | /切换源 4 或 /切换源 Gamer520 |
/游戏帮助 |
查看使用说明 | /游戏帮助 |
搜索后直接回复结果编号即可获取链接,无需重复输入命令。等待回复时可发送“取消”结束, 60 秒未回复自动结束。Aimhaven、Fitgirl 使用英文游戏名;123资源库、Gamer520 支持中文搜索。 切换网站对整个机器人生效。
旧指令继续可用:/游戏搜索、/搜索游戏、/种子源 show、/种子源 change 4、
/源 show、/源 change 4;显示、查看、更换、切换 子命令也保持兼容。
/切换游戏源 与 /切换源 等效。
示例:
可用源:1. Aimhaven、2. Fitgirl、3. 123资源库、4. Gamer520。
使用 /游戏源 查看当前源,使用 /切换源 3 切换到 123资源库,
然后通过 /搜游戏 奥日 搜索(123资源库支持中文关键词)。
123资源库返回正文中的公开磁力链接或网盘分享链接;网盘链接沿用输出中的
magnet 字段,也支持二维码发送。仅返回第一个可用资源链接,不解析网盘跳转,
也不自动下载文件;页面没有提供的大小或更新时间显示为 Unknown。
使用 /切换源 Gamer520 切换到 Gamer520,
再通过 /搜游戏 游戏名称 搜索。提取正文中公开的磁力或网盘分享链接,
优先返回磁力链接;正文没有资源链接时,返回侧栏明确标注“免费”的官方下载入口。
网盘链接和官方入口沿用 magnet 输出字段;入口由用户在浏览器打开,插件不跟踪下载跳转,
不处理登录或付费内容;缺失大小和更新时间时显示 Unknown。
已验证真实搜索和免费入口解析;站点可能对部分请求返回 403,此时会提示搜索或获取失败。
/搜游戏 赛博朋克2077/游戏源/切换源 Gamer520/游戏帮助
🌙 未来
- 获取种子链接供下载
- 链接转二维码
- 上传群文件
- 配置下载种子文件路劲
- [ ] 添加更多种子获取网站 - 添加Aimhaven的种子获取
💝 特别鸣谢
- nonebot2: 本项目的基础,非常好用的聊天机器人框架。
Metadata
Release files for nonebot-plugin-game-torrent 0.2.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nonebot_plugin_game_torrent-0.2.7.tar.gz | 14.0 kB | Without provenance | Details for nonebot_plugin_game_torrent-0.2.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nonebot_plugin_game_torrent-0.2.7-py3-none-any.whl | Python 3 | none | any | Details for nonebot_plugin_game_torrent-0.2.7-py3-none-any.whl |
Total release size: 35.0 kB
Release files / nonebot_plugin_game_torrent-0.2.7.tar.gz
| Download URL | nonebot_plugin_game_torrent-0.2.7.tar.gz |
|---|---|
| Size | 14.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0c393c24499459e1b9b559e53645bc91944686deb35cfbd73fee04316b3d8b18
|
|
BLAKE2b-256 checksum How to use checksums |
10747235da9c1807405c9e3a1b4c4cb022dedeb3eb9287b48271eca69ea235cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / nonebot_plugin_game_torrent-0.2.7-py3-none-any.whl
| Download URL | nonebot_plugin_game_torrent-0.2.7-py3-none-any.whl |
|---|---|
| Size | 21.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
13ec1c8c6526a13c345919bb4966a9305fa705cce13c005f2751fb0a6ad3bb4d
|
|
BLAKE2b-256 checksum How to use checksums |
4a80a0d530c471336ff267795c0a086b12c0e79577212c2c38f2bd55d98bda4a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for nonebot-plugin-game-torrent 0.2.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.