JavDB Toolbox(Revise)

JavDB 工具箱:1. 添加搜索在线观看资源按钮 2. 添加到 JavLibrary 等站点跳转按钮 3. 过滤肛交标签中的M男和扶她(未来会添加自定义);4. 增加免梯子访问JavLibrary;推荐结合 `JavDB 添加跳转在线观看` 食用。此脚本为naughtyEvenstar创作,版权属原作者所有,感谢其作品。本人只是增加了免梯子网址访问JavLibrary自用,如有兴趣者可自行下载。

  1. // ==UserScript==
  2. // @name JavDB Toolbox(Revise)
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2.0
  5. // @description JavDB 工具箱:1. 添加搜索在线观看资源按钮 2. 添加到 JavLibrary 等站点跳转按钮 3. 过滤肛交标签中的M男和扶她(未来会添加自定义);4. 增加免梯子访问JavLibrary;推荐结合 `JavDB 添加跳转在线观看` 食用。此脚本为naughtyEvenstar创作,版权属原作者所有,感谢其作品。本人只是增加了免梯子网址访问JavLibrary自用,如有兴趣者可自行下载。
  6. // @author testqdg
  7. // @match https://javdb.com/*
  8. // @include /^https:\/\/(\w*\.)?javdb(\d)*\.com.*$/
  9. // @icon https://javdb.com/favicon-32x32.png
  10. // @grant none
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. (function () {
  15. "use strict";
  16.  
  17. const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
  18.  
  19. const openWindowWithPost = (url, data) => {
  20. var form = document.createElement("form");
  21. form.target = "_blank";
  22. form.method = "POST";
  23. form.action = url;
  24. form.style.display = "none";
  25.  
  26. for (var key in data) {
  27. var input = document.createElement("input");
  28. input.type = "hidden";
  29. input.name = key;
  30. input.value = data[key];
  31. form.appendChild(input);
  32. }
  33.  
  34. document.body.appendChild(form);
  35. form.submit();
  36. document.body.removeChild(form);
  37. };
  38.  
  39. const { pathname, search } = location;
  40.  
  41. if (pathname.startsWith("/v/")) {
  42. const tmpl = `
  43. <div class="panel-block generated">
  44. <div class="columns">
  45. <div class="column">
  46. <div class="buttons are-small review-buttons" />
  47. </div>
  48. </div>
  49. </div>`;
  50.  
  51. [...document.querySelectorAll(".movie-panel-info div.panel-block")]
  52. .pop()
  53. .insertAdjacentHTML("afterend", tmpl);
  54.  
  55. const buttonRowEle = document.querySelector(".generated .review-buttons");
  56.  
  57. const registerButton = (text, onClick, hint) => {
  58. const btnEle = document.createElement("a");
  59. btnEle.className = "button is-info is-outlined";
  60. btnEle.addEventListener("click", onClick);
  61. btnEle.textContent = text;
  62. buttonRowEle.appendChild(btnEle);
  63. if (hint) btnEle.title = hint;
  64. return btnEle;
  65. };
  66.  
  67. const movieCode = document.querySelector(
  68. ".panel-block.first-block > span"
  69. ).textContent;
  70. const movieTitle = document.querySelector(
  71. ".title.is-4 > strong"
  72. ).textContent;
  73. const isFC2 = movieCode.startsWith("FC2");
  74. const isUncensored = isFC2 || movieTitle.includes("無碼");
  75. const searchType = isUncensored ? "uncensored" : "censored";
  76. const searchKeyword = isFC2 ? movieCode.slice(4) : movieCode;
  77.  
  78. const btn7mmtv = registerButton(
  79. "🔎 7MMTV",
  80. () => {
  81. openWindowWithPost(
  82. "https://7mmtv.tv/zh/searchform_search/all/index.html",
  83. {
  84. search_keyword: searchKeyword,
  85. search_type: searchType,
  86. op: "search",
  87. }
  88. );
  89. },
  90. "适合搜索骑兵和fc2"
  91. );
  92. const btnAvgle = registerButton("🔎 Avgle", () =>
  93. window.open(
  94. `https://avgle.com/search/videos?search_query=${searchKeyword}&search_type=videos`
  95. )
  96. );
  97. const btnJavBigo = registerButton("🔎 JavBigo", () =>
  98. window.open(`https://javbigo.com/?s=${searchKeyword}`)
  99. );
  100. const btnJavLib = registerButton("🔎 JavLibrary", () =>
  101. window.open(
  102. `https://www.javlibrary.com/cn/vl_searchbyid.php?keyword=${searchKeyword}`
  103. )
  104. );
  105. const btnJavLib1 = registerButton("🔎 JavLibNoproxy", () =>
  106. window.open(
  107. `https://www.o58c.com/cn/vl_searchbyid.php?keyword=${searchKeyword}`
  108. )
  109. );
  110. } else if (pathname.startsWith("/tags")) {
  111. if (search.includes(`c5=74`) /* 肛交 */) {
  112. console.log("tags: anal detected");
  113.  
  114. const blockedKeywords = ["男の娘", "雄母", "女装", "前立腺", "M男"];
  115.  
  116. const blockedTags = [
  117. "c1=63", // M男
  118. "c1=277", // 男同性恋
  119. "c3=192", // 女装人妖
  120. "c4=147", // 变性者
  121. ];
  122.  
  123. setTimeout(async () => {
  124. const items = [...document.querySelectorAll(`.grid-item.column`)];
  125. for (const item of items) {
  126. const a = item.children[0];
  127. const { href, title } = a;
  128. let shouldBlock = false;
  129.  
  130. if (blockedKeywords.some((keyword) => !!title.match(keyword))) {
  131. shouldBlock = true;
  132. } else {
  133. const resp = await fetch(href);
  134. const text = await resp.text();
  135. const tags = new Set(text.match(/(?!tags\?)c\d=\d+/g));
  136. shouldBlock = blockedTags.some((tag) => tags.has(tag));
  137. }
  138.  
  139. if (shouldBlock) {
  140. console.log(`blocked`, title, href);
  141. const children = [...a.children];
  142. children.forEach((ele) => {
  143. if (ele.classList.contains("uid")) {
  144. ele.textContent = "BLOCKED";
  145. } else {
  146. ele.style.visibility = "hidden";
  147. }
  148. });
  149. item.style.pointerEvents = "none";
  150. }
  151. await sleep(2000 + Math.random * 1000);
  152. }
  153. });
  154. }
  155. }
  156. })();