jdpro/jd_redRain2021.js

20 lines
51 KiB
JavaScript
Raw Normal View History

2024-06-28 07:47:44 +00:00
/*
活动名称京豆红包雨
环境变量jd_redRain2021_threads // 控制并发线程数正整数默认1最大3尽量使用默认值否则请开启代理运行
jd_redRain2021_interval // 自定义运行间隔时长整数单位毫秒默认2000
jd_redRain2021_notify // 是否推送通知true/false默认不推送
jd_redRain2021_pinFilter // 账号pin过滤多个用@进行分割
高并发脚本谨慎使用并发
活动限制IP严重建议使用代理
定时请自行修改
cron:1 1 1 1 *
*/
const $ = new Env('京豆红包雨')
var il='jsjiami.com.v7';const III111=iii1II;function iii1II(_0x24d717,_0x225569){const _0x3027e1=Iii11l();return iii1II=function(_0xaea8e8,_0x87dbf){_0xaea8e8=_0xaea8e8-0xee;let _0x396cce=_0x3027e1[_0xaea8e8];if(iii1II['wzFuGs']===undefined){var _0x28cfb6=function(_0x2a60f8){const _0x574d55='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x23b6e8='',_0x3780f7='';for(let _0x4075f2=0x0,_0x19e78d,_0x912af2,_0x372d6f=0x0;_0x912af2=_0x2a60f8['charAt'](_0x372d6f++);~_0x912af2&&(_0x19e78d=_0x4075f2%0x4?_0x19e78d*0x40+_0x912af2:_0x912af2,_0x4075f2++%0x4)?_0x23b6e8+=String['fromCharCode'](0xff&_0x19e78d>>(-0x2*_0x4075f2&0x6)):0x0){_0x912af2=_0x574d55['indexOf'](_0x912af2);}for(let _0x1ec19b=0x0,_0x26991e=_0x23b6e8['length'];_0x1ec19b<_0x26991e;_0x1ec19b++){_0x3780f7+='%'+('00'+_0x23b6e8['charCodeAt'](_0x1ec19b)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3780f7);};const _0x43c888=function(_0x4f533c,_0x1c534d){let _0x17311f=[],_0x457cf1=0x0,_0x5980d8,_0x402660='';_0x4f533c=_0x28cfb6(_0x4f533c);let _0x225fd5;for(_0x225fd5=0x0;_0x225fd5<0x100;_0x225fd5++){_0x17311f[_0x225fd5]=_0x225fd5;}for(_0x225fd5=0x0;_0x225fd5<0x100;_0x225fd5++){_0x457cf1=(_0x457cf1+_0x17311f[_0x225fd5]+_0x1c534d['charCodeAt'](_0x225fd5%_0x1c534d['length']))%0x100,_0x5980d8=_0x17311f[_0x225fd5],_0x17311f[_0x225fd5]=_0x17311f[_0x457cf1],_0x17311f[_0x457cf1]=_0x5980d8;}_0x225fd5=0x0,_0x457cf1=0x0;for(let _0x1e1f8f=0x0;_0x1e1f8f<_0x4f533c['length'];_0x1e1f8f++){_0x225fd5=(_0x225fd5+0x1)%0x100,_0x457cf1=(_0x457cf1+_0x17311f[_0x225fd5])%0x100,_0x5980d8=_0x17311f[_0x225fd5],_0x17311f[_0x225fd5]=_0x17311f[_0x457cf1],_0x17311f[_0x457cf1]=_0x5980d8,_0x402660+=String['fromCharCode'](_0x4f533c['charCodeAt'](_0x1e1f8f)^_0x17311f[(_0x17311f[_0x225fd5]+_0x17311f[_0x457cf1])%0x100]);}return _0x402660;};iii1II['oKoPrE']=_0x43c888,_0x24d717=arguments,iii1II['wzFuGs']=!![];}const _0x56fd3a=_0x3027e1[0x0],_0x257967=_0xaea8e8+_0x56fd3a,_0x27fe04=_0x24d717[_0x257967];return!_0x27fe04?(iii1II['tUHrRN']===undefined&&(iii1II['tUHrRN']=!![]),_0x396cce=iii1II['oKoPrE'](_0x396cce,_0x87dbf),_0x24d717[_0x257967]=_0x396cce):_0x396cce=_0x27fe04,_0x396cce;},iii1II(_0x24d717,_0x225569);}(function(llii1I,iiIiIi,l1lll1,IilI,liIlli,lil11,Iillll){return llii1I=llii1I>>0x7,lil11='hs',Iillll='hs',function(lllI1,III11I,Ilii1,ll11i1,ili1I1){const ll11l=iii1II;ll11i1='tfi',lil11=ll11i1+lil11,ili1I1='up',Iillll+=ili1I1,lil11=Ilii1(lil11),Iillll=Ilii1(Iillll),Ilii1=0x0;const Iill=lllI1();while(!![]&&--IilI+III11I){try{ll11i1=-parseInt(ll11l(0x13b,'T!bK'))/0x1+parseInt(ll11l(0x1f0,'7cZs'))/0x2*(parseInt(ll11l(0x210,'M!tc'))/0x3)+-parseInt(ll11l(0x29f,'rTKy'))/0x4*(parseInt(ll11l(0x151,'M!tc'))/0x5)+-parseInt(ll11l(0x1b9,'C5U#'))/0x6+parseInt(ll11l(0x27b,'C5U#'))/0x7*(parseInt(ll11l(0x1db,'wb!W'))/0x8)+-parseInt(ll11l(0x2ca,'I&2x'))/0x9+parseInt(ll11l(0x150,'1Df^'))/0xa;}catch(ili1II){ll11i1=Ilii1;}finally{ili1I1=Iill[lil11]();if(llii1I<=IilI)Ilii1?liIlli?ll11i1=ili1I1:liIlli=ili1I1:Ilii1=ili1I1;else{if(Ilii1==liIlli['replace'](/[RKyMTxQePnbrGYSONgEL=]/g,'')){if(ll11i1===III11I){Iill['un'+lil11](ili1I1);break;}Iill[Iillll](ili1I1);}}}}}(l1lll1,iiIiIi,function(liIllI,ll11i,iI1lI1,I1I1li,l1i11,IlI1li,IlI1ll){return ll11i='\x73\x70\x6c\x69\x74',liIllI=arguments[0x0],liIllI=liIllI[ll11i](''),iI1lI1=`\x72\x65\x76\x65\x72\x73\x65`,liIllI=liIllI[iI1lI1]('\x76'),I1I1li=`\x6a\x6f\x69\x6e`,(0x172afb,liIllI[I1I1li](''));});}(0x6500,0xa488c,Iii11l,0xcc),Iii11l)&&(il=Iii11l);const jdCookie=require('./jdCookie'),common=require(III111(0x159,'8n9b')),notify=require(III111(0x27e,'A**0'));console[III111(0x254,'MOk@')](''),console[III111(0x27a,'snc4')]('=========='+$[III111(0x2ab,'kJa[')]+III111(0x18c,'snc4')),console['log'](III111(0x11a,'aZ3d')),console[III111(0x267,'23Dj')](III111(0x16f,'ii^I')),console['log'](III111(0x1f7,'7cZs')),console[III111(0x2f2,'*r!g')]('jd_redRain2021_pinFilter\x20//\x20账号pin过滤多个用@进行分割'),console[III111(0x171,'bz!N')](III111(0x15a,'n41B')+$[III111(0x2e5,'8n9b')]+III111(0x145,'7cZs')),console['log']('');let taskThreads=proce
// 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"])