hitomi.la Download Tweaker

Tweaks the download script so that filenames follow %04d format

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         hitomi.la Download Tweaker
// @description  Tweaks the download script so that filenames follow %04d format
// @namespace    redturtle
// @author       redturlte
// @version      1.7
// @match        https://hitomi.la/doujinshi/*
// @match        https://hitomi.la/manga/*
// @match        https://hitomi.la/cg/*
// @match        https://hitomi.la/gamecg/*
// @noframes
// @connect      self
// @run-at       document-idle
// ==/UserScript==

$(document).ready(function () {
    download_gallery = function (galleryname) {
        $("#dl-button").hide();
        var progressbar = $("#progressbar");
        progressbar.show();
        progressbar.progressbar({
            value: false
        });

        urls_to_download = [];
        image_names_to_download = [];
        $.each(galleryinfo['files'], function (i, image) {
            var url = url_from_url_from_hash(galleryid, image);
            urls_to_download.push(url);
            image_names_to_download.push((i + 1 < 10 ? '000' + (i + 1).toString() : i + 1 < 100 ? '00' + (i + 1).toString() : i + 1 < 1000 ? '0' + (i + 1).toString() : (i + 1).toString()) + image.name.substring(image.name.length - 4, image.name.length));
        });
        zip = new JSZip();
        currently_downloading_url_index = 0;
        if (galleryname) {
            galleryname_to_download = galleryname;
        }
        download_next_image();
    };
});