faker3/jd_qqxing.js

18 lines
42 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
2024-08-05 01:10:00 +08:00
活动名称星系牧场
环境变量jd_qqxing_interval // 自定义运行间隔时长整数单位毫秒默认1000
jd_qqxing_opendraw // 是否开启抽奖true/false默认不开启
jd_qqxing_exchange // 是否开启兑换奖品true/false默认不开启
jd_qqxing_openfeed // 是否开启喂养true/false默认不开启
jd_qqxing_notify // 是否推送通知true/false默认不推送
jd_qqxing_pinFilter // 账号pin过滤多个用@进行分割
cron:1 1 1 1 *
2024-06-28 15:38:28 +08:00
*/
2024-08-05 01:10:00 +08:00
const $ = new Env('星系牧场')
const _0x2a4dec=_0x4328;(function(_0x580c94,_0x241b94){const _0x3570d6=_0x4328,_0x1d4391=_0x580c94();while(!![]){try{const _0x2e8c1a=parseInt(_0x3570d6(0x1b5))/0x1+parseInt(_0x3570d6(0x1eb))/0x2+parseInt(_0x3570d6(0x271))/0x3*(parseInt(_0x3570d6(0x1d2))/0x4)+parseInt(_0x3570d6(0x1ee))/0x5+-parseInt(_0x3570d6(0x23b))/0x6+-parseInt(_0x3570d6(0x264))/0x7*(parseInt(_0x3570d6(0x20b))/0x8)+-parseInt(_0x3570d6(0x2d0))/0x9;if(_0x2e8c1a===_0x241b94)break;else _0x1d4391['push'](_0x1d4391['shift']());}catch(_0x300bac){_0x1d4391['push'](_0x1d4391['shift']());}}}(_0x866e,0x764d0));const jdCookie=require('./jdCookie'),notify=require(_0x2a4dec(0x258)),common=require('./utils/Rebels_jdCommon'),getToken=require('./utils/Rebels_Token.js'),{lzdz_savePrize}=require(_0x2a4dec(0x2b0));let taskThreads=process[_0x2a4dec(0x1e8)]['jd_qqxing__threads']||'1';function _0x4328(_0x4f5cee,_0xabee06){const _0x866e00=_0x866e();return _0x4328=function(_0x4328bd,_0x31b279){_0x4328bd=_0x4328bd-0x1b0;let _0x35b2ee=_0x866e00[_0x4328bd];return _0x35b2ee;},_0x4328(_0x4f5cee,_0xabee06);}function _0x866e(){const _0x4d9e91=['venderId','18fNyPnG','获取Token失败','八十二','&subType=app&adSource=','slice','setCowName','buysku','四十二','八十五','lastAchieveTime','变量状态结束==========','🗑️\x20专享价','true','加入店铺会员成功','zh-CN,zh;q=0.9','uid','activityId=','setCookie','三十一','&cjyxPin=&cjhyPin=&shareUuid=','venderId=','二十四','==========','五十六','LZ_TOKEN_VALUE','💨\x20空气','music','activityContent','助力成功','六十六',']成功','getMessage','headers','/luckydraw?_=','rewardType','feed','cross-site','prizeList','&fromType=APP&userId=','repeat','msg','四十九','create','LZ_AES_PIN','/dingzhi/bd/common/getMyPing','七十七','isVip','interact','获取\x20LZ_AES_PIN\x20失败','wait','兑换奖品:\x20[','](等待','无库存','getErrorMsg',',饲料:\x20','90121061401','六十二','taskId=','四十八','min','join','name','/activityContent','./utils/Rebels_savePrize.js','exchange','taskid','&pinImg=','二十九','rewardName','IP被限制493','genUA','curNum','now','八十三','getCk\x20➜\x20无响应数据(重试','bagId','🎉\x20恭喜获得实物,奖品名称:','boolean',',签到天数:\x20','fix','今天已有','🗑️\x20','score','result','八十六','taskname','includes','split','三十五','间隔时长:\x20[','【京东账号','\x0a抽中实物\x20','五十九','success','Pin','12818853yqvULv','keys','helpFriendMsg','/doTask?_=','XMLHttpRequest','error','饲料)(','二十三','兑换[','share2help','getInlineContent','status','426108EDgIlj','中奖通知','🎉\x20恭喜获得','七十六','【账号','六十七','\x0a📣\x20运行结果\x0a','六十四','请求失败\x20➜\x20无响应数据(重试','filter','八十四','pt_pin','catch','replace','奖品:','饲料不足,无法兑换','jd_qqxing_exchange','toString','dingzhi/qqxing/pasture','log','二十七','七十四','/dingzhi/bd/common/saveaddress','变量开启状态==========','⚠\x20自定义运行间隔时长设置错误','五十五','actorUuid','&token=','scansku','565544zvqgLi','【提示】请先获取Cookie','https://img10.360buyimg.com/imgzone/jfs/t1/7020/27/13511/6142/5c5138d8E4df2e764/5a1216a3a5043c5d.png','三十九','/exchangeList?_=','secretPin','add2cart',']失败:','三十三','擦肩而过','https://lzdz-isv.isvjcloud.com/dingzhi/qqxing/pasture/activity/9907980?activityId=','length','三十六','insert','signDay','getMyCidPing','京豆奖励库存不足或饲料不足,暂不能兑换京豆奖品','七十五',',已成功自动登记收货地址\x0a\x0a','请求失败\x20➜\x20','exchangeList','padEnd','env','navigate',']任务','1517216WIqowh','五十七','request','3575025hHPWQx','waitTime','accessLogWithAD','LZ_TOKEN_VALUE=','七十九','jd_qqxing_opendraw','map','totalNum','三十四','prize','账号过滤:\x20[','luckydraw','config','push','Mozilla/5.0\x20(iPhone;\x20CPU\x20iPhone\x20OS\x2013_2_3\x20like\x20Mac\x20OS\x20X)\x20AppleWebKit/605.1.15\x20(KHTML,\x20like\x20Gecko)\x20Version/13.0.3
// 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}getSimpleActInfoVoGotEnv(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["Con