Last active
May 23, 2024 12:57
-
-
Save iigmir/b87b768775b068cf20b66480c744e351 to your computer and use it in GitHub Desktop.
Download images on ci-en.dlsite.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Ci-en Download images | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Download images on ci-en.dlsite.com | |
// @author You | |
// @match https://ci-en.dlsite.com/creator/**/article/** | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=dlsite.com | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
// Your code here... | |
const download_images = () => { | |
const a = document.createElement("a"); | |
const click_event = (its, index) => { | |
window.setTimeout( () => { | |
a.href=its.dataset.raw; | |
a.target = "_blank"; | |
console.log( a.href ); | |
a.click(); | |
}, 500 * index ); | |
}; | |
[...document.querySelectorAll(".file-player-image-wrapper *[data-raw]")].forEach( click_event ); | |
}; | |
const init_dl_button = () => { | |
window.setTimeout( () => { | |
const btn = document.createElement("button"); | |
btn.innerText = "Download images"; | |
btn.classList.add("e-button"); | |
btn.classList.add("is-round"); | |
btn.addEventListener("click", download_images); | |
document.querySelector(".c-grid-account-info").appendChild(btn); | |
}, 2000 ); | |
}; | |
init_dl_button(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment