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.

  1. // ==UserScript==
  2. // @name Nyaa Extreme Redux
  3. // @namespace Original by Vietconnect with additional code by Simon1.
  4. // @require http://code.jquery.com/jquery-3.1.0.slim.min.js
  5. // @include http*://*.nyaa.*/*
  6. // @grant GM_xmlhttpRequest
  7. // @version 5.1
  8. // @description This scrip sorts searches by seeders, it also shows the description and images if those are included. Also it grays out unseeded torrents.
  9. // ==/UserScript==
  10.  
  11. // default sort by seeds
  12. if ((window.location.href.indexOf("page=search") > -1 || window.location.href.indexOf("page") == -1) && window.location.href.indexOf("sort") == -1) {
  13. var thing = window.location.href.indexOf("?")>-1?'&':'?';
  14. window.location.replace(window.location + thing + "sort=2");
  15. redirecting = true;
  16. }
  17.  
  18. // Main
  19. var makeOutLinkNewTab = function() {
  20. $("a[href*='http://']:not([href*='"+location.hostname+"'])").attr("target","_blank");
  21. }
  22. makeOutLinkNewTab();
  23.  
  24. if($(".tlist tr.tlistrow").length > 0) {
  25. $(".tlist tr.tlistrow").after("<tr class='preview-row'><td colspan=8>loading...</td></tr>");
  26. $(".tlist tr.tlistrow").each(function() {
  27. if($(this).find(".tlistsn").text() < 2 || ($(this).find(".tlistsn").text() < 5 && $(this).find(".tlistln").text() < 10)) {
  28. $(this).find(".tlistname a").css("color", "#A3A2A2");
  29. var row = $(this).next(".preview-row").remove();
  30. } else {
  31. var url = $(this).find(".tlistname a").attr("href");
  32. var row = $(this).next(".preview-row").find("td");
  33. GM_xmlhttpRequest({
  34. method: "GET",
  35. url: url,
  36. onload: function(response) {
  37. row.html($(response.responseText).find(".viewdescription"));
  38. makeOutLinkNewTab();
  39. }
  40. });
  41. }
  42. });
  43. }