// ==UserScript==
// @name Pornhub Blacklister
// @version 0.8
// @description Delete unwanted pornhub.com videos with a list of blacklisted keywords (see code for the list)
// @description:de Unerwünschte Videos mit einer Blacklist von pornhub.com entfernen (siehe Code für die Liste)
// @description:fr Supprimer les vidéos indésirables de pornhub.com avec une liste noire (voir le code pour la liste)
// @description:it Rimuovere i video indesiderati da pornhub.com con una lista nera (vedi codice per la lista)
// @author J.H
// @include *pornhub.com*
// @icon https://www.google.com/s2/favicons?sz=64&domain=pornhub.com
// @grant none
// @license MIT
// @run-at document-end
// @namespace https://greasyfork.org/users/448067
// ==/UserScript==
// SETTINGS
const debug_info = true;
// Default blacklisted keywords (can be changed in the code)
// for some words add space after/before the word, to avoid false positives (e.g. "mother " will not match "motherfucker")
const blackList = [
// incest
"stepbro", "stepsis", "step bro", "step sis", "step-bro", "step-sis",
"stepdad", "step dad", "step-dad", "stepsib", "step sib", "step-sib",
"stepmom", "step mom", "step-mom", "stepson", "step son", "step-son",
"stepaunt", "step aunt", "step-aunt", "stepuncle", "step uncle", "step-uncle",
"stepcousin", "step cousin", "step-cousin", "sister's", "father ",
"mother ", "daughter", "daddy", "sister ", "brother", "stepfather",
"mommy", "granny", "family", " sister", "sis ", "bro ", "step-father",
"step father", "step-mother", "step mother", "stepmother", "grandma",
"mom ",
"soeur", "sœur", "papa", "maman", "fils", "frère", "frere", "frangine", // in french
"cousine", "famille", "mère", "familiale", "dad ", "niece", // in french
// no straight safe
"trap ", "futa", "trans ", "transgender", "shemale", "trann", "cuck", "fatboy",
"sissy", "femboy", "femboi", "tgirl ", "travest", "crossdresser", "pegging",
"t-girl", "ladyboy", " tgirl", "transgirl", "tbabe ", "ts ", "tgirls ", " tgirls",
"prostate",
// for woman
"fpov", "female pov", "female point of view", "female perspective",
"girlsrimming",
"pov femme", "femme pov", "point de vue féminin", "point de vue femme", // in french
// violence/extreme/..
"rape ", "pee", "piss ", "femdom",
"pipi", // in french
// other
"babysitter", "baby sitter", "baby-sitter", "doll ", "escort ", "feet", "foot ",
"ado ", "married", "mature ", "strapon", "cougar", "bbw",
"poupée", "poupee", "escorte ", // in french
];
// END OF SETTINGS
// debug info printing function
const cs = ["color: red", "color: white"];
const colorPrint = function(videoTitle, ...args) {
// remove arguments that contain 0
args = args.filter(arg => arg !== 0);
// print debug info
console.log(
'%c[Pornhub Blacklister]%c: ' + videoTitle + ' %c[removed]',
'color: green', 'color: white', ...args, 'color: green'
);
}
// select all elements with class "videoBox" "videoWrapper"
const divs_pc = document.querySelectorAll(".videoBox"); // Computer divs
const divs_mobile = document.querySelectorAll(".videoWrapper") // Mobile divs
const divs = divs_pc.length > 0 ? divs_pc : divs_mobile; // Select the good div between the pc and mobile divs
// loop through all elements from the div and find first <a> element, then print data-title attribute
divs.forEach((div) => {
// shitty way to get the video title because the data-title attribute is not available on mobile
let videoTitle = div.querySelector("a").getAttribute("data-title") !== null ? div.querySelector("a").getAttribute("data-title") : div?.querySelector("img")?.getAttribute("alt") ?? null;
if (videoTitle) {
blackList.forEach((blackWord) => {
// if videoTitle contains blacklisted word
if (videoTitle.toLowerCase().includes(blackWord)) {
const start = videoTitle.toLowerCase().indexOf(blackWord);
const end = start + blackWord.length;
// check if the blacklisted word finish with a space, check if it's a "real" word (not a part of another word)
if (blackWord[blackWord.length - 1] == " ") {
const beforeAndAfter = videoTitle.toLowerCase().substring(start - 1, end + 1);
if (beforeAndAfter[0] != " " && beforeAndAfter.startsWith(blackWord) == false) {
return;
}
}
// remove the video element
div.remove();
// allow printing of debug info
if (debug_info) {
// add %c before/after every blacklisted word in the video title
videoTitle = videoTitle.substring(0, start) + "%c" + videoTitle.substring(start, end) + "%c" + videoTitle.substring(end);
}
}
});
// allow printing of debug info
if (debug_info) {
// count how many blacklisted words are in the video title
const count = (videoTitle.match(/%c/g) || []).length / 2;
// if count is greater than 0, print debug info
if (count > 0) {
// little hack to print debug info in the console with red color for the blacklisted words
colorPrint(videoTitle,
count > 0 ? cs[0] : 0, count > 0 ? cs[1] : 0, count > 1 ? cs[0] : 0, count > 1 ? cs[1] : 0, count > 2 ? cs[0] : 0, count > 2 ? cs[1] : 0,
count > 3 ? cs[0] : 0, count > 3 ? cs[1] : 0, count > 4 ? cs[0] : 0, count > 4 ? cs[1] : 0, count > 5 ? cs[0] : 0, count > 5 ? cs[1] : 0
);
}
}
}
});