[Deluge 2.x] Deluge-console command update_tracker does not appear to do anything

General support for problems installing or using Deluge
Post Reply
nostyler
New User
New User
Posts: 2
Joined: Sat Aug 17, 2019 5:11 am

[Deluge 2.x] Deluge-console command update_tracker does not appear to do anything

Post by nostyler »

Hi,

I have been testing the new deluge-console command update_tracker and do not see it update the tracker. I realize this can be due to the force_reannounce method in libtorrent honoring the tracker's min-interval.

However, I have been trying to follow the code trail: in update_tracker.py it calls to core -> in core.py it calls to torrentmanager -> in torrentmanager.py the method does not appear to exist.

Can someone please take a look and nudge me in the right direction?
darthShadow
New User
New User
Posts: 1
Joined: Sat Aug 17, 2019 7:45 am

Re: [Deluge 2.x] Deluge-console command update_tracker does not appear to do anything

Post by darthShadow »

The function is present in libtorrent.

As for the update-tracker not working, there is another option that needs to be passed to ignore the min-interval. You could bypass the need for this option by compiling a custom libtorrent.

For RC_1_1, you need to change

Code: Select all

arg("flags") = 0
to

Code: Select all

arg("flags") = 1
@ https://github.com/arvidn/libtorrent/bl ... e.cpp#L499

For RC_1_2, you need to change

Code: Select all

static constexpr reannounce_flags_t ignore_min_interval = 0_bit;
to

Code: Select all

static constexpr reannounce_flags_t ignore_min_interval = 1_bit;
@ https://github.com/arvidn/libtorrent/bl ... .hpp#L1030
nostyler
New User
New User
Posts: 2
Joined: Sat Aug 17, 2019 5:11 am

Re: [Deluge 2.x] Deluge-console command update_tracker does not appear to do anything

Post by nostyler »

Thank you - also for your explanation on Reddit.

Topic to be closed.
basher
Member
Member
Posts: 27
Joined: Wed Sep 29, 2021 8:42 am
Location: Estonia

Re: [Deluge 2.x] Deluge-console command update_tracker does not appear to do anything

Post by basher »

Do I understand correctly this means in Deluge 1.3.x, we could truly force-reannounce by invoking

Code: Select all

torrent.handle.force_reannounce(1, -1, 1)
At least the libtorrent method runtime signature appears to be

Code: Select all

    force_reannounce(libtorrent::torrent_handle {lvalue}, int seconds=0, int tracker_idx=-1, int flags=0)
How to do this from Deluge 2, that uses libtorrent RC_1_2+ though?
mhertz
Moderator
Moderator
Posts: 1505
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: [Deluge 2.x] Deluge-console command update_tracker does not appear to do anything

Post by mhertz »

Deluge's force_reannounce() in core,py runs force_reannounce() in torrent.py, passing no args to libtorrent, so default ones used. We can change that deluge function to add a first and second arg/flag but I also thought that you had to in RC1_2 specifically change reannounce_flags_t to 1_bit and recompile, as not supporting in RC-1_2 anymore a third arg(like RC_1_1) which is the important one as you know, but I tested it nonetheless, and it seemingly works, unless i'm mistaken something.

I tested with latest debain netiso torrent, and the tracker replies back after initial announce with an interval of 900 and min-interval of 30, and by default in the deluge-function, or if changing it to self.handle.force_reannounce(1,-1,0), then when reannouncing then changes from the 15'ish minuttes countdown under next announce under tracker tab in gtkui, to 30 and if reannouncing again, then nothing happens as continues to count down - as the extra announces is scheduled for when min-interval has enountered finished, but when changing to self.handle.force_reannounce(1,-1,1), then every time pressing reannounce, then it resets back to 15 minuttes,and continues listing 'announce OK,' so seemingly min-interval ignorred, as per the additional flag defined.

If i'm wrong though, then sorry, but just to me looks like working.

From:

Code: Select all

    def force_reannounce(self):
        """Force a tracker reannounce"""
        try:
            self.handle.force_reannounce()
        except RuntimeError as ex:
            log.debug('Unable to force reannounce: %s', ex)
            return False
        return True
Into:

Code: Select all

    def force_reannounce(self):
        """Force a tracker reannounce"""
        try:
            self.handle.force_reannounce(1,-1,1)
        except RuntimeError as ex:
            log.debug('Unable to force reannounce: %s', ex)
            return False
        return True
In '../deluge/core/torrent.py', line 1330(1339 in develop branch).
basher
Member
Member
Posts: 27
Joined: Wed Sep 29, 2021 8:42 am
Location: Estonia

Re: [Deluge 2.x] Deluge-console command update_tracker does not appear to do anything

Post by basher »

Ah nice! Just to confirm, you tested it with Deluge 2 right? I tested with Deluge 1 and it seemed to work, but wasn't sure what the 3rd flags argument type should be when used in Deluge2, as for libtorrent RC_1_1 it's this, yet for RC_1_2 it's this (both links are mentioned in the 2nd post of this thread).

Note in libtorrent docs we can see the method signature as

Code: Select all

void force_reannounce (int seconds = 0, int idx = -1, reannounce_flags_t = {}) const;
Wasn't sure what reannounce_flags_t type really is. But if you confirm handle.force_reannounce(1,-1,1) works with Deluge2 the same as it does with Deluge1, then all seems good!

Another point to whoever might be interested, is that there's no real need to recompile Deluge itself. Eg from plugins you can always invoke this forced reannounce by deluge_torrent_reference.handle.force_reannounce(1,-1,1), ie the handle property of torrent gives you access to the underlying libtorrent reference.
mhertz
Moderator
Moderator
Posts: 1505
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: [Deluge 2.x] Deluge-console command update_tracker does not appear to do anything

Post by mhertz »

Yes sorry deluge2/libtorrent 1.2.14. I don't have access to deluge1, so cannot really compare, but looks like works atleast.

I made a little stupid plugin once, forcing reannouncing all torrents after x defined time, which I should change also to utilize this - anyway thanks for bringing this to our attention :)
Post Reply