From befc9db8770ee071456e5fcd568f6609c9a3efb8 Mon Sep 17 00:00:00 2001 From: sqozz Date: Sun, 1 Apr 2018 01:35:01 +0200 Subject: [PATCH] Add config for valid tracker --- indexer.py | 5 +++-- settings.json | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/indexer.py b/indexer.py index ce4f97b..3352631 100644 --- a/indexer.py +++ b/indexer.py @@ -111,7 +111,7 @@ def details(): return render_template("details.html", categories=categories.categories, torrent=tf) def scrapeAll(): - TRACKER_URL = "http://tracker.lootbox.cf:6969/" + TRACKER_URL = "" statedump = requests.get(TRACKER_URL + "stats" + "?mode=statedump") return @@ -156,7 +156,8 @@ def createNewTorrent(reuqest): is_ours = False for a in announce: - if a in [b'udp://tracker.lootbox.cf:6969/announce', b'udp://tracker.lootbox.cf:6969/announce/',b'udp://tracker.lootbox.cf/announce',b'udp://tracker.lootbox.cf/announce/']: + a = a.decode("utf-8", "ignore") + if a in settings["valid_tracker"]: is_ours = True break diff --git a/settings.json b/settings.json index 8463f41..6997ccb 100644 --- a/settings.json +++ b/settings.json @@ -184,6 +184,11 @@ } ] } + ], + + "valid_tracker" : [ + "udp://tracker.lootbox.cf:6969/announce", + "udp://tracker.lootbox.cf:6969/announce/" ] }