AIdungeon Tag Blacklist

Get those scenarios outta here!

  1. // ==UserScript==
  2. // @name AIdungeon Tag Blacklist
  3. // @namespace AIDTagBlacklist
  4. // @version 1.1
  5. // @description Get those scenarios outta here!
  6. // @author pitaden
  7. // @match https://play.aidungeon.io/main/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. /*
  12. some ideas for me to implement later, maybe:
  13.  
  14. add a "hard" blacklist, which replaces the desc with "This scenario was blocked due to hard blacklist" or removes the scenario from the list entirely
  15. sometimes, you don't even want to see what the tag is
  16.  
  17. add a whitelist, if a scenario has a normal blacklisted tag and a whitelisted tag, it will stay unblocked.
  18. the scenario will still be blocked for hard blacklist tags.
  19.  
  20. make an interface in-browser so you don't have to fuck with code to make this work
  21. the problem is... how the fuck does website design work. how do I do this.
  22. could try to copy AIdungeon's scenario tagging screen? somehow?
  23.  
  24. now that I sorta know how javascript works: rewrite ALLLL of this code.
  25. */
  26.  
  27. (function() {
  28. 'use strict';
  29.  
  30. // full block means the scenario is removed entirely, as if it was never there
  31. // if it's false, it replaces the scenario with grey text that shows why it was blocked
  32. var fullBlock = true;
  33.  
  34. var blockedTags = [
  35. "smut",
  36. "femboy",
  37. "monstergirl",
  38. "monster girl",
  39. "monster girls",
  40. "monsterboy",
  41. "monster boy",
  42. "monster boys",
  43. "femdom",
  44. "meme",
  45. "incest",
  46. "nnn",
  47. "milf",
  48. "dilf",
  49. "gilf",
  50. "age gap",
  51. "age difference",
  52. "sugar daddy",
  53. "romance",
  54. "passionate",
  55. "impregnation",
  56. "bondage",
  57. "dating",
  58. "degenerate",
  59. "naked",
  60. "nude",
  61. "sex",
  62. "slut",
  63. "furry",
  64. "abuse",
  65. "yuri",
  66. "submission",
  67. "corruption",
  68. "feminization",
  69. "slavery",
  70. "watersports",
  71. "piss",
  72. "peeing",
  73. "horny",
  74. "lewd",
  75. "gay", // not nsfw on its own, but i've yet to see a gay scenario that isn't written to be NSFW
  76. "m/m",
  77. "waifu",
  78. "bimbo",
  79. "transformation",
  80. "yandere",
  81. "dick",
  82. "femsub",
  83. "petplay",
  84. "pet play",
  85. "sempai",
  86. "senpai",
  87. "slave",
  88. "herm",
  89. "futa",
  90. "blowjob",
  91. "edging",
  92. "porn",
  93. "arousal",
  94. "aroused",
  95. "teasing",
  96. "tomboy",
  97. "bestiality",
  98. "zoophilia",
  99. "femdom",
  100. "mommy",
  101. "succubus",
  102. "vanilla",
  103. "rule 34",
  104. "dumb idiot",
  105. " x ",
  106. "slime",
  107. "vore",
  108. "drowning",
  109. "cannibal",
  110. "pervert",
  111. "tentacle",
  112. "living suit",
  113. "weight",
  114. "feed",
  115. "stuffing",
  116. "bbw",
  117. "feet",
  118. "foot",
  119. "fetish",
  120. "maledom",
  121. "submissive",
  122. "hypnosis",
  123. "kidnapping"
  124. ];
  125. // if I remember correctly, this doesn't actually work right now?
  126. var blockedAuthors = [
  127.  
  128. ];
  129.  
  130. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  131.  
  132. // There's probably a better way to do this but interval seems to work fine
  133. setInterval(function() {
  134. var scenarios = document.getElementsByClassName("css-1dbjc4n r-18u37iz");
  135. Array.from(scenarios).forEach(function(element, index, array) {
  136. if(element.checked != "true"){
  137. blockedTags.forEach(function(a, b, c){
  138. var tagText = element.childNodes[0].childNodes[0];
  139. //console.log(tagText)
  140. if (tagText.innerHTML != undefined){
  141. if(b%50 == 0){console.log(tagText)}
  142. var tagsHaveBlacklist = tagText.innerHTML.toLowerCase().indexOf(a)>=0 && element.getAttribute('style') == "border-color: rgb(153, 153, 153); border-radius: 20px; border-width: 0.5px; display: flex; margin: 4px; padding: 4px 8px;"
  143. if (tagsHaveBlacklist){
  144. var scenarioBase = element.parentElement.parentElement.getElementsByClassName("css-18t94o4 css-1dbjc4n r-1loqt21 r-1otgn73 r-1i6wzkk r-lrvibr")[0];
  145. var desc = scenarioBase.getElementsByClassName("css-901oao css-cens5h")[0];
  146. var title = scenarioBase.childNodes[1];
  147. var author = scenarioBase.getElementsByClassName("css-1dbjc4n r-18u37iz")[0].childNodes[0].childNodes[1];
  148. if (fullBlock == true){
  149. // contributed by thrwaway777
  150. element.parentElement.parentElement.style.display = "none"
  151. }else{
  152. if (element.parentElement.tagsFound == "true"){
  153. desc.innerHTML = desc.innerHTML+", '"+tagText.innerHTML.slice(1,tagText.innerHTML.length)+"'";
  154. }
  155. else{
  156.  
  157. element.parentElement.tagsFound = "true";
  158. // To any javascript developers looking at this code:
  159. // sorry.
  160. title.innerHTML = "Blocked";
  161. title.style.color = "rgb(128,128,128)";
  162. title.style.fontSize = "18px";
  163. title.style.marginBottom = "15px";
  164.  
  165. desc.innerHTML = "This scenario was blocked because of the tag(s) '"+tagText.innerHTML.slice(1,tagText.innerHTML.length)+"'";
  166. desc.style.color = "rgb(128,128,128)"
  167. desc.style.fontSize = "15px"
  168.  
  169. author.style.display = "none";
  170. author.innerHTML = "[Blocked Author]";
  171. author.style.color = "rgb(128,128,128)"
  172. author.style.fontSize = "15px"
  173.  
  174. // because the profile picture and tag are still possibly recognizable, scrub those too
  175. scenarioBase.getElementsByClassName("css-1dbjc4n r-18u37iz")[0].childNodes[0].childNodes[0].style.display = "none";
  176. // if there isn't a tag, pretend we don't see the undefined and carry on
  177. try{scenarioBase.getElementsByClassName("css-1dbjc4n r-18u37iz")[0].childNodes[0].childNodes[2].style.display = "none";}catch(err){}
  178.  
  179. scenarioBase.parentElement.childNodes[1].style.display = 'none'; // hides tags
  180. scenarioBase.parentElement.childNodes[2].style.display = "none"; // hides upload/edit dates
  181. scenarioBase.parentElement.childNodes[3].style.display = "none";
  182. }
  183. }
  184. }
  185. }
  186. });
  187. element.checked = "true";
  188. }
  189. });
  190. var authors = document.getElementsByClassName("css-901oao css-bfa6kz");
  191. Array.from(authors).forEach(function(element, index, array) {
  192. if(element.checked != "true"){
  193. blockedAuthors.forEach(function(a, b, c){
  194. if (element.innerHTML.toLowerCase().indexOf(a.toLowerCase())>=0 && element.getAttribute('style') == "color: rgb(224, 224, 224); font-family: HelveticaNeue-Light, Helvetica, sans-serif, Classic; font-size: 20px; margin-left: 8px;"){
  195.  
  196. var scenarioBase = element.parentElement.parentElement.parentElement.parentElement.getElementsByClassName("css-18t94o4 css-1dbjc4n r-1loqt21 r-1otgn73 r-1i6wzkk r-lrvibr")[0];
  197. var desc = scenarioBase.getElementsByClassName("css-901oao css-cens5h")[0];
  198. var title = scenarioBase.childNodes[1];
  199. var author = scenarioBase.getElementsByClassName("css-1dbjc4n r-18u37iz")[0].childNodes[0].childNodes[1];
  200.  
  201. title.innerHTML = "Blocked";
  202. title.style.color = "rgb(128,128,128)";
  203. title.style.fontSize = "18px";
  204. title.style.marginBottom = "15px";
  205.  
  206. desc.innerHTML = "This scenario was blocked because of the author.";
  207. desc.style.color = "rgb(128,128,128)"
  208. desc.style.fontSize = "15px"
  209.  
  210. author.style.display = "none";
  211. author.innerHTML = "[Blocked Author]";
  212. author.style.color = "rgb(128,128,128)"
  213. author.style.fontSize = "15px"
  214.  
  215. // because the profile picture and tag are still possibly recognizable, scrub those too
  216. scenarioBase.getElementsByClassName("css-1dbjc4n r-18u37iz")[0].childNodes[0].childNodes[0].style.display = "none";
  217. // if there isn't a tag, pretend we don't see the undefined and carry on
  218. try{scenarioBase.getElementsByClassName("css-1dbjc4n r-18u37iz")[0].childNodes[0].childNodes[2].style.display = "none";}catch(err){}
  219.  
  220. scenarioBase.parentElement.childNodes[1].style.display = "none"; // hides tags
  221. scenarioBase.parentElement.childNodes[2].style.display = "none"; // hides upload/edit dates
  222. scenarioBase.parentElement.childNodes[3].style.display = "none"; // I forgot what this hides
  223. }
  224. });
  225. element.checked = "true";
  226. }
  227. });
  228. }, 200);
  229. })();