Skip to content
Rouzax edited this page Mar 18, 2025 · 3 revisions

Welcome to the TorrentScript Wiki!

TorrentScript is a qBittorrent post-processing script that handles subtitle extraction, cleanup, and import of media into Radarr, Medusa, or Sonarr.
It ensures that all media files are properly processed before being imported, preventing incomplete or unprocessed files from being added to your library.


πŸ“Œ Key Features

βœ… Automated Post-Processing: Handles extraction, cleanup, and import after a torrent completes.
βœ… Subtitle Management: Extracts, cleans, renames, and downloads missing subtitles from OpenSubtitles.
βœ… Flexible Import Handling: Supports Medusa, Radarr, and Sonarr for importing TV shows and movies.
βœ… RemotePath Support: Ensures correct file paths are used when running the script from a different machine.
βœ… Email Notifications: Get alerts about processing results.
βœ… Logging & Error Handling: Keeps detailed logs for debugging.


πŸš€ How It Works

  1. Torrent completes in qBittorrent
  2. Script is triggered automatically
    • Extracts files (if necessary)
    • Processes subtitles
    • Moves files to the correct folder
    • Sends the correct import path to Medusa, Radarr, or Sonarr
  3. Media is imported into your library πŸŽ‰

πŸ”§ Setup Guide

  1. Install Required Tools

  2. Configure config.json

  3. Set Up qBittorrent

    • Add post-processing script
    • Ensure torrents are stored in unique folders
    • Set Remote Path Mapping if needed
  4. Run the Script

    • The script will automatically process new torrents when qBittorrent completes a download

πŸ”„ Supported Media Managers

TorrentScript supports importing files into the following applications:

Application Purpose API Used
Medusa TV Show Management /api
Radarr Movie Management /api/v3
Sonarr TV Show Management /api/v3

πŸ’‘ You can choose Medusa or Sonarr for TV show imports using the "ImportPrograms" setting in config.json.


❓ Frequently Asked Questions

Q: Does this script work on Linux?
A: This script is written in PowerShell and is designed for Windows Server. However, you may be able to adapt it for Linux using PowerShell Core.

Q: Can I use this script if my torrent client runs on another machine?
A: Yes! The RemotePath setting ensures that Medusa, Radarr, and Sonarr always receive the correct file path, even when running the script from a different computer.

Q: What happens if the script encounters an error?
A: Errors are logged in the LogArchivePath directory, and an email notification (if configured) will be sent.

Q: Can I use both Medusa and Sonarr at the same time?
A: No, you must choose one for TV shows using "ImportPrograms": { "TV": "Sonarr" } or "Medusa".