mirror of
https://gitlab.com/SIGBUS/nyaa.git
synced 2025-01-27 16:42:58 +00:00
Our main tracker first, then user trackers, then trackers.txt
This commit is contained in:
parent
799e9dea87
commit
7e25e6d9b8
|
@ -36,12 +36,21 @@ def default_trackers():
|
|||
|
||||
|
||||
def get_trackers(torrent):
|
||||
trackers = default_trackers()
|
||||
torrent_trackers = torrent.trackers
|
||||
trackers = OrderedSet()
|
||||
|
||||
# Our main one first
|
||||
main_announce_url = app.config.get('MAIN_ANNOUNCE_URL')
|
||||
if main_announce_url:
|
||||
trackers.add(main_announce_url)
|
||||
|
||||
# then the user ones
|
||||
torrent_trackers = torrent.trackers
|
||||
for torrent_tracker in torrent_trackers:
|
||||
trackers.add(torrent_tracker.tracker.uri)
|
||||
|
||||
# and finally our tracker list
|
||||
trackers.update(default_trackers())
|
||||
|
||||
return list(trackers)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue