您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Download Images From Newtoki
当前为
// ==UserScript== // @name NewtokiRipper // @namespace adrian // @author adrian // @match https://newtoki468.com/webtoon/* // @version 1.0 // @description Download Images From Newtoki // @require https://cdn.jsdelivr.net/npm/@violentmonkey/shortcut@1 // @require https://unpkg.com/@zip.js/[email protected]/dist/zip-full.min.js // @grant GM_registerMenuCommand // @license MIT // ==/UserScript== const fetchImage = async (url, name) => { const blob = await fetch(url, { headers: { accept: "image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8", "accept-language": "en-US,en;q=0.9", "sec-ch-ua": '"Chromium";v="135", "Not-A.Brand";v="8"', "sec-ch-ua-mobile": "?0", "sec-ch-ua-platform": '"macOS"', "sec-fetch-dest": "image", "sec-fetch-mode": "no-cors", "sec-fetch-site": "cross-site", "sec-fetch-storage-access": "active", }, referrer: "https://newtoki468.com/", referrerPolicy: "strict-origin-when-cross-origin", body: null, method: "GET", mode: "cors", credentials: "omit", }).then((response) => response.blob()); return blob; }; const downloadImages = async () => { const progressBar = document.createElement("div"); progressBar.id = "dl-progress"; progressBar.textContent = "Starting..."; progressBar.style.padding = "20px"; progressBar.style.backgroundColor = "black"; progressBar.style.borderRadius = "10px"; progressBar.style.border = "1px solid white"; progressBar.style.boxShadow = "0 25px 50px -12px rgb(0 0 0 / 0.25)"; progressBar.style.position = "fixed"; progressBar.style.left = "50%"; progressBar.style.top = "50%"; progressBar.style.transform = "translate(-50%,-50%)"; progressBar.style.zIndex = "9999"; progressBar.style.fontSize = "20px"; progressBar.style.color = "white"; document.body.appendChild(progressBar); const images = [...document.getElementsByTagName("img")].flatMap((img) => { const attributes = [...img.attributes].filter((attr) => /^data-[a-zA-Z0-9]{1,20}/.test(attr.name), ); const actualSrc = attributes[0]?.value; if (actualSrc?.startsWith("https://img1.newtoki")) return [actualSrc]; return []; }); progressBar.textContent = `${images.length} images found.`; console.log(images); const zipWriter = new zip.ZipWriter(new zip.BlobWriter("application/zip"), { bufferedWrite: true, }); console.log("starting zip generation"); for (let i = 0; i < images.length; i++) { const imageData = await fetchImage(images[i], i); zipWriter.add(`${i + 1}.jpg`, new zip.BlobReader(imageData), {}); console.log(`fetched image ${i + 1}/${images.length}`); progressBar.textContent = `fetched image ${i + 1}/${images.length}`; } console.log("image fetching done. generating zip"); progressBar.textContent = "image fetching done. generating zip"; const blobURL = URL.createObjectURL(await zipWriter.close()); const link = document.createElement("a"); link.href = blobURL; link.download = `${document.title}.zip`; link.click(); progressBar.textContent = "done."; setTimeout(() => progressBar.remove(), 1000); }; VM.shortcut.register("cm-s", downloadImages); VM.shortcut.enable(); GM_registerMenuCommand("Download Images (Ctrl/Cmd + S)", downloadImages);
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址