Skip to content

gcjbr/transmission-watch-router

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

🎯 Transmission Watch Directory Router

Hey there! 👋

I made this little script because I was tired of manually organizing my downloads in Transmission. Transmission can only watch ONE directory and dumps everything in the same place. Its web interface also doesn't help. You have to go through a bunch of manual steps and writting in order to add a remote magnet link.

Why I Made This

I have this home server running Ubuntu with Transmission in Docker, and I wanted something simple:

  • Drop torrent files in different folders through my SAMBA share
  • Have them automatically download to different places
  • Get them properly labeled/categorized
  • And just... work.

I couldn't find anything that did exactly this (though I'm sure there are better solutions out there), so I decided to code this up. It's not fancy, but it gets the job done!

What You'll Need

  • A Linux box (I use Ubuntu)
  • inotify-tools package
  • Transmission (either in Docker or native)

🚀 Getting Started

  1. First, grab the required package:
sudo apt-get update
sudo apt-get install inotify-tools
  1. Get the code:
git clone https://github.com/gcjbr/transmission-watch-router
cd transmission-watch-router
  1. Make it executable:
chmod +x torrent_watcher.sh
  1. Customize it! Open torrent_watcher.sh and edit these bits:
# Set up your folders and labels
declare -A CATEGORY_MAP=(
  ["linux-isos"]="#OpenSource"
  ["open-podcasts"]="#Podcasts"
  ["educational"]="#Education"
  ["public-archives"]="#Archives"
)

# Where's your stuff?
HOST_WATCH_DIR="/path/to/watch"
CONTAINER_WATCH_DIR="/watch"        # For Docker folks
CONTAINER_DOWNLOADS_DIR="/downloads" # For Docker folks

# Your Transmission details
TRANSMISSION_CONTAINER="transmission" # Docker container name (if using Docker)
TRANSMISSION_USER="transmission"
TRANSMISSION_PASS="your_password"

🤖 Running as a Service

Want it to run automatically? Here's how:

  1. Create a service file:
sudo nano /etc/systemd/system/torrent-watcher.service
  1. Paste this in (change the username and paths!):
[Unit]
Description=Transmission Watch Directory Router
After=network.target transmission-daemon.service docker.service

[Service]
Type=simple
User=your_username
ExecStart=/path/to/torrent_watcher.sh
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target
  1. Start it up:
sudo systemctl daemon-reload
sudo systemctl enable torrent-watcher
sudo systemctl start torrent-watcher
  1. Make sure it's happy:
sudo systemctl status torrent-watcher

📝 How to Use It

  1. Set up your watch folders:
mkdir -p /path/to/watch/{linux-isos,open-podcasts,educational,public-archives}
  1. Then just drop your .torrent files in the right folder:
  • Linux ISOs go in → /path/to/watch/linux-isos/
  • Podcasts go in → /path/to/watch/open-podcasts/
  • You get the idea!

The script handles the rest - it'll see the new file, add it to Transmission, and put everything in its right place.

🐳 Using Docker?

Make sure your Transmission container can see the right folders:

volumes:
  - /path/to/watch:/watch
  - /path/to/downloads:/downloads

⚠️ Heads Up!

  • Only works on Linux (needs inotify)
  • Make sure your folders have the right permissions
  • This was made to work with Transmission in Docker, but it should work with native Transmission too. Just edit the script accordingly.

📜 License

Do whatever you want with it!


Made with ☕ and a desperate need for organization

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages