From c505372a392ca9805b422ea49214cca66c1c4e12 Mon Sep 17 00:00:00 2001 From: shiqi110 <62666594+shiqi110@users.noreply.github.com> Date: Mon, 6 Jan 2025 01:48:56 +0400 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=20B=E7=AB=99=E5=93=94?= =?UTF-8?q?=E5=93=A9=E5=93=94=E5=93=A9=E4=BD=BF=E7=94=A8=E5=A2=9E=E5=BC=BA?= =?UTF-8?q?=EF=BC=8C=E5=85=A8=E7=BD=91VIP=E8=A7=86=E9=A2=91=E5=85=8D?= =?UTF-8?q?=E8=B4=B9=E7=A0=B4=E8=A7=A3=E5=8E=BB=E5=B9=BF=E5=91=8A=EF=BC=8C?= =?UTF-8?q?=E7=9F=A5=E4=B9=8E=E4=BD=BF=E7=94=A8=E5=A2=9E=E5=BC=BA=EF=BC=8C?= =?UTF-8?q?=E7=9F=AD=E8=A7=86=E9=A2=91=E6=97=A0=E6=B0=B4=E5=8D=B0=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=EF=BC=8C=E6=B2=B9=E7=AE=A1=E3=80=81Facebook=E7=AD=89?= =?UTF-8?q?=E5=9B=BD=E5=A4=96=E8=A7=86=E9=A2=91=E8=A7=A3=E6=9E=90=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E7=AD=89.user?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...44\270\213\350\275\275\347\255\211.user 2" | 360 ++++++++++++++++++ 1 file changed, 360 insertions(+) create mode 100644 "B\347\253\231\345\223\224\345\223\251\345\223\224\345\223\251\344\275\277\347\224\250\345\242\236\345\274\272\357\274\214\345\205\250\347\275\221VIP\350\247\206\351\242\221\345\205\215\350\264\271\347\240\264\350\247\243\345\216\273\345\271\277\345\221\212\357\274\214\347\237\245\344\271\216\344\275\277\347\224\250\345\242\236\345\274\272\357\274\214\347\237\255\350\247\206\351\242\221\346\227\240\346\260\264\345\215\260\344\270\213\350\275\275\357\274\214\346\262\271\347\256\241\343\200\201Facebook\347\255\211\345\233\275\345\244\226\350\247\206\351\242\221\350\247\243\346\236\220\344\270\213\350\275\275\347\255\211.user 2" diff --git "a/B\347\253\231\345\223\224\345\223\251\345\223\224\345\223\251\344\275\277\347\224\250\345\242\236\345\274\272\357\274\214\345\205\250\347\275\221VIP\350\247\206\351\242\221\345\205\215\350\264\271\347\240\264\350\247\243\345\216\273\345\271\277\345\221\212\357\274\214\347\237\245\344\271\216\344\275\277\347\224\250\345\242\236\345\274\272\357\274\214\347\237\255\350\247\206\351\242\221\346\227\240\346\260\264\345\215\260\344\270\213\350\275\275\357\274\214\346\262\271\347\256\241\343\200\201Facebook\347\255\211\345\233\275\345\244\226\350\247\206\351\242\221\350\247\243\346\236\220\344\270\213\350\275\275\347\255\211.user 2" "b/B\347\253\231\345\223\224\345\223\251\345\223\224\345\223\251\344\275\277\347\224\250\345\242\236\345\274\272\357\274\214\345\205\250\347\275\221VIP\350\247\206\351\242\221\345\205\215\350\264\271\347\240\264\350\247\243\345\216\273\345\271\277\345\221\212\357\274\214\347\237\245\344\271\216\344\275\277\347\224\250\345\242\236\345\274\272\357\274\214\347\237\255\350\247\206\351\242\221\346\227\240\346\260\264\345\215\260\344\270\213\350\275\275\357\274\214\346\262\271\347\256\241\343\200\201Facebook\347\255\211\345\233\275\345\244\226\350\247\206\351\242\221\350\247\243\346\236\220\344\270\213\350\275\275\347\255\211.user 2" new file mode 100644 index 00000000..3214df8f --- /dev/null +++ "b/B\347\253\231\345\223\224\345\223\251\345\223\224\345\223\251\344\275\277\347\224\250\345\242\236\345\274\272\357\274\214\345\205\250\347\275\221VIP\350\247\206\351\242\221\345\205\215\350\264\271\347\240\264\350\247\243\345\216\273\345\271\277\345\221\212\357\274\214\347\237\245\344\271\216\344\275\277\347\224\250\345\242\236\345\274\272\357\274\214\347\237\255\350\247\206\351\242\221\346\227\240\346\260\264\345\215\260\344\270\213\350\275\275\357\274\214\346\262\271\347\256\241\343\200\201Facebook\347\255\211\345\233\275\345\244\226\350\247\206\351\242\221\350\247\243\346\236\220\344\270\213\350\275\275\347\255\211.user 2" @@ -0,0 +1,360 @@ +// ==UserScript== +// @name B站哔哩哔哩使用增强,全网VIP视频免费破解去广告,知乎使用增强,短视频无水印下载,油管、Facebook等国外视频解析下载等 +// @name:zh B站哔哩哔哩使用增强,全网VIP视频免费破解去广告,知乎使用增强,短视频无水印下载,油管、Facebook等国外视频解析下载等 +// @namespace super_coolhii_video_helper_cat +// @version 5.2.6 +// @description 【❤️视频解析❤️,适配PC+移动 】1、B站使用增强:支持视频下载(👉支持多P批量快速下载👈)、浏览记录提示、一键三连、自动签到、描述文本网址转链接等;2、全网VIP视频解析:爱奇艺、腾讯、优酷、bilibili等视频免费解析(支持自定义解析接口);3、知乎使用助手:内容种类标识、问答显示优化、视频下载等;4、短视频去水印下载:支持知乎、抖音、快手等;5、油管、Facebook、Tiktok等国外视频解析下载;🔥6、搜索引擎功能增强,百度添加网址显示,google结果新标签页打开灯,导航可自定义网址【脚本长期维护更新,完全免费,无广告,仅限学习交流!!】 +// @description:zh 【❤️视频解析❤️,适配PC+移动 】1、B站使用增强:支持视频下载(👉支持多P批量快速下载👈)、浏览记录提示、一键三连、自动签到、描述文本网址转链接等;2、全网VIP视频解析:爱奇艺、腾讯、优酷、bilibili等视频免费解析(支持自定义解析接口);3、知乎使用助手:内容种类标识、问答显示优化、视频下载等;4、短视频去水印下载:支持知乎、抖音、快手等;5、油管、Facebook、Tiktok等国外视频解析下载;🔥6、搜索引擎功能增强,百度添加网址显示,google结果新标签页打开灯,导航可自定义网址【脚本长期维护更新,完全免费,无广告,仅限学习交流!!】 +// @author coolhii +// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAttJREFUaEPtWVtSAjEQTKC0vISUn3IK8WTAycBT6KeFl7C0JFZGg9mQTPcsiyUqn5qdpLvnlYl3J/7zJ35+9/cA3E/OF965uSgXwjqMx8vp4/O6j5JiK4Qb5/0s2oo2rp9eby22aAXury5mfrtd1YwH55bTzcvCsnGHiOLD680LfS564cPl2UqYavwsIDQyRFgDITyAyXlQGf50J0YF//Y218gQVyJVoAAgxphDW9eE0eiWiS0KQNz8ASlgPSFYP6gCcS8t6FJGMmFQ4ilmJDYb0QogFVjGEkhNUdZ9oq3BAFgyB8poFjJoAKULxU1qf0NuVCaExHauiIUMCkBr09KtmI077Ge+3ocM2oVam9aCW5NfI6K0xZBBAUCbWlTIiagdsFSBAQFdSGM/+fteio1V2fu7Mh52TaBSaa2upAKwGEOZJQeDmLUEtArAYmhIABbiOgDih4mpXZ8u7aFeGfv0ShYV5N6RXHI0Wuc9kgBAbQKqjBb2c1dSM1Z+caoUl3QmD9lD7IONtMKGVGCI9ZC9RkbZuVq6XqIS3Pq/Yr/jxjUVnFv6726T++JsfXfaAEJY7zVke0gPkJhhO8ZBk900sVDcDwbxoYF2SBCj+IyZ6CONKiMTKQNgStArjlB2I8/ULWRXFzO33cropMwAh+Tsmgqm2oIKWUtmSyuBcnZnD8R+UVs08n53Mye9fjaRa8XC3p2hkllYl2Ta91xNeB9gLhnspsglmctT5Y6Bs3U5kc5nNpZNUZvMEmFSIC1usce4WL5hDiJ3SQsRvQAcbazyWWOQezWrNXagrxXqNM0wEkcp9ziDLVAZLZtKdlOGxRZbMAvtYgA8cKQnIlrRgR5LeACnPF5HzR7NumEh6pWSqeEU+MlPTNJyk1MChmRkC41xetWBsi/KjaD7Qg2UBoJ1H2n7GcbyNVJ55cuPx+k4cLK+ESd7ElvZi2UfIswArICPvf4fwLEZRvbfAT8jlbXobXLcAAAAAElFTkSuQmCC +// @include *://*.youku.com/v_* +// @include *://*.iqiyi.com/v_* +// @include *://*.iqiyi.com/w_* +// @include *://*.iqiyi.com/a_* +// @include *://*.iqiyi.com/resource/pcw/play/* +// @include *://*.le.com/ptv/vplay/* +// @include *://v.qq.com/x/cover/* +// @include *://v.qq.com/x/page/* +// @include *://v.qq.com/tv/* +// @include *://*.tudou.com/listplay/* +// @include *://*.tudou.com/albumplay/* +// @include *://*.tudou.com/programs/view/* +// @include *://*.mgtv.com/b/* +// @include *://film.sohu.com/album/* +// @include *://tv.sohu.com/v/* +// @include *://*.baofeng.com/play/* +// @include *://vip.pptv.com/show/* +// @include *://v.pptv.com/show/* +// @include *://www.le.com/ptv/vplay/* +// @include *://www.wasu.cn/Play/show/* +// @include *://*.1905.com/video/* +// @include *://*.1905.com/play/* +// @include *://*.1905.com/*/play/* +// @include *://www.miguvideo.com/mgs/* +// @include *://m.v.qq.com/x/cover/* +// @include *://m.v.qq.com/x/page/* +// @include *://m.v.qq.com/* +// @include *://m.iqiyi.com/v_* +// @include *://m.iqiyi.com/w_* +// @include *://m.iqiyi.com/a_* +// @include *://m.youku.com/alipay_video/* +// @include *://m.youku.com/video/id_* +// @include *://m.mgtv.com/b/* +// @include *://m.tv.sohu.com/v/* +// @include *://m.film.sohu.com/album/* +// @include *://m.le.com/ptv/vplay/* +// @include *://m.pptv.com/show/* +// @include *://m.acfun.cn/v/* +// @include *://m.wasu.cn/Play/show/* +// @include *://www.youtube.com/watch** +// @include *://www.youtube.com/shorts** +// @include *://www.tiktok.com/@* +// @include *://www.baidu.com/* +// @include *://www.so.com/s* +// @include *://www.sogou.com/web* +// @include *://www.sogou.com/sogou* +// @include *://cn.bing.com/search* +// @include *://www.bing.com/search* +// @include *://www4.bing.com/search* +// @include *://so.toutiao.com/search* +// @include *://www.google.com/search* +// @include *://www.google.com.hk/search* +// @include *://duckduckgo.com* +// @include *://www.bilibili.com/** +// @include *://search.bilibili.com/** +// @include *://space.bilibili.com/** +// @include *://www.bilibili.com/read/** +// @include *://*.zhihu.com/* +// @include *://www.douyin.com/* +// @include *://www.kuaishou.com/* +// @include *://*.taobao.com/* +// @include *://*.tmall.com/* +// @include *://*.tmall.hk/* +// @include *://*.liangxinyao.com/* +// @include *://chaoshi.detail.tmall.com/* +// @include *://pages.tmall.com/wow/an/cs/search** +// @include *://*.jd.com/* +// @include *://*.jd.hk/* +// @include *://item.jkcsjd.com/* +// @include *://*.yiyaojd.com/* +// @include *://www.vipglobal.hk +// @include *://*.vip.com/* +// @include *://detail.vip.com/detail-* +// @include *://www.vipglobal.hk/detail-* +// @include *://category.vip.com/suggest.php** +// @include *://list.vip.com/*.html +// @include *://*.suning.com/* +// @exclude *://jianghu.taobao.com/* +// @exclude *://login.taobao.com/* +// @exclude *://uland.taobao.com/* +// @exclude *://map.taobao.com/* +// @exclude *://creator.guanghe.taobao.com/* +// @exclude *://myseller.taobao.com/* +// @exclude *://qn.taobao.com/* +// @exclude *://jingfen.jd.com/* +// @exclude *://passport.jd.com/* +// @exclude *://jmw.jd.com/* +// @exclude *://passport.shop.jd.com/* +// @exclude *://passport.vip.com/* +// @exclude *://huodong.taobao.com/wow/z/guang/gg_publish/* +// @exclude *://loginmyseller.taobao.com/* +// @exclude *://accounts.youtube.com/* +// @exclude *://www.youtube.com/live_chat_replay* +// @exclude *://www.youtube.com/persist_identity* +// @exclude *://passport.suning.com/* +// @require https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/3.2.1/jquery.min.js +// @require https://greasyfork.org/scripts/454236-findandreplacedomtext-huahuacat/code/findAndReplaceDOMText-huahuacat.js?version=1112990 +// @connect bilibili.com +// @connect sct.staticj.top +// @connect tikdownloader.io +// @grant unsafeWindow +// @grant GM_openInTab +// @grant GM.openInTab +// @grant GM_getValue +// @grant GM.getValue +// @grant GM_setValue +// @grant GM.setValue +// @grant GM_addStyle +// @grant GM_xmlhttpRequest +// @grant GM.xmlHttpRequest +// @grant GM_registerMenuCommand +// @license AGPL-3.0-only +// @charset UTF-8 +// @run-at document-idle +// ==/UserScript== +!function(){'use strict'; +/** + * 脚本遵循AGPL License开源协议;在协议允许的范围类,可以自由修改 + * 开完万岁!! + */ +//共有方法,全局共享 +//全局弹窗对象 +const dialog=function(){class Dialog{constructor(){this.mask=document.createElement('div'),this.dialogStyle=document.createElement('style'),this.setStyle(this.mask,{width:'100%',height:'100%',backgroundColor:'rgba(0, 0, 0, .6)',position:'fixed',left:"0px",top:"0px",bottom:"0px",right:"0px","z-index":"9999999999999"}),this.content=document.createElement('div'),this.setStyle(this.content,{"max-width":'450px',width:"100%","max-height":'600px',backgroundColor:'#fff',boxShadow:'0 0 2px #999',position:'absolute',left:'50%',top:'50%',transform:'translate(-50%,-50%)',borderRadius:'5px'}),this.mask.appendChild(this.content)}middleBox(param){ +// 先清空中间小div的内容 - 防止调用多次,出现混乱 +this.content.innerHTML='';let title='默认标题内容';'[object String]'==={}.toString.call(param)?title=param:'[object Object]'==={}.toString.call(param)&&(title=param.title),document.body.appendChild(this.mask),this.title=document.createElement('div'),this.setStyle(this.title,{width:'100%',height:'40px',lineHeight:'40px',boxSizing:'border-box',"background-color":"#dedede",color:'#000',"text-align":'center',"font-weight":"700","font-size":"17px","border-radius":"4px 4px 0px 0px"}),this.title.innerText=title,this.content.appendChild(this.title),this.closeBtn=document.createElement('div'),this.closeBtn.innerText='×',this.setStyle(this.closeBtn,{textDecoration:'none',color:'#000',position:'absolute',right:'10px',top:'0px',fontSize:'25px',display:"inline-block",cursor:"pointer"}),this.title.appendChild(this.closeBtn);const self=this;this.closeBtn.onclick=function(){self.close(),param.onClose&&"function"==typeof param.onClose&¶m.onClose()}}showMake(param){ +//添加公用样式表 +param.hasOwnProperty("styleSheet")&&(this.dialogStyle.textContent=param.styleSheet),document.querySelector("head").appendChild(this.dialogStyle),this.middleBox(param),this.dialogContent=document.createElement('div'),this.setStyle(this.dialogContent,{padding:"15px","max-height":"400px"}),this.dialogContent.innerHTML=param.content,this.content.appendChild(this.dialogContent),param.onContentReady(this)}close(){document.body.removeChild(this.mask),document.querySelector("head").removeChild(this.dialogStyle)}setStyle(ele,styleObj){for(let attr in styleObj)ele.style[attr]=styleObj[attr]}}let dialog=null;return function(){return dialog||(dialog=new Dialog),dialog}()}(),commonFunctionObject=new function(){this.GMgetValue=function(name,value=null){let storageValue=value;if("function"==typeof GM_getValue)storageValue=GM_getValue(name,value);else if("function"==typeof GM.setValue)storageValue=GM.getValue(name,value);else{var arr=window.localStorage.getItem(name);null!=arr&&(storageValue=arr)}return storageValue},this.GMsetValue=function(name,value){"function"==typeof GM_setValue?GM_setValue(name,value):"function"==typeof GM.setValue?GM.setValue(name,value):window.localStorage.setItem(name,value)},this.GMaddStyle=function(css){var myStyle=document.createElement('style');myStyle.textContent=css,(document.head||document.documentElement).appendChild(myStyle)},this.GMopenInTab=function(url,options={active:!0,insert:!0,setParent:!0}){"function"==typeof GM_openInTab?GM_openInTab(url,options):GM.openInTab(url,options)},this.addScript=function(url){var s=document.createElement('script');s.setAttribute('src',url),document.body.appendChild(s)},this.randomNumber=function(){return Math.ceil(1e8*Math.random())},this.request=function(method,url,param,headers={"Content-Type":"application/json;charset=UTF-8"}){return new Promise((function(resolve,reject){GM_xmlhttpRequest({url:url,method:method,data:param,headers:headers,onload:function(response){var status=response.status;if(200==status||'200'==status){var responseText=response.responseText;resolve({result:"success",data:responseText})}else reject({result:"error",data:null})}})}))},this.crossRequest=function(method,url,param){if(method||(method="get"),!url)return new Promise((function(resolve,reject){reject({result:"error",data:null})}));param||(param={});let config={method:method=method.toUpperCase()};return'POST'===method&&(config.headers['Content-Type']='application/json',config.body=JSON.stringify(param)),new Promise((function(resolve,reject){fetch(url,config).then(response=>response.text()).then(text=>{resolve({result:"success",data:text})}).catch(error=>{reject({result:"error",data:null})})}))},this.addCommonHtmlCss=function(){this.GMaddStyle("\n\t\t\t@keyframes fadeIn {\n\t\t\t\t0% {opacity: 0}\n\t\t\t\t100% {opacity: 1}\n\t\t\t}\n\t\t\t@-webkit-keyframes fadeIn {\n\t\t\t\t0% {opacity: 0}\n\t\t\t\t100% {opacity: 1}\n\t\t\t}\n\t\t\t@-moz-keyframes fadeIn {\n\t\t\t\t0% {opacity: 0}\n\t\t\t\t100% {opacity: 1}\n\t\t\t}\n\t\t\t@-o-keyframes fadeIn {\n\t\t\t\t0% {opacity: 0}\n\t\t\t\t100% {opacity: 1}\n\t\t\t}\n\t\t\t@-ms-keyframes fadeIn {\n\t\t\t\t0% {opacity: 0}\n\t\t\t\t100% {opacity: 1}\n\t\t\t}\n\t\t\t@keyframes fadeOut {\n\t\t\t\t0% {opacity: 1}\n\t\t\t\t100% {opacity: 0}\n\t\t\t}\n\t\t\t@-webkit-keyframes fadeOut {\n\t\t\t\t0% {opacity: 1}\n\t\t\t\t100% {opacity: 0}\n\t\t\t}\n\t\t\t@-moz-keyframes fadeOut {\n\t\t\t\t0% {opacity: 1}\n\t\t\t\t100% {opacity: 0}\n\t\t\t}\n\t\t\t@-o-keyframes fadeOut {\n\t\t\t\t0% {opacity: 1}\n\t\t\t\t100% {opacity: 0}\n\t\t\t}\n\t\t\t@-ms-keyframes fadeOut {\n\t\t\t\t0% {opacity: 1}\n\t\t\t\t100% {opacity: 0}\n\t\t\t}\n\t\t\t.web-toast-kkli9{\n\t\t\t\tposition: fixed;\n\t\t\t\tbackground: rgba(0, 0, 0, 0.7);\n\t\t\t\tcolor: #fff;\n\t\t\t\tfont-size: 14px;\n\t\t\t\tline-height: 1;\n\t\t\t\tpadding:10px;\n\t\t\t\tborder-radius: 3px;\n\t\t\t\tleft: 50%;\n\t\t\t\ttransform: translateX(-50%);\n\t\t\t\t-webkit-transform: translateX(-50%);\n\t\t\t\t-moz-transform: translateX(-50%);\n\t\t\t\t-o-transform: translateX(-50%);\n\t\t\t\t-ms-transform: translateX(-50%);\n\t\t\t\tz-index: 999999999999999999999999999;\n\t\t\t\twhite-space: nowrap;\n\t\t\t}\n\t\t\t.fadeOut{\n\t\t\t\tanimation: fadeOut .5s;\n\t\t\t}\n\t\t\t.fadeIn{\n\t\t\t\tanimation:fadeIn .5s;\n\t\t\t}\n\t\t\t")},this.webToast=function(params){//小提示框 +var time=params.time,background=params.background,color=params.color,position=params.position;null!=time&&''!=time||(time=1500);var el=document.createElement("div");el.setAttribute("class","web-toast-kkli9"),el.innerHTML=params.message, +//背景颜色 +null!=background&&''!=background&&(el.style.backgroundColor=background), +//字体颜色 +null!=color&&''!=color&&(el.style.color=color), +//显示位置 +null!=position&&''!=position||(position="center-bottom"), +//设置显示位置,当前有种两种形式 +"center-bottom"===position?el.style.bottom="50px":el.style.top="50px",el.style.zIndex=999999,document.body.appendChild(el),el.classList.add("fadeIn"),setTimeout((function(){el.classList.remove("fadeIn"),el.classList.add("fadeOut"), +/*监听动画结束,移除提示信息元素*/ +el.addEventListener("animationend",(function(){document.body.removeChild(el)})),el.addEventListener("webkitAnimationEnd",(function(){document.body.removeChild(el)}))}),time)},this.filterStr=function(str){return str?(str=(str=str.replace(/\t/g,"")).replace(/\r/g,""),encodeURIComponent(str)):""},this.getParamterQueryUrl=function(text,tag){//查询GET请求url中的参数 +if(-1!=text.indexOf("?")){//选取?后面的字符串,兼容window.location.search,前面的?不能去掉 +var textArray=text.split("?");text="?"+textArray[textArray.length-1]}var t=new RegExp("(^|&)"+tag+"=([^&]*)(&|$)"),a=text.substr(1).match(t);return null!=a?a[2]:""},this.getEndHtmlIdByUrl=function(url){//获得以html结束的ID +-1!=url.indexOf("?")&&(url=url.split("?")[0]),-1!=url.indexOf("#")&&(url=url.split("#")[0]);var splitText=url.split("/"),idText=splitText[splitText.length-1];return idText=idText.replace(".html","")},this.suningParameter=function(url){const match=url.match(/product\.suning\.com\/(\d+\/\d+)\.html/);return match?match[1].replace(/\//g,'-'):null},this.getEcommercePlatform=function(host=window.location.host){let platform="";return-1!=host.indexOf(".taobao.")||-1!=host.indexOf(".liangxinyao.")?platform="taobao":-1!=host.indexOf(".tmall.")?platform="tmall":-1!=host.indexOf(".jd.")||-1!=host.indexOf(".yiyaojd.")||-1!=host.indexOf(".jkcsjd.")?platform="jd":-1!=host.indexOf(".vip.")||-1!=host.indexOf(".vipglobal.")?platform="vpinhui":-1!=host.indexOf(".suning.")&&(platform="suning"),platform},this.isPC=function(){for(var userAgentInfo=navigator.userAgent,Agents=["Android","iPhone","SymbianOS","Windows Phone","iPad","iPod"],flag=!0,v=0;v0){flag=!1;break}return flag},this.getBilibiliBV=function(){return window.location.pathname.replace("/video/","").replace("/","")},this.getSystemOS=function(){var u=navigator.userAgent;return u.match(/compatible/i)||u.match(/Windows/i)?'windows':u.match(/Macintosh/i)||u.match(/MacIntel/i)?'macOS':u.match(/iphone/i)||u.match(/Ipad/i)?'ios':u.match(/android/i)?'android':'other'},this.RPCDownloadFile=function(fileName,url,savePath="D:/",RPCURL="ws://localhost:16800/jsonrpc",RPCToken=""){savePath||(savePath="D:/"),RPCURL||(RPCURL="ws://localhost:16800/jsonrpc");let options={//下载配置文件 +dir:savePath,"max-connection-per-server":"16",header:["User-Agent:"+navigator.userAgent,"Cookie:"+document.cookie,"Referer:"+window.location.href]};fileName&&(options.out=fileName);let jsonRPC={jsonrpc:"2.0",id:"huahuacat",method:"aria2.addUri",params:[[url],options]};return RPCToken&&jsonRPC.params.unshift("token:"+RPCToken),new Promise((function(resolve,reject){var webSocket=new WebSocket(RPCURL);webSocket.onerror=function(event){console.log("webSocket.onerror",event),reject("Aria2连接错误,请打开Aria2和检查RPC设置!")},webSocket.onopen=function(){webSocket.send(JSON.stringify(jsonRPC))},webSocket.onmessage=function(event){switch(JSON.parse(event.data).method){case"aria2.onDownloadStart":resolve("Aria2 开始下载【"+fileName+"】"),webSocket.close()}}}))},this.getElementObject=function(selector,target=document.body,allowEmpty=!0,delay=10,maxDelay=1e4){return new Promise((resolve,reject)=>{if("BODY"===selector.toUpperCase())return void resolve(document.body);if("HTML"===selector.toUpperCase())return void resolve(document.html);let totalDelay=0,element=target.querySelector(selector),result=allowEmpty?!!element:!!element&&!!element.innerHTML;result&&resolve(element);const elementInterval=setInterval(()=>{totalDelay>=maxDelay&&(clearInterval(elementInterval),resolve(null)),element=target.querySelector(selector),result=allowEmpty?!!element:!!element&&!!element.innerHTML,result?(clearInterval(elementInterval),resolve(element)):totalDelay+=delay},delay)})}, +/** + * @param {Object} time + * @param {Object} format + * 时间格式化 + * DateFormat(new Date(dateCreated), "yyyy-MM-dd hh:mm:ss") + */ +this.DateFormat=function(time,format){var o={"M+":time.getMonth()+1,//月份 +"d+":time.getDate(),//日 +"h+":time.getHours(),//小时 +"m+":time.getMinutes(),//分 +"s+":time.getSeconds(),//秒 +"q+":Math.floor((time.getMonth()+3)/3),//季度 +S:time.getMilliseconds()};for(var k in/(y+)/.test(format)&&(format=format.replace(RegExp.$1,(time.getFullYear()+"").substr(4-RegExp.$1.length))),o)new RegExp("("+k+")").test(format)&&(format=format.replace(RegExp.$1,1==RegExp.$1.length?o[k]:("00"+o[k]).substr((""+o[k]).length)));return format},this.decryptStr=function(str){return atob(str).split('').reverse().join('')},this.encryptStr=function(str){let result=str.split('').reverse().join('');return btoa(result)}}; +//全局统一方法对象 +commonFunctionObject.addCommonHtmlCss();//统一html、css元素添加 +let functionController=null; +//相关功能关闭控制 +functionController=commonFunctionObject.GMgetValue("setingData"),functionController||(functionController={bilibiliHelper:!0,superVideoHelper:!0,abroadVideoHelper:!0,searchEnginesNavigation:!0,zhihuHelper:!0,shortVideoDownload:!0}), +// 菜单按钮弹框 +commonFunctionObject.isPC()?GM_registerMenuCommand("功能开关",()=> +//用户功能设置函数 +function(){var bilibiliHelper=!0,superVideoHelper=!0,abroadVideoHelper=!0,searchEnginesNavigation=!0,zhihuHelper=!0,shortVideoDownload=!0,isUpdateStorage=!1;functionController.hasOwnProperty("bilibiliHelper")?bilibiliHelper=functionController.bilibiliHelper:(functionController.bilibiliHelper=!0,isUpdateStorage=!0),functionController.hasOwnProperty("superVideoHelper")?superVideoHelper=functionController.superVideoHelper:(functionController.superVideoHelper=!0,isUpdateStorage=!0),functionController.hasOwnProperty("abroadVideoHelper")?abroadVideoHelper=functionController.abroadVideoHelper:(functionController.abroadVideoHelper=!0,isUpdateStorage=!0),functionController.hasOwnProperty("searchEnginesNavigation")?searchEnginesNavigation=functionController.searchEnginesNavigation:(functionController.searchEnginesNavigation=!0,isUpdateStorage=!0),functionController.hasOwnProperty("zhihuHelper")?zhihuHelper=functionController.zhihuHelper:(functionController.zhihuHelper=!0,isUpdateStorage=!0),functionController.hasOwnProperty("shortVideoDownload")?shortVideoDownload=functionController.shortVideoDownload:(functionController.shortVideoDownload=!0,isUpdateStorage=!0),isUpdateStorage&&commonFunctionObject.GMsetValue("setingData",functionController);for(var setingData=[{tag:"bilibiliHelper",name:"B站使用加强(视频下载支持批量、浏览记录、一键三连)",checked:bilibiliHelper},{tag:"zhihuHelper",name:"知乎使用加强(内容标识、问答显示优化、视频下载等)",checked:zhihuHelper},{tag:"superVideoHelper",name:"全网VIP视频解析(支持爱奇艺、腾讯视频、B站番剧等)",checked:superVideoHelper},{tag:"searchEnginesNavigation",name:"搜索引擎使用加强(适配百度、360、搜狗、必应、Google等)",checked:searchEnginesNavigation},{tag:"shortVideoDownload",name:"短视频去水印下载(支持抖音、快手等)",checked:shortVideoDownload},{tag:"abroadVideoHelper",name:"国外视频解析下载(支持油管、Facebook等)",checked:abroadVideoHelper}],content="",i=0;i\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t"}dialog.showMake({title:"功能开关",content:content,onClose:function(){location.reload()},onContentReady:function($that){$that.dialogContent.querySelectorAll("input[type='checkbox']").forEach((function(checkbox){checkbox.addEventListener("click",(function(e){var tag=e.target.getAttribute("data-tag"),checked=e.target.checked;functionController[tag]=checked,commonFunctionObject.GMsetValue("setingData",functionController),commonFunctionObject.webToast({message:"操作成功",background:"#FF4D40"})}))}))}})}()):(functionController.bilibiliHelper=!1,functionController.abroadVideoHelper=!1,functionController.searchEnginesNavigation=!1,functionController.zhihuHelper=!1); +/** + * 超级解析助手功能 + */ +//VIP视频解析接口可自定义;请严格按照格式添加 +//showType=1(仅PC), showType=2(仅mobile), showType=3(同时显示) +const originalInterfaceList=[];try{let newOriginalInterfaceList=originalInterfaceList;if(!functionController||functionController.superVideoHelper){const superVideoHelperObject=new function(originalInterfaceList){this.originalInterfaceList=originalInterfaceList,this.elementId=Math.ceil(1e8*Math.random())+"mmx",this.customInterfaceKey="custom_interface_key_dddsdxxa",this.quicklyInterfaceKey="custom_quickly_interface_key_dddsdxxa",this.defaultQuicklyInterfaceIndex=1,this.isRun=function(){//判断是否运行 +const urls=["www.iqiyi.com","v.qq.com","youku.com","www.le.com","mgtv.com","sohu.com","acfun.cn","bilibili.com","baofeng.com","pptv.com","1905.com","miguvideo.com","sports.iqiyi.com"];var result=!1;if(!window.location.host.startsWith("m."))//不是移动端执行 +for(var i=0;i{if(2!=item.showType){var selected="";index==quicklyInterfaceIndex&&(selected="selected",currentQuicklyInterfaceObject=item),category_1_html+=""+item.name+""}}); +//获得自定义位置 +var left=0,top=120,Position=commonFunctionObject.GMgetValue("Position_"+currentHost);Position&&(left=Position.left,top=Position.top);var color="#FF4D40",hoverColor="#000000";-1!=currentHost.indexOf("bilibili.com")&&(//自定义主题 +color="#fb7299",hoverColor="#00B0E1");var cssMould="#vip_movie_box"+this.elementId+"{cursor:pointer; position:fixed; top:"+top+"px; left:"+left+"px; width:0px; z-index:99999999; font-size:16px; text-align:left;}\n\t\t\t\t\t\t#vip_movie_box"+this.elementId+" .img_box"+this.elementId+"{width:24px; height:32px;line-height:32px;text-align:center;background-color:"+color+";}\n\t\t\t\t\t\t#vip_movie_box"+this.elementId+" .img_box"+this.elementId+":hover{\n\t\t\t\t\t\t\tbackground: linear-gradient(30deg, #2a66ff 40%, "+color+");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t#vip_movie_box"+this.elementId+" .img_box"+this.elementId+">img {width:20px; display:inline-block; vertical-align:middle;}\n\t\t\t\t\t\t\n\t\t\t\t\t\t#vip_movie_box"+this.elementId+" .showhide_box"+this.elementId+"{display:none;padding-left:5px;position: absolute;left: 24px;top: 0;}\n\t\t\t\t\t\t#vip_movie_box"+this.elementId+" .vip_mod_box_action_687ii{width:380px; max-height:400px; overflow-y:auto;background-color:rgba(241,241,241);}\n\t\t\t\t\t\t#vip_movie_box"+this.elementId+" .default-scrollbar-55678::-webkit-scrollbar{width:5px; height:1px;}\n\t\t\t\t\t\t#vip_movie_box"+this.elementId+" .default-scrollbar-55678::-webkit-scrollbar-thumb{box-shadow:inset 0 0 5px rgba(0, 0, 0, 0.2); background:#A8A8A8;}\n\t\t\t\t\t\t#vip_movie_box"+this.elementId+" .default-scrollbar-55678::-webkit-scrollbar-track{box-shadow:inset 0 0 5px rgba(0, 0, 0, 0.2); background:#F1F1F1;}\n\t\t\t\t\t\t\n\t\t\t\t\t\t#vip_movie_box"+this.elementId+" .vip_mod_box_action_687ii> .item_box"+this.elementId+"{margin-bottom:10px;}\n\t\t\t\t\t\t#vip_movie_box"+this.elementId+" .vip_mod_box_action_687ii> .item_box"+this.elementId+":last-child{margin-bottom:0px;}\n\t\t\t\t\t\t#vip_movie_box"+this.elementId+" .vip_mod_box_action_687ii> .item_box"+this.elementId+" >.title"+this.elementId+"{font-size:14px; text-align:left;color:#000000;font-weight:600;margin:5px 3px;}\n\t\t\t\t\t\t#vip_movie_box"+this.elementId+" .vip_mod_box_action_687ii> .item_box"+this.elementId+" >.interface_box"+this.elementId+"{}\n\t\t\t\t\t\t#vip_movie_box"+this.elementId+" .vip_mod_box_action_687ii> .item_box"+this.elementId+" >.interface_box"+this.elementId+">span{border-radius:3px;border-top:3px solid "+color+"; border-bottom:3px solid "+color+";display:inline-block;width:calc(25% - 6px);width:-moz-calc(25% - 6px);width: -webkit-calc(25% - 6px);height:20px;line-height:20px;background-color:"+color+";color:#FFF;cursor:pointer;margin:3px;text-align:center;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;-o-text-overflow:ellipsis;font-size:12px!important;box-sizing:content-box!important;}\t\t\t\t\t\t\t\n\t\t\t\t\t\t#vip_movie_box"+this.elementId+" .vip_mod_box_action_687ii> .item_box"+this.elementId+" >.interface_box"+this.elementId+">span:hover{border-top:3px solid "+hoverColor+"; border-bottom:3px solid "+hoverColor+";}\n\t\t\t\t\t\t#vip_movie_box"+this.elementId+" .vip_mod_box_action_687ii> .item_box"+this.elementId+" >.interface_box"+this.elementId+">span.selected{border-top:3px solid "+hoverColor+"; border-bottom:3px solid "+hoverColor+";}\n\t\t\t\t\t\t#vip_movie_box"+this.elementId+" .vip_mod_box_action_687ii> .item_box"+this.elementId+" >.content"+this.elementId+"{font-size:12px;color:#000000;margin-left:3px;}\n\t\t\t\t\t\t";commonFunctionObject.GMaddStyle(cssMould); +//加入HTML +var htmlMould="
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t
接口添加
\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t对现有接口不满意?可添加自定义接口哟~添加接口\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t接口请自行添加~\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t"+category_1_html+"\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t
免责声明:
\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t1、需要使用VIP视频解析的,请自行添加接口,版权问题请联系相关解析接口所有者,脚本不承担相关责任!\"
\n\t\t\t\t\t\t\t\t\t\t\t\t2、为创造良好的创作氛围,请大家支持正版!
\n\t\t\t\t\t\t\t\t\t\t\t\t3、脚本仅限个人学习交流,使用即已代表您已经充分了解相关问题,否则后果自负,特此声明!
\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t";$("body").append(htmlMould)},this.runEvent=function(){//事件运行 +var that=this;$("#vip_movie_box"+this.elementId+" >.plugin_inner_"+this.elementId).on("mouseover",()=>{$(".showhide_box"+this.elementId).show()}),$("#vip_movie_box"+this.elementId+" >.plugin_inner_"+this.elementId).on("mouseout",()=>{$(".showhide_box"+this.elementId).hide()}),$("body").on("click","#vip_movie_box"+this.elementId+" .vip_mod_box_action_687ii>.item_box"+this.elementId+">.interface_box"+this.elementId+">span",(function(){var index=parseInt($(this).attr("data-index")),playObject=that.originalInterfaceList[index];that.showPlayerWindow(playObject),$("#vip_movie_box"+that.elementId+" .vip_mod_box_action_687ii> .item_box"+that.elementId+">.interface_box"+that.elementId+">span").removeClass("selected"),$(this).addClass("selected"),commonFunctionObject.GMsetValue(that.quicklyInterfaceKey,index),$("#img_quickly_6667897iio").find("img").attr("title","快速开始(当前所选接口:"+playObject.name+")")})), +//点击弹出设置框 +$("#img_set_6667897iio").on("click",(function(){that.showSetingDialog()})),$("#img_quickly_6667897iio").on("click",(function(){const quicklyInterfaceIndex=that.getQuicklyInterfaceIndex();var playObject=that.originalInterfaceList[quicklyInterfaceIndex];that.showPlayerWindow(playObject)})); +//右键移动位置 +var movie_box=$("#vip_movie_box"+this.elementId);movie_box.mousedown((function(e){if(3==e.which){e.preventDefault(),movie_box.css("cursor","move");var positionDiv=$(this).offset(),distenceX=e.pageX-positionDiv.left,distenceY=e.pageY-positionDiv.top;$(document).mousemove((function(e){var x=e.pageX-distenceX,y=e.pageY-distenceY,windowWidth=$(window).width(),windowHeight=$(window).height();x<0?x=0:x>windowWidth-movie_box.outerWidth(!0)-100&&(x=windowWidth-movie_box.outerWidth(!0)-100),y<0?y=0:y>windowHeight-movie_box.outerHeight(!0)&&(y=windowHeight-movie_box.outerHeight(!0)),movie_box.css("left",x),movie_box.css("top",y),commonFunctionObject.GMsetValue("Position_"+window.location.host,{left:x,top:y})})),$(document).mouseup((function(){$(document).off('mousemove'),movie_box.css("cursor","pointer")})),$(document).contextmenu((function(e){e.preventDefault()}))}}))},this.removeVideoAdBlock_iqiyi=function(){},this.removeVideoAdBlock_vqq=function(){},this.removeVideoAdBlock_youku=function(){},this.removeVideoAdBlock_mgtv=function(){},this.removeVideoAdBlock_sohu=function(){},this.removeVideoAdBlock=function(){const currentHost=window.location.host;-1!=currentHost.indexOf("www.iqiyi.com")?this.removeVideoAdBlock_iqiyi():-1!=currentHost.indexOf("v.qq.com")?this.removeVideoAdBlock_vqq():-1!=currentHost.indexOf("v.youku.com")?this.removeVideoAdBlock_youku():-1!=currentHost.indexOf("www.mgtv.com")?this.removeVideoAdBlock_mgtv():-1!=currentHost.indexOf("tv.sohu.com")&&this.removeVideoAdBlock_sohu()},this.showSetingDialog=function(){var customInterfaceKey=this.customInterfaceKey,content="\n\t\t\t
\n\t\t\t\t
自定义解析接口
\n\t\t\t\t
\t\t\t\t\t\n\t\t\t\t\t数据格式:[名字] + [,] + [接口地址]
\n\t\t\t\t\t例如:就是名字而已,https://xxxxxx?url=
\n\t\t\t\t\t注:一行一个\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t";dialog.showMake({title:"解析接口添加",content:content,onContentReady:function($that){$that.dialogContent.querySelector(".save-custom-interface-btn").addEventListener("click",(function(){var content=$that.dialogContent.querySelector(".custom-interface-textarea").value;commonFunctionObject.GMsetValue(customInterfaceKey,content),commonFunctionObject.webToast({message:"自定义接口保存成功",background:"#FF4D40"})}))}})},this.start=function(){let delayTimeMs=0;-1!=window.location.host.indexOf("www.bilibili.com")&&(delayTimeMs=2200),setTimeout(()=>{try{this.removeVideoAdBlock()}catch(e){}try{this.analysisCustomInterface(),this.addHtmlElements(),this.runEvent()}catch(e){}},delayTimeMs)}}(newOriginalInterfaceList);if(superVideoHelperObject.isRun())if("true"===commonFunctionObject.GMgetValue("copyright_video_remind",null))superVideoHelperObject.start();else 1==confirm("脚本运行提醒!!!\r1、VIP视频解析中所用到的解析接口全部收集自互联网(源码可见),版权问题请联系相关解析接口所有者!\r2、为创造良好的创作氛围,请大家支持正版!\r3、脚本仅限个人学习交流,切勿用于任何商业等其它用途!\r4、继续使用,即表明你已经明确使用脚本可能带来的风险,且愿意自行承担相关风险,对于风险脚本不承担任何责任!\r5、此提醒只弹出一次,确认后,后续将不在弹出,请知悉!")&&(commonFunctionObject.GMsetValue("copyright_video_remind","true"),superVideoHelperObject.start());new +/** + * 移动端VIP解析 + * @param {Object} originalInterfaceList + */ +function(originalInterfaceList){this.originalInterfaceList=originalInterfaceList,this.elementId=Math.ceil(1e8*Math.random())+"mmx",this.quicklyInterfaceKey="custom_mobile_quickly_interface_key_dddsdxxa",this.defaultQuicklyInterfaceIndex=2,this.playerNodes=[{url:"m.iqiyi.com",showNode:".m-video-player-wrap",color:"#05B03B"},{url:"m.v.qq.com",showNode:".mod_player",color:"#F99D39"},{url:"m.youku.com",showNode:".h5-detail-player",color:"#08BAFD"},{url:"m.mgtv.com",showNode:".video-area",color:"#E95904"}],this.isRun=function(){//判断是否运行 +const host=window.location.host,urls=["m.iqiyi.com","m.v.qq.com","m.youku.com","m.mgtv.com","m.bilibili.com"];var result=!1;if(host.startsWith("m."))//是移动端执行 +for(var i=0;i{const elementInterval=setInterval(()=>{const nodeElementObject=$(nodeObject.showNode),themeColor=nodeObject.color;if(0==nodeElementObject.length)return;clearInterval(elementInterval); +//添加HTML +let category_1_html="";this.originalInterfaceList.forEach((item,index)=>{if(1!=item.showType){var selected="";index==quicklyInterfaceIndex&&(selected="selected"),category_1_html+=""}});var htmlMould="\n\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t选择解析接口\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t站外解析\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t免责申明:1、VIP视频解析中所用到的解析接口全部收集自互联网(源码可见),版权问题请联系相关解析接口所有者!\n\t\t\t\t\t\t\t\t\t2、为创造良好的创作氛围,请大家支持正版!\n\t\t\t\t\t\t\t\t\t3、脚本仅限个人学习交流,切勿用于任何商业等其它用途!\n\t\t\t\t\t\t\t\t\t4、继续使用,即表明你已经明确使用脚本可能带来的风险,且愿意自行承担相关风险,对于风险脚本不承担任何责任!\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t";nodeElementObject.after(htmlMould),resolve("ok")},100)})},this.getPlayObjectBySelect=function(){var indexString=$("#interface_selection_"+this.elementId).find("option:selected").attr("index"),index=0;return indexString&&(index=parseInt(indexString)),this.originalInterfaceList[index]},this.runEvent=function(){//事件运行 +const self=this; +//初始化 +var playObject=self.getPlayObjectBySelect();$('#start_analysis_outer_'+self.elementId).attr("href",playObject.url+window.location.href),$('#start_analysis_outer_'+self.elementId).on('click',(function(e){"true"===commonFunctionObject.GMgetValue("copyright_video_remind_mobile_outer",null)||(0==confirm("脚本运行提醒!!!\r使用站外解析功能,视频解析时脚本跳出本页面,如不同意此脚本行为,请点击【取消】按钮!!")?e.preventDefault():commonFunctionObject.GMsetValue("copyright_video_remind_mobile_outer","true"))})), +//接口切换 +$('#interface_selection_'+self.elementId).on('change',(function(){var $option=$(this).find("option:selected"),value=$option.val(),index=parseInt($option.attr("index"));$('#start_analysis_outer_'+self.elementId).attr("href",value+window.location.href),commonFunctionObject.GMsetValue(self.quicklyInterfaceKey,index)}))},this.start=function(){const self=this;this.isRun()&&this.addHtmlElements().then(()=>{self.runEvent()})}}(newOriginalInterfaceList).start()}}catch(e){console.log("全网VIP解析:error:"+e)} +/** + * B站相关功能:视频多P下载,一键三联,浏览记录等 + */try{functionController&&!functionController.bilibiliHelper||(new function(){this.isRun=function(){return-1!=window.location.host.indexOf("bilibili.com")},this.baseFunction=function(){try{(new +/** + * b站基本功能,一件三连、视频解析、视频下载 + */ +function(){this.elementId=Math.ceil(1e8*Math.random())+"mmx",this.downloadSettingKey="download_setting_key",this.downloadResutError=function(btnElement){btnElement.text("下载视频"),btnElement.removeAttr("disabled")},this.downloadResutSuccess=function(btnElement){btnElement.text("下载视频"),btnElement.removeAttr("disabled")},this.getDownloadPages=function(){return new Promise((function(resolve,reject){var pathname=window.location.pathname,bv=null;(// 在下载视频的时候针对稍后再看页面的链接找BV号 +bv=-1!=pathname.indexOf("/medialist/play/watchlater/")?pathname.replace("/medialist/play/watchlater/","").replace("/",""):pathname.replace("/video/","").replace("/",""))? +//bv转av +commonFunctionObject.request("get","https://api.bilibili.com/x/web-interface/view?bvid="+bv,null).then(resultData=>{let dataJson=JSON.parse(resultData.data);if(!dataJson||0!==dataJson.code||!dataJson.data)return void resolve({status:"request_error"});let data=dataJson.data;if(!data)return void resolve({status:"aid_null"});let aid=data.aid,pic=data.pic,title=data.title;aid? +//获取cid +commonFunctionObject.request("get","https://api.bilibili.com/x/web-interface/view?aid="+aid,null).then(resultData2=>{let dataJson2=JSON.parse(resultData2.data);if(!dataJson2||0!==dataJson2.code||!dataJson2.data)return void resolve({status:"request_error"});const downloadData=dataJson2.data,{aid:aid,bvid:bvid}=downloadData,items=new Array; +//这是下载集合 +if(downloadData.hasOwnProperty("ugc_season")&&downloadData.ugc_season.hasOwnProperty("sections")){let sections=downloadData.ugc_season.sections,page=1;for(var i=0;i{resolve({status:"request_error"})}):resolve({status:"aid_null"})}).catch(errorData=>{resolve({status:"request_error"})}):resolve({status:"bv_null"})}))},this.startDownloadFile=function(options){let aid=options.aid,cid=options.cid,fileName=options.fileName,savePath=options.savePath,RPCURL=options.RPCURL,isByPRC=(options.RPCToken,options.isByPRC);commonFunctionObject.request("get","https://api.bilibili.com/x/player/playurl?avid="+aid+"&cid="+cid+"&qn=112",null).then(resultData3=>{fileName||(fileName=(new Date).getTime()+""),fileName=fileName.replace(/[\ |\~|\`|\=|\||\\|\;|\:|\"|\'|\,|\.|\>|\/]/g,""),fileName=fileName.substring(0,50),//可能有异常,标题最多50字符 +fileName+=".mp4";let dataJson3=JSON.parse(resultData3.data);if(dataJson3&&0===dataJson3.code&&dataJson3.data){let downloadUrl=dataJson3.data.durl[0].url;isByPRC?commonFunctionObject.RPCDownloadFile(fileName,downloadUrl,savePath,RPCURL).then(data=>{commonFunctionObject.webToast({message:data,time:3e3})}).catch(data=>{commonFunctionObject.webToast({message:data,time:3e3})}):window.open(downloadUrl)}else commonFunctionObject.webToast({message:"获取下载链接失败",background:"#FF4D40"})}).catch(errorData=>{commonFunctionObject.webToast({message:"获取下载链接失败",background:"#FF4D40"})})},this.createModals=function(){var css="\n\t\t\t\t\t.modal-mask-"+this.elementId+"{\n\t\t\t\t\t\tposition:fixed;\n\t\t\t\t\t\ttop:0;\n\t\t\t\t\t\tleft:0;\n\t\t\t\t\t\tz-index:999;\n\t\t\t\t\t\twidth:100%;\n\t\t\t\t\t\theight:100%;\n\t\t\t\t\t\tdisplay:none;\n\t\t\t\t\t\tbackground-color:#000;\n\t\t\t\t\t\topacity:0.3;\n\t\t\t\t\t\toverflow:hidden;\n\t\t\t\t\t}\n\t\t\t\t\t.modal-body-"+this.elementId+"{\n\t\t\t\t\t\tposition:fixed;\n\t\t\t\t\t\tborder-radius:5px;\n\t\t\t\t\t\tbackground-color: #FFFFFF;\n\t\t\t\t\t\ttop:10%;\n\t\t\t\t\t\twidth:600px;\n\t\t\t\t\t\tmax-width:90%;\n\t\t\t\t\t\tmax-height:80%;\n\t\t\t\t\t\tz-index:1000;\n\t\t\t\t\t\tleft: 50%;\n\t\t\t\t\t\ttransform: translateX(-50%);\n\t\t\t\t\t\tdisplay:none;\n\t\t\t\t\t\tpadding: 10px;\n\t\t\t\t\t\toverflow-y: auto;\n\t\t\t\t\t}\n\t\t\t\t\t.modal-body-"+this.elementId+" >.page-header{\n\t\t\t\t\t\theight:30px;\n\t\t\t\t\t\tline-height:30px;\n\t\t\t\t\t\tposition:relative;\n\t\t\t\t\t}\n\t\t\t\t\t.modal-body-"+this.elementId+" >.page-header >span{\n\t\t\t\t\t\tdisplay:inline-block;\n\t\t\t\t\t}\n\t\t\t\t\t.modal-body-"+this.elementId+" >.page-header >span:nth-child(1) {\n\t\t\t\t\t\tfont-size:18px;\n\t\t\t\t\t\tfont-weight:bold;\n\t\t\t\t\t\tposition:absolute;\n\t\t\t\t\t\tleft:10px;\n\t\t\t\t\t}\n\t\t\t\t\t.modal-body-"+this.elementId+" >.page-header >span:nth-child(2) {\n\t\t\t\t\t\tfont-size:28px;\n\t\t\t\t\t\tfont-weight:bold;\n\t\t\t\t\t\tposition:absolute;\n\t\t\t\t\t\tright:10px;\n\t\t\t\t\t\tcursor:pointer;\n\t\t\t\t\t}\n\t\t\t\t\t.modal-body-"+this.elementId+" >.page-container{\n\t\t\t\t\t\tmax-height: 500px;\n\t\t\t\t\t\toverflow-y: auto;\n\t\t\t\t\t}\n\t\t\t\t\t.modal-body-"+this.elementId+" .page-wrap{\n\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\tflex-wrap: wrap;\n\t\t\t\t\t\tmargin-top:5px;\n\t\t\t\t\t}\n\t\t\t\t\t.modal-body-"+this.elementId+" .page-wrap >.board-item{\n\t\t\t\t\t\tdisplay: block;\n\t\t\t\t\t\twidth: calc(50% - 10px);\n\t\t\t\t\t\tbackground-color: #6A5F60;\n\t\t\t\t\t\tmargin: 5px;\n\t\t\t\t\t\tbackground-color:#FB7299;\n\t\t\t\t\t\tcolor:#FFFFFF;\n\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t\toverflow:hidden;\n\t\t\t\t\t\twhite-space:nowrap;\n\t\t\t\t\t\ttext-overflow:ellipsis;\n\t\t\t\t\t}\n\t\t\t\t\t.modal-body-"+this.elementId+" .page-wrap >.board-item >input{\n\t\t\t\t\t\twidth: 14px;\n\t\t\t\t\t\theight: 14px;\n\t\t\t\t\t\tvertical-align: middle;\n\t\t\t\t\t\tmargin-right:5px;\n\t\t\t\t\t}\n\t\t\t\t\t.modal-body-"+this.elementId+" .page-wrap >.board-item >span{\n\t\t\t\t\t\tvertical-align: middle;\n\t\t\t\t\t}\n\t\t\t\t\t.modal-body-"+this.elementId+" .modal-btn-wrap{\n\t\t\t\t\t\ttext-align: center;\n\t\t\t\t\t\tmargin-top: 10px;\n\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t}\n\t\t\t\t\t.modal-body-"+this.elementId+" .aria2-setting{\n\t\t\t\t\t\tborder:1px dashed #F1F1F1;\n\t\t\t\t\t\tborder-radius:4px;\n\t\t\t\t\t\tmargin-top:10px;\n\t\t\t\t\t}\n\t\t\t\t\t.modal-body-"+this.elementId+" .aria2-setting >.setting-item{\n\t\t\t\t\t\ttext-align: center;\n\t\t\t\t\t\tfont-size:14px;\n\t\t\t\t\t\tmargin:10px 0px;\n\t\t\t\t\t}\n\t\t\t\t\t.modal-body-"+this.elementId+" .aria2-setting >.setting-item .topic-name{\n\t\t\t\t\t\tdisplay:inline-block;\n\t\t\t\t\t\twidth:80px;\n\t\t\t\t\t\ttext-align:left;\n\t\t\t\t\t}\n\t\t\t\t\t.modal-body-"+this.elementId+" .aria2-setting >.setting-item> input{\n\t\t\t\t\t\twidth:300px;\n\t\t\t\t\t\tpadding-left:10px;\n\t\t\t\t\t\tborder:1px solid #888;\n\t\t\t\t\t\toutline:none;\n\t\t\t\t\t\tborder-radius:3px;\n\t\t\t\t\t}\n\t\t\t\t\t.modal-body-"+this.elementId+" .modal-btn-wrap >span{\n\t\t\t\t\t\tborder:1px solid #ccc;\n\t\t\t\t\t\tdisplay:inline-block;\n\t\t\t\t\t\tpadding:3px 5px;\n\t\t\t\t\t\tmargin:0px 5px;\n\t\t\t\t\t\tborder-radius:3px;\n\t\t\t\t\t}\n\t\t\t\t\t.modal-body-"+this.elementId+" .tip-wrap{\n\t\t\t\t\t\tmargin-top: 10px;\n\t\t\t\t\t\tfont-size:12px;\n\t\t\t\t\t}\n\t\t\t\t\t.modal-body-"+this.elementId+" .tip-wrap >.title{\n\t\t\t\t\t\tfont-size:16px;\n\t\t\t\t\t\tfont-weight:bold;\n\t\t\t\t\t}\n\t\t\t\t\t.modal-body-"+this.elementId+" .tip-wrap >.content >ul >li{\n\t\t\t\t\t\tmargin-top:5px;\n\t\t\t\t\t}\n\t\t\t\t",html="\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t";commonFunctionObject.GMaddStyle(css),$("body").append(html)},this.hideModals=function(){$(".modal-body-"+this.elementId).css('display','none'),$(".modal-mask-"+this.elementId).css('display','none')},this.showModals=function(pageHtml){const self=this,downloadSettingKey=self.downloadSettingKey;$(".modal-body-"+self.elementId).css('display','block'),$(".modal-mask-"+self.elementId).css('display','block'),$(".modal-body-"+self.elementId+" .page-wrap").html(pageHtml); +//初始化设置的数据 +var savePath="D:/";"macOS"===commonFunctionObject.getSystemOS()&&(savePath="");const downloadSetting=commonFunctionObject.GMgetValue(this.downloadSettingKey,{RPCURL:"ws://localhost:16800/jsonrpc",savePath:savePath,RPCToken:'',downloadWay:"Motrix"}),isMotrix="Motrix"==downloadSetting.downloadWay;$(".modal-body-"+self.elementId+" input[name='RPCURL']").val(downloadSetting.RPCURL),$(".modal-body-"+self.elementId+" input[name='savePath']").val(downloadSetting.savePath),$(".modal-body-"+self.elementId+" input[name='RPCToken']").val(downloadSetting.RPCToken),$(".modal-body-"+self.elementId+" input[name='downloadWay']").removeAttr("checked"),isMotrix?$(".modal-body-"+self.elementId+" input:radio[value='Motrix']").attr('checked','true'):$(".modal-body-"+self.elementId+" input:radio[value='AriaNgGUI']").attr('checked','true'),$(".modal-body-"+self.elementId+" .page-wrap >.board-item >span").off("click").on("click",(function(){$(this).css("background-color","#ccc");let downloadOptions={aid:$(this).data("aid"),cid:$(this).data("cid"),isByPRC:!1};self.startDownloadFile(downloadOptions)})),$(".modal-body-"+self.elementId+" .page-header >span.close").off("click").on("click",(function(){self.hideModals()})),$(".modal-body-"+self.elementId+" .modal-btn-wrap >span[name='selectall']").off("click").on("click",(function(){$(".modal-body-"+self.elementId+" .page-wrap").find("input[type='checkbox']").each((function(){$(this).prop('checked',!0)}))})),$(".modal-body-"+self.elementId+" input[name='downloadWay']").off("change").on("change",(function(){"Motrix"==$(this).val()?$(".modal-body-"+self.elementId+" input[name='RPCURL']").val("ws://localhost:16800/jsonrpc"):$(".modal-body-"+self.elementId+" input[name='RPCURL']").val("ws://localhost:6800/jsonrpc")})),$(".modal-body-"+self.elementId+" .modal-btn-wrap >span[name='removeSelect']").off("click").on("click",(function(){$(".modal-body-"+self.elementId+" .page-wrap").find("input[type='checkbox']").each((function(){$(this).prop('checked',!1)}))})),$(".modal-body-"+self.elementId+" .modal-btn-wrap >span[name='downloadAll']").off("click").on("click",(function(){let RPCURL=$(".modal-body-"+self.elementId+" input[name='RPCURL']").val(),savePath=$(".modal-body-"+self.elementId+" input[name='savePath']").val(),RPCToken=$(".modal-body-"+self.elementId+" input[name='RPCToken']").val(),downloadWay=$(".modal-body-"+self.elementId+" input[name='downloadWay']:checked").val();commonFunctionObject.GMsetValue(downloadSettingKey,{RPCURL:RPCURL,savePath:savePath,RPCToken:RPCToken,downloadWay:downloadWay});let inputElements=$(".modal-body-"+self.elementId+" .page-wrap input[type='checkbox']:checked");if(0==inputElements.length)return void commonFunctionObject.webToast({message:"至少需要选中1P",background:"#FF4D40"});if(!savePath)return void commonFunctionObject.webToast({message:"保存路径不能为空",background:"#FF4D40"});if(!RPCURL)return void commonFunctionObject.webToast({message:"PRC地址不能为空",background:"#FF4D40"});RPCToken=RPCToken||"";let downloadOptions={aid:"",cid:"",isByPRC:!0,fileName:"",savePath:savePath,RPCURL:RPCURL,RPCToken:RPCToken};inputElements.each((function(){setTimeout(()=>{let aid=$(this).data("aid"),cid=$(this).data("cid"),fileName=$(this).attr("title");downloadOptions.aid=aid,downloadOptions.cid=cid,downloadOptions.fileName=fileName,self.startDownloadFile(downloadOptions)},1e3)}))}))},this.createElementHtml=async function(){$("#bilibili_exti_9787fjfh12j").remove();const randomNumber=this.elementId,self=this;let htmlText="\n\t\t\t\t\t
\n\t\t\t\t\t\t
下载视频
\n\t\t\t\t\t\t
一键三连
\n\t\t\t\t\t
\n\t\t\t\t"; +//添加下载等操作按钮 +commonFunctionObject.GMaddStyle("\n\t\t\t\t\t#bilibili_exti_9787fjfh12j{\n\t\t\t\t\t\tposition:fixed;\n\t\t\t\t\t\tleft:-30px;\n\t\t\t\t\t\ttop:250px;\n\t\t\t\t\t\topacity:0.6;\n\t\t\t\t\t\ttransition: 0.3s;\n\t\t\t\t\t}\n\t\t\t\t\t#bilibili_exti_9787fjfh12j >.self_s_btn{\n\t\t\t\t\t\tbackground-color:#FB7299;\n\t\t\t\t\t\tcolor:#FFF;\n\t\t\t\t\t\tfont-size:10px;\n\t\t\t\t\t\tborder-radius:3px;\n\t\t\t\t\t\tcursor:pointer;\n\t\t\t\t\t\tmargin:10px 0px;\n\t\t\t\t\t\twidth:60px;\n\t\t\t\t\t\theight:20px;\n\t\t\t\t\t\ttext-align:center;\n\t\t\t\t\t\tline-height:20px;\n\t\t\t\t\t}\n\t\t\t\t"),$("body").append(htmlText), +//创建弹框 +this.createModals(), +//移入移除操作 +$("#bilibili_exti_9787fjfh12j").hover((function(){$(this).css({left:"0px",opacity:1})}),(function(){$(this).css({left:(0-$(this).width())/2+"px",opacity:.6})})), +//下载操作函数 +$("body").on("click","#download_s_"+randomNumber,(function(){const btnElement=$(this);btnElement.attr("disabled","disabled"),btnElement.text("准备中~"), +//开始准备下载数据 +self.getDownloadPages().then(resule=>{if("success"===resule.status){const{items:items,pic:pic,title:title}=resule.downloadData;let itemHtml="";itemHtml+="";for(var i=0;i",itemHtml+=""+currentTitle+"",itemHtml+=""}self.showModals(itemHtml),self.downloadResutSuccess(btnElement)}else self.downloadResutError(btnElement)}).catch(error=>{self.downloadResutError(btnElement)})})),$("body").on("click","#focus_s_"+randomNumber,(function(){$("#arc_toolbar_report .video-like").click(),// 点赞 +$("#arc_toolbar_report .video-coin").click()}))},this.start=function(){let locationHost=window.location.host,locationPathname=window.location.pathname;"www.bilibili.com"!==locationHost||-1==locationPathname.indexOf("/video")&&-1==locationPathname.indexOf("/watchlater")||this.createElementHtml()}}).start()}catch(e){console.log("baseFunctionObject new error",e)}}, +/** + * 浏览历史记录提醒 + */ +this.recordViewFunction=function(){try{(new function(){this.localCacheName="bilibili_video_record",this.recordOneVideo=function(){new Promise((resolve,reject)=>{let bv=commonFunctionObject.getBilibiliBV(),cacheText=commonFunctionObject.GMgetValue(this.localCacheName);cacheText=cacheText||"";let currentLength=cacheText.length;currentLength>6e3&&(cacheText=cacheText.substring(1200,currentLength)),-1==cacheText.indexOf(bv)&&(cacheText+=bv,commonFunctionObject.GMsetValue(this.localCacheName,cacheText)),resolve({result:"success"})})},this.searchPageRemindHtml=function($ele,top=8,right=8){0==$ele.find("div[name='marklooked']").length&&($ele.css("position","relative"),$ele.append("
已看
"))},this.searchPageRemind=function(){let $that=this;var elementArray=[{node:".bili-video-card",top:8,right:12},//兼容 MAC M1搜索结果 +{node:"#page-index .small-item",top:12,right:12},//用户投稿 +{node:"#submit-video-list .small-item",top:12,right:12},//用户主页 +{node:"#page-series-detail .small-item.fakeDanmu-item",top:12,right:12}];setInterval((function(){let cacheText=commonFunctionObject.GMgetValue($that.localCacheName);cacheText=cacheText||"";for(var i=0;i{//循环操作,单独绑定 +$that.searchPageRemindHtml($(this),elementobj.top,elementobj.right)})}$(this).attr("dealxll","true")}}}))}}),500)},this.start=function(){let $that=this;if(-1!=window.location.pathname.indexOf("/video")&&"www.bilibili.com"===window.location.host){let currentHref="";setInterval(()=>{//需要循环存储 +window.location.href!==currentHref&&(this.recordOneVideo(),currentHref=window.location.href)},500)} +//搜索结果和用户主页已经看过的视频提醒 +-1!=window.location.host.indexOf("bilibili.com")&&(this.searchPageRemind(),GM_registerMenuCommand("清空B站浏览记录",(function(){confirm('是否要清空B站浏览记录?清空后将不可恢复...')&&commonFunctionObject.GMsetValue($that.localCacheName,"")})))}}).start()}catch(e){console.log("recordViewObject new error",e)}}, +/** + * 视频描述文本转链接 + */ +this.textToLinkFunction=function(){try{(new function(){this.link=function(selector){window.location.href;const textToLinkArea=document.querySelector(selector);textToLinkArea&&findAndReplaceDOMText(textToLinkArea,{find:/(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?/g,replace:function(e,t){let text=e.text,element=null;return-1==text.indexOf("bilibili.com")&&/^(http|ftp|https)/i.test(text)?(element=document.createElement("a"),element.setAttribute("href",text),element.setAttribute("target","_blank"),element.style.color="#00AEEC"):element=document.createElement("span"),element.innerText=text,element},preset:"prose"})},this.start=function(){this.link("#v_desc");const bodyMutationObserver=new(window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver)(()=>{this.link("#v_desc")}),element=document.querySelector("#v_desc");element&&bodyMutationObserver.observe(element,{characterData:!0,attributes:!0,childList:!0})}}).start()}catch(e){console.log("textToLinkObject new error",e)}},this.signIn=async function(){//签到下线,2024年7月2日 +},this.start=function(){this.isRun()&&(this.baseFunction(),this.recordViewFunction(),this.textToLinkFunction(),this.signIn())}}).start()}catch(e){console.log("B站视频下载:error:"+e)} +/** + * 知乎助手开始 + */try{functionController&&!functionController.zhihuHelper||(new function(){this.markArticleOrQuestion=function(){commonFunctionObject.GMaddStyle("\n\t\t\t.AnswerItem .ContentItem-title a::before {\n\t\t\t\tcontent: '问题';\n\t\t\t\tcolor: #f68b83;\n\t\t\t\tbackground-color: #f68b8333;\n\t\t\t\tfont-weight: bold;\n\t\t\t\tfont-size: 13px;\n\t\t\t\tpadding: 1px 4px 0px;\n\t\t\t\tborder-radius: 2px;\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tvertical-align: middle;\n\t\t\t\tmargin: 0px 4px 0px 0px;\n\t\t\t}\n\t\t\t.ArticleItem .ContentItem-title a::before {\n\t\t\t\tcontent: '文章';\n\t\t\t\tcolor: #0066FF;\n\t\t\t\tbackground-color: #E5EFFF;\n\t\t\t\tfont-weight: bold;\n\t\t\t\tfont-size: 13px;\n\t\t\t\tpadding: 1px 4px 0;\n\t\t\t\tborder-radius: 2px;\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tvertical-align: middle;\n\t\t\t\tmargin: 0px 4px 0px 0px;\n\t\t\t}\n\t\t\t.ZvideoItem .ContentItem-title a::before {\n\t\t\t\tcontent:'视频';\n\t\t\t\tcolor: #00BCD4;\n\t\t\t\tbackground-color: #00BCD433;\n\t\t\t\tfont-weight: bold;\n\t\t\t\tfont-size: 13px;\n\t\t\t\tpadding: 1px 4px 0;\n\t\t\t\tborder-radius: 2px;\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tvertical-align: middle;\n\t\t\t\tmargin: 0px 4px 0px 0px;\n\t\t\t}\n\t\t\t.TopstoryItem--advertCard{\n\t\t\t\ttext-decoration:line-through;\n\t\t\t}\n\t\t")},this.autoJumpTarget=function(){var regexResult=location.search.match(/target=(.+?)(&|$)/);regexResult&&3==regexResult.length&&(location.href=decodeURIComponent(regexResult[1]))}, +// 为问题本身添加时间 +this.addDateQuestion=function(){var title=document.querySelector(".QuestionPage");if(title){var dateCreated=title.querySelector("[itemprop~=dateCreated][content]").content,dateModified=title.querySelector("[itemprop~=dateModified][content]").content,createDate=commonFunctionObject.DateFormat(new Date(dateCreated),"yyyy-MM-dd hh:mm:ss"),editDate=commonFunctionObject.DateFormat(new Date(dateModified),"yyyy-MM-dd hh:mm:ss"),side=title.querySelector(".QuestionHeader-side"),timeDiv=document.createElement('div');timeDiv.innerHTML=`

创建于: ${createDate}

编辑于: ${editDate}

`,timeDiv.style.cssText='color:#6f6f6f;font-size:13px;',side.appendChild(timeDiv)}}, +// 为回答添加时间 +this.addTimeAnswerItems=function(){for(var list=document.querySelectorAll(".AnswerItem:not(div[zh_date_mk='true'])"),item=null,i=0;i${qJson.name}
`;document.querySelector('.QuestionHeader-topics').insertAdjacentHTML('beforebegin',html)},this.startDealwithQuestion=function(){let isMarkComplete=!0;setInterval(()=>{isMarkComplete&&(isMarkComplete=!1,isMarkComplete=this.addTimeAnswerItems())},2500),this.showQuestionAuthor(),this.addDateQuestion()},this.downloadVideo=function(){let isMarkComplete=!0;setInterval(()=>{!function(){if(isMarkComplete){isMarkComplete=!1; +// console.log("知乎视频下载循坏监听次数:", itemArray.length); +for(var itemArray=document.querySelectorAll("._1tg8oir:not(span[zh_date_mk='true'])"),item=null,i=0;idelayMS)&& +//拉取服务器本次不用,下次再使用 +commonFunctionObject.request("get","https://sct.staticj.top/script/api/nav?t="+currentMS,null).then(serverJson=>{let data=JSON.parse(serverJson.data);//获取本地data +data.ms=currentMS,//添加时间戳保存到本地区 +commonFunctionObject.GMsetValue(self.serverNavigationkey,data)} +//console.log("拉取服务器"); +).catch(error=>{}),finalNavigationData=serverNavigationData?JSON.parse(serverNavigationData.list):navigationData}}catch(e){finalNavigationData=navigationData}self.createHtml(element,elementInput,finalNavigationData)},this.createCss=function(elementNum){var innnerCss="\n\t\t\t#dsdsd99mmmjj7760011{\n\t\t\t\tmargin-bottom:20px;\n\t\t\t}\n\t\t\t.tab"+elementNum+"{\n\t\t\t\tmargin-bottom:8px;\n\t\t\t}\n\t\t\t.tab-c-titles"+elementNum+"{\n\t\t\t\tmargin-bottom:8px;\n\t\t\t}\n\t\t\t.tab-c-links"+elementNum+"{\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t.tabs-t"+elementNum+"{\n\t\t\t\tdisplay: inline-block;\n\t\t\t\twidth: 80px;\n\t\t\t\theight: 28px;\n\t\t\t\tline-height: 28px;\n\t\t\t\tfont-size: 15px;\n\t\t\t\tletter-spacing: 0;\n\t\t\t\ttext-align: center;\n\t\t\t\tfont-weight: 400;\n\t\t\t\tborder-radius: 6px;\n\t\t\t\tcursor: pointer;\n\t\t\t\tbackground: #f8f8f8;\n\t\t\t\tcolor: #333;\n\t\t\t}\n\t\t\t.tabs-t-selected-ddsds1idddx90{\n\t\t\t color: #315EFB;\n\t\t\t font-weight: 500;\n\t\t\t background: rgba(49, 94, 251, 0.1);\n\t\t\t}\n\t\t\t.tabs-t-small-ddsds1idddx90{\n\t\t\t margin-left: 8px;\n\t\t\t}\n\t\t\t\n\t\t\t.tab-c-links"+elementNum+" a[name='navigation']{\n\t\t\t\tdisplay:inline-block;\n\t\t\t\ttext-align:center;\n\t\t\t\tmargin-right:12px;\n\t\t\t\tmargin-top:5px;\n\t\t\t\toverflow: hidden;\n\t\t\t\twhite-space: nowrap;\n\t\t\t\ttext-overflow:ellipsis;\n\t\t\t\tbox-sizing:border-box;\n\t\t\t\tline-height:20px;\n\t\t\t\tfont-size:14px!important;\n\t\t\t\ttext-decoration: none;\n\t\t\t\tcolor:#1a0dab;\n\t\t\t}\n\t\t\t.tab-c-links"+elementNum+" a[name='navigation']:hover{\n\t\t\t\ttext-decoration: underline;\n\t\t\t}\n\t\t\t\n\t\t\t.bookmarks"+elementNum+"{\n\t\t\t\tmin-height:50px;\n\t\t\t}\n\t\t";0==$("#plugin_css_style_dddsoo").length&&$("body").prepend("")},this.showSetingDialog=function(){const self=this;var customNavigationData="";const customNavigation=commonFunctionObject.GMgetValue(self.customNavigationkey,null);customNavigation&&(customNavigationData=JSON.stringify(customNavigation,null,4));const content="\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t注意事项如下:\n\t\t\t\t\t
1、请严格按照格式添加,否则不生效\n\t\t\t\t\t
2、数据为json格式,请确保json格式正确,必要时请到https://www.json.cn/校验\n\t\t\t\t\t
3、点击下面”示例“按钮,查看具体格式情况\n\t\t\t\t\t
4、链接中的搜索关键词请用”@@“代替,脚本会自动替换成当前搜索词。例如:https://www.baidu.com/s?wd=@@\n\t\t\t\t\t
5、大家可以自定义导航数据,但是必须要注意数据格式,发现出现错误,可点“初始化”\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t";dialog.showMake({title:"自定义添加导航",content:content,onClose:function(){location.reload()},onContentReady:function($that){var $navigationExample=$that.dialogContent.querySelector(".navigation-example"),$navigationClear=$that.dialogContent.querySelector(".navigation-clear"),$navigationSave=$that.dialogContent.querySelector(".navigation-save"),$navigationInit=$that.dialogContent.querySelector(".navigation-init"),$textarea=$that.dialogContent.querySelector(".navigation-textarea");$navigationExample.addEventListener("click",(function(){$textarea.value=JSON.stringify(self.defaultNavigationData,null,4)})),$navigationClear.addEventListener("click",(function(){$textarea.value=""})),$navigationInit.addEventListener("click",(function(){$textarea.value="",commonFunctionObject.GMsetValue(self.customNavigationkey,null)})),$navigationSave.addEventListener("click",(function(){var content=$textarea.value;if(!content)return commonFunctionObject.GMsetValue(self.customNavigationkey,null),void commonFunctionObject.webToast({message:"保存成功:数据为空",background:"#FF4D40"});if(0!=content.length&&-1!=content.indexOf("{")&&-1!=content.indexOf("["))try{var contentJson=JSON.parse(content);if(Array.isArray(contentJson)){for(//开始必须是数组 +var isOK=!0,i=0;i'+navigationData[i].name+'':''+navigationData[i].name+'',nameArray.push(name);var links="";links=0==i?'
':'",linkArray.push(links)}var html="\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
"+nameArray.join("")+"
\n\t\t\t\t\t\t\t\t
"+linkArray.join("")+"
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t*该数据由油猴脚本提供\n\t\t\t\t\t\t\t\t  \n\t\t\t\t\t\t\t\t🔧自定义网址\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t"; +// //添加css 添加html +self.createCss(elementNum),$element.prepend(html), +//点击切换tab +$("#dsdsd99mmmjj7760011 .tabs-t"+elementNum).on("click",(function(e){$("div[id^='tab-list-xxsddddssd-']").hide(),$(".tabs-t"+elementNum).removeClass("tabs-t-selected-ddsds1idddx90"),$("#"+$(this).attr("name")).show(),$(this).addClass("tabs-t-selected-ddsds1idddx90")})), +//点击链接 +$("#dsdsd99mmmjj7760011 a[name='navigation']").on("click",(function(e){commonFunctionObject.GMopenInTab($(this).data("url").replace("@@",$(elementInput).val())),e.preventDefault()})), +//弹出自定义导航弹窗 +$("#dsdsd99mmmjj7760011 a[name='customNavigation']").on("click",(function(e){self.showSetingDialog(),e.preventDefault()}))}isComplate=!0}}),100)},this.hookBaidu=function(){let items=document.querySelectorAll("#content_left>div");for(let item of items){ +//给处理完成的做一个标识 +if(item.getAttribute("baidu_dealxx"))continue;item.setAttribute("baidu_dealxx","--");let a=item.querySelector("a");if(!a||!a.href)continue; +//标注了html网址的忽略 +let OP_LOG_LINK=item.querySelector(".OP_LOG_LINK");if(OP_LOG_LINK&&-1!=OP_LOG_LINK.innerText.search("http"))continue; +//有多个点击点的忽略 +if(item.querySelector(".c-gap-bottom-small"))continue; +//https://www.baidu.com/s?wd=一夜醒来欠地铁600多万?官方回应 +if(a.href.includes("www.baidu.com/link?url=")){let url=item.getAttribute("mu");url&&-1!=url.indexOf("http")&&!url.includes("nourl.ubs.baidu.com")&&(a.href=url,item.innerHTML+="
\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t"+url+"\n\t\t\t\t\t\t\t\t\t
")}let itemNews=item.querySelectorAll("[class^=single-card-wrapper] div,[class^=group-wrapper] div");if(itemNews) +//single-card-wrapper: https://www.baidu.com/s?ie=UTF-8&wd=es6 xxx的最新相关信息 +//group-wrapper: https://www.baidu.com/s?ie=UTF-8&wd=五一消费成绩单折射市场活力 资讯 +for(let itemNew of itemNews){let dataUrl=null,divs=itemNew.querySelectorAll("div");for(let div of divs)if(dataUrl=div.getAttribute("data-url"),dataUrl){itemNew.querySelector("a").setAttribute("href",dataUrl)}}}},this.hookGoogle=function(){let items=document.querySelectorAll("#center_col a");for(let a of items)a.getAttribute("target")||a.setAttribute("target","_blank")},this.hooks=function(){const host=window.location.host,self=(window.location.href,window.location.search,this);setInterval((function(){"www.baidu.com"===host?self.hookBaidu():"www.google.com"!==host&&"www.google.com.hk"!==host||self.hookGoogle()}),300)},this.show=function(){const self=this,host=window.location.host,href=window.location.href;if("www.baidu.com"===host||"www.so.com"===host&&-1!=href.indexOf("www.so.com/s")||"www.sogou.com"===host&&(-1!=href.indexOf("www.sogou.com/web")||-1!=href.indexOf("www.sogou.com/sogou"))||"cn.bing.com"===host&&-1!=href.indexOf("cn.bing.com/search")||"www.bing.com"===host&&-1!=href.indexOf("www.bing.com/search")||"www4.bing.com"===host&&-1!=href.indexOf("www4.bing.com/search")||"so.toutiao.com"===host&&-1!=href.indexOf("so.toutiao.com/search")||"www.google.com"===host&&-1!=href.indexOf("www.google.com/search")||"www.google.com.hk"===host&&-1!=href.indexOf("www.google.com.hk/search")||"duckduckgo.com"===host&&-1!=href.indexOf("duckduckgo.com")){let currentSearchEnginesData=null;for(var i=0;i已浏览
\n";try{(new function(){this.intervalIsRunComplete=!0,//定时任务一个循环是否完成 +this.histories=commonFunctionObject.GMgetValue("record_browsing_history_mark_key",[]),this.isRun=function(){const visitHref=window.location.href,allows=[/^https:\/\/www\.taobao\.com(\/|\/\?)?/i,//淘宝首页 +/^https:\/\/s\.taobao\.com/i,/^https:\/\/shop(\d+)\.taobao\.com/i,/^https:\/\/www\.tmall\.com(\/|\/\?)?/i,//天猫首页 +/pages\.tmall\.com/i,/list\.tmall\.com/i,/list\.tmall\.hk/i,/tmall\.com\/category/i,/tmall\.com\/search/i,/tmall\.com\/shop/i,/tmall\.com\/\?q=/i,/maiyao\.liangxinyao\.com/i,/^https:\/\/www\.jd\.com(\/|\/\?)?/i,//京东主页 +/search\.jd\.com/i,/search\.jd\.hk/i,/pro\.jd\.com\/mall/i,/jd\.com\/view_search/i,//商店主页 +/category\.vip\.com/i,/list\.vip\.com/i,/^https:\/\/(?!product|dfp\.)([^\/]+)\.suning\.com\//i];let isAllow=!1;for(let i=0;i{commonFunctionObject.crossRequest("GET","https://j.jiayoushichang.com/api/plugin/load/conf",null).then(data=>{"success"==data.result&&data.data?resolve(data.data):resolve(null)})})},this.pickupSearchElements=function(conf,platform){//收集列表的元素 +const selectorElementList=new Array,visitHref=window.location.href;let confFilter=conf;try{confFilter=confFilter.replace(/\\\\/g,"\\")}catch(e){}const confJson=JSON.parse(confFilter);if(confJson.hasOwnProperty(platform)){const platformConfJson=confJson[platform];for(let i=0;inew RegExp(reg,"i").test(visitHref)).some(res=>res))for(let j=0;j{this.intervalIsRunComplete=!0})},this.processLinksInBatches=async function(items,batchSize){const results=[];for(let i=0;ithis.createOneElementHtml(item)));// 获取当前批次的链接 +results.push(...batchResults)}return results;// 返回所有结果 +}, +/** + * 为商品box添加有券提醒 + */ +this.createOneElementHtml=function(item){//查询到每个商品list +const{element:element,page:page,findA:findA}=item,self=this;return new Promise((function(resolve,reject){if(element.attr("honghaoerbox"))return void resolve(-1e4);element.attr("honghaoerbox","true"),element.css("position","relative"),element.on("click",(function(){$(this).append(browsedHtml)}));var goodsDetailUrl=null;if("this"===findA)goodsDetailUrl=element.attr("href");else if(/^child@/.test(findA)){const elementA=element.find(findA.replace(/^child@/,""));elementA&&(goodsDetailUrl=elementA.attr("href"))}if(!goodsDetailUrl)return void resolve(-2e4);var analysisData=null;if(-1!=page.indexOf("jd_")){var jdId=commonFunctionObject.getEndHtmlIdByUrl(goodsDetailUrl);jdId&&(analysisData={id:jdId,platform:"jd"})}else if(-1!=page.indexOf("vpinhui_")){var vipId=commonFunctionObject.getEndHtmlIdByUrl(goodsDetailUrl).replace("detail-","");vipId&&(analysisData={id:vipId.split("-")[1],platform:"vpinhui"})}else if(-1!=page.indexOf("suning_")){var suningId=commonFunctionObject.suningParameter(goodsDetailUrl);suningId&&(analysisData={id:suningId,platform:"suning"})}else{var platform=commonFunctionObject.getEcommercePlatform(goodsDetailUrl),id=commonFunctionObject.getParamterQueryUrl(goodsDetailUrl,"id");platform&&id&&(analysisData={id:id,platform:platform})}if(!analysisData)return void resolve(-3e4);const mark=analysisData.platform+"_"+analysisData.id;self.histories.includes(mark)&&element.append(browsedHtml);const searchUrl="https://j.jiayoushichang.com/api/ebusiness/coupon/exist/"+analysisData.platform+"?id="+analysisData.id;commonFunctionObject.crossRequest("GET",searchUrl,null).then(data=>{if("success"==data.result&&data.data){const{id:id,tip:tip,encryptLink:encryptLink}=JSON.parse(data.data);if(tip&& +//console.log("coupon exist", id); +element.append(tip),encryptLink){ +// console.log("jood job!", id); +let decryptUrl=null;try{decryptUrl=atob(encryptLink).split('').reverse().join('')}catch(e){}decryptUrl&&self.relativeJu(page,element,decryptUrl)}}resolve(1e4)}).catch(()=>{resolve(-4e4)})}))},this.relativeJu=function(page,element,decryptUrl){try{-1!=page.indexOf("jd_")?element.find("a").each((function(){-1!=$(this).attr("href").indexOf("item.jd.com")&&($(this).removeAttr("onclick"),$(this).unbind("click").bind("click",(function(e){e.preventDefault(),e.stopPropagation(),commonFunctionObject.GMopenInTab(decryptUrl)})))})):-1!=page.indexOf("taobao_")||-1!=page.indexOf("tmall_")?element.unbind("click").bind("click",(function(e){const target=$(e.target);let isPreventDefault=!1;if("A"===target.prop("tagName").toUpperCase()){//只有点击A标签才去判断 +const href=target.attr("href");[/detail\.tmall\.com/,/item\.taobao\.com/].map(reg=>reg.test(href)).some(result=>result)&&(isPreventDefault=!0)}else isPreventDefault=!0;isPreventDefault&&(e.preventDefault(),e.stopPropagation(),commonFunctionObject.GMopenInTab(decryptUrl))})):-1!=page.indexOf("vpinhui_")?element.find("a").each((function(){-1!=$(this).attr("href").indexOf("detail.vip.com/detail-")&&$(this).unbind("click").bind("click",(function(e){e.preventDefault(),e.stopPropagation(),commonFunctionObject.GMopenInTab(decryptUrl)}))})):-1!=page.indexOf("suning_")&&element.find("a").each((function(){-1!=$(this).attr("href").indexOf("product.suning.com")&&$(this).unbind("click").bind("click",(function(e){e.preventDefault(),e.stopPropagation(),commonFunctionObject.GMopenInTab(decryptUrl)}))}))}catch(e){console.log(e)}},this.searchPage=function(selectorElementList){const items=[];selectorElementList.forEach(elementData=>{elementData.element&&$(elementData.element+":not([honghaoerbox='true'])").each((function(){items.push({element:$(this),findA:elementData.findA,page:elementData.page})}))}),items.length>0&&this.createAllElementHtml(items)},this.start=function(){if(this.isRun()){const platform=commonFunctionObject.getEcommercePlatform();this.requestConf().then(conf=>{const selectorElementList=this.pickupSearchElements(conf,"tmall"==platform?"taobao":platform);this.intervalIsRunComplete&&this.searchPage(selectorElementList),setInterval(()=>{this.intervalIsRunComplete&&this.searchPage(selectorElementList)},1500)})}}}).start(),(new function(){this.platforms=["detail.tmall.com","item.taobao.com","item.jd.com","item.yiyaojd.com","npcitem.jd.hk","detail.tmall.hk","detail.vip.com","item.jkcsjd.com","product.suning.com"],this.createQrcodeIsResult=!0,this.isRun=function(){for(var i=0;i{this.randomSpmValue()},2e3))},this.browsingHistoryMark=function(platform,goodsId){let histories=commonFunctionObject.GMgetValue("record_browsing_history_mark_key",[]),saveContent=platform+"_"+goodsId;histories.includes(saveContent)||(histories.unshift(saveContent),commonFunctionObject.GMsetValue("record_browsing_history_mark_key",histories.slice(0,60)))},this.createHtml=async function(platform,goodsId,goodsName){if(!platform||!goodsId)return"kong";this.browsingHistoryMark(platform,goodsId);//把浏览记录给存在本地 +let addition="";if("vpinhui"==platform){const vip=goodsId.split("-");addition=vip[0],goodsId=vip[1]}const goodsCouponUrl="https://j.jiayoushichang.com/api/ebusiness/find?n=7&v=1.0.2&p="+platform+"&i="+goodsId+"&q="+goodsName+"&addition="+addition;try{const data=await commonFunctionObject.crossRequest("GET",goodsCouponUrl,null);if("success"==data.result&&data.data){const json=JSON.parse(data.data);await this.createCoupon(platform,json.data),await this.createQrcode(platform,json.mscan); +//开启插入检测 +let heartms=0;const HEART_DELAY=1500,MAX_MS=3e4,createResultInterval=setInterval(async()=>{this.createQrcodeIsResult&&(document.querySelector("*[name='exist-llkbccxs-9246-hi']")||heartms>=MAX_MS?clearInterval(createResultInterval):await this.createCoupon(platform,json.data)),heartms+=HEART_DELAY},HEART_DELAY)}}catch(e){console.log("createCouponHtml:",e)}},this.getHandlerElement=async function(handler){const element=await(async handler=>{const promiseArray=[],handlers=handler.split("@");for(let i=0;i{resolve(document.body)})):"html"==eleName?promiseArray.push(new Promise((resolve,reject)=>{resolve(document.html)})):promiseArray.push(commonFunctionObject.getElementObject(eleName,document.body,!0,10,1500)))}const element=await Promise.race(promiseArray);return element||null})(handler);return new Promise((resolve,reject)=>{resolve(element)})},this.createCoupon=async function(platform,result){try{if(this.createQrcodeIsResult=!1,!(result&&"null"!==result&&result.hasOwnProperty("css")&&result.hasOwnProperty("html")&&result.hasOwnProperty("handler")))return;const cssText=result.css,htmlText=result.html,handler=result.handler,templateId=result.templateId;if(!cssText||!htmlText||!handler)return;GM_addStyle(cssText); +// 添加HTML, 需要动态检测元素 +const handlerElement=await this.getHandlerElement(handler);if(handlerElement){const $handlerElement=$(handlerElement);"taobao"==platform||"tmall"==platform?$handlerElement.parent().after(htmlText):("jd"==platform||"vpinhui"==platform||"suning"==platform)&&$handlerElement.after(htmlText)}const $template=$("#"+templateId);if(0==$template.length)return;const couponId=$template.data("id"),goodsPrivateUrl="https://j.jiayoushichang.com/api/private/change/coupon?script=7&platform="+platform+"&id=";if(!/\d/.test(couponId))return;setInterval(()=>{$template.find("*").each((function(){$(this).removeAttr("data-spm-anchor-id")}))},400);if($template.find("a[name='cpShUrl']").unbind("click").bind("click",()=>{event.stopPropagation(),event.preventDefault(),commonFunctionObject.crossRequest("GET",goodsPrivateUrl+couponId,null).then(privateResultData=>{if("success"===privateResultData.result&&privateResultData.data){let url=JSON.parse(privateResultData.data).url;url&&GM_openInTab(url,{active:!0})}})}),0==$("#ca"+templateId).length)return;const qrcodeResultData=await commonFunctionObject.crossRequest("GET",goodsPrivateUrl+couponId,null);if(qrcodeResultData&&"success"===qrcodeResultData.result&&qrcodeResultData.data){let img=JSON.parse(qrcodeResultData.data).img;if(img){var cxt=document.getElementById("ca"+templateId).getContext("2d"),imgData=new Image;imgData.src=img,imgData.onload=function(){cxt.drawImage(imgData,0,0,imgData.width,imgData.height)}}}}catch(e){console.log("~~~~~~~~~~~~~~~~~",e)}finally{this.createQrcodeIsResult=!0}},this.createQrcode=async function(platform,mscan){if(!(mscan&&"null"!==mscan&&mscan.hasOwnProperty("mount")&&mscan.hasOwnProperty("html")&&mscan.hasOwnProperty("qrcode")))return;const{mount:mount,html:html,qrcode:qrcode,iden:iden}=mscan;if(mount&&html&&qrcode&&iden){$(mount).append(html);var canvasElement=document.getElementById("mscan"+iden),width=canvasElement.getAttribute("width"),height=canvasElement.getAttribute("height"),cxt=canvasElement.getContext("2d"),imgData=new Image;imgData.src=qrcode,imgData.onload=function(){cxt.drawImage(imgData,0,0,width,height)}}},this.start=async function(){if(this.isRun()){this.runAliDeceptionSpm();const platform=commonFunctionObject.getEcommercePlatform();if(!platform)return; +//如果sku太多就折叠,不然移动端体验太差了 +if("tmall"==platform||"taobao"==platform)commonFunctionObject.getElementObject("div[class^='skuWrapper--']",document.body,!1,10,1500).then(skuItemWrapper=>{if(null!=skuItemWrapper){const{style:style}=skuItemWrapper;style.maxHeight="400px",style.overflow="auto"}}).catch(()=>{});else if("jd"==platform){const skuItemWrapper=document.querySelector("#choose-attrs");if(skuItemWrapper){const{style:style}=skuItemWrapper;style.maxHeight="400px",style.overflow="auto"}}const goodsData=await this.getGoodsData(platform);this.createHtml(platform,goodsData.goodsId,goodsData.goodsName)}}}).start(),/taobao|jd|tmall|jkcsjd|vip|vipglobal|yiyaojd|liangxinyao|suning/.test(window.location.host)&&GM_registerMenuCommand("清除商品浏览记录",()=>{confirm('此弹窗来自脚本-[🔥]!!网购小助手,不花冤枉钱\n是否要移除所有的浏览记录?移除后将不可恢复...')&&commonFunctionObject.GMsetValue("record_browsing_history_mark_key",[])})}catch(e){console.log("优惠券查询:error:"+e)} +/** + * 代码借鉴子:https://greasyfork.org/en/scripts/501542-twitter-x-%E1%B4%BE%CB%A1%E1%B5%98%CB%A2-youtube%E1%B4%BE%CB%A1%E1%B5%98%CB%A2 + * 原脚本开源协议为:MIT + * 本脚本在原脚本基础上优惠了部分逻辑,特此声明! + */try{functionController&&!functionController.abroadVideoHelper||(new function(){this.extractHref=function(html){const regex=/]*?\s+)?href=(['"])(.*?)\1/gi,hrefs=[];let match;for(;null!==(match=regex.exec(html));)hrefs.push(match[2]);return hrefs.filter(href=>-1!=href.indexOf("snapcdn.app"))},this.download=async function(url,element){commonFunctionObject.webToast({message:"正在下载中...",background:"#000"}),element.classList.add("download-loadding");const data=await commonFunctionObject.request("POST","https://tikdownloader.io/api/ajaxSearch","q="+url+"&lang=en",{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"});if("success"===data.result){const result=JSON.parse(data.data);if("ok"==result.status&&result.hasOwnProperty("data")){const data=result.data,downloadUrls=this.extractHref(data);downloadUrls.length>=2&&commonFunctionObject.GMopenInTab(downloadUrls.at(-2))}}element.classList.remove("download-loadding")},this.start=async function(){/www\.tiktok\.com/.test(window.location.host)&&(commonFunctionObject.GMaddStyle("\n\t\t\t@keyframes scriptspin {0% {transform: rotate(0deg);} 100% {transform: rotate(360deg);}}\n\t\t\t.download-loadding{\n\t\t\t\tanimation: scriptspin 1s linear infinite;\n\t\t\t}\n\t\t"),setInterval(()=>{if(!document.querySelector("#tiktok-download-990i")){const container=document.querySelector('#main-content-video_detail')||document.body;if(!container)return;const divs=container.querySelectorAll("div"),regex=/-DivRightControlsWrapper|-DivMiniPlayerContainer/,matchedDiv=Array.from(divs).find(div=>div.classList.value.split(' ').some(className=>regex.test(className)));if(matchedDiv){let cloneNode=null,isDetail=1!=matchedDiv.children.length;cloneNode=isDetail?matchedDiv.children[0].cloneNode(!0):matchedDiv.cloneNode(!0),cloneNode.id="tiktok-download-990i",cloneNode.querySelector("div").innerHTML="",isDetail?matchedDiv.insertBefore(cloneNode,matchedDiv.children[0]):(cloneNode.style.right="166px",matchedDiv.parentNode.insertBefore(cloneNode,matchedDiv)),cloneNode.title="点击下载视频(高清无水印)",cloneNode.addEventListener("click",()=>{this.download(window.location.href,cloneNode)})}}},2e3))}}).start()}catch(e){console.log("国外视频解析:error:"+e)}try{functionController&&!functionController.shortVideoDownload||(new function(){this.douyinVideoDownloader=function(){setInterval((function(){!function(){if("www.douyin.com"!==window.location.host)return;let downloadOption=[{name:'',id:'toServer'},{name:'打开视频(可下载)',id:'toLink'}],videoElements=document.querySelectorAll('video');if(0==videoElements.length)return; +//把自动播放的video标签选择出来 +let playVideoElements=[];videoElements.forEach((function(element){null!==element.getAttribute('autoplay')&&playVideoElements.push(element)}));let videoContainer=-1!=location.href.indexOf('modal_id')?playVideoElements[0]:playVideoElements[playVideoElements.length-1];if(!videoContainer)return; +//获取视频播放地址 +let videoId,url=videoContainer&&videoContainer.children.length>0&&videoContainer.children[0].src?videoContainer.children[0].src:videoContainer.src,resp=url.match(/^(https:)?\/\/.+\.com\/([a-zA-Z0-9]+)\/[a-zA-Z0-9]+\/video/),res=url.match(/blob:https:\/\/www.douyin.com\/(.*)/); +//获取视频ID,配合自定义id使用 +videoId=resp&&resp[2]?resp[2]:res&&res[1]?res[1]:videoContainer.getAttribute('data-xgplayerid');let playContainer=videoContainer.parentNode.parentNode.querySelector('.xg-right-grid');if(playContainer)if(playContainer.querySelector('#scriptVideoDownload'+videoId)){playContainer.querySelectorAll('.xgplayer-playclarity-setting').forEach((function(d){let btn=d.querySelector('.btn');d.id!='scriptVideoDownload'+videoId&&'下载'==btn.innerText&&d.parentNode.removeChild(d)}))}else if(videoContainer&&playContainer){let playClarityDom=playContainer.querySelector('.xgplayer-playclarity-setting');if(!playClarityDom)return;if(!playClarityDom.querySelector('.btn'))return;let downloadDom=playClarityDom.cloneNode(!0);downloadDom.setAttribute('id','scriptVideoDownload'+videoId),-1==location.href.indexOf('search')?downloadDom.style='margin-top:-68px;padding-top:100px;padding-left:20px;padding-right:20px;':downloadDom.style='margin-top:0px;padding-top:100px;';let downloadText=downloadDom.querySelector('.btn');downloadText.innerText='下载',downloadText.style='font-size:14px;font-weight:600;',downloadText.setAttribute('id','zhmDouyinDownload'+videoId);let detail=playContainer.querySelector('xg-icon:nth-of-type(1)').children[0],linkUrl=detail.getAttribute('href')?detail.getAttribute('href'):location.href;-1==linkUrl.indexOf('www.douyin.com')&&(linkUrl='//www.douyin.com'+linkUrl),downloadText.setAttribute('data-url',linkUrl),downloadText.removeAttribute('target'),downloadText.setAttribute('href','javascript:void(0);');let virtualDom=downloadDom.querySelector('.virtual');downloadDom.onmouseover=function(){-1==location.href.indexOf('search')?virtualDom.style='display:block !important':virtualDom.style='display:block !important;margin-bottom:37px;'},downloadDom.onmouseout=function(){virtualDom.style='display:none !important'};let downloadHtml='';downloadOption.forEach((function(item){"toServer"==item.id?downloadHtml+=`
AI视频分析(热门)
`:downloadHtml+=`
${item.name}
`})),downloadDom.querySelector('.virtual')&&(downloadDom.querySelector('.virtual').innerHTML=downloadHtml),playClarityDom.after(downloadDom); +//直接打开 +let toLinkDom=playContainer.querySelector('#toLink'+videoId);toLinkDom&&toLinkDom.addEventListener('click',(function(){url.match(/^blob/)?commonFunctionObject.webToast({message:"加密视频无法直接打开。可复制分享链,重新打开页面使用“下载”",background:"#141414"}):window.open(url)}));let toAi=playContainer.querySelector('#toServer'+videoId);toAi&&toAi.addEventListener('click',(function(){window.open("https://www.quzhuanpan.com/redirect/d?t="+(new Date).getTime()+"&url="+window.location.href)}))} +//在对主页就行视频浏览时会出现多个按钮,删除不需要的,只保留当前对应的 +} +//抖音视频下载需要鼠标右键保存 +()}),500),function(){if(-1!=window.location.host.indexOf(".douyinvod.com")){var html="
\n\t\t\t\t\t
直接下载已经失效,需要在视频框点击:鼠标右键 ->视频另存为,然后保存视频
\n\t\t\t\t\t
# 纯纯的资源分享,需要的自取:点我查看【建议保存】
\n\t\t\t\t\t
# 效率工具,免费AI总结/摘要/改写/翻译,支持搜索学术文献一键阅读:点我查看
\n\t\t\t\t
";$("body").append(html)}}()},this.kuaishouVideoDownloader=function(){"www.kuaishou.com"===window.location.host&&window.addEventListener('load',(function(){async function downloader(){if(!document.querySelector("#kuaishou-video-downloder")){let downloadDIV=document.createElement("div");downloadDIV.style="cursor:pointer;width:50px;height:40px;line-height:40px;text-align:center;background-color:#FFF;color:#000;position:fixed;top:200px;left:0px;z-index:999;",downloadDIV.innerText="下载",downloadDIV.setAttribute('id','kuaishou-video-downloder'),document.body.appendChild(downloadDIV),downloadDIV.addEventListener("click",(function(e){let videoDom=document.querySelector('.player-video');if(!videoDom)return void console.log('没有找到DOM');let videoSrc=videoDom.getAttribute('src');videoSrc.match(/^blob/)?console.log('blob视频无法下载'):commonFunctionObject.GMopenInTab(videoSrc)}))}}document.querySelectorAll(".switch-item").forEach((function(value){value.addEventListener("click",(function(){downloader()}))})),downloader(),setInterval((function(){let kuaishouVideoDownloder=document.querySelector("#kuaishou-video-downloder");kuaishouVideoDownloder&&(window.location.href.match(/https:\/\/www\.kuaishou\.com\/short-video\/.*?/)?kuaishouVideoDownloder.style.display="block":kuaishouVideoDownloder.style.display="none")}),800)}))},this.start=function(){this.douyinVideoDownloader(),this.kuaishouVideoDownloader()}}).start()}catch(e){console.log("短视频去水印下载:error:"+e)}}(); \ No newline at end of file