Jinxin Novel ZhaoZe

下载黑沼泽俱乐部中的小说

Verze ze dne 11. 02. 2024. Zobrazit nejnovější verzi.

Tento skript by neměl být instalován přímo. Jedná se o knihovnu, kterou by měly jiné skripty využívat pomocí meta příkazu // @require https://update.sleazyfork.org/scripts/487102/1326078/Jinxin%20Novel%20ZhaoZe.js

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         Jinxin Novel ZhaoZe
// @namespace    https://gitee.com/jinxin11112/tampermonkey
// @version      0.1.2
// @description  下载黑沼泽俱乐部中的小说
// @author       jinxin
// @match        https://zhaoze.pro/*
// @require      https://update.greasyfork.org/scripts/460642/1326073/Jinxin%20Util%20Button.js
// @require      https://update.greasyfork.org/scripts/460643/1326074/Jinxin%20Util%20Download.js
// @icon         https://picdm.sunbangyan.cn/2024/02/11/afc94fe5ca129f37d1ce5d19370e77bb.jpeg
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    const excludeTags = ['div', 'blockquote', 'fieldset', 'img']

    function getMessage() {
        let messages = document.getElementsByClassName("entry-content")[0].children;
        let contentList = [];
        for (let message of messages) {
            let tagName = message.tagName;
            if (excludeTags.includes(tagName.toLowerCase())) continue;
            let content = message.innerHTML;
            if (content) {
                content = removeGarbled(content);
                contentList.push(content);
                contentList.push('\n\n')
            }
        }
        downloadFile(contentList, getTitle());
    }

    function removeGarbled(str) {
        if (!str) return str;
        str = str.replace(/ /g, ' ')
        str = str.replace(/ – 黑沼泽俱乐部/g, '')
        return str;
    }

    function getTitle() {
        let title = document.title;
        title = title.replace(' - 调教小说', '');
        title = title.replace('- 黑沼泽俱乐部', '');
        title = title.replace('-调教小说原创,翻译,转载', '');
        return title;
    }

    window.onload = () => addDownloadButton(getMessage)

})();