ToothAndScale

Tooth's e621 Pool Downloader

Oct 5th, 2021
617
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Tooth's e621 Pool Downloader
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Quickly download e621 pools
  6. // @author ToothAndScale
  7. // @match https://e621.net/pools/*
  8. // @icon https://www.google.com/s2/favicons?domain=e621.net
  9. // @grant GM_download
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. const previewArr = document.querySelectorAll(".post-preview[data-large-file-url]");
  16. const poolName = document.querySelector(".pool-category-series").innerHTML.replace(/[^a-z0-9\s]/gi, '');
  17. console.log(poolName);
  18.  
  19. if(previewArr && poolName) {
  20. var links = new Array();
  21. previewArr.forEach(t => links.push(t.getAttribute("data-large-file-url")));
  22.  
  23. var args = new Array();
  24. links.forEach(t => args.push({url: t, name: poolName + "/" + t.split("/").pop()}));
  25.  
  26. let btn = document.createElement("button");
  27. btn.innerHTML = "Download Pool";
  28. btn.onclick = () => {
  29. args.forEach(t => GM_download(t))
  30. }
  31.  
  32. document.querySelector("#page").prepend(btn);
  33. }
  34.  
  35.  
  36. // Your code here...
  37. })();
Advertisement
Add Comment
Please, Sign In to add comment