E-hentai Scraper

a simple scraper in e-hentai or exhentai you can simply export filelink with this plugging and suggest to use it with idman

  1. // ==UserScript==
  2. // @name E-hentai Scraper
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.1
  5. // @description a simple scraper in e-hentai or exhentai you can simply export filelink with this plugging and suggest to use it with idman
  6. // @author jack2002jack
  7. // @match https://e-hentai.org/*
  8. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  9. // @grant unsafeWindow
  10. // @require https://code.jquery.com/jquery-3.7.1.min.js
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. (function () {
  15. 'use strict';
  16. let reg="return popUp\\('(.*?)',"
  17. let chk_value = [];
  18. let result=[];
  19. $("body > div.ido > div:nth-child(2) > table > tbody > tr:nth-child(1) > th:nth-child(2)").after("<th>download</th>")
  20. $("td.gl2c").after('<td style="text-align:center"><input/ type="checkbox" style="height:15px;width:15px" class="download"></td>')
  21. $("div.searchnav:last-child").append('<div><button id="selectAll">selectAll</button><button id="start" style="margin-left:8px;">start-downloader</button></div>')
  22. $("#start").click(() => {
  23. $("table.itg").find('input.download:checked').each(function () {
  24. let url = $(this).parent().next().children().attr('href')
  25. chk_value.push(url);
  26. });
  27. chk_value.forEach((value) => {
  28. $.ajax({
  29. url: value,
  30. method: 'get'
  31.  
  32. }).done((data) => {
  33. let detail=$(data).find("#gd5 > p:nth-child(2) > a").attr('onclick').match(reg)[1]
  34. $.post(detail,{dltype:"org",dlcheck:"Download Original Archive"}).done((data)=>{
  35. let real_url=data.match('(https:.*\\.hath.*?)"')[1]
  36. result.push(real_url+"?start=1\n")
  37. if (result.length==chk_value.length){
  38.  
  39. let elink=document.createElement("a")
  40. elink.style.display="none"
  41. elink.href=window.URL.createObjectURL(new Blob(result,{type:"text/plain"}))
  42. elink.download="export.txt"
  43. document.body.appendChild(elink)
  44. elink.click()
  45. document.body.removeChild(elink)
  46. }
  47. })
  48. })
  49. })
  50.  
  51. })
  52. $("#selectAll").click(() => {
  53. $("input.download").each(function(){
  54. $(this).prop('checked', !$(this).prop('checked'))
  55. })
  56. })
  57.  
  58. })();