FFA Foul Language Enhanced

Enhanced script for detecting and counting occurrences of specific words with timestamps.

当前为 2024-11-05 提交的版本,查看 最新版本

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