你正在訪問的內容是外部程式的映像位址,僅用於使用者加速訪問,本站無法保證其可靠性。當前的連結位址(單點即可複製)為 https://greasyfork.org.cn/zh-CN/scripts/455399-comicryudownloader/discussions/305447,源站連結 點此以跳轉

ComicRyuDownloader

Manga downloader for comic-ryu.jp

< 脚本 ComicRyuDownloader 的反馈

提问 / 留言

§
发布于:2025-07-31

适配comic-ryu.jp新网页结构及unicorn.comic-ryu.jp


// ==UserScript==
// @name ComicRyuDownloader
// @namespace https://github.com/Timesient/manga-download-scripts
// @version 0.5
// @license GPL-3.0
// @author Timesient
// @description Manga downloader for comic-ryu.jp
// @icon https://comic-ryu.jp/img/icon.png
// @homepageURL https://greasyfork.org.cn/zh-CN/scripts/455399-comicryudownloader
// @supportURL https://github.com/Timesient/manga-download-scripts/issues
// @match https://*.comic-ryu.jp/*/
// @require https://unpkg.com/axios@0.27.2/dist/axios.min.js
// @require https://unpkg.com/jszip@3.7.1/dist/jszip.min.js
// @require https://unpkg.com/file-saver@2.0.5/dist/FileSaver.min.js
// @require https://update.greasyfork.org.cn/scripts/451810/1398192/ImageDownloaderLib.js
// @grant GM_info
// ==/UserScript==

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

// Wait for the page to load completely
await new Promise(resolve => {
if (document.readyState === 'complete') {
resolve();
} else {
window.addEventListener('load', resolve);
}
});

// Get all image elements with class m-viewer-page-comic-img
const imageElements = document.querySelectorAll('.m-viewer-page-comic-img');
if (imageElements.length === 0) {
console.error('No images found on the page');
return;
}

// Extract image URLs from src attributes
const imageURLs = Array.from(imageElements).map(img => {
// Get the highest quality version if available
const src = img.src || img.getAttribute('data-src') || '';
return src.replace(/@w_\d+/, '@w_2000'); // Try to get higher resolution
}).filter(url => url);

// Get title from the page
const titleElement = document.querySelector('.m-viewer-header-title') ||
document.querySelector('title');
const title = titleElement ? titleElement.textContent.trim().split(' -')[0].replace(' ', ' ') :
`comic_${Date.now()}`;

// Setup ImageDownloader
ImageDownloader.init({
maxImageAmount: imageURLs.length,
getImagePromises: getImagePromises,
title: title
});

// Collect promises of image downloads
function getImagePromises(startNum, endNum) {
return imageURLs
.slice(startNum - 1, endNum)
.map(url => axios.get(url, { responseType: 'arraybuffer' })
.then(res => res.data)
.then(ImageDownloader.fulfillHandler)
.catch(ImageDownloader.rejectHandler)
);
}

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

发布留言

登录以发布留言。