rumanzo / qbtchangetracker

cli tool for iteratively change trackers in qBittorrent
https://qbforums.shiki.hu/viewtopic.php?f=14&t=5625
GNU General Public License v3.0
65 stars 3 forks source link

Can I replace tracker by no tracker (removal mode)? #13

Open slrslr opened 1 week ago

slrslr commented 1 week ago

Hello, I am having hundred+ trackers that I need to remove from qbittorrent torrents. Is this tool good to use for this purpose or do you suggest better tool? I am on Linux.

The README.md suggests i can only replace one tracker by another, maybe I can replace it by nothing causing removal?

rumanzo commented 1 week ago

Hello! Huh, I never think about deletion, but I think just replace with empty value '', probably should work.

slrslr commented 1 week ago

I have tried variations:

    ./qbtchangetracker_v1.4_amd64_linux
    ./qbtchangetracker_v1.4_amd64_linux -o -n ''
    ./qbtchangetracker_v1.4_amd64_linux -o 'http://0d.kebhana.com.mx:443/announce' -n ''
    ./qbtchangetracker_v1.4_amd64_linux -o http://0d.kebhana.com.mx:443/announce -n
    ./qbtchangetracker_v1.4_amd64_linux -o http://0d.kebhana.com.mx:443/announce -n ''
    ./qbtchangetracker_v1.4_amd64_linux -o http://0d.kebhana.com.mx:443/announce
    ./qbtchangetracker_v1.4_amd64_linux --oldtracker=http://0d.kebhana.com.mx:443/announce --newtracker=
    ./qbtchangetracker_v1.4_amd64_linux --oldtracker='http://0d.kebhana.com.mx:443/announce' --newtracker=''

and all anyway asks for new/old tracker and ends with error:

Enter old tracker: http://0d.kebhana.com.mx:443/announce
Enter new tracker: 
panic: runtime error: slice bounds out of range [:-1]

goroutine 1 [running]:
main.main()
        /usr/src/qbtchangetracker/qbtchangetracker.go:92 +0x1578

$ go version go version go1.20.6 linux/amd64 Debian 11

I can also wait for qBittorrent 5.x, it may possibly include torrent deleting: https://github.com/qbittorrent/qBittorrent/pull/21056

rumanzo commented 1 week ago

It seems easy to fix. Do you want to try?

slrslr commented 1 week ago

If you can fix it, i will re-download and retry. Just let me know.

rumanzo commented 1 week ago

try https://github.com/rumanzo/qbtchangetracker/releases/tag/v1.5

slrslr commented 1 week ago

Error is gone, it processed (and indeed removed most of unwanted trackers) the files apparently without damaging these, since qbt returned no error loading torrents on the log tab, while qbtchangetracker had problem with several files, returning:

====== 
numberhere   Panic while processing torrent file /home/userhere/.local/share/data/qBittorrent/BT_backup/stringhere.fastresume:
======
Reason: interface conversion: interface {} is string, not []interface {}.
Text panic:
goroutine 1670 [running]:
runtime/debug.Stack()
        /usr/local/go/src/runtime/debug/stack.go:26 +0x5e
github.com/rumanzo/qbtchangetracker/tracker.ChangeTracker.func1()
        /usr/src/qbtchangetracker/tracker/tracker.go:16 +0x5d
panic({0x5020a0?, 0xc013155c50?})
        /usr/local/go/src/runtime/panic.go:785 +0x132
github.com/rumanzo/qbtchangetracker/tracker.ChangeTracker(0xc0000d2130, 0xc0000d2140, {0xc00499bf80, 0x63}, {0xc00022db90, 0x66}, 0x0?, 0xc0000dc4d0, 0xc0000dc540)
        /usr/src/qbtchangetracker/tracker/tracker.go:32 +0x825
created by main.main in goroutine 1
        /usr/src/qbtchangetracker/qbtchangetracker.go:124 +0x1126

======

In case you are wondering what is the content of these .fastresume, i have uploaded it here.

Second issue: The app continue to prompt for new/old tracker + confirmation + confirmation after processing all the files. So in total 4 prompts, despite i am defining the trackers using -o -n switches, preventing automation using for example bash script. But main thing is that it now works, thank you.

Third issue: The app did not remove tracker from a torrent with weird special characters in .fastresume file, details are here.

rumanzo commented 1 week ago

Thank you for your feedback and fastresumes, it really helps. I'll check and fix those issues later

stalkerok commented 1 week ago

@slrslr Removing trackers has long been implemented in the GUI for 5.0.