GM_archiveImages

打包下载图片

このスクリプトは単体で利用できません。右のようなメタデータを含むスクリプトから、ライブラリとして読み込まれます: // @require https://update.greatest.deepsurf.us/scripts/565289/1806498/GM_archiveImages.js

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
作者
ssnangua
バージョン
0.0.1.20260423161639
作成日
2026/02/05
更新日
2026/04/23
大きさ
2.15KB
ライセンス
不明

需要引入以下依赖:GM_pLimitGM_requestJSZipFileSaver

// @require      https://update.greatest.deepsurf.us/scripts/565266/1749341/GM_pLimit.js
// @require      https://update.greatest.deepsurf.us/scripts/565272/1806487/GM_request.js
// @require      https://update.greatest.deepsurf.us/scripts/565290/1749444/JSZip-v391.js
// @require      https://update.greatest.deepsurf.us/scripts/565291/1749445/FileSaver-205.js
// @grant        GM_xmlhttpRequest

使用:

GM_archiveImages({
  images: [
    { name: "01.jpg", url: "https://..." },
    { name: "02.jpg", url: "https://..." },
  ],
  zip: "test.zip",
  GM_xmlhttpRequest_options: {},
  concurrency: 10,
  maxRetries: 5,
  onload({ loaded, total }) {
    console.log(`下载图片:${loaded}/${total}`);
  },
  onretry({ url, currentRetry, maxRetries }) {
    console.warn(`下载失败,重试 ${currentRetry}/${maxRetries}:${url}`);
  },
  onerror({ url }) {
    console.warn(`下载失败:${url}`);
  },
  onloaded() {
    console.log("下载完成,开始打包…");
  },
  onarchive(percent) {
    console.log(`正在打包:${percent.toFixed(2)}%`);
  },
  oncomplete() {
    console.log("完成!");
  },
});