A very simple line to add to my script (I hope).

General support for problems installing or using Deluge
Post Reply
rick moore
New User
New User
Posts: 3
Joined: Thu Apr 28, 2022 7:47 pm

A very simple line to add to my script (I hope).

Post by rick moore »

I have a working execute script. I just need one more part.

I just need it to 'update tracker' x seconds (probably 10) but I would prefer to experiment, after any torrent download starts.

that's the only line I need to add.

I apologize for not knowing anything but I have nowhere else to go except fiverr etc, would be helpful to me and would be very grateful.
mhertz
Moderator
Moderator
Posts: 2195
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: A very simple line to add to my script (I hope).

Post by mhertz »

If using thinclient, then easiest would be use 'deluge-console', though it doesn't have an update-tracker command, but you could trigger one through pausing/resuming the torrent, so adding e.g. in shell-script(if using such):

Code: Select all

sleep 10 
deluge-console "pause $1; resume $1"
Alternatively(still for thinclient) can make a deluge client script, so either having the complete execute script in python, or just having the wanted functionality in python, e.g. if using a shell-script then instead of above, then:

Code: Select all

sleep 10 
reannounce.py $1
Plus having reannounce.py in your PATH somewhere(if not, then need add the path specifically) - here's a quick reannounce.py example:

Code: Select all

#!/bin/python

from deluge.ui.client import client
from twisted.internet import reactor
import sys

def a(self):
    def b(self):
        client.disconnect()
        reactor.stop()
    client.core.force_reannounce([sys.argv[1]]).addCallback(b)

client.connect().addCallback(a)

reactor.run()
Note that both of the examples here, is made for just localhost(deluged running on same computer as deluge), and if having deluged on other IP, then need add ip, port, user and pass to 'client.connect()' and/or deluge-console'.

Last, if not running deluge in thinclient mode, then I only know how do this from making a plugin doing such.
Post Reply