Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Tooth's e621 Pool Downloader
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description Quickly download e621 pools
- // @author ToothAndScale
- // @match https://e621.net/pools/*
- // @icon https://www.google.com/s2/favicons?domain=e621.net
- // @grant GM_download
- // ==/UserScript==
- (function() {
- 'use strict';
- const previewArr = document.querySelectorAll(".post-preview[data-large-file-url]");
- const poolName = document.querySelector(".pool-category-series").innerHTML.replace(/[^a-z0-9\s]/gi, '');
- console.log(poolName);
- if(previewArr && poolName) {
- var links = new Array();
- previewArr.forEach(t => links.push(t.getAttribute("data-large-file-url")));
- var args = new Array();
- links.forEach(t => args.push({url: t, name: poolName + "/" + t.split("/").pop()}));
- let btn = document.createElement("button");
- btn.innerHTML = "Download Pool";
- btn.onclick = () => {
- args.forEach(t => GM_download(t))
- }
- document.querySelector("#page").prepend(btn);
- }
- // Your code here...
- })();
Advertisement
Add Comment
Please, Sign In to add comment