Skip to content

Instantly share code, notes, and snippets.

@FredrikBorgstrom
Last active March 3, 2016 17:45
Show Gist options
  • Save FredrikBorgstrom/76d88325b3390094dd55 to your computer and use it in GitHub Desktop.
Save FredrikBorgstrom/76d88325b3390094dd55 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Filter torrentleech
// @namespace fb
// @description remove UDEMY and TV-episodes with few seeders from Torrentleech
// @include *.torrentleech.org/torrents/browse
// @include *.torrentleech.org/torrents/browse/index/page/*
// @include *.torrentleech.org/torrents/browse/index/categories/*
// @exclude *.torrentleech.org/torrents/browse/index/query/*
// @version 1
// @grant none
// ==/UserScript==
if ($ === undefined) {
importScripts ('code.jquery.com/jquery-1.11.3.min.js');
}
var filteredMinSeeders1 = 100;
var filteredString1 = 'udemy';
var torrentRows = $('table#torrenttable tr');
var torrentRowsFiltered = torrentRows.filter (function (i, elt) {
if (elt.innerHTML.toLowerCase().indexOf(filteredString1) >=0) {
return true;
}
var catElt = $('td.category a[href~="/torrents/browse/index/categories/32"]', elt);
if (catElt.length > 0){
var seedersColumn = $('td.seeders', elt);
if (seedersColumn.length > 0) {
var nrOfSeeders = parseInt(seedersColumn[0].innerHTML);
return nrOfSeeders < filteredMinSeeders1;
}
}
return false;
});
torrentRowsFiltered.remove();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment