kp4jd2

Generate a list of links for JD2 from kemono.party posts. Package name included at end for easier copy-pasta, and you should set up Packagizer so the images sort properly (ie. <jd:indexof>_<jd:orgfilename>)

2022/03/17のページです。最新版はこちら。

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください。
// ==UserScript==
// @name         kp4jd2
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  Generate a list of links for JD2 from kemono.party posts. Package name included at end for easier copy-pasta, and you should set up Packagizer so the images sort properly (ie. <jd:indexof>_<jd:orgfilename>)
// @author       You
// @match        https://kemono.party/*/user/*/post/*
// @icon         https://www.google.com/s2/favicons?domain=kemono.party
// @grant        none
// @require      http://code.jquery.com/jquery-latest.min.js
// @license      MIT
// ==/UserScript==
var $ = window.jQuery;

(function() {
    'use strict';

    $(document).ready(function () {
        $(".post__header").after("<div class='kpdlh'></div>");
        $(".kpdlh").append(`<button class="kpdl">Generate List for JD2</button>`).css("padding","0.5rem");
        $(".kpdl").click(function() {genList();});

        function genList() {
            let srcList = "";
            $(".post__files .post__thumbnail a.image-link").each(function() {
                let tmtl = $(this).attr("href");
                let url = "https://kemono.party"+tmtl;
                srcList += url + " ";
            });
            $(".post__attachment a.post__attachment-link").each(function() {
                let tmtl = $(this).attr("href");
                let url = "https://kemono.party"+tmtl;
                srcList += url + " ";
            });

            srcList += $(".post__title").text();
            navigator.clipboard.writeText(srcList);

            $(".kpdlh").append(`<span class="kpdlfb">List copied to Clipboard.</span>`);
            $(".kpdlfb").css("margin-left","0.5rem");
            setTimeout(function() {
                $(".kpdlfb").fadeOut(500, function() {
                    $(".kpdlfb").remove()});
            }, 2000);
        }
    });
})();