├── README.md └── qb_skip.py /README.md: -------------------------------------------------------------------------------- 1 | # Qbittorrent强制跳过校验python脚本 2 | 3 | python版本:3+ 4 | 5 | 依赖库:python-qbitorrent 6 | 7 | 参数: 8 | 9 | | 参数 | 说明 | 10 | | ------------- | ------------- | 11 | | qb_url | webui链接 | 12 | | qb_username | webui用户名(本地跳过验证则留空) | 13 | | qb_password | webui密码 | 14 | | qb_nackup_path | qb备份的的种子文件夹路径 | 15 | | iyuu | 是否为iyuu辅种跳过校验 | 16 | 17 | 备份路径: 18 | 19 | - windows: `C:/Users//AppData/Local/qBittorrent/BT_backup/` 20 | 21 | - linux: `/home//.local/share/data/qBittorrent/BT_backup/` 22 | 23 | 运行: 24 | 25 | - `curl -O https://raw.githubusercontent.com/Hugo7650/qb_skip_hash_check_script/master/qb_skip.py` 下载脚本 26 | - `pip install python-qbittorrent` 安装依赖库 27 | - 修改py文件添加上对应的参数 28 | - 运行 29 | 30 | 请在本地环境/ssh后运行 31 | 32 | 仅在windows上测试过 33 | 34 | 原理: 35 | 36 | - 通过webapi获取到要检查的种子 37 | - 找到对应的种子文件 38 | - 复制到当前文件夹 39 | - 在qb上删除这个种子 40 | - 再添加进去并跳过校验 41 | - 对于iyuu辅种种子tracker在磁力链接里的情况, 给种子添加tracker 42 | - 最后删除当前文件夹下的副本 43 | 44 | IYUU辅种跳过校验: 45 | 1. iyuu关闭qb下载器里的"自动校验", 此时添加到qb里种子状态为暂停且未完成 46 | 2. 启动iyuu辅种程序前先清理暂停的种子 47 | 3. 辅种程序执行完毕后按上述运行步骤运行, 参数iyuu的设置为True -------------------------------------------------------------------------------- /qb_skip.py: -------------------------------------------------------------------------------- 1 | import os, shutil 2 | from qbittorrent import Client 3 | from urllib.parse import parse_qs 4 | import time 5 | 6 | qb_url = '' 7 | qb_username = '' 8 | qb_password = '' 9 | qb_backup_path = '' 10 | tmp_path = os.getcwd() + '/' 11 | iyuu = False 12 | 13 | qb = Client(qb_url) 14 | qb.login(qb_username, qb_password) 15 | torrents = qb.torrents() 16 | check_torrents=[] 17 | state = 'pausedDL' if iyuu else 'checkingUP' 18 | for torrent in torrents: 19 | if torrent['state'] == state: 20 | check_torrents.append(torrent) 21 | print('Get', len(check_torrents), 'torrents.') 22 | for torrent in check_torrents: 23 | filename = torrent['hash'] + '.torrent' 24 | shutil.copy(qb_backup_path+filename, tmp_path) 25 | qb.delete(torrent['hash']) 26 | with open(tmp_path+filename,'rb') as f: 27 | qb.download_from_file(f,save_path=torrent['save_path'],category=torrent['category'],skip_checking=True) 28 | uri = torrent['magnet_uri'].split(':', 3)[-1] 29 | params = parse_qs(uri) 30 | if iyuu and 'tr' in params.keys() and params['tr']: 31 | time.sleep(1) 32 | qb.add_trackers(torrent['hash'], params['tr']) 33 | os.remove(tmp_path + filename) 34 | if not iyuu: 35 | os.remove(tmp_path + filename) 36 | print('Force skip ' + torrent['name']) 37 | print('Finished.') 38 | --------------------------------------------------------------------------------