Nyaa Extreme Redux

This scrip sorts searches by seeders, it also shows the description and images if those are included. Also it grays out unseeded torrents.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        Nyaa Extreme Redux
// @namespace Original by Vietconnect with additional code by Simon1.
// @require     http://code.jquery.com/jquery-3.1.0.slim.min.js
// @include     http*://*.nyaa.*/*
// @grant       GM_xmlhttpRequest
// @version     5.1
// @description This scrip sorts searches by seeders, it also shows the description and images if those are included. Also it grays out unseeded torrents.
// ==/UserScript==

    // default sort by seeds
    if ((window.location.href.indexOf("page=search") > -1 || window.location.href.indexOf("page") == -1) && window.location.href.indexOf("sort") == -1) {
        var thing = window.location.href.indexOf("?")>-1?'&':'?';
        window.location.replace(window.location + thing + "sort=2");
        redirecting = true;
    }

 // Main
var makeOutLinkNewTab = function() {
	$("a[href*='http://']:not([href*='"+location.hostname+"'])").attr("target","_blank");
}
makeOutLinkNewTab();

if($(".tlist tr.tlistrow").length > 0) {
	$(".tlist tr.tlistrow").after("<tr class='preview-row'><td colspan=8>loading...</td></tr>");
	$(".tlist tr.tlistrow").each(function() {
		if($(this).find(".tlistsn").text() < 2 || ($(this).find(".tlistsn").text() < 5 && $(this).find(".tlistln").text() < 10)) {
			$(this).find(".tlistname a").css("color", "#A3A2A2");
			var row = $(this).next(".preview-row").remove();
		} else {		
			var	url = $(this).find(".tlistname a").attr("href");
			var row = $(this).next(".preview-row").find("td");
			GM_xmlhttpRequest({
				method: "GET",
				url: url,
				onload: function(response) {
					row.html($(response.responseText).find(".viewdescription"));
					makeOutLinkNewTab();
							}
			});
		}
	});
}