rakshasa / rtorrent

rTorrent BitTorrent client
https://github.com/rakshasa/rtorrent/wiki
GNU General Public License v2.0
4.15k stars 412 forks source link

Add tracker remove method to XMLRPC API #165

Open TheLQ opened 10 years ago

TheLQ commented 10 years ago

Currently there is no way to remove a tracker from an existing torrent with the existing XMLRPC API. The edit rutorrent plugin gets around this by erasing and recreating the entire torrent with an updated tracker list. This is hugely expensive, looses statistics, and is a very hacky workaround.

Could a simple t.remove method be added to remove an individual tracker? Would be better if there was additional support for removing an entire group.

From a patch perspective, is there a way to remove individual trackers? Looking at the source for tracker_list ( https://github.com/rakshasa/libtorrent/blob/master/src/torrent/tracker_list.cc ) I can see a clear method but not a remove method.

avijc commented 10 years ago

So the existing functionality to disable a tracker is not enough, you want to totally remove the tracker?

d3xt3r01 commented 9 years ago

Sorry for waking up an old thread but .. I still don't see a solution to the issue. A tracker just updated addresses. Now I have to go and edit all the torrent files ( via rutorrent manually .. which recreates the entire torrent file ).

I found out about d.tracker.insert which only adds a tracker ! But there is no way to delete the old one ( which makes unnecessary calls ) or to just replace the one at index 0.

Anyone has any ideas ?

Dmole commented 7 years ago

if only there was an API reference somewhere, xmlrpc localhost d.tracker.insert $H":t0:$URL" gives Invalid index but you can disable the old tracker with xmlrpc localhost t.set_enabled $H":t0" 0

kannibalox commented 7 years ago

Documentation doesn't write itself, but there's an attempt going here if you want to help out: https://rtorrent-docs.readthedocs.io/en/latest/cmd-ref.html

Dmole commented 7 years ago

kannibalox, good code is self documenting. implementing system.methodHelp or at least system.methodSignature would be best but that link looks like it's less than 1% complete...there is also the relatively incomplete https://wiki.archlinux.org/index.php/RTorrent ... Looking in the code is a bit time consuming and filled with choice comments like "// Urgh, seriously?" but this is more useful than that doc: find . -iname 'command_*.cc' | xargs -I {} grep -P "CMD.*\(\"[^\"]+\"," "{}"

dmak commented 4 months ago

I also would be interested in that feature, as I would like to replace a tracker in torrent file with another tracker.

kannibalox commented 4 months ago

I also would be interested in that feature, as I would like to replace a tracker in torrent file with another tracker.

That is still possible even without the addition of this feature: https://kannibalox.github.io/pyrosimple/changing-announce/. Even if you don't want to use pyrosimple, hopefully that provides the basic idea of how you would go about it.