Doujins Loader

Get all of the urls from a page on Doujins.com

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Doujins Loader
// @description  Get all of the urls from a page on Doujins.com
// @namespace    https://sleazyfork.org/en/users/182876-belphegor
// @version      1
// @author       https://sleazyfork.org/en/users/182876-belphegor
// @match        https://doujins.com/*/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    window.onload = function () {
        var imgDoujin = document.querySelector("img.doujin")
        var urlList = []

        function allLoadedCallback () {
            var counter = 0
            window.doujinUrls = urlList
            window.doujinWGET = urlList.map(function (url) {
                counter++
                return `wget "${url}" -O ${counter}.jpg`
            }).join('\n')
            console.log(window.doujinWGET)
        }

        if (imgDoujin) {
            var imgDoujinNext = imgDoujin
            var iv = setInterval(function () {
                urlList.push(imgDoujinNext.dataset.file)
                if (imgDoujinNext.nextElementSibling && imgDoujinNext.nextElementSibling.dataset.file) {
                    imgDoujinNext = imgDoujinNext.nextElementSibling
                    console.log('loading next')
                } else {
                    clearInterval(iv);
                    allLoadedCallback();
                }
            }, 600)
        }
    }
})();