2024-07-01 10:19:24 +08:00
|
|
|
|
/*
|
2024-07-06 12:23:46 +08:00
|
|
|
|
活动名称:逛视频任务
|
|
|
|
|
环境变量:jd_video_interval // 自定义运行间隔时长(整数,单位毫秒),默认1000
|
|
|
|
|
jd_video_notify // 是否推送通知(true/false),默认不推送
|
|
|
|
|
jd_video_pinFilter // 账号pin过滤,多个用@进行分割
|
2024-07-12 16:13:49 +08:00
|
|
|
|
jd_video_signapi // 自定义SIGN的API
|
2024-07-06 12:23:46 +08:00
|
|
|
|
|
|
|
|
|
定时随机,一天一次
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
const $ = new Env('逛视频任务')
|
2024-07-12 16:13:49 +08:00
|
|
|
|
const _0x9fae6e=_0x3bc7;(function(_0x58d7c1,_0x29eb34){const _0x58be35=_0x3bc7,_0x4d036d=_0x58d7c1();while(!![]){try{const _0x3d42e0=parseInt(_0x58be35(0x30d,'Jr5U'))/0x1*(-parseInt(_0x58be35(0x26a,'MzPW'))/0x2)+-parseInt(_0x58be35(0x316,'BNV%'))/0x3+parseInt(_0x58be35(0x27a,'[FEf'))/0x4+parseInt(_0x58be35(0x2eb,'pm1M'))/0x5+parseInt(_0x58be35(0x234,'MzPW'))/0x6*(parseInt(_0x58be35(0x2da,'PPU%'))/0x7)+-parseInt(_0x58be35(0x2a4,'hPdS'))/0x8+-parseInt(_0x58be35(0x275,'qI9K'))/0x9*(parseInt(_0x58be35(0x231,'EpYv'))/0xa);if(_0x3d42e0===_0x29eb34)break;else _0x4d036d['push'](_0x4d036d['shift']());}catch(_0x502790){_0x4d036d['push'](_0x4d036d['shift']());}}}(_0x5db6,0x6088f));const jdCookie=require(_0x9fae6e(0x243,'[FEf')),notify=require(_0x9fae6e(0x254,'GUgw')),common=require(_0x9fae6e(0x2c6,'HHBj')),{H5st}=require('./utils/Rebels_H');let taskThreads=process['env'][_0x9fae6e(0x212,'6lMg')]||'1';const runInterval=process[_0x9fae6e(0x2a3,'0hJ$')][_0x9fae6e(0x2aa,'HMSm')]||_0x9fae6e(0x224,'Efqk'),isNotify=(process[_0x9fae6e(0x261,'Jr5U')][_0x9fae6e(0x262,'Jr5U')]||process[_0x9fae6e(0x317,'RbA[')]['jd_video_Notify'])==='true',pinFilter=(process[_0x9fae6e(0x2b4,'rsFp')][_0x9fae6e(0x2df,'gKs!')]||'')['split']('@'),randomApi=process['env'][_0x9fae6e(0x216,'[FEf')]||_0x9fae6e(0x213,'$qaa'),maxThreads=0x1,videotaskbodyvar=[{'type':'20','assignmentId':'27kYktGUgPEPba9Wz82CamK1uG2','scanTaskCodeIndex':'2','activitySource':'1','realClient':_0x9fae6e(0x1fd,'BNV%')},{'type':'20','assignmentId':_0x9fae6e(0x329,'Q@7f'),'scanTaskCodeIndex':'3','activitySource':'1','realClient':'ios'},{'type':'20','assignmentId':'44N6QuyCHyb9n6VVr2EHyHKEkEwm','scanTaskCodeIndex':'0','activitySource':'1','realClient':_0x9fae6e(0x2a5,'qI9K')},{'type':'21','assignmentId':_0x9fae6e(0x21f,'WnPw'),'activitySource':'1','realClient':_0x9fae6e(0x293,'BVCp')}];let cookiesArr=Object[_0x9fae6e(0x2ce,'WnPw')](jdCookie)[_0x9fae6e(0x33d,'RbA[')](_0x2cae25=>jdCookie[_0x2cae25])['filter'](_0x2615c3=>_0x2615c3);!cookiesArr[0x0]&&($[_0x9fae6e(0x20f,'bMne')]($['name'],_0x9fae6e(0x2cc,']dX4')),process[_0x9fae6e(0x343,'FmU8')](0x1));function _0x3bc7(_0x4887fd,_0xbf79fc){const _0x5db613=_0x5db6();return _0x3bc7=function(_0x3bc740,_0x3cdbde){_0x3bc740=_0x3bc740-0x1eb;let _0x3af02a=_0x5db613[_0x3bc740];if(_0x3bc7['zLhhme']===undefined){var _0x19ba48=function(_0x2615c3){const _0x15af3d='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x41ea95='',_0x38eaf7='';for(let _0x578fed=0x0,_0xd147c3,_0x5f2bb7,_0x5c2dbc=0x0;_0x5f2bb7=_0x2615c3['charAt'](_0x5c2dbc++);~_0x5f2bb7&&(_0xd147c3=_0x578fed%0x4?_0xd147c3*0x40+_0x5f2bb7:_0x5f2bb7,_0x578fed++%0x4)?_0x41ea95+=String['fromCharCode'](0xff&_0xd147c3>>(-0x2*_0x578fed&0x6)):0x0){_0x5f2bb7=_0x15af3d['indexOf'](_0x5f2bb7);}for(let _0x23b5d4=0x0,_0x2a961d=_0x41ea95['length'];_0x23b5d4<_0x2a961d;_0x23b5d4++){_0x38eaf7+='%'+('00'+_0x41ea95['charCodeAt'](_0x23b5d4)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x38eaf7);};const _0x2cae25=function(_0x2bd4c1,_0x122bcd){let _0x33e20c=[],_0x2ae6ef=0x0,_0x124b68,_0x58657e='';_0x2bd4c1=_0x19ba48(_0x2bd4c1);let _0x4f4028;for(_0x4f4028=0x0;_0x4f4028<0x100;_0x4f4028++){_0x33e20c[_0x4f4028]=_0x4f4028;}for(_0x4f4028=0x0;_0x4f4028<0x100;_0x4f4028++){_0x2ae6ef=(_0x2ae6ef+_0x33e20c[_0x4f4028]+_0x122bcd['charCodeAt'](_0x4f4028%_0x122bcd['length']))%0x100,_0x124b68=_0x33e20c[_0x4f4028],_0x33e20c[_0x4f4028]=_0x33e20c[_0x2ae6ef],_0x33e20c[_0x2ae6ef]=_0x124b68;}_0x4f4028=0x0,_0x2ae6ef=0x0;for(let _0x4c822a=0x0;_0x4c822a<_0x2bd4c1['length'];_0x4c822a++){_0x4f4028=(_0x4f4028+0x1)%0x100,_0x2ae6ef=(_0x2ae6ef+_0x33e20c[_0x4f4028])%0x100,_0x124b68=_0x33e20c[_0x4f4028],_0x33e20c[_0x4f4028]=_0x33e20c[_0x2ae6ef],_0x33e20c[_0x2ae6ef]=_0x124b68,_0x58657e+=String['fromCharCode'](_0x2bd4c1['charCodeAt'](_0x4c822a)^_0x33e20c[(_0x33e20c[_0x4f4028]+_0x33e20c[_0x2ae6ef])%0x100]);}return _0x58657e;};_0x3bc7['lSYoMw']=_0x2cae25,_0x4887fd=arguments,_0x3bc7['zLhhme']=!![];}const _0x458675=_0x5db613[0x0],_0x5755c0=_0x3bc740+_0x458675,_0x51c173=_0x4887fd[_0x5755c0];return!_0x51c173?(_0x3bc7['AZTdfz']===
|
2024-07-06 12:23:46 +08:00
|
|
|
|
// prettier-ignore
|
|
|
|
|
function Env(t,e){"undefined"!=typeof process&&JSON.stringify(process.env).indexOf("GITHUB")>-1&&process.exit(0);class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`🔔${this.name}, 开始!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),n={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(n,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"])
|