Skip to main content

NoneBotPluginLogo

nonebot-plugin-game-torrent

⭐基于Nonebot2的获取游戏种子插件⭐


⭐ 介绍

为用户在线提供游戏种子资源

📜 免责声明

💿 安装

安装

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触发,实际需要在命令前加上command_start

指令 需要内容 范围 说明 权限
游戏搜索 是 群聊、私聊 搜索游戏种子 所有人
种子源 否 群聊、私聊 管理种子源 所有人

示例:

可用源:1. Aimhaven、2. Fitgirl、3. 123资源库、4. Gamer520。 使用 /种子源 show 查看当前源,使用 /种子源 change 3 切换到 123资源库, 然后通过 /游戏搜索 奥日 搜索(123资源库支持中文关键词)。

123资源库返回正文中的公开磁力链接或网盘分享链接;网盘链接沿用输出中的 magnet 字段,也支持二维码发送。仅返回第一个可用资源链接,不解析网盘跳转, 也不自动下载文件;页面没有提供的大小或更新时间显示为 Unknown。

使用 /种子源 change 4 切换到 Gamer520, 再通过 /游戏搜索 游戏名称 搜索。提取正文中公开的磁力或网盘分享链接, 优先返回磁力链接;正文没有资源链接时,返回侧栏明确标注“免费”的官方下载入口。 网盘链接和官方入口沿用 magnet 输出字段;入口由用户在浏览器打开,插件不跟踪下载跳转, 不处理登录或付费内容;缺失大小和更新时间时显示 Unknown。 已验证真实搜索和免费入口解析;站点可能对部分请求返回 403,此时会提示搜索或获取失败。

  • /游戏搜索 赛博朋克2077
  • /搜索游戏 艾尔登法环
  • /种子源 show
  • /源 change 1

🌙 未来

  • 获取种子链接供下载
  • 链接转二维码
  • 上传群文件
  • 配置下载种子文件路劲 - [ ] 添加更多种子获取网站
  • 添加Aimhaven的种子获取
喜欢记得点个star⭐

💝 特别鸣谢

  • nonebot2: 本项目的基础,非常好用的聊天机器人框架。

Metadata

Release files for nonebot-plugin-game-torrent 0.2.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nonebot-plugin-game-torrent 0.2.6
File Size Uploaded Provenance Actions
nonebot_plugin_game_torrent-0.2.6.tar.gz 13.0 kB Without provenance Details for nonebot_plugin_game_torrent-0.2.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nonebot-plugin-game-torrent 0.2.6
File Interpreter ABI Platform Actions
nonebot_plugin_game_torrent-0.2.6-py3-none-any.whl Python 3 none any Details for nonebot_plugin_game_torrent-0.2.6-py3-none-any.whl

Total release size: 32.9 kB

Release files / nonebot_plugin_game_torrent-0.2.6.tar.gz

Download URL nonebot_plugin_game_torrent-0.2.6.tar.gz
Size 13.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3d7dde232f477c9a6146804c10014ba7dba6241e46e2e1ca037f5c92213941f4
BLAKE2b-256 checksum
How to use checksums
16db909bbe0cddefd13ba74d4319f5fafbb9be7aeab76262bec4c063c774810e
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.6-py3-none-any.whl

Download URL nonebot_plugin_game_torrent-0.2.6-py3-none-any.whl
Size 19.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b6f6d3515fde5cd31b43f773db2693fd0c7d62eaa8d08914fd9187e9684a2dbe
BLAKE2b-256 checksum
How to use checksums
c186381a3cd5bf1f604cd0cd1921c7790af19e988a3b8d4eaa4caaadc946478c
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.6

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page