KR/jd_luck_draw.js

37 lines
171 KiB
JavaScript
Raw Normal View History

2023-07-27 16:14:01 +08:00
/*
2023-09-03 02:07:30 +08:00
活动名称店铺抽奖 · 超级无线/超级会员
活动链接https://lzkj-isv.isvjd.com/lzclient/<活动id>/cjwx/common/entry.html?activityId=<活动id>&gameType=<玩法类型>
https://lzkj-isv.isvjd.com/wxDrawActivity/activity/activity?activityId=<活动id>
2023-07-27 16:14:01 +08:00
https://cjhy-isv.isvjcloud.com/wxDrawActivity/activity/activity?activityId=<活动id>
环境变量LUCK_DRAW_URL // 活动链接
2023-09-03 02:07:30 +08:00
LUCK_DRAW_NOTIFY // 是否推送通知true/false默认不推送
LUCK_DRAW_OPENCARD // 是否入会true/false默认不入会
2023-10-29 10:39:53 +08:00
LUCK_DRAW_CONC // 是否启用并发模式true/false默认不开启
LUCK_DRAW_CONC_THREADS // 控制并发线程数正整数默认3
2023-11-03 11:17:33 +08:00
LUCK_DRAW_CONC_RETRY // 并发模式下接口请求的最大重试次数正整数默认0即不重试
2023-11-14 21:29:36 +08:00
LUCK_DRAW_CONC_TIMEOUT // 并发模式下接口请求的最大超时时间(正整数,单位毫秒),默认 '60000' 即1分钟
2023-11-03 11:17:33 +08:00
LUCK_DRAW_INTERVAL // 自定义抽奖间隔整数默认1秒
2023-09-03 02:07:30 +08:00
LUCK_DRAW_MAX_MISS // 最大连续未抽中次数(正整数),达到此次数后会跳过运行对应账号,默认不启用此功能
2023-11-03 11:17:33 +08:00
LUCK_DRAW_FORBIDDEN_QUIT // 当连续请求493时是否跳出即停止运行脚本true/false默认停止运行
LUCK_DRAW_LZKJ_PIN_FILTER // 超级无线类活动账号pin过滤多个用@进行分割
LUCK_DRAW_CJHY_PIN_FILTER // 超级会员类活动账号pin过滤多个用@进行分割
LUCK_DRAW_LZKJ_SHOP_FILTER // 超级无线类活动店铺ID过滤多个用英文逗号进行分割
LUCK_DRAW_CJHY_SHOP_FILTER // 超级会员类活动店铺ID过滤多个用英文逗号进行分割
2023-07-27 16:14:01 +08:00
2023-09-03 10:16:18 +08:00
只有在没有抽奖次数的情况下才会去做任务获取部分活动涉及定制接口会导致请求响应非法操作
2023-07-27 16:14:01 +08:00
2023-10-29 10:39:53 +08:00
2023/9/6 修复 500错误 修复黑名单无效
2023-07-27 16:14:01 +08:00
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
2023-10-29 10:39:53 +08:00
#店铺抽奖通用活动-加密
1 1 1 1 * jd_luck_draw.js, tag=店铺抽奖通用活动-加密, enabled=true
2023-07-27 16:14:01 +08:00
2023-09-03 02:07:30 +08:00
*/
2023-07-27 16:14:01 +08:00
2023-11-03 11:17:33 +08:00
const $ = new Env('店铺抽奖(超级无线/超级会员)')
2023-11-14 21:29:36 +08:00
var version_='jsjiami.com.v7';const I11il=iii1II;function Iii11l(){const l1l1ll=(function(){return[...[version_,'MggjSsPqgjhXGilaUYmFGibl.rcVpoeEme.IRvg7==','cSo9wComrwJdVwddS8o+W7RdGSoXya','CSk6W7ddICkK','smkVW6ldMmkX','W6JdR8kFWP7cJcWLW612DXO3W4JdVmkvW6BcHZS5WQnkAW','WOxcOSoaw8oB','W6VcRSkvW4ZcPG','rmkFr8kg','W40djCktoq','wYBdHSk+Dq','aCo3sG','W7pcJqlcHWWTqGVcJq','WPpcU8kcW7pdTNyOW6tdUSka','8y61RSoV','WP3cSCo3nGm','cKKRW6pcJG','y8kRW5hdICkh','k0OjW7hcRCoKgevbDmofxKtOROFMSOhLP7/OTkZVV4ZOR4hMORBMNOlNV6ROT7xPHjZOR40','WPFcQSkeW7xdSLi5W67dGmkfWONcOG','xW3dTCkwgW','DEs5HEs4IEs4N3G','W6v4qmk2WQC','WRm5WQSbWOm5W51wpCkVgupdQa','W67cQW8Ffa','W50djSk5gW','WRiJWR84WQq','WOirW7ClWO5+','5yI65ywF5BQb6zkd5l+95zkS5OUf5yIs','6z6c5Rce5Pg85l2a','ie8AB2S','W4BcS8kzW7NcUq','AmoZW5XC','aeinAhqWtqa','qHldPSk4Da','WORcHCo7fI4kWPXLWR0DW4q','WQBdU8keWQVcKdyhW7zttbOTW4tdV8k+','yWldQSkoCG','rSkxsW','WPxcJGC+nSoPuSklWRpdVmkFWOjhsCowWRddRsHnlSo6WORcHSkEAaZcQW','sCkqumklW5hcUK3cVG','W4z1xSkzWOy','WPJcV8kEW5BdGW','zSkLumo2eG','xrxdRCoaW4tdQIqTadRdOSkIuCoQW5FdISoOW41+W5ZdL8oj','vtZdNSk0W60','WORcKSo8baejWPbGWQ4fW58','W6ZcJmkcW4xcNG','FSozgq','W5FcLstcUIq','8jkNLaq','5ygwWRlcIUwfJUAWGUwuOEwrSwvL5lUH5yIIW5ddOSoWb+s6JowlSowULoAjJW','xCoximoSmq','rXVdPa','W5tcKctcQIe','W4BcRSoKCImtWRizWOemWRKh','xW3dS8kN','yd9ykCoWW6/dRXv2','W7SVfqGR','W5BcLSobW60','qCoRW49VWPm','WPW0W4/dUMy','W4FcRSo3AHaUWR46WPmzWRy','W7ijoG','ASo7W5a','BSotb0BdJq','WO5tzCk7tq','FvxdRCk9','8lgXH0tNQldMSyS','WRXfWQXtbmoD','k1OCW6tcIq','W7GwerCt','WP3cOe0p','W77dJmkxWRSAuCojfW','W6HtWQ1Yd8ke','Cmk8pCkgW6W','FIpdRmkgoW','zmkydSkaW5BdQLmDWOGrWPLz','WQLIW5C','W5dcKCoMW6JcQa','WPKKW506WPy','BmoxgeBdUa','W7GflbWqW7y','W79izbBcLCk5WRddVSkaW4BdHZm','W4BcJeOkW7DxDCklW6ldLSkoW6OrWOFdGgNdS8oMmdHpt1u','WQatWRS6WO4','WQCBmCkIhCojW5GMtCk7lfbwdL7cQfHDbW','W4DjWQdcHLa','W6LsEqNcRSkq','vSo4jSoxia','4P+2W4/MNy7NNQ/ORQJMS50B','E8k/W7pdHCkEy8oM','yCo3W5ToWOSaW5u','W4NORiZMSBdOT4JMLAdVVk0','WRXyyWdcGSkgWOxdPmkDWPO','W7ZORkBMS7pLPk3OTQVVVytcQg3OOz3PMj3LI4tVVlJdJH4DW7DDhr9NWQBcNCowgSorW7a','tSkbASonea','W6CumbikW7NcVvtdGa','WPJcKSo0bqOiWRXrW6e','BrJdQSkLW5u','CCobt8k2z8kVWP1W','WQuJWQCz','nsFdOSoMW4C','c2i0W5tcOa','p04qW5ldQCo5gvHQr8oO','iwFdQ8kQW4hdV0ZdJmkqW4qFW4BdNSkyp8oXW73cMmkR','W68Nq8kFWOldUmozW7pdI8obWRm','WQ/cQKyfW5a','zHZdTmkPW4S','qmoTqSkfBG','W7xcHCkFW7VcLa','5PYD5B+Z5AEV','gqFdQ8ohW4xdOtG','WR7dMCknWPFcKW','5lM95AsE5Rkn5P+s5OMv5AsQ5P+o5lYy5lUE772c5PMU5AEj5yA25P+t5zcRWPa','WO3cSSoJBCoW','WPaAW5y+WQiQeCkzxSkvW5tcPmkwW6tcVqFcL8kKja4JB8khFCkJW69DxSkZWQLiWORdQ01EmaaEymkZWR7cQ8oPWQjvcmo3umkzWOFcVCk7sSopx8k/W6JdPmkGW7RdOGyKW7PzlueMxZtdO8k8xvNdGSk9DWBcSv3dKmoPWQRcJSkqW6OsjffFdImtBCoXW4xdSHikuhqKmJeduWX/kcnnWQq2WQGZW47cUCowAv4RW6tcOhlcQ8oBW49rWP9eftyWWOxdRWimFCo1WRhcIvyEW7pdT03cT8oWxsZdRWtcRCkcWPhdLw1xW7ddNuFdLCoCoJRcQJT5W4VcJcjeWQddQ8oNx8oBWRDuW5NdUmkGhhNdKezRW7ONW4/dHCokWQ/dHCkaWQTqzSk3WOy','W7NcUmkAW5JcUCk5a0ZdMq','W7NcRCoXwYS','CCkXW7pdLmkLCmoNW64','vL3dR8kKWPS','W5DnWQJcQ3S','CtvvcSoQW7ddLX9JW6fgDSkviMW','W7XpWRS','qJNdHq','W7FcHCoBFHG','WOZcIuaIW6rPEmkzW6hdMmkhW44','WObLW6bmWOS','bFcYGBC','WPRcKSkN','W6LsWQjdfmktDSoKW4Wx','WP7dLSkFWQlcTa','x8oXmCoYpW','WPCDW6GhWPyQmCksA8ovW6hdSq','W6pcOdyEfq','W7xdI8kc','W45DyW3cHq','uCo8jCoBoW','BSoEW6XwWPS','WQbJW4y','FGjCjCop','sr/dHmkazG','5RAc5yMC5Bst5lUCWRC','vx7dNffVW5NcHCkIjwu','sItdG8kFymo9oLNcGG','watdR8kRlG','tSk9ymoida','yCogtSkYtmkGWOq','WP7cL3abW48','WQKeW53dMv55WRG','W7niWRbse8ku','oCkaWQDXWQldS37dVW','DSktfCkzW6NdPW','WQxcGSoiACoKzG','m8kndvKrW6C','WPmqW78bWOqM','jmknhvyg','rJJdICkhca','fNSWW4BcHq','w+IUKEAZMUwMK+I2TE++MWyTtIVdVCk8bmoUWPpdUSoOW5XPWP8','W5fQtYZcVG','D8kDh8keW7a','W4NcI8kcW5pcJG','W6pdGmkxWQirrmo0g8o4','fXFdJ8o4W5W','W6RcIHhcMJq','EfddVCkUWQ4pad09','W4O6uSkvWOC','W7Gpjq','W5xcMHamm8o+xa','p1SpW57cQSoX','DmoFbG','WPKlW6GOWOWIiG','h23dL1H/W5q','W7dcTrhcRZa','5Bsa5AkZ5z+g5z+A','5RwR5yMg5Bs257Uo5P6i776B57Ui5P+t5PAV6zwi77YH','W6CTqG','W6HpEHW','hSoSx8oMrgddV2/dRW','nZddOSogW6G','Dmk7W7pdK8kQDSoV','DJLAa8o2W7tdNb9RW5jC','W68jpCkIeCofW5a','WQ1VW5vIWOJcRIRcQ8ktWOajzaRcGCoK','wCkDymoHpW','W78nimkc','WQa8WQu2WQ0','WQq1xCk9WO3dUmouW4FdICocWQ45pdLGw
2023-07-27 16:14:01 +08:00
// prettier-ignore
2023-10-30 23:09:08 +08:00
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"])