// ==UserScript== // @name Nyaa Extract Links and Images // @version 1.0 // @description extract links and images from inside the description page to the listing page // @author JasonC // @match https://nyaa.si/ // @match https://nyaa.si/?p=* // @match https://*.nyaa.si/ // @match https://*.nyaa.si/?p=* // @grant none // @namespace https://greasyfork.org/users/165799 // @downloadURL none // ==/UserScript== var pause = true; var torRows = new Array(); var torlist = document.getElementsByClassName('torrent-list')[0]; for (var i=1;i0){ var link = document.createElement("A"); link.href = LINKs[0].href; link.innerHTML = LINKs[0].innerHTML; torRow.cells[0].appendChild(document.createElement("br")); torRow.cells[0].appendChild(link); LINKs[0].parentElement.removeChild(LINKs[0]); } var IMGs = desc.getElementsByTagName("IMG"); while (IMGs.length>0){ var img = document.createElement("IMG"); img.src = IMGs[0].src; torRow.cells[0].appendChild(document.createElement("br")); torRow.cells[0].appendChild(img); IMGs[0].parentElement.removeChild(IMGs[0]); } this.parentElement.removeChild(this); if (torRows.length > 0){ ExtractImage();} }; torRow.cells[0].appendChild(ifrm); } (function() { var MainBtn = document.createElement('INPUT'); MainBtn.type = 'button'; MainBtn.style.position = 'fixed'; MainBtn.style.top = '10px'; MainBtn.style.left = '10px'; MainBtn.style.zIndex = "9999"; MainBtn.value = 'Start'; MainBtn.onclick = function() { pause = !pause; if (pause) MainBtn.value = "Stop"; else MainBtn.value = "Start"; ExtractImage(); }; document.body.appendChild(MainBtn); })();