Script / Action on tracker status?

General support for problems installing or using Deluge
Post Reply
Lazybones
Leecher
Leecher
Posts: 62
Joined: Sat Dec 31, 2011 11:00 pm

Script / Action on tracker status?

Post by Lazybones »

Switching back and forth between clients I am looking for a way to replicate a script I had for transmission.

One of the trackers I am on has very specific tracker status errors for when a torrent has been pulled or when it is about to be retired. I had a script that automatically removed these torrents to free up seeding slots on this tracker..

Is there a way via CLI or script I could automate removing torrents that have specific words in the tracker status message?
Cas
Top Bloke
Top Bloke
Posts: 3679
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: Script / Action on tracker status?

Post by Cas »

I think this is essentially what you are looking for, it's very untested code but should help you :)

Code: Select all

core = component.get("Core")
def on_torrents_status(torrents):
    for torrent_id, status in torrents.items():
        if "Error" in status["tracker_status"]:
            core.remove_torrent(torrent_id)

core.get_torrents_status({}, ["tracker_status"]).addCallback(on_torrents_status)
Lazybones
Leecher
Leecher
Posts: 62
Joined: Sat Dec 31, 2011 11:00 pm

Re: Script / Action on tracker status?

Post by Lazybones »

Thanks, ill give it a shot.
Post Reply