// ==UserScript== // @name Hide Fake Torrents on The Pirate Bay // @namespace https://www.reddit.com/r/Piracy/comments/4w0qix/now_that_kat_is_gone_i_wrote_a_small_script_that/ // @version 1.2 // @description Hide Fake Torrents on The Pirate Bay with Conditional Logic // @author https://www.reddit.com/user/nicobelic // @match https://thepiratebay.org/browse/* // @grant none // @locale English // @downloadURL none // ==/UserScript== (function() { // Change the values below if you want maxSeedsWithoutTrust = 1000; trustedTorrentsOnly = false; hideUntrustedTorrentsWithoutComments = false; hidePorn = false; dontHideJustWarn = false; disableThisCompletely = false; // Don't touch anything past this point function hide(badtorrent) { if (dontHideJustWarn) { badtorrent.css('background','#fbbdbd'); } else { badtorrent.hide(); } } if (!disableThisCompletely) { if (hidePorn) { $('#searchResult tbody tr').each(function( index ) { if ($(this).children('td:nth-child(1)').text().search('Porn') != -1) { hide( $(this) ); } }); } $('#searchResult tbody tr:not(:has(img[title="VIP"],img[title="Trusted"],img[title="Moderator"],img[title="Helper"],td[style="text-align:center;"]))').each(function( index ) { if (trustedTorrentsOnly) { hide( $(this) ); } else { if (hideUntrustedTorrentsWithoutComments) { // Max seeds exceeded AND no comments torrentSeeds = Number( $(this).children('td:nth-child(3)').text() ); if ( (torrentSeeds >= maxSeedsWithoutTrust) || ( $(this).has("img[src='//thepiratebay.org/static/img/icon_comment.gif']").length === 0) ) { hide( $(this) ); } } else { // Max seeds exceeded torrentSeeds = Number( $(this).children('td:nth-child(3)').text() ); if (torrentSeeds >= maxSeedsWithoutTrust) { hide( $(this) ); } } } }); } })();