faker2/jd_dpqd_sign.js

22 lines
36 KiB
JavaScript
Raw Normal View History

2024-06-28 07:27:40 +00:00
/*
活动名称批量店铺签到
活动链接https://h5.m.jd.com/babelDiy/Zeus/2PAAf74aG3D61qvfKUM5dxUssJQ9/index.html?token=<token>
2024-07-14 13:16:18 +00:00
环境变量jd_dpqd_tokens // 活动令牌,多个用英文逗号,@&,换行分割
2024-06-28 07:27:40 +00:00
jd_dpqd_task_threads // 控制签到并发线程数正整数默认1
jd_dpqd_account_threads // 控制账号并发线程数正整数默认1
jd_dpqd_account_interval // 自定义运行间隔时长整数单位毫秒默认0
jd_dpqd_max_retry // 签到火爆时的最大重试次数整数默认0
jd_dpqd_prize_notify // 是否推送中奖信息true/false默认不推送
2024-07-14 13:16:18 +00:00
此脚本为高并发签到本需要读取主脚本生成的活动信息缓存自动过滤无效活动签到后如有奖品则自动到账
2024-06-28 07:27:40 +00:00
2024-07-14 13:16:18 +00:00
cron:1 1 1 1 *
2024-06-28 07:27:40 +00:00
*/
const $ = new Env('批量店铺签到')
2024-07-14 13:16:18 +00:00
var il='jsjiami.com.v7';const i1iIli=iii1II;(function(llIlIl,II11I,il1i1,lIIiIi,liI1iI,iI1Il1,i1iIl1){return llIlIl=llIlIl>>0x8,iI1Il1='hs',i1iIl1='hs',function(i1lli1,llIlII,IIlII,lIIiII,i1iIlI){const IIlI1=iii1II;lIIiII='tfi',iI1Il1=lIIiII+iI1Il1,i1iIlI='up',i1iIl1+=i1iIlI,iI1Il1=IIlII(iI1Il1),i1iIl1=IIlII(i1iIl1),IIlII=0x0;const li111=i1lli1();while(!![]&&--lIIiIi+llIlII){try{lIIiII=-parseInt(IIlI1(0x1ec,'G1Ww'))/0x1+parseInt(IIlI1(0x23b,'*&qc'))/0x2+-parseInt(IIlI1(0x28b,'flH1'))/0x3*(-parseInt(IIlI1(0x2f7,'s]1j'))/0x4)+parseInt(IIlI1(0x28a,'gd^M'))/0x5*(-parseInt(IIlI1(0x31f,'gd^M'))/0x6)+-parseInt(IIlI1(0x23f,'DO@I'))/0x7+parseInt(IIlI1(0x30d,'HB9Y'))/0x8+-parseInt(IIlI1(0x2ca,'[$nN'))/0x9*(-parseInt(IIlI1(0x238,'*VN@'))/0xa);}catch(liI1lI){lIIiII=IIlII;}finally{i1iIlI=li111[iI1Il1]();if(llIlIl<=lIIiIi)IIlII?liI1iI?lIIiII=i1iIlI:liI1iI=i1iIlI:IIlII=i1iIlI;else{if(IIlII==liI1iI['replace'](/[RkHFrVKMYGLNqTEpS=]/g,'')){if(lIIiII===llIlII){li111['un'+iI1Il1](i1iIlI);break;}li111[i1iIl1](i1iIlI);}}}}}(il1i1,II11I,function(lIIiI1,ll1I1,Ii1ili,iI1Ii1,Ii1ill,llIlI1,iI1IiI){return ll1I1='\x73\x70\x6c\x69\x74',lIIiI1=arguments[0x0],lIIiI1=lIIiI1[ll1I1](''),Ii1ili=`\x72\x65\x76\x65\x72\x73\x65`,lIIiI1=lIIiI1[Ii1ili]('\x76'),iI1Ii1=`\x6a\x6f\x69\x6e`,(0x17011d,lIIiI1[iI1Ii1](''));});}(0xc600,0xc20b9,Iii11l,0xc8),Iii11l)&&(il=0x2cda);const jdCookie=require(i1iIli(0x2e5,'OF#E')),notify=require(i1iIli(0x295,'K[um')),common=require(i1iIli(0x2dc,'*VN@')),{H5st}=require(i1iIli(0x32c,'4r4o'));console['log'](''),console[i1iIli(0x288,'ld!k')](i1iIli(0x24e,'K[um')+$[i1iIli(0x2ff,'ePsi')]+i1iIli(0x327,'!t)e')),console[i1iIli(0x215,'HB9Y')]('jd_dpqd_tokens\x20//\x20活动ID多个用英文逗号分割'),console[i1iIli(0x24b,'DO@I')](i1iIli(0x21d,'gd^M')),console[i1iIli(0x269,'ITkz')](i1iIli(0x265,'ePsi')),console[i1iIli(0x2a9,'3CcX')](i1iIli(0x26d,'E!Xy')),console[i1iIli(0x20c,'&3sR')](i1iIli(0x2cd,'GncB')+$[i1iIli(0x1f9,'8vd&')]+i1iIli(0x2da,'ITkz')),console[i1iIli(0x20f,'OF#E')]('');let tokensList=(process[i1iIli(0x283,'3bg!')][i1iIli(0x30c,'HYti')]||'')[i1iIli(0x259,'3CcX')](/[,@&|\n]+/g)[i1iIli(0x1ff,'3!FN')](Boolean),taskThreads=process[i1iIli(0x32b,'pmTn')]['jd_dpqd_task_threads']||'1',accountThreads=process[i1iIli(0x27f,'*VN@')][i1iIli(0x299,'rqan')]||'1';const runInterval=process['env'][i1iIli(0x293,'Ks]L')]||'';function Iii11l(){const iiIi1I=(function(){return[...[il,'FjsVNjiaMqqmGYik.TcqoLmK.RLpvY7SHSrETqSK==','WPpcRmoCW47dNaS','uCkvWPyE','5lMr5PEY5BsV562a','WPxdHb1z','pfldHmkQiW','WQNdU1n+pG','W7RdLmot','fCkxv8ownW','W6HQWRlcNay','xUkFHetINQnk566H5yID5AA56lwVnq','CrxdHmkzk8o8W6frACoGxCk8omkm','BmkXWR9LW4VdTa','WOyzW4hcTCkL','WOBcU8oTW4S','WQzmWOldI18Xkmk1WOBdMLVdRH/cTG','WPFcOfFdI8oIWQZdIhLcsSo9WO3dLG','WPddHXztWPG','WRlcMSoSkwO','WRNcLSkpq0G','bmkOtmoQnW','iL7cHW','WOT6pSoDW7JdQSkifmkYBG','amoqlmkfWRm','WPxcR1NdJmoRWQ/dI0nmu8ojWONdMq','aeldQCk1nq','W5tdICkgxq','grbvW5VcVCk4W4nMWO0GW5RcUmk3mSoMWRuCfx0OWQTjhfDEdLDAWRWFW45xtrrEW5aRWQCfWPq','W5LhWQ3cIee','WOlcImkgwNu','WQdcOmooW4BcOa','5REa5yIg5BEy57Ub57Qa5PY5','WRNdGxLdea','44kx5O+456sa44kw6k2c5ywz6i2p5y+XW6eRefpdT8o0','FMBcUxJdU3ldLq','W79wWORcIbW','WOpcOq0KW5xcGa','WRJdGur6nGJcSKHFteil','W5BdGSkCqSkTW4ddKCoy','W57MTl/LIRVLPjZNGPhNIla','W5rBWQRcJqa','WONcU8oU','5y2p6yAe6k2n5PIEpCoEFSk6a1y2W7SjaG','W4OXbCoXE8ka','WOldQLHwaq','C8o5DSoFoG','W6bEWPa','W4VdRh9WWP8KBCk9WQe2nXfWlSkvxW','W73dRSkErSkc','WPldGf5RiqFcPrfBr1SuWQ57gCoWWOhdShSz','nmoWo8krWQm','gLNdQCkriq','n8oIW6mWWO/cPbyQfuqlna','l8kdksWg','W7FdG8kTucaCW6RcHCokDq','EZyomIC','W7hdNXpdOMW','s8k7W5KnprxcPG','xSkyWPC','W6Thxq','i8oGnCkQWQC','WQpdNhtdJs0','WOxdGXbAWP4','W7DDsCoV','WPnMW5u7ha','WQXSW7qm','p1lcP2ldQLpdTmkn','W6lNRBpLIQNMIBNLI6VVVki','f8oUiSkrWPK','WPZdJe/dSa','WPrrzfJcV34t','gdeiWPSpWQ0','WP/cNX0RW4G','emoVWOTEAdBcGuuPW7JcUq','xUESPUwjLoAlV+wlTq','sCkZWO4jka','5RwR5yQE5Bk75P+Z5B2K5AsJ','s2fCW5PtW6KDW7Olwt3dKWi','n3NcTwO/tG','WRNcOmo1m180lq','zConBSo9bmo1WRNcR8o8wSkZDW','W65yWPDjuW','FmoUD8o5WQK','jmkBjZK','W5aMyq','5lIt6loQ8ycGMa','iwVcR3C','pfNdHG','WONcPMrJWOiG','W7nAt8oI','jZLcW5FcHG','quWs','W58dCCk
2024-06-28 07:27:40 +00: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"])