Torrent Downloader#
Search magnet links for movies and TV shows, auto-rank by quality, and push to qBittorrent for download.
Prerequisites#
- qBittorrent with Web UI enabled (default:
http://localhost:8080)
- Python 3 (no extra packages needed — uses only stdlib)
Configuration#
Set these environment variables (or edit the scripts directly):
VariableDefaultDescriptionQBT_URL``http://localhost:8080qBittorrent Web UI URLQBT_USER``adminqBittorrent usernameQBT_PASS``adminadminqBittorrent password
Workflow#
- Search magnet links using keyword
- Auto-score results (built-in Chinese subtitles > external subs; 1080P/4K preferred)
- Pick the best result and push to qBittorrent
- Report download status to user
Search#
bash
python3 {baseDir}/scripts/search_magnet.py "keyword" [--prefer-4k] [--limit N]
- Default preference: 1080P. Add
--prefer-4k for 4K priority.
- Scoring: built-in Chinese subtitles (+100) > external subtitles (+50); 4K (+80/40) > 1080P (+60/30)
- Output: JSON with
results[].magnet, results[].title, results[].score
Download#
bash
python3 {baseDir}/scripts/qbt_download.py "<magnet_url>" [--category CATEGORY]
Check Download Status#
bash
python3 {baseDir}/scripts/qbt_download.py --status
Agent Behavior Rules#
- After search, pick the highest-scored result and start download — don't show the search list to user
- After download starts, tell user: title, file size, resolution info
- If no results found, retry with English title
- Honor user's resolution preference when specified