Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: add trackers from file instead of url #43

Open
teotikalki opened this issue Mar 2, 2025 · 5 comments
Open

Feature request: add trackers from file instead of url #43

teotikalki opened this issue Mar 2, 2025 · 5 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@teotikalki
Copy link

As the title says. It should be possible to use a local text file instead of a remote url as the tracker list.

@AtomicRobotMan0101
Copy link
Contributor

AtomicRobotMan0101 commented Mar 2, 2025

One could run a tiny webserver locally.....http://localhost/file.txt

Or on your network http://192.168.1.x/file.txt

Or within a virtual machine (VirtualBox or QEMU)

@AtomicRobotMan0101
Copy link
Contributor

AtomicRobotMan0101 commented Mar 2, 2025

Another thought, if one is running qBitTorrent with the web server interface, put the file into it's own file system.... Have it serve it's own file 😄

http://192.168.1.x:8080/file.txt

Don't see why that won't work.

@Jorman
Copy link
Owner

Jorman commented Mar 2, 2025

Hi, @teotikalki
I would like to better understand the origin of the request, because this involves modifying the script, and it can be done in two very different ways

  1. add an argument
  2. have the ability to specify a path to a file in the list of trackers to draw from
    and of course both have "difficulties" to manage

As it stands, the easiest thing you can do is to upload this list to pastebin or similar and then add the link to the trackers list to download

What would be the advantage of using a local file?

@Jorman Jorman added enhancement New feature or request question Further information is requested labels Mar 4, 2025
@teotikalki
Copy link
Author

So... one shouldn't need to either create a webserver or use an external service to run a local script whose input is a text file.

The advantage is that it would do it's job without external dependencies.

If I want to change an entry in a text file, I can do that in a terminal with nano on the line before I invoke the script. I shouldn't have to upload that edit somewhere so that it can then be downloaded... it started as a local file and it's being read by a local script (probably to manage another software instance which is running locally).

I believe that your item 1 is more practical. It is definitely the functionality I expected.

<script.sh> -f trackerlist.txt

@Jorman
Copy link
Owner

Jorman commented Mar 10, 2025

Mmm local is a strange word, it's torrents, torrents are online, trackers are online, you have to connect online to download.
What advantages would a local file have? You have to update it by hand, you have to format it the right way and compatible with the script.
A local webserver I don't recommend, and uploading your trackers file online was a suggestion, if you do a pastebin you don't need to edit the local file to upload it modified, you directly edit the file on pastebin.

Always keep in mind that the script doesn't download anything, it's all in memory, nothing is written to disk, not by the script, instead the data for each torrent involved by the trackers update is updated.

But I will tell you more, actually, the functionality you are looking for is already in the script, just edit it, if you use the .sh version:
Remove all online listings

declare -a live_trackers_list_urls=(
	"https://newtrackon.com/api/stable"
	"https://trackerslist.com/best.txt"
	"https://trackerslist.com/http.txt"
	"https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_best.txt"
	)

And then enter your list

cat >"${trackers_list}" <<'EOL'
udp://tracker.coppersurfer.tk:6969/announce
http://tracker.internetwarriors.net:1337/announce
udp://tracker.internetwarriors.net:1337/announce
[...]
http://tracker.tfile.co:80/announce
http://retracker.mgts.by:80/announce
http://peersteers.org:80/announce
http://fxtt.ru:80/announce
EOL

If you use the .py version:
Remove all online listings

live_trackers_list_urls = [
    "https://newtrackon.com/api/stable",
    "https://trackerslist.com/best.txt",
    "https://trackerslist.com/http.txt",
    "https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_best.txt",
]

And then enter your list

            trackers_list = """udp://tracker.coppersurfer.tk:6969/announce
http://tracker.internetwarriors.net:1337/announce
udp://tracker.internetwarriors.net:1337/announce
udp://tracker.opentrackr.org:1337/announce
udp://9.rarbg.to:2710/announce
udp://exodus.desync.com:6969/announce
[...]
http://retracker.mgts.by:80/announce
http://peersteers.org:80/announce
http://fxtt.ru:80/announce
"""

In theory if there are no lists to download, it will use the static list, at which point, if it does not work, I will make a correction, in that if it cannot download lists online, it must use the static, and for all intents and purposes if there are no lists specified, it must then behave the same way.
So you have exactly what you are looking for, a local list that you can control

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants