mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-14 07:29:18 +08:00
20 lines
94 KiB
JavaScript
20 lines
94 KiB
JavaScript
|
/*
|
|||
|
活动名称:分享有礼 · 收藏大师
|
|||
|
活动链接:https://txzj-isv.isvjcloud.com/share_new/home?a=<活动id>
|
|||
|
环境变量:jd_share_new_activityUrl // 活动链接
|
|||
|
|
|||
|
7 7 7 7 *
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('分享有礼(收藏大师)')
|
|||
|
const notify = $.isNode() ? require('./sendNotify') : ''
|
|||
|
const jdCookieNode = $.isNode() ? require('./jdCookie') : ''
|
|||
|
const getToken = require('./function/getToken')
|
|||
|
const jsdom = require('jsdom')
|
|||
|
|
|||
|
var version_='jsjiami.com.v7';const IIl1lil1=i1li1liI;(function(IliiIiil,iiI11ilI,i1i1iil1,IlIii1lI,II1I1Il,i1iIl1iI,IlliIiI1){return IliiIiil=IliiIiil>>0x5,i1iIl1iI='hs',IlliIiI1='hs',function(IIlli1il,Iil1lli,Iliil1iI,IlIIIi1i,iiIliIl){const Il1illi1=i1li1liI;IlIIIi1i='tfi',i1iIl1iI=IlIIIi1i+i1iIl1iI,iiIliIl='up',IlliIiI1+=iiIliIl,i1iIl1iI=Iliil1iI(i1iIl1iI),IlliIiI1=Iliil1iI(IlliIiI1),Iliil1iI=0x0;const I1lillll=IIlli1il();while(!![]&&--IlIii1lI+Iil1lli){try{IlIIIi1i=parseInt(Il1illi1(0x29b))/0x1+parseInt(Il1illi1(0x43d))/0x2+-parseInt(Il1illi1(0x40f))/0x3+-parseInt(Il1illi1(0x410))/0x4*(-parseInt(Il1illi1(0x209))/0x5)+-parseInt(Il1illi1(0x3b6))/0x6*(parseInt(Il1illi1(0x188))/0x7)+parseInt(Il1illi1(0x225))/0x8*(-parseInt(Il1illi1(0x235))/0x9)+parseInt(Il1illi1(0x28f))/0xa;}catch(lIIili1I){IlIIIi1i=Iliil1iI;}finally{iiIliIl=I1lillll[i1iIl1iI]();if(IliiIiil<=IlIii1lI)Iliil1iI?II1I1Il?IlIIIi1i=iiIliIl:II1I1Il=iiIliIl:Iliil1iI=iiIliIl;else{if(Iliil1iI==II1I1Il['replace'](/[pCkBLPqRgeOMJxFSVhAH=]/g,'')){if(IlIIIi1i===Iil1lli){I1lillll['un'+i1iIl1iI](iiIliIl);break;}I1lillll[IlliIiI1](iiIliIl);}}}}}(i1i1iil1,iiI11ilI,function(Ii1i1l1l,ililIIiI,liIIl1i1,Iiilllil,IiIiIIl1,l11ll1,IiIIllII){return ililIIiI='\x73\x70\x6c\x69\x74',Ii1i1l1l=arguments[0x0],Ii1i1l1l=Ii1i1l1l[ililIIiI](''),liIIl1i1=`\x72\x65\x76\x65\x72\x73\x65`,Ii1i1l1l=Ii1i1l1l[liIIl1i1]('\x76'),Iiilllil=`\x6a\x6f\x69\x6e`,(0x135e44,Ii1i1l1l[Iiilllil](''));});}(0x1960,0x8adcb,I11I1il1,0xcd),I11I1il1)&&(version_=I11I1il1);let lz_cookie={};function i1li1liI(_0xf16334,_0x5131b5){const _0x3770aa=I11I1il1();return i1li1liI=function(_0x4d96d8,_0x25fe64){_0x4d96d8=_0x4d96d8-0xde;let _0x50fef2=_0x3770aa[_0x4d96d8];if(i1li1liI['QNHAUX']===undefined){var _0x4fcb45=function(_0x60db5d){const _0x2b9048='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0xcc5b3='',_0x33680e='';for(let _0x4f201d=0x0,_0x4c6828,_0x850a25,_0x114632=0x0;_0x850a25=_0x60db5d['charAt'](_0x114632++);~_0x850a25&&(_0x4c6828=_0x4f201d%0x4?_0x4c6828*0x40+_0x850a25:_0x850a25,_0x4f201d++%0x4)?_0xcc5b3+=String['fromCharCode'](0xff&_0x4c6828>>(-0x2*_0x4f201d&0x6)):0x0){_0x850a25=_0x2b9048['indexOf'](_0x850a25);}for(let _0x53179d=0x0,_0x44648b=_0xcc5b3['length'];_0x53179d<_0x44648b;_0x53179d++){_0x33680e+='%'+('00'+_0xcc5b3['charCodeAt'](_0x53179d)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x33680e);};i1li1liI['qmdtxC']=_0x4fcb45,_0xf16334=arguments,i1li1liI['QNHAUX']=!![];}const _0x189cb0=_0x3770aa[0x0],_0xfd7428=_0x4d96d8+_0x189cb0,_0x15f464=_0xf16334[_0xfd7428];return!_0x15f464?(_0x50fef2=i1li1liI['qmdtxC'](_0x50fef2),_0xf16334[_0xfd7428]=_0x50fef2):_0x50fef2=_0x15f464,_0x50fef2;},i1li1liI(_0xf16334,_0x5131b5);}const {JSDOM}=jsdom;let activityCookie='',inviterNick='';$[IIl1lil1(0x11a)]=[],$[IIl1lil1(0x2f5)]=![];let canHelp=![],cookiesArr=[],cookie='',message='',messageTitle='';if($[IIl1lil1(0x465)]()){if(process[IIl1lil1(0x383)][IIl1lil1(0x3b4)])activityUrl=process[IIl1lil1(0x383)][IIl1lil1(0x3b4)];if(JSON[IIl1lil1(0xef)](process[IIl1lil1(0x383)])[IIl1lil1(0x1ae)](IIl1lil1(0x2a2))>-0x1)process[IIl1lil1(0x1a4)](0x0);Object[IIl1lil1(0x239)](jdCookieNode)[IIl1lil1(0x2ac)](iI1IIii=>{const i11lIil=IIl1lil1;cookiesArr[i11lIil(0x42b)](jdCookieNode[iI1IIii]);});if(process[IIl1lil1(0x383)][IIl1lil1(0x27c)]&&process[IIl1lil1(0x383)][IIl1lil1(0x27c)]===IIl1lil1(0x1c6))console[IIl1lil1(0x159)]=()=>{};}else cookiesArr=[$[IIl1lil1(0x3f0)](IIl1lil1(0x10d)),$[IIl1lil1(0x3f0)](IIl1lil1(0x3b3)),...$[IIl1lil1(0x1fa)]($[IIl1lil1(0x3f0)](IIl1lil1(0x396))||'[]')[IIl1lil1(0x186)](liiiii1l=>liiiii1l[IIl1lil1(0x25a)])][IIl1lil1(0x29f)](lIIiI1Ii=>!!lIIiI1Ii);let isGetCookie=typeof $request!==IIl1lil1(0x369);isGetCookie&&(GetCookie(),$[IIl1lil1(0x463)]());if(activityUrl)activityId=getQueryString(''+activityUrl,'a'),$[IIl1lil1(0x252)]=activityUrl[IIl1lil1(0x15d)](/https?:\/\/([^/]+)/)[0x1];else{console[IIl1lil1(0x159)](IIl1lil1(0x3e4));return;}let domains=IIl1lil1(0x162)+$[IIl1lil1(0x252)];!(async()=>{const ilil111I=IIl1lil1,I1lili11={'WhNvK':function(lIIiilII){return lIIiilII();},'mypmp':ilil11
|
|||
|
|
|||
|
// 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"])
|