Some private trackers answer Unregistered torrent for a short time after a torrent was uploaded. If autodl-irssi or autobrr sends a new torrent to Deluge within seconds of the upload, Deluge gets this answer first: the tracker status shows Error: Unregistered torrent, and Deluge can wait up to 30 minutes before it asks the tracker again.
Our small script shortens this wait. Every time Deluge adds a torrent, the script checks its tracker status about every 12 seconds and restarts the torrent while the tracker still refuses it. Deluge then asks the tracker again at once, and the torrent starts as soon as the tracker knows it.
Deluge basics: Deluge: Add and Manage Torrents in Your Browser. Connecting with SSH: SSH how to get connected.
1. Download the Script
Connect over SSH and run:
cd wget https://www.seedhost.eu/dl/delugetracker.sh chmod 750 ~/delugetracker.sh
Show the full path of the script; you need it in step 2:
echo ~/delugetracker.sh
/homeX/username/delugetracker.sh
2. Add the Script to Execute
Switch on the plugin Execute and add a command as in Deluge: Run Your Own Script When a Download Finishes, steps 2 and 3, with two differences:
- Event: Torrent Added
- Command: the path from step 1, for example
/homeX/username/delugetracker.sh
3. Restart Deluge Once
Deluge starts using a new command after a restart. Stop Deluge from its own window first, so that Execute also stays switched on after the restart:
- Click Connection Manager in the toolbar, select the line of your service and click Stop Daemon.
- In the Client Area, open the Apps tab and click RESTART at Deluge. Then reload the Deluge page; sign in again if it asks for your password.
Pictures of these steps are in Deluge: Install a Plugin From Another Author, step 6. Under Preferences → Plugins, Execute is now ticked.
Each time you untick and tick Execute, Deluge starts the script once more for every new torrent, until its next restart. Two or more copies of the script then restart the same torrent.
4. Check It
For every new torrent, the script writes what it does into the file script.log in your home folder. Show it:
cat ~/script.log
For a torrent that the tracker refused four times, the file starts and ends like this:
Running 1 times TorrentID: fa0db9e4de0822987e99e11fe7c87378ee6b8ee9 Tracker status: Error: Unregistered torrent ... Running 5 times TorrentID: fa0db9e4de0822987e99e11fe7c87378ee6b8ee9 Tracker status: Announce OK Found working torrent: Example.Torrent /homeX/username/downloads fa0db9e4de0822987e99e11fe7c87378ee6b8ee9
Found working torrent means that the tracker has accepted the torrent and the script has finished.
5. What the Script Does
- Deluge starts the script for every torrent it adds, also for torrents you add yourself.
- About every 12 seconds the script reads the tracker status. While it contains Unregistered, Error, Sent (as in Announce Sent), Bad Gateway or End of file, the script pauses and resumes the torrent, and Deluge asks the tracker again.
- At the first other status, usually Announce OK, the script finishes. After 100 rounds it gives up.
- It also restarts a torrent whose tracker does not answer at all, for example with Error: timed out.
6. Stop Using the Script
In Deluge, open Preferences, choose Execute, select the command, click Remove and then OK. This works at once. Then delete the script and its file over SSH:
rm ~/delugetracker.sh ~/script.log
Good to Know
~/script.loggrows with every new torrent. Delete it from time to time withrm ~/script.log; the script creates it again.- Unticking Execute under Plugins does not stop the script: Deluge keeps starting it until it is restarted. Use Remove as in step 6.