FFA Foul Language Enhanced

Enhanced script for detecting and counting occurrences of specific words.

目前为 2024-11-05 提交的版本。查看 最新版本

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.gf.qytechs.cn/scripts/515949/1478362/FFA%20Foul%20Language%20Enhanced.js

  1. // ==UserScript==
  2. // @name FFA Foul Language Enhanced
  3. // @licence MIT
  4. // @author krcanacu & jgonzzz
  5. // @namespace FFA_FL_Script
  6. // @description Enhanced script for detecting and counting occurrences of specific words.
  7. // @match http://vcc-review-caption-alpha.corp.amazon.com/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=amazon.com
  9. // @version 1.0.0
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. //Keywords definition
  15. // Severe Words //
  16. //RoDS = Racial or derogatory slurs
  17. const RoDSWords = ["nigger", "beaner", "nigga", "coon", "negro", "dyke", "chink", "faggy", "chinky", "faggot", "jap", "fag", "paki", "retard", "wog", "queer", "gook", "kike"];
  18.  
  19. //Fuckwords = Self explanatory
  20. const Fuckwords = ["fuck", "fucked", "fucker", "fucking", "fuckin", "motherfuck"];
  21.  
  22. //EuSR = Explicit use of sexual terminology
  23. const EuSRwords = ["porn", "ho", "pornography", "hoe", "porno", "wanker", "masturbate", "masturbation", "jerk off", "hand job", "whore", "hooker", "stripper", "prostitution", "prostitute", "sex worker", "brothel", "pimp"];
  24.  
  25. //ERoSV = Explicit references of sexual violence
  26. const ERoSV = ["sexual assault", "sexual abuse", "rape", "rapist", "raped", "molest", "molested"];
  27.  
  28. //RtHD = References to hard drugs
  29. const RtHDwords = ["LSD", "crack", "meth", "acid", "meth-head", "molly", "methamphetamine", "ecstasy", "heroin", "cocaine", "MDMA", "DMT"];
  30.  
  31. //NCSR = Non-comedic sexual reference
  32. const NCSRwords = ["orgy", "BDSM", "dildo", "vibrator", "lubricant", "orgasm"];
  33.  
  34. // Moderate words //
  35. //TenIoS = 10+ Instances of shit, ass, asshole, bitch, piss, etc.
  36. const TenIoSwords = ["shit", "wanker", "ass", "retard", "asshole", "wank", "bitch", "piss", "bollocks", "shitty", "bullshit", "bastard", "slut", "cocksucker"];
  37.  
  38. // DiSR = Dick/cock, pussy/cunt, cum in a sexual reference
  39. const DiSRwords = ["penis", "dick", "tits", "cock", "clit", "pussy", "condom", "cum", "cunt", "balls", "semen", "twat"];
  40.  
  41. //RtDUwords = References to drugs or drug use
  42. const RtDUwords = ["weed", "opioids", "marihuana", "opium", "marijuana", "pot", "cannabis", "mary jane", "opioid"];
  43.  
  44. //CSR = Comedic sexual reference
  45. const CSRwords = ["orgy", "BDSM", "dildo", "vibrator", "lubricant", "orgasm"];
  46.  
  47. //RtS = References to Suicide
  48. const RtSWords = ["suicide", "self-harm", "kill myself", "kill herself", "kill himself", "kill yourself"];
  49.  
  50. //NErtSV = Non-explicit references to Sexual Violence
  51. const SErtSV = ["sexual harassment"];
  52.  
  53. //MuoSR = Moderate use of sexual references
  54. const MuoSRWords = ["harlot"];
  55.  
  56. // Categories config of threshold and label
  57. const targetCategories = [
  58. { words: RoDSWords, threshold: 1, label: "Racial or derogatory slurs" },
  59. { words: Fuckwords, threshold: 3, label: "3+ instances of fuck" },
  60. { words: EuSRwords, threshold: 1, label: "Explicit use of sexual terminology" },
  61. { words: ERoSV, threshold: 1, label: "Explicit references to sexual violence" },
  62. { words: RtHDwords, threshold: 1, label: "References to hard drugs" },
  63. { words: NCSRwords, threshold: 1, label: "Non-comedic sexual reference" },
  64. { words: TenIoSwords, threshold: 10, label: "10+ Instances of shit, ass, asshole, bitch, piss, etc." },
  65. { words: DiSRwords, threshold: 2, label: "Dick/cock, pussy/cunt, cum in a sexual reference" },
  66. { words: RtDUwords, threshold: 3, label: "References to drugs or drug use" },
  67. { words: CSRwords, threshold: 3, label: "Comedic sexual reference" },
  68. { words: RtSWords, threshold: 3, label: "References to Suicide"},
  69. { words: MuoSRWords, threshold: 3, label: "Moderate use of Sexual References"}
  70. ];
  71.  
  72. const subTitleDiv = document.getElementById('full-caps');
  73.  
  74. if (subTitleDiv) {
  75. const textNodes = document.createTreeWalker(subTitleDiv, NodeFilter.SHOW_TEXT, null, false);
  76. let categoryCounts = {};
  77. let detectedWords = {};
  78.  
  79. targetCategories.forEach(category => {
  80. categoryCounts[category.label] = 0;
  81. detectedWords[category.label] = new Set();
  82. });
  83.  
  84. while (textNodes.nextNode()) {
  85. const textContent = textNodes.currentNode.textContent.toLowerCase();
  86. const lines = textContent.split('\n');
  87.  
  88. lines.forEach(line => {
  89. targetCategories.forEach(category => {
  90. category.words.forEach(word => {
  91. const regex = new RegExp(`\\b${word}(er)?\\b`, 'gi');
  92. if (regex.test(line)) {
  93. console.log(`Detected word: ${word} in line: ${line}`);
  94. categoryCounts[category.label]++;
  95. detectedWords[category.label].add(word);
  96. }
  97. });
  98. });
  99. });
  100. }
  101.  
  102. let popupContent = '';
  103. let foulLanguageDetected = false;
  104.  
  105. targetCategories.forEach(category => {
  106. if (categoryCounts[category.label] >= category.threshold) {
  107. const wordsList = [...detectedWords[category.label]].join(', ');
  108. popupContent += `${category.label}: ${categoryCounts[category.label]} (${wordsList})<br>`;
  109. foulLanguageDetected = true; // Mark that foul language was detected
  110. }
  111. });
  112.  
  113. // If no foul language was detected, add the fallback message
  114. if (!foulLanguageDetected) {
  115. popupContent = 'Not enough foul language was found, check the title for NFF content';
  116. }
  117.  
  118. if (popupContent.trim() !== '') {
  119. const popup = document.createElement('div');
  120. popup.style.position = 'fixed';
  121. popup.style.top = '10px';
  122. popup.style.right = '10px';
  123. popup.style.backgroundColor = 'white';
  124. popup.style.padding = '10px';
  125. popup.style.border = '1px solid black';
  126. if (popupContent === 'Not enough foul language was found, check the title for NFF content') {
  127. popup.innerHTML = popupContent;
  128. } else {
  129. popup.innerHTML = `Possible NFF (check for ambiguity):<br>${popupContent}`;
  130. }
  131.  
  132. document.body.appendChild(popup);
  133. }
  134. }
  135. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址