This file contains hidden or 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
| $defaultUrl = "http://localhost/prefixFile" | |
| $defaultExt = ".jpg" | |
| $defaultLimit = 25 | |
| param( | |
| [string] $url = $defaultUrl, | |
| [string] $ext = $defaultExt, | |
| [int] $limit = $defaultLimit | |
| ) | |
| $errorMessage = "An error occurred with " |
This file contains hidden or 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
| /* | |
| Bookmarklet to download images from manga chapters as a ZIP file | |
| Designed for specific manga websites where images are displayed in a viewer. | |
| (Warning: For personal use only. The author is not responsible for misuse or copyright violations) | |
| To use: | |
| 1. Create a new bookmark in your browser. | |
| 2. Paste this code in the bookmark URL field. | |
| ``` | |
| javascript:(async function(){const JSZIP_URL="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js",EXTS=['.png','.jpg','.jpeg','.webp'],loadScript=src=>new Promise((res,rej)=>{Object.assign(document.head.appendChild(document.createElement("script")), {src,onload:res,onerror:()=>rej(Error(`Failed to load ${src}`))})}),parseRange=(s,e)=>{const isInt=v=>/^\d+$/.test(v);return isInt(s)&&isInt(e)?Array.from({length:e-s+1},(_,i)=>+s+i):e?[s,e]:[s]},getExt=url=>EXTS.find(ext=>url.toLowerCase().endsWith(ext))?.slice(1)||"img",fetchBuffer=async url=>(await(await fetch(url)).blob()).arrayBuffer(),extractImgs=doc=>[...doc.querySelectorAll("#readerarea |