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>)
当前为
// ==UserScript==
// @name kp4jd2
// @namespace http://tampermonkey.net/
// @version 0.1
// @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 + " ";
});
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);
}
});
})();