yimuhe

1.去除javlibrary详情页面中下载url的重定向;高亮yimuhe的下载链接;添加 在javbus中查询 链接

Mint 2023.08.04.. Lásd a legutóbbi verzió

  1. // ==UserScript==
  2. // @name yimuhe
  3. // @namespace https://greasyfork.org/zh-CN/scripts/38740-yimuhe
  4. // @version 2.5.0
  5. // @description 1.去除javlibrary详情页面中下载url的重定向;高亮yimuhe的下载链接;添加 在javbus中查询 链接
  6. // 2.破坏torrentkitty的脚本变量引用. 原先l8l1X变量是引用window,然后给加定时器,不停地添加页面的mousedown事件,导致鼠标点击任何地方都会跳转到广告页面
  7. // 3.给141jav每个车牌号后面加上复制按钮;添加 在JavLib中查询 链接
  8. // 4.给javdb每个车牌号后面添加 在JavLib中查询 链接, 所有链接都添加可下载条件
  9. // 5.javbus详情页面加上的车牌号后面添加 在JavLib中查询
  10. // 6.去掉get.datapps.org网页点击链接后弹出广告窗口
  11. // 7.去掉https://www.77file.com 的弹出广告
  12.  
  13. // @author You
  14.  
  15. // @require https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js
  16.  
  17. // @include http://*.javlib.com/*
  18. // @include http*:/*.torrentkitty.*/*
  19. // @include http*://*.h68g.com/*
  20. // @include http*://*.141jav.com/*
  21.  
  22. // @include http*://javdb003.com/*
  23. // @include http*://javdb004.com/*
  24.  
  25. // @include http*://*.seejav.men/*
  26. // @include http*://*.javbus.com/*
  27. // @include http*://*.fanbus.*/*
  28.  
  29. // @include http*://get.datapps.org/*
  30. // @include http*://www.77file.com/down/*
  31.  
  32. // @run-at document-end
  33. // @grant GM_xmlhttpRequest
  34. // @connect *
  35. // ==/UserScript==
  36.  
  37. (function() {
  38. 'use strict';
  39.  
  40. console.info('========= yimuhe ');
  41.  
  42.  
  43.  
  44. var javLibDomain="h68g";
  45. var javLibUrl="https://www."+javLibDomain+".com";
  46. let javLibRegx="("+javLibDomain+"|javlib|javlibrary)";
  47.  
  48. let javdbDomain="javdb003";
  49. let javdbUrl="https://"+javdbDomain+".com";
  50.  
  51. let jav141Domain="141jav";
  52.  
  53. let javbusDomain="fanbus";
  54. const javabusUrl = "https://www."+javbusDomain+".cfd";
  55.  
  56. const datappsDomain="datapps";
  57. //const datappsUrl="https://get.datapps.org";
  58.  
  59. const file77Domain = "77file";
  60.  
  61. execute(javLibRegx,function(location){
  62. console.info("====yimuhe====去除javlibrary页面中下载url的重定向;高亮yimuhe的下载链接");
  63. const mainNode=document.querySelector('#video_comments');
  64.  
  65. mainNode.addEventListener('DOMNodeInserted',(a,b,c)=>{
  66. console.log(123213);
  67. })
  68. $.each($("a[href^='redirect.php?url']"),function(index,a){
  69. //var origin = location.origin;
  70. //a.href = decodeURIComponent(a.href.replace(origin+"/cn/redirect.php?url=",""));
  71.  
  72. var url = getQueryVariable(a,'url');
  73. a.href = decodeURIComponent(url);
  74. a.text = a.text + " " + a.href + " ";
  75. if(a.href.includes("yimuhe")){
  76. $(a).parentsUntil("tr").closest('.t').css('background-color', '#6B6C83');
  77. a.style='font-size:40px;';
  78. }else{
  79. a.style='font-size:20px;';
  80. }
  81. });
  82. });
  83. /*
  84. execute(javLibRegx+".*\?v=.*",function(location){
  85. console.info("====yimuhe====javlibrary详情页面中添加 在javdb中查询 链接");
  86. let chePai = document.querySelector("#video_id > table > tbody > tr > td.text").innerText;
  87. let toAppendElement = document.querySelector("#video_id > table > tbody > tr > td.text");
  88. appendCopyButton(chePai,toAppendElement);
  89. let trTag=document.querySelector("#video_id > table > tbody > tr");
  90. let javdbQueryId = "javdbQueryId";
  91. trTag.innerHTML = [trTag.innerHTML,'<td><a id="', javdbQueryId,'"href="',javdbUrl,'/search?q=',chePai,'&f=download">在javdb中查询</a></td>'].join('');
  92. });*/
  93. execute(javLibRegx+".*\?v=.*",function(location){
  94. console.info("====yimuhe====javlibrary详情页面中添加 在javbus中查询 链接");
  95. let chePai = document.querySelector("#video_id > table > tbody > tr > td.text").innerText;
  96. let toAppendElement = document.querySelector("#video_id > table > tbody > tr > td.text");
  97. appendCopyButton(chePai,toAppendElement);
  98. let trTag=document.querySelector("#video_id > table > tbody > tr");
  99. let javdbQueryId = "javdbQueryId";
  100. trTag.innerHTML = [trTag.innerHTML,'<td><a id="', javdbQueryId,'"href="',javabusUrl,'/search/=',chePai,'">在javbus中查询</a></td>'].join('');
  101. });
  102.  
  103.  
  104.  
  105. execute(jav141Domain,function(location){
  106. console.info("3.给141jav每个车牌号后面加上复制按钮;添加 在JavLib中查询 链接.");
  107. document.querySelectorAll('h5.title.is-4.is-spaced > a').forEach(function(element,index){
  108. var chePai=element.innerText.trim();
  109.  
  110. appendCopyButton(chePai,element.parentElement);
  111. appendHrefJavLib(chePai,element.parentElement);
  112.  
  113. let markAsOwnerButton = document.createElement('button');
  114. markAsOwnerButton.dataset.type = 2;
  115. markAsOwnerButton.dataset.chePai = chePai;
  116. markAsOwnerButton.appendChild(document.createTextNode('设置为已拥有(javlib)'));
  117. element.parentElement.appendChild(markAsOwnerButton);
  118. markAsOwnerButton.onclick=function(event){
  119. //debugger;
  120. GM_xmlhttpRequest({
  121. method: "GET",
  122. //responseType: "json",
  123. url: javLibUrl+"/cn/vl_searchbyid.php?keyword=" + event.target.dataset.chePai,
  124. onerror: function(e) {
  125. console.log(e);
  126. },
  127. onload: function(response) {
  128. if (response.status != 200) {
  129. console.log("失败。。。")
  130. return;
  131. }
  132.  
  133. let finalUrl = response.finalUrl;
  134. if (finalUrl.includes('vl_searchbyid.php')){
  135. console.log("有多个结果或者没有结果")
  136. //有多个结果或者没有结果
  137.  
  138. } else {
  139. // 明细页面
  140. let patternAjaxid = /^var[ ]\$ajaxid.*;/m;
  141. let result = patternAjaxid.exec(response.responseText);
  142. let ajaxid = result[0].split('"')[1];
  143. let data = "type=" + event.target.dataset.type + "&targetid="+ajaxid;
  144. //debugger;
  145.  
  146. GM_xmlhttpRequest({
  147. method: "POST",
  148. responseType: "json",
  149. headers: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"},
  150. url: javLibUrl+"/ajax/ajax_cv_favoriteadd.php",
  151. data: data,
  152. onerror: function(e) {
  153. console.log(e);
  154. },
  155. onload: function(response) {
  156. if (response.status != 200) {
  157. return;
  158. }
  159. let responseJson = JSON.parse(response.responseText);
  160. if (responseJson.ERROR != 1) {
  161. // 失败
  162. console.log("失败。" + response.responseText);
  163. }
  164. }
  165. });// end GM_xmlhttpRequest
  166. }// end else
  167. } // end onload
  168. });// end GM_xmlhttpRequest
  169. };
  170. });
  171. });
  172.  
  173. execute(javdbDomain,function(location){
  174. console.info("4.给javdb添加 在JavLib中查询 链接.");
  175. document.querySelectorAll("a.button.is-white.copy-to-clipboard").forEach(function(element,index){
  176. var chePai=element.getAttribute('data-clipboard-text');
  177. appendHrefJavLib(chePai,element.parentElement);
  178. });
  179.  
  180. console.info("javdb 每个查询链接都添加 可下载 条件");
  181. //document.querySelectorAll('div.tabs.is-boxed a').forEach(function(element,index){
  182. document.querySelectorAll('a').forEach(function(element,index){
  183. console.info(index+element);
  184. let href = element.href;
  185. if(href.includes("video_codes")
  186. ||href.includes("directors")
  187. ||href.includes("makers")
  188. ||href.includes("series")
  189. ||href.includes("publishers")
  190. ||href.includes("search")){
  191. //element.href = href+"?f=download";
  192. element.href = appendUrlParam(href,"f=download")
  193. }else if(href.includes("actors")){
  194. //element.href = href+"?t=d";
  195. element.href = appendUrlParam(href,"t=d")
  196. }else if(href.includes("tags")){
  197. element.href = appendUrlParam(href,"c10=1")
  198. }
  199. });
  200.  
  201. document.querySelectorAll("div.tabs.is-boxed a").forEach((element,index)=>{
  202. let href = element.href;
  203. element.href=href.replace('&f=download','');
  204. });
  205. });
  206.  
  207. //debugger;
  208. execute(javbusDomain,function(location){
  209. console.info("5.给javbus每个车牌号后面加上复制按钮;添加 在JavLib中查询 链接.");
  210.  
  211. var chePai = document.querySelector("body > div.container > div.row.movie > div.col-md-3.info > p:nth-child(1) > span:nth-child(2)").innerText.trim();
  212. var toAppendElement=document.querySelector("body > div.container > div.row.movie > div.col-md-3.info > p:nth-child(1)");
  213.  
  214. appendCopyButton(chePai,toAppendElement);
  215. appendHrefJavLib(chePai,toAppendElement);
  216.  
  217. });
  218.  
  219. execute(datappsDomain,function(location){
  220. console.info("6.去掉get.datapps.org网页点击链接后弹出广告窗口.");
  221. document.querySelectorAll('a[onclick="setpos();"]').forEach((element,index)=>{
  222. element.removeAttribute("onclick");
  223. });
  224. });
  225.  
  226. execute(file77Domain,function(location){
  227. console.info("7.去掉77file网页点击链接后弹出广告窗口.");
  228. document.querySelectorAll('input[value="验证下载"]').forEach((element,index)=>{
  229. element.setAttribute("onclick","check_code();");
  230. });
  231. });
  232.  
  233. function execute(regExpString,callback){
  234. var href = window.location.href;
  235. var pattern=new RegExp(regExpString);
  236. if(pattern.test(href)){
  237. callback(window.location);
  238. }else{
  239. console.info("输入的参数 %s 与 %s 不匹配",regExpString,href);
  240. }
  241. }
  242.  
  243. execute("torrentkitty",function(location){
  244. console.info("2.破坏torrentkitty的脚本变量引用. 原先l8l1X变量是引用window,然后给加定时器,不停地添加页面的mousedown事件,导致鼠标点击任何地方都会跳转到广告页面.");
  245. window.l8l1X=1;
  246. });
  247.  
  248. //////////////////////////////////////////////////////////////////////////////////////////////
  249. /////////////////// 公共方法
  250. /////////////////////////////////////////////////////////////////////////////////////////////
  251. function appendHrefJavLib(chePai,toAppendElement){
  252. var openHref=document.createElement('a');
  253. openHref.href=javLibUrl+"/cn/vl_searchbyid.php?keyword="+chePai;
  254. openHref.target="_blank";
  255. openHref.innerText="JavLib中查询";
  256. toAppendElement.appendChild(openHref);
  257. }
  258. function appendCopyButton(chePai,toAppendElement){
  259. var copyButton = document.createElement('button');
  260. copyButton.innerHTML = "复 制";
  261. copyButton.setAttribute('id','copyButton');
  262. toAppendElement.appendChild(copyButton);
  263. copyButton.onclick=function(){
  264. copyToClipboard(chePai);
  265. };
  266. }
  267.  
  268. function getQueryVariable(anchor,variable){
  269. var query = anchor.search.substring(1);
  270. var vars = query.split("&");
  271. for (var i=0;i<vars.length;i++) {
  272. var pair = vars[i].split("=");
  273. if(pair[0] == variable){return pair[1];}
  274. }
  275. return false;
  276. }
  277. function appendUrlParam(url,param){
  278. if(url.includes("?")){
  279. return url + "&" + param;
  280. }
  281. return url + "?" + param;
  282. }
  283.  
  284. function copyToClipboard (text) {
  285. var textArea = document.createElement("textarea");
  286. textArea.style.position = 'fixed';
  287. textArea.style.top = '0';
  288. textArea.style.left = '0';
  289. textArea.style.width = '2em';
  290. textArea.style.height = '2em';
  291. textArea.style.padding = '0';
  292. textArea.style.border = 'none';
  293. textArea.style.outline = 'none';
  294. textArea.style.boxShadow = 'none';
  295. textArea.style.background = 'transparent';
  296. textArea.value = text;
  297. document.body.appendChild(textArea);
  298. textArea.select();
  299.  
  300. try {
  301. var successful = document.execCommand('copy');
  302. var msg = successful ? '成功复制到剪贴板' : '该浏览器不支持点击复制到剪贴板';
  303. //alert(msg);
  304. } catch (err) {
  305. alert('该浏览器不支持点击复制到剪贴板');
  306. }
  307.  
  308. document.body.removeChild(textArea);
  309. }
  310. })();