This project is a torrent search and download automation tool powered by:
- LLM (Large Language Model) for turning natural language queries into optimized torrent search keywords.
- 1337x torrent search scraping to fetch results.
- qBittorrent WebUI API for automatically adding torrents to your download client.
- Full-stack app with:
- Backend (Flask + MCP server) for orchestrating LLM + torrent search + downloads.
- Frontend (React + Vite + Material UI) for a clean UI to enter queries and monitor results.
- Accepts natural language queries (e.g., “Download all Harry Potter movies”).
- LLM (via Perplexity API) expands queries into torrent-ready keywords and categorizes them (Movies, Games, TV, Music, etc.).
- Scrapes results from 1337x (using
cloudscraperto bypass Cloudflare). - Auto-fetches magnet links and sends them to qBittorrent for download.
- Simple web interface for users to enter queries and track torrent status.
TORRENT_SEARCH/
│── backend/
│ ├── llmclient.py # LLM client for query expansion (Perplexity API)
│ ├── middle.py # Flask middleware between frontend ↔ backend tools
│ ├── server.py # MCP server for torrent search + qBittorrent download
│ └── .env # Environment variables (API keys, etc.)
│
│── frontend/
│ ├── src/
│ │ ├── App.jsx # Main React UI logic
│ │ ├── App.css # Styling
│ │ └── main.jsx # Entry point
│ ├── public/
│ ├── package.json # Frontend dependencies
│ └── vite.config.js # Vite configuration
│
│── requirements.txt # Python dependencies
│── README.md # Project documentation
git clone https://github.com/Grind1503/Torrent-Downloader.git
cd torrent-searchcd backend
python -m venv venv
source venv/bin/activate # On Linux/Mac
venv\Scripts\activate # On Windowspip install -r requirements.txtCreate a .env file in backend/ with:
PERPLEXITY_API_KEY=your_perplexity_api_key_here- Start MCP server (torrent search + download):
python server.py- Start Flask middleware (LLM + MCP bridge):
python middle.pyBy default:
- MCP server runs on
http://localhost:8050 - Flask middleware runs on
http://localhost:8000
cd frontend
npm install
npm run devFrontend will start on http://localhost:5173
- Install qBittorrent.
- Enable WebUI in preferences (default:
http://localhost:8080). - Configure credentials in
server.py: - Make sure the application runs in the background.
QB_URL = "http://localhost:8080"
QB_USER = "admin"
QB_PASS = "adminadmin"- Open the frontend (
http://localhost:5173). - Enter a query like:
"Download all Marvel movies""Latest Ubuntu ISO""Call of Duty Modern Warfare"
- LLM expands it into torrent-ready search terms.
- MCP server searches 1337x, fetches magnet links, and sends them to qBittorrent.
- UI shows status of downloads (success/failure).
- Add support for multiple torrent sources beyond 1337x.
- User authentication for private use.
- Advanced filters (seeders, size, quality).
- Automatic notifications when downloads start/finish.
This project is for educational purposes only. Downloading copyrighted material without permission is illegal. The authors are not responsible for any misuse of this tool.