Kemono.Party Blacklist

Blacklists posts by Creator ID

Stan na 23-04-2022. Zobacz najnowsza wersja.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name				Kemono.Party Blacklist
// @namespace		https://MeusArtis.ca
// @version			1.1.6
// @author			Meus Artis
// @description	Blacklists posts by Creator ID
// @icon				https://www.google.com/s2/favicons?domain=kemono.party
// @supportURL	https://t.me/kemonoparty
// @match				https://*.kemono.party/*
// @require			https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js
// @license CC BY-NC-SA 4.0
// ==/UserScript==
const BlacklistStorage = window.localStorage;
const BlacklistButton = document.createElement("BUTTON");
const BlacklistButtonArtist = document.createElement("BUTTON");
const Blacklisted = JSON.parse(localStorage.getItem("blacklist"));
const ButtonArea = document.querySelector('.post__actions');
const ButtonAreaArtist = document.querySelector('.user-header__actions');
const HeadMeta = document.querySelector("meta[name='user']");
const HeadMetaArtist = document.querySelector("meta[name='artist_name']");
const styleSheet = document.createElement("style");
const styles = `
			.creator__blacklist{
					color:#ddd;
					font-weight:bold;
					text-shadow:#000 0px 0px 3px,#000 -1px -1px 0px,#000 1px 1px 0px;
					background-color:transparent;
					border:transparent
			}
			.user-header__blacklist {
			box-sizing: border-box;
    font-weight: bold;
		color: #fff;
		text-shadow: #000 0px 0px 3px,#000 -1px -1px 0px,#000 1px 1px 0px;
		background-color: transparent;
		border: transparent;
		-webkit-user-select: none;
		-moz-user-select: none;
		-ms-user-select: none;
		user-select: none
}
`;
if ("blacklist" in BlacklistStorage) {
	console.log("Blacklist Exists");
} else {
	alert("Blacklist does not exist, creating a new one");
	BlacklistStorage.setItem("blacklist", "[]");
}
var HeadMetaID = document.querySelector("meta[name='id']");
if (HeadMeta) {
	console.log("Blacklist Enabled (Post Page)");
	var HeadMetaID = HeadMeta.getAttribute("content");
	ButtonArea.appendChild(BlacklistButton);
} else if (HeadMetaArtist) {
	console.log("Blacklist Enabled (Artist Page)");
	var HeadMetaID = HeadMetaID.getAttribute("content");
	ButtonAreaArtist.appendChild(BlacklistButton);
} else {
	console.log("Blacklist Enabled (Recent Posts/Search Page)");
}
const UnBlacklist = Blacklisted.indexOf(HeadMetaID);
document.head.appendChild(styleSheet);
styleSheet.innerText = styles;
styleSheet.type = "text/css";
BlacklistButton.classList.add("creator__blacklist");
BlacklistButton.type = "button";
if (Blacklisted.indexOf(HeadMetaID) !== -1) {
	BlacklistButton.innerHTML = '<span class="creator__blacklist-icon">⛒</span><span>Blacklisted</span>';
	BlacklistButton.onclick = function () {
		Blacklisted.splice(UnBlacklist, 1);
		BlacklistStorage.setItem("blacklist", JSON.stringify(Blacklisted));
		alert("Creator Unblacklisted");
		location.reload();
	};
} else {
	BlacklistButton.innerHTML = '<span class="creator__blacklist-icon">⛔</span><span>Blacklist</span>';
	BlacklistButton.onclick = function () {
		Blacklisted.push(HeadMetaID);
		BlacklistStorage.setItem("blacklist", JSON.stringify(Blacklisted));
		alert("Creator Blacklisted");
		location.reload();
	};
}
Blacklisted.forEach(function (item) {
	$("article[data-user='" + item + "']").remove();
	$("article[data-id='" + item + "']").remove();
});