PussyTorrents display images on list page

The list page shows the images from the torrent data sheet.

  1. // ==UserScript==
  2. // @name PussyTorrents display images on list page
  3. // @name:hu PussyTorrents torrenten, képek megjelenítése listaoldalon
  4. // @author Kepek
  5. // @description The list page shows the images from the torrent data sheet.
  6. // @description:hu A lista oldalon megmutatja a képeket, az adatlapról kiolvasva
  7. // @namespace https://openuserjs.org/users/Kepek
  8. // @license MIT
  9. // @version 1
  10. // @include https://pussytorrents.org/torrents/browse*
  11. // @compatible Greasemonkey
  12. // @require https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js
  13. // ==/UserScript==
  14.  
  15. //if the images do not appear, press F5
  16.  
  17.  
  18. var site = "https://pussytorrents.org";
  19.  
  20. var delay_milliseconds = 100;
  21.  
  22. // press F5
  23. if ( window.location.href.indexOf('#') > -1 ) {
  24. var new_url = window.location.href.replace(/\#/g, '?');
  25. window.location.href = new_url;
  26. }
  27.  
  28. // images from description
  29. $('tr.even, tr.odd').each(function (index, value) {
  30.  
  31. setTimeout(function () {
  32.  
  33. var item = $('<tr style="width: max-content; padding-top: 10px;">');
  34. $(value).after( item.load( '/torrent/' + value.id + ' #torrentImages', function (responseText, textStatus, req) {
  35.  
  36. $('#torrentImages', $(this)).replaceWith('<td colspan="8">' + $('#torrentImages', $(this)).html() +'</td>');
  37.  
  38. $('a', $(this)).each(function (index2) {
  39. if ( index2 < 3 ) {
  40. var image_url = $(this).attr('href');
  41.  
  42. $('img', this).attr("src", image_url);
  43. }
  44. });
  45.  
  46. }));
  47.  
  48. }, (delay_milliseconds * (index + 1)));
  49.  
  50. });