ComicDaysDownloader

Manga downloader for comic-days.com and other sites using the same reader

目前為 2022-09-23 提交的版本,檢視 最新版本

// ==UserScript==
// @name         ComicDaysDownloader
// @namespace    ComicDays
// @version      0.1
// @description  Manga downloader for comic-days.com and other sites using the same reader
// @homepage     https://github.com/Timesient/manga-download-scripts
// @author       Timesient
// @license      GPL-3.0
// @match        https://comic-days.com/*/*
// @match        https://shonenjumpplus.com/*/*
// @match        https://kuragebunch.com/*/*
// @match        https://www.sunday-webry.com/*/*
// @match        https://comicbushi-web.com/*/*
// @match        https://tonarinoyj.jp/*/*
// @match        https://comic-gardo.com/*/*
// @match        https://pocket.shonenmagazine.com/*/*
// @match        https://comic-zenon.com/*/*
// @match        https://comic-trail.com/*/*
// @match        https://comic-action.com/*/*
// @require      https://unpkg.com/[email protected]/dist/axios.min.js
// @require      https://unpkg.com/[email protected]/dist/jszip.min.js
// @require      https://unpkg.com/[email protected]/dist/FileSaver.min.js
// @require      https://gf.qytechs.cn/scripts/451810-imagedownloaderlib/code/ImageDownloaderLib.js?version=1096733
// @grant        GM_xmlhttpRequest
// @grant        window.onurlchange
// ==/UserScript==

(async function (axios, JSZip, saveAs, ImageDownloader) {
  'use strict';

  // reload page after url changed
  window.onurlchange = () => window.location.reload();

  // get JSON data of episode
  const jsonData = await new Promise(resolve => {
    GM_xmlhttpRequest({
      method: 'GET',
      url: window.location.origin + window.location.pathname + '.json',
      responseType: 'json',
      headers: { 'user-agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1' },
      onload: res => resolve(res.response)
    });
  });

  // get url of images and title
  const imageURLs = jsonData.readableProduct.pageStructure.pages.filter(item => item.src).map(item => item.src);
  const title = jsonData.readableProduct.title;

  // setup ImageDownloader
  ImageDownloader({
    getImagePromises,
    title
  });

  // collect promises of image
  function getImagePromises() {
    return imageURLs.map(url => axios.get(url, { responseType: 'arraybuffer' }).then(res => res.data));
  }

})(axios, JSZip, saveAs, ImageDownloader);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址