Doujins Loader

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

You will need to install an extension such as Tampermonkey, Greasemonkey 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 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.

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

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

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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

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