/*********************************** > 应用名称:多多视频 > 软件版本:1.1 > 脚本作者:Cuttlefish > 微信账号:墨鱼手记 > 解锁说明:去除悬浮广告,视频开头广告,首页广告,限时广告以及底部广场Tab > 更新时间:2022-12-11 > 通知频道:https://t.me/ddgksf2021 > 贡献投稿:https://t.me/ddgksf2013_bot > 问题反馈:ddgksf2013@163.com > 特别提醒:如需转载请注明出处,谢谢合作! > 特别说明:⚠️⚠️⚠️ 本脚本仅供学习交流使用,禁止转载售卖 ⚠️⚠️⚠️ [rewrite_local] # > 多多视频_悬浮广告@ddgksf2013 ^https:\/\/api.juxingclub.com\/ad\/getAll url script-response-body https://github.com/ddgksf2013/Scripts/raw/master/rrtv_json.js # > 多多视频_我的页面@ddgksf2013 ^https?:\/\/api.juxingclub.com\/v3plus\/index\/channel\?pageNum=1&position=CHANNEL_MY url script-response-body https://github.com/ddgksf2013/Scripts/raw/master/rrtv_json.js # > 多多视频_限时广告@ddgksf2013 https://api.juxingclub.com/storage/business/rootName/app/homePage\?dataType=JSON url reject-dict # > 多多视频_首页广告@ddgksf2013 https://api.juxingclub.com/v3plus/index/channel\?pageNum=1&position=CHANNEL_INDEX url script-response-body https://github.com/ddgksf2013/Scripts/raw/master/rrtv_json.js # > 多多视频_去除广场@ddgksf2013 ^https?:\/\/api.juxingclub.com\/app\/config\/h5NativeBar url script-response-body https://github.com/ddgksf2013/Scripts/raw/master/rrtv_json.js [mitm] hostname=api.juxingclub.com ***********************************/ const scriptName = "RRTV"; const magicJS = new MagicJS(scriptName, "INFO"); const rrtv_tab_home = /.*\/v3plus\/index\/channel\?pageNum=1&position=CHANNEL_INDEX/; const rrtv_tab_my = /.*\/v3plus\/index\/channel\?pageNum=1&position=CHANNEL_MY/; const rrtv_tab_cfg = /.*\/app\/config\/h5NativeBar/; const rrtv_drama_detail = /.*\/drama\/detail\?/; const rrtv_user_info = /.*\/user\/personal/; const rrtv_level = /.*\/level\/info/; const rrtv_ad_getall = /.*\/ad\/getAll/; const rrtv_watch_v4 = /.*\/watch\/v4/; (() => { let body = null; if (magicJS.isResponse) { switch (true) { //首页去广告 case rrtv_tab_home.test(magicJS.request.url): try { let obj = JSON.parse(magicJS.response.body); //delete obj.data.bannerTop; for(i = 0;i>2,r=(3&t)<<4|(s=e.charCodeAt(h++))>>4,n=(15&s)<<2|(o=e.charCodeAt(h++))>>6,a=63&o,isNaN(s)?n=a=64:isNaN(o)&&(a=64),c=c+_keyStr.charAt(i)+_keyStr.charAt(r)+_keyStr.charAt(n)+_keyStr.charAt(a);return c},this.decode=function(e){var t,s,o,i,r,n,a="",c=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");c>4,s=(15&i)<<4|(r=_keyStr.indexOf(e.charAt(c++)))>>2,o=(3&r)<<6|(n=_keyStr.indexOf(e.charAt(c++))),a+=String.fromCharCode(t),64!=r&&(a+=String.fromCharCode(s)),64!=n&&(a+=String.fromCharCode(o));return a=_utf8_decode(a)},_utf8_encode=function(e){e=e.replace(/\r\n/g,"\n");for(var t="",s=0;s127&&o<2048?(t+=String.fromCharCode(o>>6|192),t+=String.fromCharCode(63&o|128)):(t+=String.fromCharCode(o>>12|224),t+=String.fromCharCode(o>>6&63|128),t+=String.fromCharCode(63&o|128))}return t},_utf8_decode=function(e){for(var t="",s=0,o=c1=c2=0;s191&&o<224?(c2=e.charCodeAt(s+1),t+=String.fromCharCode((31&o)<<6|63&c2),s+=2):(c2=e.charCodeAt(s+1),c3=e.charCodeAt(s+2),t+=String.fromCharCode((15&o)<<12|(63&c2)<<6|63&c3),s+=3);return t}}return new class{constructor(){if(this.version="2.2.3.1",this.scriptName=e,this.logLevels={DEBUG:5,INFO:4,NOTIFY:3,WARNING:2,ERROR:1,CRITICAL:0,NONE:-1},this.isLoon="undefined"!=typeof $loon,this.isQuanX="undefined"!=typeof $task,this.isJSBox="undefined"!=typeof $drive,this.isNode="undefined"!=typeof module&&!this.isJSBox,this.isSurge="undefined"!=typeof $httpClient&&!this.isLoon,this.node={request:void 0,fs:void 0,data:{}},this.iOSUserAgent="Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.5 Mobile/15E148 Safari/604.1",this.pcUserAgent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36 Edg/84.0.522.59",this.logLevel=t,this._barkUrl="",this.b64codecs=new s,this.isNode){this.node.fs=require("fs"),this.node.request=require("request");try{this.node.fs.accessSync("./magic.json",this.node.fs.constants.R_OK|this.node.fs.constants.W_OK)}catch(e){this.node.fs.writeFileSync("./magic.json","{}",{encoding:"utf8"})}this.node.data=require("./magic.json")}else this.isJSBox&&($file.exists("drive://MagicJS")||$file.mkdir("drive://MagicJS"),$file.exists("drive://MagicJS/magic.json")||$file.write({data:$data({string:"{}"}),path:"drive://MagicJS/magic.json"}))}set barkUrl(e){this._barkUrl=e.replace(/\/+$/g,"")}set logLevel(e){this._logLevel="string"==typeof e?e.toUpperCase():"DEBUG"}get logLevel(){return this._logLevel}get isRequest(){return"undefined"!=typeof $request&&"undefined"==typeof $response}get isResponse(){return"undefined"!=typeof $response}get request(){return"undefined"!=typeof $request?$request:void 0}get response(){return"undefined"!=typeof $response?($response.hasOwnProperty("status")&&($response.statusCode=$response.status),$response.hasOwnProperty("statusCode")&&($response.status=$response.statusCode),$response):void 0}get platform(){return this.isSurge?"Surge":this.isQuanX?"Quantumult X":this.isLoon?"Loon":this.isJSBox?"JSBox":this.isNode?"Node.js":"unknown"}read(e,t=""){let s="";this.isSurge||this.isLoon?s=$persistentStore.read(e):this.isQuanX?s=$prefs.valueForKey(e):this.isNode?s=this.node.data:this.isJSBox&&(s=$file.read("drive://MagicJS/magic.json").string);try{this.isNode&&(s=s[e]),this.isJSBox&&(s=JSON.parse(s)[e]),t&&("string"==typeof s&&(s=JSON.parse(s)),s=s&&"object"==typeof s?s[t]:null)}catch(o){this.logError(o),s=t?{}:null,this.del(e)}void 0===s&&(s=null);try{s&&"string"==typeof s&&(s=JSON.parse(s))}catch(e){}return this.logDebug(`READ DATA [${e}]${t?`[${t}]`:""}(${typeof s})\n${JSON.stringify(s)}`),s}write(e,t,s=""){let o=s?{}:"";if(s&&(this.isSurge||this.isLoon)?o=$persistentStore.read(e):s&&this.isQuanX?o=$prefs.valueForKey(e):this.isNode?o=this.node.data:this.isJSBox&&(o=JSON.parse($file.read("drive://MagicJS/magic.json").string)),s){try{"string"==typeof o&&(o=JSON.parse(o)),o="object"==typeof o&&o?o:{}}catch(t){this.logError(t),this.del(e),o={}}this.isJSBox||this.isNode?(o.hasOwnProperty(e)&&"object"==typeof o[e]||(o[e]={}),o[e].hasOwnProperty(s)||(o[e][s]=null),void 0===t?delete o[e][s]:o[e][s]=t):void 0===t?delete o[s]:o[s]=t}else this.isNode||this.isJSBox?void 0===t?delete o[e]:o[e]=t:o=void 0===t?null:t;"object"==typeof o&&(o=JSON.stringify(o)),this.isSurge||this.isLoon?$persistentStore.write(o,e):this.isQuanX?$prefs.setValueForKey(o,e):this.isNode?this.node.fs.writeFileSync("./magic.json",o):this.isJSBox&&$file.write({data:$data({string:o}),path:"drive://MagicJS/magic.json"}),this.logDebug(`WRITE DATA [${e}]${s?`[${s}]`:""}(${typeof t})\n${JSON.stringify(t)}`)}del(e,t=""){this.logDebug(`DELETE KEY [${e}]${t?`[${t}]`:""}`),this.write(e,null,t)}notify(e=this.scriptName,t="",s="",o=""){this.logNotify(`title:${e}\nsubTitle:${t}\nbody:${s}\noptions:${"object"==typeof o?JSON.stringify(o):o}`);if(o=(e=>{let t={};return"string"==typeof e?this.isLoon?t={openUrl:e}:this.isQuanX&&(t={"open-url":e}):"object"==typeof e&&(this.isLoon?(t.openUrl=e["open-url"]?e["open-url"]:"",t.mediaUrl=e["media-url"]?e["media-url"]:""):this.isQuanX&&(t=e["open-url"]||e["media-url"]?e:{})),t})(o),1==arguments.length&&(e=this.scriptName,t="",s=arguments[0]),this.isSurge)$notification.post(e,t,s);else if(this.isLoon)o?$notification.post(e,t,s,o):$notification.post(e,t,s);else if(this.isQuanX)$notify(e,t,s,o);else if(this.isNode){if(this._barkUrl){let o=encodeURI(`${e}/${t}\n${s}`);this.get(`${this._barkUrl}/${o}`,()=>{})}}else if(this.isJSBox){let o={title:e,body:t?`${t}\n${s}`:s};$push.schedule(o)}}log(e,t="INFO"){this.logLevels[this._logLevel]void 0===s.body?"":`${encodeURIComponent(e)}=${encodeURIComponent(s.body[e])}`).join("&");s.url.indexOf("?")<0&&(s.url+="?"),s.url.lastIndexOf("&")+1!=s.url.length&&s.url.lastIndexOf("?")+1!=s.url.length&&(s.url+="&"),s.url+=e,delete s.body}return this.isQuanX?(s.hasOwnProperty("body")&&"string"!=typeof s.body&&(s.body=JSON.stringify(s.body)),s.method=t):this.isNode?(delete s.headers["Accept-Encoding"],"object"==typeof s.body&&("GET"===t?(s.qs=s.body,delete s.body):"POST"===t&&(s.json=!0,s.body=s.body))):this.isJSBox&&(s.header=s.headers,delete s.headers),s}get(e,t){let s=this.adapterHttpOptions(e,"GET");if(this.logDebug(`HTTP GET: ${JSON.stringify(s)}`),this.isSurge||this.isLoon)$httpClient.get(s,t);else if(this.isQuanX)$task.fetch(s).then(e=>{e.status=e.statusCode,t(null,e,e.body)},e=>t(e.error,null,null));else{if(this.isNode)return this.node.request.get(s,t);this.isJSBox&&(s.handler=(e=>{let s=e.error?JSON.stringify(e.error):void 0,o="object"==typeof e.data?JSON.stringify(e.data):e.data;t(s,e.response,o)}),$http.get(s))}}post(e,t){let s=this.adapterHttpOptions(e,"POST");if(this.logDebug(`HTTP POST: ${JSON.stringify(s)}`),this.isSurge||this.isLoon)$httpClient.post(s,t);else if(this.isQuanX)$task.fetch(s).then(e=>{e.status=e.statusCode,t(null,e,e.body)},e=>{t(e.error,null,null)});else{if(this.isNode)return this.node.request.post(s,t);this.isJSBox&&(s.handler=(e=>{let s=e.error?JSON.stringify(e.error):void 0,o="object"==typeof e.data?JSON.stringify(e.data):e.data;t(s,e.response,o)}),$http.post(s))}}done(e={}){"undefined"!=typeof $done&&$done(e)}b64encode(e){return this.b64codecs.encode(e)}b64decode(e){return this.b64codecs.decode(e)}isToday(e){if(null==e)return!1;{let t=new Date;return"string"==typeof e&&(e=new Date(e)),t.getFullYear()==e.getFullYear()&&t.getMonth()==e.getMonth()&&t.getDay()==e.getDay()}}isNumber(e){return"NaN"!==parseFloat(e).toString()}attempt(e,t=null){return e.then(e=>[null,e]).catch(e=>(this.logError(e),[e,t]))}retry(e,t=5,s=0,o=null){return(...i)=>new Promise((r,n)=>{(function i(...a){Promise.resolve().then(()=>e.apply(this,a)).then(e=>{"function"==typeof o?Promise.resolve().then(()=>o(e)).then(()=>{r(e)}).catch(e=>{this.logError(e),t>=1&&s>0?setTimeout(()=>i.apply(this,a),s):t>=1?i.apply(this,a):n(e),t--}):r(e)}).catch(e=>{this.logError(e),t>=1&&s>0?setTimeout(()=>i.apply(this,a),s):t>=1?i.apply(this,a):n(e),t--})}).apply(this,i)})}formatTime(e,t="yyyy-MM-dd hh:mm:ss"){var s={"M+":e.getMonth()+1,"d+":e.getDate(),"h+":e.getHours(),"m+":e.getMinutes(),"s+":e.getSeconds(),"q+":Math.floor((e.getMonth()+3)/3),S:e.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(e.getFullYear()+"").substr(4-RegExp.$1.length)));for(let e in s)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?s[e]:("00"+s[e]).substr((""+s[e]).length)));return t}now(){return this.formatTime(new Date,"yyyy-MM-dd hh:mm:ss")}today(){return this.formatTime(new Date,"yyyy-MM-dd")}sleep(e){return new Promise(t=>setTimeout(t,e))}}(e)} // @formatter:on