You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何使用qBittorrent Web API修改已添加种子的分类?

修改已添加种子分类的curl命令实现

要修改qBittorrent中已添加种子的分类,你需要调用其Web API的/api/v2/torrents/setCategory接口,核心命令格式如下:

curl -s -X POST "$SERVER/api/v2/torrents/setCategory" \
  --form "category=$NEW_CATEGORY" \
  --form "hashes=$TORRENT_HASHES" -o /dev/null

参数说明

  • $NEW_CATEGORY:替换为你要设置的目标分类名称(需提前在qBittorrent中创建)
  • $TORRENT_HASHES:指定要修改的种子哈希值,多个哈希用竖线|分隔;若要批量修改符合条件的种子,可改用filter参数替代hashes,支持的过滤器值包括:all(所有种子)、downloading(正在下载)、completed(已完成)、active(活跃)、inactive(非活跃)、uncategorized(未分类)等

脚本示例

  1. 修改单个种子的分类
# 配置变量
SERVER="http://你的qbittorrent地址:端口"
NEW_CATEGORY="Movies"
TORRENT_HASH="abcdef1234567890abcdef1234567890abcdef123"

# 执行修改
curl -s -X POST "$SERVER/api/v2/torrents/setCategory" \
  --form "category=$NEW_CATEGORY" \
  --form "hashes=$TORRENT_HASH" -o /dev/null
  1. 批量修改所有未分类种子的分类
curl -s -X POST "$SERVER/api/v2/torrents/setCategory" \
  --form "category=TVShows" \
  --form "filter=uncategorized" -o /dev/null

注意事项

如果你的qBittorrent WebUI设置了账号密码,需要在curl命令中添加--user "用户名:密码"参数,例如:

curl -s -X POST "$SERVER/api/v2/torrents/setCategory" \
  --user "admin:yourpassword" \
  --form "category=$NEW_CATEGORY" \
  --form "hashes=$TORRENT_HASH" -o /dev/null

内容的提问来源于stack exchange,提问作者SwedishGojira

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.05 19:44:51