From 2db68129de0accf54a30b846968e232ee315d9d1 Mon Sep 17 00:00:00 2001 From: TheBeastLT Date: Sun, 7 Mar 2021 12:34:26 +0100 Subject: [PATCH] [addon] exclude rutor trackers from moch downloads --- addon/lib/magnetHelper.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/addon/lib/magnetHelper.js b/addon/lib/magnetHelper.js index 42abd29..acdeab1 100644 --- a/addon/lib/magnetHelper.js +++ b/addon/lib/magnetHelper.js @@ -13,6 +13,14 @@ const ANIME_TRACKERS = [ "http://share.camoe.cn:8080/announce", "http://t.nyaatracker.com:80/announce" ]; +// Some trackers have limits on original torrent trackers, +// where downloading ip has to seed the torrents for some amount of time, +// thus it doesn't work on mochs. +// So it's better to exclude them and try to download through DHT, +// as the torrent won't start anyway. +const LIMITED_PROVIDERS = [ + 'Rutor' +]; let BEST_TRACKERS = []; let ALL_TRACKERS = []; @@ -22,7 +30,8 @@ function getAllTrackers() { async function getMagnetLink(infoHash) { const torrent = await getTorrent(infoHash).catch(() => ({ infoHash })); - const torrentTrackers = torrent.trackers && torrent.trackers.split(','); + const torrentTrackers = !LIMITED_PROVIDERS.includes(torrent.provider) + && torrent.trackers && torrent.trackers.split(','); const animeTrackers = torrent.type === Type.ANIME ? ALL_TRACKERS : undefined; const trackers = torrentTrackers || animeTrackers;