faker3/jd_liveLottery.js

25 lines
78 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
活动名称京东直播互动抽奖
活动链接https://h5.m.jd.com/dev/3pbY8ZuCx4ML99uttZKLHC2QcAMn/live.html?id=<直播间id>
2024-08-17 19:41:53 +08:00
环境变量jd_liveLottery_ids // 直播间id多个用英文逗号@,换行分割
jd_liveLottery_threads // 控制并发线程数正整数默认1最大10
2024-06-28 15:38:28 +08:00
jd_liveLottery_interval // 自定义运行间隔时长整数单位毫秒默认500
jd_liveLottery_notify // 是否推送通知true/false默认不推送
jd_liveLottery_pinFilter // 账号pin过滤多个用@进行分割
2024-08-17 19:41:53 +08:00
jd_liveLottery_rewardnum // 京豆低于值不跑默认1
2024-06-28 15:38:28 +08:00
高并发脚本谨慎使用并发
活动限制IP严重建议使用代理
黑号会持续擦肩同一直播间活动请勿连续抽奖以直播间悬浮标识为准
2024-08-17 19:41:53 +08:00
修正403错误
2024-06-28 15:38:28 +08:00
2024-08-17 19:41:53 +08:00
cron:1 1 1 1 *
2024-06-28 15:38:28 +08:00
2024-08-17 19:41:53 +08:00
*/
2024-06-28 15:38:28 +08:00
2024-08-17 19:41:53 +08:00
const $ = new Env('京东直播互动抽奖')
function BzN7B0y(){}var k9gZL2s=Object['defineProperty'],o2OXfLl,oiuUlP5,gthIBJ,fTs3TI,v7tFFUR,PkpCCU,VMA96E,kOFOxB,jaiYdPF,r87kBXi,KzGDdr,p8I7WA,hMkhWg,s1eR6o0,Rg6Da8,vril4XL,wfhFqp1;function svZj9_(BzN7B0y){return o2OXfLl[BzN7B0y<0xd1?BzN7B0y-0x1c:BzN7B0y-0x3f]}o2OXfLl=ujoQzdZ.call(this);function npRZwF(BzN7B0y,k9gZL2s){oiuUlP5(BzN7B0y,'length',{value:k9gZL2s,configurable:!0x0});return BzN7B0y}oiuUlP5=Object.defineProperty;var XBG2K26=[],AFq0d4I=['69.:VM30','=Zm[}6"A$','OIC27iRx','fN`8TV90','SI|W.jxAx;!@N$','k&jwR','a>4Tn_339tq','RW7*@@{]dX,0JK','JP)CB','mJw4?T`H','zmh,H>3H','nEx~j2DH','oJCp','zmh,_$/Xkr+Gj','ej(kA','YTmkc',svZj9_(0x20),svZj9_(0x1d),'}EAB','1{(O3!,pE[:K*9#E"0>kUtd','^6TrStd','wD]k','lJ+Ic','E;mkrq6e','1{(O3!,pE[:K*9#E"0#BF]@ab<%','1{(O3!,pE[:K*9#E"07Z]tu3h=1<w','Z}MD','1{(O3!Ze','S*qkYt#e','|q5|P8xe','Tf9B','1{(O3!,pE[:K*9#E"05!]tQ5IM','lJ~r^','1{(O3!,pE[:K*9#E"0*r$@)Hov<Heo','1{(O3!,pE[:K*9#E"0xr0l(3b4U~KD','1{(O3!,pE[:K*9#E"0[r,WDO+RH','Ng48X','$ZOk','eDir^','6Xn"{#v(lSM49{]$"Ux(lA*9i>E=OK#o)Ea`i','%:7kn',';u=Zi!7e','Z;MBpqd','eDir^','fgjrNqAv3<CHw','Z>H|&Vy7h<}Kw','Xb3B;','YT:@AKd','(uZIP]6e','E;vr#hw|a','cuvr^','>g#@8t;e',svZj9_(0x1c),'%~BUMKNu5zLiC@(ZhWC*z.yVr!JC!JAt2uf=xeEL~qiiH<yx%gP*mKvDYz24MCpZctgg','V;Rk','iD7k5$s~~4',svZj9_(0x1c),'%~BUMKN$*EmAcM&m2L={@>,|R;b[!JatxGDu=.]lm8Q?_fPH47LYu','(uOk','eDir^','fgMB5]sVP,ZK;"cs7w','Pu^Zc','fg=ZE:_7ZRnc/caAY#T','rm_qR5_*Rk.]+;y*ggVh1KH[]ftG/lm&]J3BCYLs4,NYw',svZj9_(0x23),']Ulo','fgNC,muw',svZj9_(0x2f),'fgNC,m|w','"EpI9_d','C);]}&XA','%z^#:W}A','$:u]S_DEYeZPCYCoHn',svZj9_(0x1f),'fgMB^8YH1RZK;"cs7w',svZj9_(0x21),svZj9_(0x2c),'^glOy%P~|vGH,t)&};1IJ@ppgM',svZj9_(0x25),'6kjr^l!7P,W+2D','(uMBrq3|l{x',svZj9_(0x27),svZj9_(0x1d),';u#@I$wvtf','?T3B5]atu=|"P)q1nuT',svZj9_(0x1e),'|xg"7&J4','dug;d_%4','gr+I/J1e','gg|B','r%)"?Ujj]J','|xg"7&J4','5ulr5VEe','x;3^M{K4','xx?[','(uOk',svZj9_(0x1e),'fg:@N8Ee','};_|s:*e',svZj9_(0x1f),',J1I@t#e',svZj9_(0x20),'"EjO|Ypp;#','E;|B','#jRg`rHu(P#%hs~tWM??+ijBj2o?:<.mo7lb.q"Fi',svZj9_(0x1c),'fgjrJ@w|1R+DAWzE}EMB','^glOy%P~|vGH,t)&};1IJ@ppgM',svZj9_(0x22),'fgMB^8YH1RZK;"cs7w',svZj9_(0x21),'Z>H|e6xe','(uOk',svZj9_(0x32),'![UA)iWAR;pZ|Q4','^glOy%P~|vGH,t)&};1IJ@ppgM',svZj9_(0x22),svZj9_(0x23),'fgNC,muw','fgNC,m|w','TuMBrq3|a','iD7k5$s~~4','iD7kn','(Jahn',svZj9_(0x31),';upI^','IbghN8ppQ','lTjr7','(uMBrq3|6$l@q;n(!UjrB!*e','ngdPE]fe','>q(r^',';unB*8cvJvNJ["aACET','2TTrrqd','T4SvI2Vizs^9B','^t&[jebIQ7ww','poI#hXbjDi*[k;1{3R|w','?T3B5]atu=|"P)q1nuT',svZj9_(0x1c),'U5Mq}{eX','"EjO|Yfe','Z>H|&VEe','gg:on','MVDJ=FVL!zDvGDLnT0CC6w5&s4,',svZj9_(0x1c),'^:}h^','ngdPE]R7Vfm<sD',svZj9_(0x1c),svZj9_(0x24),'|):(`3r^6rMZ:oBt}fF=4nw','xer{y..^8rj',svZj9_(0x1c),svZj9_(0x24),'8c19(*7TiXQ%e','^tk5|{jF|~CCLy5]Z1s=P5w',svZj9_(0x1c),svZj9_(0x1c),svZj9_(0x1c),'7gb@m:5pQ',svZj9_(0x29),svZj9_(0x2a),'(uMBrq3|l{x',';u#@.:xe',svZj9_(0x2b),'U;lrOjKw','k8t<','+>H|Iqfe',svZj9_(0x25),'FxBSS%q6kq|Zi','6;lr,|Ee','lQ}YfM_i','I]*$.x,i','rmAD','`x}YfM:1{HJHrlv["@3eX_rC','fg:@Q!TtQ','zw*cdY61(HP?:&B>JslVK>g@G$','Rw*c$+F6VqV',svZj9_(0x26),';sp<','&;~O','N>bST','uuyI[@d','pwobv2JGGj','FxBSS%TC','CEsQ^','6;lrkm{O`#m,ix9(|qkptPp{T','(g4=v','(uOk',svZj9_(0x2d),'1s/=c3FC','DsZ$T.!D,','R<heWurC','bFRT','ZRDS:3FC','l]$<',svZj9_(0x2e),'>*J|jWHe','_B*$','@>`T1:cvd|o#83CMc*p^[@S4+[N2GeN)(*hVuKd6k4:K:(Vcum5o.rMw','M0HV:.g1rKTHi','hs*$Ee{C','zw*cJ','M0q<c.}1N,9PF^{',',zP<vyaC',':Q.bxS|i','%fNSi}N#','nuJryIHe','w(_|_2Ee','ssG$','zFX@{!#e','!fYT_r#','(A|XNVd',')Rhecld1(juKomA]Ji','<A]k1zd',')Rhecld1(juKRXT!=i','w8AST','LUNIr",7.4SGYUzEBw','aDir_IG3xGM[@D','!V}YEey]Gj4Li','tA"rwWu3h4_G))y*`TZI^',';u%Z`(4w^<!]"7X(5uUINh#e','%f|=EeK_lKoH=&',svZj9_(0x30),'WWZc}bpC','lTjr7','Vw7ce3,J,','@UAa','`s8cc.|J,','exobn.fD,',':JH@u]d',svZj9_(0x28),';upI^','IbghN8ppQ','lTjr7','ZkKZw6[pi4','Cq(r^','6kjrr81e','>q(r^','bAb@&]#e','X0*rt2re','*%5|m:Xe','ngJOBjfe','QDw8vhEe','"%_|Azd','(uMBrq6e','$;!O','(uMBrq3|l{x','zT#@2|L(h4Z',svZj9_(0x26),'Pgmk',svZj9_(0x1c),'ct6Y&N5A!hQ|kQFtAG^#oww','Z>H|&Vy7h<}Kw','^gw8u:1e','Z>KZijfe','RJw8vhEe','0$3!v','(uOk','zs[1)iQA!hQ|kQA]lDqFAPxcMI1!^a','+QSXn',svZj9_(0x27),svZj9
2024-06-28 15:38:28 +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"])