jdpro/jd_bean_home.js

9 lines
111 KiB
JavaScript
Raw Normal View History

2024-06-28 07:47:44 +00:00
/*
2024-11-24 03:14:38 +00:00
活动入口京东APP首页-秒杀-赚更多
cron "10 1,15 * * *" jd_bean_home.js
2024-06-28 07:47:44 +00:00
*/
const $ = new Env('领京豆-升级赚豆');
2024-11-24 03:53:35 +00:00
function XLibpv(){}var A1pSYQg=Object['defineProperty'],IP1_nF,mJvstx,lJVS4a6,nf39eIe,IlpNqm,gQythvn,wbAxlq,QTQksNV,u5rdH9,tkxssA,mqPdm0F,CvOSvQ,PK9qQk,gkIQxGO,P8YYM7D;function tW9AO8(XLibpv){return IP1_nF[XLibpv>0x4a?XLibpv-0x4b:XLibpv-0x29]}IP1_nF=GIf_LKY();function gFe8pz(XLibpv,A1pSYQg){return mJvstx(XLibpv,'length',{value:A1pSYQg,configurable:!0x0})}mJvstx=Object.defineProperty;var HhwY1vL=[],Pnu_Rc9=['D$%^hRdT','!bC?)::"','dC{}QJ1`x','[@&b$WA;',']?Psa%WBZvlw^','2m~/y(>p','YlznH$>p','O=z:','dws?_m6dk*c4L','3"Sa((+','jCtg,(+','XxDP(HsL',tW9AO8(0x4b),'v=|yKHyX)B]1:V','E&G:','N]Ucj',tW9AO8(0x4c),'S.4:?','!.Pc','Z(Oz%gtbq}h"*_vSaz,lDoj5+5!YKxJ=ido4RzUfI9>l<Fc(Q<[>M9lZ{?6AfJd_.L',tW9AO8(0x4b),'E&G:',tW9AO8(0x4c),tW9AO8(0x4e),'=]bcgxCp','LQjlMld`{>{@L','=]tg{yjqqu','v=sP5iEp','8&>yo(]p','1>RP?','v=|yKHyX)B]1:V',tW9AO8(0x4d),'N]Ucj',':C#y((+','S.4:?','!.Pc','Z(Oz%gtbq}h"*_vSaz,lDoj5+5!YKxJ=ido4RzUfI9>l<Fc(Q<[>M9lZ{?6AfJd_.L','1>RP?',tW9AO8(0x4d),':C#y((+','S.4:?',tW9AO8(0x4c),tW9AO8(0x4e),'1>RP?','E&G:',':C#y((+',tW9AO8(0x4e),'1>RP?',tW9AO8(0x4d),'%y<^E','?.mgz|u;F','#)4:]',')w(>qFox',')w(>qFhPLw','JtQy/x+',tW9AO8(0x4f),'E&G:O|[PF','J7#y0nk{+0','J7#y0nk{+0j','J7#y0ncIP4D','LQec','].#y0n>p','=]bcgxCp','zHG:u(<JZ5Q|41!~{#a5|r5q/5S3()n~)=Vay(UdzI','j&Lo9}!4y3.2<)@=',tW9AO8(0x62),'pQ*gj','OpBH[*m7h#8_R[x(H2W7hVeRjyg6HmBB448[@}2z!J4oQ:`O].#y0nk{HJh}^yI{PA9AWw.imIBe8w9(d0cBM/t_m1mU{U0b=`XebxRNc','zHG:u(<J]Pv','eDuQy^A%lBG','].0yQryX~U8','jC;Qgve:rB(','?tsP&nI(F','E<eji/r+PM','4%E8B!{fCLj>xym?jpV;%s>i)_F2_W[.9jy^gY`*(6m=C+i`QCzQI','l8@5TxDp','h8B^>._j','!lA5&Y0p','LQ|yz}+',tW9AO8(0x60),'x:bgD(Z.P','|_hEQx?j','|ts?Tl+','!lcmtsn=[0m#L','!.Pc','|_hEQx255R',tW9AO8(0x61),'7:SA','MWCYF','GCA5d/q4FI','owb1R.s[_Sim(&%zi9nAwqm4@6Z|68ge)i&Ek^=G~r%T_Q4=:_<:l','qm#rU;iM',')V"Dq','it|yz}+',tW9AO8(0x4f),'pQ*gj','=]Ig>aL5X','Z.Igj','%}J]8^kp',tW9AO8(0x53),'l8@5S;=p','&&|V?','l8@5S;d`a3O}L','Z.Ig^{[P.B_',tW9AO8(0x54),tW9AO8(0x55),'FQUc/oNp','Z.Ig^{_p','THRP','!.l/9eCp',tW9AO8(0x4e),'N.FY4n}MmHW}[^6DIL','$84:&(QNrI','$84:&(]p',tW9AO8(0x5c),'?&C/Me*4FI','slA5pCNTzI{',tW9AO8(0x5a),'{=cTMebp','g.Uc','dSpV',tW9AO8(0x4f),'bHmg^yi@LW)',tW9AO8(0x51),tW9AO8(0x52),'Rtsg`','$B@5{$J?ZBb3H1F~r>t','!.Pc','N]`9P(`p','1y!%;19T','ml?:e(vL','mgId',tW9AO8(0x50),'ZlhLI&hf',tW9AO8(0x50),'ZlhLI&hf',tW9AO8(0x5b),tW9AO8(0x4c),'4&@5D^LI(EP{X_w','"]Sa=;RXzI^@rQ',tW9AO8(0x63),'4&@5x).4#B32yQ','!.Pc',tW9AO8(0x57),tW9AO8(0x51),'l8@5S;=p',tW9AO8(0x5f),tW9AO8(0x52),'|m@y.eq?ZBQ;})0',tW9AO8(0x53),'!.Pc','Rtsg`','&)V:6x2TVI','&)@yyrhequ','$m#yi(]p','&)@yyr>p','UcA5Tx}?qB=32(q~=]Pc','[H@5((+','$m#yi(~T!I_','$m#yi(&I7Bo$:V','j&5:$5>p','9&vlIx0p','l=ngZ','"]SatC7p|HiWMQ','"]SatC7p','s8]gTx+','PQd/{y.XZB5','LQjlD^#p','t!RP',tW9AO8(0x54),'bxgcj','*Q`c?','Z.Igg^LI(E','LQjlD^#p','t!RP','eDXaj','"]Sa=;]p','M=IgGa+','LQjlD^#p','t!RP',tW9AO8(0x5d),'PQ)yHm~p','?.4:','6&uo#',tW9AO8(0x56),'LQ5:XnbT]>','/)^PM|~UE)wZL','bHmPYibp','PQ)y4Yjqqu','l]G:Tx+',tW9AO8(0x55),'CcsggoA`TG)@L','PQ)y9^TUquY','PQ)y9^)p','PQ)y9^)pau','*Q`c4bq40u#{z14','PQ)y9^=p','6&Uc','PQ)yHm[NlUH',tW9AO8(0x56),'LQ5:XnbT]>','PQ)y4Yjqqu','!.Pc','!.l/9eCp','Ambc','zHG:u(<J]P','XCjlxajH^u','dPZgg9WrbE','O=6Y/|3`vE','Y=5_miZI7>','g.Igb$l0qu','M=b}D^LI(E','j.T/T','bHmg^y`p',tW9AO8(0x69),tW9AO8(0x5e),tW9AO8(0x64),'XCjlxajH^ukvw<4','(zt:f/WrvW8B:V','>),TkgVL','slA5f/;Mqu|}L','(zvgL1.4auAW[[gN:L','zHG:u(<J]Pd$z1!~{#a5|r+','1z<];|(r/5rv9[{M#.xF9=+','/zr/io{C&EEr34KDVc:gj=+','w=yXm{vJkE6mMQ/[zH"cZ','Cc6/Q,_p',')7Ut','omxa*n~p','zHG:u(<Jp','bO@y^g&(p',tW9AO8(0x6b),'T&6/ox>p','Bc3/+(#p','XQ*gA/&5.B_','T&6/ox2`ku,WmR#!:L','].@y#','T&6/ox2`ku,W))@=jL','3zec~J+','?&C/Me.4X','zHG:u(<J]Pd$z1!~{#a5|r5q/5L;$v<[CcsgjR"dm42e/^pz_OvF312FrlyvGN~~Px[m}3DEIlAHov^!U=wc%aDp','Cc6/Q,WqxuavivVzi>t','jn`c8/U+','&&+c;|_p',',Da;=e+','8D@5s1@p','r>RP','y8CxtYGHDW6rWp6[!Di5d/|E=Y~dHr|I_w>yH,/L05Z','].#y0n>p',tW9AO8(0x4e),'!.Pc',tW9AO8(0x57),'QQ@y/x+','CcsggoA`TG)@L',tW9AO8(0x58),tW9AO8(0x59),'N]jo6oTTF',tW9AO8(0x4f),'Uc}l/x+','!.Pc','Ccsggo~p','8x!gj',tW9AO8(0x58),'Rtsg`','N]jo6oTTF','l8@5S;=p','&&|V?',tW9AO8(0x4f),'N]`9P(`p','!.Pc','bHmg^yi@LW)','!.l/9eCp
2024-11-24 03:14:38 +00:00
function Env(o,t){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((r,i)=>{s.call(this,t,(t,e,s)=>{t?i(t):r(e)})})}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.logLevels={debug:0,info:1,warn:2,error:3},this.logLevelPrefixs={debug:"[DEBUG] ",info:"[INFO] ",warn:"[WARN] ",error:"[ERROR] "},this.logLevel="info",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.encoding="utf-8",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`🔔${this.name}, 开始!`)}getEnv(){return"undefined"!=typeof $environment&&$environment["surge-version"]?"Surge":"undefined"!=typeof $environment&&$environment["stash-version"]?"Stash":"undefined"!=typeof module&&module.exports?"Node.js":"undefined"!=typeof $task?"Quantumult X":"undefined"!=typeof $loon?"Loon":"undefined"!=typeof $rocket?"Shadowrocket":void 0}isNode(){return"Node.js"===this.getEnv()}isQuanX(){return"Quantumult X"===this.getEnv()}isSurge(){return"Surge"===this.getEnv()}isLoon(){return"Loon"===this.getEnv()}isShadowrocket(){return"Shadowrocket"===this.getEnv()}isStash(){return"Stash"===this.getEnv()}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null,...s){try{return JSON.stringify(t,...s)}catch{return e}}getjson(t,e){let s=e;if(this.getdata(t))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(r=>{this.get({url:t},(t,e,s)=>r(s))})}runScript(a,o){return new Promise(r=>{let t=this.getdata("@chavy_boxjs_userCfgs.httpapi");t=t&&t.replace(/\n/g,"").trim();var e=(e=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"))?+e:20,[s,i]=(e=o&&o.timeout?o.timeout:e,t.split("@"));this.post({url:`http://${i}/v1/scripting/evaluate`,body:{script_text:a,mock_type:"cron",timeout:e},headers:{"X-Key":s,Accept:"*/*"},timeout:e},(t,e,s)=>r(s))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};this.fs=this.fs||require("fs"),this.path=this.path||require("path");var t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),r=!s&&this.fs.existsSync(e);if(!s&&!r)return{};r=s?t:e;try{return JSON.parse(this.fs.readFileSync(r))}catch(t){return{}}}writedata(){var t,e,s,r,i;this.isNode()&&(this.fs=this.fs||require("fs"),this.path=this.path||require("path"),t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),r=!(s=this.fs.existsSync(t))&&this.fs.existsSync(e),i=JSON.stringify(this.data),!s&&r?this.fs.writeFileSync(e,i):this.fs.writeFileSync(t,i))}lodash_get(t,e,s){let r=t;for(const t of e.replace(/\[(\d+)\]/g,".$1").split("."))if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,r,e){return Object(t)===t&&((r=Array.isArray(r)?r:r.toString().match(/[^.[\]]+/g)||[]).slice(0,-1).reduce((t,e,s)=>Object(t[e])===t[e]?t[e]:t[e]=Math.abs(r[s+1])>>0==+r[s+1]?[]:{},t)[r[r.length-1]]=e),t}getdata(t){let e=this.getval(t);if(/^@/.test(t)){var[,s,r]=/^@(.*?)\.(.*?)$/.exec(t);if(s=s?this.getval(s):"")try{const t=JSON.parse(s);e=t?this.lodash_get(t,r,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){var[,r,i]=/^@(.*?)\.(.*?)$/.exec(e),a=this.getval(r),a=r?"null"===a?null:a||"{}":"{}";try{const e=JSON.parse(a);this.lodash_set(e,i,t),s=this.setval(JSON.stringify(e),r)}catch(e){this.lodash_set(a={},i,t),s=this.setval(JSON.stringify(a),r)}}else s=this.setval(t,e);return s}getval(t){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":return $persistentStore.read(t);case"Quantumult X":return $prefs.valueForKey(t);case"Node.js":return this.data=this.loaddata(),this.data[t];default:return this.data&&this.data[t]||null}}setval(t,e){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":return $persistentStore.write(t,e);case"Quantumult X":return $prefs.setValueF