// ==UserScript==
// @name RARBG Filters for Movies and TV Shows [BETA]
// @namespace http://tampermonkey.net/
// @version 0.4
// @description Additional filters
// @author Kxmode
// @match *://rarbg.to/*
// @grant none
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @downloadURL none
// ==/UserScript==
$(document).ready(function() {
// TODO: Configuration possibility
var showMoviesTVFilters = true;
/* TODO: Filter Form [BETA]
$("body").prepend("");
$("#js-filters").append("
Update
");
*/
// Iterates through line items
$.each($(".lista a"), function(index, value) {
var title = $(this).attr("title");
/*
* BEGIN: NON-CATEGORY =================================================================================================
*/
// This section hides the icons [TODO: make this a form checkbox filter]
$(".lista2t tr td:nth-of-type(1)").remove();
/*
* BEGIN: MOVIES AND TV =================================================================================================
*/
if (showMoviesTVFilters)
{
// Skips torrents without titles
if (title !== undefined)
{
// This section hides torrents with IMDB ratings equal to or lower than minRating [TODO: make this a form input filter]
var minRating = 6.5;
// Loop through every span tag inside the lista class anchor tag
$.each($("span"), function(index, value) {
var ratings = $(this).text();
var imdb = ratings.indexOf("IMDB: ") + 6;
// Continue if this span has IMDB rating information
if (ratings !== undefined && imdb !== -1)
{
var rateValue = parseFloat(ratings.substring(imdb,ratings.length-3));
// Continue if this IMDB rating is a number
if (!isNaN(rateValue))
{
// Continue if the torrent's rating is equal to or less than the minRating
if (rateValue <= minRating)
{
$(this).parents(".lista2").remove();
}
}
}
});
// This section hides low-quality KORSUB torrents [TODO: make this a form checkbox filter]
if (parseInt(title.indexOf("KORSUB")) > 0)
{
$(this).parents(".lista2").remove();
}
}
}
});
/*
TODO: Filter counter [ALPHA]
$(".container-sales").prepend("