Pornhub Blacklister

Rimuovere i video indesiderati da pornhub.com con una lista nera (vedi codice per la lista)

  1. // ==UserScript==
  2. // @name Pornhub Blacklister
  3. // @version 0.9.1
  4. // @description Delete unwanted pornhub.com videos with a list of blacklisted keywords (see code for the list)
  5. // @description:de Unerwünschte Videos mit einer Blacklist von pornhub.com entfernen (siehe Code für die Liste)
  6. // @description:fr Supprimer les vidéos indésirables de pornhub.com avec une liste noire (voir le code pour la liste)
  7. // @description:it Rimuovere i video indesiderati da pornhub.com con una lista nera (vedi codice per la lista)
  8. // @author J.H
  9. // @include *pornhub.com*
  10. // @icon https://www.google.com/s2/favicons?sz=64&domain=pornhub.com
  11. // @grant none
  12. // @license MIT
  13. // @run-at document-end
  14. // @namespace https://greasyfork.org/users/448067
  15. // ==/UserScript==
  16.  
  17. // SETTINGS
  18. const debug_info = true; // show debug info in console (blacklisted videos, blacklisted words in the video title)
  19. // Default blacklisted keywords (can be changed in the code)
  20. // for some words add space after/before the word, to avoid false positives (e.g. "mother " will not match "motherfucker")
  21. const blackList = [
  22. // incest
  23. "stepbro", "stepsis", "step bro", "step sis", "step-bro", "step-sis", "stepdad",
  24. "step dad", "step-dad", "stepsib", "step sib", "step-sib", "stepmom", "step mom",
  25. "step-mom", "stepson", "step son", "step-son","stepaunt", "step aunt", "step-aunt",
  26. "stepuncle", "step uncle", "step-uncle", "stepcousin", "step cousin", "step-cousin",
  27. "sister's", "father ", "mother ", "daughter", "daddy", "sister ", "brother", "stepfather",
  28. "mommy", "granny", "family", " sister", "sis ", "bro ", "step-father", "step father",
  29. "step-mother", "step mother", "stepmother", "grandma", "mom ", "moms ",
  30. "soeur", "sœur", "papa", "maman", "fils", "frère", "frere", "frangine", "cousine", // in french
  31. "famille", "mère", "familiale", "dad ", "niece",
  32. // no straight safe
  33. "trap ", "futa", "trans ", "transgender", "shemale", "trann", "cuck", "fatboy",
  34. "sissy", "femboy", "femboi", "tgirl ", "travest", "crossdresser", "pegging",
  35. "t-girl", "ladyboy", " tgirl", "transgirl", "tbabe ", "ts ", "tgirls ", " tgirls",
  36. "prostate",
  37. // for woman
  38. "fpov", "female pov", "female point of view", "female perspective", "girlsrimming",
  39. "pov femme", "femme pov", "point de vue féminin", "point de vue femme", // in french
  40. // violence/extreme/..
  41. "rape ", "pee", "piss ", "femdom",
  42. "pipi", // in french
  43. // other
  44. "babysitter", "baby sitter", "baby-sitter", "doll ", "escort ", "feet", "foot ",
  45. "ado ", "married", "mature ", "strapon", "cougar", "bbw",
  46. "poupée", "poupee", "escorte ", // in french
  47. ];
  48. // END OF SETTINGS
  49.  
  50. const colorPrint = function (videoTitle, ...args) { // debug info printing function
  51. args = args.filter(arg => arg !== 0); // remove arguments that contain 0
  52. console.log('%c[Pornhub Blacklister]:%c ' + videoTitle + ' %c[removed]', clr_s[2], clr_s[1], ...args, clr_s[3]);
  53. }, clr_s = ["color: red", "color: white", "color: #f90", "color: green"]; // color settings (for debug info)
  54.  
  55. const divs_pc = document.querySelectorAll(".videoBox"), divs_mobile = document.querySelectorAll(".videoWrapper"), // PC/Mobile divs
  56. divs = divs_pc.length > 0 ? divs_pc : divs_mobile; // Select the good div between the pc and mobile divs
  57. divs.forEach((div) => { // loop through all elements from the divs and find the title
  58. // shitty way to get the video title because the data-title attribute is not available on mobile
  59. let videoTitle = div.querySelector("a").getAttribute("data-title") !== null ? div.querySelector("a").getAttribute("data-title") : div?.querySelector("img")?.getAttribute("alt") ?? null;
  60. if (videoTitle) { // if the video title is found
  61. blackList.forEach((blackWord) => { // loop through all blacklisted words
  62. if (videoTitle.toLowerCase().includes(blackWord)) { // if videoTitle contains blacklisted word
  63. const start = videoTitle.toLowerCase().indexOf(blackWord), end = start + blackWord.length;
  64. if (blackWord[blackWord.length - 1] == " ") { // check if the blacklisted word finish with a space, if it does, check if it's a word
  65. const beforeAndAfter = videoTitle.toLowerCase().substring(start - 1, end + 1); // get the character before and after the blacklisted word
  66. // if the character before the blacklisted word is not a space, and the blacklisted word is not the first word of the video title
  67. if (beforeAndAfter[0] != " " && beforeAndAfter.startsWith(blackWord) == false) {
  68. return; // return to the next blacklisted word
  69. }
  70. }
  71. div.remove(); // remove the video element
  72. if (debug_info) { // allow printing of debug info
  73. // add %c before/after every blacklisted word in the video title
  74. videoTitle = videoTitle.substring(0, start) + "%c" + videoTitle.substring(start, end) + "%c" + videoTitle.substring(end);
  75. }
  76. }
  77. });
  78. if (debug_info) { // allow printing of debug info
  79. const count = (videoTitle.match(/%c/g) || []).length / 2; // count how many blacklisted words in the video title
  80. if (count > 0) { // if count is greater than 0, print debug info
  81. colorPrint(videoTitle, // little hack to print debug info in the console with red color for the blacklisted words
  82. count > 0 ? clr_s[0] : 0, count > 0 ? clr_s[1] : 0, count > 1 ? clr_s[0] : 0, count > 1 ? clr_s[1] : 0, count > 2 ? clr_s[0] : 0, count > 2 ? clr_s[1] : 0,
  83. count > 3 ? clr_s[0] : 0, count > 3 ? clr_s[1] : 0, count > 4 ? clr_s[0] : 0, count > 4 ? clr_s[1] : 0, count > 5 ? clr_s[0] : 0, count > 5 ? clr_s[1] : 0
  84. );
  85. }
  86. }
  87. }
  88. });