KurtBestor / Hitomi-Downloader

:cake: Desktop utility to download images/videos/music/text from various websites, and more.
21.6k stars 2k forks source link

https://e-hentai.org/tag/ download #5822

Open sik20852 opened 1 year ago

sik20852 commented 1 year ago

195 page It's hard to copy and insert links one by one. I'd like to get all of the taggers

rickmiron commented 1 year ago

I assembled this script for e-hentai.org, and to avoid the IP ban I put a limit of 150 pages, each page has 25 galleries. The way to use it is to enter the web page, that you want to obtain the links of the galleries, press Ctrl+Shift+C or right click and inspect, in the result of these actions go to the console tab, paste the script and press enter. After collecting all the links, it will automatically open a page and show you all the links obtained there, it is possible that the browser can block the opening, so you will have to paste this code to open it manually. A quick way to select everything is Ctrl+A.

var elementos=document.getElementsByClassName('gl3t'); var codigos=""; var pagina; var url; async function bucle(){ for(let j=0;j<150;++j){ await fetch(url) .then(response => response.text()) .then(html => {console.log("pag",j+1) pagina = (new DOMParser()).parseFromString(html, 'text/html'); elementos = pagina.getElementsByClassName('gl3t'); for (let i = 0; i < elementos.length; i++) { codigos+=elementos[i].getElementsByTagName('a')[0].href+"<"+"br>"; } try{ if((url=pagina.getElementById('dnext').href)==undefined){j=1/0;} }catch(err){console.log('es problable que tu IP tenga ban');j=1/0;} }); }escribe(); }

function escribe(){ window.open().document.write(codigos); }

for (let i = 0; i < elementos.length; i++) { codigos+=elementos[i].getElementsByTagName('a')[0].href+"<"+"br>"; } if((url=document.getElementById('dnext').href)!=undefined){bucle();}else{escribe();}

Script if a tab does not open automatically: window.open().document.write(codigos);