Doujins Loader

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

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

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

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

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

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

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

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.

(I already have a user style manager, let me install it!)

// ==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)
        }
    }
})();