Sleazy Fork is available in English.

hitomi.la url catcher

Copy shown content's URL and name to clipboard, maintained for JDownloader2. like https://URL%Packagename=name, and based nyaa magnet catcher thank you very much for based coder.

  1. // ==UserScript==
  2. // @name hitomi.la url catcher
  3. // @version 0.1
  4. // @description Copy shown content's URL and name to clipboard, maintained for JDownloader2. like https://URL%Packagename=name, and based nyaa magnet catcher thank you very much for based coder.
  5. // @author luminisward, aPirateAnonymous.
  6. // @license CC0 PublicDomain
  7. // @match https://hitomi.la/*
  8. // @grant none
  9. // @require https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js
  10. // @namespace https://greasyfork.org/users/2810
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. "use strict";
  15. function insertCheckbox() {
  16. var headRow = $("div.top-content");
  17. headRow.prepend(
  18. $("<tr>").append(
  19. $('<input type="checkbox" id="checkall" />')
  20. .attr("checked", true)
  21. .change(function() {
  22. $("tbody input").prop("checked", this.checked);
  23. })
  24. )
  25. );
  26.  
  27. var bodyRows = $("div.gallery-content");
  28. bodyRows.prepend(
  29. $("<tr>").append($('<input type="checkbox" />').attr("checked", true))
  30. );
  31. }
  32.  
  33. function getCheckedList() {
  34. var checkboxList = $("div.gallery-content");
  35. return $.map(checkboxList, x => true);
  36. }
  37.  
  38. function getMagnetLinks() {
  39. var bodyRows = $("div.gallery-content div h1 a");
  40. var links = $.map(bodyRows, x => x.href + "#packagename=" + x.firstChild.data);
  41. return links.filter(link => link.includes(".html"));
  42. }
  43.  
  44. /* function getName() {
  45. var bodyRows = $("div.gallery-content div.dj h1 a");
  46. return links = $.map(bodyRows, x => x.firstChild.data );
  47. } */
  48.  
  49. function insertCopyButton() {//sounyuu the CopyButton to top panel
  50. var navBar = $("div.top-content")
  51. var button = document.createElement("li");
  52. var a = document.createElement("a");
  53. $(a)
  54. .attr("href", "#")
  55. .attr("id", "copyMagnet")
  56. .text("Copy All Links")
  57. .click(e => {
  58. e.preventDefault();
  59. });
  60. button.append(a);
  61. navBar[0].append(button);
  62. }
  63.  
  64. insertCopyButton();
  65. insertCheckbox();
  66.  
  67. new ClipboardJS("#copyMagnet", {
  68. text: function() {
  69. var links = getMagnetLinks();
  70. //var names = getName();
  71. var checkedList = getCheckedList();
  72.  
  73. /* links = links.filter(function(val, i) {
  74. return checkedList[i];
  75. }); */
  76. return links.join("\n");
  77. }
  78. });
  79. })();