faker3/jd_liveLottery.js

25 lines
87 KiB
JavaScript
Raw Normal View History

2024-11-12 11:17:55 +08:00
/*
活动名称京东直播互动抽奖
活动链接https://h5.m.jd.com/dev/3pbY8ZuCx4ML99uttZKLHC2QcAMn/live.html?id=<直播间id>
2025-01-17 09:38:12 +08:00
环境变量jd_liveLottery_ids // 直播间id多个用英文逗号@,换行分割
jd_liveLottery_threads // 控制并发线程数正整数默认1最大10
2024-11-12 11:17:55 +08:00
jd_liveLottery_interval // 自定义运行间隔时长整数单位毫秒默认500
jd_liveLottery_notify // 是否推送通知true/false默认不推送
jd_liveLottery_pinFilter // 账号pin过滤多个用@进行分割
2025-01-17 09:38:12 +08:00
jd_liveLottery_rewardnum // 京豆低于值不跑默认1
2024-11-12 11:17:55 +08:00
高并发脚本谨慎使用并发
活动限制IP严重建议使用代理
黑号会持续擦肩同一直播间活动请勿连续抽奖以直播间悬浮标识为准
2025-01-17 09:38:12 +08:00
修正403错误
2024-11-12 11:17:55 +08:00
2025-01-17 09:38:12 +08:00
cron:1 1 1 1 *
2024-11-12 11:17:55 +08:00
2025-01-17 09:38:12 +08:00
*/
2024-11-12 11:17:55 +08:00
2025-01-17 09:38:12 +08:00
const $ = new Env('京东直播互动抽奖')
2025-03-06 11:41:55 +08:00
function aDsPlX(){}var jPR5VQ=Object['defineProperty'],JOg09lD,f6EShb,_hD4CT,ATsDRR6,PUCVs4,kttiLCq,V_7VK1,sQNTdXY,OaTBEH,BVqoXWg,iu4Cp12,vOgNf4,YEInuPv,zBSZHw,Ric1Xa,WdU_O0,nNuaWo,TbjXfx,DU6m5d;function QUcjtPE(aDsPlX){return JOg09lD[aDsPlX<0x3c?aDsPlX-0x3f:aDsPlX<0xa0?aDsPlX<0x3c?aDsPlX-0x2b:aDsPlX<0xa0?aDsPlX-0x3d:aDsPlX+0x39:aDsPlX+0x5f]}aDsPlX(JOg09lD=BRJFGc(),f6EShb=mjG5b6((aDsPlX,jPR5VQ)=>{return jPR5VQ(aDsPlX())},0x2)(uYpLw6G,qqQNfG));var NmoQen=[],ZQnqThU=[_4E_oq(QUcjtPE(0x45)),'\u0068\u003c\u0062\u006d\u007e\u006a\u0035\u005a',_4E_oq(0x1),'\u0025\u003a\u0070\u004d\u006c','\u004c\u0063\u0057\u003f\u003d\u007e\u0064\u007a','z!;}}:G','\u0071\u0022\u0030\u005b\u0029\u0035\u0061\u0053\u0069\u0030\u007d\u004d\u0065\u0044\u0069',_4E_oq(0x2),'\x72\x4e\x71\x54','\u006a\u006f\u0058\u0024\u0045\u0031\u005b\u0053\u004e\u0021\u003e\u0033\u0044\u0079\u0057\u004e\u0059\u0060\u004c\u004d\u004f\u007e\u0065','\u0046\u0041\u003a\u0055\u0026\u007e\u0065',_4E_oq(0x3),_4E_oq(0x4),'\x4e\x64\x70\x4d\x55\x39\x41\x7a','joX$E1[SN!>3DyWNY`WTBv?#)<I',_4E_oq(0x5),'\x5a\x72\x50\x3b','\x6a\x6f\x58\x24\x45\x31\x5b\x53\x4e\x21\x3e\x33\x44\x79\x57\x4e\x59\x60\x52\x3f\x76\x7e\x77\x43\x62\x50','\u006a\u006f\u0058\u0024\u0045\u0031\u005b\u0053\u004e\u0021\u003e\u0033\u0044\u0079\u0057\u004e\u0059\u0060\u0043\u0031\u0076\u007e\u0077\u0043\u0062\u0050',',48UF',_4E_oq(QUcjtPE(0x48)),'joX$E1[SN!>3DyWNY`|U`,XE)JO83;',_4E_oq(QUcjtPE(0x49)),'\x61\x63\x4a\x3d\x73',_4E_oq(QUcjtPE(0x4c)),_4E_oq(QUcjtPE(0x55)),'\x72\x7a\x5e\x49\x6e\x67\x34\x42\x47\x73\x4c\x7c\x2c\x6e\x39\x7e\x49\x5b\x2b\x42\x47\x40\x76\x2c\x46\x3f\x55\x61\x44\x4e\x67\x48\x63\x55\x32\x62\x46','\x49\x3e\x51\x4d\x56','dK^Zg1Qz','\u0040\u0067\u0028\u0065\u0079\u004f\u0031',_4E_oq(0xa),'\x36\x7c\x53\x77\x35\x4f\x46\x2f\x4a\x7a\x49\x71\x26',_4E_oq(0xb),'\u0025\u003a\u003e\u003f\u0071\u0033\u0065','\u0058\u004b\u005a\u0062\u006b\u0076\u0041\u007a','\x4e\x64\x52\x55\x57\x2a\x37\x69\x23','\u006c\u004b\u0052\u0055\u0046','\x4c\x63\x57\x3f\x3d\x7e\x64\x7a',_4E_oq(0xc),'\x49\x38\x54\x4f\x50\x33\x61\x4b\x43\x2f\x5d\x67\x78\x3f\x58\x5a\x2a\x28\x78\x44\x2f\x6d\x75\x7b\x55\x31\x34\x78\x31\x34\x71\x7e\x7d\x4b\x68\x5e\x7c\x7a\x4e\x5d\x38\x39\x67\x67\x22\x3c\x75\x7c\x49\x63\x6b\x44\x70\x33\x52\x3b\x25\x2f\x7d\x4a\x50\x78\x53\x5a\x6c\x7e\x63\x63','\x7b\x64\x5f\x4d','\u0067\u003b\u0051\u004d\u0043\u0036\u0074\u0038\u0038\u004a',QUcjtPE(0x3d),'\u0049\u0038\u0054\u004f\u0050\u0033\u0061\u0036\u0044\u004e\u0070\u0071\u006c\u0050\u0048\u0070\u007d\u005d\u005e\u006f\u003f\u004c\u005b\u0069\u005f\u0064\u0029\u0021\u0031\u0034\u0023\u007e\u007c\u002b\u003b\u004b\u005e\u006d\u0076\u002c\u0070\u003d\u0077\u002e\u0030\u0068\u006b\u0022\u004a\u0051\u005d\u0025\u004b',QUcjtPE(0x3d),'z;gUF',_4E_oq(QUcjtPE(0x4d)),_4E_oq(QUcjtPE(0x51)),'\u0068\u0063\u005e\u005a\u004e\u003e\u0030\u0051\u005a\u005f\u0056\u006c\u0066\u006c\u0023\u0071\u0025\u0057\u003a','Up09_C0D_Mmv2duDcc{*j3"!vh~+f,pHv4ETx%]tJ[a%7','\x71\x68\x65\x42\x6e\x4b\x6b','vO,@',_4E_oq(QUcjtPE(0x47)),'\u0044\u0021\u0042\u0031','\x68\x63\x61\x78\x5b\x70\x69\x37',_4E_oq(0x10),'\u005e\u0061\u002c\u0074\u0078\u003d\u0067\u0049','\u0058\u005a\u0030\u0069\u0063\u0078\u0046\u0038\u0038\u004a','\u0071\u0068\u002a\u0074\u0058\u0059\u004f\u0062\u003c\u0072\u004b\u007b\u005e\u003c\u005e\u002f\u007c\u0041','\x4b\x60\x6a\x54\x21\x3d\x4d\x49','\u0071\u0068\u002e\u007c\u0075\u0059\u005b\u0039\u004d\u0062\u0076\u0048\u005e\u003c\u003f\u002f\u0026\u0041',QUcjtPE(0x3e),'\x75\x68\x4c\x54\x6e\x60\x28\x25\x7a\x65\x72\x39\x73\x5a\x70\x6c\x4b\x5e\x4d\x7b\x47\x74\x4f\x4f\x68\x2e',_4E_oq(0x11),_4E_oq(0x12),'\x58\x4b\x50\x54\x55\x39\x45\x69\x2c\x6f\x7c','\x54\x44\x57\x65\x5a\x33\x6a\x42\x65\x72',_4E_oq(0x13),_4E_oq(0x14),'\u0053\u0029\u0052\u0055\u007c\u003f\u0068\u007a',_4E_oq(QUcjtPE(0x59)),QUcjtPE(0x3d),_4E_oq(0x16),'\u0053\u0029\u0052\u0055\u007c\u003f\u0068\u007a',_4E_oq(0x17),_4E_oq(QUcjtPE(0x5a)),'\u004c\u0063\u0057\u003f\u003d\u007e\u0064\u007a','YN5$i%SSdW',_4E_oq(0x19),_4E_oq(0x1a),'\x58\x4b\x24\x4d',_4E_oq(0x1b),'\u0046\u0063\u002c\u0024\u0075\u0049\u006b\u0038\u0069\u0052\u002b\u0022\
2024-11-12 11:17:55 +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"])