diff --git a/shangtuo.jpg b/bak/shangtuo.jpg similarity index 100% rename from shangtuo.jpg rename to bak/shangtuo.jpg diff --git a/shangtuo.js b/bak/shangtuo.js similarity index 96% rename from shangtuo.js rename to bak/shangtuo.js index 41664f4..e19ed6a 100644 --- a/shangtuo.js +++ b/bak/shangtuo.js @@ -3,13 +3,13 @@ 下载地址: 复制链接后,在微信里打开: -https://shatuvip.com/pages/login/register?recom_code=5290130 +https://shatuvip.com/pages/login/register?recom_code=7755074 或微信扫描二维码下载 https://raw.githubusercontent.com/leafxcy/JavaScript/main/shangtuo.jpg -推荐码: 5290130 -抢券时段为7:00到23:59,建议在8点后跑脚本,7点有可能会卡 +推荐码: 7755074 +抢券时段为7:00到23:59,建议在9点后跑脚本,7点有可能会卡 玩法:进APP后,先手动去全球分红->提取分红金,然后在个人中心->分红余额->提现一次0.03元(需要上传支付宝和微信收款码),就可以跑脚本了 脚本会自动看广告得分红金,抢券,提现 @@ -19,6 +19,9 @@ https://raw.githubusercontent.com/leafxcy/JavaScript/main/shangtuo.jpg 脚本默认红包余额满0.5自动提现,可以自己新建一个环境变量 stCash 设定红包余额提现金额,export stCash=20 !!!但是不建议提现20块以下,因为手续费高,只有0.5手续费低!!! +脚本会自动把红包余额转换为消费余额来抢更高面额的券,如果不想换的自己建一个环境变量 stExchange 设为0,export stExchange=0 +青龙环境下会有推送,不想要推送的建一个环境变量 stNotify 设为0,export stNotify=0 + CK有效期较短,可能几天后需要重新捉 只测试了IOS,测试过V2P,青龙可以跑 @@ -56,6 +59,8 @@ let userNum = 0 let userInfo = "" var packWithdrawAmount = ($.isNode() ? (process.env.stCash) : ($.getval('stCash'))) || 0.5; +var autoExchange = ($.isNode() ? (process.env.stExchange) : ($.getval('stExchange'))) || 1; +var nodeNotify = ($.isNode() ? (process.env.stNotify) : ($.getval('stNotify'))) || 1; let secretCode @@ -65,6 +70,9 @@ let grabCount let getBondListFlag let quanList +let retryLimit = 5 +let retryTime + let logDebug = 0 let logCaller = 0 @@ -95,8 +103,12 @@ const notify = $.isNode() ? require('./sendNotify') : ''; if(accountStatus) { //看广告得分红金 + retryTime = 0 + compTaskFlag = 1 await getAdvertPage(1); await $.wait(1000); + await getAdvertPage(2); + await $.wait(1000); //提取分红金 await changeDividendBonusToBalance(); @@ -146,7 +158,7 @@ const notify = $.isNode() ? require('./sendNotify') : ''; } $.msg(userInfo) - if($.isNode()) await notify.sendNotify($.name, userInfo) + if(nodeNotify == 1 && $.isNode()) await notify.sendNotify($.name, userInfo) } } @@ -292,6 +304,7 @@ function getUserInfoData(checkStatus,timeout = 0) { //广告列表id function getAdvertPage(pageNo,timeout = 0) { if(logCaller) console.log("call "+ printCaller()) + retryTime++ return new Promise((resolve) => { let request = { url: `https://api.shatuvip.com/advert/getAdvertPage?type=1&pageNo=${pageNo}&column_id=1`, @@ -314,6 +327,9 @@ function getAdvertPage(pageNo,timeout = 0) { if (err) { console.log("API请求失败"); console.log(err + " at function " + printCaller()); + if(retryTime < retryLimit) { + await getAdvertPage(pageNo) + } } else { if (safeGet(data)) { let result = JSON.parse(data) @@ -321,9 +337,7 @@ function getAdvertPage(pageNo,timeout = 0) { if (result.code == 0) { console.log(`获取分红金广告任务列表成功`) adNum = result.result.length - compTaskFlag = 1 for(let i=0; i= 88) { console.log(`\n分红金余额:${result.result.balance},开始尝试提现`) + retryTime = 0 await getBalanceWithdrawalData(0,result.result.balance) } else { console.log(`\n分红金余额:${result.result.balance},不执行提现`) @@ -1096,6 +1111,7 @@ function getPopularizeBalance(timeout = 0) { await $.wait(1000); if(result.result.balance >= 1) { console.log(`\n推广余额:${result.result.balance},开始尝试提现`) + retryTime = 0 await getBalanceWithdrawalData(2,result.result.balance) } else { console.log(`\n推广余额:${result.result.balance},不执行提现`) @@ -1147,12 +1163,20 @@ function getPackBalance(move,timeout = 0) { if(result.code == 0) { await $.wait(1000); if(move == 0) { - if(result.result.balance > 0) { - console.log(``) - await balancePackChangeBalance(result.result.balance) + if(autoExchange >0) { + console.log(`\n您当前设置为自动转换消费余额,当前红包余额${result.result.balance}`) + if(result.result.balance > 0.5) { + let exchangeAmount = Math.floor((result.result.balance-0.5)*100) / 100 + await balancePackChangeBalance(exchangeAmount) + } else { + console.log(`\n红包余额${result.result.balance},少于0.5,不转换消费余额`) + } + } else { + console.log(`\n您当前设置为不转换消费余额`) } } else { if(result.result.balance >= packWithdrawAmount) { + retryTime = 0 console.log(`\n红包余额${result.result.balance},尝试为你提现${packWithdrawAmount}`) await getBalanceWithdrawalData(1,result.result.balance,packWithdrawAmount) } else { @@ -1341,6 +1365,7 @@ function queryWithdrawId(id,balance,timeout = 0) { //提现 function balanceWithdrawal(id,withdrawMoney,timeout = 0) { if(logCaller) console.log("call "+ printCaller()) + retryTime++ return new Promise((resolve, reject) => { let request = { url: `https://api.shatuvip.com/withdrawal/balanceWithdrawal`, @@ -1364,6 +1389,9 @@ function balanceWithdrawal(id,withdrawMoney,timeout = 0) { if (err) { console.log("API请求失败"); console.log(err + " at function " + printCaller()); + if(retryTime < retryLimit) { + await balanceWithdrawal(id,withdrawMoney) + } } else { if (safeGet(data)) { await $.wait(1000); diff --git a/blackUnique.jpg b/blackUnique.jpg new file mode 100644 index 0000000..cb29696 Binary files /dev/null and b/blackUnique.jpg differ diff --git a/blackUnique.js b/blackUnique.js new file mode 100644 index 0000000..54e0e08 --- /dev/null +++ b/blackUnique.js @@ -0,0 +1,1652 @@ +/* +APP:全球购骑士特权 + +直接appstore搜索下载,方便的话可以微信扫下面图片二维码走邀请注册,谢谢 +https://raw.githubusercontent.com/leafxcy/JavaScript/main/blackUnique.jpg + +定时为每小时一次,务必在0分到5分之间运行,目前每天大概1毛7 +提现需要关注微信公众号,在公众号里申请提现 +请手动点一下签到页面的【收零花钱】领一次金币,去【果园】里选择水果种子 + +青龙: +捉https://market.chuxingyouhui.com/promo-bargain-api/activity/mqq/api/indexTopInfo的包 +然后填在blackJSON里面,注意按照JSON格式填写。用青龙面板的环境变量或者外面用双引号的,字符串内需要用\"转义 +export blackJSON='{"black-token":"", "token":"", "User-Agent":"", "appId":""}' + +V2P,圈X:重写方法 -- 点击右下角【我的】-> 【每日签到赚现金】 +[task_local] +#全球购骑士特权 +0 * * * * https://raw.githubusercontent.com/leafxcy/JavaScript/main/blackUnique.js, tag=全球购骑士特权, enabled=true +[rewrite_local] +https://market.chuxingyouhui.com/promo-bargain-api/activity/mqq/api/indexTopInfo? url script-request-header https://raw.githubusercontent.com/leafxcy/JavaScript/main/blackUnique.js +[MITM] +hostname = market.chuxingyouhui.com + +*/ + +const jsname = '全球购骑士特权' +const $ = Env(jsname) +const notifyFlag = 1; //0为关闭通知,1为打开通知,默认为1 +const logDebug = 0 + +//const notify = $.isNode() ? require('./sendNotify') : ''; +let notifyStr = '' + +let blackJSON = ($.isNode() ? (process.env.blackJSON) : ($.getval('blackJSON'))) || '' +let blackArr = [] + +let userIdx = 0 +let reqTime = '' +let userSign = '' +let redPacketId = '' +let fruitId = '' +let userFruitId = '' +let activityId = '' +let redPacketCount = 0 +let waterCount = 0 +let fertilizerCount = 0 +let clickTreeTimes = 1 +let signRetryTimes = 3 +let signRetryCount = 0 + +var todayDate = formatDateTime(new Date()); +let bussinessInfo = '{}' + +let rndtime = "" //毫秒 + +/////////////////////////////////////////////////////////////////// + +!(async () => { + + if(typeof $request !== "undefined") + { + await getRewrite() + } + else + { + //检查环境变量 + if(!(await checkEnv())){ + return + } + + console.log('\n提现需要关注微信公众号,在公众号里申请提现') + + for(userIdx=0; userIdx $.logErr(e)) +.finally(() => $.done()) + +//通知 +async function showmsg() { + + notifyBody = jsname + "运行通知\n\n" + notifyStr + + if (notifyFlag != 1) { + console.log(notifyBody); + } + + if (notifyFlag == 1) { + $.msg(notifyBody); + //if ($.isNode()){await notify.sendNotify($.name, notifyBody );} + } +} + +async function getRewrite() +{ + if($request.url.indexOf("mqq/api/indexTopInfo?appId=") > -1) { + let blackCk = {"black-token":"", "token":"", "User-Agent":"", "appId":""} + let msgStr = '' + + let matchItem = $request.url.match(/appId=([\w]+)/) + blackCk['appId'] = matchItem[1] + msgStr += `获取到appId: ${blackCk['appId']}\n` + + blackCk['black-token'] = $request.headers['black-token'] + msgStr += `获取到black-token: ${blackCk['black-token']}\n` + + blackCk['token'] = $request.headers['token'] + msgStr += `获取到token: ${blackCk['token']}\n` + + blackCk['User-Agent'] = $request.headers['User-Agent'] + msgStr += `获取到User-Agent: ${blackCk['User-Agent']}\n` + + if(blackCk['black-token']) { + if(blackJSON) { + if(blackJSON.indexOf(blackCk['black-token']) == -1) { + blackJSON = blackJSON + '@' + JSON.stringify(blackCk) + numUser = blackJSON.split('@') + msgStr = `获取到第${numUser.length}个账户ck\n` + msgStr + $.setdata(blackJSON,'blackJSON') + $.msg(msgStr) + } else { + $.log('检测到重复的账户ck') + } + } else { + msgStr = `获取到第一个账户ck\n` + msgStr + $.setdata(JSON.stringify(blackCk),'blackJSON') + $.msg(msgStr) + } + } + } +} + +async function checkEnv() +{ + if(blackJSON) { + for(let users of blackJSON.split('@')) { + blackArr.push(JSON.parse(users)) + } + } else { + console.log('未找到blackJSON') + return false + } + + if(blackArr.length == 0) { + console.log('未找到有效的blackJSON') + return false + } + + console.log(`共找到${blackArr.length}个用户`) + return true +} + +//========================================================================== +//获取视频信息 +async function getBussinessInfo(adId,activityType,bussinessType,version) { + let caller = printCaller() + //rndtime = Math.round(new Date().getTime()) + reqBody = `{"adId":"${adId}","activityType":${activityType},"bussinessType":"${bussinessType}","version":"${version}"}` + encodeBody = encodeURIComponent(reqBody) + return new Promise((resolve) => { + let url = { + url: 'https://market.chuxingyouhui.com/promo-bargain-api/video/api/v1_0/getBussinessInfo', + headers: { + 'Host' : 'market.chuxingyouhui.com', + 'request-body' : encodeBody, + 'Accept' : 'application/json, text/plain, */*', + 'Accept-Language' : 'zh-CN,zh-Hans;q=0.9', + 'Accept-Encoding' : 'gzip, deflate, br', + 'token' : blackArr[userIdx]['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackArr[userIdx]['User-Agent'], + 'black-token' : blackArr[userIdx]['black-token'], + 'Referer' : 'https://m.black-unique.com/', + 'Connection' : 'keep-alive', + }, + body: reqBody + }; + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log("Fucntion " + caller + ": API请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + let result = JSON.parse(data); + if(logDebug) console.log(result); + if(result.code == 200) { + bussinessInfo = result.data ? JSON.stringify(result.data) : '{}' + } else { + console.log(`获取视频信息失败:${result.msg}`) + } + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +//获取签到状态 +async function querySignStatus() { + let caller = printCaller() + //rndtime = Math.round(new Date().getTime()) + return new Promise((resolve) => { + let url = { + url: 'https://market.chuxingyouhui.com/promo-bargain-api/activity/weekSign/api/v1_0/calendar?appId='+blackArr[userIdx]['appId'], + headers: { + 'Host' : 'market.chuxingyouhui.com', + 'Origin' : 'https://m.black-unique.com', + 'Accept-Encoding' : 'gzip, deflate, br', + 'Connection' : 'keep-alive', + 'black-token' : blackArr[userIdx]['black-token'], + 'Accept' : 'application/json, text/plain, */*', + 'User-Agent' : blackArr[userIdx]['User-Agent'], + 'Referer' : 'https://m.black-unique.com/', + 'token' : blackArr[userIdx]['token'], + 'Accept-Language' : 'zh-CN,zh-Hans;q=0.9', + }, + }; + $.get(url, async (err, resp, data) => { + try { + if (err) { + console.log("Fucntion " + caller + ": API请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + let result = JSON.parse(data); + if(logDebug) console.log(result); + if(result.code == 200) { + if(result.data && result.data.calendar && Array.isArray(result.data.calendar)) { + for(let i=0; i< result.data.calendar.length; i++) { + let signItem = result.data.calendar[i] + if(signItem.isToday == true) { + if(signItem.signStyle == 0) { + await doSign() + } else { + console.log(`\n今日已签到\n`) + } + } + } + } + } else { + console.log(`\n获取签到状态失败:${result.msg}\n`) + } + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +//签到 +async function doSign() { + let caller = printCaller() + //rndtime = Math.round(new Date().getTime()) + reqBody = `{}` + encodeBody = encodeURIComponent(reqBody) + return new Promise((resolve) => { + let url = { + url: 'https://market.chuxingyouhui.com/promo-bargain-api/activity/weekSign/api/v1_0/sign?appId='+blackArr[userIdx]['appId'], + headers: { + 'Host' : 'market.chuxingyouhui.com', + 'request-body' : encodeBody, + 'Accept' : 'application/json, text/plain, */*', + 'Accept-Language' : 'zh-CN,zh-Hans;q=0.9', + 'Accept-Encoding' : 'gzip, deflate, br', + 'token' : blackArr[userIdx]['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackArr[userIdx]['User-Agent'], + 'black-token' : blackArr[userIdx]['black-token'], + 'Referer' : 'https://m.black-unique.com/', + 'Connection' : 'keep-alive', + }, + body: reqBody + }; + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log("Fucntion " + caller + ": API请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + let result = JSON.parse(data); + if(logDebug) console.log(result); + if(result.code == 200) { + console.log(`\n签到成功获得:${result.data.reward}金币,已连续签到${result.data.continuouslyDay}天\n`) + } else { + console.log(`\n签到失败:${result.msg}\n`) + } + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +//日常-任务列表 +async function listUserTask() { + let caller = printCaller() + rndtime = Math.round(new Date().getTime()) + reqBody = `{"activityType":13}` + encodeBody = encodeURIComponent(reqBody) + return new Promise((resolve) => { + let url = { + url: 'https://market.chuxingyouhui.com/promo-bargain-api/activity/task/api/list_user_task', + headers: { + 'Host' : 'market.chuxingyouhui.com', + 'request-body' : encodeBody, + 'Accept' : 'application/json, text/plain, */*', + 'Accept-Language' : 'zh-CN,zh-Hans;q=0.9', + 'Accept-Encoding' : 'gzip, deflate, br', + 'token' : blackArr[userIdx]['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackArr[userIdx]['User-Agent'], + 'black-token' : blackArr[userIdx]['black-token'], + 'Referer' : 'https://m.black-unique.com/', + 'Connection' : 'keep-alive', + }, + body: reqBody + }; + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log("Fucntion " + caller + ": API请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + let result = JSON.parse(data); + if(logDebug) console.log(result); + if(result.code == 200) { + if(result.data && Array.isArray(result.data)) { + for(let i=0; i -1 && (rndtime < taskItem.receiveStartTime || rndtime > taskItem.receiveEndTime)) { + //非整点领勋章时间 + continue + } else if(taskItem.taskType.indexOf('SHOPPING') > -1) { + //跳过购物任务 + continue + } + await $.wait(1000) + await doTask(taskItem.taskType,taskItem.userTaskId,taskItem.taskTitle) + } + + } + } + } else { + console.log(`查询任务列表失败:${result.msg}`) + } + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +//日常-完成任务 +async function doTask(taskType,userTaskId,taskTitle) { + let caller = printCaller() + //rndtime = Math.round(new Date().getTime()) + reqBody = `{"activityType":13,"taskType":"${taskType}","userTaskId":"${userTaskId}"}` + encodeBody = encodeURIComponent(reqBody) + return new Promise((resolve) => { + let url = { + url: 'https://market.chuxingyouhui.com/promo-bargain-api/activity/task/api/doTask', + headers: { + 'Host' : 'market.chuxingyouhui.com', + 'request-body' : encodeBody, + 'Accept' : 'application/json, text/plain, */*', + 'Accept-Language' : 'zh-CN,zh-Hans;q=0.9', + 'Accept-Encoding' : 'gzip, deflate, br', + 'token' : blackArr[userIdx]['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackArr[userIdx]['User-Agent'], + 'black-token' : blackArr[userIdx]['black-token'], + 'Referer' : 'https://m.black-unique.com/', + 'Connection' : 'keep-alive', + }, + body: reqBody + }; + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log("Fucntion " + caller + ": API请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + let result = JSON.parse(data); + if(logDebug) console.log(result); + if(result.code == 200) { + console.log(`完成任务【${result.data.taskTitle}】:获得${result.data.rewardScore}勋章`) + } else { + console.log(`完成任务【${taskTitle}】失败:${result.msg}`) + } + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +//存钱罐状态 +async function queryPiggyInfo() { + let caller = printCaller() + //rndtime = Math.round(new Date().getTime()) + return new Promise((resolve) => { + let url = { + url: 'https://market.chuxingyouhui.com/promo-bargain-api/activity/golden/api/queryUserAccountInfo?appId='+blackArr[userIdx]['appId'], + headers: { + 'Host' : 'market.chuxingyouhui.com', + 'Origin' : 'https://m.black-unique.com', + 'Accept-Encoding' : 'gzip, deflate, br', + 'Connection' : 'keep-alive', + 'black-token' : blackArr[userIdx]['black-token'], + 'Accept' : 'application/json, text/plain, */*', + 'User-Agent' : blackArr[userIdx]['User-Agent'], + 'Referer' : 'https://m.black-unique.com/', + 'token' : blackArr[userIdx]['token'], + 'Accept-Language' : 'zh-CN,zh-Hans;q=0.9', + }, + }; + $.get(url, async (err, resp, data) => { + try { + if (err) { + console.log("Fucntion " + caller + ": API请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + let result = JSON.parse(data); + if(logDebug) console.log(result); + if(result.code == 200) { + if(parseFloat(result.data.goldenAmount) < parseFloat(result.data.dayCeil)) { + if(parseFloat(result.data.piggyAmount) >= 1) { + await getBussinessInfo(946088114,7,'GOLDEN_CLICK','v3') + await clickPiggy() + } + } else { + console.log(`\n存钱罐提取已达到当天上限:${result.data.dayCeil}\n`) + } + } else { + console.log(`\n查询存钱罐状态失败:${result.msg}\n`) + } + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +//提取存钱罐金币 +async function clickPiggy() { + let caller = printCaller() + //rndtime = Math.round(new Date().getTime()) + reqBody = `{"appId":"${blackArr[userIdx]['appId']}","extraReq":${bussinessInfo}}` + encodeBody = encodeURIComponent(reqBody) + return new Promise((resolve) => { + let url = { + url: 'https://market.chuxingyouhui.com/promo-bargain-api/activity/golden/api/v1_0/click', + headers: { + 'Host' : 'market.chuxingyouhui.com', + 'request-body' : encodeBody, + 'Accept' : 'application/json, text/plain, */*', + 'Accept-Language' : 'zh-CN,zh-Hans;q=0.9', + 'Accept-Encoding' : 'gzip, deflate, br', + 'token' : blackArr[userIdx]['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackArr[userIdx]['User-Agent'], + 'black-token' : blackArr[userIdx]['black-token'], + 'Referer' : 'https://m.black-unique.com/', + 'Connection' : 'keep-alive', + }, + body: reqBody + }; + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log("Fucntion " + caller + ": API请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + let result = JSON.parse(data); + if(logDebug) console.log(result); + if(result.code == 200) { + console.log(`\n提取存钱罐金币成功,金币余额${result.data.goldenAmount}\n`) + } else { + console.log(`\n提取存钱罐金币失败:${result.msg}\n`) + } + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +//查询翻牌领提现额度 +async function getUserFlopRecord() { + let caller = printCaller() + //rndtime = Math.round(new Date().getTime()) + reqBody = `{"appId":"${blackArr[userIdx]['appId']}","queryDay":"${todayDate}"}` + encodeBody = encodeURIComponent(reqBody) + return new Promise((resolve) => { + let url = { + url: 'https://market.chuxingyouhui.com/promo-bargain-api/activity/flop/api/getUserFlopRecord', + headers: { + 'Host' : 'market.chuxingyouhui.com', + 'request-body' : encodeBody, + 'Accept' : 'application/json, text/plain, */*', + 'Accept-Language' : 'zh-CN,zh-Hans;q=0.9', + 'Accept-Encoding' : 'gzip, deflate, br', + 'token' : blackArr[userIdx]['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackArr[userIdx]['User-Agent'], + 'black-token' : blackArr[userIdx]['black-token'], + 'Referer' : 'https://m.black-unique.com/', + 'Connection' : 'keep-alive', + }, + body: reqBody + }; + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log("Fucntion " + caller + ": API请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + let result = JSON.parse(data); + if(logDebug) console.log(result); + if(result.code == 200) { + if(result.data && result.data.recordList && Array.isArray(result.data.recordList)) { + for (let i=0; i { + let url = { + url: 'https://market.chuxingyouhui.com/promo-bargain-api/activity/flop/api/flop', + headers: { + 'Host' : 'market.chuxingyouhui.com', + 'request-body' : encodeBody, + 'Accept' : 'application/json, text/plain, */*', + 'Accept-Language' : 'zh-CN,zh-Hans;q=0.9', + 'Accept-Encoding' : 'gzip, deflate, br', + 'token' : blackArr[userIdx]['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackArr[userIdx]['User-Agent'], + 'black-token' : blackArr[userIdx]['black-token'], + 'Referer' : 'https://m.black-unique.com/', + 'Connection' : 'keep-alive', + }, + body: reqBody + }; + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log("Fucntion " + caller + ": API请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + let result = JSON.parse(data); + if(logDebug) console.log(result); + if(result.code == 200) { + console.log(`翻牌获得提现额度:${result.data.amount}元`) + } else { + console.log(`翻牌获得提现额度失败:${result.msg}`) + } + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +//定点红包列表 +async function listRedPacket() { + let caller = printCaller() + //rndtime = Math.round(new Date().getTime()) + curTime = new Date() + currentHour = curTime.getHours() + let isGetRedTime = ((currentHour < 23) && (currentHour > 6)) ? 1 : 0 + return new Promise((resolve) => { + let url = { + url: 'https://fanxian-api.chuxingyouhui.com/api/redPacketIncome/v1_0/listRedPacket', + headers: { + 'Host' : 'fanxian-api.chuxingyouhui.com', + 'Accept-Language' : 'zh-CN,zh-Hans;q=0.9', + 'newcomer' : 'true', + 'Accept-Encoding' : 'gzip, deflate, br', + 'token' : blackArr[userIdx]['token'], + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackArr[userIdx]['User-Agent'], + 'Referer' : 'https://m.black-unique.com/', + 'Content-Length' : '0', + 'Connection' : 'keep-alive', + 'Accept' : 'application/json, text/plain, */*', + }, + }; + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log("Fucntion " + caller + ": API请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + let result = JSON.parse(data); + if(logDebug) console.log(result); + if(result.code == 200) { + if(isGetRedTime == 1 && result.data && result.data.redPacketList && Array.isArray(result.data.redPacketList)) { + redPacketCount = 0 + for(let i=0; i 0) { + redPacketCount++ + } + if(redItem.status == 2 && redItem.money == 0 && redPacketCount < 7) { + signRetryCount = 0 + await getSignInfo('open') + await $.wait(500) + await openRedPacket() + } + } + } + } else { + console.log(`查询红包列表失败:${result.msg}`) + } + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +//开定点红包 +async function openRedPacket() { + let caller = printCaller() + //rndtime = Math.round(new Date().getTime()/1000) + return new Promise((resolve) => { + let url = { + url: 'https://pyp-api.chuxingyouhui.com/api/knightCard/redPacket/v1_0/openRedPacket', + headers: { + 'Host' : 'pyp-api.chuxingyouhui.com', + 'Accept' : 'application/json, text/plain, */*', + 'ymd' : '0', + 'newcomer' : 'true', + 'token' : blackArr[userIdx]['token'], + 'Accept-Language' : 'zh-CN,zh-Hans;q=0.9', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackArr[userIdx]['User-Agent'], + 'Referer' : 'https://m.black-unique.com/', + 'Accept-Encoding' : 'gzip, deflate, br', + 'Connection' : 'keep-alive', + 'Content-Type' : 'application/json;charset=utf-8', + }, + body: `{"click":false,"sign":"${userSign}","ts":"${reqTime}"}` + }; + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log("Fucntion " + caller + ": API请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + let result = JSON.parse(data); + if(logDebug) console.log(result); + if(result.code == 200) { + console.log(`打开红包获得:${result.data.money}现金`) + signRetryCount = 0 + await getSignInfo('boom') + await $.wait(2000) + await boomRedPacket() + } else { + console.log(`打开红包失败:${result.msg}`) + } + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +//定点红包翻倍 +async function boomRedPacket() { + let caller = printCaller() + //rndtime = Math.round(new Date().getTime()/1000) + return new Promise((resolve) => { + let url = { + url: 'https://fanxian-api.chuxingyouhui.com/api/redPacket/increase/v1_0/boom', + headers: { + 'Host' : 'fanxian-api.chuxingyouhui.com', + 'Accept' : 'application/json, text/plain, */*', + 'Accept-Language' : 'zh-CN,zh-Hans;q=0.9', + 'token' : blackArr[userIdx]['token'], + 'Accept-Encoding' : 'gzip, deflate, br', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackArr[userIdx]['User-Agent'], + 'Referer' : 'https://m.black-unique.com/', + 'Connection' : 'keep-alive', + 'Content-Type' : 'application/json;charset=utf-8', + }, + body: `{"redPacketId":"${redPacketId}","sign":"${userSign}","ts":"${reqTime}"}`, + }; + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log("Fucntion " + caller + ": API请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + let result = JSON.parse(data); + if(logDebug) console.log(result); + if(result.code == 200) { + console.log(`红包翻倍获得:${result.data.redPacketIncreaseAmount}现金`) + } else { + console.log(`红包翻倍失败:${result.msg}`) + } + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +//果园状态 +async function userFruitDetail() { + let caller = printCaller() + //rndtime = Math.round(new Date().getTime()/1000) + reqBody = `{"appId":"${blackArr[userIdx]['appId']}","isMiniProgram":false}` + encodeBody = encodeURIComponent(reqBody) + return new Promise((resolve) => { + let url = { + url: 'https://market.chuxingyouhui.com/promo-bargain-api/garden/api/v1_0/userFruitDetail', + headers: { + 'Host' : 'market.chuxingyouhui.com', + 'request-body' : encodeBody, + 'Accept' : 'application/json, text/plain, */*', + 'Accept-Language' : 'zh-CN,zh-Hans;q=0.9', + 'Accept-Encoding' : 'gzip, deflate, br', + 'token' : blackArr[userIdx]['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackArr[userIdx]['User-Agent'], + 'black-token' : blackArr[userIdx]['black-token'], + 'Connection' : 'keep-alive', + }, + body: reqBody, + }; + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log("Fucntion " + caller + ": API请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + let result = JSON.parse(data); + if(logDebug) console.log(result); + if(result.code == 200) { + console.log(`你现在种的水果是 ${result.data.fruitName} ${result.data.specification},${result.data.progressWord}`) + console.log(`今天已浇水${result.data.wateredTimes}次,剩余水滴数量:${result.data.remainAmount}`) + fruitId = result.data.fruitId + userFruitId = result.data.userFruitId + activityId = result.data.activityId + if(result.data.canReceiveStatus == 1 && result.data.canReceiveAmount > 0) { + await receiveWaterDrop('TOMORROW_REWARD','null','每日水滴') + } + if(result.data.gardenStageRewardResp && result.data.gardenStageRewardResp.status == 1) { + await fruitStageReward() + } + if(result.data.remainAmount >= 10) { + waterCount = 0 + console.log(`开始浇水,请等候......`) + await wateringFruit() + console.log(`浇水结束,本次共浇水${waterCount}次`) + } + } else { + console.log(`查询果园状态失败:${result.msg}`) + } + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +//果园水果进度奖励 +async function fruitStageReward() { + let caller = printCaller() + //rndtime = Math.round(new Date().getTime()/1000) + reqBody = `{"userFruitId":"${userFruitId}","appId":"${blackArr[userIdx]['appId']}"}` + encodeBody = encodeURIComponent(reqBody) + return new Promise((resolve) => { + let url = { + url: 'https://market.chuxingyouhui.com/promo-bargain-api/garden/api/v1_0/receiveStageReward', + headers: { + 'Host' : 'market.chuxingyouhui.com', + 'request-body' : encodeBody, + 'Accept' : 'application/json, text/plain, */*', + 'Accept-Language' : 'zh-CN,zh-Hans;q=0.9', + 'Accept-Encoding' : 'gzip, deflate, br', + 'token' : blackArr[userIdx]['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackArr[userIdx]['User-Agent'], + 'black-token' : blackArr[userIdx]['black-token'], + 'Connection' : 'keep-alive', + }, + body: reqBody, + }; + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log("Fucntion " + caller + ": API请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + let result = JSON.parse(data); + if(logDebug) console.log(result); + if(result.code == 200) { + console.log(`领取水果进度奖励:${result.data.rewardNum}水滴`) + } else { + console.log(`领取水果进度奖励失败:${result.msg}`) + } + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +//果园浇水 +async function wateringFruit() { + let caller = printCaller() + //rndtime = Math.round(new Date().getTime()/1000) + reqBody = `{"userFruitId":"${userFruitId}"}` + encodeBody = encodeURIComponent(reqBody) + return new Promise((resolve) => { + let url = { + url: 'https://market.chuxingyouhui.com/promo-bargain-api/garden/api/v1_0/watering', + headers: { + 'Host' : 'market.chuxingyouhui.com', + 'request-body' : encodeBody, + 'Accept' : 'application/json, text/plain, */*', + 'Accept-Language' : 'zh-CN,zh-Hans;q=0.9', + 'Accept-Encoding' : 'gzip, deflate, br', + 'token' : blackArr[userIdx]['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackArr[userIdx]['User-Agent'], + 'black-token' : blackArr[userIdx]['black-token'], + 'Connection' : 'keep-alive', + }, + body: reqBody, + }; + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log("Fucntion " + caller + ": API请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + let result = JSON.parse(data); + if(logDebug) console.log(result); + if(result.code == 200) { + if(result.data.level && !result.data.remindType) { + if(result.data.upgrade == true) { + console.log(`果树升级到 ${result.data.level} 获得:${result.data.upgradeReward}水滴`) + } + waterCount++ + await $.wait(500) + await wateringFruit() + } + } else { + console.log(`浇水失败:${result.msg}`) + } + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +//果园水滴任务 +async function waterTaskList() { + let caller = printCaller() + //rndtime = Math.round(new Date().getTime()/1000) + reqBody = `{"activityId":"${activityId}","userFruitId":"${userFruitId}","clientType":1}` + encodeBody = encodeURIComponent(reqBody) + return new Promise((resolve) => { + let url = { + url: 'https://market.chuxingyouhui.com/promo-bargain-api/garden/api/v1_0/userTaskList', + headers: { + 'Host' : 'market.chuxingyouhui.com', + 'request-body' : encodeBody, + 'Accept' : 'application/json, text/plain, */*', + 'Accept-Language' : 'zh-CN,zh-Hans;q=0.9', + 'Accept-Encoding' : 'gzip, deflate, br', + 'token' : blackArr[userIdx]['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackArr[userIdx]['User-Agent'], + 'black-token' : blackArr[userIdx]['black-token'], + 'Connection' : 'keep-alive', + }, + body: reqBody, + }; + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log("Fucntion " + caller + ": API请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + let result = JSON.parse(data); + if(logDebug) console.log(result); + if(result.code == 200) { + if(result.data && result.data.taskList && Array.isArray(result.data.taskList)) { + for(let i=0; i -1 || + taskItem.taskType.indexOf('WATCH_VIDEO') > -1 || + taskItem.taskType.indexOf('APP_LOGIN') > -1) { + if(taskItem.status == 0) { + await doWaterTask(taskItem.taskType,taskItem.taskId,taskItem.title) + } else if(taskItem.status == 1) { + await receiveWaterDrop(taskItem.taskType,taskItem.userTaskId,taskItem.title) + } + } else if(taskItem.taskType.indexOf('EVERY_DAY_WATERING_REWARD') > -1 || + taskItem.taskType.indexOf('OPEN_CHEST') > -1) { + if(taskItem.status == 1) { + await receiveWaterDrop(taskItem.taskType,taskItem.userTaskId,taskItem.title) + } + } else { + if(taskItem.status == 0) { + await receiveWaterDrop(taskItem.taskType,taskItem.userTaskId,taskItem.title) + } + } + } + } + } else { + console.log(`获取果园水滴任务失败:${result.msg}`) + } + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +//果园-完成水滴任务 +async function doWaterTask(taskType,taskId,taskTitle) { + let caller = printCaller() + //rndtime = Math.round(new Date().getTime()) + reqBody = `{"userFruitId":"${userFruitId}","taskType":"${taskType}","taskId":"${taskId}"}` + encodeBody = encodeURIComponent(reqBody) + return new Promise((resolve) => { + let url = { + url: 'https://market.chuxingyouhui.com/promo-bargain-api/garden/api/v1_0/doTask', + headers: { + 'Host' : 'market.chuxingyouhui.com', + 'request-body' : encodeBody, + 'Accept' : 'application/json, text/plain, */*', + 'Accept-Language' : 'zh-CN,zh-Hans;q=0.9', + 'Accept-Encoding' : 'gzip, deflate, br', + 'token' : blackArr[userIdx]['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackArr[userIdx]['User-Agent'], + 'black-token' : blackArr[userIdx]['black-token'], + 'Referer' : 'https://m.black-unique.com/', + 'Connection' : 'keep-alive', + }, + body: reqBody + }; + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log("Fucntion " + caller + ": API请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + let result = JSON.parse(data); + if(logDebug) console.log(result); + if(result.code == 200) { + console.log(`完成水滴任务【${taskTitle}】成功`) + } else { + console.log(`完成水滴任务【${taskTitle}】失败:${result.msg}`) + } + await $.wait(1000) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +//果园-领取水滴 +async function receiveWaterDrop(taskType,userTaskId,taskTitle) { + let caller = printCaller() + //rndtime = Math.round(new Date().getTime()) + reqBody = `{"userFruitId":"${userFruitId}","taskType":"${taskType}","userTaskId":${userTaskId}}` + encodeBody = encodeURIComponent(reqBody) + return new Promise((resolve) => { + let url = { + url: 'https://market.chuxingyouhui.com/promo-bargain-api/garden/api/v1_0/receiveWaterDrop', + headers: { + 'Host' : 'market.chuxingyouhui.com', + 'request-body' : encodeBody, + 'Accept' : 'application/json, text/plain, */*', + 'Accept-Language' : 'zh-CN,zh-Hans;q=0.9', + 'Accept-Encoding' : 'gzip, deflate, br', + 'token' : blackArr[userIdx]['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackArr[userIdx]['User-Agent'], + 'black-token' : blackArr[userIdx]['black-token'], + 'Referer' : 'https://m.black-unique.com/', + 'Connection' : 'keep-alive', + }, + body: reqBody + }; + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log("Fucntion " + caller + ": API请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + let result = JSON.parse(data); + if(logDebug) console.log(result); + if(result.code == 200) { + console.log(`领取水滴任务【${taskTitle}】奖励:${result.data.reward}水滴`) + } else { + console.log(`领取水滴任务【${taskTitle}】奖励失败:${result.msg}`) + } + await $.wait(1000) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +//果园肥料任务 +async function nutrientTaskList() { + let caller = printCaller() + //rndtime = Math.round(new Date().getTime()/1000) + reqBody = `{"activityId":"${activityId}","userFruitId":"${userFruitId}"}` + encodeBody = encodeURIComponent(reqBody) + return new Promise((resolve) => { + let url = { + url: 'https://market.chuxingyouhui.com/promo-bargain-api/garden/api/v1_0/getUserNutrientTaskList', + headers: { + 'Host' : 'market.chuxingyouhui.com', + 'request-body' : encodeBody, + 'Accept' : 'application/json, text/plain, */*', + 'Accept-Language' : 'zh-CN,zh-Hans;q=0.9', + 'Accept-Encoding' : 'gzip, deflate, br', + 'token' : blackArr[userIdx]['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackArr[userIdx]['User-Agent'], + 'black-token' : blackArr[userIdx]['black-token'], + 'Connection' : 'keep-alive', + }, + body: reqBody, + }; + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log("Fucntion " + caller + ": API请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + let result = JSON.parse(data); + if(logDebug) console.log(result); + if(result.code == 200) { + if(result.data && result.data.gardenFertilizerTaskDtoList && Array.isArray(result.data.gardenFertilizerTaskDtoList)) { + for(let i=0; i { + let url = { + url: 'https://market.chuxingyouhui.com/promo-bargain-api/garden/api/v1_0/doTaskForNutrient', + headers: { + 'Host' : 'market.chuxingyouhui.com', + 'request-body' : encodeBody, + 'Accept' : 'application/json, text/plain, */*', + 'Accept-Language' : 'zh-CN,zh-Hans;q=0.9', + 'Accept-Encoding' : 'gzip, deflate, br', + 'token' : blackArr[userIdx]['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackArr[userIdx]['User-Agent'], + 'black-token' : blackArr[userIdx]['black-token'], + 'Referer' : 'https://m.black-unique.com/', + 'Connection' : 'keep-alive', + }, + body: reqBody + }; + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log("Fucntion " + caller + ": API请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + let result = JSON.parse(data); + if(logDebug) console.log(result); + if(result.code == 200) { + console.log(`完成肥料任务【${taskTitle}】成功`) + } else { + console.log(`完成肥料任务【${taskTitle}】失败:${result.msg}`) + } + await $.wait(1000) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +//果园肥料状态 +async function userFertilizerDetail(taskType,taskId,taskTitle) { + let caller = printCaller() + //rndtime = Math.round(new Date().getTime()) + reqBody = `{"activityId":"${activityId}","userFruitId":"${userFruitId}"}` + encodeBody = encodeURIComponent(reqBody) + return new Promise((resolve) => { + let url = { + url: 'https://market.chuxingyouhui.com/promo-bargain-api/garden/api/v1_0/getUserFertilizerTool', + headers: { + 'Host' : 'market.chuxingyouhui.com', + 'request-body' : encodeBody, + 'Accept' : 'application/json, text/plain, */*', + 'Accept-Language' : 'zh-CN,zh-Hans;q=0.9', + 'Accept-Encoding' : 'gzip, deflate, br', + 'token' : blackArr[userIdx]['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackArr[userIdx]['User-Agent'], + 'black-token' : blackArr[userIdx]['black-token'], + 'Referer' : 'https://m.black-unique.com/', + 'Connection' : 'keep-alive', + }, + body: reqBody + }; + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log("Fucntion " + caller + ": API请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + let result = JSON.parse(data); + if(logDebug) console.log(result); + if(result.code == 200) { + fertilizerCount = 0 + if(result.data.userSmallFertilizerTool.remainNum > 0 || result.data.userFertilizerTool.remainNum > 0) { + for(let i=0; i { + let url = { + url: 'https://market.chuxingyouhui.com/promo-bargain-api/garden/api/v1_0/useFertilizer', + headers: { + 'Host' : 'market.chuxingyouhui.com', + 'request-body' : encodeBody, + 'Accept' : 'application/json, text/plain, */*', + 'Accept-Language' : 'zh-CN,zh-Hans;q=0.9', + 'Accept-Encoding' : 'gzip, deflate, br', + 'token' : blackArr[userIdx]['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackArr[userIdx]['User-Agent'], + 'black-token' : blackArr[userIdx]['black-token'], + 'Referer' : 'https://m.black-unique.com/', + 'Connection' : 'keep-alive', + }, + body: reqBody + }; + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log("Fucntion " + caller + ": API请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + let result = JSON.parse(data); + if(logDebug) console.log(result); + if(result.code == 200) { + //施肥成功 + } else { + console.log(`施肥失败:${result.msg}`) + } + await $.wait(500) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +//果园-摇树得优惠券 +async function getTreeCoupon() { + console.log(`\n开始摇树${clickTreeTimes}次得优惠券`) + for(let i=0; i { + let url = { + url: 'https://market.chuxingyouhui.com/promo-bargain-api/garden/api/v1_0/clickTree', + headers: { + 'Host' : 'market.chuxingyouhui.com', + 'request-body' : encodeBody, + 'Accept' : 'application/json, text/plain, */*', + 'Accept-Language' : 'zh-CN,zh-Hans;q=0.9', + 'Accept-Encoding' : 'gzip, deflate, br', + 'token' : blackArr[userIdx]['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackArr[userIdx]['User-Agent'], + 'black-token' : blackArr[userIdx]['black-token'], + 'Referer' : 'https://m.black-unique.com/', + 'Connection' : 'keep-alive', + }, + body: reqBody + }; + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log("Fucntion " + caller + ": API请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + let result = JSON.parse(data); + if(logDebug) console.log(result); + if(result.code == 200) { + await $.wait(1000) + if(result.data.hasReward == true) { + await receiveReward(result.data.rewardId,result.data.rewardName,result.data.rewardInfo) + } + } else { + console.log(`果园点击树失败:${result.msg}`) + } + await $.wait(500) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +//果园-获得树干奖励 +async function receiveReward(rewardId,rewardName,rewardInfo) { + let caller = printCaller() + //rndtime = Math.round(new Date().getTime()) + reqBody = `{"rewardId":"${rewardId}","userFruitId":"${userFruitId}","appId":"${blackArr[userIdx]['appId']}"}` + encodeBody = encodeURIComponent(reqBody) + return new Promise((resolve) => { + let url = { + url: 'https://market.chuxingyouhui.com/promo-bargain-api/garden/api/v1_0/receiveReward', + headers: { + 'Host' : 'market.chuxingyouhui.com', + 'request-body' : encodeBody, + 'Accept' : 'application/json, text/plain, */*', + 'Accept-Language' : 'zh-CN,zh-Hans;q=0.9', + 'Accept-Encoding' : 'gzip, deflate, br', + 'token' : blackArr[userIdx]['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackArr[userIdx]['User-Agent'], + 'black-token' : blackArr[userIdx]['black-token'], + 'Referer' : 'https://m.black-unique.com/', + 'Connection' : 'keep-alive', + }, + body: reqBody + }; + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log("Fucntion " + caller + ": API请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + let result = JSON.parse(data); + if(logDebug) console.log(result); + if(result.code == 200) { + console.log(`获得优惠券:${rewardName} -- ${rewardInfo}`) + } else { + console.log(`获取优惠券失败:${result.msg}`) + } + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +//查询账户信息 +async function userInfo() { + console.log(`\n========= 账户${userIdx+1} 信息 =========`) + notifyStr += `========= 账户${userIdx+1} 信息 =========\n` + await userRebateInfo() + await userTopInfo() +} + +//查询现金余额 +async function userRebateInfo() { + let caller = printCaller() + //rndtime = Math.round(new Date().getTime()) + return new Promise((resolve) => { + let url = { + url: 'https://pyp-api.chuxingyouhui.com/api/app/userCenter/v1/info', + headers: { + 'Host' : 'pyp-api.chuxingyouhui.com', + 'Accept' : '*/*', + 'Accept-Language' : 'zh-Hans-CN;q=1', + 'token' : blackArr[userIdx]['token'], + 'User-Agent' : blackArr[userIdx]['User-Agent'], + 'black-token' : blackArr[userIdx]['black-token'], + 'Accept-Encoding' : 'gzip, deflate, br', + 'Connection' : 'keep-alive', + }, + }; + $.get(url, async (err, resp, data) => { + try { + if (err) { + console.log("Fucntion " + caller + ": API请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + let result = JSON.parse(data); + if(logDebug) console.log(result); + if(result.code == 200) { + console.log(`【骑士卡号】:${result.data.userPointsResp.cardNo}`) + notifyStr += `【骑士卡号】:${result.data.userPointsResp.cardNo}\n` + console.log(`【现金余额】:${result.data.currencyBlanceResp.commission}元`) + notifyStr += `【现金余额】:${result.data.currencyBlanceResp.commission}元\n` + } else { + console.log(`查询现金余额失败:${result.msg}`) + notifyStr += `查询现金余额失败:${result.msg}\n` + } + await $.wait(200) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +//查询勋章余额 +async function userTopInfo() { + let caller = printCaller() + //rndtime = Math.round(new Date().getTime()) + return new Promise((resolve) => { + let url = { + url: 'https://market.chuxingyouhui.com/promo-bargain-api/activity/mqq/api/indexTopInfo?appId='+blackArr[userIdx]['appId'], + headers: { + 'Host' : 'market.chuxingyouhui.com', + 'Origin' : 'https://m.black-unique.com', + 'Accept-Encoding' : 'gzip, deflate, br', + 'Connection' : 'keep-alive', + 'black-token' : blackArr[userIdx]['black-token'], + 'Accept' : 'application/json, text/plain, */*', + 'User-Agent' : blackArr[userIdx]['User-Agent'], + 'Referer' : 'https://m.black-unique.com/', + 'token' : blackArr[userIdx]['token'], + 'Accept-Language' : 'zh-CN,zh-Hans;q=0.9', + }, + }; + $.get(url, async (err, resp, data) => { + try { + if (err) { + console.log("Fucntion " + caller + ": API请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + let result = JSON.parse(data); + if(logDebug) console.log(result); + if(result.code == 200) { + console.log(`【勋章余额】:${result.data.score} ≈ ${result.data.score/10000}元`) + notifyStr += `【勋章余额】:${result.data.score} ≈ ${result.data.score/10000}元\n` + } else { + console.log(`查询勋章余额失败:${result.msg}`) + notifyStr += `查询勋章余额失败:${result.msg}\n` + } + await $.wait(200) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +//////////////////////////////////////////////////////////////////// +function safeGet(data) { + try { + if (typeof JSON.parse(data) == "object") { + return true; + } + } catch (e) { + console.log(e); + console.log(`服务器访问数据为空,请检查自身设备网络情况`); + return false; + } +} + +function printCaller(){ + return (new Error()).stack.split("\n")[2].trim().split(" ")[1] +} + +function formatDateTime(inputTime) { + var date = new Date(inputTime); + var y = date.getFullYear(); + var m = date.getMonth() + 1; + m = m < 10 ? ('0' + m) : m; + var d = date.getDate(); + d = d < 10 ? ('0' + d) : d; + var h = date.getHours(); + h = h < 10 ? ('0' + h) : h; + var minute = date.getMinutes(); + var second = date.getSeconds(); + minute = minute < 10 ? ('0' + minute) : minute; + second = second < 10 ? ('0' + second) : second; + return `${y}-${m}-${d}`; +}; + +function Env(t, e) { 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("", `\ud83d\udd14${this.name}, \u5f00\u59cb!`) } 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("@"), a = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(a, (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"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t) { let e = { "M+": (new Date).getMonth() + 1, "d+": (new Date).getDate(), "H+": (new Date).getHours(), "m+": (new Date).getMinutes(), "s+": (new Date).getSeconds(), "q+": Math.floor(((new Date).getMonth() + 3) / 3), S: (new Date).getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, ((new Date).getFullYear() + "").substr(4 - RegExp.$1.length))); for (let s in e) new RegExp("(" + s + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? e[s] : ("00" + e[s]).substr(("" + e[s]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))); let h = ["", "==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="]; h.push(e), s && h.push(s), i && h.push(i), console.log(h.join("\n")), this.logs = this.logs.concat(h) } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t.stack) : this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) } diff --git a/daw.js b/daw.js new file mode 100644 index 0000000..ed9e549 --- /dev/null +++ b/daw.js @@ -0,0 +1,895 @@ +/* +IOS/安卓:都爱玩 +下载注册地址,微信打开: +https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx592b7bf2a9f7f003&redirect_uri=https://v3.sdk.haowusong.com/api/auth/wechat/sharelogin&response_type=code&scope=snsapi_userinfo&state=AAABQKAW,dawbox-android#wechat_redirect + +现在需要充钱1块才能解锁分红池,自己考虑要不要充 +支持苹果和安卓双端的任务,两边账户分红币独立,理论上收益可以翻倍,每天2块多到3块的样子,不过提现次数似乎两边共用 +支持多账户,可以并发看视频广告,减少运行时间,V2P跑有时会有code=400错误信息,忽略就好 +重写捉包只需要捉其中一端的账号即可,ck通用 +脚本内置了自动提现,默认提现到微信 +在【我的】页面可以花0.1购买普通会员,马上返1元可提现。会员每日可以积分兑换0.1-0.2的红包,聊胜于无吧,建议购买 +建议每天多跑几次,池子有额度就能投进去分红 + +青龙: +捉取https://v3.sdk.haowusong.com/api/box/wallet/info的包里的token,写到环境变量dawToken里,多账户用@隔开 +export dawToken='account1@account2@account3' + +V2P重写:打开APP即可获取CK,没有的话点一下下面分红币页面,可以直接捉多账号 +[task_local] +#都爱玩 +3 1,20 * * * https://raw.githubusercontent.com/leafxcy/JavaScript/main/daw.js, tag=都爱玩, enabled=true +[rewrite_local] +https://v3.sdk.haowusong.com/api/box/wallet/info url script-request-header https://raw.githubusercontent.com/leafxcy/JavaScript/main/daw.js +[MITM] +hostname = v3.sdk.haowusong.com +*/ + +const jsname = '都爱玩 by leaf ' +const $ = Env(jsname) + +const logDebug = 0 + +//0为关闭通知,1为打开通知,默认为1,可以在环境变量设置 +let notifyFlag = ($.isNode() ? process.env.dawNotify : $.getdata('dawNotify')) || 1; +let notifyStr = '' +const notify = $.isNode() ? require('./sendNotify') : ''; + +let rndtime = "" //毫秒 +let httpResult //global buffer + +let userToken = '' +let userIdx = 0 +let numBoxbody = 0 +let userStatus = [] +let coinStatus = [] + +let maxTryNum = 12 +let waitTime = 0 +let allCompFlag = 0 + +let channelIdx = 0 +let channel = ['dawbox','dawbox-android'] +let channelStr = ['苹果端','安卓端'] +let withdrawList = [] +let withdrawMethod = [] + +let dawToken = ($.isNode() ? process.env.dawToken : $.getdata('dawToken')) || ''; +let dawTokenArr = [] + +let userName = [] +let isVip = 0 +let vipLevel = 0 + +/////////////////////////////////////////////////////////////////// + +!(async () => { + + if(typeof $request !== "undefined") + { + await GetRewrite() + } + else + { + await CheckEnv() + + numBoxbody = dawTokenArr.length + console.log(`\n找到${numBoxbody}个账户,脚本会同时做IOS和安卓端任务`) + + console.log(`\n检查账号状态中...`) + for(channelIdx=0; channelIdx 0) { + console.log(`等待${waitTime}ms 进行下一轮看视频抽奖\n`) + await $.wait(waitTime) + } + } + } + } + + console.log(`\n开始签到,领取任务奖励,兑换红包和提现`) + for(channelIdx=0; channelIdx $.logErr(e)) +.finally(() => $.done()) + +//通知 +async function Showmsg() { + + notifyBody = '\n' + jsname + "运行通知\n\n" + notifyStr + + if (notifyFlag != 1) { + console.log(notifyBody); + } + + if (notifyFlag == 1) { + $.msg(notifyBody); + if ($.isNode()){await notify.sendNotify($.name, notifyBody );} + } +} + +async function GetRewrite() { + + if($request.url.indexOf('api/box/wallet/info') > -1) { + let headers = $request.headers + let token = headers['token'] ? headers['token'] : '' + + if(!token) return; + + if(dawToken) { + if(dawToken.indexOf(token) > -1) { + $.msg(jsname+` 此dawToken已存在`) + } else { + dawToken = dawToken + '@' + token + $.setdata(dawToken, 'dawToken'); + ckList = dawToken.split('@') + $.msg(jsname+` 获取第${ckList.length}个dawToken成功`) + } + } else { + $.setdata(token, 'dawToken'); + $.msg(jsname+` 获取第1个dawToken成功`) + } + } +} + +async function CheckEnv() { + if(dawToken) { + if(dawToken.indexOf('@') > -1) { + let dawTokens = dawToken.split('@') + for(let i=0; i 0) { + if(integral_num >= integral_min_put_num && can_put_num >= integral_min_put_num) { + let putNum = (integral_num>can_put_num) ? can_put_num : integral_num + await $.wait(100) + await PutInPool(putNum,1) + } + } + } else if(type == 1) { + if(result.data.tasks.vedio_task && Array.isArray(result.data.tasks.vedio_task)) { + for(let i=0; i -1) { + if(taskItem.complete_num < taskItem.contribution_num) { + allCompFlag = 0 + await $.wait(100) + waitTime -= 100 + await ReceiveCoin(taskItem) + } + } + } + } + if(result.data.tasks.game_task && Array.isArray(result.data.tasks.game_task)) { + for(let i=0; i -1) { + if(taskItem.complete_num < taskItem.contribution_num) { + allCompFlag = 0 + await $.wait(100) + waitTime -= 100 + await QueryTurntable(taskItem) + } + } + } + } + } else if(type == 2) { + let integral_num = result.data.player.integral_num ? result.data.player.integral_num : 0 + let use_integral_num = result.data.player.use_integral_num ? result.data.player.use_integral_num : 0 + let money = result.data.player.money ? result.data.player.money : 0 + console.log(`【DAB币】:${integral_num}`) + console.log(`【今日已投】:${use_integral_num}`) + console.log(`【分红余额】:${money}`) + notifyStr += `【DAB币】:${integral_num}\n` + notifyStr += `【今日已投】:${use_integral_num}\n` + notifyStr += `【分红余额】:${money}\n` + } + } else { + console.log(`\n账户${userIdx+1}${channelStr[channelIdx]}查询信息失败:${result.error}`) + } +} + +//领币任务奖励 +async function ReceiveCoin(taskItem) { + let caller = PrintCaller() + let url = `https://v3.sdk.haowusong.com/api/channel/integral/task/receive` + let reqBody = `{"task_id":${taskItem.task_id},"channel":"${channel[channelIdx]}"}` + let urlObject = PopulatePostUrl(url,reqBody) + await HttpPost(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.code == 200) { + console.log(`账户${userIdx+1}${channelStr[channelIdx]}完成任务【${taskItem.title}】,领取DAB币成功`) + } else { + console.log(`账户${userIdx+1}${channelStr[channelIdx]}完成任务【${taskItem.title}】失败:${result.error}`) + if(result.error.indexOf('当前仓库已存满') > -1) { + let idx = channelIdx*numBoxbody+userIdx + if(coinStatus[idx] == 1) { + console.log(`账户${userIdx+1}${channelStr[channelIdx]}仓库已存满,尝试先投入分红池`) + coinStatus[idx] = 2 + await $.wait(100) + await QueryCoinInfo(0) + } else if(coinStatus[idx] == 2) { + console.log(`账户${userIdx+1}${channelStr[channelIdx]}仓库已存满,且无法投入分红池,此用户暂时不再做任务`) + } + } + } +} + +//转盘次数查询 +async function QueryTurntable(taskItem) { + let caller = PrintCaller() + let url = `https://v3.sdk.haowusong.com/api/channel/integral/turntable/config?channel=${channel[channelIdx]}&task_id=${taskItem.task_id}` + let urlObject = PopulateGetUrl(url) + await HttpGet(urlObject,caller) + let result = httpResult; + if(!result) return false + + if(result.code == 200) { + let can_video_num = result.data.lottery_num.can_video_num ? result.data.lottery_num.can_video_num : 0 + let max_video_num = result.data.lottery_num.max_video_num ? result.data.lottery_num.max_video_num : 0 + let can_lottery_num = result.data.lottery_num.can_lottery_num ? result.data.lottery_num.can_lottery_num : 0 + let max_lottery_num = result.data.lottery_num.max_lottery_num ? result.data.lottery_num.max_lottery_num : 0 + if(can_video_num < max_video_num) { + //先看视频领次数 + await $.wait(100) + waitTime -= 100 + await ReceiveVideoReward(taskItem) + } else if(can_lottery_num < max_lottery_num) { + //已看完视频,直接抽奖 + await $.wait(100) + waitTime -= 100 + await Turntable(taskItem) + } + } else { + console.log(`账户${userIdx+1}${channelStr[channelIdx]}获取转盘次数失败:${result.error}`) + return false + } + + return true +} + +//看视频领抽奖次数 +async function ReceiveVideoReward(taskItem) { + let caller = PrintCaller() + let url = `https://v3.sdk.haowusong.com/api/channel/integral/turntable/video/receive` + let reqBody = `{"channel":"${channel[channelIdx]}","task_id":"${taskItem.task_id}"}` + let urlObject = PopulatePostUrl(url,reqBody) + await HttpPost(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.code == 200) { + console.log(`账户${userIdx+1}${channelStr[channelIdx]}看视频获得了一次抽奖机会`) + await $.wait(100) + waitTime -= 100 + await Turntable(taskItem) + } else { + console.log(`账户${userIdx+1}${channelStr[channelIdx]}看视频得抽奖机会失败:${result.error}`) + } +} + +//转盘抽奖 +async function Turntable(taskItem) { + let caller = PrintCaller() + let url = `https://v3.sdk.haowusong.com/api/channel/integral/turntable/result` + let reqBody = `{"channel":"${channel[channelIdx]}","task_id":"${taskItem.task_id}"}` + let urlObject = PopulatePostUrl(url,reqBody) + await HttpPost(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.code == 200) { + let reward = result.data.title ? result.data.title : '【?】' + console.log(`账户${userIdx+1}${channelStr[channelIdx]}抽奖成功,获得了${reward}`) + await $.wait(100) + waitTime -= 100 + await ReceiveTurntable(taskItem) + } else { + console.log(`账户${userIdx+1}${channelStr[channelIdx]}抽奖失败:${result.error}`) + } +} + +//转盘抽奖奖励翻倍领取 +async function ReceiveTurntable(taskItem) { + let caller = PrintCaller() + let url = `https://v3.sdk.haowusong.com/api/channel/integral/turntable/receive` + let reqBody = `{"channel":"${channel[channelIdx]}","task_id":"${taskItem.task_id}","type":1}` + let urlObject = PopulatePostUrl(url,reqBody) + await HttpPost(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.code == 200) { + console.log(`账户${userIdx+1}${channelStr[channelIdx]}看视频获得抽奖翻倍奖励成功`) + } else { + console.log(`账户${userIdx+1}${channelStr[channelIdx]}看视频获得抽奖翻倍奖励失败:${result.error}`) + if(result.error.indexOf('当前仓库已存满') > -1) { + let idx = channelIdx*numBoxbody+userIdx + if(coinStatus[idx] == 1) { + console.log(`账户${userIdx+1}${channelStr[channelIdx]}仓库已存满,尝试先投入分红池`) + coinStatus[idx] = 2 + await $.wait(100) + await QueryCoinInfo(0) + } else if(coinStatus[idx] == 2) { + console.log(`账户${userIdx+1}${channelStr[channelIdx]}仓库已存满,且无法投入分红池,此用户暂时不再做任务`) + } + } + } +} + +//瓜分池投入 +async function PutInPool(num,pool_lv) { + let caller = PrintCaller() + let url = `https://v3.sdk.haowusong.com/api/channel/integral/put?channel=${channel[channelIdx]}&num=${num}&pool_lv=${pool_lv}` + let urlObject = PopulateGetUrl(url) + await HttpPost(urlObject,caller) + let result = httpResult; + if(!result) return false + + if(result.code == 200) { + console.log(`账号${userIdx+1}${channelStr[channelIdx]}投入瓜分池${num}币成功`) + notifyStr += `账号${userIdx+1}${channelStr[channelIdx]}投入瓜分池${num}币成功\n` + coinStatus[channelIdx*numBoxbody+userIdx] = 1 + } else { + console.log(`账号${userIdx+1}${channelStr[channelIdx]}投入瓜分池${num}币失败:${result.error}`) + } +} + +//签到信息查询 +async function QuerySignList() { + let caller = PrintCaller() + let url = `https://v3.sdk.haowusong.com/api/box/sign/list` + let urlObject = PopulateGetUrl(url) + await HttpGet(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.code == 200) { + if(result.data.today_sign_status == 0) { + await $.wait(100) + await SignToday() + } else { + console.log(`账户${userIdx+1}${channelStr[channelIdx]}今日已签到`) + } + } else { + console.log(`账户${userIdx+1}${channelStr[channelIdx]}获取签到信息失败:${result.error}`) + } +} + +//签到 +async function SignToday() { + let caller = PrintCaller() + let url = `https://v3.sdk.haowusong.com/api/box/sign/post` + let urlObject = PopulateGetUrl(url) + await HttpPost(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.code == 200) { + console.log(`账户${userIdx+1}${channelStr[channelIdx]}签到成功,获得${result.data.total_credit_num}积分`) + } else { + console.log(`账户${userIdx+1}${channelStr[channelIdx]}签到失败:${result.error}`) + } +} + +//积分任务列表查询 +async function QueryTaskList() { + let caller = PrintCaller() + let url = `https://v3.sdk.haowusong.com/api/box/task/list` + let urlObject = PopulateGetUrl(url) + await HttpGet(urlObject,caller) + let result = httpResult; + if(!result) return false + + if(result.code == 200) { + if(result.data && Array.isArray(result.data)) { + for(let i=0; i 0 && vipLevel >= exchangeItem.vip_level) { + await $.wait(100) + await MallExchange(exchangeItem,exchangeItem.today_ex_num) + } + } + } + } else { + console.log(`账户${userIdx+1}${channelStr[channelIdx]}获取积分红包兑换列表失败:${result.error}`) + } +} + +//积分红包兑换 +async function MallExchange(exchangeItem,num) { + let caller = PrintCaller() + let url = `https://v3.sdk.haowusong.com/api/box/mall/exchange` + let reqBody = `{"mall_id":${exchangeItem.id},"num":${num}}` + let urlObject = PopulatePostUrl(url,reqBody) + await HttpPost(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.code == 200) { + console.log(`账户${userIdx+1}${channelStr[channelIdx]}兑换【${exchangeItem.title}】成功`) + } else { + console.log(`账户${userIdx+1}${channelStr[channelIdx]}兑换【${exchangeItem.title}】失败:${result.error}`) + } +} + +//积分红包提现列表查询 +async function QueryWithdrawBox(page) { + let caller = PrintCaller() + let url = `https://v3.sdk.haowusong.com/api/box/withdraw/platform/config?channel=${channel[channelIdx]}&page=${page}&page_count=10` + let urlObject = PopulateGetUrl(url) + await HttpGet(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.code == 200) { + let money = result.data.money ? result.data.money : 0 + withdrawMethod[userIdx].alipay = result.data.is_bind_alipay ? result.data.is_bind_alipay : 0 + withdrawMethod[userIdx].wechat = result.data.is_bind_wechat ? result.data.is_bind_wechat : 0 + let payType = '' + if(result.data.is_bind_wechat==1) payType += ' 微信' + if(result.data.is_bind_alipay==1) payType += ' 支付宝' + if(!payType) payType += '无' + console.log(`账户${userIdx+1}${channelStr[channelIdx]}积分红包余额:${result.data.money}`) + console.log(`账户${userIdx+1}${channelStr[channelIdx]}已绑定支付方式:${payType}`) + if(result.data.withdraw_config && Array.isArray(result.data.withdraw_config)) { + for(let i=0; i= withItem.money) { + withdrawList[userIdx].push({type:'box',channel:channelIdx,item:withItem}) + } + } + } else { + console.log(`账号${userIdx+1}${channelStr[channelIdx]}获取积分红包提现列表失败`) + } + } else { + console.log(`账号${userIdx+1}${channelStr[channelIdx]}获取积分红包提现列表失败:${result.error}`) + } +} + +//分红提现列表查询 +async function QueryWithdrawIntegral(page) { + let caller = PrintCaller() + let url = `https://v3.sdk.haowusong.com/api/channel/integral/withdraw/config?channel=${channel[channelIdx]}&page=${page}&page_count=10` + let urlObject = PopulateGetUrl(url) + await HttpGet(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.code == 200) { + let money = result.data.money ? result.data.money : 0 + console.log(`\n账号${userIdx+1}${channelStr[channelIdx]}:`) + console.log(`分红余额:${result.data.money}`) + if(result.data.withdraw_config && Array.isArray(result.data.withdraw_config)) { + for(let i=0; i= withItem.money) { + withdrawList[userIdx].push({type:'integral',channel:channelIdx,item:withItem}) + } + } + } else { + console.log(`\n账号${userIdx+1}${channelStr[channelIdx]}获取分红余额提现列表失败`) + } + } else { + console.log(`\n账号${userIdx+1}${channelStr[channelIdx]}获取分红余额提现列表失败:${result.error}`) + } +} + +async function Withdraw() { + if(withdrawList[userIdx].length > 0) { + console.log(`\n账号${userIdx+1}开始尝试提现:`) + let sortList = withdrawList[userIdx].sort(function(a,b){return b['item']['money']-a['item']['money']}); + for(let i=0; i -1) { + return true + } + } + return false +} + +//分红提现 +async function WithdrawIntegral(withItem,withMethod) { + let caller = PrintCaller() + let pay_type = 0 + if(withMethod.wechat == 1 && withItem.item.is_wechat == 1) { + pay_type = 1 + } else if(withMethod.alipay == 1 && withItem.item.is_alipay == 1) { + pay_type = 2 + } else { + return false + } + let url = `https://v3.sdk.haowusong.com/api/channel/integral/withdraw/apply?config_id=${withItem.item.id}&channel=${channel[withItem.channel]}&pay_type=${pay_type}` + let urlObject = PopulateGetUrl(url) + await HttpPost(urlObject,caller) + let result = httpResult; + if(!result) { + console.log(`--账号${userIdx+1}${channelStr[withItem.channel]}提现分红${withItem.item.money}元失败:服务器无响应`) + return false + } + + if(result.code == 200) { + console.log(`--账号${userIdx+1}${channelStr[withItem.channel]}提现分红${withItem.item.money}元成功`) + notifyStr += `--账号${userIdx+1}${channelStr[withItem.channel]}提现分红${withItem.item.money}元成功\n` + return true + } else { + console.log(`--账号${userIdx+1}${channelStr[withItem.channel]}提现分红${withItem.item.money}元失败:${result.error}`) + if(result.error.indexOf('今日提现次数超出限制') > -1) { + return true + } + } + return false +} + +//////////////////////////////////////////////////////////////////// +function PopulatePostUrl(url,reqBody){ + let urlObject = { + url: url, + headers: { + 'Host' : 'v3.sdk.haowusong.com', + 'Origin' : 'https://v3.h5.haowusong.com', + 'Content-Type' : 'application/json', + 'Accept-Encoding' : 'gzip, deflate, br', + 'Connection' : 'keep-alive', + 'Accept' : 'application/json, text/plain, */*', + 'User-Agent' : 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148', + 'Accept-Language' : 'zh-CN,zh-Hans;q=0.9', + 'Referer' : 'https://v3.h5.haowusong.com/', + 'token' : dawTokenArr[userIdx], + }, + body: reqBody, + } + return urlObject; +} + +function PopulateGetUrl(url){ + let urlObject = { + url: url, + headers: { + 'Host' : 'v3.sdk.haowusong.com', + 'Origin' : 'https://v3.h5.haowusong.com', + 'Content-Type' : 'application/json', + 'Accept-Encoding' : 'gzip, deflate, br', + 'Connection' : 'keep-alive', + 'Accept' : 'application/json, text/plain, */*', + 'User-Agent' : 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148', + 'Accept-Language' : 'zh-CN,zh-Hans;q=0.9', + 'Referer' : 'https://v3.h5.haowusong.com/', + 'token' : dawTokenArr[userIdx], + } + } + return urlObject; +} + +async function HttpPost(url,caller) { + httpResult = null + return new Promise((resolve) => { + $.post(url, async (err, resp, data) => { + try { + if (SafeGet(data,caller)) { + httpResult = JSON.parse(data); + if(logDebug) console.log(httpResult); + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +async function HttpGet(url,caller) { + httpResult = null + return new Promise((resolve) => { + $.get(url, async (err, resp, data) => { + try { + if (SafeGet(data,caller)) { + httpResult = JSON.parse(data); + if(logDebug) console.log(httpResult); + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +function SafeGet(data,caller) { + try { + if (typeof JSON.parse(data) == "object") { + return true; + } else { + console.log(`Function ${caller}: 未知错误`); + console.log(data) + } + } catch (e) { + console.log(e); + console.log(data) + console.log(`Function ${caller}: 服务器访问数据为空,请检查自身设备网络情况`); + return false; + } +} + +function PrintCaller(){ + return (new Error()).stack.split("\n")[2].trim().split(" ")[1] +} + +function Env(t, e) { 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("", `\ud83d\udd14${this.name}, \u5f00\u59cb!`) } 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("@"), a = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(a, (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"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t) { let e = { "M+": (new Date).getMonth() + 1, "d+": (new Date).getDate(), "H+": (new Date).getHours(), "m+": (new Date).getMinutes(), "s+": (new Date).getSeconds(), "q+": Math.floor(((new Date).getMonth() + 3) / 3), S: (new Date).getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, ((new Date).getFullYear() + "").substr(4 - RegExp.$1.length))); for (let s in e) new RegExp("(" + s + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? e[s] : ("00" + e[s]).substr(("" + e[s]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))); let h = ["", "=========\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3========="]; h.push(e), s && h.push(s), i && h.push(i), console.log(h.join("\n")), this.logs = this.logs.concat(h) } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t.stack) : this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) } diff --git a/jckd/jckd_risk.js b/jckd/jckd_risk.js new file mode 100644 index 0000000..8e100a3 --- /dev/null +++ b/jckd/jckd_risk.js @@ -0,0 +1,312 @@ +/* +安卓:晶彩看点 风险查询+今日收益详情 + +需要用到jckdCookie,只测试了青龙,理论上V2P也能用 +本脚本没有设置重写,请自己复制jc_cookie到青龙环境下使用,多账号用@隔开 +例子: export jckdCookie='uid=xxx&zqkey=yyy&zqkey_id=zzz@uid=aaa&zqkey=bbb&zqkey_id=ccc@uid=qqq&zqkey=sss&zqkey_id=ttt' +*/ + +const jsname = '晶彩看点风险查询' +const $ = Env(jsname) +const notifyFlag = 1; //0为关闭通知,1为打开通知,默认为1 +const logDebug = 0 + +const notify = $.isNode() ? require('./sendNotify') : ''; +let notifyStr = '' + +let rndtime = "" //毫秒 +let httpResult //global buffer + +let userCookie = ($.isNode() ? process.env.jckdCookie : $.getdata('jckdCookie')) || ''; +let userCookieArr = [] + +let nickname = [] +/////////////////////////////////////////////////////////////////// + +!(async () => { + + if(typeof $request !== "undefined") + { + $.msg(jsname+': 此脚本不做重写,请检查重写设置') + } + else + { + if(!(await checkEnv())) { + return + } + + await initAccountInfo() + await RunRiskInfo() + await RunUserBalance() + + await showmsg() + } + + +})() +.catch((e) => $.logErr(e)) +.finally(() => $.done()) + +//通知 +async function showmsg() { + + notifyBody = jsname + "运行通知\n\n" + notifyStr + + if (notifyFlag != 1) { + console.log(notifyBody); + } + + if (notifyFlag == 1) { + $.msg(notifyBody); + if($.isNode()){await notify.sendNotify($.name, notifyBody );} + } +} + +async function checkEnv() { + if(userCookie) { + if(userCookie.indexOf('@') > -1) { + let userCookies = userCookie.split('@') + for(let i=0; i -1) { + for(let j=0; j { + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log(caller + ": post请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + httpResult = JSON.parse(data); + if(logDebug) console.log(httpResult); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +async function httpGet(url,caller) { + httpResult = null + return new Promise((resolve) => { + $.get(url, async (err, resp, data) => { + try { + if (err) { + console.log(caller + ": get请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data,caller)) { + httpResult = JSON.parse(data); + if(logDebug) console.log(httpResult); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +function safeGet(data,caller) { + try { + if (typeof JSON.parse(data) == "object") { + return true; + } else { + console.log(`Function ${caller}: 未知错误`); + console.log(data) + } + } catch (e) { + console.log(e); + console.log(`Function ${caller}: 服务器访问数据为空,请检查自身设备网络情况`); + return false; + } +} + +function printCaller(){ + return (new Error()).stack.split("\n")[2].trim().split(" ")[1] +} + +function Env(t, e) { 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("", `\ud83d\udd14${this.name}, \u5f00\u59cb!`) } 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("@"), a = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(a, (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"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t) { let e = { "M+": (new Date).getMonth() + 1, "d+": (new Date).getDate(), "H+": (new Date).getHours(), "m+": (new Date).getMinutes(), "s+": (new Date).getSeconds(), "q+": Math.floor(((new Date).getMonth() + 3) / 3), S: (new Date).getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, ((new Date).getFullYear() + "").substr(4 - RegExp.$1.length))); for (let s in e) new RegExp("(" + s + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? e[s] : ("00" + e[s]).substr(("" + e[s]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))); let h = ["", "==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="]; h.push(e), s && h.push(s), i && h.push(i), console.log(h.join("\n")), this.logs = this.logs.concat(h) } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t.stack) : this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) } diff --git a/jckd/jckd_shareRead.js b/jckd/jckd_shareRead.js new file mode 100644 index 0000000..1ee1bf1 --- /dev/null +++ b/jckd/jckd_shareRead.js @@ -0,0 +1,328 @@ +/* +安卓:晶彩看点 + +转发和分享阅读,请勿贪心,小心黑号 +*/ + +const jsname = '晶彩看点分享阅读' +const $ = Env(jsname) +const notifyFlag = 1; //0为关闭通知,1为打开通知,默认为1 +const logDebug = 0 + +//const notify = $.isNode() ? require('./sendNotify') : ''; +let notifyStr = '' + +let rndtime = "" //毫秒 +let httpResult //global buffer + +let jckdCookie = ($.isNode() ? process.env.jc_cookie : $.getdata('jc_cookie')) || ''; +let jckdCookieArr = [] + +let userCk = '' +let readCount = 0 + +let jckdShareNum = ($.isNode() ? process.env.jckdShareNum : $.getdata('jckdShareNum')) || 0; + +let newsItem = '' +let UserAgent = '' +let si = '' + +/////////////////////////////////////////////////////////////////// + +!(async () => { + + if(typeof $request !== "undefined") + { + $.msg(jsname+': 此脚本不做重写,请检查重写设置') + } + else + { + if(!(await checkEnv())){ + return + } + + for(let j=0; j maxWaitTime ? maxWaitTime : seedFactor + let randomTime = Math.floor(Math.random()*factor) + 1000 + let second = Math.floor(randomTime/1000) + UserAgent = 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.16(0x1800102c) NetType/WIFI Language/zh_CN' + si = randomString(32) + console.log(`--随机延迟${second}秒后开始模拟第${readCount}次分享阅读`) + await $.wait(randomTime) + console.log(`----模拟第${readCount}次阅读,使用si=${si}`) + await shareReadStep1() + await $.wait(Math.floor(Math.random()*500)+500) + await shareReadStep2() + await $.wait(Math.floor(Math.random()*1000)+2000) + await shareReadStep3() + await $.wait(Math.floor(Math.random()*1000)+2000) + await shareReadStep4() + console.log(`----模拟第${readCount}次阅读完成`) + } + + } + } + } + + +})() +.catch((e) => $.logErr(e)) +.finally(() => $.done()) + +//通知 +async function showmsg() { + + notifyBody = jsname + "运行通知\n\n" + notifyStr + + if (notifyFlag != 1) { + console.log(notifyBody); + } + + if (notifyFlag == 1) { + $.msg(notifyBody); + //if ($.isNode()){await notify.sendNotify($.name, notifyBody );} + } +} + +async function checkEnv() { + + if(jckdShareNum == 0) { + console.log('当前分享次数设置为0。如果需要开启分享阅读,请设置环境变量jckdShareNum为要被阅读的次数。') + return false + } + + if(jckdCookie) { + if(jckdCookie.indexOf('@') > -1) { + let jckdCookies = jckdCookie.split('@') + for(let i=0; i { + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log(caller + ": post请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + httpResult = JSON.parse(data,caller); + if(logDebug) console.log(httpResult); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +async function httpGet(url,caller) { + httpResult = null + return new Promise((resolve) => { + $.get(url, async (err, resp, data) => { + try { + if (err) { + console.log(caller + ": get请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + // + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +function safeGet(data,caller) { + try { + if (typeof JSON.parse(data) == "object") { + return true; + } else { + console.log(`Function ${caller}: 未知错误`); + console.log(data) + } + } catch (e) { + console.log(e); + console.log(`Function ${caller}: 服务器访问数据为空,请检查自身设备网络情况`); + return false; + } +} + +function printCaller(){ + return (new Error()).stack.split("\n")[2].trim().split(" ")[1] +} + +function Env(t, e) { 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("", `\ud83d\udd14${this.name}, \u5f00\u59cb!`) } 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("@"), a = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(a, (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"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t) { let e = { "M+": (new Date).getMonth() + 1, "d+": (new Date).getDate(), "H+": (new Date).getHours(), "m+": (new Date).getMinutes(), "s+": (new Date).getSeconds(), "q+": Math.floor(((new Date).getMonth() + 3) / 3), S: (new Date).getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, ((new Date).getFullYear() + "").substr(4 - RegExp.$1.length))); for (let s in e) new RegExp("(" + s + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? e[s] : ("00" + e[s]).substr(("" + e[s]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))); let h = ["", "==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="]; h.push(e), s && h.push(s), i && h.push(i), console.log(h.join("\n")), this.logs = this.logs.concat(h) } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t.stack) : this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) } diff --git a/jctq/README.md b/jctq/README.md new file mode 100644 index 0000000..2e15bfb --- /dev/null +++ b/jctq/README.md @@ -0,0 +1,22 @@ +# 晶彩天气(v8.3.7) + +## 重写: +https://tq.xunsl.com/v17/NewTask/getTaskListByWeather.json -- 点开福利页即可获取jctqCookie +https://tq.xunsl.com/v5/CommonReward/toGetReward.json -- 签到,和福利页任务奖励 +https://tq.xunsl.com/v5/article/info.json -- 点开文章获取文章body +https://tq.xunsl.com/v5/article/detail.json -- 点开视频获取视频body +https://tq.xunsl.com/v5/user/stay.json -- 阅读文章或者看视频一段时间后可以获取到时长body +https://tq.xunsl.com/v5/nameless/adlickstart.json -- 点开看看赚获取body,可以一直开着,脚本会自动删除重复body +https://tq.xunsl.com/v5/Weather/giveBoxOnWeather.json -- 点开福利页浮窗宝箱和观看翻倍视频获取body +https://tq.xunsl.com/v5/weather/giveTimeInterval.json -- 点开首页气泡红包和观看翻倍视频获取body +https://tq.xunsl.com/v5/wechat/withdraw2.json -- 提现一次对应金额获取body +https://tq.xunsl.com/v5/CommonReward/toDouble.json -- 领取签到翻倍奖励后可获取 + +## 任务: +jctq_daily.js -- 领转发页定时宝箱,领福利页定时宝箱,领首页气泡红包,时段转发,刷福利视频,抽奖5次 +jctq_reward.js -- 签到和翻倍,任务奖励领取,统计今日收益,自动提现 +jctq_kkz.js -- 完成看看赚任务,删除重复和失效的body +jctq_read.js -- 阅读文章,浏览视频 + +## 分享阅读: +jctq_shareRead.js -- 分享和助力阅读,需要在环境变量jctqShareNum里设置要被阅读的次数,不设置默认不跑 diff --git a/jctq/jctq_Adv_video.js b/jctq/jctq_Adv_video.js deleted file mode 100644 index 671b3fd..0000000 --- a/jctq/jctq_Adv_video.js +++ /dev/null @@ -1,91 +0,0 @@ -const $ = new Env("晶彩天气福利视频"); -const notify = $.isNode() ? require('./sendNotify') : ''; -message = "" -let jctqCookie= $.isNode() ? (process.env.jctqCookie ? process.env.jctqCookie : "") : ($.getdata('jctqCookie') ? $.getdata('jctqCookie') : "") -let jctqCookieArr = [] -let jctqCookies = "" - -if (!jctqCookie) { - $.msg($.name, '【提示】进入点击右下角"赚钱图标",再跑一次脚本', '不知道说啥好', { - "open-url": "给您劈个叉吧" - }); - $.done() - } - else if (jctqCookie.indexOf("@") == -1 && jctqCookie.indexOf("@") == -1) { - jctqCookieArr.push(jctqCookie) - } - else if (jctqCookie.indexOf("@") > -1) { - jctqCookies = jctqCookie.split("@") - } - else if (process.env.jctqCookie && process.env.jctqCookie.indexOf('@') > -1) { - jctqCookieArr = process.env.jctqCookie.split('@'); - console.log(`您选择的是用"@"隔开\n`) - } - else { - jctqCookies = [process.env.jctqCookie] - }; - Object.keys(jctqCookies).forEach((item) => { - if (jctqCookies[item]) { - jctqCookieArr.push(jctqCookies[item]) - } - }) - - - - -!(async () => { - console.log(`共${jctqCookieArr.length}个cookie`) - for (let k = 0; k < jctqCookieArr.length; k++) { - $.message = "" - bodyVal = jctqCookieArr[k] - var time1 = Date.parse( new Date() ).toString(); - time1 = time1.substr(0,10); - jctqCookie1= time1 + '&' + bodyVal - //待处理cookie - console.log(`${jctqCookie1}`) - console.log(`--------第 ${k + 1} 个账号观看福利视频中--------\n`) - for (let j =0; j<5;j++){ - console.log(`--------第 ${j + 1} 次观看福利视频中--------\n`) - await video(jctqCookie1) - console.log("等待30秒") - await $.wait(30000); - console.log("\n\n") - } - console.log("\n\n") - } - - })() - .catch((e) => $.logErr(e)) - .finally(() => $.done()) - - -function video(jctqCookie1,timeout = 0) { - return new Promise((resolve) => { - - let url = { - url : 'https://tq.xunsl.com/V17/NewTask/recordNum.json?'+ jctqCookie1, - headers : { - 'Host': 'tq.xunsl.com', - 'Connection': 'Keep-Alive', - 'Accept-Encoding': 'gzip', - 'User-Agent': 'okhttp/3.12.2' -}, - } - $.get(url, async (err, resp, data) => { - try { - const result = JSON.parse(data) - if(result.success === true){ - console.log('\n福利视频:'+result.message) - }else{ - console.log(result) - } - } catch (e) { - } finally { - resolve() - } - },timeout) - }) -} - -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("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}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("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(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"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} - diff --git a/jctq/jctq_Rotary.js b/jctq/jctq_Rotary.js deleted file mode 100644 index c5a84ac..0000000 --- a/jctq/jctq_Rotary.js +++ /dev/null @@ -1,137 +0,0 @@ -const $ = new Env("晶彩天气大转盘抽奖"); -const notify = $.isNode() ? require('./sendNotify') : ''; -message = "" -let jctqCookie= $.isNode() ? (process.env.jctqCookie ? process.env.jctqCookie : "") : ($.getdata('jctqCookie') ? $.getdata('jctqCookie') : "") -let jctqCookieArr = [] -let jctqCookies = "" -let remain =100 -var time = Date.parse( new Date() ).toString(); -var time1 = time.substr(0,10); - -if (!jctqCookie) { - $.msg($.name, '【提示】进入点击右下角"赚钱图标",获取cookie,再跑一次脚本', '不知道说啥好', { - "open-url": "给您劈个叉吧" - }); - $.done() - } - else if (jctqCookie.indexOf("@") == -1 && jctqCookie.indexOf("@") == -1) { - jctqCookieArr.push(jctqCookie) - } - else if (jctqCookie.indexOf("@") > -1) { - jctqCookies = jctqCookie.split("@") - } - else if (process.env.jctqCookie && process.env.jctqCookie.indexOf('@') > -1) { - jctqCookieArr = process.env.jctqCookie.split('@'); - console.log(`您选择的是用"@"隔开\n`) - } - else { - jctqCookies = [process.env.jctqCookie] - }; - Object.keys(jctqCookies).forEach((item) => { - if (jctqCookies[item]) { - jctqCookieArr.push(jctqCookies[item]) - } - }) - - - -!(async () => { - console.log(`共${jctqCookieArr.length}个cookie`) - for (let k = 0; k < jctqCookieArr.length; k++) { - $.message = "" - bodyVal = jctqCookieArr[k].split('&uid=')[0]; - cookie = bodyVal.replace(/zqkey=/, "cookie=") - cookie_id = cookie.replace(/zqkey_id=/, "cookie_id=") - jctqCookie1= cookie_id + '&request_time=' + time1 + '&time=' + time1 +'&'+ bodyVal - //待处理cookie - //console.log(`${jctqCookie1}`) - console.log(`--------第 ${k + 1} 个账号转盘抽奖中--------\n`) - - console.log("\n\n") - - for(let k = 0 ; k < 100 ; k++){ - await Rotary(jctqCookie1,cookie_id,time) - await $.wait(6000); - console.log("\n\n") - } - for (let k = 1 ; k < 5 ; k++){ - id = k.toString() - await openbox(jctqCookie1,cookie_id,time,id) - await $.wait(15000) - } - console.log("\n\n") - } - })() - .catch((e) => $.logErr(e)) - .finally(() => $.done()) -//抽奖 -function Rotary(jctqCookie1,cookie_id,time) { - return new Promise((resolve, reject) => { - let url = { - url : 'https://tq.xunsl.com/WebApi/RotaryTable/turnRotary?_='+time, - headers : {'Host': 'tq.xunsl.com', - 'Referer':'https://tq.xunsl.com/html/rotaryTable/index.html?'+jctqCookie1 - }, - body:cookie_id, - } - $.post(url, async (err, resp, data) => { - try { - const result = JSON.parse(data) - if(result.status === 1 ){ - if(result.data.score !== 0){ - console.log('好家伙!你抽中了'+result.data.score + '金币') - - //console.log('剩'+remain+'次') - }else { - console.log('你抽了个寂寞') - } - - }else{ - console.log('\n抽奖失败,别问我,我也不知道为啥') - } - } catch (e) { - $.logErr(e+resp); - } finally { - resolve() - } - }) - }) -} - -function openbox(jctqCookie1,cookie_id,time,k,timeout = 0) { - return new Promise((resolve) => { - let url = { - url : 'https://tq.xunsl.com/WebApi/RotaryTable/chestReward?_='+ time, - headers : {'Host': 'tq.xunsl.com', - 'User-Agent': 'Mozilla/5.0 (Linux; Android 8.1.0; 16 X Build/OPM1.171019.026; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/65.0.3325.109 Mobile Safari/537.36', - 'Content-Type': 'application/x-www-form-urlencoded', - 'Accept-Language': 'zh-CN,en-US;q=0.9', - 'Accept-Encoding': 'gzip, deflate', - 'Content-Length': (cookie_id +'&num='+k).length.toString(), - 'Referer':'https://tq.xunsl.com/html/rotaryTable/index.html?'+jctqCookie1 - }, - body:cookie_id + '&num=' + k, - } - $.post(url, async (err, resp, data) => { - try { - const result = JSON.parse(data) - if(result.status === 1 ){ - if(result.data.score !== 0){ - console.log('宝箱获得:'+result.data.score + '金币') - - }else { - console.log('宝箱打开失败') - } - }else{ - console.log('\n宝箱请求失败') - - } - } catch (e) { - } finally { - resolve() - } - },timeout) - }) -} - -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("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}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("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(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"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} diff --git a/jctq/jctq_daily.js b/jctq/jctq_daily.js new file mode 100644 index 0000000..8f61908 --- /dev/null +++ b/jctq/jctq_daily.js @@ -0,0 +1,709 @@ +/* +安卓:水果天气(v8.3.9) + +此脚本负责: +旧版本8.3.7:领首页气泡红包和翻倍奖励,福利页定时宝箱和翻倍奖励 +新版本8.3.9:领转发页定时宝箱,领资讯页宝箱和视频奖励,任务页一键收金币,时段转发,刷福利视频,抽奖5次 +*/ + +const jsname = '晶彩天气日常' +const $ = Env(jsname) +const notifyFlag = 1; //0为关闭通知,1为打开通知,默认为1 +const logDebug = 0 + +//const notify = $.isNode() ? require('./sendNotify') : ''; +let notifyStr = '' + +let rndtime = "" //毫秒 +let httpResult //global buffer + +let userCookie = '' + +let jctqCookie = ($.isNode() ? process.env.jctqCookie : $.getdata('jctqCookie')) || ''; +let jctqBubbleBody = ($.isNode() ? process.env.jctqBubbleBody : $.getdata('jctqBubbleBody')) || ''; +let jctqGiveBoxBody = ($.isNode() ? process.env.jctqGiveBoxBody : $.getdata('jctqGiveBoxBody')) || ''; +let jctqGoldBody = ($.isNode() ? process.env.jctqGoldBody : $.getdata('jctqGoldBody')) || ''; +let jctqVideoBody = ($.isNode() ? process.env.jctqVideoBody : $.getdata('jctqVideoBody')) || ''; + +let jctqCookieArr = [] +let jctqBubbleBodyArr = [] +let jctqGiveBoxBodyArr = [] +let jctqGoldBodyArr = [] +let jctqVideoBodyArr = [] + +let refHotShare = 'http://tq.xunsl.com/h5/hotShare/?' +let refRotory = 'https://tq.xunsl.com/html/rotaryTable/index.html?keyword_wyq=woyaoq.com&' + + +/////////////////////////////////////////////////////////////////// + +!(async () => { + + if(typeof $request !== "undefined") + { + $.msg(jsname+': 此脚本不做重写,请检查重写设置') + } + else + { + await checkEnv() + + numBoxbody = jctqCookieArr.length + console.log(`找到${numBoxbody}个cookie`) + + for(let i=0; i $.logErr(e)) +.finally(() => $.done()) + +//通知 +async function showmsg() { + + notifyBody = jsname + "运行通知\n\n" + notifyStr + + if (notifyFlag != 1) { + console.log(notifyBody); + } + + if (notifyFlag == 1) { + $.msg(notifyBody); + //if ($.isNode()){await notify.sendNotify($.name, notifyBody );} + } +} + +async function checkEnv() { + + if(jctqCookie) { + if(jctqCookie.indexOf('&') > -1) { + let jctqCookies = jctqCookie.split('@') + for(let i=0; i -1) { + let jctqBubbleBodyArrs = jctqBubbleBody.split('&') + for(let i=0; i -1) { + let jctqGiveBoxBodyArrs = jctqGiveBoxBody.split('&') + for(let i=0; i -1) { + let jctqGoldBodyArrs = jctqGoldBody.split('&') + for(let i=0; i -1) { + let jctqVideoBodyArrs = jctqVideoBody.split('@') + for(let i=0; i=5 && currentHour<10) { + action = 'beread_extra_reward_one' + } else if(currentHour>=11 && currentHour<16) { + action = 'beread_extra_reward_two' + } else if(currentHour>=17 && currentHour<22) { + action = 'beread_extra_reward_three' + } + + if(result.code == 200) { + if(result.data && result.data.taskList && Array.isArray(result.data.taskList)) { + let taskList = result.data.taskList + for(let i=0; i -1) { + if(taskItem.status == 1) { + console.log(`\n转发页面定时宝箱可领取`) + await $.wait(1000) + await getRewardShareBox() + } else { + let cdTime = taskItem.total_time - taskItem.countdown + console.log(`\n转发页面定时宝箱冷却时间:${cdTime}秒`) + if(cdTime < 90) { + let waitTime = cdTime+1 + console.log(`\n等待${waitTime}秒后尝试领取`) + await $.wait(waitTime*1000) + await queryShareStatus() + } + } + } + if(action && taskItem.action.indexOf(action) > -1) { + if(taskItem.status == 0) { + console.log(`\n开始做${taskItem.name}转发任务`) + await $.wait(1000) + await listsNewTag() + await $.wait(1000) + await execExtractTask(taskItem.action,taskItem.name) + } else { + console.log(`\n${taskItem.name}转发已完成`) + } + } + } + } + } else { + console.log(`\n转发页面查询失败:${result.msg}`) + } +} + +//转发页面红包领取 -- 30分钟一次 +async function getRewardShareBox() { + let caller = printCaller() + let url = 'http://tq.xunsl.com/WebApi/TimePacket/getReward' + let urlObject = populatePostUrl(url,refHotShare,userCookie) + await httpPost(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.code == 1) { + console.log(`领取转发页面定时宝箱成功:获得${result.data.score}金币`) + } else { + console.log(`领取转发页面定时宝箱失败:${result.msg}`) + } +} + +//转发页面列表 +async function listsNewTag() { + let caller = printCaller() + let url = 'http://tq.xunsl.com/WebApi/ArticleTop/listsNewTag' + let urlObject = populatePostUrl(url,refHotShare,userCookie) + await httpPost(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.status == 1) { + if(result.data && result.data.items && Array.isArray(result.data.items)) { + let shareIdx = Math.floor(Math.random()*result.data.items.length) + let newsItem = result.data.items[shareIdx] + await $.wait(1000) + await getShareArticleReward(newsItem.id) + } + } else { + console.log(`查询转发页面列表失败:${result.msg}`) + } +} + +//转发文章 +async function getShareArticleReward(articleId) { + let caller = printCaller() + let url = 'http://tq.xunsl.com/WebApi/ShareNew/getShareArticleReward' + let reqBody = userCookie + '&article_id=' + articleId + let urlObject = populatePostUrl(url,refHotShare,reqBody) + await httpPost(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.status == 1) { + if(result.data.share == 1) { + console.log(`转发文章成功`) + } + } else { + console.log(`转发文章失败:${result.msg}`) + } +} + +//转发时段奖励 +async function execExtractTask(action,name) { + let caller = printCaller() + let url = 'http://tq.xunsl.com/WebApi/ShareNew/execExtractTask' + let reqBody = userCookie + '&action=' + action + let urlObject = populatePostUrl(url,refHotShare,reqBody) + await httpPost(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.code == 200) { + console.log(`领取${name}转发奖励成功`) + } else { + console.log(`领取${name}转发奖励失败:${result.msg}`) + } +} + +//首页气泡红包查询 +async function queryBubbleStatus() { + let caller = printCaller() + let url = 'https://tq.xunsl.com/v17/weather/index.json?' + userCookie + let urlObject = populateGetUrl(url,refHotShare) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.success == true) { + let numBody = jctqBubbleBodyArr.length + if(numBody > 0) { + if(result.items && result.items.bubble && Array.isArray(result.items.bubble)) { + let bubbleList = result.items.bubble + let numBubble = bubbleList.length + console.log(`\n共有${numBubble}个气泡红包可以领取,找到${numBody}个气泡和翻倍body,开始尝试领取`) + for(let i=0; i 1) { + if(result.items.status == 1) { + console.log(`\n福利页面定时宝箱可领取,找到${numBody}个宝箱body,开始尝试领取`) + for(let i=0; i 5 ? 5 : result.data.remainTurn + if(numTurn > 0) { + for(let i=0; i= boxItem.times) { + randomTime = Math.floor(Math.random()*5000)+30000 + console.log(`随机延迟 ${randomTime}ms 看视频开抽奖宝箱`) + await $.wait(randomTime) + await chestReward(i+1) + } + } + } + } else { + console.log(`抽奖次数查询失败:${result.msg}`) + } +} + +//抽奖宝箱 +async function chestReward(idx) { + rndtime = Math.floor(new Date().getTime()) + let caller = printCaller() + let url = 'https://tq.xunsl.com/WebApi/RotaryTable/chestReward?_='+rndtime + let reqBody = userCookie + '&num=' + idx + let urlObject = populatePostUrl(url,refRotory,reqBody) + await httpPost(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.status == 1) { + console.log(`开抽奖第${idx}个宝箱获得${result.data.score}金币`) + } else { + console.log(`开抽奖宝箱失败:${result.msg}`) + } +} + +//抽奖 +async function turnRotary() { + rndtime = Math.floor(new Date().getTime()) + let caller = printCaller() + let url = 'https://tq.xunsl.com/WebApi/RotaryTable/turnRotary?_='+rndtime + let urlObject = populatePostUrl(url,refRotory,userCookie) + await httpPost(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.status == 1) { + console.log(`抽奖获得${result.data.score}金币,剩余抽奖次数${result.data.remainTurn}`) + } else { + console.log(`抽奖失败:${result.msg}`) + } +} + +//查询日常任务进度 +async function getTaskListByWeather() { + let caller = printCaller() + let url = 'https://tq.xunsl.com/v17/NewTask/getTaskListByWeather.json?' + userCookie + let urlObject = populateGetUrl(url,refHotShare) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.success == true) { + if(Array.isArray(result.items.daily)) { + for(let i=0; i 0) { + console.log(`\n找到${numBody}个资讯页宝箱body,开始尝试领取`) + for(let i=0; i 0) { + console.log(`\n找到${numBody}个收金币body,开始尝试领取`) + for(let i=0; i { + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log(caller + ": post请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + httpResult = JSON.parse(data,caller); + if(logDebug) console.log(httpResult); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +async function httpGet(url,caller) { + httpResult = null + return new Promise((resolve) => { + $.get(url, async (err, resp, data) => { + try { + if (err) { + console.log(caller + ": get请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data,caller)) { + httpResult = JSON.parse(data); + if(logDebug) console.log(httpResult); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +function safeGet(data,caller) { + try { + if (typeof JSON.parse(data) == "object") { + return true; + } else { + console.log(`Function ${caller}: 未知错误`); + console.log(data) + } + } catch (e) { + console.log(e); + console.log(`Function ${caller}: 服务器访问数据为空,请检查自身设备网络情况`); + return false; + } +} + +function printCaller(){ + return (new Error()).stack.split("\n")[2].trim().split(" ")[1] +} + +function Env(t, e) { 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("", `\ud83d\udd14${this.name}, \u5f00\u59cb!`) } 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("@"), a = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(a, (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"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t) { let e = { "M+": (new Date).getMonth() + 1, "d+": (new Date).getDate(), "H+": (new Date).getHours(), "m+": (new Date).getMinutes(), "s+": (new Date).getSeconds(), "q+": Math.floor(((new Date).getMonth() + 3) / 3), S: (new Date).getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, ((new Date).getFullYear() + "").substr(4 - RegExp.$1.length))); for (let s in e) new RegExp("(" + s + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? e[s] : ("00" + e[s]).substr(("" + e[s]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))); let h = ["", "==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="]; h.push(e), s && h.push(s), i && h.push(i), console.log(h.join("\n")), this.logs = this.logs.concat(h) } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t.stack) : this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) } diff --git a/jctq/jctq_friendSign.js b/jctq/jctq_friendSign.js deleted file mode 100644 index 598ddcf..0000000 --- a/jctq/jctq_friendSign.js +++ /dev/null @@ -1,125 +0,0 @@ -const $ = new Env("晶彩天气好友签到红包"); -const notify = $.isNode() ? require('./sendNotify') : ''; -message = "" -let jctqCookie= $.isNode() ? (process.env.jctqCookie ? process.env.jctqCookie : "") : ($.getdata('jctqCookie') ? $.getdata('jctqCookie') : "") -let jctqCookieArr = [] -let jctqCookies = "" - - if (typeof $request !== "undefined") { - getjctqCookie() - $.done() - } - - -if (!jctqCookie) { - $.msg($.name, '【提示】进入点击右下角"赚钱图标",再跑一次脚本', '不知道说啥好', { - "open-url": "给您劈个叉吧" - }); - $.done() - } - else if (jctqCookie.indexOf("@") == -1 && jctqCookie.indexOf("@") == -1) { - jctqCookieArr.push(jctqCookie) - } - else if (jctqCookie.indexOf("@") > -1) { - jctqCookies = jctqCookie.split("@") - } - else if (process.env.jctqCookie && process.env.jctqCookie.indexOf('@') > -1) { - jctqCookieArr = process.env.jctqCookie.split('@'); - console.log(`您选择的是用"@"隔开\n`) - } - else { - jctqCookies = [process.env.jctqCookie] - }; - Object.keys(jctqCookies).forEach((item) => { - if (jctqCookies[item]) { - jctqCookieArr.push(jctqCookies[item]) - } - }) - -!(async () => { - console.log(`共${jctqCookieArr.length}个cookie`) - for (let k = 0; k < jctqCookieArr.length; k++) { - $.message = "" - bodyVal = jctqCookieArr[k].split('&uid=')[0]; - cookie = bodyVal.replace(/zqkey=/, "cookie=") - cookie_id = cookie.replace(/zqkey_id=/, "cookie_id=") - var time1 = Date.parse( new Date() ).toString(); - time1 = time1.substr(0,10); - jctqCookie1= cookie_id + '&request_time=' + time1 + '&time=' + time1 +'&'+ bodyVal - //待处理cookie - //console.log(`${jctqCookie1}`) - console.log(`--------第 ${k + 1} 个账号好友查询中--------\n`) - await friendlist(jctqCookie1) - //await $.wait(4000); - console.log("\n\n") - } - - - })() - .catch((e) => $.logErr(e)) - .finally(() => $.done()) -//查询好友列表 -function friendlist(jctqCookie1,timeout = 0) { - return new Promise((resolve) => { - let url = { - url : 'https://tq.xunsl.com/WebApi/ShareSignNew/getFriendFinalList?'+jctqCookie1, - headers : {'Host': 'tq.xunsl.com', - 'Referer':'https://tq.xunsl.com/h5/20201020missionSign/?'+jctqCookie1 - }, - } - $.get(url, async (err, resp, data) => { - try { - - const result = JSON.parse(data) - if(result.success === true ){ - - for (let k=0;k { - let url = { - url : 'https://tq.xunsl.com/WebApi/ShareSignNew/sendScoreV2?friend_uid='+uid+'&'+jctqCookie1, - headers : {'Host': 'tq.xunsl.com', - 'Referer':'https://tq.xunsl.com/h5/20201020missionSign/?'+jctqCookie1 - }, - } - $.get(url, async (err, resp, data) => { - try { - - const result = JSON.parse(data) - if(result.success === true ){ - long=result.data.length - console.log('领取好友红包成功,获得:'+result.data[long-1].score + '金币') - - await $.wait(2000); - // await share(wzid) - - }else{ - console.log('\n该好友未签到或红包已完') - } - } catch (e) { - } finally { - resolve() - } - },timeout) - }) -} - -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("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}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("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(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"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} diff --git a/jctq/jctq_kkz.js b/jctq/jctq_kkz.js new file mode 100644 index 0000000..89adf8b --- /dev/null +++ b/jctq/jctq_kkz.js @@ -0,0 +1,372 @@ +/* +安卓:水果天气(v8.3.9) + +此脚本负责: +完成看看赚任务 +*/ + +const jsname = '水果天气看看赚' +const $ = Env(jsname) +const notifyFlag = 1; //0为关闭通知,1为打开通知,默认为1 +const logDebug = 0 + +//const notify = $.isNode() ? require('./sendNotify') : ''; +let notifyStr = '' + +let rndtime = "" //毫秒 +let httpResult //global buffer + +let jctqCookie = ($.isNode() ? process.env.jctqCookie : $.getdata('jctqCookie')) || ''; +let jctqLookStartbody = ($.isNode() ? process.env.jctqLookStartbody : $.getdata('jctqLookStartbody')) || ''; + +let jctqCookieArr = [] +let jctqLookStartbodyArr = [] + +let userCookie = '' + +let bannerIdList = [] +//let duplicatedCount = 0 +let finishCount = 0 +let rewardAmount = 0 + + +/////////////////////////////////////////////////////////////////// + +!(async () => { + + if(typeof $request !== "undefined") + { + $.msg(jsname+': 此脚本不做重写,请检查重写设置') + } + else + { + if(!(await checkEnv())) { + return + } + + for(let i=0; i $.logErr(e)) +.finally(() => $.done()) + +//通知 +async function showmsg() { + + notifyBody = jsname + "运行通知\n\n" + notifyStr + + if (notifyFlag != 1) { + console.log(notifyBody); + } + + if (notifyFlag == 1) { + $.msg(notifyBody); + //if ($.isNode()){await notify.sendNotify($.name, notifyBody );} + } +} + +async function checkEnv() { + + if(!jctqLookStartbody) { + console.log(`未获取到看看赚body`) + return false + } + + if(jctqLookStartbody.indexOf('&') > -1) { + jctqLookStartbodyArr = jctqLookStartbody.split('&') + } else { + jctqLookStartbodyArr.push(jctqLookStartbody) + } + + let numBody = jctqLookStartbodyArr.length + console.log(`找到${numBody}个看看赚body`) + + if(jctqCookie) { + if(jctqCookie.indexOf('@') > -1) { + let jctqCookies = jctqCookie.split('@') + for(let i=0; i { + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log(caller + ": post请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + httpResult = JSON.parse(data,caller); + if(logDebug) console.log(httpResult); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +async function httpGet(url,caller) { + httpResult = null + return new Promise((resolve) => { + $.get(url, async (err, resp, data) => { + try { + if (err) { + console.log(caller + ": get请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data,caller)) { + httpResult = JSON.parse(data); + if(logDebug) console.log(httpResult); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +function safeGet(data,caller) { + try { + if (typeof JSON.parse(data) == "object") { + return true; + } else { + console.log(`Function ${caller}: 未知错误`); + console.log(data) + } + } catch (e) { + console.log(e); + console.log(`Function ${caller}: 服务器访问数据为空,请检查自身设备网络情况`); + return false; + } +} + +function printCaller(){ + return (new Error()).stack.split("\n")[2].trim().split(" ")[1] +} + +function Env(t, e) { 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("", `\ud83d\udd14${this.name}, \u5f00\u59cb!`) } 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("@"), a = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(a, (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"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t) { let e = { "M+": (new Date).getMonth() + 1, "d+": (new Date).getDate(), "H+": (new Date).getHours(), "m+": (new Date).getMinutes(), "s+": (new Date).getSeconds(), "q+": Math.floor(((new Date).getMonth() + 3) / 3), S: (new Date).getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, ((new Date).getFullYear() + "").substr(4 - RegExp.$1.length))); for (let s in e) new RegExp("(" + s + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? e[s] : ("00" + e[s]).substr(("" + e[s]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))); let h = ["", "==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="]; h.push(e), s && h.push(s), i && h.push(i), console.log(h.join("\n")), this.logs = this.logs.concat(h) } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t.stack) : this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) } diff --git a/jctq/jctq_read.js b/jctq/jctq_read.js new file mode 100644 index 0000000..4c7f92c --- /dev/null +++ b/jctq/jctq_read.js @@ -0,0 +1,258 @@ +/* +安卓:水果天气(v8.3.9) + +此脚本负责: +阅读文章,浏览视频 +*/ + +const jsname = '水果天气文章视频' +const $ = Env(jsname) +const notifyFlag = 1; //0为关闭通知,1为打开通知,默认为1 +const logDebug = 0 + +//const notify = $.isNode() ? require('./sendNotify') : ''; +let notifyStr = '' + +let rndtime = "" //毫秒 +let httpResult //global buffer + +let jctqTimeBody = ($.isNode() ? process.env.jctqTimeBody : $.getdata('jctqTimeBody')) || ''; +let jctqWzBody = ($.isNode() ? process.env.jctqWzBody : $.getdata('jctqWzBody')) || ''; +let jctqWzBodyArr = [] + +let bannerIdList = [] +let totalTime = 0 +let invalidCount = 0 +let finishCount = 0 +let rewardAmount = 0 + +/////////////////////////////////////////////////////////////////// + +!(async () => { + + if(typeof $request !== "undefined") + { + $.msg(jsname+': 此脚本不做重写,请检查重写设置') + } + else + { + if(!(await checkEnv())) { + return + } + + for(let i=0; i $.logErr(e)) +.finally(() => $.done()) + +//通知 +async function showmsg() { + + notifyBody = jsname + "运行通知\n\n" + notifyStr + + if (notifyFlag != 1) { + console.log(notifyBody); + } + + if (notifyFlag == 1) { + $.msg(notifyBody); + //if ($.isNode()){await notify.sendNotify($.name, notifyBody );} + } +} + +async function checkEnv() { + + if(!jctqWzBody) { + console.log(`未获取到文章视频body`) + return false + } + + if(jctqWzBody.indexOf('&') > -1) { + jctqWzBodyArr = jctqWzBody.split('&') + } else { + jctqWzBodyArr.push(jctqWzBody) + } + + if(jctqTimeBody && jctqTimeBody.indexOf('&') > -1) { + jctqTimeBodys = jctqTimeBody.split('&') + jctqTimeBody = jctqTimeBodys[0] + } + + let numWzBody = jctqWzBodyArr.length + console.log(`找到${numWzBody}个文章视频body`) + + return true +} + +/////////////////////////////////////////////////////////////////// + +//浏览文章 +async function readArticle(wzBody,idx) { + let caller = printCaller() + let url = 'https://tq.xunsl.com/v5/article/complete.json' + let urlObject = populatePostUrl(url,wzBody) + await httpPost(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.success == true) { + finishCount++ + let randomTime = Math.floor(Math.random()*10000)+60000 + let score = result.items.read_score || 0 + rewardAmount += parseInt(score) + console.log(`浏览第${idx+1}篇文章获得${score}金币,随机延迟${randomTime}ms后刷阅读时长`) + await $.wait(randomTime) + if(jctqTimeBody) { + await updateStayTime(jctqTimeBody) + } else { + console.log(`----没有找到时长body,不刷时长,请小心黑号`) + } + } else { + //invalidCount++ + //await removeBody(wzBody) + console.log(`浏览第${idx+1}篇文章失败:${result.message}`) + } +} + +//更新阅读时长 +async function updateStayTime(timeBody) { + let caller = printCaller() + let url = 'https://tq.xunsl.com/v5/user/stay.json' + let urlObject = populatePostUrl(url,timeBody) + await httpPost(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.success == true) { + totalTime = result.time + console.log(`----更新阅读时长成功,今天总阅读时长${result.time}秒`) + } else { + console.log(`----更新阅读时长失败:${result.message}`) + } +} + +//删除失效body +async function removeBody(wzBody) { + newBody = $.getdata('jctqWzBody').replace(wzBody,""); + newBody = newBody.replace("&&","&"); + $.setdata(newBody,'jctqWzBody'); +} + +//统计运行情况 +async function getStatus() { + notifyStr += `本次运行情况:\n` + notifyStr += `共阅读了${finishCount}篇文章/视频,获得${rewardAmount}金币,总阅读时长${totalTime}\n` + //if(invalidCount > 0) notifyStr += `删除了${invalidCount}个无效的body\n` +} + +//////////////////////////////////////////////////////////////////// +function populatePostUrl(url,reqBody){ + let rndtime = Math.floor(new Date().getTime()/1000) + let urlObject = { + url: url, + headers: { + 'request_time' : rndtime, + 'Host' : 'tq.xunsl.com', + 'device-model' : 'VOG-AL10', + 'device-platform' : 'android', + 'Connection' : 'keep-alive', + 'app-type' : 'jcweather', + }, + body: reqBody + } + return urlObject; +} + +function populateGetUrl(url){ + let rndtime = Math.floor(new Date().getTime()/1000) + let urlObject = { + url: url, + headers: { + 'request_time' : rndtime, + 'Host' : 'tq.xunsl.com', + 'device-model' : 'VOG-AL10', + 'device-platform' : 'android', + 'Connection' : 'keep-alive', + 'app-type' : 'jcweather', + } + } + return urlObject; +} + +async function httpPost(url,caller) { + httpResult = null + return new Promise((resolve) => { + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log(caller + ": post请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + httpResult = JSON.parse(data,caller); + if(logDebug) console.log(httpResult); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +async function httpGet(url,caller) { + httpResult = null + return new Promise((resolve) => { + $.get(url, async (err, resp, data) => { + try { + if (err) { + console.log(caller + ": get请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data,caller)) { + httpResult = JSON.parse(data); + if(logDebug) console.log(httpResult); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +function safeGet(data,caller) { + try { + if (typeof JSON.parse(data) == "object") { + return true; + } else { + console.log(`Function ${caller}: 未知错误`); + console.log(data) + } + } catch (e) { + console.log(e); + console.log(`Function ${caller}: 服务器访问数据为空,请检查自身设备网络情况`); + return false; + } +} + +function printCaller(){ + return (new Error()).stack.split("\n")[2].trim().split(" ")[1] +} + +function Env(t, e) { 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("", `\ud83d\udd14${this.name}, \u5f00\u59cb!`) } 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("@"), a = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(a, (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"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t) { let e = { "M+": (new Date).getMonth() + 1, "d+": (new Date).getDate(), "H+": (new Date).getHours(), "m+": (new Date).getMinutes(), "s+": (new Date).getSeconds(), "q+": Math.floor(((new Date).getMonth() + 3) / 3), S: (new Date).getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, ((new Date).getFullYear() + "").substr(4 - RegExp.$1.length))); for (let s in e) new RegExp("(" + s + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? e[s] : ("00" + e[s]).substr(("" + e[s]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))); let h = ["", "==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="]; h.push(e), s && h.push(s), i && h.push(i), console.log(h.join("\n")), this.logs = this.logs.concat(h) } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t.stack) : this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) } diff --git a/jctq/jctq_reward.js b/jctq/jctq_reward.js new file mode 100644 index 0000000..bd3a343 --- /dev/null +++ b/jctq/jctq_reward.js @@ -0,0 +1,373 @@ +/* +安卓:水果天气(v8.3.9) + +此脚本负责: +签到和翻倍,任务奖励领取,领首页福利视频奖励,首页统计今日收益,自动提现 + +请将定时放在看看赚和阅读任务后面 +如果不想自动提现的,请不要捉提现body,或者新建环境变量jctqWithdrawFlag,写成0 +*/ + +const jsname = '水果天气任务签到' +const $ = Env(jsname) +const notifyFlag = 1; //0为关闭通知,1为打开通知,默认为1 +const logDebug = 0 + +//const notify = $.isNode() ? require('./sendNotify') : ''; +let notifyStr = '' + +let rndtime = "" //毫秒 +let httpResult //global buffer + +let numBoxbody + +let jctqWithdrawFlag = ($.isNode() ? process.env.jctqWithdrawFlag : $.getdata('jctqWithdrawFlag')) || 1; +let jctqBoxbody = ($.isNode() ? process.env.jctqBoxbody : $.getdata('jctqBoxbody')) || ''; +let jctqQdBody = ($.isNode() ? process.env.jctqQdBody : $.getdata('jctqQdBody')) || ''; +let jctqSignDoubleBody = ($.isNode() ? process.env.jctqSignDoubleBody : $.getdata('jctqSignDoubleBody')) || ''; +let jctqWithdraw = ($.isNode() ? process.env.jctqWithdraw : $.getdata('jctqWithdraw')) || ''; +let jctqCookie = ($.isNode() ? process.env.jctqCookie : $.getdata('jctqCookie')) || ''; + +let jctqRewardBodyArr = [] +let jctqSignDoubleBodyArr = [] +let jctqWithdrawArr = [] +let jctqCookieArr = [] + +let withdrawSuccess = 0 + +/////////////////////////////////////////////////////////////////// + +!(async () => { + + if(typeof $request !== "undefined") + { + $.msg(jsname+': 此脚本不做重写,请检查重写设置') + } + else + { + await checkEnv() + + numBoxbody = jctqRewardBodyArr.length + console.log(`找到${numBoxbody}个签到/奖励body`) + + for(let i=0; i 0 && jctqWithdrawArr.length > 0) { + numBoxbody = jctqWithdrawArr.length + console.log(`找到${numBoxbody}个提现body`) + + for(let i=0; i $.logErr(e)) +.finally(() => $.done()) + +//通知 +async function showmsg() { + + notifyBody = jsname + "运行通知\n\n" + notifyStr + + if (notifyFlag != 1) { + console.log(notifyBody); + } + + if (notifyFlag == 1) { + $.msg(notifyBody); + //if ($.isNode()){await notify.sendNotify($.name, notifyBody );} + } +} + +async function checkEnv() { + + if(jctqCookie) { + if(jctqCookie.indexOf('@') > -1) { + let jctqCookies = jctqCookie.split('@') + for(let i=0; i -1) { + let jctqWithdraws = jctqWithdraw.split('&') + for(let i=0; i -1) { + let jctqQdBodyArr = jctqQdBody.split('&') + for(let i=0; i -1) { + let jctqBoxbodyArr = jctqBoxbody.split('&') + for(let i=0; i -1) { + let jctqSignDoubleBodys = jctqSignDoubleBody.split('&') + for(let i=0; i -1) signStr = '签到' + console.log(`领取第${idx+1}个奖励成功,${signStr}获得${result.items.score}金币`) + } + } else { + console.log(`领取第${idx+1}个奖励失败:${result.message}`) + } +} + +//签到翻倍 +async function toDouble(rewardBody) { + let caller = printCaller() + let url = 'https://tq.xunsl.com/v5/CommonReward/toDouble.json' + let urlObject = populatePostUrl(url,rewardBody) + await httpPost(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.success == true) { + if(result.items && result.items.score) { + console.log(`签到翻倍成功,获得${result.items.score}金币`) + } + } else { + console.log(`签到翻倍失败:${result.message}`) + } +} + +//今日收益 +async function getBalance(cookie) { + let caller = printCaller() + let url = 'https://tq.xunsl.com/wap/user/balance?keyword_wyq=woyaoq.com&' + cookie + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.status == 0) { + notifyStr += `【金币总数】:${result.user.score}\n` + notifyStr += `【今日收益】:${result.user.today_score}\n` + for(let i=0; i -1) { + for(let j=0; j { + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log(caller + ": post请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + httpResult = JSON.parse(data,caller); + if(logDebug) console.log(httpResult); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +async function httpGet(url,caller) { + httpResult = null + return new Promise((resolve) => { + $.get(url, async (err, resp, data) => { + try { + if (err) { + console.log(caller + ": get请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data,caller)) { + httpResult = JSON.parse(data); + if(logDebug) console.log(httpResult); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +function safeGet(data,caller) { + try { + if (typeof JSON.parse(data) == "object") { + return true; + } else { + console.log(`Function ${caller}: 未知错误`); + console.log(data) + } + } catch (e) { + console.log(e); + console.log(`Function ${caller}: 服务器访问数据为空,请检查自身设备网络情况`); + return false; + } +} + +function printCaller(){ + return (new Error()).stack.split("\n")[2].trim().split(" ")[1] +} + +function Env(t, e) { 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("", `\ud83d\udd14${this.name}, \u5f00\u59cb!`) } 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("@"), a = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(a, (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"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t) { let e = { "M+": (new Date).getMonth() + 1, "d+": (new Date).getDate(), "H+": (new Date).getHours(), "m+": (new Date).getMinutes(), "s+": (new Date).getSeconds(), "q+": Math.floor(((new Date).getMonth() + 3) / 3), S: (new Date).getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, ((new Date).getFullYear() + "").substr(4 - RegExp.$1.length))); for (let s in e) new RegExp("(" + s + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? e[s] : ("00" + e[s]).substr(("" + e[s]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))); let h = ["", "==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="]; h.push(e), s && h.push(s), i && h.push(i), console.log(h.join("\n")), this.logs = this.logs.concat(h) } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t.stack) : this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) } diff --git a/jctq/jctq_rewrite.js b/jctq/jctq_rewrite.js new file mode 100644 index 0000000..93e9d39 --- /dev/null +++ b/jctq/jctq_rewrite.js @@ -0,0 +1,263 @@ +/* +安卓:水果天气(v8.3.9) + +此脚本负责:捉包重写 + +脚本会自动提现,如果不想自动提现的,请不要捉提现body,或者新建环境变量jctqWithdrawFlag,写成0 + +重写: +https://tq.xunsl.com/v17/NewTask/getTaskListByWeather.json -- 点开任务页即可获取jctqCookie +https://tq.xunsl.com/v5/CommonReward/toGetReward.json -- 领取签到和任务奖励后获取。首页左方点击福利视频浮窗(一共5次,建议捉到第一个后复制4遍)。获取完建议关掉重写 +https://tq.xunsl.com/v5/article/info.json -- 点开文章获取文章body,获取完建议关掉重写 +https://tq.xunsl.com/v5/article/detail.json -- 点开视频获取视频body,获取完建议关掉重写 +https://tq.xunsl.com/v5/user/stay.json -- 阅读文章或者看视频一段时间后可以获取到时长body,获取完务必关掉重写,同一个账号不要获取多个时长body +https://tq.xunsl.com/v5/nameless/adlickstart.json -- 点开看看赚获取body,可以一直开着,看看赚会不定时更新 +https://tq.xunsl.com/v5/Weather/giveBoxOnWeather.json -- (旧版8.3.7)点开福利页浮窗宝箱和观看翻倍视频获取body,获取完建议关掉重写 +https://tq.xunsl.com/v5/weather/giveTimeInterval.json -- (旧版8.3.7)点开首页气泡红包和观看翻倍视频获取body,获取完建议关掉重写 +https://tq.xunsl.com/v5/Weather/giveReceiveGoldCoin.json -- 任务页点击一键收金币获取第一个body,收金币后看完视频领奖励获取第二个body +https://tq.xunsl.com/v17/Rvideo/videoCallback.json -- 资讯页右上角宝箱,看视频领取奖励后获取 +https://tq.xunsl.com/v5/wechat/withdraw2.json -- 提现一次对应金额获取body +https://tq.xunsl.com/v5/CommonReward/toDouble.json -- 领取签到翻倍奖励后可获取 + +任务: +jctq_daily.js -- 各种时段奖励,抽奖,转发 +jctq_reward.js -- 签到和翻倍,任务奖励领取,领首页福利视频奖励,首页统计今日收益,自动提现 +jctq_kkz.js -- 完成看看赚任务 +jctq_read.js -- 阅读文章,浏览视频 + +*/ + +const jsname = '晶彩天气捉包重写' +const $ = Env(jsname) +const notifyFlag = 1; //0为关闭通知,1为打开通知,默认为1 +const logDebug = 0 + +let jctqCookie = ($.isNode() ? process.env.jctqCookie : $.getdata('jctqCookie')) || ''; +let jctqBoxbody = ($.isNode() ? process.env.jctqBoxbody : $.getdata('jctqBoxbody')) || ''; +let jctqTimeBody = ($.isNode() ? process.env.jctqTimeBody : $.getdata('jctqTimeBody')) || ''; +let jctqWzBody = ($.isNode() ? process.env.jctqWzBody : $.getdata('jctqWzBody')) || ''; +let jctqLookStartbody = ($.isNode() ? process.env.jctqLookStartbody : $.getdata('jctqLookStartbody')) || ''; +let jctqWithdraw = ($.isNode() ? process.env.jctqWithdraw : $.getdata('jctqWithdraw')) || ''; +let jctqBubbleBody = ($.isNode() ? process.env.jctqBubbleBody : $.getdata('jctqBubbleBody')) || ''; +let jctqGiveBoxBody = ($.isNode() ? process.env.jctqGiveBoxBody : $.getdata('jctqGiveBoxBody')) || ''; +let jctqSignDoubleBody = ($.isNode() ? process.env.jctqSignDoubleBody : $.getdata('jctqSignDoubleBody')) || ''; +let jctqGoldBody = ($.isNode() ? process.env.jctqGoldBody : $.getdata('jctqGoldBody')) || ''; +let jctqVideoBody = ($.isNode() ? process.env.jctqVideoBody : $.getdata('jctqVideoBody')) || ''; + +/////////////////////////////////////////////////////////////////// + +!(async () => { + + if(typeof $request !== "undefined") + { + await getRewrite() + } else { + $.msg(jsname+': 此脚本只负责重写,请检查任务设置') + } + +})() +.catch((e) => $.logErr(e)) +.finally(() => $.done()) + +async function getRewrite() { + + if($request.url.indexOf('v17/NewTask/getTaskListByWeather.json') > -1) { + rUrl = $request.url + app_version = rUrl.match(/app_version=([\w\.]+)/)[1] + zqkey = rUrl.match(/zqkey=([\w-]+)/)[1] + zqkey_id = rUrl.match(/zqkey_id=([\w-]+)/)[1] + uid = rUrl.match(/uid=([\w]+)/)[1] + uidStr = 'uid=' + uid + + let newCookie = `app_version=${app_version}&cookie=${zqkey}&cookie_id=${zqkey_id}&uid=${uid}` + if(jctqCookie) { + if(jctqCookie.indexOf(uidStr) > -1) { + $.msg(jsname+` 此jctqCookie已存在,本次跳过`) + } else { + jctqCookie = jctqCookie + '@' + newCookie + $.setdata(jctqCookie, 'jctqCookie'); + bodyList = jctqCookie.split('@') + $.msg(jsname+` 获取第${bodyList.length}个jctqCookie成功`) + } + } else { + $.setdata(newCookie, 'jctqCookie'); + $.msg(jsname+` 获取第一个jctqCookie成功`) + } + } + + if($request.url.indexOf('v5/CommonReward/toGetReward.json') > -1) { + rBody = $request.body + if(jctqBoxbody) { + if(jctqBoxbody.indexOf(rBody) > -1) { + $.msg(jsname+` 此签到/奖励body已存在,本次跳过`) + } else { + jctqBoxbody = jctqBoxbody + '&' + rBody + $.setdata(jctqBoxbody, 'jctqBoxbody'); + bodyList = jctqBoxbody.split('&') + $.msg(jsname+` 获取第${bodyList.length}个签到/奖励body成功`) + } + } else { + $.setdata(rBody, 'jctqBoxbody'); + $.msg(jsname+` 获取第一个签到/奖励body成功`) + } + } + + if($request.url.indexOf('v5/article/info.json') > -1 || + $request.url.indexOf('v5/article/detail.json') > -1) { + rUrl = $request.url + bodys = rUrl.split('?p=') + rBody = 'p=' + bodys[1] + if(jctqWzBody) { + if(jctqWzBody.indexOf(rBody) > -1) { + $.msg(jsname+` 此文章/视频body已存在,本次跳过`) + } else { + jctqWzBody = jctqWzBody + '&' + rBody + $.setdata(jctqWzBody, 'jctqWzBody'); + bodyList = jctqWzBody.split('&') + $.msg(jsname+` 获取第${bodyList.length}个文章/视频body成功`) + } + } else { + $.setdata(rBody, 'jctqWzBody'); + $.msg(jsname+` 获取第一个文章/视频body成功`) + } + } + + if($request.url.indexOf('v5/user/stay.json') > -1) { + rBody = $request.body + if(jctqTimeBody) { + if(jctqTimeBody.indexOf(rBody) > -1) { + $.msg(jsname+` 此时长body已存在,本次跳过`) + } else { + jctqTimeBody = jctqTimeBody + '&' + rBody + $.setdata(jctqTimeBody, 'jctqTimeBody'); + bodyList = jctqTimeBody.split('&') + $.msg(jsname+` 获取第${bodyList.length}个时长body成功`) + } + } else { + $.setdata(rBody, 'jctqTimeBody'); + $.msg(jsname+` 获取第一个时长body成功`) + } + } + + if($request.url.indexOf('v5/nameless/adlickstart.json') > -1) { + rBody = $request.body + if(jctqLookStartbody) { + if(jctqLookStartbody.indexOf(rBody) > -1) { + $.msg(jsname+` 此看看赚body已存在,本次跳过`) + } else { + jctqLookStartbody = jctqLookStartbody + '&' + rBody + $.setdata(jctqLookStartbody, 'jctqLookStartbody'); + bodyList = jctqLookStartbody.split('&') + $.msg(jsname+` 获取第${bodyList.length}个看看赚body成功`) + } + } else { + $.setdata(rBody, 'jctqLookStartbody'); + $.msg(jsname+` 获取第一个看看赚body成功`) + } + } + + if($request.url.indexOf('v5/wechat/withdraw2.json') > -1) { + rBody = $request.body + if(jctqWithdraw) { + if(jctqWithdraw.indexOf(rBody) > -1) { + $.msg(jsname+` 此提现body已存在,本次跳过`) + } else { + jctqWithdraw = jctqWithdraw + '&' + rBody + $.setdata(jctqWithdraw, 'jctqWithdraw'); + bodyList = jctqWithdraw.split('&') + $.msg(jsname+` 获取第${bodyList.length}个提现body成功`) + } + } else { + $.setdata(rBody, 'jctqWithdraw'); + $.msg(jsname+` 获取第一个提现body成功`) + } + } + + if($request.url.indexOf('v5/Weather/giveBoxOnWeather.json') > -1) { + rBody = $request.body + if(jctqGiveBoxBody) { + if(jctqGiveBoxBody.indexOf(rBody) > -1) { + $.msg(jsname+` 此福利页宝箱/翻倍body已存在,本次跳过`) + } else { + jctqGiveBoxBody = jctqGiveBoxBody + '&' + rBody + $.setdata(jctqGiveBoxBody, 'jctqGiveBoxBody'); + bodyList = jctqGiveBoxBody.split('&') + $.msg(jsname+` 获取第${bodyList.length}个福利页宝箱/翻倍body成功`) + } + } else { + $.setdata(rBody, 'jctqGiveBoxBody'); + $.msg(jsname+` 获取第一个福利页宝箱/翻倍body成功`) + } + } + + if($request.url.indexOf('v5/weather/giveTimeInterval.json') > -1) { + rBody = $request.body + if(jctqBubbleBody) { + if(jctqBubbleBody.indexOf(rBody) > -1) { + $.msg(jsname+` 此首页气泡/翻倍body已存在,本次跳过`) + } else { + jctqBubbleBody = jctqBubbleBody + '&' + rBody + $.setdata(jctqBubbleBody, 'jctqBubbleBody'); + bodyList = jctqBubbleBody.split('&') + $.msg(jsname+` 获取第${bodyList.length}个首页气泡/翻倍body成功`) + } + } else { + $.setdata(rBody, 'jctqBubbleBody'); + $.msg(jsname+` 获取第一个首页气泡/翻倍body成功`) + } + } + + if($request.url.indexOf('v5/CommonReward/toDouble.json') > -1) { + rBody = $request.body + if(jctqSignDoubleBody) { + if(jctqSignDoubleBody.indexOf(rBody) > -1) { + $.msg(jsname+` 此签到翻倍body已存在,本次跳过`) + } else { + jctqSignDoubleBody = jctqSignDoubleBody + '&' + rBody + $.setdata(jctqSignDoubleBody, 'jctqSignDoubleBody'); + bodyList = jctqSignDoubleBody.split('&') + $.msg(jsname+` 获取第${bodyList.length}个签到翻倍body成功`) + } + } else { + $.setdata(rBody, 'jctqSignDoubleBody'); + $.msg(jsname+` 获取第一个签到翻倍body成功`) + } + } + + if($request.url.indexOf('v5/Weather/giveReceiveGoldCoin.json') > -1) { + rBody = $request.body + if(jctqGoldBody) { + if(jctqGoldBody.indexOf(rBody) > -1) { + $.msg(jsname+` 此收金币body已存在,本次跳过`) + } else { + jctqGoldBody = jctqGoldBody + '&' + rBody + $.setdata(jctqGoldBody, 'jctqGoldBody'); + bodyList = jctqGoldBody.split('&') + $.msg(jsname+` 获取第${bodyList.length}个收金币body成功`) + } + } else { + $.setdata(rBody, 'jctqGoldBody'); + $.msg(jsname+` 获取第一个收金币body成功`) + } + } + + if($request.url.indexOf('v17/Rvideo/videoCallback.json') > -1) { + rBody = $request.body + if(jctqVideoBody) { + if(jctqVideoBody.indexOf(rBody) > -1) { + $.msg(jsname+` 此资讯页视频奖励body已存在,本次跳过`) + } else { + jctqVideoBody = jctqVideoBody + '@' + rBody + $.setdata(jctqVideoBody, 'jctqVideoBody'); + bodyList = jctqVideoBody.split('@') + $.msg(jsname+` 获取第${bodyList.length}个资讯页视频奖励body成功`) + } + } else { + $.setdata(rBody, 'jctqVideoBody'); + $.msg(jsname+` 获取第一个资讯页视频奖励body成功`) + } + } +} + +//////////////////////////////////////////////////////////////////// +function Env(t, e) { 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("", `\ud83d\udd14${this.name}, \u5f00\u59cb!`) } 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("@"), a = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(a, (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"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t) { let e = { "M+": (new Date).getMonth() + 1, "d+": (new Date).getDate(), "H+": (new Date).getHours(), "m+": (new Date).getMinutes(), "s+": (new Date).getSeconds(), "q+": Math.floor(((new Date).getMonth() + 3) / 3), S: (new Date).getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, ((new Date).getFullYear() + "").substr(4 - RegExp.$1.length))); for (let s in e) new RegExp("(" + s + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? e[s] : ("00" + e[s]).substr(("" + e[s]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))); let h = ["", "==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="]; h.push(e), s && h.push(s), i && h.push(i), console.log(h.join("\n")), this.logs = this.logs.concat(h) } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t.stack) : this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) } diff --git a/jctq/jctq_rewrite_subscribe.json b/jctq/jctq_rewrite_subscribe.json index c83c209..9da565b 100644 --- a/jctq/jctq_rewrite_subscribe.json +++ b/jctq/jctq_rewrite_subscribe.json @@ -3,49 +3,81 @@ "type": "rewrite", "note": "仅供参考", "author": "leaf", - "resource": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_rewrite_subscribe.json", + "resource": "jctq_rewrite_subscribe.json", "mitmhost": [ "tq.xunsl.com" ], "rewrite": [ { - "match": "https://tq.xunsl.com/v5/nameless/adlickstart.json", - "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctqkkz.js", + "match": "https://tq.xunsl.com/v17/NewTask/getTaskListByWeather.json", + "stage": "req", + "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_rewrite.js", "enable": true }, { - "match": "https://tq.xunsl.com/v17/NewTask/getTaskListByWeather.json", - "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_today_score.js", + "match": "https://tq.xunsl.com/v5/CommonReward/toGetReward.json", + "stage": "req", + "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_rewrite.js", "enable": true }, { "match": "https://tq.xunsl.com/v5/article/info.json", - "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctqwz.js", + "stage": "req", + "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_rewrite.js", "enable": true }, { "match": "https://tq.xunsl.com/v5/article/detail.json", - "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctqwz.js", + "stage": "req", + "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_rewrite.js", "enable": true }, { "match": "https://tq.xunsl.com/v5/user/stay.json", - "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctqwz.js", + "stage": "req", + "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_rewrite.js", "enable": true }, { - "match": "https://tq.xunsl.com/v5/CommonReward/toGetReward.json", - "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctqqd.js", + "match": "https://tq.xunsl.com/v5/nameless/adlickstart.json", + "stage": "req", + "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_rewrite.js", "enable": true }, { - "match": "https://tq.xunsl.com/v5/CommonReward/toGetReward.json", - "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctqbox.js", + "match": "https://tq.xunsl.com/v5/wechat/withdraw2.json", + "stage": "req", + "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_rewrite.js", "enable": true }, { - "match": "https://tq.xunsl.com/v5/wechat/withdraw2.json", - "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_withdraw.js", + "match": "https://tq.xunsl.com/v5/Weather/giveBoxOnWeather.json", + "stage": "req", + "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_rewrite.js", + "enable": true + }, + { + "match": "https://tq.xunsl.com/v5/weather/giveTimeInterval.json", + "stage": "req", + "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_rewrite.js", + "enable": true + }, + { + "match": "https://tq.xunsl.com/v5/CommonReward/toDouble.json", + "stage": "req", + "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_rewrite.js", + "enable": true + }, + { + "match": "https://tq.xunsl.com/v5/Weather/giveReceiveGoldCoin.json", + "stage": "req", + "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_rewrite.js", + "enable": true + }, + { + "match": "https://tq.xunsl.com/v17/Rvideo/videoCallback.json", + "stage": "req", + "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_rewrite.js", "enable": true } ], @@ -55,92 +87,38 @@ { "name": "晶彩天气看看赚", "type": "cron", - "time": "21 8,20 * * *", - "job": { - "type": "runjs", - "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctqkkz.js" - }, - }, - { - "name": "晶彩天气每日收益", - "type": "cron", - "time": "18 22 * * *", - "job": { - "type": "runjs", - "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_today_score.js" - }, - }, - { - "name": "晶彩天气签到", - "type": "cron", - "time": "23 0,6 * * *", - "job": { - "type": "runjs", - "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctqqd.js" - }, - }, - { - "name": "晶彩天气文章", - "type": "cron", - "time": "12 7,19 * * *", - "job": { - "type": "runjs", - "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctqwz.js" - }, - }, - { - "name": "晶彩天气火爆转发", - "type": "cron", - "time": "12 6,12,18 * * *", - "job": { - "type": "runjs", - "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_share.js" - }, - }, - { - "name": "晶彩天气福利视频", - "type": "cron", - "time": "20 9,17 * * *", - "job": { - "type": "runjs", - "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_Adv_video.js" - }, - }, - { - "name": "晶彩抽奖", - "type": "cron", - "time": "31 8,16 * * *", + "time": "30 9,20 * * *", "job": { "type": "runjs", - "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_Rotary.js" - }, + "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_kkz.js" + } }, { - "name": "晶彩每日宝箱", + "name": "晶彩天气文章视频", "type": "cron", - "time": "24 21,22 * * *", + "time": "20 7,18 * * *", "job": { "type": "runjs", - "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctqbox.js" - }, + "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_read.js" + } }, { - "name": "晶彩好友签到红包", + "name": "晶彩天气日常任务", "type": "cron", - "time": "32 2,6,20 * * *", + "time": "15,45 * * * *", "job": { "type": "runjs", - "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_friendSign.js" - }, + "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_daily.js" + } }, { - "name": "晶彩天气提现", + "name": "晶彩天气任务签到", "type": "cron", - "time": "34 23 * * *", + "time": "30 22 * * *", "job": { "type": "runjs", - "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_withdraw.js" - }, + "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_reward.js" + } } ] } diff --git a/jctq/jctq_rewrite_subscribe.json.bak b/jctq/jctq_rewrite_subscribe.json.bak new file mode 100644 index 0000000..c38e922 --- /dev/null +++ b/jctq/jctq_rewrite_subscribe.json.bak @@ -0,0 +1,102 @@ +{ + "name": "晶彩天气重写订阅", + "type": "rewrite", + "note": "仅供参考", + "author": "leaf", + "resource": "jctq_rewrite_subscribe.json", + "mitmhost": [ + "tq.xunsl.com" + ], + "rewrite": [ + { + "match": "https://tq.xunsl.com/v17/NewTask/getTaskListByWeather.json", + "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_rewrite.js", + "enable": true + }, + { + "match": "https://tq.xunsl.com/v5/CommonReward/toGetReward.json", + "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_rewrite.js", + "enable": true + }, + { + "match": "https://tq.xunsl.com/v5/article/info.json", + "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_rewrite.js", + "enable": true + }, + { + "match": "https://tq.xunsl.com/v5/article/detail.json", + "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_rewrite.js", + "enable": true + }, + { + "match": "https://tq.xunsl.com/v5/user/stay.json", + "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_rewrite.js", + "enable": true + }, + { + "match": "https://tq.xunsl.com/v5/nameless/adlickstart.json", + "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_rewrite.js", + "enable": true + }, + { + "match": "https://tq.xunsl.com/v5/wechat/withdraw2.json", + "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_rewrite.js", + "enable": true + }, + { + "match": "https://tq.xunsl.com/v5/Weather/giveBoxOnWeather.json", + "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_rewrite.js", + "enable": true + }, + { + "match": "https://tq.xunsl.com/v5/weather/giveTimeInterval.json", + "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_rewrite.js", + "enable": true + } + ], + "task": { + "type": "skip", + "list": [ + { + "name": "晶彩天气看看赚", + "type": "cron", + "time": "30 9,20 * * *", + "job": { + "type": "runjs", + "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_kkz.js" + }, + "running": true + }, + { + "name": "晶彩天气文章视频", + "type": "cron", + "time": "20 7,18 * * *", + "job": { + "type": "runjs", + "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_read.js" + }, + "running": true + }, + { + "name": "晶彩天气日常任务", + "type": "cron", + "time": "15,45 * * * *", + "job": { + "type": "runjs", + "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_daily.js" + }, + "running": true + }, + { + "name": "晶彩天气任务签到", + "type": "cron", + "time": "30 22 * * *", + "job": { + "type": "runjs", + "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_reward.js" + }, + "running": true + } + ] + } +} \ No newline at end of file diff --git a/jctq/jctq_share.js b/jctq/jctq_share.js deleted file mode 100644 index 0bc38f4..0000000 --- a/jctq/jctq_share.js +++ /dev/null @@ -1,199 +0,0 @@ -const $ = new Env("晶彩天气火爆转发"); -const notify = $.isNode() ? require('./sendNotify') : ''; -message = "" -let jctqCookie= $.isNode() ? (process.env.jctqCookie ? process.env.jctqCookie : "") : ($.getdata('jctqCookie') ? $.getdata('jctqCookie') : "") -let jctqCookieArr = [] -let jctqCookies = "" - -var myDate = new Date(); -var hour=myDate.getHours(); -console.log(hour) - - - - - if (!jctqCookie) { - $.msg($.name, '【提示】进入点击右下角"赚钱图标",再跑一次脚本', '不知道说啥好', { - "open-url": "给您劈个叉吧" - }); - $.done() - } - else if (jctqCookie.indexOf("@") == -1 && jctqCookie.indexOf("@") == -1) { - jctqCookieArr.push(jctqCookie) - } - else if (jctqCookie.indexOf("@") > -1) { - jctqCookies = jctqCookie.split("@") - } - else if (process.env.jctqCookie && process.env.jctqCookie.indexOf('@') > -1) { - jctqCookieArr = process.env.jctqCookie.split('@'); - console.log(`您选择的是用"@"隔开\n`) - } - else { - jctqCookies = [process.env.jctqCookie] - }; - Object.keys(jctqCookies).forEach((item) => { - if (jctqCookies[item]) { - jctqCookieArr.push(jctqCookies[item]) - } - }) - -!(async () => { - if (typeof $request !== "undefined") { - await getjctqCookie() - $.done()}else { - console.log(`共${jctqCookieArr.length}个cookie`) - for (let k = 0; k < jctqCookieArr.length; k++) { - // $.message = "" - //bodyVal2 =jctqCookie2.split('&token=')[0] - //console.log(`${bodyVal2}`) - - - if (hour > 4 && hour !== 10 && hour !== 16 && hour !== 22) { - var time1 = Date.parse(new Date()).toString(); - time1 = time1.substr(0, 10); - bodyVal = jctqCookieArr[k].split('&uid=')[0]; - cookie = bodyVal.replace(/zqkey=/, "cookie=") - cookie_id = cookie.replace(/zqkey_id=/, "cookie_id=") - jctqCookie1 = cookie_id + '&device_brand=xfdg&device_id=cc7dgdsgfsz83e&device_model=1gx&device_platform=android&device_type=android&inner_version=202107261526&mi=0&openudid=cc7dgdsgfsz83e&os_api=27&os_version=bdftgsdfga&phone_network=WIFI&phone_sim=1' + '&request_time=' + time1 + '&time=' + time1 + '&' + bodyVal - - //待处理cookie - - //console.log(`${jctqCookie1}`) - console.log(`--------第 ${k + 1} 次转发奖励执行中--------\n`) - - await wzlist() - await $.wait(4000); - await sharejl() - //console.log(typeof(jctqCookie1)); - //console.log(jctqCookie1.length.toString()); - await $.wait(4000); - console.log("\n\n") - } else { - console.log('\n现在不是转发时段!') - } - } - } - })() - .catch((e) => $.logErr(e)) - .finally(() => $.done()) - -function wzlist(timeout = 5000) { - return new Promise((resolve) => { - let url = { - url : 'https://tq.xunsl.com/WebApi/ArticleTop/listsNewTag', - headers : {'Host': 'tq.xunsl.com'}, - //body : wzbody1, - }//xsgbody,} - $.post(url, async (err, resp, data) => { - try { - - const result = JSON.parse(data) - if(result.data.items !== "undefined" ){ - wzid = result.data.items[0].id - console.log(result.data.items[0].id) - await $.wait(3000); - await share(wzid) - - }else{ - console.log(result) - } - } catch (e) { - } finally { - resolve() - } - },timeout) - }) -} - -function share(wzid,timeout=0) { - return new Promise((resolve) => { - let url = { - url : 'https://tq.xunsl.com/WebApi/ShareNew/getShareArticleReward', - headers : { - 'Content-Type': 'application/x-www-form-urlencoded', - 'Content-Length': (jctqCookie1+ '&article_id='+wzid).length.toString(), - 'Host': 'tq.xunsl.com', - 'Referer': 'https://tq.xunsl.com/h5/hotShare/?' +jctqCookie1 -}, - body : jctqCookie1 + '&article_id='+wzid,} - $.post(url, async (err, resp, data) => { - try { - - const result = JSON.parse(data) - if(result.status == 1){ - console.log(result.data) - }else{ - console.log(result) - } - } catch (e) { - } finally { - resolve() - } - },timeout) - }) -} - -function sharejl(timeout=0) { - return new Promise((resolve) => { - if(hour >= 5 && hour <=10 ){ - reward = 'one' - }else if(hour >= 11 && hour <=16){ - reward = 'two' - }else if(hour >= 17 && hour <=22){ - reward = 'three' - } - let url = { - url : 'https://tq.xunsl.com/WebApi/ShareNew/execExtractTask', - headers : { - 'Content-Type': 'application/x-www-form-urlencoded', - 'Content-Length': (jctqCookie1+ '&action=beread_extra_reward_'+ reward).length.toString(), - 'Host': 'tq.xunsl.com', - 'Referer': 'https://tq.xunsl.com/h5/20200612makeMoney/?' +jctqCookie1 -}, - body : jctqCookie1 + '&action=beread_extra_reward_'+ reward,} - $.post(url, async (err, resp, data) => { - try { - - const result = JSON.parse(data) - if(result.status == 1){ - console.log(result.data) - }else{ - console.log(result) - } - } catch (e) { - } finally { - resolve() - } - },timeout) - }) -} - - -async function getjctqCookie() { - if ($request.url.match(/\/tq.xunsl.com\/v17\/NewTask\/getTaskList/)) { - bodyVal1 = $request.url.split('?')[1] - bodyVal2 = bodyVal1.split('&token')[0] - bodyVal3 = bodyVal2.split('&zqkey=')[1] - bodyVal4 = bodyVal2.split('&uid=')[1] - bodyVal5 = bodyVal4.split('&version_code=')[0] - bodyVal = 'zqkey='+ bodyVal3 + '&uid='+ bodyVal5 - if (jctqCookie) { - if (jctqCookie.indexOf(bodyVal5) > -1) { - $.log("此cookie已存在,本次跳过") - } else if (jctqCookie.indexOf(bodyVal5) === -1) { - jctqCookies = jctqCookie + "@" + bodyVal; - $.setdata(jctqCookies, 'jctqCookie'); - $.log(`${$.name}获取cookie: 成功, jctqCookies: ${bodyVal}`); - bodys = jctqCookies.split("@") - // $.msg($.name, "获取第" + bodys.length + "个阅读请求: 成功🎉", ``) - } - } else { - $.setdata(bodyVal, 'jctqCookie'); - $.log(`${$.name}获取cookie: 成功, jctqCookies: ${bodyVal}`); - $.msg($.name, `获取第一个cookie: 成功🎉`, ``) - } - } - - } - -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("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}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("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(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"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} \ No newline at end of file diff --git a/jctq/jctq_shareRead.js b/jctq/jctq_shareRead.js new file mode 100644 index 0000000..b534a65 --- /dev/null +++ b/jctq/jctq_shareRead.js @@ -0,0 +1,331 @@ +/* +安卓:晶彩天气(v8.3.7) + +转发和分享阅读,请勿贪心,小心黑号 +*/ + +const jsname = '晶彩天气分享阅读' +const $ = Env(jsname) +const notifyFlag = 1; //0为关闭通知,1为打开通知,默认为1 +const logDebug = 0 + +//const notify = $.isNode() ? require('./sendNotify') : ''; +let notifyStr = '' + +let rndtime = "" //毫秒 +let httpResult //global buffer + +let jctqCookie = ($.isNode() ? process.env.jctqCookie : $.getdata('jctqCookie')) || ''; +let jctqCookieArr = [] + +let userCk = '' +let readCount = 0 + +let jctqShareNum = ($.isNode() ? process.env.jctqShareNum : $.getdata('jctqShareNum')) || 0; + +let newsItem = '' +let UserAgent = '' +let si = '' + +/////////////////////////////////////////////////////////////////// + +!(async () => { + + if(typeof $request !== "undefined") + { + $.msg(jsname+': 此脚本不做重写,请检查重写设置') + } + else + { + if(!(await checkEnv())){ + return + } + + for(let j=0; j maxWaitTime ? maxWaitTime : seedFactor + let randomTime = Math.floor(Math.random()*factor) + 1000 + let second = Math.floor(randomTime/1000) + UserAgent = 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.16(0x1800102c) NetType/WIFI Language/zh_CN' + si = randomString(32) + console.log(`--随机延迟${second}秒后开始模拟第${readCount}次分享阅读`) + await $.wait(randomTime) + console.log(`----模拟第${readCount}次阅读,使用si=${si}`) + await shareReadStep1() + await $.wait(Math.floor(Math.random()*500)+500) + await shareReadStep2() + await $.wait(Math.floor(Math.random()*1000)+2000) + await shareReadStep3() + await $.wait(Math.floor(Math.random()*1000)+2000) + await shareReadStep4() + console.log(`----模拟第${readCount}次阅读完成`) + } + + } + } + } + + +})() +.catch((e) => $.logErr(e)) +.finally(() => $.done()) + +//通知 +async function showmsg() { + + notifyBody = jsname + "运行通知\n\n" + notifyStr + + if (notifyFlag != 1) { + console.log(notifyBody); + } + + if (notifyFlag == 1) { + $.msg(notifyBody); + //if ($.isNode()){await notify.sendNotify($.name, notifyBody );} + } +} + +async function checkEnv() { + + if(jctqShareNum == 0) { + console.log('当前分享次数设置为0。如果需要开启分享阅读,请设置环境变量jctqShareNum为要被阅读的次数。') + return false + } + + if(jctqCookie) { + if(jctqCookie.indexOf('@') > -1) { + let jctqCookies = jctqCookie.split('@') + for(let i=0; i { + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log(caller + ": post请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + httpResult = JSON.parse(data,caller); + if(logDebug) console.log(httpResult); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +async function httpGet(url,caller) { + httpResult = null + return new Promise((resolve) => { + $.get(url, async (err, resp, data) => { + try { + if (err) { + console.log(caller + ": get请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + // + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +function safeGet(data,caller) { + try { + if (typeof JSON.parse(data) == "object") { + return true; + } else { + console.log(`Function ${caller}: 未知错误`); + console.log(data) + } + } catch (e) { + console.log(e); + console.log(`Function ${caller}: 服务器访问数据为空,请检查自身设备网络情况`); + return false; + } +} + +function printCaller(){ + return (new Error()).stack.split("\n")[2].trim().split(" ")[1] +} + +function Env(t, e) { 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("", `\ud83d\udd14${this.name}, \u5f00\u59cb!`) } 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("@"), a = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(a, (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"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t) { let e = { "M+": (new Date).getMonth() + 1, "d+": (new Date).getDate(), "H+": (new Date).getHours(), "m+": (new Date).getMinutes(), "s+": (new Date).getSeconds(), "q+": Math.floor(((new Date).getMonth() + 3) / 3), S: (new Date).getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, ((new Date).getFullYear() + "").substr(4 - RegExp.$1.length))); for (let s in e) new RegExp("(" + s + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? e[s] : ("00" + e[s]).substr(("" + e[s]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))); let h = ["", "==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="]; h.push(e), s && h.push(s), i && h.push(i), console.log(h.join("\n")), this.logs = this.logs.concat(h) } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t.stack) : this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) } diff --git a/jctq/jctq_task_subscribe.json b/jctq/jctq_task_subscribe.json index 1e27df5..4064c76 100644 --- a/jctq/jctq_task_subscribe.json +++ b/jctq/jctq_task_subscribe.json @@ -1,98 +1,48 @@ { - "name": "晶彩天气任务订阅", + "name": "晶彩天气重写订阅", + "type": "rewrite", + "note": "仅供参考", "author": "leaf", - "note": "请自行修改运行时间", - "date": "2021-11-12 00:08:11", "list": [ - { - "name": "晶彩天气看看赚", - "type": "cron", - "time": "21 8,20 * * *", - "job": { - "type": "runjs", - "target": "jctqkkz.js" - } - }, - { - "name": "晶彩天气每日收益", - "type": "cron", - "time": "18 22 * * *", - "job": { - "type": "runjs", - "target": "jctq_today_score.js" - } - }, - { - "name": "晶彩天气签到", - "type": "cron", - "time": "23 0,6 * * *", - "job": { - "type": "runjs", - "target": "jctqqd.js" - } - }, - { - "name": "晶彩天气文章", - "type": "cron", - "time": "12 7,19 * * *", - "job": { - "type": "runjs", - "target": "jctqwz.js" - } - }, - { - "name": "晶彩天气火爆转发", - "type": "cron", - "time": "12 6,12,18 * * *", - "job": { - "type": "runjs", - "target": "jctq_share.js" - } - }, - { - "name": "晶彩天气福利视频", - "type": "cron", - "time": "20 9,17 * * *", - "job": { - "type": "runjs", - "target": "jctq_Adv_video.js" - } - }, - { - "name": "晶彩天气抽奖", - "type": "cron", - "time": "31 8,16 * * *", - "job": { - "type": "runjs", - "target": "jctq_Rotary.js" - } - }, - { - "name": "晶彩天气每日宝箱", - "type": "cron", - "time": "24 21,22 * * *", - "job": { - "type": "runjs", - "target": "jctqbox.js" - } - }, - { - "name": "晶彩天气好友红包", - "type": "cron", - "time": "32 2,6,20 * * *", - "job": { - "type": "runjs", - "target": "jctq_friendSign.js" - } - }, - { - "name": "晶彩天气提现", - "type": "cron", - "time": "34 23 * * *", - "job": { - "type": "runjs", - "target": "jctq_withdraw.js" - } - } - ] -} + { + "name": "晶彩天气看看赚", + "type": "cron", + "time": "30 9,20 * * *", + "job": { + "type": "runjs", + "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_kkz.js" + }, + "running": true + }, + { + "name": "晶彩天气文章视频", + "type": "cron", + "time": "20 7,18 * * *", + "job": { + "type": "runjs", + "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_read.js" + }, + "running": true + }, + { + "name": "晶彩天气日常任务", + "type": "cron", + "time": "15,45 * * * *", + "job": { + "type": "runjs", + "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_daily.js" + }, + "running": true + }, + { + "name": "晶彩天气任务签到", + "type": "cron", + "time": "30 22 * * *", + "job": { + "type": "runjs", + "target": "https://raw.githubusercontent.com/leafxcy/JavaScript/main/jctq/jctq_reward.js" + }, + "running": true + } + ] +} \ No newline at end of file diff --git a/jctq/jctq_today_score.js b/jctq/jctq_today_score.js deleted file mode 100644 index 4b760e6..0000000 --- a/jctq/jctq_today_score.js +++ /dev/null @@ -1,134 +0,0 @@ -const $ = new Env("晶彩天气收益统计"); -const notify = $.isNode() ? require('./sendNotify') : ''; -message = "" -let jctqCookie= $.isNode() ? (process.env.jctqCookie ? process.env.jctqCookie : "") : ($.getdata('jctqCookie') ? $.getdata('jctqCookie') : "") -let jctqCookieArr = [] -let jctqCookies = "" - - - - - -if (!jctqCookie) { - $.msg($.name, '【提示】进入点击右下角"赚钱图标",再跑一次脚本', '不知道说啥好', { - "open-url": "给您劈个叉吧" - }); - $.done() - } - else if (jctqCookie.indexOf("@") == -1 && jctqCookie.indexOf("@") == -1) { - jctqCookieArr.push(jctqCookie) - } - else if (jctqCookie.indexOf("@") > -1) { - jctqCookies = jctqCookie.split("@") - } - else if (process.env.jctqCookie && process.env.jctqCookie.indexOf('@') > -1) { - jctqCookieArr = process.env.jctqCookie.split('@'); - console.log(`您选择的是用"@"隔开\n`) - } - else { - jctqCookies = [process.env.jctqCookie] - }; - Object.keys(jctqCookies).forEach((item) => { - if (jctqCookies[item]) { - jctqCookieArr.push(jctqCookies[item]) - } - }) - -!(async () => { - if (typeof $request !== "undefined") { - getjctqCookie() - $.done() - }else { - console.log(`共${jctqCookieArr.length}个cookie`) - for (let k = 0; k < jctqCookieArr.length; k++) { - $.message = "" - bodyVal = jctqCookieArr[k].split('&uid=')[0]; - cookie = bodyVal.replace(/zqkey=/, "cookie=") - cookie_id = cookie.replace(/zqkey_id=/, "cookie_id=") - jctqCookie1 = cookie_id + '&' + bodyVal - //待处理cookie - console.log(`${jctqCookie1}`) - console.log(`--------第 ${k + 1} 个账号收益查询中--------\n`) - await today_score(jctqCookie1) - if ($.message.length != 0) { - message += "账号" + (k + 1) + ": " + $.message + " \n" - } - await $.wait(4000); - console.log("\n\n") - } - - - if (message.length != 0) { - await notify ? notify.sendNotify("晶彩天气收益查询", `${message}\n\n shaolin-kongfu`) : - $.msg($.name, "晶彩天气收益查询", `${message}`); - } else if ($.isNode()) { - await notify.sendNotify("晶彩天气收益查询", `${message}\n\nshaolin-kongfu`); - } - } - })() - .catch((e) => $.logErr(e)) - .finally(() => $.done()) - - -function today_score(jctqCookie1,timeout = 0) { - return new Promise((resolve) => { - let url = { - url : 'https://tq.xunsl.com/wap/user/balance?'+ jctqCookie1, - headers : { - 'Host': 'tq.xunsl.com' -}, - } - $.get(url, async (err, resp, data) => { - try { - - const result = JSON.parse(data) - if(result.status == 0){ - console.log('\n今日收益总计:'+result.user.today_score) - console.log('\n当前金币总数:'+result.user.score) - console.log('\n折合人民币总数:'+result.user.money) - $.message = `今日收益总计:${result.user.today_score}金币\n 当前金币总数:${result.user.score} \n 折合人民币总数:${result.user.money}元` - $.msg($.name, "", `今日收益总计:${result.user.today_score}金币\n 当前金币总数:${result.user.score} \n 折合人民币总数:${result.user.money}元`); - }else{ - console.log(result) - } - } catch (e) { - } finally { - resolve() - } - },timeout) - }) -} - - - -async function getjctqCookie() { - if ($request.url.match(/\/tq.xunsl.com\/v17\/NewTask\/getTaskList/)) { - bodyVal1 = $request.url.split('?')[1] - bodyVal2 = bodyVal1.split('&token')[0] - bodyVal3 = bodyVal2.split('&zqkey=')[1] - bodyVal4 = bodyVal2.split('&uid=')[1] - bodyVal5 = bodyVal4.split('&version_code=')[0] - bodyVal = 'zqkey='+ bodyVal3 + '&uid='+ bodyVal5 - if (jctqCookie) { - if (jctqCookie.indexOf(bodyVal5) > -1) { - $.log("此cookie已存在,本次跳过") - } else if (jctqCookie.indexOf(bodyVal5) === -1) { - jctqCookies = jctqCookie + "@" + bodyVal; - $.setdata(jctqCookies, 'jctqCookie'); - $.log(`${$.name}获取cookie: 成功, jctqCookies: ${bodyVal}`); - bodys = jctqCookies.split("@") - $.msg($.name, "获取第" + bodys.length + "个cookie: 成功🎉", ``) - } - } else { - $.setdata(bodyVal, 'jctqCookie'); - $.log(`${$.name}获取cookie: 成功, jctqCookies: ${bodyVal}`); - $.msg($.name, `获取第一个cookie: 成功🎉`, ``) - } - } - - } - -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("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}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("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(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"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} - - - diff --git a/jctq/jctq_withdraw.js b/jctq/jctq_withdraw.js deleted file mode 100644 index 636e5be..0000000 --- a/jctq/jctq_withdraw.js +++ /dev/null @@ -1,206 +0,0 @@ -const $ = new Env("晶彩天气提现"); -const notify = $.isNode() ? require('./sendNotify') : ''; -message = "" -let jctqWithdraw= $.isNode() ? (process.env.jctqWithdraw ? process.env.jctqWithdraw : "") : ($.getdata('jctqWithdraw') ? $.getdata('jctqWithdraw') : "") -let jctqWithdrawArr = [] -let jctqWithdraws = "" -let jc_cash = $.getdata('jc_cash') || 0.3; -let jctqCookie= $.isNode() ? (process.env.jctqCookie ? process.env.jctqCookie : "") : ($.getdata('jctqCookie') ? $.getdata('jctqCookie') : "") -let jctqCookieArr = [] -let jctqCookies = "" -let nowmoney; - - - -var time1 = Date.parse( new Date() ).toString(); - time1 = time1.substr(0,10); -if (!jctqWithdraw) { - $.msg($.name, '【提示】请先完成一次提现,明天再跑一次脚本', '不知道说啥好', { - "open-url": "给您劈个叉吧" - }); - - $.done() - } - else if (jctqWithdraw.indexOf("@") == -1 && jctqWithdraw.indexOf("@") == -1) { - jctqWithdrawArr.push(jctqWithdraw) - } - else if (jctqWithdraw.indexOf("@") > -1) { - jctqWithdraws = jctqWithdraw.split("@") - } - else if (process.env.jctqWithdraw && process.env.jctqWithdraw.indexOf('@') > -1) { - jctqWithdrawArr = process.env.jctqWithdraw.split('@'); - console.log(`您选择的是用"@"隔开\n`) - } - else { - jctqWithdraws = [process.env.jctqWithdraw] - }; - Object.keys(jctqWithdraws).forEach((item) => { - if (jctqWithdraws[item]) { - jctqWithdrawArr.push(jctqWithdraws[item]) - } - }) - - -if (!jctqCookie) { - $.msg($.name, '【提示】进入点击右下角"赚钱图标",再跑一次脚本', '不知道说啥好', { - "open-url": "给您劈个叉吧" - }); - $.done() - } - else if (jctqCookie.indexOf("@") == -1 && jctqCookie.indexOf("@") == -1) { - jctqCookieArr.push(jctqCookie) - } - else if (jctqCookie.indexOf("@") > -1) { - jctqCookies = jctqCookie.split("@") - } - else if (process.env.jctqCookie && process.env.jctqCookie.indexOf('@') > -1) { - jctqCookieArr = process.env.jctqCookie.split('@'); - console.log(`您选择的是用"@"隔开\n`) - } - else { - jctqCookies = [process.env.jctqCookie] - }; - Object.keys(jctqCookies).forEach((item) => { - if (jctqCookies[item]) { - jctqCookieArr.push(jctqCookies[item]) - } - }) - -!(async () => { - if (typeof $request !== "undefined") { - getbody() - $.done() - }else { - console.log(`共${jctqCookieArr.length}个cookie`) - for (let k = 0; k < jctqCookieArr.length; k++) { - $.message = "" - bodyVal = jctqCookieArr[k].split('&uid=')[0]; - cookie = bodyVal.replace(/zqkey=/, "cookie=") - cookie_id = cookie.replace(/zqkey_id=/, "cookie_id=") - jctqCookie1 = cookie_id + '&' + bodyVal - //待处理cookie - console.log(`--------第 ${k + 1} 个账号收益查询中--------\n`) - jctqWithdraw1 = jctqWithdrawArr[k] - await today_score(jctqCookie1) - - - if ($.message.length != 0) { - message += "账号" + (k + 1) + ": " + $.message + " \n" - } - await $.wait(4000); - console.log("\n\n") - } - - - if (message.length != 0) { - await notify ? notify.sendNotify("晶彩天气提现", `${message}\n\n shaolin-kongfu`) : - $.msg($.name, "晶彩天气提现", `${message}\n\n shaolin-kongfu`); - } else if ($.isNode()) { - await notify.sendNotify("晶彩天气提现", `${message}\n\nshaolin-kongfu`); - } - } - })() - .catch((e) => $.logErr(e)) - .finally(() => $.done()) - - - -function withdraw(jctqWithdraw1,timeout = 0) { - return new Promise((resolve) => { - let url = { - url : 'https://tq.xunsl.com/v5/wechat/withdraw2.json', - headers : { - 'request_time' : time1, - 'access' : 'WIFI', - 'os-api' : '29', - 'app-type' : 'jcweather', - 'device-platform' : 'android', - 'app-version' : '8.3.7', - 'Content-Type' : 'application/x-www-form-urlencoded', - 'Host' : 'tq.xunsl.com', - 'Connection' : 'Keep-Alive', - 'Accept-Encoding' : 'gzip', - 'User-Agent' : 'okhttp/3.12.2', - }, - body : jctqWithdraw1,} - $.post(url, async (err, resp, data) => { - try { - - const result = JSON.parse(data) - if (result.error_code == 0) { - console.log(result) - console.log(`【自动提现】提现${jc_cash}元成功\n`) - $.message = `【自动提现】提现${jc_cash}元成功\n` - //$.msg($.name,$.sub,$.desc) - } else { - console.log(result) - } - } catch (e) { - } finally { - resolve() - } - },timeout) - }) -} - - -function getbody() { - if ($request.url.match(/\/tq.xunsl.com\/v5\/wechat\/withdraw2.json/)) { - bodyVal=$request.body - console.log(bodyVal) - if (jctqWithdraw) { - if (jctqWithdraw.indexOf(bodyVal) > -1) { - $.log("此提现请求已存在,本次跳过") - } else if (jctqWithdraw.indexOf(bodyVal) == -1) { - jctqWithdraws = jctqWithdraw + "@" + bodyVal; - $.setdata(jctqWithdraws,'jctqWithdraw'); - $.log(`${$.name}获取提现: 成功, jctqWithdraws: ${bodyVal}`); - bodys = jctqWithdraws.split("@") - $.msg($.name, "获取第" + bodys.length + "个提现请求: 成功🎉", ``) - } - } else { - $.setdata($request.body,'jctqWithdraw'); - $.log(`${$.name}获取提现: 成功, jctqWithdraws: ${bodyVal}`); - $.msg($.name, `获取第一个提现请求: 成功🎉`, ``) - } - } -} - - -function today_score(jctqCookie1,timeout = 0) { - return new Promise((resolve) => { - let url = { - url : 'https://tq.xunsl.com/wap/user/balance?'+ jctqCookie1, - headers : { - 'Host': 'tq.xunsl.com' -}, - } - $.get(url, async (err, resp, data) => { - try { - - const result = JSON.parse(data) - if(result.status == 0){ - - console.log('\n当前金币总数:'+result.user.score) - console.log('\n折合人民币总数:'+result.user.money) - nowmoney = result.user.money - if(nowmoney >= jc_cash){ - await $.wait(3000); - await withdraw(jctqWithdraw1) - } - $.message = `当前金币总数:${result.user.score} \n 折合人民币总数:${result.user.money}元` - //$.msg($.name, "", `当前金币总数:${result.user.score} \n 折合人民币总数:${result.user.money}元`); - }else{ - console.log(result) - } - } catch (e) { - } finally { - resolve() - } - },timeout) - }) -} - -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("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}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("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(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"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} - - diff --git a/jctq/jctqbox.js b/jctq/jctqbox.js deleted file mode 100644 index 4645d9d..0000000 --- a/jctq/jctqbox.js +++ /dev/null @@ -1,108 +0,0 @@ -const $ = new Env('晶彩天气任务宝箱领取'); -let jctqBoxbody= $.isNode() ? (process.env.jctqBoxbody ? process.env.jctqBoxbody : "") : ($.getdata('jctqBoxbody') ? $.getdata('jctqBoxbody') : "") -let jctqBoxbodyArr = [] -let jctqBoxbodys = "" - - - -if (!jctqBoxbody) { - $.msg($.name, '【提示】请在app下方点击赚钱图标,在每日任务中点击所有可领取的奖励,获取body,明天再跑一次脚本', '不知道说啥好', { - "open-url": "给您劈个叉吧" - }); - $.done() - } - else if (jctqBoxbody.indexOf("&") == -1) { - jctqBoxbodyArr.push(jctqBoxbody) - } - else if (jctqBoxbody.indexOf("&") > -1) { - jctqBoxbodys = jctqBoxbody.split("&") - } - else if (process.env.jctqBoxbody && process.env.jctqBoxbody.indexOf('&') > -1) { - jctqBoxbodyArr = process.env.jctqBoxbody.split('&'); - console.log(`您选择的是用"&"隔开\n`) - } - else { - jctqBoxbodys = [process.env.jctqBoxbody] - }; - Object.keys(jctqBoxbodys).forEach((item) => { - if (jctqBoxbodys[item]) { - jctqBoxbodyArr.push(jctqBoxbodys[item]) - } - }) - -!(async () => { -if (typeof $request !== "undefined") { - getjctqBoxbody() - $.done() - }else { - console.log(`共${jctqBoxbodyArr.length}个宝箱奖励body`) - for (let k = 0; k < jctqBoxbodyArr.length; k++) { - // $.message = "" - jctqBoxbody1 = jctqBoxbodyArr[k]; - console.log(`${jctqBoxbody1}`) - console.log(`--------第 ${k + 1} 次宝箱奖励执行中--------\n`) - let jctqBoxheader = { - 'device-platform': 'android', - 'Content-Type': 'application/x-www-form-urlencoded', - 'Content-Length': jctqBoxbody1.length.toString(), - 'Host': 'tq.xunsl.com', - } - await jctqBoxreward(jctqBoxheader) - console.log(typeof (jctqBoxbody1)); - console.log(jctqBoxbody1.length.toString()); - await $.wait(4000); - console.log("\n\n") - } -} - })() - .catch((e) => $.logErr(e)) - .finally(() => $.done()) - -function getjctqBoxbody() { - if ($request.url.match(/\/tq.xunsl.com\/v5\/CommonReward\/toGetReward/)) { - bodyVal = $request.body - if (jctqBoxbody) { - if (jctqBoxbody.indexOf(bodyVal) > -1) { - $.log("此宝箱请求已存在,本次跳过") - } else if (jctqBoxbody.indexOf(bodyVal) == -1) { - jctqBoxbodys = jctqBoxbody + "&" + bodyVal; - $.setdata(jctqBoxbodys, 'jctqBoxbody'); - $.log(`${$.name}获取宝箱: 成功, jctqBoxbodys: ${bodyVal}`); - bodys = jctqBoxbodys.split("&") - $.msg($.name, "获取第" + bodys.length + "个宝箱请求: 成功🎉", ``) - } - } else { - $.setdata(bodyVal, 'jctqBoxbody'); - $.log(`${$.name}获取宝箱: 成功, jctqBoxbodys: ${bodyVal}`); - $.msg($.name, `获取第一个宝箱请求: 成功🎉`, ``) - } - } - - } -//宝箱 -function jctqBoxreward(jctqBoxheader,timeout=0) { - return new Promise((resolve) => { - let url = { - url : 'https://tq.xunsl.com/v5/CommonReward/toGetReward.json', - headers : jctqBoxheader, - body : jctqBoxbody1,} - $.post(url, async (err, resp, data) => { - try { - - const result = JSON.parse(data) - if(result.success !== false ){ - console.log('\n领取宝箱奖励成功,获得:'+result.items.score + '金币') - }else{ - console.log('\n领取宝箱奖励失败,'+result.error_code) - console.log(result) - } - } catch (e) { - } finally { - resolve() - } - },timeout) - }) -} - -function Env(t,e){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("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}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("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(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"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} - diff --git a/jctq/jctqkkz.js b/jctq/jctqkkz.js deleted file mode 100644 index 46e93f0..0000000 --- a/jctq/jctqkkz.js +++ /dev/null @@ -1,271 +0,0 @@ -const $ = new Env("晶彩天气看看赚"); -const notify = $.isNode() ? require('./sendNotify') : ''; -message = "" - -let jctqLookStartbody= $.isNode() ? (process.env.jctqLookStartbody ? process.env.jctqLookStartbody : "") : ($.getdata('jctqLookStartbody') ? $.getdata('jctqLookStartbody') : "") -let jctqLookStartbodyArr = [] -let jctqLookStartbodys = "" - -let jctqCookie= $.isNode() ? (process.env.jctqCookie ? process.env.jctqCookie : "") : ($.getdata('jctqCookie') ? $.getdata('jctqCookie') : "") -let jctqCookieArr = [] -let jctqCookies = "" - - -const jctqLookheader = { - 'device-platform': 'android', - 'Content-Type': 'application/x-www-form-urlencoded', - 'Host': 'tq.xunsl.com', - 'app-type' : 'jcweather', -} - -const jctqRewardheader={ - 'device-platform': 'android', - 'Content-Type': 'application/x-www-form-urlencoded', - 'Host': 'tq.xunsl.com', - 'app-type' : 'jcweather', -} - -const jctqLookStartheader={ - 'device-platform': 'android', - 'Content-Type': 'application/x-www-form-urlencoded', - 'Host': 'tq.xunsl.com', - 'app-type' : 'jcweather', -} - - - -if (!jctqCookie) { - $.msg($.name, '【提示】进入点击右下角"赚钱图标",再跑一次脚本', '不知道说啥好', { - "open-url": "给您劈个叉吧" - }); - $.done() - } - else if (jctqCookie.indexOf("@") == -1 && jctqCookie.indexOf("@") == -1) { - jctqCookieArr.push(jctqCookie) - } - else if (jctqCookie.indexOf("@") > -1) { - jctqCookies = jctqCookie.split("@") - } - else if (process.env.jctqCookie && process.env.jctqCookie.indexOf('@') > -1) { - jctqCookieArr = process.env.jctqCookie.split('@'); - console.log(`您选择的是用"@"隔开\n`) - } - else { - jctqCookies = [process.env.jctqCookie] - }; - Object.keys(jctqCookies).forEach((item) => { - if (jctqCookies[item]) { - jctqCookieArr.push(jctqCookies[item]) - } - }) -if (!jctqLookStartbody) { - $.msg($.name, '【提示】请点击看看赚某一任务获取body', '不知道说啥好', { - "open-url": "给您劈个叉吧" - }); - $.done() - } - else if (jctqLookStartbody.indexOf("&") == -1) { - jctqLookStartbodyArr.push(jctqLookStartbody) - } - else if (jctqLookStartbody.indexOf("&") > -1) { - jctqLookStartbodys = jctqLookStartbody.split("&") - } - else if (process.env.jctqLookStartbody && process.env.jctqLookStartbody.indexOf('&') > -1) { - jctqLookStartbodyArr = process.env.jctqLookStartbody.split('&'); - console.log(`您选择的是用"&"隔开\n`) - } - else { - jctqLookStartbodys = [process.env.jctqLookStartbody] - }; - Object.keys(jctqLookStartbodys).forEach((item) => { - if (jctqLookStartbodys[item]) { - jctqLookStartbodyArr.push(jctqLookStartbodys[item]) - } - }) - -!(async () => { - if (typeof $request !== "undefined") { - await getjctqLookStartbody() - $.done() - }else{ - console.log(`共${jctqLookStartbodyArr.length}个看看赚body`) - for (let k = 0; k < jctqLookStartbodyArr.length; k++) { - - jctqLookStartbody1 = jctqLookStartbodyArr[k]; - console.log(`--------第 ${k + 1} 次看看赚激活执行中--------\n`) - await lookStart() - await $.wait(1000); - console.log("\n\n") - } - console.log(`共${jctqCookieArr.length}个cookie`) - for (let k = 0; k < jctqCookieArr.length; k++) { - bodyVal = jctqCookieArr[k].split('&uid=')[0]; - var time1 = Date.parse( new Date() ).toString(); - time1 = time1.substr(0,10); - - cookie = bodyVal.replace(/zqkey=/, "cookie=") - cookie_id = cookie.replace(/zqkey_id=/, "cookie_id=") - jctqCookie1= cookie_id +'&device_brand=xfdg&device_id=cc7dgdsgfsz83e&device_model=1gx&device_platform=android&device_type=android&inner_version=202107261526&mi=0&openudid=cc7dgdsgfsz83e&os_api=27&os_version=bdftgsdfga&phone_network=WIFI&phone_sim=1'+'&request_time=' + time1 +'&time=' + time1 +'&'+ bodyVal - //console.log(`${jctqCookie1}`) - console.log(`--------第 ${k + 1} 个账号看看赚上方宝箱奖励执行中--------\n`) - for(let k = 0; k < 3; k++){ - id = k.toString() - await openbox(id,jctqCookie1) - await $.wait(30000); - - } - - console.log("\n\n") - - } - - -function openbox(id,jctqCookie1,timeout=0) { - return new Promise((resolve) => { - let url = { - url : 'https://tq.xunsl.com/WebApi/Nameless/getBoxReward?id='+ id + '&' + jctqCookie1, - headers : { - 'Host': 'tq.xunsl.com', - //'Referer': 'https://tq.xunsl.com/h5/20190527watchMoney/?' +jctqCookie1 - 'Referer':'https://tq.xunsl.com/h5/20190527watchMoney/?keyword_wyq=woyaoq.com&access=WIFI&app-version=8.1.2&app_version=8.1.2&carrier=%E4%B8%AD%E5%9B%BD%E7%A7%BB%E5%8A%A8&channel=c1005&'+jctqCookie1}, - } - $.get(url, async (err, resp, data) => { - try { - - const result = JSON.parse(data) - if(result.status == 1){ - console.log(result.data) - }else{ - console.log(result) - } - } catch (e) { - } finally { - resolve() - } - },timeout) - }) -}} - })() - .catch((e) => $.logErr(e)) - .finally(() => $.done()) - - - - - - - - -//获取看看赚激活body -async function getjctqLookStartbody() { -if ($request.url.match(/\/tq.xunsl.com\/v5\/nameless\/adlickstart/)) { - bodyVal=$request.body - await $.wait(1100); - if (jctqLookStartbody) { - if (jctqLookStartbody.indexOf(bodyVal) > -1) { - $.log("此看看赚任务请求已存在,本次跳过") - } else if (jctqLookStartbody.indexOf(bodyVal) == -1) { - jctqLookStartbodys = jctqLookStartbody + "&" + bodyVal; - $.setdata(jctqLookStartbodys, 'jctqLookStartbody'); - $.log(`${$.name}获取看看赚任务: 成功, jctqLookStartbodys: ${bodyVal}`); - bodys = jctqLookStartbodys.split("&") - $.msg($.name, "获取第" + bodys.length + "个看看赚任务请求: 成功🎉", ``) - } - } else { - $.setdata(bodyVal, 'jctqLookStartbody'); - $.log(`${$.name}获取看看赚任务: 成功, jctqLookStartbodys: ${bodyVal}`); - $.msg($.name, `获取第一个看看赚任务请求: 成功🎉`, ``) - } - } - - } -//看看赚激活 -function lookStart(timeout = 0) { - return new Promise((resolve) => { - let url = { - url : 'https://tq.xunsl.com/v5/nameless/adlickstart.json', - headers : jctqLookStartheader, - body : jctqLookStartbody1,}//xsgbody,} - $.post(url, async (err, resp, data) => { - try { - - const result = JSON.parse(data) - if(result.success === true ){ - console.log('\n激活看看赚任务成功') - comstate = result.items.comtele_state - if(comstate === 1){ - console.log('\n任务: '+ result.items.banner_id+'已完成,跳过') - }else { - $.log("任务开始," + result.items.banner_id + result.message); - for (let j = 0; j < result.items.see_num - result.items.read_num; j++) { - $.log("任务执行第" + parseInt(j + 1) + "次") - await $.wait(8000); - await lookstart() - } - await $.wait(10000); - await reward() - } - - }else{ - console.log('\n激活看看赚任务失败') - smbody = $.getdata('jctqLookStartbody').replace(jctqLookStartbody1 + "&", ""); - $.setdata(smbody, 'jctqLookStartbody'); - console.log("该看看赚任务已自动删除") - } - } catch (e) { - } finally { - resolve() - } - },timeout) - }) -} -//看看赚阅读 -function lookstart(timeout = 0) { - return new Promise((resolve) => { - let url = { - url : 'https://tq.xunsl.com/v5/nameless/bannerstatus.json', - headers : jctqLookheader, - body : jctqLookStartbody1,}//xsgbody,} - $.post(url, async (err, resp, data) => { - try { - - const result = JSON.parse(data) - if(result.success === true ){ - console.log('\n浏览看看赚文章成功') - }else { - console.log('\n浏览看看赚文章失败') - } - - } catch (e) { - } finally { - resolve() - } - },timeout) - }) -} -//看看赚奖励 -function reward(timeout = 0) { - return new Promise((resolve) => { - let url = { - url : 'https://tq.xunsl.com/v5/nameless/adlickend.json', - headers : jctqRewardheader, - body : jctqLookStartbody1,}//xsgbody,} - $.post(url, async (err, resp, data) => { - try { - - const result = JSON.parse(data) - if(result.items.score !== "undefined" ){ - console.log('\n看看赚获得:'+result.items.score + '金币') - }else{ - console.log('\n领取奖励失败') - } - } catch (e) { - } finally { - resolve() - } - },timeout) - }) -} - - -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("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}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("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(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"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} diff --git a/jctq/jctqqd.js b/jctq/jctqqd.js deleted file mode 100644 index 0b97485..0000000 --- a/jctq/jctqqd.js +++ /dev/null @@ -1,118 +0,0 @@ -const $ = new Env("晶彩天气签到"); -const notify = $.isNode() ? require('./sendNotify') : ''; -message = "" -let jctqQdBody= $.isNode() ? (process.env.jctqQdBody ? process.env.jctqQdBody : "") : ($.getdata('jctqQdBody') ? $.getdata('jctqQdBody') : "") -let jctqQdBodyArr = [] -let jctqQdBodys = "" -const jctqQdHeader={ - 'device-platform': 'android', - 'Content-Type': 'application/x-www-form-urlencoded', - 'Content-Length': '1247', - 'Host': 'tq.xunsl.com' -}; - - if (typeof $request !== "undefined") { - getjctqQdBody() - $.done() - } - if (!jctqQdBody) { - $.msg($.name, '【提示】请签到以获取body,明天再跑一次脚本测试', '不知道说啥好', { - "open-url": "给您劈个叉吧" - }); - $.done() - } - else if (jctqQdBody.indexOf("&") == -1) { - jctqQdBodyArr.push(jctqQdBody) - } - else if (jctqQdBody.indexOf("&") > -1) { - jctqQdBodys = jctqQdBody.split("&") - } - else if (process.env.jctqQdBody && process.env.jctqQdBody.indexOf('&') > -1) { - jctqQdBodyArr = process.env.jctqQdBody.split('&'); - console.log(`您选择的是用"&"隔开\n`) - } - else { - jctqQdBodys = [process.env.jctqQdBody] - }; - Object.keys(jctqQdBodys).forEach((item) => { - if (jctqQdBodys[item]) { - jctqQdBodyArr.push(jctqQdBodys[item]) - } - }) - -!(async () => { - - - console.log(`共${jctqQdBodyArr.length}个账号`) - for (let k = 0; k < jctqQdBodyArr.length; k++) { - $.message = "" - jctqQdBody1 = jctqQdBodyArr[k]; - console.log(`${jctqQdBody1}`) - console.log(`--------账号 ${k+1} 签到任务执行中--------\n`) - await jcqd() - await $.wait(1000); - console.log("\n\n") - } - - date = new Date() - if ($.isNode() &&date.getHours() == 11 && date.getMinutes()<10) { - if (message.length != 0) { - await notify.sendNotify("晶彩天气签到", `${message}\n\n shaolin-kongfu`); - } - } else { - $.msg($.name, "", message) - } - - })() - .catch((e) => $.logErr(e)) - .finally(() => $.done()) - - -//获取签到body -function getjctqQdBody() { - if ($request.url.match(/\/tq.xunsl.com\/v5\/CommonReward\/toGetReward/)) { - bodyVal = $request.body - if (jctqQdBody) { - if (jctqQdBody.indexOf(bodyVal) > -1) { - $.log("此签到请求已存在,本次跳过") - } else if (jctqQdBody.indexOf(bodyVal) == -1) { - jctqQdBodys = jctqQdBody + "&" + bodyVal; - $.setdata(jctqQdBodys, 'jctqQdBody'); - $.log(`${$.name}获取签到: 成功, jctqQdBodys: ${bodyVal}`); - bodys = jctqQdBodys.split("&") - $.msg($.name, "获取第" + bodys.length + "个签到请求: 成功🎉", ``) - } - } else { - $.setdata(bodyVal, 'jctqQdBody'); - $.log(`${$.name}获取签到: 成功, jctqQdBodys: ${bodyVal}`); - $.msg($.name, `获取第一个签到请求: 成功🎉`, ``) - } - } - - } - -//签到 -function jcqd(timeout = 0) { - return new Promise((resolve) => { - let url = { - url : 'https://tq.xunsl.com/v5/CommonReward/toGetReward.json', - headers : jctqQdHeader, - body : jctqQdBody1,} - $.post(url, async (err, resp, data) => { - try { - - const result = JSON.parse(data) - if(result.success == true){ - console.log('\n签到成功,获得:'+result.items.score +'金币') - }else{ - console.log('\n今日已签到,明天再来吧^_^') - } - } catch (e) { - } finally { - resolve() - } - },timeout) - }) -} -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("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}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("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(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"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} - diff --git a/jctq/jctqwz.js b/jctq/jctqwz.js deleted file mode 100644 index c0088f5..0000000 --- a/jctq/jctqwz.js +++ /dev/null @@ -1,229 +0,0 @@ -const $ = new Env("晶彩天气阅读文章"); -const notify = $.isNode() ? require('./sendNotify') : ''; -message = "" - - -let jctqWzBody= $.isNode() ? (process.env.jctqWzBody ? process.env.jctqWzBody : "") : ($.getdata('jctqWzBody') ? $.getdata('jctqWzBody') : "") -let jctqWzBodyArr = [] -let jctqWzBodys = "" - -let jctqTimeBody= $.isNode() ? (process.env.jctqTimeBody ? process.env.jctqTimeBody : "") : ($.getdata('jctqTimeBody') ? $.getdata('jctqTimeBody') : "") -let jctqTimeBodyArr = [] -let jctqTimeBodys = "" - -let skipFlag = 0; - -const jctqTimeHeader={ - 'device-platform': 'android', - 'Content-Type': 'application/x-www-form-urlencoded', - 'Content-Length': '1198', - 'Host': 'tq.xunsl.com', - 'app-type' : 'jcweather', -} -const jctqWzHeader = { - 'device-platform': 'android', - 'Content-Type': 'application/x-www-form-urlencoded', - 'Content-Length': '1201', - 'Host': 'tq.xunsl.com', - 'app-type' : 'jcweather', -} - - if (!jctqTimeBody) { - $.msg($.name, '【提示】请点击文章获取body,再跑一次脚本', '不知道说啥好', { - "open-url": "给您劈个叉吧" - }); - $.done() - } - else if (jctqTimeBody.indexOf("&") == -1) { - jctqTimeBodyArr.push(jctqTimeBody) - } - else if (jctqTimeBody.indexOf("&") > -1) { - jctqTimeBodys = jctqTimeBody.split("&") - } - else if (process.env.jctqTimeBody && process.env.jctqTimeBody.indexOf('&') > -1) { - jctqTimeBodyArr = process.env.jctqTimeBody.split('&'); - console.log(`您选择的是用"&"隔开\n`) - } - else { - jctqTimeBodys = [process.env.jctqTimeBody] - }; - Object.keys(jctqTimeBodys).forEach((item) => { - if (jctqTimeBodys[item]) { - jctqTimeBodyArr.push(jctqTimeBodys[item]) - } - }) - - if (!jctqWzBody) { - $.msg($.name, '【提示】请点击文章获取body,再跑一次脚本', '不知道说啥好', { - "open-url": "给您劈个叉吧" - }); - $.done() - } - else if (jctqWzBody.indexOf("&") == -1) { - jctqWzBodyArr.push(jctqWzBody) - } - else if (jctqWzBody.indexOf("&") > -1) { - jctqWzBodys = jctqWzBody.split("&") - } - else if (process.env.jctqWzBody && process.env.jctqWzBody.indexOf('&') > -1) { - jctqWzBodyArr = process.env.jctqWzBody.split('&'); - console.log(`您选择的是用"&"隔开\n`) - } - else { - jctqWzBodys = [process.env.jctqWzBody] - }; - Object.keys(jctqWzBodys).forEach((item) => { - if (jctqWzBodys[item]) { - jctqWzBodyArr.push(jctqWzBodys[item]) - } - }) - -!(async () => { - if (typeof $request !== "undefined") { - getjctqWzBody() - getjctqTimeBody() - $.done() - }else { - - console.log(`共${jctqWzBodyArr.length}个阅读body`) - for (let k = 0; k < jctqWzBodyArr.length; k++) { - // $.message = "" - jctqWzBody1 = jctqWzBodyArr[k]; - // console.log(`${jctqWzBody1}`) - console.log(`--------第 ${k + 1} 次阅读任务执行中--------\n`) - $.skipFlag = 1 - await wzjl() - if($.skipFlag == 0) - { - await $.wait(60000); - for (let k = 0; k < jctqTimeBodyArr.length; k++) { - jctqTimeBody1 = jctqTimeBodyArr[k]; - await timejl() - } - }else{ - await $.wait(400); - } - console.log("\n\n") - } - } - - - - // date = new Date() - // if ($.isNode() &&date.getHours() == 11 && date.getMinutes()<10) { - // if (message.length != 0) { - // await notify.sendNotify("晶彩天气文章阅读", `${message}\n\n shaolin-kongfu`); - // } - // } else { - // $.msg($.name, "", message) - // } - - })() - .catch((e) => $.logErr(e)) - .finally(() => $.done()) - - -function getjctqWzBody() { - if ($request.url.match(/\/tq.xunsl.com\/v5\/article\/info.json/)||$request.url.match(/\/tq.xunsl.com\/v5\/article\/detail.json/)) { - bodyVal1 = $request.url.split('p=')[1] - console.log(encodeURIComponent(bodyVal1)) - bodyVal = 'p='+encodeURIComponent(bodyVal1) - console.log(bodyVal) - - - if (jctqWzBody) { - if (jctqWzBody.indexOf(bodyVal) > -1) { - $.log("此阅读请求已存在,本次跳过") - } else if (jctqWzBody.indexOf(bodyVal) == -1) { - jctqWzBodys = jctqWzBody + "&" + bodyVal; - $.setdata(jctqWzBodys, 'jctqWzBody'); - $.log(`${$.name}获取阅读: 成功, jctqWzBodys: ${bodyVal}`); - bodys = jctqWzBodys.split("&") - $.msg($.name, "获取第" + bodys.length + "个阅读请求: 成功🎉", ``) - } - } else { - $.setdata(bodyVal, 'jctqWzBody'); - $.log(`${$.name}获取阅读: 成功, jctqWzBodys: ${bodyVal}`); - $.msg($.name, `获取第一个阅读请求: 成功🎉`, ``) - } - } - - } -//阅读文章奖励 -function wzjl(timeout = 0) { - return new Promise((resolve) => { - let url = { - url : 'https://tq.xunsl.com/v5/article/complete.json', - headers : jctqWzHeader, - body : jctqWzBody1,}//xsgbody,} - $.post(url, async (err, resp, data) => { - try { - - const result = JSON.parse(data) - if(result.items.read_score){ - if(result.items.read_score == 0){ - console.log('\n获得0金币,下一篇') - $.skipFlag = 1 - }else{ - console.log('\n浏览文章成功,获得:'+result.items.read_score + '金币') - $.skipFlag = 0 - } - }else{ - console.log('\n看太久了,换一篇试试') - $.skipFlag = 1 - } - } catch (e) { - } finally { - resolve() - } - },timeout) - }) -} - - -function getjctqTimeBody() { - if ($request.url.match(/\/tq.xunsl.com\/v5\/user\/stay.json/)) { - bodyVal=$request.body - console.log(bodyVal) - if (jctqTimeBody) { - if (jctqTimeBody.indexOf(bodyVal) > -1) { - $.log("此阅读时长请求已存在,本次跳过") - } else if (jctqTimeBody.indexOf(bodyVal) == -1) { - jctqTimeBodys = jctqTimeBody + "&" + bodyVal; - $.setdata(jctqTimeBodys,'jctqTimeBody'); - $.log(`${$.name}获取阅读: 成功, jctqTimeBodys: ${bodyVal}`); - bodys = jctqTimeBodys.split("&") - $.msg($.name, "获取第" + bodys.length + "个阅读时长请求: 成功🎉", ``) - } - } else { - $.setdata($request.body,'jctqTimeBody'); - $.log(`${$.name}获取阅读: 成功, jctqTimeBodys: ${bodyVal}`); - $.msg($.name, `获取第一个阅读时长请求: 成功🎉`, ``) - } - } -} - -function timejl(timeout = 0) { - return new Promise((resolve) => { - let url = { - url : 'https://tq.xunsl.com/v5/user/stay.json', - headers : jctqTimeHeader, - body : jctqTimeBody1,}//xsgbody,} - $.post(url, async (err, resp, data) => { - try { - - const result = JSON.parse(data) - if(result.success === true ){ - console.log('\n阅读时长:'+result.time + '秒') - }else{ - console.log('\n更新阅读时长失败') - } - } catch (e) { - } finally { - resolve() - } - },timeout) - }) -} - -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("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}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("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(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"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} diff --git a/jrttjsb.js b/jrttjsb.js new file mode 100644 index 0000000..3ccd342 --- /dev/null +++ b/jrttjsb.js @@ -0,0 +1,1284 @@ +/* +IOS/安卓: 今日头条极速版 +邀请码: 1173836876 + +老用户每天几毛,新用户可能收益高点 +普通版定时: 1-59/15 6-23 * * * +激进版定时: 1-59/5 * * * * +多用户跑的时间会久一点,自己看着改定时吧 + +自定义UA:捉包拿到自己的UA,填到变量jrttjsbUA里,不填默认用安卓UA +自定义每次运行阅读文章的数量:填到变量jrttjsbReadNum,不填默认10篇 +农场和种树任务:默认不做,需要做的,把变量jrttjsbFarm填为1 + +V2P重写: +[task_local] +#今日头条极速版 +1-59/15 6-23 * * * https://raw.githubusercontent.com/leafxcy/JavaScript/main/jrttjsb.js, tag=今日头条极速版, enabled=true +[rewrite_local] +luckycat\/lite\/v1\/task\/page_data url script-request-header https://raw.githubusercontent.com/leafxcy/JavaScript/main/jrttjsb.js +[MITM] +#每个人的域名不同,都放进去MITM吧,还捉不到就自行捉包填写 +hostname = *.snssdk.com +hostname = *.toutiaoapi.com + +青龙把极速版捉包里面的cookie放到jrttjsbHeader里,多账户用@隔开 +*/ + +const jsname = '今日头条极速版' +const $ = Env(jsname) +const notifyFlag = 1; //0为关闭通知,1为打开通知,默认为1 +const logDebug = 0 + +//const notify = $.isNode() ? require('./sendNotify') : ''; +let notifyStr = '' + +let rndtime = "" //毫秒 +let httpResult //global buffer + +let host = 'i.snssdk.com' +let hostname = 'https://' + host + +let userAgent = ($.isNode() ? process.env.jrttjsbUA : $.getdata('jrttjsbUA')) || 'Dalvik/2.1.0 (Linux; U; Android 7.1.2; VOG-AL10 Build/HUAWEIVOG-AL10) NewsArticle/8.2.8 tt-ok/3.10.0.2'; +let userAgentArr = [] +let userHeader = ($.isNode() ? process.env.jrttjsbHeader : $.getdata('jrttjsbHeader')) || ''; +let userHeaderArr = [] +let jrttjsbFarm = ($.isNode() ? process.env.jrttjsbFarm : $.getdata('jrttjsbFarm')) || 0; + +let userIdx = 0 +let UAcount = 0 +let userStatus = [] +let maxReadPerRun = ($.isNode() ? process.env.jrttjsbReadNum : $.getdata('jrttjsbReadNum')) || 10; +let readList = [] + +let validList = [] +let adIdList = [26, 181, 186, 187, 188, 189, 190, 195, 210, 214, 216, 225, 308, 324, 327, 329] + +/////////////////////////////////////////////////////////////////// + +!(async () => { + + if(typeof $request !== "undefined") + { + await GetRewrite() + } + else + { + await showUpdateMsg() + + if(!(await checkEnv())) { + return + } + + await initAccountInfo() + await RunMultiUser() + } + + +})() +.catch((e) => $.logErr(e)) +.finally(() => $.done()) + +function showUpdateMsg() { + console.log('\n2021.12.15 9:30 更新:增加推送奖励,修复一个UA的bug,更改默认UA为安卓\n') +} + +//通知 +async function showmsg() { + + notifyBody = jsname + "运行通知\n\n" + notifyStr + + if (notifyFlag != 1) { + console.log(notifyBody); + } + + if (notifyFlag == 1) { + $.msg(notifyBody); + //if ($.isNode()){await notify.sendNotify($.name, notifyBody );} + } +} + +async function GetRewrite() { + if($request.url.indexOf('luckycat/lite/v1/task/page_data') > -1) { + let userCK = $request.headers.Cookie + + if(userHeader) { + if(userHeader.indexOf(userCK) == -1) { + userHeader = userHeader + '@' + userCK + $.setdata(userHeader, 'jrttjsbHeader'); + ckList = userHeader.split('@') + $.msg(jsname+` 获取第${ckList.length}个jrttjsbHeader成功: ${userCK}`) + } + } else { + $.setdata(userCK, 'jrttjsbHeader'); + $.msg(jsname+` 获取第1个jrttjsbHeader成功: ${userCK}`) + } + } +} + +async function checkEnv() { + if(userHeader) { + userHeaderArr = userHeader.split('@') + } else { + console.log('未找到jrttjsbHeader') + return false + } + if(userHeaderArr.length == 0) { + console.log('未找到有效的jrttjsbHeader') + return false + } + + if(userAgent) { + userAgentArr = userAgent.split('@') + } else { + console.log('未找到userAgent') + return false + } + UAcount = userAgentArr.length + + console.log(`共找到${userHeaderArr.length}个用户,${UAcount}个UA`) + return true +} + +async function initAccountInfo() { + for(userIdx=0; userIdx 0) await GetWalkBonus() + } else { + console.log(`用户${userIdx+1}走路状态失败:${result.err_tips}`) + } +} + +//走路奖励 +async function GetWalkBonus() { + let caller = printCaller() + let nowtime = Math.round(new Date().getTime()/1000) + let url = `${hostname}/luckycat/lite/v1/walk/bonus/?aid=35&update_version_code=85221&os_version=15.0&device_platform=iphone` + let body = `{"task_id":136,"enable_preload_exciting_video":0,"client_time":${nowtime},"rit":"","use_ecpm":0}` + let urlObject = populatePostUrl(url,body) + await httpPost(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.err_no == 0) { + console.log(`用户${userIdx+1}领取走路奖励获得${result.data.score_amount}金币`) + } else { + console.log(`用户${userIdx+1}领取走路奖励失败:${result.err_tips}`) + } +} + +//吃饭补贴 +async function DoneEat() { + let caller = printCaller() + let url = `${hostname}/luckycat/lite/v1/eat/done_eat/?aid=35&update_version_code=85221&device_platform=iphone&&device_type=iPhone13,2` + let urlObject = populatePostUrl(url) + await httpPost(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.err_no == 0) { + console.log(`用户${userIdx+1}领取吃饭补贴获得${result.data.score_amount}金币`) + } else { + console.log(`用户${userIdx+1}领取吃饭补贴失败:${result.err_tips}`) + } +} + +//睡觉状态 +async function QuerySleepStatus() { + let caller = printCaller() + let curTime = new Date() + let curHour = curTime.getHours() + let url = `${hostname}/luckycat/lite/v1/sleep/status/?aid=35&update_version_code=85221&device_platform=iphone&&device_type=iPhone13,2` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.err_no == 0) { + let sleepHour = Math.floor(result.data.sleep_last_time/36)/100 + if(result.data.sleeping == true) { + if(sleepHour>=12) { + await SleepStop() + } else if(result.data.sleep_unexchanged_score==result.data.max_coin && curHour >= 7) { + let rnd = Math.random() + if(rnd>0.95) { + await SleepStop() + } else { + console.log(`用户${userIdx+1}随机醒来时间,本次不进行醒来,已经睡了${sleepHour}小时,可以获得${result.data.sleep_unexchanged_score}金币`) + } + } else { + console.log(`用户${userIdx+1}睡眠中,已经睡了${sleepHour}小时,可以获得${result.data.sleep_unexchanged_score}金币,上限${result.data.max_coin}金币`) + } + } else { + if(result.data.history_amount > 0) { + await SleepDone(result.data.history_amount) + } + if(curHour >= 22 || curHour < 2) { + await SleepStart() + } else if(curHour >= 20) { + let rnd = Math.random() + if(rnd>0.95) { + await SleepStart() + } else { + console.log(`用户${userIdx+1}随机睡眠时间,本次不进行睡眠`) + } + } else { + console.log(`用户${userIdx+1}未到睡觉时间`) + } + } + } else { + console.log(`用户${userIdx+1}查询睡觉状态失败:${result.err_tips}`) + } +} + +//睡觉醒来 +async function SleepStop() { + let caller = printCaller() + let url = `${hostname}/luckycat/lite/v1/sleep/stop/?aid=35&update_version_code=85221&device_platform=iphone&&device_type=iPhone13,2` + let urlObject = populatePostUrl(url) + await httpPost(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.err_no == 0) { + let sleepHour = result.data.sleep_last_time/3600 + console.log(`用户${userIdx+1}结束睡眠,本次睡了${sleepHour}小时,可以领取${result.data.history_amount}金币`) + await SleepDone(result.data.history_amount) + } else { + console.log(`用户${userIdx+1}结束睡眠失败:${result.err_tips}`) + } +} + +//睡觉收金币 +async function SleepDone(amount) { + let caller = printCaller() + let timeInMS = Math.round(new Date().getTime()) + let url = `${hostname}/luckycat/lite/v1/sleep/done_task/?os_api=25&device_type=VOG-AL10&ssmix=a&manifest_version_code=8280&dpi=240&abflag=3&pass_through=default&use_ecpm=0&rom_version=25&rit=coin&app_name=news_article_lite&ab_client=a1%2Ce1%2Cf2%2Cg2%2Cf7&version_name=8.2.8&ab_version=668903%2C3491704%2C1859936%2C668908%2C3491714%2C668907%2C3491710%2C668905%2C3491678%2C668906%2C3491686%2C668904%2C3491669%2C3269751%2C3472846%2C3493942&plugin_state=7731332411413&sa_enable=0&ac=wifi&_request_from=web&update_version_code=82809&channel=lite2_tengxun&_rticket=${timeInMS}&status_bar_height=24&dq_param=0&device_platform=android&iid=1592553870724568&scm_build_version=1.0.0.1454&mac_address=88%3AB1%3A11%3A61%3A96%3A7B&version_code=828&polaris_version=1.0.5&tma_jssdk_version=1.95.0.28&is_pad=1&resolution=720*1280&os_version=7.1.2&language=zh&device_brand=HUAWEI&aid=35&ab_feature=z1&luckycat_version_name=4.2.0-rc.5&luckycat_version_code=420005` + let body = `{"score_amount":${amount},"enable_preload_exciting_video":0}` + let urlObject = populatePostUrl(url,body) + await httpPost(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.err_no == 0) { + console.log(`用户${userIdx+1}领取睡觉金币奖励${amount}金币成功`) + } else { + console.log(`用户${userIdx+1}领取睡觉金币奖励失败:${result.err_tips}`) + } +} + +//开始睡觉 +async function SleepStart() { + let caller = printCaller() + let url = `${hostname}/luckycat/lite/v1/sleep/start/?aid=35&update_version_code=85221&device_platform=iphone&&device_type=iPhone13,2` + let urlObject = populatePostUrl(url) + await httpPost(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.err_no == 0) { + console.log(`用户${userIdx+1}开始睡觉,ZZZzzz...`) + await SleepDone(result.data.history_amount) + } else { + console.log(`用户${userIdx+1}开始睡觉失败:${result.err_tips}`) + } +} + +//查询农场状态 +async function QueryFarmInfo() { + let caller = printCaller() + let url = `${hostname}/ttgame/game_farm/polling_info?aid=35&update_version_code=85221&device_platform=iphone&&device_type=iPhone13,2` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.status_code == 0) { + if(result.data.info.offline_production) { + await FarmOfflineDouble() + } + if(result.data.info.water>=10) { + await FarmWater() + } + if(result.data.info.box_num>0) { + await FarmOpenBox() + } + } else { + console.log(`用户${userIdx+1}查询农场状态失败:${result.message}`) + } +} + +//进入农场 +async function EnterFarm() { + let caller = printCaller() + let url = `${hostname}/ttgame/game_farm/home_info?aid=35&update_version_code=85221&device_platform=iphone&&device_type=iPhone13,2` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + console.log(result) + if(result.status_code == 0) { + + } else { + console.log(`用户${userIdx+1}进入农场失败:${result.message}`) + } +} + +//农场-离线奖励翻倍 +async function FarmOfflineDouble() { + let caller = printCaller() + let url = `${hostname}/ttgame/game_farm/double_reward?watch_ad=1&aid=35` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.status_code == 0) { + console.log(`用户${userIdx+1}农场离线产量翻倍成功`) + } else { + console.log(`用户${userIdx+1}农场离线产量翻倍失败:${result.message}`) + } +} + +//农场-领取三餐礼包 +async function RewardFarmThreeGift(gift_id) { + let caller = printCaller() + let url = `${hostname}/ttgame/game_farm/reward/gift?game_client_version_code=2&gift_id=${gift_id}&watch_ad=0&double=0&aid=35&update_version_code=85221&device_platform=iphone&&device_type=iPhone13,2` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.status_code == 0) { + console.log(`用户${userIdx+1}领取农场三餐礼包获得${result.data.reward_num}水滴`) + } else { + console.log(`用户${userIdx+1}领取农场三餐礼包失败:${result.message}`) + } +} + +//农场-三餐礼包状态 +async function QueryFarmThreeGift() { + let caller = printCaller() + let url = `${hostname}/ttgame/game_farm/gift/list?aid=35&update_version_code=85221&device_platform=iphone&&device_type=iPhone13,2` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.status_code == 0) { + for(let item of result.data) { + if(item.status==1) { + await RewardFarmThreeGift(item.gift_id) + } + } + } else { + console.log(`用户${userIdx+1}查询农场三餐礼包状态失败:${result.message}`) + } +} + +//查询农场任务列表 +async function QueryFarmTask() { + let caller = printCaller() + let url = `${hostname}/ttgame/game_farm/daily_task/list?aid=35&update_version_code=85221&device_platform=iphone&&device_type=iPhone13,2` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.status_code == 0) { + for(let item of result.data) { + if(item.status==1) { + await RewardFarmTask(item.task_id) + } + } + } else { + console.log(`用户${userIdx+1}查询农场任务列表失败:${result.message}`) + } +} + +//农场-领取任务奖励 +async function RewardFarmTask(id) { + let caller = printCaller() + let url = `${hostname}/ttgame/game_farm/reward/task?task_id=${id}&aid=35` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.status_code == 0) { + let typeStr = (result.data.reward_type==1) ? '水滴' : '化肥' + console.log(`用户${userIdx+1}领取农场任务奖励[task_id=${result.data.task_id}]获得${result.data.reward_num}${typeStr},剩余${typeStr}数量${result.data.current_num}`) + } else { + console.log(`用户${userIdx+1}领取农场任务奖励失败:${result.message}`) + } +} + +//农场-浇水 +async function FarmWater() { + let caller = printCaller() + let url = `${hostname}/ttgame/game_farm/land_water?aid=35&update_version_code=85221&device_platform=iphone&&device_type=iPhone13,2` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.status_code == 0) { + console.log(`用户${userIdx+1}农场浇水成功,剩余水滴:${result.data.water}`) + if(result.data.water>=10) { + await $.wait(1500) //min time 1000 + await FarmWater() + } + } else { + console.log(`用户${userIdx+1}农场浇水失败:${result.message}`) + } +} + +//农场-开宝箱 +async function FarmOpenBox() { + let caller = printCaller() + let url = `${hostname}/ttgame/game_farm/box/open?aid=35&update_version_code=85221&device_platform=iphone&&device_type=iPhone13,2` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.status_code == 0) { + console.log(`用户${userIdx+1}开农场宝箱获得${result.data.incr_coin}金币`) + if(result.data.excitation_ad_score_amount>0) await FarmOpenBoxVideo() + } else { + console.log(`用户${userIdx+1}开农场宝箱失败:${result.message}`) + } +} + +//农场-宝箱视频 +async function FarmOpenBoxVideo() { + let caller = printCaller() + let url = `${hostname}/ttgame/game_farm/excitation_ad/add?excitation_ad_score_amount=134&device_id=2392172203611735&aid=35&os_version=15.0&update_version_code=85221` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.status_code == 0) { + console.log(`用户${userIdx+1}看农场宝箱视频获得${result.data.incr_coin}金币`) + } else { + console.log(`用户${userIdx+1}看农场宝箱视频失败:${result.message}`) + } +} + +//农场-签到状态 +async function QueryFarmSignStatus() { + let caller = printCaller() + let url = `${hostname}/ttgame/game_farm/sign_in/list?aid=35&update_version_code=85221&device_platform=iphone&&device_type=iPhone13,2` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.status_code == 0) { + for(let item of result.data.sign) { + if(item.status==1) { + await FarmSign() + break + } + } + } else { + console.log(`用户${userIdx+1}查询签到状态失败:${result.message}`) + } +} + +//农场-签到 +async function FarmSign() { + let caller = printCaller() + let url = `${hostname}/ttgame/game_farm/reward/sign_in?aid=35&update_version_code=85221&device_platform=iphone&&device_type=iPhone13,2` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.status_code == 0) { + let str = (result.data.reward_type==1)?'水滴':'化肥' + console.log(`用户${userIdx+1}签到获得${result.data.reward_num}${str},剩余${str}数量${result.data.cur_reward_num}`) + } else { + console.log(`用户${userIdx+1}签到失败:${result.message}`) + } +} + +//农场-签到视频翻倍 +async function FarmSignDouble() { + let caller = printCaller() + let url = `${hostname}/ttgame/game_farm/reward/double_sign_in?aid=35&update_version_code=85221&device_platform=iphone&&device_type=iPhone13,2` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.status_code == 0) { + let str = (result.data.reward_type==1)?'水滴':'化肥' + console.log(`用户${userIdx+1}签到翻倍获得${result.data.reward_num}{str},剩余${str}数量${result.data.cur_reward_num}`) + } else { + console.log(`用户${userIdx+1}签到翻倍失败:${result.message}`) + } +} + +//农场-土地状态 +async function QueryFarmLandStatus() { + let caller = printCaller() + let url = `${hostname}/ttgame/game_farm/home_info?aid=35&update_version_code=85221&device_platform=iphone&&device_type=iPhone13,2` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.status_code == 0) { + for(let item of result.data.info.lands) { + if(item.status==false && item.unlock_able==true) { + await FarmUnlock(item.land_id) + break + } + } + } else { + console.log(`用户${userIdx+1}查询土地状态失败:${result.message}`) + } +} + +//农场-土地解锁 +async function FarmUnlock(land_id) { + let caller = printCaller() + let url = `${hostname}/ttgame/game_farm/land/unlock?land_id=${land_id}&aid=35&update_version_code=85221&device_platform=iphone&&device_type=iPhone13,2` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.status_code == 0) { + console.log(`用户${userIdx+1}解锁${land_id}号土地成功`) + } else { + console.log(`用户${userIdx+1}解锁${land_id}号土地失败:${result.message}`) + } +} + +//种树-签到状态 +async function QueryTreeSignStatus() { + let caller = printCaller() + let url = `${hostname}/ttgame/game_orchard/sign_in/list?aid=35&update_version_code=85221&device_platform=iphone&&device_type=iPhone13,2` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.status_code == 0) { + if(result.data.today == false) { + await TreeSign() + } + } else { + console.log(`用户${userIdx+1}查询种树签到状态失败:${result.message}`) + } +} + +//种树-签到 +async function TreeSign() { + let caller = printCaller() + let url = `${hostname}/ttgame/game_orchard/sign_in/reward?aid=35&update_version_code=85221&device_platform=iphone&&device_type=iPhone13,2` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.status_code == 0) { + console.log(`用户${userIdx+1}种树签到获得${result.data.reward_item.num}${result.data.reward_item.name}`) + } else { + console.log(`用户${userIdx+1}种树签到失败:${result.message}`) + } +} + +//种树-二选一-选项 +async function QueryTreeChallenge() { + let caller = printCaller() + let url = `${hostname}/ttgame/game_orchard/challenge/list?aid=35&update_version_code=85221&device_platform=iphone&&device_type=iPhone13,2` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.status_code == 0) { + let bestChoice = 0 + let maxWater = 0 + for(let item of result.data.tasks) { + if(item.state==0 && item.water_times>maxWater) { + maxWater = item.water_times + bestChoice = item.id + } + } + if(bestChoice>0) await TreeChallengeChoose(bestChoice) + } else { + console.log(`用户${userIdx+1}查询挑战任务失败:${result.message}`) + } +} + +//种树-二选一-选择 +async function TreeChallengeChoose(id) { + let caller = printCaller() + let url = `${hostname}/ttgame/game_orchard/challenge/choose?task_id=${id}&aid=35` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.status_code == 0) { + console.log(`用户${userIdx+1}选择浇水${result.data.red_point.times}次挑战`) + } else { + console.log(`用户${userIdx+1}选择浇水挑战失败:${result.message}`) + } +} + +//种树-二选一-领奖 +async function TreeChallengeReward() { + let caller = printCaller() + let url = `${hostname}/ttgame/game_orchard/challenge/reward?aid=35&update_version_code=85221&device_platform=iphone&&device_type=iPhone13,2` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.status_code == 0) { + console.log(`用户${userIdx+1}领取浇水挑战奖励获得${result.data.reward_item.num}水滴`) + } else { + console.log(`用户${userIdx+1}领取浇水挑战奖励失败:${result.message}`) + } +} + +//种树-化肥签到 +async function TreeNutrientSign() { + let caller = printCaller() + let url = `${hostname}/ttgame/game_orchard/nutrient/sign_in?aid=35&update_version_code=85221&device_platform=iphone&&device_type=iPhone13,2` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.status_code == 0) { + if(result.data.is_rewarded==true) { + console.log(`用户${userIdx+1}种树化肥签到获得${result.data.reward_item.num}{result.data.reward_item.name}`) + } else { + console.log(`用户${userIdx+1}种树化肥签到成功`) + } + } else { + console.log(`用户${userIdx+1}种树化肥签到失败:${result.message}`) + } +} + +//种树-领取三餐礼包 +async function RewardTreeThreeGift(task_id) { + let caller = printCaller() + let url = `${hostname}/ttgame/game_orchard/three_gift/reward?task_id=${task_id}&watch_ad=0&extra_ad_num=0&aid=35&update_version_code=85221&device_platform=iphone&&device_type=iPhone13,2` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.status_code == 0) { + console.log(`用户${userIdx+1}领取种树三餐礼包获得${result.data.reward_item.num}${result.data.reward_item.name}`) + } else { + console.log(`用户${userIdx+1}领取种树三餐礼包失败:${result.message}`) + } +} + +//种树-三餐礼包状态 +async function QueryTreeThreeGift() { + let caller = printCaller() + let curTime = new Date() + let curHour = curTime.getHours() + let url = `${hostname}/ttgame/game_orchard/three_gift/list?aid=35&update_version_code=85221&device_platform=iphone&&device_type=iPhone13,2` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.status_code == 0) { + for(let item of result.data.gift_list) { + if(item.rounds==1 && curHour >= item.available_time.begin && curHour < item.available_time.end) { + await RewardTreeThreeGift(item.id) + } + } + } else { + console.log(`用户${userIdx+1}查询种树三餐礼包状态失败:${result.message}`) + } +} + +//种树-水滴任务列表 +async function QueryTreeWaterTask() { + let caller = printCaller() + let url = `${hostname}/ttgame/game_orchard/tasks/list?aid=35&update_version_code=85221&device_platform=iphone&&device_type=iPhone13,2` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.status_code == 0) { + for(let item of result.data.tasks_v2) { + if(item.reward_item.state==4) { + await TreeWaterReward(item.id) + await $.wait(1500) + } + } + } else { + console.log(`用户${userIdx+1}查询种树水滴任务列表失败:${result.message}`) + } +} + +//种树-水滴领奖 +async function TreeWaterReward(task_id) { + let caller = printCaller() + let url = `${hostname}/ttgame/game_orchard/tasks/reward?task_id=${task_id}&do_action=0&aid=35` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.status_code == 0) { + console.log(`用户${userIdx+1}领取水滴任务[id=${task_id}]获得${result.data.reward_item.num}${result.data.reward_item.name}`) + } else { + console.log(`用户${userIdx+1}领取水滴任务[id=${task_id}]失败:${result.message}`) + } +} + +//种树-浇水 +async function TreeWater() { + let caller = printCaller() + let url = `${hostname}/ttgame/game_orchard/tree/water?aid=35&update_version_code=85221&device_platform=iphone&&device_type=iPhone13,2` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.status_code == 0) { + console.log(`用户${userIdx+1}种树浇水成功,剩余水滴:${result.data.kettle.water_num}`) + if(result.data.kettle.water_num>=100) { + await $.wait(1500) //min time 1000 + await TreeWaterTenTimes() + } else if(result.data.kettle.water_num>=10) { + await $.wait(1500) //min time 1000 + await TreeWater() + } + } else { + console.log(`用户${userIdx+1}种树浇水失败:${result.message}`) + } +} + +//种树-浇水10次 +async function TreeWaterTenTimes() { + let caller = printCaller() + let url = `${hostname}/ttgame/game_orchard/tree/tenfold_water?times=10&aid=35` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.status_code == 0) { + console.log(`用户${userIdx+1}种树浇水10次成功,剩余水滴:${result.data.kettle.water_num}`) + if(result.data.kettle.water_num>=100) { + await $.wait(1500) //min time 1000 + await TreeWaterTenTimes() + } else if(result.data.kettle.water_num>=10) { + await $.wait(1500) //min time 1000 + await TreeWater() + } + } else { + console.log(`用户${userIdx+1}种树浇水失败:${result.message}`) + } +} + +//种树-信息 +async function QueryTreeStatus() { + let caller = printCaller() + let url = `${hostname}/ttgame/game_orchard/polling_info?aid=35&update_version_code=85221&device_platform=iphone&&device_type=iPhone13,2` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.status_code == 0) { + if(result.data.red_points.challenge && result.data.red_points.challenge.state==4) { + await TreeChallengeReward() + } + if(result.data.bottle.state==1) { + await RewardTreeWaterBottle() + } + if(result.data.red_points.box && result.data.red_points.box.rounds>0 && result.data.red_points.box.state==4) { + await TreeOpenBox() + } + if(result.data.kettle.water_num >= 100) { + await TreeWaterTenTimes() + } else if(result.data.kettle.water_num>=10) { + await TreeWater() + } + } else { + console.log(`用户${userIdx+1}查询种树信息失败:${result.message}`) + } +} + +//种树-水瓶奖励 +async function RewardTreeWaterBottle() { + let caller = printCaller() + let url = `${hostname}/ttgame/game_orchard/water_bottle/reward?aid=35&update_version_code=85221&device_platform=iphone&&device_type=iPhone13,2` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.status_code == 0) { + console.log(`用户${userIdx+1}领取种树水瓶奖励获得${result.data.reward_item.num}水滴`) + } else { + console.log(`用户${userIdx+1}领取种树水瓶奖励失败:${result.message}`) + } +} + +//种树-开宝箱 +async function TreeOpenBox() { + let caller = printCaller() + let url = `${hostname}/ttgame/game_orchard/box2/open?watch_ad=0&aid=35` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + //console.log(result) + if(result.status_code == 0) { + console.log(`用户${userIdx+1}种树开宝箱获得${result.data.incr_coin}金币`) + } else { + console.log(`用户${userIdx+1}种树开宝箱失败:${result.message}`) + } +} +//////////////////////////////////////////////////////////////////// +function populatePostUrl(url,reqBody=''){ + let timeInMS = Math.round(new Date().getTime()) + let timeInSecond = Math.floor(timeInMS/1000) + let urlObject = { + url: url, + headers: { + 'Accept-Encoding' : 'gzip', + 'X-SS-REQ-TICKET' : timeInMS, + 'passport-sdk-version' : '30', + 'sdk-version' : '2', + 'x-vc-bdturing-sdk-version' : '2.0.0', + 'User-Agent' : userAgentArr[userIdx%UAcount], + 'Cookie' : userHeaderArr[userIdx], + 'X-Khronos' : timeInSecond, + 'Content-Type' : 'application/json; charset=utf-8', + 'Host' : host, + 'Connection' : 'Keep-Alive', + }, + body: reqBody + } + return urlObject; +} + +function populateGetUrl(url){ + let timeInMS = Math.round(new Date().getTime()) + let timeInSecond = Math.floor(timeInMS/1000) + let urlObject = { + url: url, + headers: { + 'Accept-Encoding' : 'gzip', + 'X-SS-REQ-TICKET' : timeInMS, + 'passport-sdk-version' : '30', + 'sdk-version' : '2', + 'x-vc-bdturing-sdk-version' : '2.0.0', + 'User-Agent' : userAgentArr[userIdx%UAcount], + 'Cookie' : userHeaderArr[userIdx], + 'X-Khronos' : timeInSecond, + 'Content-Type' : 'application/json; charset=utf-8', + 'Host' : host, + 'Connection' : 'Keep-Alive', + } + } + return urlObject; +} + +async function httpPost(url,caller) { + httpResult = null + return new Promise((resolve) => { + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log(caller + ": post请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + httpResult = JSON.parse(data); + if(logDebug) console.log(httpResult); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +async function httpGet(url,caller) { + httpResult = null + return new Promise((resolve) => { + $.get(url, async (err, resp, data) => { + try { + if (err) { + console.log(caller + ": get请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data,caller)) { + httpResult = JSON.parse(data); + if(logDebug) console.log(httpResult); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +function safeGet(data,caller) { + try { + if (typeof JSON.parse(data) == "object") { + return true; + } else { + console.log(`Function ${caller}: 未知错误`); + console.log(data) + } + } catch (e) { + console.log(e); + console.log(`Function ${caller}: 服务器访问数据为空,请检查自身设备网络情况`); + return false; + } +} + +function printCaller(){ + return (new Error()).stack.split("\n")[2].trim().split(" ")[1] +} + +function getMin(a,b){ + return ((a { 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("", `\ud83d\udd14${this.name}, \u5f00\u59cb!`) } 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("@"), a = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(a, (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"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t) { let e = { "M+": (new Date).getMonth() + 1, "d+": (new Date).getDate(), "H+": (new Date).getHours(), "m+": (new Date).getMinutes(), "s+": (new Date).getSeconds(), "q+": Math.floor(((new Date).getMonth() + 3) / 3), S: (new Date).getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, ((new Date).getFullYear() + "").substr(4 - RegExp.$1.length))); for (let s in e) new RegExp("(" + s + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? e[s] : ("00" + e[s]).substr(("" + e[s]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))); let h = ["", "==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="]; h.push(e), s && h.push(s), i && h.push(i), console.log(h.join("\n")), this.logs = this.logs.concat(h) } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t.stack) : this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) } diff --git a/txstock.js b/txstock.js index bb4da46..07125a7 100644 --- a/txstock.js +++ b/txstock.js @@ -1,10 +1,11 @@ /* 腾讯自选股APP & 微信微证券公众号 -改自@CenBoMin大佬的脚本 + 只适配了IOS,测试了青龙和V2P,其他平台请自行测试,安卓请自行测试 多用户用#隔开 -脚本只会在10点到13点之间进行猜涨跌,请务必在这段时间内跑一次脚本,猜涨跌开奖时间为15:15 +脚本只会在10点到13点之间进行猜涨跌,请务必在这段时间内跑一次脚本 +上证和个股猜涨跌开奖时间为15:15和16:30,建议16:30后再跑一次领奖 有些任务会提示任务完成发奖失败 -- 可以忽略 或者任务完成前置条件不符合 -- 一般为需要分享,会在完成日常任务后尝试做互助 @@ -37,7 +38,7 @@ MITM: wzq.tenpay.com 圈X: [task_local] #腾讯自选股 -16 12,15 * * * txstock.js, tag=腾讯自选股, enabled=true +35 11,16 * * * https://raw.githubusercontent.com/leafxcy/JavaScript/main/txstock.js, tag=腾讯自选股, enabled=true [rewrite_local] #获取APP和微信微证券的URL和header https://wzq.tenpay.com/cgi-bin/activity_task_daily.fcgi? url script-request-header https://raw.githubusercontent.com/leafxcy/JavaScript/main/txstock.js @@ -84,6 +85,12 @@ let scanList = [] let nickname = [] let bullStatusFlag = 0 +let guessOption = 0 +let guessStockFlag = 0 +let stockName = '' +let stockList = [] +let marketCode = {'sz':0, 'sh':1, 'hk':2, } + let appShareFlag = 1 let wxShareFlag = 1 let appTaskFlag = 1 @@ -246,12 +253,15 @@ async function getRewrite() if($request.url.indexOf("openid=") > -1) { //APP包 + let msgStr = '' $.setdata($request.url,'TxStockAppUrl') $.log(`获取TxStockAppUrl成功: ${$request.url}\n`) - $.msg(`获取TxStockAppUrl成功: ${$request.url}\n`) + msgStr += `获取TxStockAppUrl成功: ${$request.url}\n` $.setdata(JSON.stringify($request.headers),'TxStockAppHeader') $.log(`获取TxStockAppHeader成功: ${JSON.stringify($request.headers)}\n`) - $.msg(`获取TxStockAppHeader成功: ${JSON.stringify($request.headers)}\n`) + msgStr += `获取TxStockAppHeader成功: ${JSON.stringify($request.headers)}\n` + + $.msg(msgStr) } else { @@ -374,13 +384,17 @@ async function getEnvParam(userNum) app_UA = "" Object.keys(appHeaderArrVal).forEach((item) => { if(item.toLowerCase() == "cookie") { - app_ck = appHeaderArrVal[item] + //app_ck = appHeaderArrVal[item] + cookie = appHeaderArrVal[item] + //pgv_info_ssid = cookie.match(/pgv_info=ssid=([\w]+)/)[1] + pgv_pvid = cookie.match(/pgv_pvid=([\w]+)/)[1] + ts_sid = cookie.match(/ts_sid=([\w]+)/)[1] + ts_uid = cookie.match(/ts_uid=([\w]+)/)[1] } else if(item.toLowerCase() == "user-agent") { app_UA = appHeaderArrVal[item] } }) - app_ck = appHeaderArrVal["Cookie"] - app_UA = appHeaderArrVal["User-Agent"] + app_ck = `pgv_pvid=${pgv_pvid}; ts_sid=${ts_sid}; ts_uid=${ts_uid}` wx_ck_tmp = "" wx_UA = "" @@ -394,14 +408,14 @@ async function getEnvParam(userNum) pgv_info = wx_ck_tmp.match(/pgv_info=([\w=]+)/)[1] pgv_pvid = wx_ck_tmp.match(/pgv_pvid=([\w]+)/)[1] - ts_last = wx_ck_tmp.match(/ts_last=([\w\/]+)/)[1] - ts_refer = wx_ck_tmp.match(/ts_refer=([\w\/\.]+)/)[1] - ts_sid = wx_ck_tmp.match(/ts_sid=([\w]+)/)[1] - ts_uid = wx_ck_tmp.match(/ts_uid=([\w]+)/)[1] + //ts_last = wx_ck_tmp.match(/ts_last=([\w\/]+)/)[1] + //ts_refer = wx_ck_tmp.match(/ts_refer=([\w\/\.]+)/)[1] + //ts_sid = wx_ck_tmp.match(/ts_sid=([\w]+)/)[1] + //ts_uid = wx_ck_tmp.match(/ts_uid=([\w]+)/)[1] qlappid = wx_ck_tmp.match(/qlappid=([\w]+)/)[1] qlskey = wx_ck_tmp.match(/qlskey=([\w]+)/)[1] qluin = wx_ck_tmp.match(/qluin=([\w@\.]+)/)[1] - qq_logtype = wx_ck_tmp.match(/qq_logtype=([\w]+)/)[1] + //qq_logtype = wx_ck_tmp.match(/qq_logtype=([\w]+)/)[1] wzq_qlappid = wx_ck_tmp.match(/wzq_qlappid=([\w]+)/)[1] wzq_qlskey = wx_ck_tmp.match(/wzq_qlskey=([\w]+)/)[1] wzq_qluin = wx_ck_tmp.match(/wzq_qluin=([\w-]+)/)[1] @@ -409,7 +423,7 @@ async function getEnvParam(userNum) //wx_ck = `pgv_info=${pgv_info}; pgv_pvid=${pgv_pvid}; ts_last=${ts_last}; ts_refer=${ts_refer}; ts_sid=${ts_sid}; ts_uid=${ts_uid}; qlappid=${qlappid}; qlskey=${qlskey}; qluin=${qluin}; qq_logtype=${qq_logtype}; wx_session_time=${sessionTime}; wzq_qlappid=${wzq_qlappid}; wzq_qlskey=${wzq_qlskey}; wzq_qluin=${wzq_qluin}; zxg_openid=${zxg_openid}` - wx_ck = `pgv_info=${pgv_info}; pgv_pvid=${pgv_pvid}; ts_last=${ts_last}; ts_refer=${ts_refer}; ts_sid=${ts_sid}; ts_uid=${ts_uid}; qlappid=${qlappid}; qlskey=${qlskey}; qluin=${qluin}; qq_logtype=${qq_logtype}; wzq_qlappid=${wzq_qlappid}; wzq_qlskey=${wzq_qlskey}; wzq_qluin=${wzq_qluin}; zxg_openid=${zxg_openid}` + wx_ck = `pgv_info=${pgv_info}; pgv_pvid=${pgv_pvid}; qlappid=${qlappid}; qlskey=${qlskey}; qluin=${qluin}; wzq_qlappid=${wzq_qlappid}; wzq_qlskey=${wzq_qlskey}; wzq_qluin=${wzq_qluin}; zxg_openid=${zxg_openid}` } async function initAccountInfo() @@ -1977,10 +1991,11 @@ async function appGuessStatus() { curTime = new Date() rndtime = Math.round(curTime.getTime()) currentHour = curTime.getHours() - let isGuessTime = ((currentHour < 13) && (currentHour > 9)) ? 1 : 0 + currentDay = curTime.getDay() + let isGuessTime = ((currentHour < 13) && (currentHour > 9) && (currentDay < 6) && (currentDay > 0)) ? 1 : 0 return new Promise((resolve) => { let url = { - url: `https://zqact.tenpay.com/cgi-bin/guess_home.fcgi?channel=1&source=2&new_version=2&_=${rndtime}&openid=${app_openid}&fskey=${app_fskey}&access_token=${app_token}&_appName=${app_appName}&_appver=${app_appver}&_osVer=${app_osVer}&_devId=${app_devId}`, + url: `https://zqact.tenpay.com/cgi-bin/guess_home.fcgi?channel=1&source=2&new_version=3&_=${rndtime}&openid=${app_openid}&fskey=${app_fskey}&access_token=${app_token}&_appName=${app_appName}&_appver=${app_appver}&_osVer=${app_osVer}&_devId=${app_devId}`, headers: { 'Cookie': app_ck, 'Accept': `application/json, text/plain, */*`, @@ -2007,34 +2022,54 @@ async function appGuessStatus() { if(result.notice_info && result.notice_info[0]) { if(logDebug) console.log(result) if(result.notice_info[0].answer_status == 1) { - $.log(`上期猜涨跌回答正确,正在取得奖励\n`); + $.log(`上期猜上证指数涨跌回答正确,正在取得奖励\n`); await appGuessAward(result.notice_info[0].date) } else { - $.log(`上期猜涨跌回答错误\n`); + $.log(`上期猜上证指数涨跌回答错误\n`); + } + await $.wait(1000) + } + if(result.stock_notice_info && result.stock_notice_info[0]) { + if(logDebug) console.log(result) + if(result.stock_notice_info[0].guess_correct == 1) { + $.log(`上期猜个股涨跌回答正确,正在取得奖励\n`); + await appGuessStockAward(result.stock_notice_info[0].date) + } else { + $.log(`上期猜个股涨跌回答错误\n`); } await $.wait(1000) } if(isGuessTime) { if((result.T_info && result.T_info[0] && result.T_info[0].user_answer == 0) || (result.T1_info && result.T1_info[0] && result.T1_info[0].user_answer == 0)) { - let guessOption = 1 - if(result.stockinfo && result.stockinfo[0]) { - guessOption = (result.stockinfo[0].zdf.indexOf('-') > -1) ? 2 : 1 - let guessStr = (guessOption == 2) ? "跌" : "涨" - $.log(`当前上证指数涨幅为${result.stockinfo[0].zdf}%,为你猜${guessStr}\n`); - } else { - $.log(`未获取到上证指数状态,默认为你猜涨\n`); - } if(result.date_list) { for(let i=0; i 0) { + await $.wait(100) + await appGuessRiseFall(guessOption,guessItem.date) + } else { + $.log(`获取猜涨跌错误:guessOption=${guessOption}\n`); + } } } } } else { - $.log(`已竞猜当期涨跌\n`); + $.log(`已竞猜当期上证指数涨跌\n`); + } + if(result.recommend && Array.isArray(result.recommend)) { + recList = result.recommend + stockList = recList.sort(function(a,b){return Math.abs(b["zdf"])-Math.abs(a["zdf"])}); + guessStockFlag = 1 + for(let k=0; k { + let url = { + url: `https://zqact.tenpay.com/cgi-bin/open_stockinfo.fcgi?scode=${scode}&markets=${markets}&needfive=0&needquote=1&needfollow=0&type=0&channel=1&_=${rndtime}&openid=${app_openid}&fskey=${app_fskey}&access_token=${app_token}&_appName=${app_appName}&_appver=${app_appver}&_osVer=${app_osVer}&_devId=${app_devId}`, + headers: { + 'Cookie': app_ck, + 'Accept': `*/*`, + 'Connection': `keep-alive`, + 'Referer': `https://zqact.tenpay.com/activity/page/guessRiseFall/`, + 'Accept-Encoding': `gzip, deflate, br`, + 'Host': `zqact.tenpay.com`, + 'User-Agent': app_UA, + 'Accept-Language': `zh-cn`, + }, + }; + + $.get(url, async (err, resp, data) => { + try { + data = data.replace(/\\x/g,'') + if (err) { + console.log("腾讯自选股: API查询请求失败 ‼️‼️"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + let result = JSON.parse(data); + if(logDebug) console.log(result) + if(result.retcode == 0) { + stockName = result.secu_info.secu_name || '' + if(stockName) { + let dqj = result.secu_quote.dqj || 0 + let zsj = result.secu_quote.zsj || 0 + let raise = dqj - zsj + let ratio = raise/zsj*100 + let guessStr = (raise < 0) ? '跌' : '涨' + guessOption = (raise < 0) ? 2 : 1 + $.log(`${stockName}:当前价格${dqj},前天收市价${zsj},涨幅${Math.floor(ratio*100)/100}% (${Math.floor(raise*100)/100}),猜${guessStr}`); + } + } else { + $.log(`获取个股信息失败:${result.retmsg}`); + } + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +//猜上证指数涨跌奖励 async function appGuessAward(guessDate) { rndtime = Math.round(curTime.getTime()) return new Promise((resolve) => { @@ -2094,9 +2184,61 @@ async function appGuessAward(guessDate) { let result = JSON.parse(data); if(logDebug) console.log(result) if(result.retcode == 0) { - $.log(`获得猜涨跌奖励:${result.reward_memo} ${result.reward_value}金币\n`); + $.log(`获得上证指数猜涨跌奖励:${result.reward_memo} ${result.reward_value}金币\n`); + } else { + $.log(`获得上证指数猜涨跌奖励失败:${result.retmsg}\n`); + } + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +//猜个股涨跌奖励 +async function appGuessStockAward(guessDate) { + rndtime = Math.round(curTime.getTime()) + return new Promise((resolve) => { + let url = { + url: `https://zqact.tenpay.com/cgi-bin/activity/activity.fcgi?activity=guess_new&action=guess_stock_reward&guess_date=${guessDate}&channel=1&_=${rndtime}&openid=${app_openid}&fskey=${app_fskey}&access_token=${app_token}&_appName=${app_appName}&_appver=${app_appver}&_osVer=${app_osVer}&_devId=${app_devId}`, + headers: { + 'Cookie': app_ck, + 'Accept': `application/json, text/plain, */*`, + 'Connection': `keep-alive`, + 'Referer': `https://zqact.tenpay.com/activity/page/guessRiseFall/`, + 'Accept-Encoding': `gzip, deflate, br`, + 'Host': `zqact.tenpay.com`, + 'User-Agent': app_UA, + 'Accept-Language': `zh-cn` + }, + }; + $.get(url, async (err, resp, data) => { + try { + if (err) { + console.log("腾讯自选股: API查询请求失败 ‼️‼️"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + let result = JSON.parse(data); + if(logDebug) console.log(result) + if(result.retcode == 0) { + if(result.stock_rewards && Array.isArray(result.stock_rewards)) { + for(let i=0; i { + let url = { + url: `https://wzq.tenpay.com/cgi-bin/guess_home.fcgi?access_token=${app_token}&openid=${app_openid}&fskey=${app_fskey}&check=11&_dev=iPhone13,2&_devId=${app_devId}&_appver=${app_appver}&_osVer=${app_osVer}&_appName=${app_appName}&source=3&channel=1&symbol=${stockItem.symbol}&new_version=3`, + headers: { + 'Cookie': app_ck, + 'Accept': `application/json, text/plain, */*`, + 'Connection': `keep-alive`, + 'Referer': `https://zqact.tenpay.com/activity/page/guessRiseFall/`, + 'Accept-Encoding': `gzip, deflate, br`, + 'Host': `zqact.tenpay.com`, + 'User-Agent': app_UA, + 'Accept-Language': `zh-cn` + }, + }; + $.get(url, async (err, resp, data) => { + try { + if (err) { + console.log("腾讯自选股: API查询请求失败 ‼️‼️"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + let result = JSON.parse(data); + if(logDebug) console.log(result) if(result.retcode == 0) { - $.log(`用户 ${nickname[numUser]} 猜涨跌成功:${guessStr}\n`); + $.log(`剩余猜个股涨跌次数:${result.guess_times_left}`); + if(result.guess_times_left > 0) { + if(result.T_info.user_answer > 0) { + $.log(`已竞猜:${stockItem.stockname}\n`); + } else { + let guessStr = (stockItem.zdf < 0) ? '跌' : '涨' + let answer = (stockItem.zdf < 0) ? 2 : 1 + console.log(`${stockItem.stockname}今天涨幅为${stockItem.zdf}%,猜${guessStr}`) + await $.wait(1000) + await appGuessStock(stockItem,answer) + } + } else { + $.log(`竞猜个股次数已用完\n`); + guessStockFlag = 0 + } } else { - $.log(`用户 ${nickname[numUser]} ${guessStr}失败:${result.retmsg}\n`); + $.log(`获取猜个股涨跌次数失败:${result.retmsg}\n`); } } } @@ -2152,6 +2352,52 @@ async function appGuessRiseFall(answer,guessDate) { }); }); } + +//猜个股涨跌 +async function appGuessStock(stockItem,answer) { + rndtime = Math.round(curTime.getTime()) + return new Promise((resolve) => { + let url = { + url: `https://wzq.tenpay.com/cgi-bin/guess_op.fcgi?access_token=${app_token}&openid=${app_openid}&fskey=${app_fskey}&check=11&_dev=iPhone13,2&_devId=${app_devId}&_appver=${app_appver}&_osVer=${app_osVer}&_appName=${app_appName}&`, + headers: { + 'Cookie': app_ck, + 'Accept': `application/json, text/plain, */*`, + 'Connection': `keep-alive`, + 'Referer': `https://zqact.tenpay.com/activity/page/guessRiseFall/`, + 'Accept-Encoding': `gzip, deflate, br`, + 'Host': `zqact.tenpay.com`, + 'User-Agent': app_UA, + 'Accept-Language': `zh-cn` + }, + body: `source=3&channel=1&outer_src=0&new_version=3&symbol=${stockItem.symbol}&date=${todayDate}&action=2&user_answer=${answer}&access_token=${app_token}&openid=${app_openid}&fskey=${app_fskey}&check=11&`, + }; + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log("腾讯自选股: API查询请求失败 ‼️‼️"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + let result = JSON.parse(data); + if(logDebug) console.log(result) + let guessStr = (answer==1) ? "猜涨" : "猜跌" + if(result.retcode == 0) { + $.log(`${stockItem.stockname} 猜涨跌成功:${guessStr}\n`); + } else { + $.log(`${stockItem.stockname} ${guessStr}失败:${result.retmsg}\n`); + } + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + //////////////////////////////////////////////////////////////////// function time(time) { diff --git a/ydd.js b/ydd.js new file mode 100644 index 0000000..b3e3f2a --- /dev/null +++ b/ydd.js @@ -0,0 +1,1105 @@ +/* +IOS:看点宝/阅多多/悦看点 +三个APP分别捉包,可以共用一个脚本跑任务 +比较容易黑,不要跑太频繁,每天11次就可以领完任务奖励 +每天金币7毛以上,提现1元和5元需要做任务拿提现券 +看点宝下载注册地址:https://yuekandian.yichengw.cn/download?app=5&referrer=764084 + +可以在环境变量yddSkipWithdraw设置不想提现的金额,逗号隔开,填0就会尝试提现所有金额 +export yddSkipWithdraw='1' + +青龙: +捉取 https://yuekandian.yichengw.cn/api/v1/member/profile 的包里的Authorization(把前面的Bearer删掉),device和User-Agent,按顺序用#连起来写到yddCookie里,多账户用@隔开 +export yddCookie='账号1的Authorization#device#UA@账号2的Authorization#device#UA' + +V2P重写:打开APP即可获取CK,没有的话点一下我的页面或者赚钱页面 +[task_local] +#看点宝/阅多多/悦看点 +15 9-21 * * * https://raw.githubusercontent.com/leafxcy/JavaScript/main/ydd.js, tag=看点宝/阅多多/悦看点, enabled=true +[rewrite_local] +https://yuekandian.yichengw.cn/api/v1/member/profile url script-request-header https://raw.githubusercontent.com/leafxcy/JavaScript/main/ydd.js +[MITM] +hostname = yuekandian.yichengw.cn +*/ + +const jsname = '阅多多' +const $ = Env(jsname) +const notifyFlag = 1; //0为关闭通知,1为打开通知,默认为1 +const logDebug = 0 + +//const notify = $.isNode() ? require('./sendNotify') : ''; +let notifyStr = '' + +let rndtime = "" //毫秒 +let httpResult //global buffer + +let host = 'yuekandian.yichengw.cn' +let hostname = 'https://' + host + +let yddCookie = ($.isNode() ? process.env.yddCookie : $.getdata('yddCookie')) || ''; +let yddCookieArr = [] +let userToken = [] +let userDevice = [] +let userAgent = [] +let userCookie = [] + +let yddSkipWithdraw = ($.isNode() ? process.env.yddSkipWithdraw : $.getdata('yddSkipWithdraw')) || '0'; +let skipWithdraw = [] + +let userIdx = 0 +let taskIdx = 0 +let coinList = [] +let signFlag = [] +let contSignFlag = [] +let lotteryTicket = [] +let lotteryAdTicket = [] +let helpTicket = [] +let userTicket = [] +let userWaitTime = [] +let extraRewardFlag = [] +let userInfo = [] +let withdrawFlag = [] +let adVideoFlag = [] +let adVideoTicket = [] +let doAliFlag = [] +let barrierFlag = [] +let doneTaskList = [] +let doneTaskTicket = [] + +let NUM_PER_ROUND = 2 + +let LOTTERY_TYPE = 1 +let AD_TICKET_TYPE = 5 +let AD_VIDEO_TYPE = 10 +let HELP_TYPE = 13 +let COIN_TYPE = 14 + +/////////////////////////////////////////////////////////////////// + +!(async () => { + + if(typeof $request !== "undefined") + { + await GetRewrite() + } + else + { + if(!(await checkEnv())) { + return + } + + await initAccountInfo() + await RunMultiUser() + } + + +})() +.catch((e) => $.logErr(e)) +.finally(() => $.done()) + +//通知 +async function showmsg() { + + notifyBody = jsname + "运行通知\n\n" + notifyStr + + if (notifyFlag != 1) { + console.log(notifyBody); + } + + if (notifyFlag == 1) { + $.msg(notifyBody); + //if ($.isNode()){await notify.sendNotify($.name, notifyBody );} + } +} + +async function GetRewrite() { + if($request.url.indexOf('/api/v1/member/profile') > -1) { + let headers = $request.headers + let auth = headers.Authorization + if(!auth) return + auth = auth.replace(/Bearer /g,'') + let device = headers['device'] + if(!device) return + let ua = headers['User-Agent'] + if(!ua) return + let ck = auth + '#' + device + '#' + ua + + if(yddCookie) { + if(yddCookie.indexOf(ck) == -1) { + yddCookie = yddCookie + '@' + ck + $.setdata(yddCookie, 'yddCookie'); + ckList = yddCookie.split('@') + $.msg(jsname+` 获取第${ckList.length}个yddCookie成功: ${yddCookie}`) + } + } else { + $.setdata(ck, 'yddCookie'); + $.msg(jsname+` 获取第1个yddCookie成功: ${ck}`) + } + } +} + +async function checkEnv() { + if(yddCookie) { + yddCookie = yddCookie.replace(/Bearer/g,'') + if(yddCookie.indexOf('@') > -1) { + let yddCookies = yddCookie.split('@') + for(let i=0; i -1) { + skipWithdraw = yddSkipWithdraw.split(',') + } else { + skipWithdraw.push(yddSkipWithdraw) + } + } + + console.log(`共找到${yddCookieArr.length}个用户`) + return true +} + +async function initAccountInfo() { + for(userIdx=0; userIdx 0) { + console.log('\n开始领取首页气泡红包...') + for(let i=0; i 0) { + console.log('\n开始签到...') + for(userIdx=0; userIdx 0) { + console.log('\n开始领取连续签到奖励...') + for(userIdx=0; userIdx 0) { + console.log('\n开始抽奖...') + for(userIdx=0; userIdx0) needBarrier=1 + } + await $.wait(100) + + if(needBarrier > 0) { + for(userIdx=0; userIdx 0) { + console.log('\n开始领取任务奖励...') + for(taskIdx=0; taskIdx 0) { + console.log('\n开始做跳转支付宝任务...') + for(userIdx=0; userIdx 0) { + console.log('\n开始看广告...') + for(userIdx=0; userIdx 0) { + for(userIdx=0; userIdx 0; i++) { + haveTicket = 0 + console.log(`--- 开始刷第${i+1}轮 ---`) + + let waitTime = Math.floor(Math.random()*1000) + maxWaitTime*1000 + console.log(`随机等待${waitTime/1000}秒...`) + await $.wait(waitTime) + for(userIdx=0; userIdx 0) { + for(userIdx=0; userIdx 0; i++) { + haveTicket = 0 + console.log(`--- 开始刷第${i+1}轮 ---`) + + let waitTime = Math.floor(Math.random()*1000) + maxWaitTime*1000 + console.log(`随机等待${waitTime/1000}秒...`) + await $.wait(waitTime) + for(userIdx=0; userIdx= items.days) { + console.log(`用户${userIdx+1}可领取${items.desc}奖励`) + contSignFlag[userIdx] = 1 + } + } + } else { + console.log(`用户${userIdx+1}查询签到状态失败:${result.message}`) + } +} + +//签到 +async function DoSign() { + let caller = printCaller() + let url = `${hostname}/api/v1/reward/sign?` + let urlObject = populatePostUrl(url) + await httpPost(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.code == 0) { + console.log(`用户${userIdx+1}签到获得:${result.result.coin}金币`) + } else { + console.log(`用户${userIdx+1}签到失败:${result.message}`) + } +} + +//连续签到奖励 +async function RewardContinuesSign() { + let caller = printCaller() + let url = `${hostname}/api/v1/reward/sign/red_envelope?` + let urlObject = populatePostUrl(url) + await httpPost(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.code == 0) { + console.log(`用户${userIdx+1}获得连续签到奖励:${result.result.amount}元`) + } else { + console.log(`用户${userIdx+1}获得连续签到奖励失败:${result.message}`) + } +} + +//查询首页金币气泡 +async function QueryCoinInfo() { + let caller = printCaller() + let url = `${hostname}/api/v1/reward/coin?` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.code == 0) { + for(let items of result.result.coins) { + if(items.num > 0) { + coinList[userIdx].push(items) + } + } + console.log(`用户${userIdx+1}有${coinList[userIdx].length}个可以领取的首页气泡`) + } else { + console.log(`用户${userIdx+1}查询首页气泡信息失败:${result.message}`) + } +} + +//领取首页气泡 +async function GetCoin(id) { + let caller = printCaller() + let url = `${hostname}/api/v1/reward/coin?` + let body = `id=${id}&` + let urlObject = populatePostUrl(url,body) + await httpPost(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.code == 0) { + console.log(`用户${userIdx+1}领取首页气泡获得:${result.result.coin}金币`) + } else { + console.log(`用户${userIdx+1}领取首页气泡失败:${result.message}`) + } +} + +//查询抽奖状态 +async function QueryLotteryInfo() { + let caller = printCaller() + let url = `${hostname}/api/v1/reward/lottery/index?` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.code == 0) { + console.log(`用户${userIdx+1}今天剩余抽奖次数:${result.result.lottery_count}`) + if(result.result.lottery_count>0) { + lotteryTicket[userIdx] = result.result.ticket + } + } else { + console.log(`用户${userIdx+1}查询抽奖状态失败:${result.message}`) + } +} + +//抽奖 +async function DoLottery(ticket) { + let caller = printCaller() + let url = `${hostname}/api/v1/reward/lottery/index?` + let body = `ticket=${ticket}&` + let urlObject = populatePostUrl(url,body) + await httpPost(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.code == 0) { + if(result.result.type==2) { + lotteryAdTicket[userIdx] = result.result.ticket + console.log(`用户${userIdx+1}抽奖获得:${result.result.num}金币`) + } else if (result.result.type==1) { + console.log(`用户${userIdx+1}抽奖获得:${result.result.num}手机碎片`) + } else { + console.log(result) + } + } else { + console.log(`用户${userIdx+1}抽奖失败:${result.message}`) + } +} + +//助力领现金-看视频 +async function HelpClick() { + let caller = printCaller() + let url = `${hostname}/api/v1/reward/help/click?` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.code == 0) { + if(result.result && result.result.ticket) { + helpTicket[userIdx] = result.result.ticket + console.log(`用户${userIdx+1}看助力领现金视频将获得${result.result.coin/10000}元余额`) + } else { + console.log(`用户${userIdx+1}看助力领现金视频失败:${result.message}`) + } + } else { + console.log(`用户${userIdx+1}看助力领现金视频失败:${result.message}`) + } +} + +//助力领现金信息 +async function HelpInfo() { + let caller = printCaller() + let url = `${hostname}/api/v1/reward/help/index?` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.code == 0) { + console.log(`用户${userIdx+1}助力领现金金额:${result.result.jinbi}元,还差${result.result.diff_jinbi}元可以提现`) + } else { + console.log(`用户${userIdx+1}看助力领现金视频失败:${result.message}`) + } +} + +//开始广告 +async function WatchAd(type) { + let caller = printCaller() + let url = `${hostname}/api/v1/ad/topon/placement/id?type=${type}&` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.code == 0) { + console.log(`用户${userIdx+1}开始看广告`) + } else { + console.log(`用户${userIdx+1}看广告失败:${result.message}`) + } +} + +//完成广告 +async function LogAd(type,ticket='') { + let caller = printCaller() + let ticketStr = '' + if(ticket) ticketStr = `ticket=${ticket}&` + let url = `${hostname}/api/v1/ad/log?${ticketStr}type=${type}&` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.code == 0) { + console.log(`用户${userIdx+1}完成看广告`) + } else { + console.log(`用户${userIdx+1}完成看广告失败:${result.message}`) + } +} + +//获取ticket +async function GetTicket(suburl) { + userTicket[userIdx] = '' + userWaitTime[userIdx] = 0 + let caller = printCaller() + let url = `${hostname}/api/v1/reward/${suburl}` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.code == 0) { + if(result.result.coin_status==1) { + if(result.result.ticket) { + userTicket[userIdx] = result.result.ticket + userWaitTime[userIdx] = result.result.time + console.log(`用户${userIdx+1}获取到ticket`) + } else { + console.log(`用户${userIdx+1}获取ticket失败:${result.message}`) + } + } else { + console.log(`用户${userIdx+1}已无法获得更多金币`) + } + } else { + console.log(`用户${userIdx+1}获取ticket失败:${result.message}`) + } +} + +//记录时间 +async function TimeRecord(suburl,isEnd=false) { + let caller = printCaller() + let endStr = '' + let desc = '开始' + if(isEnd) { + endStr = 'end=1&' + desc = '结束' + } + let url = `${hostname}/api/v1/reward/${suburl}/interval?${endStr}` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.code == 0) { + console.log(`用户${userIdx+1}${desc}记录时长`) + } else { + console.log(`用户${userIdx+1}${desc}记录时长失败:${result.message}`) + } +} + +//获得奖励 +async function Reward(suburl,ticket,subbody='') { + extraRewardFlag[userIdx] = 0 + userTicket[userIdx] = '' + userWaitTime[userIdx] = 0 + let caller = printCaller() + let url = `${hostname}/api/v1/reward/${suburl}` + let body = `ticket=${ticket}&${subbody}` + let urlObject = populatePostUrl(url,body) + await httpPost(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.code == 0) { + if(result.result.count >= result.result.target && result.result.ren_status == 1) extraRewardFlag[userIdx]=1 + if(result.result.ticket) { + userTicket[userIdx] = result.result.ticket + userWaitTime[userIdx] = result.result.time + console.log(`用户${userIdx+1}获取到下一个ticket`) + } else { + console.log(`用户${userIdx+1}获取下一个ticket失败:${result.message}`) + } + console.log(`用户${userIdx+1}获得:${result.result.reward}金币,额外奖励次数${result.result.target},目前已刷${result.result.count}次`) + } else { + console.log(`用户${userIdx+1}获得奖励失败:${result.message}`) + } +} + +//额外次数奖励 +async function RewardOpen(suburl,body='') { + let caller = printCaller() + let url = `${hostname}/api/v1/reward/${suburl}/open?` + let urlObject = populatePostUrl(url,body) + await httpPost(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.code == 0) { + console.log(`用户${userIdx+1}获得额外奖励:${result.result.reward}金币`) + } else { + console.log(`用户${userIdx+1}获得额外奖励失败:${result.message}`) + } +} + +//账号信息 +async function QueryUserInfo() { + let caller = printCaller() + let url = `${hostname}/api/v1/member/profile?debug=0&` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.code == 0) { + console.log(`\n==== 用户${userIdx+1}: ${result.result.nickname} ====`) + console.log(`今日收益: ${result.result.today_point}`) + console.log(`提现券 : ${result.result.ticket}`) + console.log(`手机碎片: ${result.result.fragment}`) + console.log(`金币余额: ${result.result.point}`) + console.log(`历史收益: ${result.result.total_point}`) + userInfo[userIdx] = result.result + } else { + console.log(`用户${userIdx+1}查询账号信息失败:${result.message}`) + } +} + +//提现列表 +async function QueryWithdrawList() { + let caller = printCaller() + let url = `${hostname}/api/v1/cash/exchange?` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.code == 0) { + let sortList = result.result.items.sort(function(a,b){return b["jine"]-a["jine"]}); + for(let item of sortList) { + let skipFlag = 0 + if(skipWithdraw.length>0) { + for(let skipItem of skipWithdraw) { + if(item.jine == skipItem) { + skipFlag = 1 + break + } + } + } + if(skipFlag==1) { + console.log(`用户${userIdx+1}跳过提现${item.jine}元`) + continue + } + if(userInfo[userIdx].point>=item.jinbi && userInfo[userIdx].ticket>=item.cond && item.is_ok==1) { + console.log(`用户${userIdx+1}准备提现${item.jine}元`) + await Withdraw(item.jine) + if(withdrawFlag[userIdx]==1) break; + } + } + } else { + console.log(`用户${userIdx+1}查询提现列表失败:${result.message}`) + } +} + +//提现 +async function Withdraw(amount) { + let caller = printCaller() + let url = `${hostname}/api/v1/cash/exchange?` + let body = `amount=${amount}&gate=wechat&` + let urlObject = populatePostUrl(url,body) + await httpPost(urlObject,caller) + let result = httpResult; + if(!result) return false + + if(result.code == 0) { + withdrawFlag[userIdx] = 1 + console.log(`用户${userIdx+1}提现${amount}:${result.result.title}, ${result.result.message}`) + } else { + console.log(`用户${userIdx+1}提现${amount}失败:${result.message}`) + } + return false +} + +//获取任务列表状态 +async function QueryTaskList() { + let caller = printCaller() + let url = `${hostname}/api/v1/zhuan/index?` + let urlObject = populatePostUrl(url) + await httpPost(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.code == 0) { + for(let item of result.result.items) { + let str = (item.st==0) ? '未完成' : '已完成' + if(item.title.indexOf('观看广告视频') > -1) { + let matchItem = item.title.match(/"red">(\w+)<\/font>\/(\w+)/) + str = (parseInt(matchItem[2]) > parseInt(matchItem[1])) ? '未完成' : '已完成' + if(item.st==0) adVideoFlag[userIdx] = 1 + console.log(`用户${userIdx+1}${str}看广告任务,总次数${matchItem[2]}次,已完成${matchItem[1]}次`) + } else if(item.title.indexOf('支付宝红包') > -1) { + if(item.st==0) doAliFlag[userIdx] = 1 + console.log(`用户${userIdx+1}${str}跳转支付宝任务`) + } else if(item.title.indexOf('看资讯') > -1) { + let matchItem = item.rate.split('$') + console.log(`用户${userIdx+1}${str}看资讯任务,总次数${matchItem[1]}次,已完成${matchItem[0]}次`) + } else if(item.title.indexOf('刷视频') > -1) { + let matchItem = item.rate.split('$') + console.log(`用户${userIdx+1}${str}刷视频任务,总次数${matchItem[1]}次,已完成${matchItem[0]}次`) + } + if(item.st==1) { + if(item.id != 10 && item.time <= 0) { + doneTaskList[userIdx].push(item.id) + doneTaskTicket[userIdx].push('') + } + } + } + } else { + console.log(`用户${userIdx+1}获取任务列表状态失败:${result.message}`) + } +} + +//获取看广告视频任务ticket +async function DoAdVideo() { + let caller = printCaller() + let url = `${hostname}/api/v1/zhuan/video?` + let urlObject = populatePostUrl(url) + await httpPost(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.code == 0) { + if(result.result.ticket) { + adVideoTicket[userIdx] = result.result.ticket + console.log(`用户${userIdx+1}获取看广告视频ticket成功,将获得:${result.result.coin}金币,${result.result.coupon}提现券`) + } else { + console.log(`用户${userIdx+1}获取看广告视频ticket失败`) + } + } else { + console.log(`用户${userIdx+1}获取看广告视频ticket失败:${result.message}`) + } +} + +//跳转支付宝 +async function DoAliTask() { + let caller = printCaller() + let url = `${hostname}/api/v1/zhuan/aliaaa?` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.code == 0) { + console.log(`用户${userIdx+1}完成跳转支付宝任务`) + } else { + console.log(`用户${userIdx+1}完成跳转支付宝任务失败:${result.message}`) + } +} + +//闯关换手机状态 +async function QueryBarrierInfo() { + let caller = printCaller() + let url = `${hostname}/api/v1/reward/barrier/index?` + let urlObject = populateGetUrl(url) + await httpGet(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.code == 0) { + console.log(`用户${userIdx+1}今天已闯关${result.result.current_barrier}次`) + if(result.result.current_barrier<7) { + barrierFlag[userIdx] = parseInt(result.result.current_barrier) + 1 + } + } else { + console.log(`用户${userIdx+1}获取看广告视频ticket失败:${result.message}`) + } +} + +//闯关 +async function DoBarrier(num) { + let caller = printCaller() + let url = `${hostname}/api/v1/reward/barrier/index?` + let body = `no=${num}&` + let urlObject = populatePostUrl(url,body) + await httpPost(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.code == 0) { + console.log(`用户${userIdx+1}闯关获得:${result.result.coin}金币,${result.result.fragment}手机碎片`) + } else { + console.log(`用户${userIdx+1}闯关失败:${result.message}`) + } +} + +//领任务奖励 +async function doneTaskReward(id) { + let caller = printCaller() + let url = `${hostname}/api/v1/zhuan/done?` + let body = `id=${id}&` + let urlObject = populatePostUrl(url,body) + await httpPost(urlObject,caller) + let result = httpResult; + if(!result) return + + if(result.code == 0) { + if(result.result.ticket) doneTaskTicket[userIdx][taskIdx] = result.result.ticket + console.log(`用户${userIdx+1}领取任务[id=${id}]奖励获得:${result.result.coin}金币`) + } else { + console.log(`用户${userIdx+1}领取任务[id=${id}]奖励失败:${result.message}`) + } +} +//////////////////////////////////////////////////////////////////// +function populatePostUrl(url,reqBody=''){ + let urlObject = { + url: url, + headers: { + 'Host' : 'yuekandian.yichengw.cn', + 'version' : '8', + 'Authorization' : 'Bearer ' + userToken[userIdx], + 'Accept-Language' : 'zh-CN,zh-Hans;q=0.9', + 'Accept-Encoding' : 'gzip, deflate, br', + 'platform' : '2', + 'Accept' : '*/*', + 'User-Agent' : userAgent[userIdx], + 'Connection' : 'keep-alive', + 'device' : userDevice[userIdx], + 'store' : '100', + }, + body: reqBody + } + if(userAgent[userIdx].indexOf('CBD') > -1) { + urlObject.headers['version'] = '2' + urlObject.headers['app'] = '3' + } else if(userAgent[userIdx].indexOf('KDB') > -1) { + urlObject.headers['version'] = '1' + urlObject.headers['app'] = '5' + } + return urlObject; +} + +function populateGetUrl(url){ + let urlObject = { + url: url, + headers: { + 'Host' : 'yuekandian.yichengw.cn', + 'version' : '8', + 'Authorization' : 'Bearer ' + userToken[userIdx], + 'Accept-Language' : 'zh-CN,zh-Hans;q=0.9', + 'Accept-Encoding' : 'gzip, deflate, br', + 'platform' : '2', + 'Accept' : '*/*', + 'User-Agent' : userAgent[userIdx], + 'Connection' : 'keep-alive', + 'device' : userDevice[userIdx], + 'store' : '100', + } + } + if(userAgent[userIdx].indexOf('CBD') > -1) { + urlObject.headers['version'] = '2' + urlObject.headers['app'] = '3' + } else if(userAgent[userIdx].indexOf('KDB') > -1) { + urlObject.headers['version'] = '1' + urlObject.headers['app'] = '5' + } + return urlObject; +} + +async function httpPost(url,caller) { + httpResult = null + return new Promise((resolve) => { + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log(caller + ": post请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + httpResult = JSON.parse(data); + if(logDebug) console.log(httpResult); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +async function httpGet(url,caller) { + httpResult = null + return new Promise((resolve) => { + $.get(url, async (err, resp, data) => { + try { + if (err) { + console.log(caller + ": get请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data,caller)) { + httpResult = JSON.parse(data); + if(logDebug) console.log(httpResult); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +function safeGet(data,caller) { + try { + if (typeof JSON.parse(data) == "object") { + return true; + } else { + console.log(`Function ${caller}: 未知错误`); + console.log(data) + } + } catch (e) { + console.log(e); + console.log(`Function ${caller}: 服务器访问数据为空,请检查自身设备网络情况`); + return false; + } +} + +function printCaller(){ + return (new Error()).stack.split("\n")[2].trim().split(" ")[1] +} + +function getMin(a,b){ + return ((a { 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("", `\ud83d\udd14${this.name}, \u5f00\u59cb!`) } 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("@"), a = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(a, (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"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t) { let e = { "M+": (new Date).getMonth() + 1, "d+": (new Date).getDate(), "H+": (new Date).getHours(), "m+": (new Date).getMinutes(), "s+": (new Date).getSeconds(), "q+": Math.floor(((new Date).getMonth() + 3) / 3), S: (new Date).getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, ((new Date).getFullYear() + "").substr(4 - RegExp.$1.length))); for (let s in e) new RegExp("(" + s + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? e[s] : ("00" + e[s]).substr(("" + e[s]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))); let h = ["", "==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="]; h.push(e), s && h.push(s), i && h.push(i), console.log(h.join("\n")), this.logs = this.logs.concat(h) } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t.stack) : this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) } diff --git a/zqkd/zqkd_check.js b/zqkd/zqkd_check.js new file mode 100644 index 0000000..ed952b0 --- /dev/null +++ b/zqkd/zqkd_check.js @@ -0,0 +1,12 @@ +/* +中青看点检查脚本 + +本脚本会找出账号ck并检查账号状态是否黑号,默认不执行注销 +把需要检查的账号按照 手机号#密码 的格式,填到zqkdAccount里,多账号用@隔开 +或者把账号CK填进zqkdBlackCookie里,多账号用@隔开 +例子:export zqkdAccount='110#123456@120#654321' +export zqkdBlackCookie='uid=xxxx&zqkey=yyyyy&zqkey_id=zzzzzz' +!!!谨慎操作:如果需要注销,请把环境变量zqkdCancel设为1!!! +*/ + +const _0x3c3db2=_0x2bd7;(function(_0x160349,_0x1a6441){const _0x49a870=_0x2bd7,_0x465d90=_0x160349();while(!![]){try{const _0x5e2f02=parseInt(_0x49a870(0x252))/(-0x1799+0x1304+0x496)*(-parseInt(_0x49a870(0x301))/(-0x16*-0x136+-0x2b*-0x11+-0x1*0x1d7d))+parseInt(_0x49a870(0x2d8))/(-0x2617+0xc5b*0x3+0x109)+-parseInt(_0x49a870(0x1ec))/(-0x2*0x1269+-0x2046+0x451c)+-parseInt(_0x49a870(0x3cd))/(0x1*-0xe51+-0x981*-0x3+-0x13*0xbf)*(parseInt(_0x49a870(0x1c4))/(-0x1*0x231b+0x1627+0x97*0x16))+parseInt(_0x49a870(0x3d2))/(0x1*0x2d1+0x17*-0xe6+0x1a0*0xb)*(-parseInt(_0x49a870(0x211))/(-0x14ff+0x2194+-0xc8d))+parseInt(_0x49a870(0x3fa))/(-0x1f29*0x1+0x96*0x1f+0xd08)*(parseInt(_0x49a870(0x3da))/(0x425*-0x5+-0x41*0x40+0x2503))+parseInt(_0x49a870(0x37f))/(0xb23*0x2+0x1d*-0x157+0x10a0)*(parseInt(_0x49a870(0x2b5))/(0x2+-0x42d+0x437));if(_0x5e2f02===_0x1a6441)break;else _0x465d90['push'](_0x465d90['shift']());}catch(_0x376da0){_0x465d90['push'](_0x465d90['shift']());}}}(_0x45e4,-0x98a3a+0x74ad2+0x72bcd));const jsname=_0x3c3db2(0x387),$=Env(jsname),logDebug=0x9c0+0xb37*-0x1+0x177;let rndtime='',httpResult;var CryptoJS=require('crypto-js');let userAccount=($[_0x3c3db2(0x25c)]()?process[_0x3c3db2(0x419)][_0x3c3db2(0x3f3)]:$[_0x3c3db2(0x1bc)](_0x3c3db2(0x3f3)))||'',userAccountArr=[],userCookie=($[_0x3c3db2(0x25c)]()?process[_0x3c3db2(0x419)][_0x3c3db2(0x265)]:$[_0x3c3db2(0x1bc)]('zqkdBlackCookie'))||'',userCookieArr=[],needCancel=($['isNode']()?process[_0x3c3db2(0x419)][_0x3c3db2(0x2b9)]:$[_0x3c3db2(0x1bc)](_0x3c3db2(0x2b9)))||-0x76*-0x32+0x12*0x8d+-0x20f6;setInterval(function(){const _0x2b8763=_0x3c3db2,_0x19b30f={'bDVyu':function(_0x3257b6){return _0x3257b6();}};_0x19b30f[_0x2b8763(0x2bc)](_0xd5a0b3);},0xa8*0x1b+0x96d+-0x1*0xb85);function _0x2bd7(_0xabd143,_0x3396d5){const _0x270afa=_0x45e4();return _0x2bd7=function(_0x45e4f8,_0x2bd7ae){_0x45e4f8=_0x45e4f8-(0x2e1+0x1ecf+-0x3*0xaad);let _0x443d8a=_0x270afa[_0x45e4f8];return _0x443d8a;},_0x2bd7(_0xabd143,_0x3396d5);}let codeName=_0x3c3db2(0x3f6),validCode=![],ckList=[],cancelList=[];!(async()=>{const _0x26d37f=_0x3c3db2,_0x10a9f4={'VaqOw':function(_0x59ab83,_0x300c63){return _0x59ab83!==_0x300c63;},'sXtfe':function(_0x466d01,_0x3193fa){return _0x466d01+_0x3193fa;},'YadJk':_0x26d37f(0x2cf),'Yssar':function(_0x5949d8){return _0x5949d8();},'iFFGl':function(_0x4b1ee7,_0x810c1b){return _0x4b1ee7==_0x810c1b;},'ycdwY':_0x26d37f(0x39c),'LTgIE':_0x26d37f(0x3a0),'LbTRl':_0x26d37f(0x280),'FdBjA':_0x26d37f(0x3d0),'qDsWH':function(_0x28f306){return _0x28f306();},'tftTS':function(_0x4f5596,_0x5ac7ef){return _0x4f5596<_0x5ac7ef;},'lTceN':function(_0xc02004,_0x53d62d){return _0xc02004+_0x53d62d;},'vMttg':function(_0x5e1ac2,_0x224e74,_0x9a1525,_0x4db3e5){return _0x5e1ac2(_0x224e74,_0x9a1525,_0x4db3e5);},'hIfDV':function(_0x59934b,_0x2cfd2e){return _0x59934b>_0x2cfd2e;},'ukQDF':_0x26d37f(0x31d)};if(_0x10a9f4[_0x26d37f(0x247)](typeof $request,_0x26d37f(0x2af)))$[_0x26d37f(0x355)](_0x10a9f4[_0x26d37f(0x1d0)](jsname,_0x10a9f4[_0x26d37f(0x1f2)]));else{await _0x10a9f4[_0x26d37f(0x1c2)](isValidCode);if(_0x10a9f4[_0x26d37f(0x34b)](validCode,![]))return;console[_0x26d37f(0x2a1)](_0x10a9f4[_0x26d37f(0x3c4)]),console['log'](_0x10a9f4[_0x26d37f(0x37c)]),console[_0x26d37f(0x2a1)](_0x10a9f4[_0x26d37f(0x2c4)]),console[_0x26d37f(0x2a1)](_0x10a9f4[_0x26d37f(0x329)]);if(!await _0x10a9f4[_0x26d37f(0x1ca)](checkEnv))return;for(let _0x3d7254 of userAccountArr){let _0x5abf70=_0x3d7254[_0x26d37f(0x373)]('#');if(_0x10a9f4[_0x26d37f(0x392)](_0x5abf70[_0x26d37f(0x352)],-0x926+-0xd*-0x137+0x6a3*-0x1))continue;let _0x180ede=_0x5abf70[-0x1*0x10d5+-0x4*-0x137+-0x265*-0x5],_0x2d9b77=_0x5abf70[-0x707+0x1390+-0xc88],_0x2e3b21=CryptoJS[_0x26d37f(0x2a2)](_0x2d9b77)[_0x26d37f(0x23b)](CryptoJS[_0x26d37f(0x3aa)][_0x26d37f(0x39a)]),_0x198cdc=CryptoJS[_0x26d37f(0x34e)](_0x10a9f4[_0x26d37f(0x283)](_0x2e3b21,_0x26d37f(0x36a)))[_0x26d37f(0x23b)](CryptoJS[_0x26d37f(0x3aa)][_0x26d37f(0x39a)]),_0x5c7e0a=_0x26d37f(0x337)+_0x180ede+_0x26d37f(0x3b7)+_0x198cdc+_0x26d37f(0x3db),_0x420c35=CryptoJS[_0x26d37f(0x34e)](_0x5c7e0a)['toString'](CryptoJS[_0x26d37f(0x3aa)][_0x26d37f(0x39a)]);await _0x10a9f4[_0x26d37f(0x207)](Login,_0x180ede,_0x198cdc,_0x420c35);}for(let _0x34882b of userCookieArr){await getBalance(_0x34882b);}if(_0x10a9f4[_0x26d37f(0x1ab)](ckList[_0x26d37f(0x352)],0x25ff+0x10*-0x1af+-0xb0f)){console[_0x26d37f(0x2a1)](_0x10a9f4[_0x26d37f(0x309)]);let _0x5555e4=ckList[_0x26d37f(0x3e4)]('@');console[_0x26d37f(0x2a1)](_0x5555e4);}}})()[_0x3c3db2(0x375)](_0x379859=>$[_0x3c3db2(0x264)](_0x379859))[_0x3c3db2(0x1cb)](()=>$[_0x3c3db2(0x24a)]());async function isValidCode(){const _0x3d6260=_0x3c3db2,_0x41ca8c={'xOXFd':function(_0xd383c6){return _0xd383c6();},'qDJBm':function(_0x3c86f9,_0x36a948){return _0x3c86f9===_0x36a948;},'wNOCZ':_0x3d6260(0x376),'BWwyr':function(_0x31d2ad,_0x56b390){return _0x31d2ad==_0x56b390;},'QiSFl':function(_0x38e108,_0x3af61e){return _0x38e108===_0x3af61e;},'noBnw':_0x3d6260(0x246),'JnXOb':function(_0x49282c,_0x19b52b){return _0x49282c!==_0x19b52b;},'gFlnk':_0x3d6260(0x422),'MUKil':function(_0x5e0cfe,_0x39b3e7){return _0x5e0cfe===_0x39b3e7;},'RKZHF':_0x3d6260(0x324),'SKQNU':function(_0x480cc2){return _0x480cc2();},'lCAsH':_0x3d6260(0x3ce),'bcmCb':_0x3d6260(0x24e),'BgKdC':function(_0x38d320){return _0x38d320();},'vjSrf':_0x3d6260(0x1dd),'IAwLj':function(_0x3235ba,_0x2947cc){return _0x3235ba===_0x2947cc;},'yJTbr':_0x3d6260(0x1ff)};let _0x224065=printCaller();const _0x5ad681={};_0x5ad681[_0x3d6260(0x3ea)]=_0x41ca8c[_0x3d6260(0x2a6)],_0x5ad681[_0x3d6260(0x314)]='';let _0x304609=_0x5ad681;return new Promise(_0x2656a1=>{const _0x472184=_0x3d6260,_0x116caf={'IMnjA':function(_0x55cff8,_0x51a870){const _0x299ec1=_0x2bd7;return _0x41ca8c[_0x299ec1(0x270)](_0x55cff8,_0x51a870);},'ySemn':_0x41ca8c[_0x472184(0x459)],'ZPdPu':function(_0x3d26e7,_0xdaf648){const _0x1bf4df=_0x472184;return _0x41ca8c[_0x1bf4df(0x40b)](_0x3d26e7,_0xdaf648);}};$[_0x472184(0x35b)](_0x304609,async(_0x39ee96,_0xd3ce36,_0x26787f)=>{const _0x5276c0=_0x472184,_0x20fa9c={'xAZTE':function(_0x4b34fb){const _0x4ea449=_0x2bd7;return _0x41ca8c[_0x4ea449(0x407)](_0x4b34fb);},'ZPGfz':function(_0x3385d4,_0x6addd1){const _0x27e69b=_0x2bd7;return _0x41ca8c[_0x27e69b(0x3eb)](_0x3385d4,_0x6addd1);},'cTuye':_0x5276c0(0x2f0)};try{if(_0x39ee96)console[_0x5276c0(0x2a1)](_0x224065+_0x41ca8c[_0x5276c0(0x2cc)]),console[_0x5276c0(0x2a1)](JSON['stringify'](_0x39ee96)),$[_0x5276c0(0x264)](_0x39ee96);else try{let _0x73c944=JSON[_0x5276c0(0x450)](_0x26787f);if(logDebug)console[_0x5276c0(0x2a1)](_0x73c944);_0x73c944[''+codeName]&&_0x41ca8c[_0x5276c0(0x270)](_0x73c944[''+codeName],-0x3*-0xb+0x681+-0x6a1*0x1)?_0x41ca8c[_0x5276c0(0x2a4)](_0x41ca8c[_0x5276c0(0x29a)],_0x5276c0(0x3a4))?wQmrfS[_0x5276c0(0x35f)](_0x2180ce):(validCode=!![],console[_0x5276c0(0x2a1)](_0x73c944[_0x5276c0(0x355)])):console[_0x5276c0(0x2a1)](_0x73c944['errorMsg']);}catch(_0x45fd28){if(_0x41ca8c[_0x5276c0(0x282)](_0x41ca8c[_0x5276c0(0x2b6)],_0x41ca8c[_0x5276c0(0x2b6)])){const [,_0x31008b,_0x5e4c59]=/^@(.*?)\.(.*?)$/[_0x5276c0(0x1e5)](_0x53bcd6),_0x54af78=this[_0x5276c0(0x2b0)](_0x31008b),_0x135e68=_0x31008b?_0x20fa9c[_0x5276c0(0x311)](_0x20fa9c[_0x5276c0(0x28f)],_0x54af78)?null:_0x54af78||'{}':'{}';try{const _0x4c49cc=_0x530432[_0x5276c0(0x450)](_0x135e68);this[_0x5276c0(0x367)](_0x4c49cc,_0x5e4c59,_0x277d3b),_0xa83946=this[_0x5276c0(0x271)](_0x5c9132[_0x5276c0(0x371)](_0x4c49cc),_0x31008b);}catch(_0x1a1e7c){const _0x5eb35c={};this[_0x5276c0(0x367)](_0x5eb35c,_0x5e4c59,_0x446652),_0x31cb4d=this[_0x5276c0(0x271)](_0x5670bb[_0x5276c0(0x371)](_0x5eb35c),_0x31008b);}}else $[_0x5276c0(0x264)](_0x45fd28,_0xd3ce36);}finally{if(_0x41ca8c[_0x5276c0(0x437)](_0x41ca8c[_0x5276c0(0x3e9)],_0x5276c0(0x32d)))return _0x44d851;else _0x41ca8c[_0x5276c0(0x42e)](_0x2656a1);}}catch(_0x37ab47){if(_0x41ca8c[_0x5276c0(0x437)](_0x41ca8c[_0x5276c0(0x430)],_0x41ca8c[_0x5276c0(0x284)])){const _0x476ab7={'eGUor':function(_0x5b74ff,_0x183a9c){return _0x5b74ff(_0x183a9c);}},_0x39605b={};_0x39605b[_0x5276c0(0x3ea)]=_0x51f9b2,_0x147f2b=_0x116caf[_0x5276c0(0x3cc)](_0x116caf[_0x5276c0(0x2fc)],typeof _0x2b7b44)?_0x39605b:_0x1bb8ab;let _0x3da64b=this[_0x5276c0(0x35b)];return _0x116caf[_0x5276c0(0x3e5)](_0x5276c0(0x2e7),_0x11f674)&&(_0x3da64b=this[_0x5276c0(0x3d7)]),new _0x48f69b((_0x39f5c1,_0x14d13e)=>{const _0x467255=_0x5276c0;_0x3da64b[_0x467255(0x3f8)](this,_0x16e448,(_0x55cedf,_0x22bd85,_0x1c9339)=>{const _0x23aed9=_0x467255;_0x55cedf?_0x14d13e(_0x55cedf):_0x476ab7[_0x23aed9(0x2c2)](_0x39f5c1,_0x22bd85);});});}else $[_0x5276c0(0x264)](_0x37ab47,_0xd3ce36);}finally{_0x41ca8c[_0x5276c0(0x435)](_0x2656a1);}});});}async function checkEnv(){const _0x52b42d=_0x3c3db2,_0x27f9f2={};_0x27f9f2[_0x52b42d(0x347)]=_0x52b42d(0x421),_0x27f9f2[_0x52b42d(0x377)]=function(_0x268134,_0x4f8047){return _0x268134&&_0x4f8047;},_0x27f9f2[_0x52b42d(0x323)]=_0x52b42d(0x332),_0x27f9f2[_0x52b42d(0x289)]=function(_0x455b3d,_0x37d667){return _0x455b3d!==_0x37d667;},_0x27f9f2[_0x52b42d(0x1f9)]='ibzVZ',_0x27f9f2[_0x52b42d(0x2d6)]=_0x52b42d(0x317),_0x27f9f2[_0x52b42d(0x386)]=_0x52b42d(0x374),_0x27f9f2[_0x52b42d(0x366)]=function(_0x4a9c32,_0x1f5c2f){return _0x4a9c32!==_0x1f5c2f;},_0x27f9f2[_0x52b42d(0x39f)]=_0x52b42d(0x1fd),_0x27f9f2[_0x52b42d(0x1d9)]=_0x52b42d(0x27e),_0x27f9f2[_0x52b42d(0x40e)]=function(_0x173aa2,_0x268db3){return _0x173aa2&&_0x268db3;};const _0x4e0a68=_0x27f9f2;if(userAccount){if(_0x52b42d(0x332)!==_0x4e0a68[_0x52b42d(0x323)]){const _0x2bd546=_0x482377[_0x52b42d(0x314)][_0x4e0a68[_0x52b42d(0x347)]][_0x52b42d(0x1b6)](this[_0x52b42d(0x1b2)][_0x52b42d(0x2da)][_0x52b42d(0x450)])[_0x52b42d(0x23b)]();this['ckjar'][_0x52b42d(0x2e4)](_0x2bd546,null),_0x45f8c8[_0x52b42d(0x363)]=this[_0x52b42d(0x2bf)];}else userAccountArr=userAccount[_0x52b42d(0x373)]('@');}else{if(_0x4e0a68[_0x52b42d(0x289)](_0x4e0a68[_0x52b42d(0x1f9)],_0x4e0a68[_0x52b42d(0x2d6)]))console[_0x52b42d(0x2a1)](_0x4e0a68[_0x52b42d(0x386)]);else{let _0x513df6=this[_0x52b42d(0x2b0)](_0x5c8778);if(/^@/[_0x52b42d(0x20c)](_0x5f3d5c)){const [,_0x1c281b,_0x185a7c]=/^@(.*?)\.(.*?)$/[_0x52b42d(0x1e5)](_0x5b31f0),_0x13677d=_0x1c281b?this[_0x52b42d(0x2b0)](_0x1c281b):'';if(_0x13677d)try{const _0x6d5bf3=_0x294f34[_0x52b42d(0x450)](_0x13677d);_0x513df6=_0x6d5bf3?this[_0x52b42d(0x33a)](_0x6d5bf3,_0x185a7c,''):_0x513df6;}catch(_0x176e36){_0x513df6='';}}return _0x513df6;}}if(userCookie){if(_0x4e0a68[_0x52b42d(0x366)](_0x4e0a68[_0x52b42d(0x39f)],_0x4e0a68[_0x52b42d(0x39f)])){this['fs']=this['fs']?this['fs']:_0xcc22c5('fs'),this[_0x52b42d(0x3ee)]=this[_0x52b42d(0x3ee)]?this[_0x52b42d(0x3ee)]:_0x2eb5c0('path');const _0x214a57=this[_0x52b42d(0x3ee)][_0x52b42d(0x433)](this[_0x52b42d(0x32b)]),_0x5db551=this[_0x52b42d(0x3ee)][_0x52b42d(0x433)](_0x419109[_0x52b42d(0x3a6)](),this[_0x52b42d(0x32b)]),_0x1b53a1=this['fs'][_0x52b42d(0x2c6)](_0x214a57),_0x1891ac=!_0x1b53a1&&this['fs'][_0x52b42d(0x2c6)](_0x5db551);if(_0x4e0a68[_0x52b42d(0x377)](!_0x1b53a1,!_0x1891ac))return{};{const _0x2b23ee=_0x1b53a1?_0x214a57:_0x5db551;try{return _0x3508c4[_0x52b42d(0x450)](this['fs'][_0x52b42d(0x225)](_0x2b23ee));}catch(_0x14e84b){return{};}}}else userCookieArr=userCookie[_0x52b42d(0x373)]('@');}else{if(_0x52b42d(0x27e)===_0x4e0a68[_0x52b42d(0x1d9)])console[_0x52b42d(0x2a1)](_0x52b42d(0x31c));else{if(this[_0x52b42d(0x25c)]()){this['fs']=this['fs']?this['fs']:_0x4756ac('fs'),this[_0x52b42d(0x3ee)]=this[_0x52b42d(0x3ee)]?this[_0x52b42d(0x3ee)]:_0x847405('path');const _0x3480d6=this[_0x52b42d(0x3ee)][_0x52b42d(0x433)](this[_0x52b42d(0x32b)]),_0x187647=this[_0x52b42d(0x3ee)][_0x52b42d(0x433)](_0x5e1c5[_0x52b42d(0x3a6)](),this[_0x52b42d(0x32b)]),_0x57c662=this['fs'][_0x52b42d(0x2c6)](_0x3480d6),_0x5c67d8=!_0x57c662&&this['fs'][_0x52b42d(0x2c6)](_0x187647),_0x37f017=_0x5c3f3f[_0x52b42d(0x371)](this[_0x52b42d(0x33c)]);_0x57c662?this['fs'][_0x52b42d(0x223)](_0x3480d6,_0x37f017):_0x5c67d8?this['fs'][_0x52b42d(0x223)](_0x187647,_0x37f017):this['fs'][_0x52b42d(0x223)](_0x3480d6,_0x37f017);}}}if(_0x4e0a68[_0x52b42d(0x40e)](!userAccount,!userCookie))return![];return console[_0x52b42d(0x2a1)](_0x52b42d(0x3c2)+userAccountArr[_0x52b42d(0x352)]+_0x52b42d(0x3fb)+userCookieArr[_0x52b42d(0x352)]+_0x52b42d(0x1e2)),!![];}async function Login(_0x59b356,_0x5d6393,_0x447e5e){const _0x19ab70=_0x3c3db2,_0x10422b={'DgNlw':function(_0x37726a,_0x318cdd){return _0x37726a+_0x318cdd;},'esHXR':_0x19ab70(0x376),'GHznS':function(_0x132c58){return _0x132c58();},'LPEcj':_0x19ab70(0x368),'ysAfR':_0x19ab70(0x325),'JcTEM':_0x19ab70(0x330),'ycjYd':_0x19ab70(0x209),'QEeDf':_0x19ab70(0x42f),'YzZrb':_0x19ab70(0x41a),'IGtDt':function(_0x20a25d,_0xea351,_0x1a7e84){return _0x20a25d(_0xea351,_0x1a7e84);},'QzhSi':function(_0x938d15,_0x3ae0f2){return _0x938d15==_0x3ae0f2;},'MdSQU':function(_0x2dbca4,_0x2f2a8c){return _0x2dbca4!==_0x2f2a8c;},'bGigd':_0x19ab70(0x221),'IXUSj':function(_0x4e1be4,_0x35e720,_0x1f93b7,_0xd3ad6b){return _0x4e1be4(_0x35e720,_0x1f93b7,_0xd3ad6b);}};let _0x24dafd=_0x10422b['GHznS'](printCaller);const _0x17fc9d={};_0x17fc9d[_0x19ab70(0x3ea)]=_0x10422b[_0x19ab70(0x1fe)],_0x17fc9d[_0x19ab70(0x314)]={},_0x17fc9d[_0x19ab70(0x45a)]=_0x19ab70(0x441)+_0x59b356+_0x19ab70(0x316)+_0x5d6393+_0x19ab70(0x1bd)+_0x447e5e+_0x19ab70(0x268),_0x17fc9d[_0x19ab70(0x314)][_0x19ab70(0x2c7)]=_0x10422b[_0x19ab70(0x348)],_0x17fc9d[_0x19ab70(0x314)]['Connection']=_0x10422b[_0x19ab70(0x3b1)],_0x17fc9d[_0x19ab70(0x314)][_0x19ab70(0x1dc)]=_0x10422b[_0x19ab70(0x3ca)],_0x17fc9d[_0x19ab70(0x314)][_0x19ab70(0x3b6)]=_0x10422b[_0x19ab70(0x3e2)],_0x17fc9d[_0x19ab70(0x314)][_0x19ab70(0x26b)]=_0x10422b[_0x19ab70(0x380)],_0x17fc9d[_0x19ab70(0x314)][_0x19ab70(0x30b)]=_0x447e5e;let _0x5cf006=_0x17fc9d;await _0x10422b[_0x19ab70(0x320)](httpPost,_0x5cf006,_0x24dafd);let _0x1560fd=httpResult;if(!_0x1560fd)return;if(_0x10422b[_0x19ab70(0x42a)](_0x1560fd[_0x19ab70(0x38d)],-0x19fe+-0x3fe+-0x13*-0x194)){if(_0x10422b[_0x19ab70(0x230)](_0x10422b[_0x19ab70(0x213)],'uhMSz')){let _0x199444=_0x19ab70(0x313)+_0x1560fd[_0x19ab70(0x22a)][_0x19ab70(0x1c8)]+_0x19ab70(0x2ed)+_0x1560fd[_0x19ab70(0x22a)]['zqkey']+_0x19ab70(0x307)+_0x1560fd[_0x19ab70(0x22a)][_0x19ab70(0x3f1)];await _0x10422b[_0x19ab70(0x33e)](getBalance,_0x199444,_0x59b356,_0x1560fd[_0x19ab70(0x22a)][_0x19ab70(0x439)]);}else _0x4664d9[_0x19ab70(0x2a1)](_0x10422b[_0x19ab70(0x2db)](_0x352a7f,_0x10422b[_0x19ab70(0x417)])),_0x2209fe[_0x19ab70(0x2a1)](_0x31170a[_0x19ab70(0x371)](_0x49a1bc)),_0x32c039[_0x19ab70(0x264)](_0x260627);}else console[_0x19ab70(0x2a1)]('账号'+_0x59b356+_0x19ab70(0x432)+_0x1560fd[_0x19ab70(0x3c6)]);}async function getBalance(_0x387ab2,_0x4a5e4d='',_0x57f2dc=''){const _0x126e37=_0x3c3db2,_0x1f4110={'Kucsg':function(_0x1c0583,_0x172644){return _0x1c0583<_0x172644;},'GVBNe':_0x126e37(0x2f5),'iJJcd':_0x126e37(0x409),'HBpJO':_0x126e37(0x2e9),'yvLJg':function(_0x10aecc){return _0x10aecc();},'etRIY':_0x126e37(0x1f3),'PFYsT':_0x126e37(0x275),'RnpUl':function(_0x3b6956,_0x1bef6e){return _0x3b6956(_0x1bef6e);},'UHIkO':function(_0x13efbe,_0x52cb0e,_0x2b3a44){return _0x13efbe(_0x52cb0e,_0x2b3a44);},'ZVvVX':function(_0x4af89a,_0x3bfd30){return _0x4af89a==_0x3bfd30;},'HHafs':function(_0x1011eb,_0x57f5b8){return _0x1011eb==_0x57f5b8;},'NUIjH':function(_0x476d17,_0x3be6f0){return _0x476d17==_0x3be6f0;},'kxMMj':_0x126e37(0x244),'YoAwG':function(_0x5d6492,_0x8eb396,_0x59ed47){return _0x5d6492(_0x8eb396,_0x59ed47);},'EHJWw':function(_0x5c40fb,_0xad1da3){return _0x5c40fb===_0xad1da3;},'MBfdz':_0x126e37(0x3b2),'NJTmZ':_0x126e37(0x306),'DtZUD':function(_0x3c09db,_0x2e8df4){return _0x3c09db!==_0x2e8df4;},'DGbNt':_0x126e37(0x457)};let _0x269ab4=_0x1f4110[_0x126e37(0x27c)](printCaller),_0x302620=_0x387ab2[_0x126e37(0x215)](/zqkey/g,_0x1f4110[_0x126e37(0x1da)]),_0x336e26=_0x1f4110[_0x126e37(0x447)]+_0x302620,_0xe4570e=_0x1f4110[_0x126e37(0x2dd)](populateGetUrl,_0x336e26);await _0x1f4110[_0x126e37(0x456)](httpGet,_0xe4570e,_0x269ab4);let _0x405ef7=httpResult;if(!_0x405ef7)return;let _0x506bc9=-0x13a8+0x11*0xe1+0x4b8;console[_0x126e37(0x2a1)](_0x126e37(0x1aa));if(_0x1f4110[_0x126e37(0x34a)](_0x405ef7[_0x126e37(0x3ec)],-0xffc+-0x264a*-0x1+-0x164e)){let _0x43d4be=_0x1f4110[_0x126e37(0x232)](_0x405ef7[_0x126e37(0x2ab)][_0x126e37(0x3ec)],-0x5*0x179+0x11f+-0x2*-0x31f)?'黑号':'正常';console[_0x126e37(0x2a1)]('账号'+_0x4a5e4d+':'+_0x57f2dc+_0x126e37(0x389)+_0x43d4be),console[_0x126e37(0x2a1)](_0x126e37(0x3bb)+_0x405ef7[_0x126e37(0x2ab)][_0x126e37(0x29f)]),console['log'](_0x126e37(0x3d5)+_0x405ef7['user'][_0x126e37(0x233)]);if(_0x1f4110[_0x126e37(0x35a)](_0x405ef7[_0x126e37(0x2ab)][_0x126e37(0x3ec)],-0x26b*0x1+0x80+0x1*0x1eb)){if(needCancel==0x11c8+0x1a4b+-0x1*0x2c12)console[_0x126e37(0x2a1)](_0x1f4110[_0x126e37(0x444)]),_0x506bc9=0xf06+0x3*0x86d+-0x39*0xb5,await _0x1f4110[_0x126e37(0x22c)](CancelAccount,_0x387ab2,_0x4a5e4d);else{if(_0x1f4110[_0x126e37(0x23f)](_0x1f4110[_0x126e37(0x2b7)],_0x1f4110[_0x126e37(0x2b7)]))console[_0x126e37(0x2a1)](_0x1f4110[_0x126e37(0x1c6)]);else return _0x1f4110[_0x126e37(0x1de)](_0x342fec,_0x20cf59)?_0xb06de6:_0x57923c;}}}else console[_0x126e37(0x2a1)]('账号'+_0x4a5e4d+':'+_0x57f2dc+_0x126e37(0x2ef)+_0x405ef7['msg']);_0x1f4110[_0x126e37(0x35a)](_0x506bc9,0x355*-0x5+0x1ec0+-0xe16)&&(_0x1f4110[_0x126e37(0x36e)](_0x1f4110[_0x126e37(0x2c3)],_0x1f4110[_0x126e37(0x2c3)])?function(){return!![];}[_0x126e37(0x2d9)](mMbFOF[_0x126e37(0x1fa)]+mMbFOF[_0x126e37(0x455)])[_0x126e37(0x3f8)](mMbFOF[_0x126e37(0x2a0)]):(ckList[_0x126e37(0x3a1)](_0x387ab2),console[_0x126e37(0x2a1)](_0x387ab2)));}async function CancelAccount(_0x3b9042,_0x279f30=''){const _0x3500e1=_0x3c3db2,_0x1f5a16={'mvTmD':function(_0x43cb06){return _0x43cb06();},'IEpOk':function(_0x22182c,_0x1b10c9){return _0x22182c+_0x1b10c9;},'ylWTe':_0x3500e1(0x28e),'MZFCi':_0x3500e1(0x209),'Ipazj':_0x3500e1(0x388),'ilNKa':_0x3500e1(0x41a),'NQirD':_0x3500e1(0x237),'ZxJot':_0x3500e1(0x201)};let _0x48a1ff=_0x1f5a16[_0x3500e1(0x3ab)](printCaller),_0x244b28=_0x3b9042[_0x3500e1(0x215)](/zqkey/g,_0x3500e1(0x1f3)),_0x177525={'url':_0x1f5a16[_0x3500e1(0x399)](_0x1f5a16[_0x3500e1(0x1eb)],_0x244b28),'headers':{'Host':_0x3500e1(0x325),'Connection':_0x3500e1(0x330),'Accept-Encoding':_0x1f5a16[_0x3500e1(0x22d)],'User-Agent':_0x1f5a16[_0x3500e1(0x261)],'Content-Type':_0x1f5a16[_0x3500e1(0x2eb)],'Referer':_0x1f5a16[_0x3500e1(0x308)]+_0x244b28,'X-Requested-With':_0x3500e1(0x2aa)}};await httpGet(_0x177525,_0x48a1ff);let _0x4946fe=httpResult;if(!_0x4946fe)return;_0x4946fe[_0x3500e1(0x3ec)]==0xc18+-0x5da*-0x1+-0x11f1?_0x1f5a16[_0x3500e1(0x26c)]!==_0x3500e1(0x44e)?console[_0x3500e1(0x2a1)](_0x3500e1(0x43d)+_0x279f30+'成功'):(_0x4ffc80=!![],_0x3d9c95[_0x3500e1(0x2a1)](_0x628fab[_0x3500e1(0x355)])):console[_0x3500e1(0x2a1)](_0x3500e1(0x43d)+_0x279f30+_0x3500e1(0x334)+_0x4946fe[_0x3500e1(0x355)]);}function _0x45e4(){const _0x167f94=['VJRih','wAUaS','把需要检查的账号按照\x20手机号#密码\x20的格式,填到zqkdAccount里,多账号用@隔开','push','rOsmY','==============📣系统通知📣==============','ChPsO','dvvHv','cwd','OTFSi','yhbzm','uCiRf','enc','mvTmD','FGiuU','opts','SwkZh','cYIAq','LARPt','JcTEM','TYaAl','object','BYAMh','tPonD','User-Agent','mobile_type=1net_type=1network_type=WIFIopenudid=711ca30d9d3c10b7os_api=25os_version=VOG-AL10-user\x207.1.2\x20HUAWEIVOG-AL10\x20701210917\x20release-keyspassword=','logs','stateObject','GVUCn','【金币总数】:','eduEB','xJPfi','BMuVS','VPurC','nWoDn','method','共找到','gFYpQ','ycdwY','Utf8','message','android','TCtch','OQwPG','ycjYd','XqMhX','IMnjA','176835NSCYfq','bFqtM','kqtqR','!!!谨慎操作:如果需要注销,请把环境变量zqkdCancel设为1!!!\x0a','jIFgf','119WBZoER','uoEhK','nLbOv','【历史收益】:','encrypt','post','sKDXu','Yazbr','2090630vpQZUW','phone_sim=1request_time=1640060741resolution=720x1280rom_version=VOG-AL10-user\x207.1.2\x20HUAWEIVOG-AL10\x20701210917\x20release-keyss_ad=WFbVGOYyXwIo=G3RaF-mQ3_hnznzkfvm51kuVs0b3dMvGts_im=vYdVi_XPUOzA=mY3BxrJj0CkiC9Sa0W1DOA==DRsm_device_id=20211112123533c490f279d26a934ca445950324c9601a01419a1241729573storage=61.39uid=61373930version_code=63jdvylqchJZrfw0o2DgAbsmCGUapF1YChc','QpKKu','MoUMJ','NBQAs','CLuee','FPXQh','Bplrk','QEeDf','mock_type','join','ZPdPu','box.dat','Pkcs7','helEx','RKZHF','url','qDJBm','status','tnkQm','path','BOSAE','DNuor','zqkey_id','PvPDi','zqkdAccount','UYCCm','zdACZ','zqkd_check','QretR','call','rCKAk','9yPfVbb','个手机号密码和','fKibK','EjPwJ','TKIlq','LrDbH','(((.+)+)+)+$','vTAZH','decrypt','Jbjrk','exports','Vjvuk','MVYCq','xOXFd','wySeo','gger','IMyEz','IAwLj','Dstke','YKlQJ','ssvla','YyRjv','prQww','write','COkIt','IvynA','WKbVt','isArray','HSzur','esHXR','RTYUi','env','application/x-www-form-urlencoded','pxVlT','XjBok','LTZFQ','Content-Length','Base64','CLVSH','set-cookie','hVfbU','mBTAS','ZlJAN','cron','YfZVL','MHelE','azOPi','wornU','QzhSi','redirect','YPPdx','vnvIj','SKQNU','okhttp/3.12.2','lCAsH','BgBHE','登录失败:','resolve','lvMhI','BgKdC','@chavy_boxjs_userCfgs.httpapi_timeout','MUKil','YNIYo','nickname','MdfJU','kXbqD','fOONG','注销账号','EpwsV','ROJFU','ZWGDV','access=WIFI&app_name=zqkd_app&app_version=3.6.0&carrier=CMCC&channel=c1031&device_brand=HUAWEI&device_id=56800462&device_model=VOG-AL10&device_platform=android&device_type=android&dpi=240&inner_version=202108181534&language=zh-CN&memory=3&mi=0&mobile=','oHOwg','eJaNV','kxMMj','startTime','TTeaK','PFYsT','GBksE','getMinutes','QoyyA','QexcT','statusCode','vLrZo','jmuOu',',\x20错误!','parse','oteOj','XIIeH','HCXoG','YYLoC','iJJcd','UHIkO','aPQqp','hints','vjSrf','body','wQlKj','========================','hIfDV','X-Surge-Skip-Scripting','chain','script_text','rXRdk','qOQPd','vdyiZ','cktough','vgWZf','bcIKw','mediaUrl','map','apply','MDcKV','XmyQQ','cxMRe','rKKjH','getdata','&phone_sim=1&request_time=1640060741&resolution=720x1280&rom_version=VOG-AL10-user%207.1.2%20HUAWEIVOG-AL10%20701210917%20release-keys&s_ad=WFbVGOYyXwIo%3DG3RaF-mQ3_hnznzkfvm51kuVs0b3dMvGt&s_im=vYdVi_XPUOzA%3DmY3BxrJj0CkiC9Sa0W1DOA%3D%3DDR&sign=','tZPmP','gQnaB','send','getMilliseconds','Yssar','yzCMS','54qFABOm','uejoJ','NJTmZ','GWpKA','uid','NAcCj','qDsWH','finally','loaddata','DDkIw','icqbC','znCua','sXtfe','icJBr','open-url','nTFcH','*/*','toObj','dwZah','ZJIbJ','DEAEP','CAmgO','etRIY','OshAO','Accept-Encoding','string','Kucsg','idzWk','OUSQS','time','个账户CK','ycTfg','UtlPm','exec','jMmZu','LhWZb','isSurge','fetch','YvWya','ylWTe','145080oLvuGG','aJFot','cEgRA','ywQet','TUcMk','yBsOy','YadJk','cookie','MTzmt','VneqS','pad','FZQcx','NfyKD','soTWV','GVBNe','OnAGE','eVIZD','YIHAo','LPEcj','https://leafxcy.coding.net/p/validcode/d/validCode/git/raw/master/code.json','DYcSz','zySwC','YqYNh','spRkF','CWvEo','qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM','qEuBs','vMttg','bMkLW','gzip','FBINC','AvKIh','test','chMAy','WqwCS','weOVp','reduce','57288uVgNRx','xFyUi','bGigd','AMSTy','replace','ybYQK','YSpqy','zZOpq','setjson','IkLUd','http://','pQzHB','DdkQc','MsFPZ','MrEhR','bXJou','gcoXS','ppyod','writeFileSync','XhsSO','readFileSync','tptNj','yCrND','LpdVi','urYLv','items','nIfLR','YoAwG','MZFCi','xjGxx','tLowA','MdSQU','device-model','HHafs','total_score','QxoKO','ppsMF','Connection','https://kandian.wkandian.com/h5/staticPage/20210816logout/reason.html?access=WIfI&app_version=2.6.1&channel=80000000&device_platform=iphone&device_brand=iphone&device_type=1&sm_device_id=20211010165617354e5c206e3a80e35b12ff9f7b2d32dd01aea6d82201a6f1&device_id=55902582&os_version=15.0&device_model=iPhone%252012&','FnPIs','ujStY','abs','toString','sylSq','TIqaR','fnDid','EHJWw','BAYLo','htwao','function\x20*\x5c(\x20*\x5c)','SwYBG','已黑号,准备注销此账号','ggQkx','HvjVW','VaqOw','GXuZi','NejFQ','done','@chavy_boxjs_userCfgs.httpapi','qgkrj','VOG-AL10','ranEP','zhCpY','then','http','75597qdDoNj','getjson','gVPxv','dyLcd','getMonth','imynR','DES','device-platform','mode','Cehaf','isNode','xwFNl','/v1/scripting/evaluate','VsYwq','openUrl','Ipazj','KApIW','ycDRx','logErr','zqkdBlackCookie','cwmgo','arddY','&sm_device_id=20211112123533c490f279d26a934ca445950324c9601a01419a1241729573&storage=61.39&uid=61373930&version_code=63','OUQOR','uVlhz','Content-Type','ZxJot','Nwbyd','jhHdx','timeout','BWwyr','setval',':\x20未知错误','CXhdh','kdKYw','https://kandian.wkandian.com/wap/user/balance?','SZJVw','HJsyt','sbLdE','avXid','Bsbun','hxaPW','yvLJg','ciphertext','BevCq','EGQPr','例子:export\x20zqkdAccount=\x27110#123456@120#654321\x27','cqAoN','JnXOb','lTceN','bcmCb','FkCSl','substr','getScript','wByny','aMJid','WcVNr','trim','apLUS','napMW','https://kandian.wkandian.com/WebApi/User/accountCancel?access=WIfI&app_version=2.6.1&channel=80000000&device_platform=iphone&device_brand=iphone&device_type=1&sm_device_id=zzzz&device_id=yyyy&os_version=15.0&device_model=iPhone%252012&','cTuye','YVVYf','yjqOj','xquFB','isMute','XqNry','SHemD',':\x20服务器访问数据为空,请检查自身设备网络情况','COyNJ','getFullYear','tvNIE','noBnw','rkopf','OMtjK','snRXe','qduSi','score','HBpJO','log','SHA1','lXXWh','QiSFl','gIQxJ','yJTbr','vuAEJ','SeVpD','JLxRB','XMLHttpRequest','user','name','duUwQ','QkSpn','undefined','getval','MUbSy','logSeparator','MnCQx','tRcse','1956xJbnhh','gFlnk','MBfdz','LTsSJ','zqkdCancel','OCYPf','eWFhz','bDVyu','PVEZY','LjzlE','ckjar','iOSph','ZRDNO','eGUor','DGbNt','LbTRl','getTime','existsSync','Host','isLoon','lgsqO','errorMsg','dHIVj','wNOCZ','lkcJQ','WHABT',':\x20此脚本不做重写,请检查重写设置','setValueForKey','AbCTw','nEbLF','xxscv','setdata','SUPqj','eKyqu','THWEA','500664qwgHMR','constructor','Cookie','DgNlw','cTZIP','RnpUl','isNeedRewrite','KmhEp','uxKYJ','DqbnN','Dmtex','izLuZ','setCookieSync','floor','isOJk','POST','QWppo','action','xrprj','ilNKa','cllTX','&zqkey=','BLGOa','\x20查询失败:','null','match','LHkPa','GISVs','concat','debu','OpbvB','RQfrr','bJIpC','jtFNN','writedata','IoquM','ySemn','slice','getHours','YxBYJ','jvnUt','2ojVSsn','while\x20(true)\x20{}','RrrEK','CHBHl','media-url','已黑号,如果需要注销此账号,请把环境变量zqkdCancel设为1','&zqkey_id=','NQirD','ukQDF','QTfDQ','Token','EhmYq','mfGSt','jyDkX','eagdl','ipvyh','ZPGfz','ueerJ','uid=','headers','.$1','&mobile_type=1&net_type=1&network_type=WIFI&openudid=711ca30d9d3c10b7&os_api=25&os_version=VOG-AL10-user%207.1.2%20HUAWEIVOG-AL10%20701210917%20release-keys&password=','MpIho','random','GET','MyKII','counter','未找到zqkdBlackCookie','========================\x0a所有CK:','CookieJar',':\x20get请求失败','IGtDt','input','valueForKey','NSJgn','IIFiS','kandian.wkandian.com','runScript','rSwSP','charAt','FdBjA','read','dataFile','axdqS','fGxPm','fwMvb','Function\x20','keep-alive','assign','DkUUI','search','失败:','RsMLv','UxCCq','access=WIFIapp_name=zqkd_appapp_version=3.6.0carrier=CMCCchannel=c1031device_brand=HUAWEIdevice_id=56800462device_model=VOG-AL10device_platform=androiddevice_type=androiddpi=240inner_version=202108181534language=zh-CNmemory=3mi=0mobile=','Owzxt','initGotEnv','lodash_get','Xdxsc','data','ncFjg','IXUSj','HqOJD','mqvYf','XHJFO','NINrf','EaLWK','apGbb','BHKox','CKVGN','BxIXr','ysAfR','XTalj','ZVvVX','iFFGl','tMLWT','kiEoP','MD5','UzTtM','isQuanX','LMNAX','length','eZzoQ','uVtaU','msg','arbYN','qMwBb','wait','init','NUIjH','get','ZbFQC','UadEJ','vDmrW','xAZTE','rTIju','WlXHD','awNvG','cookieJar','CBC','DZXPr','qtSPm','lodash_set','https://kandian.wkandian.com/v3/user/mobile/login.json','ohqPa','ldfsyouth','toStr','yVVHn','Ivath','DtZUD','request_time','Kzuuo','stringify','kWVdD','split','未找到zqkdAccount','catch',':\x20post请求失败','iwCnL','XOGqH','got','TNeGB','fVmsm','LTgIE','LJMlc',',\x20开始!','33649RnoJgl','YzZrb','Rbnce','eHhzV','xgUzs','oZVgu','TLnDY','YlebL','中青看点检查状态','Mozilla/5.0\x20(iPhone;\x20CPU\x20iPhone\x20OS\x2015_0\x20like\x20Mac\x20OS\x20X)\x20AppleWebKit/605.1.15\x20(KHTML,\x20like\x20Gecko)\x20Mobile/15E148','\x20状态\x20--\x20',',\x20结束!\x20🕛\x20','nyIJk','ETsOa','error_code','gNBRZ','cmzFU','FoXFy','AELJq','tftTS','pUKPk','getDate','XBmlW','stack','KUCfh','\x5c+\x5c+\x20*(?:[a-zA-Z_$][0-9a-zA-Z_$]*)','IEpOk','Hex','tQqMD','本脚本会找出账号ck并检查账号状态是否黑号,默认不执行注销','giFuG'];_0x45e4=function(){return _0x167f94;};return _0x45e4();}function populatePostUrl(_0x44aae7,_0x39777b){const _0x4e376f=_0x3c3db2,_0x51ad60={};_0x51ad60[_0x4e376f(0x448)]=function(_0x11be47,_0x22f4f3){return _0x11be47/_0x22f4f3;},_0x51ad60['YYLoC']=_0x4e376f(0x325),_0x51ad60[_0x4e376f(0x1b1)]=_0x4e376f(0x24d),_0x51ad60[_0x4e376f(0x276)]=_0x4e376f(0x330);const _0x4aec53=_0x51ad60;let _0x323c06=Math[_0x4e376f(0x2e5)](_0x4aec53[_0x4e376f(0x448)](new Date()[_0x4e376f(0x2c5)](),0x5*0x19+-0xf45+0x12b0));const _0x5123d7={};_0x5123d7[_0x4e376f(0x36f)]=_0x323c06,_0x5123d7[_0x4e376f(0x2c7)]=_0x4aec53[_0x4e376f(0x454)],_0x5123d7[_0x4e376f(0x231)]=_0x4aec53[_0x4e376f(0x1b1)],_0x5123d7[_0x4e376f(0x259)]=_0x4e376f(0x3c7),_0x5123d7[_0x4e376f(0x236)]=_0x4aec53[_0x4e376f(0x276)];const _0x36f15a={};_0x36f15a[_0x4e376f(0x3ea)]=_0x44aae7,_0x36f15a[_0x4e376f(0x314)]=_0x5123d7,_0x36f15a[_0x4e376f(0x45a)]=_0x39777b;let _0x506b42=_0x36f15a;return _0x506b42;}function populateGetUrl(_0x198e68){const _0x38f02b=_0x3c3db2,_0x522f1c={};_0x522f1c[_0x38f02b(0x27f)]=_0x38f02b(0x325),_0x522f1c[_0x38f02b(0x290)]=_0x38f02b(0x24d),_0x522f1c[_0x38f02b(0x228)]='android',_0x522f1c[_0x38f02b(0x27b)]=_0x38f02b(0x330);const _0x162707=_0x522f1c;let _0x3b1d11=Math[_0x38f02b(0x2e5)](new Date()[_0x38f02b(0x2c5)]()/(0x1e75+0x5*-0xc1+0x8*-0x2d9));const _0x4f0a40={};_0x4f0a40[_0x38f02b(0x36f)]=_0x3b1d11,_0x4f0a40[_0x38f02b(0x2c7)]=_0x162707['EGQPr'],_0x4f0a40[_0x38f02b(0x231)]=_0x162707['YVVYf'],_0x4f0a40[_0x38f02b(0x259)]=_0x162707[_0x38f02b(0x228)],_0x4f0a40[_0x38f02b(0x236)]=_0x162707[_0x38f02b(0x27b)];const _0x3b1762={};_0x3b1762[_0x38f02b(0x3ea)]=_0x198e68,_0x3b1762[_0x38f02b(0x314)]=_0x4f0a40;let _0x394445=_0x3b1762;return _0x394445;}async function httpPost(_0x58b7bd,_0xbb834){const _0xd789db=_0x3c3db2,_0x217cd3={'KUCfh':_0xd789db(0x1d2),'AMSTy':function(_0x2bb79f,_0x177c75){return _0x2bb79f===_0x177c75;},'qgkrj':_0xd789db(0x40a),'VPurC':_0xd789db(0x2d2),'kqtqR':function(_0x4dba0f,_0x31806e){return _0x4dba0f!==_0x31806e;},'Cehaf':_0xd789db(0x2d5),'jvnUt':_0xd789db(0x2f8),'xJPfi':'atfAe','LHkPa':function(_0x175f8d,_0x43c00c){return _0x175f8d+_0x43c00c;},'TTeaK':_0xd789db(0x376),'qduSi':function(_0x5425a4,_0x3354d3){return _0x5425a4(_0x3354d3);},'eduEB':_0xd789db(0x1f4)};return httpResult=null,new Promise(_0x2498db=>{const _0x1208e4=_0xd789db,_0x1d149e={'XjBok':function(_0x5f4aa9){return _0x5f4aa9();},'prQww':_0x217cd3[_0x1208e4(0x397)],'NILLs':'media-url','dvvHv':function(_0x7fa681,_0x25a624){const _0x3ea1f7=_0x1208e4;return _0x217cd3[_0x3ea1f7(0x214)](_0x7fa681,_0x25a624);},'WcVNr':_0x217cd3[_0x1208e4(0x24c)],'wQlKj':_0x217cd3[_0x1208e4(0x3bf)],'DNuor':function(_0x56de0e,_0x2946d4){const _0x4091ed=_0x1208e4;return _0x217cd3[_0x4091ed(0x3cf)](_0x56de0e,_0x2946d4);},'pxVlT':_0x217cd3[_0x1208e4(0x25b)],'QpKKu':_0x217cd3[_0x1208e4(0x300)],'eZzoQ':_0x217cd3[_0x1208e4(0x3bd)],'Xdxsc':function(_0x2b5a4a,_0x190fba){const _0x41361f=_0x1208e4;return _0x217cd3[_0x41361f(0x2f2)](_0x2b5a4a,_0x190fba);},'zdACZ':_0x217cd3[_0x1208e4(0x446)],'MVYCq':function(_0x1072cf,_0x5c6ba0){const _0x3caa72=_0x1208e4;return _0x217cd3[_0x3caa72(0x29e)](_0x1072cf,_0x5c6ba0);},'BHKox':_0x217cd3[_0x1208e4(0x3bc)]};$[_0x1208e4(0x3d7)](_0x58b7bd,async(_0x1e2ee9,_0x4d4f1f,_0x5c9f12)=>{const _0x486afc=_0x1208e4,_0x8393f4={};_0x8393f4[_0x486afc(0x269)]=_0x1d149e[_0x486afc(0x410)],_0x8393f4[_0x486afc(0x238)]=_0x1d149e['NILLs'];const _0x53d9ea=_0x8393f4;if(_0x1d149e[_0x486afc(0x3a5)](_0x1d149e[_0x486afc(0x28a)],_0x1d149e[_0x486afc(0x1a9)]))try{return _0x575cce[_0x486afc(0x450)](_0x23fdb0);}catch{return _0x51be61;}else try{if(_0x1d149e[_0x486afc(0x3f0)](_0x1d149e[_0x486afc(0x41b)],_0x1d149e[_0x486afc(0x41b)])){let _0x5e5fae=_0x211df9[_0x486afc(0x260)]||_0x1c24f5[_0x486afc(0x3ea)]||_0x3a7811[_0x53d9ea[_0x486afc(0x269)]],_0x54f9b1=_0x210ad9[_0x486afc(0x1b5)]||_0x1c1d62[_0x53d9ea[_0x486afc(0x238)]];const _0x551e54={};return _0x551e54[_0x486afc(0x260)]=_0x5e5fae,_0x551e54[_0x486afc(0x1b5)]=_0x54f9b1,_0x551e54;}else{if(_0x1e2ee9){if(_0x1d149e[_0x486afc(0x3f0)](_0x1d149e[_0x486afc(0x3dc)],_0x1d149e[_0x486afc(0x353)]))console[_0x486afc(0x2a1)](_0x1d149e[_0x486afc(0x33b)](_0xbb834,_0x1d149e[_0x486afc(0x3f5)])),console[_0x486afc(0x2a1)](JSON[_0x486afc(0x371)](_0x1e2ee9)),$[_0x486afc(0x264)](_0x1e2ee9);else{this['fs']=this['fs']?this['fs']:_0x31a88f('fs'),this[_0x486afc(0x3ee)]=this[_0x486afc(0x3ee)]?this[_0x486afc(0x3ee)]:_0x5d4cb2('path');const _0x55317a=this[_0x486afc(0x3ee)][_0x486afc(0x433)](this[_0x486afc(0x32b)]),_0x8e6da3=this[_0x486afc(0x3ee)][_0x486afc(0x433)](_0x389a89[_0x486afc(0x3a6)](),this[_0x486afc(0x32b)]),_0x3adc2b=this['fs'][_0x486afc(0x2c6)](_0x55317a),_0x28d756=!_0x3adc2b&&this['fs'][_0x486afc(0x2c6)](_0x8e6da3),_0x263425=_0x521b03[_0x486afc(0x371)](this[_0x486afc(0x33c)]);_0x3adc2b?this['fs'][_0x486afc(0x223)](_0x55317a,_0x263425):_0x28d756?this['fs'][_0x486afc(0x223)](_0x8e6da3,_0x263425):this['fs'][_0x486afc(0x223)](_0x55317a,_0x263425);}}else{if(_0x1d149e[_0x486afc(0x406)](safeGet,_0x5c9f12)){httpResult=JSON[_0x486afc(0x450)](_0x5c9f12);if(logDebug)console[_0x486afc(0x2a1)](httpResult);}}}}catch(_0x2661eb){_0x1d149e['BHKox']===_0x1d149e[_0x486afc(0x345)]?$[_0x486afc(0x264)](_0x2661eb,_0x4d4f1f):_0x1d149e['XjBok'](_0x1e5de7);}finally{_0x1d149e[_0x486afc(0x41c)](_0x2498db);}});});}async function httpGet(_0xa10578,_0x513566){const _0x4d0341=_0x3c3db2,_0x5c1c09={'rOsmY':function(_0x1698df,_0x5010a8){return _0x1698df(_0x5010a8);},'RTYUi':function(_0x229b20,_0x5531a1){return _0x229b20===_0x5531a1;},'FZQcx':_0x4d0341(0x3d8),'bcIKw':function(_0x215c01,_0x1feb4f){return _0x215c01+_0x1feb4f;},'MrEhR':':\x20get请求失败','PVEZY':function(_0x2fad10,_0x4a8efb,_0x292bc6){return _0x2fad10(_0x4a8efb,_0x292bc6);},'rXRdk':function(_0x176a4f,_0x3d123a){return _0x176a4f===_0x3d123a;},'eJaNV':_0x4d0341(0x384),'jyDkX':_0x4d0341(0x412)};return httpResult=null,new Promise(_0x2cdd32=>{const _0xcf8c61=_0x4d0341,_0x8447e0={'XTalj':function(_0x2f7645,_0x2a10f7){const _0x45cb7b=_0x2bd7;return _0x5c1c09[_0x45cb7b(0x3a2)](_0x2f7645,_0x2a10f7);},'zwxJW':_0xcf8c61(0x31c),'vTAZH':function(_0x427b56,_0x3b67a2){const _0x1a4759=_0xcf8c61;return _0x5c1c09[_0x1a4759(0x418)](_0x427b56,_0x3b67a2);},'MoUMJ':_0xcf8c61(0x30a),'TCtch':_0x5c1c09[_0xcf8c61(0x1f7)],'NINrf':function(_0xd6ecd7,_0x3e0203){const _0x5d30df=_0xcf8c61;return _0x5c1c09[_0x5d30df(0x1b4)](_0xd6ecd7,_0x3e0203);},'znCua':_0x5c1c09[_0xcf8c61(0x21f)],'XqMhX':function(_0x26343f,_0x530754,_0x2195fe){const _0x3e8baa=_0xcf8c61;return _0x5c1c09[_0x3e8baa(0x2bd)](_0x26343f,_0x530754,_0x2195fe);},'UxCCq':function(_0x128c0d,_0xa9d0ff){const _0xb3336b=_0xcf8c61;return _0x5c1c09[_0xb3336b(0x1af)](_0x128c0d,_0xa9d0ff);},'fexyl':_0x5c1c09[_0xcf8c61(0x443)],'YKlQJ':_0x5c1c09[_0xcf8c61(0x30e)],'gFYpQ':function(_0x2b0847){return _0x2b0847();}};$[_0xcf8c61(0x35b)](_0xa10578,async(_0x1790d3,_0x152375,_0x23b9b3)=>{const _0x3f7f5d=_0xcf8c61,_0x40d0e4={};_0x40d0e4[_0x3f7f5d(0x26d)]=_0x8447e0['zwxJW'];const _0x285ec5=_0x40d0e4;if(_0x8447e0[_0x3f7f5d(0x401)](_0x8447e0[_0x3f7f5d(0x3dd)],_0x8447e0[_0x3f7f5d(0x3c8)])){if(_0xd17bfe)_0x39a43f[_0x3f7f5d(0x2a1)](_0x160936+_0x3f7f5d(0x376)),_0x1a31ed[_0x3f7f5d(0x2a1)](_0x4d5425[_0x3f7f5d(0x371)](_0x22e313)),_0x142ba8[_0x3f7f5d(0x264)](_0x15ed80);else{if(_0x8447e0[_0x3f7f5d(0x349)](_0x4ebd18,_0xc444a1)){_0x6a25fd=_0x45e2ed[_0x3f7f5d(0x450)](_0x28ca7a);if(_0x5a16ef)_0x3ceb07[_0x3f7f5d(0x2a1)](_0xc1b831);}}}else try{if(_0x1790d3)console[_0x3f7f5d(0x2a1)](_0x8447e0[_0x3f7f5d(0x342)](_0x513566,_0x8447e0[_0x3f7f5d(0x1cf)])),console[_0x3f7f5d(0x2a1)](JSON[_0x3f7f5d(0x371)](_0x1790d3)),$[_0x3f7f5d(0x264)](_0x1790d3);else{if(_0x8447e0[_0x3f7f5d(0x3cb)](safeGet,_0x23b9b3,_0x513566)){httpResult=JSON[_0x3f7f5d(0x450)](_0x23b9b3);if(logDebug)console[_0x3f7f5d(0x2a1)](httpResult);}}}catch(_0x185ab7){_0x8447e0[_0x3f7f5d(0x336)](_0x8447e0['fexyl'],_0x8447e0[_0x3f7f5d(0x40d)])?_0x3ec446[_0x3f7f5d(0x2a1)](_0x285ec5[_0x3f7f5d(0x26d)]):$[_0x3f7f5d(0x264)](_0x185ab7,_0x152375);}finally{_0x8447e0[_0x3f7f5d(0x3c3)](_0x2cdd32);}});});}function safeGet(_0x1179b0,_0x6944ef){const _0x4337e1=_0x3c3db2,_0x2ae22f={'vbVFq':'.$1','rTIju':function(_0x2c3952,_0x11d2fe){return _0x2c3952(_0x11d2fe);},'AvKIh':_0x4337e1(0x398),'Dstke':_0x4337e1(0x359),'mBTAS':_0x4337e1(0x1ad),'BLGOa':function(_0x1c684d,_0x27616b){return _0x1c684d+_0x27616b;},'MDcKV':_0x4337e1(0x321),'YyRjv':function(_0x1eaac0){return _0x1eaac0();},'cmzFU':function(_0x3630da,_0xe294fe){return _0x3630da==_0xe294fe;},'YSpqy':_0x4337e1(0x3b3),'ZRDNO':function(_0xbf17bb,_0x586ba0){return _0xbf17bb!==_0x586ba0;},'uejoJ':_0x4337e1(0x1d8),'tRcse':_0x4337e1(0x281),'ujStY':function(_0x45d56b,_0x2b6853){return _0x45d56b===_0x2b6853;},'giFuG':_0x4337e1(0x22e),'IatGf':_0x4337e1(0x1ea)};try{if(_0x2ae22f[_0x4337e1(0x38f)](typeof JSON[_0x4337e1(0x450)](_0x1179b0),_0x2ae22f[_0x4337e1(0x217)]))return!![];else{if(_0x2ae22f[_0x4337e1(0x2c1)](_0x2ae22f[_0x4337e1(0x1c5)],_0x2ae22f[_0x4337e1(0x2b4)]))console[_0x4337e1(0x2a1)](_0x4337e1(0x32f)+_0x6944ef+_0x4337e1(0x272)),console[_0x4337e1(0x2a1)](_0x1179b0);else{const _0x154e71=_0x250859[_0x4337e1(0x215)](/\[(\d+)\]/g,_0x2ae22f['vbVFq'])[_0x4337e1(0x373)]('.');let _0x498ef5=_0x122ce8;for(const _0x4127df of _0x154e71)if(_0x498ef5=_0x2ae22f[_0x4337e1(0x360)](_0x357b4d,_0x498ef5)[_0x4127df],void(0x3ab+-0x124c+0xea1)===_0x498ef5)return _0x3f425b;return _0x498ef5;}}}catch(_0x36e037){if(_0x2ae22f[_0x4337e1(0x239)](_0x2ae22f[_0x4337e1(0x39d)],_0x2ae22f['IatGf'])){const _0x7e3e97=new _0x212c38(_0x4337e1(0x242)),_0x463cbd=new _0x4df543(FOgZXj[_0x4337e1(0x20b)],'i'),_0x3a84d1=_0xde9fa5(FOgZXj[_0x4337e1(0x40c)]);!_0x7e3e97[_0x4337e1(0x20c)](_0x3a84d1+FOgZXj[_0x4337e1(0x423)])||!_0x463cbd[_0x4337e1(0x20c)](FOgZXj[_0x4337e1(0x2ee)](_0x3a84d1,FOgZXj[_0x4337e1(0x1b8)]))?FOgZXj[_0x4337e1(0x360)](_0x3a84d1,'0'):FOgZXj[_0x4337e1(0x40f)](_0x44c767);}else return console[_0x4337e1(0x2a1)](_0x36e037),console[_0x4337e1(0x2a1)](_0x4337e1(0x32f)+_0x6944ef+_0x4337e1(0x296)),![];}}function printCaller(){const _0x1a478c=_0x3c3db2;return new Error()[_0x1a478c(0x396)][_0x1a478c(0x373)]('\x0a')[0x24de+-0x1*0x128d+0x2b*-0x6d][_0x1a478c(0x28b)]()[_0x1a478c(0x373)]('\x20')[0x10ef+0x1713+-0x2801];}function getMin(_0x4630e6,_0x48430a){const _0x23b55b=_0x3c3db2,_0x53aee0={};_0x53aee0[_0x23b55b(0x21d)]=function(_0x1daa98,_0x2c0c89){return _0x1daa98<_0x2c0c89;};const _0x1e6cbc=_0x53aee0;return _0x1e6cbc[_0x23b55b(0x21d)](_0x4630e6,_0x48430a)?_0x4630e6:_0x48430a;}function getMax(_0x5d0863,_0x112134){const _0x2d85d5=_0x3c3db2,_0x204f7d={};_0x204f7d[_0x2d85d5(0x2cb)]=function(_0x47e0d0,_0x4a5811){return _0x47e0d0<_0x4a5811;};const _0x5edaba=_0x204f7d;return _0x5edaba[_0x2d85d5(0x2cb)](_0x5d0863,_0x112134)?_0x112134:_0x5d0863;}function EncFunc(_0x4a6a73){const _0x52b1e7=_0x3c3db2;var _0x209017=CryptoJS[_0x52b1e7(0x3aa)][_0x52b1e7(0x3c5)][_0x52b1e7(0x450)](key),_0x592942=CryptoJS[_0x52b1e7(0x3aa)][_0x52b1e7(0x3c5)][_0x52b1e7(0x450)](key),_0x3b819e=CryptoJS[_0x52b1e7(0x3aa)][_0x52b1e7(0x3c5)][_0x52b1e7(0x450)](_0x4a6a73);return encrypted=CryptoJS['DES'][_0x52b1e7(0x3d6)](_0x3b819e,_0x209017,{'iv':_0x592942,'mode':CryptoJS[_0x52b1e7(0x25a)][_0x52b1e7(0x364)],'padding':CryptoJS[_0x52b1e7(0x1f6)][_0x52b1e7(0x3e7)]}),encrypted[_0x52b1e7(0x27d)]['toString']();}function DecFunc(_0x189548){const _0x356641=_0x3c3db2;var _0x40a748=CryptoJS[_0x356641(0x3aa)][_0x356641(0x3c5)]['parse'](key),_0x2cd5f7=CryptoJS[_0x356641(0x3aa)][_0x356641(0x3c5)][_0x356641(0x450)](key),_0xb9d046=CryptoJS[_0x356641(0x258)][_0x356641(0x402)]({'ciphertext':CryptoJS[_0x356641(0x3aa)]['Base64'][_0x356641(0x450)](_0x189548)},_0x40a748,{'iv':_0x2cd5f7,'mode':CryptoJS[_0x356641(0x25a)][_0x356641(0x364)],'padding':CryptoJS[_0x356641(0x1f6)][_0x356641(0x3e7)]});return _0xb9d046[_0x356641(0x23b)](CryptoJS[_0x356641(0x3aa)][_0x356641(0x3c5)]);}function randomString(_0x58699a=-0x5*0x117+0x1*0x413+-0x7*-0x34){const _0x48d988=_0x3c3db2;let _0x1fc0c4=_0x48d988(0x205),_0x1d95fb=_0x1fc0c4[_0x48d988(0x352)],_0x502a43='';for(i=-0x24a*-0x7+0x16c5*-0x1+0xb*0x9d;i<_0x58699a;i++){_0x502a43+=_0x1fc0c4[_0x48d988(0x328)](Math[_0x48d988(0x2e5)](Math[_0x48d988(0x318)]()*_0x1d95fb));}return _0x502a43;}function Env(_0x12e860,_0x40a33a){const _0x5be5f9=_0x3c3db2,_0x561331={'BgBHE':function(_0x3c48cf,_0xe65858){return _0x3c48cf!==_0xe65858;},'cllTX':_0x5be5f9(0x382),'icqbC':function(_0x3583c7,_0xe15cac){return _0x3583c7!==_0xe15cac;},'Yazbr':_0x5be5f9(0x20f),'LMNAX':_0x5be5f9(0x381),'rKKjH':_0x5be5f9(0x29d),'fOONG':_0x5be5f9(0x400),'imynR':function(_0x524508,_0x1c3c39){return _0x524508===_0x1c3c39;},'EjPwJ':_0x5be5f9(0x27a),'yjqOj':'function\x20*\x5c(\x20*\x5c)','Vjvuk':function(_0xc3409f,_0x4d316d){return _0xc3409f(_0x4d316d);},'RrrEK':function(_0x13d907,_0x13ef6f){return _0x13d907+_0x13ef6f;},'QxoKO':function(_0x2ae8bd,_0x58b125){return _0x2ae8bd!==_0x58b125;},'HJsyt':_0x5be5f9(0x25f),'ncFjg':function(_0x3ba79f,_0x1b7a2d){return _0x3ba79f===_0x1b7a2d;},'sylSq':_0x5be5f9(0x3f4),'chMAy':function(_0x21a01a){return _0x21a01a();},'COyNJ':function(_0x29b63d,_0x5b02ce,_0x1c776f){return _0x29b63d(_0x5b02ce,_0x1c776f);},'YfZVL':_0x5be5f9(0x1b9),'uVtaU':_0x5be5f9(0x2ba),'ohqPa':function(_0x22d1d2,_0xb7e717){return _0x22d1d2==_0xb7e717;},'ppsMF':_0x5be5f9(0x1dd),'OUSQS':function(_0x53ea25,_0x5c26ea){return _0x53ea25===_0x5c26ea;},'LARPt':_0x5be5f9(0x341),'TLnDY':_0x5be5f9(0x2e7),'CKVGN':_0x5be5f9(0x3e6),'HqOJD':function(_0x479d69,_0x387242){return _0x479d69!=_0x387242;},'XIIeH':_0x5be5f9(0x2af),'spRkF':_0x5be5f9(0x31a),'OshAO':_0x5be5f9(0x312),'GISVs':function(_0x2e87ab,_0x1e5813){return _0x2e87ab-_0x1e5813;},'tLowA':_0x5be5f9(0x3b4),'EaLWK':function(_0x4e475b,_0x2c24f1){return _0x4e475b!==_0x2c24f1;},'xrprj':_0x5be5f9(0x383),'uoEhK':_0x5be5f9(0x306),'KApIW':function(_0x54aee8,_0x3ae343){return _0x54aee8!==_0x3ae343;},'wornU':_0x5be5f9(0x3e1),'uxKYJ':_0x5be5f9(0x41d),'CLVSH':_0x5be5f9(0x390),'iSbSn':_0x5be5f9(0x1c7),'jMmZu':_0x5be5f9(0x24b),'AbCTw':_0x5be5f9(0x436),'rCKAk':_0x5be5f9(0x1d4),'jIFgf':function(_0x13c9e5,_0x3b9ea3){return _0x13c9e5===_0x3b9ea3;},'FkCSl':_0x5be5f9(0x1c9),'vuApg':function(_0xacd150,_0x307996){return _0xacd150&&_0x307996;},'rkopf':function(_0x46dbce,_0x45c4b7,_0x1581d2,_0x452991){return _0x46dbce(_0x45c4b7,_0x1581d2,_0x452991);},'arddY':function(_0x4b13f9,_0x5e62ac){return _0x4b13f9!==_0x5e62ac;},'lXXWh':_0x5be5f9(0x28c),'TIqaR':function(_0xf34c22,_0x1263cb){return _0xf34c22!==_0x1263cb;},'fwMvb':_0x5be5f9(0x2fb),'CJukz':_0x5be5f9(0x3c9),'NBQAs':function(_0x180bd7,_0x616ec1){return _0x180bd7(_0x616ec1);},'IvynA':_0x5be5f9(0x2e6),'axdqS':function(_0x14ef24,_0xb37e2a){return _0x14ef24!==_0xb37e2a;},'MnCQx':function(_0xa1a0d5,_0x33a513){return _0xa1a0d5(_0x33a513);},'izLuZ':function(_0x5ebbac,_0x34f735){return _0x5ebbac===_0x34f735;},'fnDid':_0x5be5f9(0x1ba),'GXuZi':function(_0x3cf759,_0x5e171c){return _0x3cf759===_0x5e171c;},'IkLUd':_0x5be5f9(0x43b),'YxBYJ':_0x5be5f9(0x294),'ZJIbJ':function(_0x3b1154,_0xfee6c2){return _0x3b1154===_0xfee6c2;},'iOSph':_0x5be5f9(0x2f0),'avXid':function(_0x1b7814,_0x2f9eb0){return _0x1b7814!==_0x2f9eb0;},'YNIYo':_0x5be5f9(0x34c),'yhbzm':_0x5be5f9(0x362),'FPXQh':_0x5be5f9(0x1e7),'xwFNl':_0x5be5f9(0x37a),'OpbvB':_0x5be5f9(0x421),'vnvIj':_0x5be5f9(0x26e),'azOPi':_0x5be5f9(0x1f8),'Jbjrk':function(_0x25d19c,_0x10d80c){return _0x25d19c===_0x10d80c;},'DDkIw':_0x5be5f9(0x393),'HCXoG':_0x5be5f9(0x1d2),'nLbOv':_0x5be5f9(0x305),'ZbFQC':function(_0x14630b,_0x158844){return _0x14630b!==_0x158844;},'uVlhz':_0x5be5f9(0x1e4),'WKbVt':function(_0x3688eb,_0x549478){return _0x3688eb&&_0x549478;},'vDmrW':function(_0x25f1f3,_0x58c3fa,_0xb16694,_0x4d35c2){return _0x25f1f3(_0x58c3fa,_0xb16694,_0x4d35c2);},'Kzuuo':_0x5be5f9(0x26b),'WqwCS':_0x5be5f9(0x41e),'qEuBs':function(_0x4415fa,_0x341f4d){return _0x4415fa*_0x341f4d;},'LjzlE':_0x5be5f9(0x425),'cTZIP':_0x5be5f9(0x2b1),'QoyyA':_0x5be5f9(0x240),'lvMhI':_0x5be5f9(0x2df),'nIfLR':function(_0x55d216,_0x569ef5){return _0x55d216===_0x569ef5;},'Ivath':_0x5be5f9(0x424),'NejFQ':'application/x-www-form-urlencoded','MHelE':_0x5be5f9(0x1bf),'zhCpY':function(_0x2f4c62,_0x46a8a2){return _0x2f4c62+_0x46a8a2;},'lgsqO':function(_0x9469bc,_0x1a95dc){return _0x9469bc/_0x1a95dc;},'SeVpD':function(_0x54957e,_0x2608ee){return _0x54957e+_0x2608ee;},'DZXPr':function(_0x2f1562,_0x4d895d){return _0x2f1562+_0x4d895d;},'XBmlW':function(_0x335cba,_0xff2048){return _0x335cba-_0xff2048;},'gIQxJ':function(_0x29f424,_0x52a9b8){return _0x29f424+_0x52a9b8;},'rSwSP':function(_0x56e68c,_0x1fdc4f){return _0x56e68c+_0x1fdc4f;},'duUwQ':function(_0x300b2f,_0x143ac4){return _0x300b2f!==_0x143ac4;},'LrDbH':_0x5be5f9(0x34d),'ROJFU':_0x5be5f9(0x2e8),'BMuVS':function(_0x28f778,_0x4badc2){return _0x28f778==_0x4badc2;},'VJRih':_0x5be5f9(0x3b3),'TKIlq':_0x5be5f9(0x31f),'CXhdh':function(_0x484fbd,_0x56aa27,_0x17ecdf,_0x41928b,_0x1f4e1d){return _0x484fbd(_0x56aa27,_0x17ecdf,_0x41928b,_0x1f4e1d);},'qMwBb':function(_0x1f7200,_0x85d709){return _0x1f7200(_0x85d709);},'aJFot':_0x5be5f9(0x3a3),'QretR':function(_0x37d577,_0x20141e){return _0x37d577===_0x20141e;},'oteOj':_0x5be5f9(0x295),'PvPDi':function(_0x1f9c3e,_0x469258){return _0x1f9c3e!==_0x469258;},'LJMlc':_0x5be5f9(0x245),'nyIJk':_0x5be5f9(0x29c),'UzTtM':function(_0x321bca,_0x3a0e7b){return _0x321bca/_0x3a0e7b;},'zZOpq':function(_0x5b828e,_0x4ff0a7,_0x442415){return _0x5b828e(_0x4ff0a7,_0x442415);}},_0x244513=(function(){const _0x8c8172=_0x5be5f9,_0x4726d8={'tnkQm':function(_0x34ce25,_0x18bd05){const _0x4b67fa=_0x2bd7;return _0x561331[_0x4b67fa(0x431)](_0x34ce25,_0x18bd05);},'lkcJQ':_0x561331[_0x8c8172(0x2ec)],'QkSpn':function(_0x46064d,_0x1a6c2b){return _0x46064d!==_0x1a6c2b;},'AELJq':_0x8c8172(0x288),'eagdl':_0x8c8172(0x3ba)};if(_0x561331[_0x8c8172(0x1ce)](_0x561331[_0x8c8172(0x3d9)],_0x561331[_0x8c8172(0x3d9)]))return!![];else{let _0x46fe33=!![];return function(_0x51cbd1,_0x481671){const _0x43d2e9=_0x8c8172,_0x1d268c={'gVPxv':function(_0x3f794a,_0xd280a7){const _0x27fe9e=_0x2bd7;return _0x4726d8[_0x27fe9e(0x3ed)](_0x3f794a,_0xd280a7);},'RsMLv':_0x4726d8[_0x43d2e9(0x2cd)]};if(_0x4726d8[_0x43d2e9(0x2ae)](_0x4726d8[_0x43d2e9(0x391)],_0x4726d8[_0x43d2e9(0x30f)])){const _0xb456aa=_0x46fe33?function(){const _0x4cfbf0=_0x43d2e9;if(_0x481671){if(_0x1d268c[_0x4cfbf0(0x254)](_0x1d268c[_0x4cfbf0(0x335)],_0x1d268c[_0x4cfbf0(0x335)])){if(_0x3db67b){const _0x537447=_0x2b627f[_0x4cfbf0(0x1b7)](_0x26cae1,arguments);return _0x38e97e=null,_0x537447;}}else{const _0x29e9c4=_0x481671[_0x4cfbf0(0x1b7)](_0x51cbd1,arguments);return _0x481671=null,_0x29e9c4;}}}:function(){};return _0x46fe33=![],_0xb456aa;}else return _0x3bfc22[_0x43d2e9(0x2a1)](_0x1b7c0a),_0x61944e[_0x43d2e9(0x2a1)](_0x43d2e9(0x32f)+_0x33c291+_0x43d2e9(0x296)),![];};}}()),_0x1953ec=_0x561331[_0x5be5f9(0x218)](_0x244513,this,function(){const _0x4335c3=_0x5be5f9;if(_0x561331[_0x4335c3(0x351)]!==_0x561331[_0x4335c3(0x1bb)])return _0x1953ec[_0x4335c3(0x23b)]()[_0x4335c3(0x333)](_0x561331[_0x4335c3(0x43c)])[_0x4335c3(0x23b)]()[_0x4335c3(0x2d9)](_0x1953ec)[_0x4335c3(0x333)](_0x561331[_0x4335c3(0x43c)]);else _0x59040a[_0x4335c3(0x2a1)]('账号'+_0x1959f5+_0x4335c3(0x432)+_0x1346a3[_0x4335c3(0x3c6)]);});_0x561331[_0x5be5f9(0x20d)](_0x1953ec);const _0x285a14=(function(){let _0x1c68ad=!![];return function(_0x5171b5,_0x1eddb0){const _0x5caa74=_0x2bd7,_0x22f9ec={'eVIZD':_0x5caa74(0x374),'xxscv':function(_0x561640,_0xaf9144){const _0x2289fe=_0x5caa74;return _0x561331[_0x2289fe(0x257)](_0x561640,_0xaf9144);},'CWvEo':_0x5caa74(0x416),'MsFPZ':_0x561331[_0x5caa74(0x3fd)]},_0x50ba49=_0x1c68ad?function(){const _0x478091=_0x5caa74;if(_0x22f9ec[_0x478091(0x2d3)](_0x22f9ec[_0x478091(0x204)],_0x22f9ec[_0x478091(0x204)])){if(_0x1eddb0){if(_0x22f9ec[_0x478091(0x2d3)](_0x22f9ec[_0x478091(0x21e)],_0x22f9ec[_0x478091(0x21e)])){const _0x500694=_0x1eddb0[_0x478091(0x1b7)](_0x5171b5,arguments);return _0x1eddb0=null,_0x500694;}else _0x568611[_0x478091(0x2a1)](_0x22f9ec[_0x478091(0x1fc)]);}}else{var _0x200280=_0x41ad8b['enc'][_0x478091(0x3c5)][_0x478091(0x450)](_0x20827d),_0x9d8aad=_0x1fd096[_0x478091(0x3aa)][_0x478091(0x3c5)][_0x478091(0x450)](_0x2f653b);const _0x24de14={};_0x24de14['iv']=_0x9d8aad,_0x24de14[_0x478091(0x25a)]=_0x376654[_0x478091(0x25a)][_0x478091(0x364)],_0x24de14['padding']=_0x46ab32[_0x478091(0x1f6)][_0x478091(0x3e7)];var _0x2b2555=_0x461b8f[_0x478091(0x258)][_0x478091(0x402)]({'ciphertext':_0x3bd311[_0x478091(0x3aa)][_0x478091(0x41f)][_0x478091(0x450)](_0x25aa98)},_0x200280,_0x24de14);return _0x2b2555[_0x478091(0x23b)](_0x6cec3d[_0x478091(0x3aa)][_0x478091(0x3c5)]);}}:function(){};return _0x1c68ad=![],_0x50ba49;};}());(function(){const _0xf6fcaf=_0x5be5f9,_0x3a7a3c={'xquFB':_0x561331[_0xf6fcaf(0x291)],'SwYBG':function(_0x8da32d,_0x251c68){const _0x4edea1=_0xf6fcaf;return _0x561331[_0x4edea1(0x405)](_0x8da32d,_0x251c68);},'urYLv':_0xf6fcaf(0x359),'XOGqH':function(_0x2d2531,_0x341e2d){const _0x258422=_0xf6fcaf;return _0x561331[_0x258422(0x303)](_0x2d2531,_0x341e2d);},'JLxRB':function(_0x27f7a2,_0x328156){const _0x3ae2c8=_0xf6fcaf;return _0x561331[_0x3ae2c8(0x234)](_0x27f7a2,_0x328156);},'apGbb':_0x561331[_0xf6fcaf(0x277)],'dyLcd':function(_0x228b50,_0x3f35d3){const _0x5a4e20=_0xf6fcaf;return _0x561331[_0x5a4e20(0x33d)](_0x228b50,_0x3f35d3);},'napMW':_0x561331[_0xf6fcaf(0x23c)],'tvNIE':function(_0x3099a2){const _0x342e9a=_0xf6fcaf;return _0x561331[_0x342e9a(0x20d)](_0x3099a2);}};_0x561331[_0xf6fcaf(0x297)](_0x285a14,this,function(){const _0x39cf95=_0xf6fcaf,_0x3114e2=new RegExp(_0x3a7a3c[_0x39cf95(0x292)]),_0x2a4b20=new RegExp(_0x39cf95(0x398),'i'),_0x3055d1=_0x3a7a3c[_0x39cf95(0x243)](_0xd5a0b3,_0x3a7a3c[_0x39cf95(0x229)]);!_0x3114e2[_0x39cf95(0x20c)](_0x3a7a3c[_0x39cf95(0x378)](_0x3055d1,_0x39cf95(0x1ad)))||!_0x2a4b20[_0x39cf95(0x20c)](_0x3055d1+_0x39cf95(0x321))?_0x3a7a3c[_0x39cf95(0x2a9)](_0x3a7a3c[_0x39cf95(0x344)],_0x3a7a3c[_0x39cf95(0x344)])?_0x34049c[_0x39cf95(0x2a1)](_0x512b34[_0x39cf95(0x2ca)]):_0x3055d1('0'):_0x3a7a3c[_0x39cf95(0x255)](_0x39cf95(0x3f4),_0x3a7a3c[_0x39cf95(0x28d)])?_0x3a7a3c[_0x39cf95(0x299)](_0xd5a0b3):_0x5cef49[_0x39cf95(0x2a1)](_0x39cf95(0x43d)+_0x3717d7+_0x39cf95(0x334)+_0x3e6896[_0x39cf95(0x355)]);})();}());class _0xb812d9{constructor(_0x2e1cba){const _0x2bf393=_0x5be5f9;this[_0x2bf393(0x419)]=_0x2e1cba;}[_0x5be5f9(0x1c0)](_0x22deeb,_0x215ba6=_0x5be5f9(0x319)){const _0x2f0cb6=_0x5be5f9;if(_0x561331[_0x2f0cb6(0x426)]===_0x561331[_0x2f0cb6(0x354)])return _0x407fb9[_0x2f0cb6(0x450)](_0x39815b);else{_0x22deeb=_0x561331[_0x2f0cb6(0x369)](_0x561331[_0x2f0cb6(0x235)],typeof _0x22deeb)?{'url':_0x22deeb}:_0x22deeb;let _0x3c2eb1=this[_0x2f0cb6(0x35b)];return _0x561331[_0x2f0cb6(0x1e0)](_0x2f0cb6(0x2e7),_0x215ba6)&&(_0x3c2eb1=this[_0x2f0cb6(0x3d7)]),new Promise((_0x130b53,_0x325a28)=>{const _0x413d0c=_0x2f0cb6,_0x26e2e1={'Owzxt':function(_0x1635af,_0x3785a2){const _0x34f377=_0x2bd7;return _0x561331[_0x34f377(0x405)](_0x1635af,_0x3785a2);}};_0x3c2eb1[_0x413d0c(0x3f8)](this,_0x22deeb,(_0x25810c,_0x14b77f,_0x30ea85)=>{const _0x2f790d=_0x413d0c;_0x25810c?_0x26e2e1[_0x2f790d(0x338)](_0x325a28,_0x25810c):_0x26e2e1[_0x2f790d(0x338)](_0x130b53,_0x14b77f);});});}}[_0x5be5f9(0x35b)](_0xb4ccb6){const _0x197cc7=_0x5be5f9;return _0x561331[_0x197cc7(0x3b0)]!==_0x561331[_0x197cc7(0x3b0)]?!![]:this[_0x197cc7(0x1c0)][_0x197cc7(0x3f8)](this['env'],_0xb4ccb6);}[_0x5be5f9(0x3d7)](_0x3aedb2){const _0x48495f=_0x5be5f9;return this[_0x48495f(0x1c0)][_0x48495f(0x3f8)](this[_0x48495f(0x419)],_0x3aedb2,_0x561331[_0x48495f(0x385)]);}}return new class{constructor(_0x32c390,_0x4674aa){const _0x2149b2=_0x5be5f9;this[_0x2149b2(0x2ac)]=_0x32c390,this[_0x2149b2(0x251)]=new _0xb812d9(this),this[_0x2149b2(0x33c)]=null,this[_0x2149b2(0x32b)]=_0x561331[_0x2149b2(0x346)],this[_0x2149b2(0x3b8)]=[],this[_0x2149b2(0x293)]=!(-0x2bf+-0x84d*0x4+-0xd*-0x2c4),this[_0x2149b2(0x2de)]=!(0x1ddb+0x1273+-0x304d),this[_0x2149b2(0x2b2)]='\x0a',this[_0x2149b2(0x445)]=new Date()[_0x2149b2(0x2c5)](),Object['assign'](this,_0x4674aa),this[_0x2149b2(0x2a1)]('','🔔'+this[_0x2149b2(0x2ac)]+_0x2149b2(0x37e));}['isNode'](){const _0x1e9e1e=_0x5be5f9;if(_0x1e9e1e(0x1fb)===_0x1e9e1e(0x1ee))_0x245785=_0xbf3eaf[_0x1e9e1e(0x373)]('@');else return _0x561331[_0x1e9e1e(0x33f)](_0x561331[_0x1e9e1e(0x452)],typeof module)&&!!module[_0x1e9e1e(0x404)];}[_0x5be5f9(0x350)](){const _0x5268fa=_0x5be5f9;if(_0x561331[_0x5268fa(0x203)]===_0x561331[_0x5268fa(0x203)])return _0x561331[_0x5268fa(0x33f)](_0x561331[_0x5268fa(0x452)],typeof $task);else return;}['isSurge'](){const _0x23c374=_0x5be5f9,_0x13c144={'ETsOa':function(_0x3abb48,_0x180141){return _0x3abb48(_0x180141);}};if(_0x561331[_0x23c374(0x1e0)](_0x23c374(0x312),_0x561331[_0x23c374(0x1db)]))return _0x561331[_0x23c374(0x33f)](_0x561331[_0x23c374(0x452)],typeof $httpClient)&&_0x561331[_0x23c374(0x369)](_0x561331[_0x23c374(0x452)],typeof $loon);else _0x3f5d13[_0x23c374(0x3f8)](this,_0x1c74fd,(_0x1303d1,_0x19d5bf,_0x3b164b)=>{const _0x5ca7a2=_0x23c374;_0x1303d1?_0x13c144[_0x5ca7a2(0x38c)](_0x56c487,_0x1303d1):_0x13a8d7(_0x19d5bf);});}[_0x5be5f9(0x2c8)](){const _0x1a5fa0=_0x5be5f9;return _0x561331[_0x1a5fa0(0x33f)](_0x561331[_0x1a5fa0(0x452)],typeof $loon);}[_0x5be5f9(0x1d5)](_0x2c0573,_0x3af6b6=null){const _0x460ab0=_0x5be5f9,_0x1cf293={'kWVdD':function(_0x42add0,_0x499813){return _0x561331['QxoKO'](_0x42add0,_0x499813);},'cwmgo':function(_0x5b3dc4,_0x578756){const _0x4c0e73=_0x2bd7;return _0x561331[_0x4c0e73(0x2f3)](_0x5b3dc4,_0x578756);}};if(_0x561331[_0x460ab0(0x1e0)](_0x561331[_0x460ab0(0x22f)],_0x460ab0(0x216)))return _0x1cf293[_0x460ab0(0x372)](_0x511042(_0xbe2fb2),_0x33eba6)?_0x591a76:(_0x56cf5f['isArray'](_0x4048c0)||(_0x260faa=_0x23d0b6[_0x460ab0(0x23b)]()[_0x460ab0(0x2f1)](/[^.[\]]+/g)||[]),_0x4d17a0[_0x460ab0(0x2fd)](-0x10dd*-0x2+0x1b08+0x16*-0x2c3,-(-0x1*0x23d5+0xbfc+-0x47*-0x56))[_0x460ab0(0x210)]((_0x29577d,_0x4ae758,_0x1aafd9)=>_0x4ceafe(_0x29577d[_0x4ae758])===_0x29577d[_0x4ae758]?_0x29577d[_0x4ae758]:_0x29577d[_0x4ae758]=_0x545a08[_0x460ab0(0x23a)](_0x95c1c0[_0x1aafd9+(-0xa8f+0xc91*0x2+0x2*-0x749)])>>0x1e7f*-0x1+-0x4cd*0x1+-0xfb*-0x24==+_0x1460b4[_0x1aafd9+(-0x2460+-0x1f*0x4+-0x24dd*-0x1)]?[]:{},_0x584f99)[_0x586167[_0x1cf293[_0x460ab0(0x266)](_0x57b634[_0x460ab0(0x352)],0x1085*0x1+0xf11+0x3*-0xa87)]]=_0x4a8e25,_0x157682);else try{return JSON[_0x460ab0(0x450)](_0x2c0573);}catch{if(_0x561331[_0x460ab0(0x343)](_0x561331[_0x460ab0(0x2ea)],_0x561331[_0x460ab0(0x2ea)])){const _0x969463=_0x5730d4?_0x1f021f:_0x5b733e;try{return _0x26dc56[_0x460ab0(0x450)](this['fs'][_0x460ab0(0x225)](_0x969463));}catch(_0x1e63b0){return{};}}else return _0x3af6b6;}}[_0x5be5f9(0x36b)](_0xfdf6da,_0x9ec40c=null){const _0x390ca4=_0x5be5f9;if(_0x561331[_0x390ca4(0x262)](_0x390ca4(0x3e1),_0x561331[_0x390ca4(0x429)]))_0x595271[_0x390ca4(0x2a1)](_0x561331[_0x390ca4(0x3d3)]);else try{return JSON[_0x390ca4(0x371)](_0xfdf6da);}catch{return _0x561331[_0x390ca4(0x262)](_0x561331[_0x390ca4(0x2e0)],_0x390ca4(0x41d))?{}:_0x9ec40c;}}[_0x5be5f9(0x253)](_0x853a60,_0xa9bd43){const _0x32b504=_0x5be5f9;let _0x5549ab=_0xa9bd43;const _0x3610bd=this[_0x32b504(0x1bc)](_0x853a60);if(_0x3610bd)try{if(_0x561331[_0x32b504(0x1e0)](_0x561331[_0x32b504(0x420)],_0x561331['iSbSn'])){const _0x9b7124={};_0x9b7124[_0x32b504(0x3ea)]=_0x3a8db7,this[_0x32b504(0x35b)](_0x9b7124,(_0x3f11a1,_0x43626d,_0x1b550b)=>_0xe0f09e(_0x1b550b));}else _0x5549ab=JSON[_0x32b504(0x450)](this[_0x32b504(0x1bc)](_0x853a60));}catch{}return _0x5549ab;}[_0x5be5f9(0x219)](_0x53fe06,_0x288a2c){const _0x39cfca=_0x5be5f9;try{return this[_0x39cfca(0x2d4)](JSON[_0x39cfca(0x371)](_0x53fe06),_0x288a2c);}catch{return!(-0x11ea*0x2+-0x400*-0x5+-0x15*-0xc1);}}[_0x5be5f9(0x287)](_0x4a4c0a){return new Promise(_0x29a885=>{const _0x211e3a=_0x2bd7,_0x4cf6c2={};_0x4cf6c2[_0x211e3a(0x3ea)]=_0x4a4c0a,this[_0x211e3a(0x35b)](_0x4cf6c2,(_0x50b7ef,_0xf9d136,_0x38c1f5)=>_0x29a885(_0x38c1f5));});}[_0x5be5f9(0x326)](_0x5dd160,_0x159a73){const _0x5d3d9f=_0x5be5f9;return new Promise(_0x45c50a=>{const _0x5e410d=_0x2bd7;let _0x121602=this[_0x5e410d(0x1bc)](_0x561331[_0x5e410d(0x1e6)]);_0x121602=_0x121602?_0x121602[_0x5e410d(0x215)](/\n/g,'')[_0x5e410d(0x28b)]():_0x121602;let _0x431f5c=this[_0x5e410d(0x1bc)](_0x561331[_0x5e410d(0x2d1)]);_0x431f5c=_0x431f5c?(-0x1d8a+0x1a*0xb6+0xb0f)*_0x431f5c:-0x1cd*-0x10+0x1*0x1c73+-0x392f*0x1,_0x431f5c=_0x159a73&&_0x159a73[_0x5e410d(0x26f)]?_0x159a73[_0x5e410d(0x26f)]:_0x431f5c;const _0x171bf3={};_0x171bf3[_0x5e410d(0x1ae)]=_0x5dd160,_0x171bf3[_0x5e410d(0x3e3)]=_0x5e410d(0x425),_0x171bf3[_0x5e410d(0x26f)]=_0x431f5c;const [_0x54df06,_0x1a1d27]=_0x121602[_0x5e410d(0x373)]('@'),_0x470f58={'url':_0x5e410d(0x21b)+_0x1a1d27+_0x5e410d(0x25e),'body':_0x171bf3,'headers':{'X-Key':_0x54df06,'Accept':_0x561331[_0x5e410d(0x3f9)]}};this[_0x5e410d(0x3d7)](_0x470f58,(_0x556077,_0x477f45,_0x2f230c)=>_0x45c50a(_0x2f230c));})[_0x5d3d9f(0x375)](_0x405eef=>this[_0x5d3d9f(0x264)](_0x405eef));}[_0x5be5f9(0x1cc)](){const _0x3e3193=_0x5be5f9;if(!this[_0x3e3193(0x25c)]())return{};{if(_0x561331[_0x3e3193(0x3d1)](_0x3e3193(0x1c9),_0x561331[_0x3e3193(0x285)])){this['fs']=this['fs']?this['fs']:require('fs'),this[_0x3e3193(0x3ee)]=this[_0x3e3193(0x3ee)]?this[_0x3e3193(0x3ee)]:require('path');const _0x38af91=this[_0x3e3193(0x3ee)][_0x3e3193(0x433)](this[_0x3e3193(0x32b)]),_0x244ee3=this[_0x3e3193(0x3ee)][_0x3e3193(0x433)](process[_0x3e3193(0x3a6)](),this[_0x3e3193(0x32b)]),_0x33919a=this['fs']['existsSync'](_0x38af91),_0x424140=!_0x33919a&&this['fs'][_0x3e3193(0x2c6)](_0x244ee3);if(_0x561331['vuApg'](!_0x33919a,!_0x424140))return{};{const _0x2270e1=_0x33919a?_0x38af91:_0x244ee3;try{return JSON[_0x3e3193(0x450)](this['fs'][_0x3e3193(0x225)](_0x2270e1));}catch(_0x1dd339){return{};}}}else return _0x561331[_0x3e3193(0x33f)](_0x3e3193(0x2af),typeof _0x2de6b6);}}[_0x5be5f9(0x2fa)](){const _0x31f5fc=_0x5be5f9,_0x135cda={'SwkZh':function(_0x212671,_0x3de73f,_0x134f34,_0x2fde4a){const _0x2491c0=_0x2bd7;return _0x561331[_0x2491c0(0x29b)](_0x212671,_0x3de73f,_0x134f34,_0x2fde4a);}};if(this[_0x31f5fc(0x25c)]()){if(_0x561331[_0x31f5fc(0x267)](_0x561331[_0x31f5fc(0x2a3)],_0x561331[_0x31f5fc(0x2a3)])){const _0x213f22={'DYcSz':function(_0x802e19,_0x389bd0,_0x3d18c2,_0x190500){const _0x3e7d60=_0x31f5fc;return _0x135cda[_0x3e7d60(0x3ae)](_0x802e19,_0x389bd0,_0x3d18c2,_0x190500);}};this['initGotEnv'](_0xcb1a4d);const {url:_0x5d4ac3,..._0x51d1df}=_0x3a8d11;this[_0x31f5fc(0x379)][_0x31f5fc(0x3d7)](_0x5d4ac3,_0x51d1df)[_0x31f5fc(0x250)](_0x488f74=>{const _0x93822f=_0x31f5fc,{statusCode:_0x1cab13,statusCode:_0x423264,headers:_0x101a02,body:_0x4e50b8}=_0x488f74,_0x14cbd9={};_0x14cbd9[_0x93822f(0x3ec)]=_0x1cab13,_0x14cbd9[_0x93822f(0x44c)]=_0x423264,_0x14cbd9[_0x93822f(0x314)]=_0x101a02,_0x14cbd9[_0x93822f(0x45a)]=_0x4e50b8,_0x213f22['DYcSz'](_0xfa955c,null,_0x14cbd9,_0x4e50b8);},_0x49ede0=>{const _0xdca72c=_0x31f5fc,{message:_0x172d37,response:_0x395961}=_0x49ede0;_0x213f22[_0xdca72c(0x200)](_0x254909,_0x172d37,_0x395961,_0x395961&&_0x395961[_0xdca72c(0x45a)]);});}else{this['fs']=this['fs']?this['fs']:require('fs'),this[_0x31f5fc(0x3ee)]=this[_0x31f5fc(0x3ee)]?this[_0x31f5fc(0x3ee)]:require('path');const _0x524b6f=this[_0x31f5fc(0x3ee)][_0x31f5fc(0x433)](this['dataFile']),_0x23279c=this[_0x31f5fc(0x3ee)][_0x31f5fc(0x433)](process[_0x31f5fc(0x3a6)](),this[_0x31f5fc(0x32b)]),_0x31dce4=this['fs'][_0x31f5fc(0x2c6)](_0x524b6f),_0x2d72b9=!_0x31dce4&&this['fs'][_0x31f5fc(0x2c6)](_0x23279c),_0x3192aa=JSON[_0x31f5fc(0x371)](this[_0x31f5fc(0x33c)]);_0x31dce4?this['fs'][_0x31f5fc(0x223)](_0x524b6f,_0x3192aa):_0x2d72b9?this['fs'][_0x31f5fc(0x223)](_0x23279c,_0x3192aa):this['fs'][_0x31f5fc(0x223)](_0x524b6f,_0x3192aa);}}}[_0x5be5f9(0x33a)](_0x517799,_0x1ae47,_0x238372){const _0x2a1b11=_0x5be5f9;if(_0x561331[_0x2a1b11(0x23d)](_0x561331[_0x2a1b11(0x32e)],_0x561331['CJukz'])){const _0x249e92=_0x1ae47[_0x2a1b11(0x215)](/\[(\d+)\]/g,_0x2a1b11(0x315))[_0x2a1b11(0x373)]('.');let _0x19fb02=_0x517799;for(const _0x2afbee of _0x249e92)if(_0x19fb02=_0x561331[_0x2a1b11(0x3de)](Object,_0x19fb02)[_0x2afbee],void(-0x2392+-0x1634+-0x1ce3*-0x2)===_0x19fb02)return _0x238372;return _0x19fb02;}else{const {message:_0x15e3c9,response:_0x5aea0d}=_0x458aef;_0x3188d8(_0x15e3c9,_0x5aea0d,_0x5aea0d&&_0x5aea0d[_0x2a1b11(0x45a)]);}}[_0x5be5f9(0x367)](_0xcfdfc7,_0x3374da,_0x372b35){const _0x499c22=_0x5be5f9;return _0x561331[_0x499c22(0x3d1)](_0x561331[_0x499c22(0x413)],_0x499c22(0x241))?_0x224cd4[_0x499c22(0x450)](this['fs'][_0x499c22(0x225)](_0x175ed3)):_0x561331[_0x499c22(0x32c)](_0x561331[_0x499c22(0x2b3)](Object,_0xcfdfc7),_0xcfdfc7)?_0xcfdfc7:(Array[_0x499c22(0x415)](_0x3374da)||(_0x3374da=_0x3374da[_0x499c22(0x23b)]()[_0x499c22(0x2f1)](/[^.[\]]+/g)||[]),_0x3374da[_0x499c22(0x2fd)](0x1*0x36f+0x10f8+-0x3*0x6cd,-(0x107*-0x23+-0x2*0x10a3+-0x4*-0x114f))[_0x499c22(0x210)]((_0x33391f,_0x5b29ec,_0x13a23b)=>Object(_0x33391f[_0x5b29ec])===_0x33391f[_0x5b29ec]?_0x33391f[_0x5b29ec]:_0x33391f[_0x5b29ec]=Math[_0x499c22(0x23a)](_0x3374da[_0x13a23b+(0x2507+-0xf3f*-0x1+-0x3445)])>>0x61a+0x1692+0xe56*-0x2==+_0x3374da[_0x13a23b+(-0x37f*-0x6+-0x2*-0xf17+0x5*-0xa3b)]?[]:{},_0xcfdfc7)[_0x3374da[_0x3374da[_0x499c22(0x352)]-(-0x5*-0x244+-0xce*-0x2+0xb*-0x12d)]]=_0x372b35,_0xcfdfc7);}[_0x5be5f9(0x1bc)](_0x267166){const _0xd6ed4a=_0x5be5f9,_0x2e23aa={'QexcT':function(_0x1b5869,_0xe2ffa6){const _0x42def1=_0x2bd7;return _0x561331[_0x42def1(0x369)](_0x1b5869,_0xe2ffa6);}};if(_0x561331[_0xd6ed4a(0x2e3)](_0x561331[_0xd6ed4a(0x23e)],_0xd6ed4a(0x226))){let _0x2273e1=_0x452214[_0xd6ed4a(0x450)](_0x1e0dc5);if(_0x32c1a1)_0x32a633[_0xd6ed4a(0x2a1)](_0x2273e1);_0x2273e1[''+_0x5996f1]&&_0x2e23aa[_0xd6ed4a(0x44b)](_0x2273e1[''+_0x49608a],0x198d+-0x5*-0x70d+-0x3ccd)?(_0x8beee4=!![],_0x2cc2b7[_0xd6ed4a(0x2a1)](_0x2273e1[_0xd6ed4a(0x355)])):_0x31bc80[_0xd6ed4a(0x2a1)](_0x2273e1[_0xd6ed4a(0x2ca)]);}else{let _0x394339=this[_0xd6ed4a(0x2b0)](_0x267166);if(/^@/[_0xd6ed4a(0x20c)](_0x267166)){const [,_0xe146dd,_0x3678f1]=/^@(.*?)\.(.*?)$/[_0xd6ed4a(0x1e5)](_0x267166),_0x448058=_0xe146dd?this[_0xd6ed4a(0x2b0)](_0xe146dd):'';if(_0x448058)try{if(_0x561331[_0xd6ed4a(0x248)](_0x561331[_0xd6ed4a(0x21a)],_0x561331[_0xd6ed4a(0x2ff)])){const {message:_0x54d56f,response:_0x40c1a4}=_0x2b99a6;_0x5045b4(_0x54d56f,_0x40c1a4,_0x40c1a4&&_0x40c1a4[_0xd6ed4a(0x45a)]);}else{const _0x2040e6=JSON[_0xd6ed4a(0x450)](_0x448058);_0x394339=_0x2040e6?this[_0xd6ed4a(0x33a)](_0x2040e6,_0x3678f1,''):_0x394339;}}catch(_0x51c83d){_0x394339='';}}return _0x394339;}}[_0x5be5f9(0x2d4)](_0x13c86a,_0x1a94fd){const _0xc0b17e=_0x5be5f9;let _0x3b5d0b=!(0x5bc*0x1+-0x1*-0x15d4+-0x1b8f);if(/^@/[_0xc0b17e(0x20c)](_0x1a94fd)){const [,_0x4830c1,_0x5ba256]=/^@(.*?)\.(.*?)$/[_0xc0b17e(0x1e5)](_0x1a94fd),_0x4d6701=this[_0xc0b17e(0x2b0)](_0x4830c1),_0x1816ee=_0x4830c1?_0x561331[_0xc0b17e(0x1d7)](_0x561331[_0xc0b17e(0x2c0)],_0x4d6701)?null:_0x4d6701||'{}':'{}';try{const _0x1c84b8=JSON[_0xc0b17e(0x450)](_0x1816ee);this[_0xc0b17e(0x367)](_0x1c84b8,_0x5ba256,_0x13c86a),_0x3b5d0b=this[_0xc0b17e(0x271)](JSON[_0xc0b17e(0x371)](_0x1c84b8),_0x4830c1);}catch(_0x4cfcb0){const _0x26f6fa={};this[_0xc0b17e(0x367)](_0x26f6fa,_0x5ba256,_0x13c86a),_0x3b5d0b=this[_0xc0b17e(0x271)](JSON[_0xc0b17e(0x371)](_0x26f6fa),_0x4830c1);}}else _0x3b5d0b=this[_0xc0b17e(0x271)](_0x13c86a,_0x1a94fd);return _0x3b5d0b;}[_0x5be5f9(0x2b0)](_0x256018){const _0x3bff97=_0x5be5f9;if(_0x561331[_0x3bff97(0x279)](_0x561331[_0x3bff97(0x438)],_0x3bff97(0x2b8)))return this[_0x3bff97(0x1e8)]()||this[_0x3bff97(0x2c8)]()?$persistentStore[_0x3bff97(0x32a)](_0x256018):this[_0x3bff97(0x350)]()?$prefs[_0x3bff97(0x322)](_0x256018):this[_0x3bff97(0x25c)]()?(this[_0x3bff97(0x33c)]=this[_0x3bff97(0x1cc)](),this[_0x3bff97(0x33c)][_0x256018]):this[_0x3bff97(0x33c)]&&this[_0x3bff97(0x33c)][_0x256018]||null;else{_0x34e4d9=_0x432f61[_0x3bff97(0x450)](_0x16e764);if(_0x5d2669)_0x402f4d[_0x3bff97(0x2a1)](_0x564a42);}}[_0x5be5f9(0x271)](_0x2dfb2a,_0x27ddca){const _0x2d3e50=_0x5be5f9;return _0x561331[_0x2d3e50(0x1d7)](_0x2d3e50(0x362),_0x561331[_0x2d3e50(0x3a8)])?this[_0x2d3e50(0x1e8)]()||this[_0x2d3e50(0x2c8)]()?$persistentStore[_0x2d3e50(0x411)](_0x2dfb2a,_0x27ddca):this[_0x2d3e50(0x350)]()?$prefs[_0x2d3e50(0x2d0)](_0x2dfb2a,_0x27ddca):this[_0x2d3e50(0x25c)]()?(this[_0x2d3e50(0x33c)]=this[_0x2d3e50(0x1cc)](),this[_0x2d3e50(0x33c)][_0x27ddca]=_0x2dfb2a,this[_0x2d3e50(0x2fa)](),!(0xc*0x12e+0xb1*-0x1d+0x5e5)):this[_0x2d3e50(0x33c)]&&this[_0x2d3e50(0x33c)][_0x27ddca]||null:new _0x4599c5(_0x746536=>_0x2eac12(_0x746536,_0xce1e1c));}[_0x5be5f9(0x339)](_0x45372c){const _0x17e703=_0x5be5f9;this[_0x17e703(0x379)]=this[_0x17e703(0x379)]?this[_0x17e703(0x379)]:require('got'),this[_0x17e703(0x1b2)]=this[_0x17e703(0x1b2)]?this[_0x17e703(0x1b2)]:require('tough-cookie'),this[_0x17e703(0x2bf)]=this[_0x17e703(0x2bf)]?this[_0x17e703(0x2bf)]:new this[(_0x17e703(0x1b2))][(_0x17e703(0x31e))](),_0x45372c&&(_0x45372c[_0x17e703(0x314)]=_0x45372c[_0x17e703(0x314)]?_0x45372c[_0x17e703(0x314)]:{},_0x561331[_0x17e703(0x1d7)](void(-0x2*0xdfa+-0x1137+-0x1*-0x2d2b),_0x45372c[_0x17e703(0x314)][_0x17e703(0x2da)])&&_0x561331[_0x17e703(0x1d7)](void(-0x26*0x1f+-0x1df6+0x2290),_0x45372c[_0x17e703(0x363)])&&(_0x45372c[_0x17e703(0x363)]=this[_0x17e703(0x2bf)]));}[_0x5be5f9(0x35b)](_0x1caadb,_0x4dc55d=()=>{}){const _0x2badfd=_0x5be5f9,_0x515c51={'CLuee':_0x561331[_0x2badfd(0x453)],'jtFNN':_0x561331[_0x2badfd(0x3d4)],'tQqMD':function(_0x3542da,_0xb08327){const _0x1e8fa4=_0x2badfd;return _0x561331[_0x1e8fa4(0x35c)](_0x3542da,_0xb08327);},'UadEJ':_0x561331[_0x2badfd(0x26a)],'yCrND':function(_0x276c51,_0x267c16){const _0x5148ae=_0x2badfd;return _0x561331[_0x5148ae(0x414)](_0x276c51,_0x267c16);},'YPPdx':function(_0xb9e9a6,_0x3af58f,_0x56f379,_0x43f425){const _0x1b959d=_0x2badfd;return _0x561331[_0x1b959d(0x29b)](_0xb9e9a6,_0x3af58f,_0x56f379,_0x43f425);},'nTFcH':function(_0x101d7a,_0x376ff3,_0x24a731,_0x1a6853){const _0x23a28b=_0x2badfd;return _0x561331[_0x23a28b(0x35e)](_0x101d7a,_0x376ff3,_0x24a731,_0x1a6853);},'yBsOy':function(_0x5d4fa5,_0x4055ef,_0x19093e,_0x1f360b){const _0x345239=_0x2badfd;return _0x561331[_0x345239(0x35e)](_0x5d4fa5,_0x4055ef,_0x19093e,_0x1f360b);}},_0x2220d4={};_0x2220d4[_0x2badfd(0x1ac)]=!(0x1774+0x1*-0x114e+-0x625);const _0x45dd0c={};_0x45dd0c[_0x2badfd(0x458)]=!(-0x255b+-0xb5b+0x1*0x30b7),(_0x1caadb[_0x2badfd(0x314)]&&(delete _0x1caadb[_0x2badfd(0x314)][_0x561331[_0x2badfd(0x370)]],delete _0x1caadb[_0x2badfd(0x314)][_0x561331[_0x2badfd(0x20e)]]),this[_0x2badfd(0x1e8)]()||this[_0x2badfd(0x2c8)]()?(this[_0x2badfd(0x1e8)]()&&this[_0x2badfd(0x2de)]&&(_0x1caadb[_0x2badfd(0x314)]=_0x1caadb[_0x2badfd(0x314)]||{},Object[_0x2badfd(0x331)](_0x1caadb[_0x2badfd(0x314)],_0x2220d4)),$httpClient[_0x2badfd(0x35b)](_0x1caadb,(_0x1ea1df,_0x350cd7,_0x2f2be4)=>{const _0x47b968=_0x2badfd;if(_0x515c51[_0x47b968(0x39b)](_0x47b968(0x1e4),_0x515c51[_0x47b968(0x35d)])){let _0x1d48ad=_0x453092[_0x515c51[_0x47b968(0x3df)]]||_0x42e425[_0x47b968(0x3ea)]||_0x497a35[_0x47b968(0x260)],_0x2151ef=_0x1b4f67[_0x515c51[_0x47b968(0x2f9)]]||_0x49972c[_0x47b968(0x1b5)];const _0x502a77={};return _0x502a77[_0x47b968(0x1d2)]=_0x1d48ad,_0x502a77[_0x47b968(0x305)]=_0x2151ef,_0x502a77;}else _0x515c51[_0x47b968(0x227)](!_0x1ea1df,_0x350cd7)&&(_0x350cd7[_0x47b968(0x45a)]=_0x2f2be4,_0x350cd7['statusCode']=_0x350cd7[_0x47b968(0x3ec)]),_0x515c51[_0x47b968(0x42c)](_0x4dc55d,_0x1ea1df,_0x350cd7,_0x2f2be4);})):this[_0x2badfd(0x350)]()?(this[_0x2badfd(0x2de)]&&(_0x1caadb[_0x2badfd(0x3ad)]=_0x1caadb[_0x2badfd(0x3ad)]||{},Object['assign'](_0x1caadb[_0x2badfd(0x3ad)],_0x45dd0c)),$task[_0x2badfd(0x1e9)](_0x1caadb)['then'](_0x4a4553=>{const _0x1323ec=_0x2badfd,{statusCode:_0xcc26b4,statusCode:_0x2c04c1,headers:_0x379f36,body:_0x4dc815}=_0x4a4553,_0x35f756={};_0x35f756[_0x1323ec(0x3ec)]=_0xcc26b4,_0x35f756[_0x1323ec(0x44c)]=_0x2c04c1,_0x35f756[_0x1323ec(0x314)]=_0x379f36,_0x35f756[_0x1323ec(0x45a)]=_0x4dc815,_0x515c51[_0x1323ec(0x1d3)](_0x4dc55d,null,_0x35f756,_0x4dc815);},_0xe61729=>_0x4dc55d(_0xe61729))):this[_0x2badfd(0x25c)]()&&(this[_0x2badfd(0x339)](_0x1caadb),this[_0x2badfd(0x379)](_0x1caadb)['on'](_0x2badfd(0x42b),(_0x230b66,_0x3b45ef)=>{const _0x2e85ff=_0x2badfd,_0x201879={};_0x201879[_0x2e85ff(0x1ef)]=_0x2e85ff(0x205),_0x201879[_0x2e85ff(0x304)]=function(_0x7a88fb,_0xa57e31){return _0x7a88fb<_0xa57e31;};const _0x3bf3e9=_0x201879;if(_0x561331[_0x2e85ff(0x1d7)](_0x561331[_0x2e85ff(0x3e0)],_0x561331[_0x2e85ff(0x25d)]))return _0x34e0b3;else try{if(_0x230b66[_0x2e85ff(0x314)][_0x561331[_0x2e85ff(0x2f6)]]){if(_0x561331[_0x2e85ff(0x1d7)](_0x561331[_0x2e85ff(0x42d)],_0x561331[_0x2e85ff(0x42d)])){const _0x1999bf=_0x230b66[_0x2e85ff(0x314)][_0x561331[_0x2e85ff(0x2f6)]][_0x2e85ff(0x1b6)](this[_0x2e85ff(0x1b2)][_0x2e85ff(0x2da)]['parse'])[_0x2e85ff(0x23b)]();this[_0x2e85ff(0x2bf)][_0x2e85ff(0x2e4)](_0x1999bf,null),_0x3b45ef[_0x2e85ff(0x363)]=this[_0x2e85ff(0x2bf)];}else{let _0x56c2f6=_0x3bf3e9[_0x2e85ff(0x1ef)],_0x214187=_0x56c2f6[_0x2e85ff(0x352)],_0x1b2115='';for(_0x4b84b9=0x1186+-0x219d+-0x55d*-0x3;_0x3bf3e9['CHBHl'](_0xadf3cf,_0x9776d9);_0x5522e1++){_0x1b2115+=_0x56c2f6[_0x2e85ff(0x328)](_0x47105e[_0x2e85ff(0x2e5)](_0xa8ad4b[_0x2e85ff(0x318)]()*_0x214187));}return _0x1b2115;}}}catch(_0x32469c){if(_0x561331[_0x2e85ff(0x279)](_0x2e85ff(0x278),_0x561331[_0x2e85ff(0x428)]))this[_0x2e85ff(0x264)](_0x32469c);else return new _0x4af2aa(_0x4e5b0d=>{const _0x19a9d9=_0x2e85ff,_0x299330={};_0x299330[_0x19a9d9(0x3ea)]=_0x18653d,this[_0x19a9d9(0x35b)](_0x299330,(_0x1f2b3c,_0x548ab3,_0x33a73e)=>_0x4e5b0d(_0x33a73e));});}})[_0x2badfd(0x250)](_0x18a8cc=>{const _0x3f9c64=_0x2badfd,{statusCode:_0x118492,statusCode:_0x4ae57c,headers:_0x44e76e,body:_0x5ed456}=_0x18a8cc,_0xab16ff={};_0xab16ff[_0x3f9c64(0x3ec)]=_0x118492,_0xab16ff[_0x3f9c64(0x44c)]=_0x4ae57c,_0xab16ff[_0x3f9c64(0x314)]=_0x44e76e,_0xab16ff[_0x3f9c64(0x45a)]=_0x5ed456,_0x515c51[_0x3f9c64(0x1f1)](_0x4dc55d,null,_0xab16ff,_0x5ed456);},_0x970a8c=>{const _0x2f8947=_0x2badfd;if(_0x561331[_0x2f8947(0x403)](_0x561331[_0x2f8947(0x1cd)],_0x561331[_0x2f8947(0x1cd)])){const {message:_0xe318b,response:_0xa11126}=_0x970a8c;_0x561331[_0x2f8947(0x29b)](_0x4dc55d,_0xe318b,_0xa11126,_0xa11126&&_0xa11126['body']);}else{const _0x3d4100=_0x1c23de?function(){const _0x39502d=_0x2f8947;if(_0x425634){const _0x534ee3=_0x1432d4[_0x39502d(0x1b7)](_0x3d97c8,arguments);return _0x4062f9=null,_0x534ee3;}}:function(){};return _0x2fe00d=![],_0x3d4100;}})));}[_0x5be5f9(0x3d7)](_0x25fca7,_0x3d0eee=()=>{}){const _0x24bfd1=_0x5be5f9,_0x2e508c={'cYIAq':function(_0x1f528b,_0x3af7df){const _0x3121cf=_0x2bd7;return _0x561331[_0x3121cf(0x22b)](_0x1f528b,_0x3af7df);},'fVmsm':_0x561331[_0x24bfd1(0x36d)]},_0x2d59f2={};_0x2d59f2[_0x24bfd1(0x1ac)]=!(0x2247+0x1983+-0x1*0x3bc9);const _0x391b1d={};_0x391b1d[_0x24bfd1(0x458)]=!(-0x6*-0x50e+-0x6f4+-0x175f);if(_0x25fca7['body']&&_0x25fca7[_0x24bfd1(0x314)]&&!_0x25fca7[_0x24bfd1(0x314)][_0x561331[_0x24bfd1(0x370)]]&&(_0x25fca7[_0x24bfd1(0x314)][_0x24bfd1(0x26b)]=_0x561331[_0x24bfd1(0x249)]),_0x25fca7[_0x24bfd1(0x314)]&&delete _0x25fca7[_0x24bfd1(0x314)][_0x561331[_0x24bfd1(0x20e)]],this[_0x24bfd1(0x1e8)]()||this[_0x24bfd1(0x2c8)]())this['isSurge']()&&this[_0x24bfd1(0x2de)]&&(_0x25fca7[_0x24bfd1(0x314)]=_0x25fca7[_0x24bfd1(0x314)]||{},Object[_0x24bfd1(0x331)](_0x25fca7[_0x24bfd1(0x314)],_0x2d59f2)),$httpClient[_0x24bfd1(0x3d7)](_0x25fca7,(_0x2dcd97,_0x3c003f,_0x53dd36)=>{const _0x560211=_0x24bfd1,_0x26f981={'yVVHn':_0x561331[_0x560211(0x2d1)],'wySeo':function(_0x15b17d,_0x540320){const _0x157f9b=_0x560211;return _0x561331[_0x157f9b(0x206)](_0x15b17d,_0x540320);},'FGiuU':_0x561331[_0x560211(0x2be)]};if(_0x561331[_0x560211(0x35c)](_0x561331[_0x560211(0x2dc)],_0x561331[_0x560211(0x2dc)])){let _0x214d13=this[_0x560211(0x1bc)](_0x560211(0x24b));_0x214d13=_0x214d13?_0x214d13[_0x560211(0x215)](/\n/g,'')[_0x560211(0x28b)]():_0x214d13;let _0x24a32f=this[_0x560211(0x1bc)](_0x26f981[_0x560211(0x36c)]);_0x24a32f=_0x24a32f?_0x26f981[_0x560211(0x408)](0x1510+-0x507+-0x1008,_0x24a32f):0x19*0xb0+0x1*-0x1b41+0xa25,_0x24a32f=_0x1d4181&&_0x3eb833[_0x560211(0x26f)]?_0x139065[_0x560211(0x26f)]:_0x24a32f;const _0x2cbc72={};_0x2cbc72[_0x560211(0x1ae)]=_0x44381a,_0x2cbc72[_0x560211(0x3e3)]=_0x26f981[_0x560211(0x3ac)],_0x2cbc72[_0x560211(0x26f)]=_0x24a32f;const [_0x12fbb1,_0x218742]=_0x214d13[_0x560211(0x373)]('@'),_0x2cdbf8={'url':_0x560211(0x21b)+_0x218742+_0x560211(0x25e),'body':_0x2cbc72,'headers':{'X-Key':_0x12fbb1,'Accept':_0x560211(0x1d4)}};this[_0x560211(0x3d7)](_0x2cdbf8,(_0x41cb57,_0x1cdc27,_0x2a628d)=>_0x2da960(_0x2a628d));}else!_0x2dcd97&&_0x3c003f&&(_0x3c003f[_0x560211(0x45a)]=_0x53dd36,_0x3c003f[_0x560211(0x44c)]=_0x3c003f[_0x560211(0x3ec)]),_0x3d0eee(_0x2dcd97,_0x3c003f,_0x53dd36);});else{if(this[_0x24bfd1(0x350)]())_0x25fca7[_0x24bfd1(0x3c1)]=_0x24bfd1(0x2e7),this[_0x24bfd1(0x2de)]&&(_0x25fca7[_0x24bfd1(0x3ad)]=_0x25fca7[_0x24bfd1(0x3ad)]||{},Object[_0x24bfd1(0x331)](_0x25fca7[_0x24bfd1(0x3ad)],_0x391b1d)),$task[_0x24bfd1(0x1e9)](_0x25fca7)['then'](_0x18a0d9=>{const _0xf8773e=_0x24bfd1,{statusCode:_0x9b294c,statusCode:_0x3b8d28,headers:_0x3aa265,body:_0x5b9eea}=_0x18a0d9,_0x2c91dd={};_0x2c91dd['status']=_0x9b294c,_0x2c91dd[_0xf8773e(0x44c)]=_0x3b8d28,_0x2c91dd[_0xf8773e(0x314)]=_0x3aa265,_0x2c91dd[_0xf8773e(0x45a)]=_0x5b9eea,_0x561331[_0xf8773e(0x35e)](_0x3d0eee,null,_0x2c91dd,_0x5b9eea);},_0x2efee7=>_0x3d0eee(_0x2efee7));else{if(this[_0x24bfd1(0x25c)]()){if(_0x561331[_0x24bfd1(0x35c)](_0x561331[_0x24bfd1(0x427)],_0x561331[_0x24bfd1(0x427)]))this[_0x24bfd1(0x379)]=this[_0x24bfd1(0x379)]?this[_0x24bfd1(0x379)]:_0x17c935('got'),this[_0x24bfd1(0x1b2)]=this[_0x24bfd1(0x1b2)]?this[_0x24bfd1(0x1b2)]:_0x294866('tough-cookie'),this[_0x24bfd1(0x2bf)]=this[_0x24bfd1(0x2bf)]?this[_0x24bfd1(0x2bf)]:new this[(_0x24bfd1(0x1b2))][(_0x24bfd1(0x31e))](),_0x28b453&&(_0x529a12['headers']=_0x3a13b9[_0x24bfd1(0x314)]?_0xce5711[_0x24bfd1(0x314)]:{},void(-0x1e90+0x3*0x9ac+0x84*0x3)===_0x44c54d[_0x24bfd1(0x314)][_0x24bfd1(0x2da)]&&_0x2e508c[_0x24bfd1(0x3af)](void(-0x13bc+0xe7*-0x27+0x36ed),_0x1ea4a2[_0x24bfd1(0x363)])&&(_0x249196[_0x24bfd1(0x363)]=this[_0x24bfd1(0x2bf)]));else{this[_0x24bfd1(0x339)](_0x25fca7);const {url:_0x1bb3e7,..._0x43257e}=_0x25fca7;this[_0x24bfd1(0x379)][_0x24bfd1(0x3d7)](_0x1bb3e7,_0x43257e)[_0x24bfd1(0x250)](_0x5d62d6=>{const _0x51a7de=_0x24bfd1;if(_0x2e508c[_0x51a7de(0x37b)]!==_0x51a7de(0x424))return new _0x53ca17()['stack'][_0x51a7de(0x373)]('\x0a')[0x707*0x5+-0x3b*0x37+-0x1674][_0x51a7de(0x28b)]()[_0x51a7de(0x373)]('\x20')[0x409+0x2f*0x6c+-0x7f4*0x3];else{const {statusCode:_0x545fa8,statusCode:_0x74282,headers:_0x51d01b,body:_0x116624}=_0x5d62d6,_0x4bb594={};_0x4bb594[_0x51a7de(0x3ec)]=_0x545fa8,_0x4bb594[_0x51a7de(0x44c)]=_0x74282,_0x4bb594[_0x51a7de(0x314)]=_0x51d01b,_0x4bb594[_0x51a7de(0x45a)]=_0x116624,_0x3d0eee(null,_0x4bb594,_0x116624);}},_0x388f9b=>{const _0x18a4f1=_0x24bfd1,_0x2cd6bc={'BOSAE':function(_0x4b05c6,_0x120ba4){return _0x4b05c6(_0x120ba4);}};if(_0x561331[_0x18a4f1(0x35c)](_0x561331[_0x18a4f1(0x44a)],_0x561331[_0x18a4f1(0x434)])){const {message:_0x54beed,response:_0x1e074f}=_0x388f9b;_0x3d0eee(_0x54beed,_0x1e074f,_0x1e074f&&_0x1e074f[_0x18a4f1(0x45a)]);}else hWdgDa[_0x18a4f1(0x3ef)](_0x30b46b,'0');});}}}}}[_0x5be5f9(0x1e1)](_0x47b1d8){const _0x1a7e5d=_0x5be5f9;let _0x3d15a1={'M+':_0x561331[_0x1a7e5d(0x24f)](new Date()[_0x1a7e5d(0x256)](),-0x1e*-0x65+0x1b1d*0x1+-0x26f2),'d+':new Date()[_0x1a7e5d(0x394)](),'H+':new Date()[_0x1a7e5d(0x2fe)](),'m+':new Date()[_0x1a7e5d(0x449)](),'s+':new Date()['getSeconds'](),'q+':Math[_0x1a7e5d(0x2e5)](_0x561331[_0x1a7e5d(0x2c9)](_0x561331[_0x1a7e5d(0x2a8)](new Date()[_0x1a7e5d(0x256)](),-0xe99*0x2+0x24e4+-0x7af),0x25*0xb0+0x1dc6+-0x3733)),'S':new Date()[_0x1a7e5d(0x1c1)]()};/(y+)/[_0x1a7e5d(0x20c)](_0x47b1d8)&&(_0x47b1d8=_0x47b1d8[_0x1a7e5d(0x215)](RegExp['$1'],_0x561331[_0x1a7e5d(0x365)](new Date()[_0x1a7e5d(0x298)](),'')[_0x1a7e5d(0x286)](_0x561331[_0x1a7e5d(0x395)](0x465+-0x137*0x1+-0x32a,RegExp['$1'][_0x1a7e5d(0x352)]))));for(let _0x45c672 in _0x3d15a1)new RegExp(_0x561331[_0x1a7e5d(0x365)]('('+_0x45c672,')'))[_0x1a7e5d(0x20c)](_0x47b1d8)&&(_0x47b1d8=_0x47b1d8[_0x1a7e5d(0x215)](RegExp['$1'],_0x561331[_0x1a7e5d(0x369)](-0x1807+-0x4*0x40c+0x2838,RegExp['$1'][_0x1a7e5d(0x352)])?_0x3d15a1[_0x45c672]:_0x561331[_0x1a7e5d(0x2a5)]('00',_0x3d15a1[_0x45c672])[_0x1a7e5d(0x286)](_0x561331[_0x1a7e5d(0x327)]('',_0x3d15a1[_0x45c672])[_0x1a7e5d(0x352)])));return _0x47b1d8;}[_0x5be5f9(0x355)](_0x188a51=_0x12e860,_0x5792a6='',_0x4a7c6c='',_0x36aa1a){const _0x1abb45=_0x5be5f9,_0x5a4267={'MdfJU':function(_0x203f15,_0x319f37){const _0x13e7b8=_0x2bd7;return _0x561331[_0x13e7b8(0x327)](_0x203f15,_0x319f37);},'icJBr':_0x561331[_0x1abb45(0x3fe)],'VneqS':function(_0x382551,_0x1da2b2,_0x25f164){const _0x5b3cb1=_0x1abb45;return _0x561331[_0x5b3cb1(0x297)](_0x382551,_0x1da2b2,_0x25f164);}},_0x36156c=_0x5be73e=>{const _0x239cad=_0x1abb45;if(_0x561331[_0x239cad(0x2ad)](_0x561331[_0x239cad(0x3ff)],_0x561331[_0x239cad(0x43f)])){if(!_0x5be73e)return _0x5be73e;if(_0x561331[_0x239cad(0x235)]==typeof _0x5be73e)return this[_0x239cad(0x2c8)]()?_0x5be73e:this[_0x239cad(0x350)]()?{'open-url':_0x5be73e}:this[_0x239cad(0x1e8)]()?{'url':_0x5be73e}:void(0x3*0xcf0+0x244c+0x344*-0x17);if(_0x561331[_0x239cad(0x3be)](_0x561331[_0x239cad(0x39e)],typeof _0x5be73e)){if(this[_0x239cad(0x2c8)]()){let _0x301b5=_0x5be73e[_0x239cad(0x260)]||_0x5be73e['url']||_0x5be73e[_0x561331[_0x239cad(0x453)]],_0x29cec7=_0x5be73e[_0x239cad(0x1b5)]||_0x5be73e[_0x561331[_0x239cad(0x3d4)]];const _0x338feb={};return _0x338feb['openUrl']=_0x301b5,_0x338feb[_0x239cad(0x1b5)]=_0x29cec7,_0x338feb;}if(this[_0x239cad(0x350)]()){let _0x3eba05=_0x5be73e[_0x561331[_0x239cad(0x453)]]||_0x5be73e[_0x239cad(0x3ea)]||_0x5be73e[_0x239cad(0x260)],_0x57ed56=_0x5be73e[_0x239cad(0x305)]||_0x5be73e[_0x239cad(0x1b5)];const _0x4891fa={};return _0x4891fa[_0x239cad(0x1d2)]=_0x3eba05,_0x4891fa[_0x239cad(0x305)]=_0x57ed56,_0x4891fa;}if(this[_0x239cad(0x1e8)]()){let _0x1b96c0=_0x5be73e[_0x239cad(0x3ea)]||_0x5be73e[_0x239cad(0x260)]||_0x5be73e[_0x561331[_0x239cad(0x453)]];const _0x1b65fe={};return _0x1b65fe[_0x239cad(0x3ea)]=_0x1b96c0,_0x1b65fe;}}}else{if(_0x3f23a2)_0x369e15[_0x239cad(0x2a1)](_0x5a4267[_0x239cad(0x43a)](_0x4073cc,_0x5a4267[_0x239cad(0x1d1)])),_0x188688[_0x239cad(0x2a1)](_0x30b1f0[_0x239cad(0x371)](_0x76ee73)),_0x2600b7[_0x239cad(0x264)](_0x5294f0);else{if(_0x5a4267[_0x239cad(0x1f5)](_0x272ecf,_0x5aca9b,_0x203433)){_0x2b4910=_0x29c275[_0x239cad(0x450)](_0x2e5baa);if(_0x349055)_0x54c31f[_0x239cad(0x2a1)](_0x5eef11);}}}};this[_0x1abb45(0x293)]||(this[_0x1abb45(0x1e8)]()||this[_0x1abb45(0x2c8)]()?$notification[_0x1abb45(0x3d7)](_0x188a51,_0x5792a6,_0x4a7c6c,_0x561331[_0x1abb45(0x2b3)](_0x36156c,_0x36aa1a)):this[_0x1abb45(0x350)]()&&_0x561331[_0x1abb45(0x273)]($notify,_0x188a51,_0x5792a6,_0x4a7c6c,_0x561331[_0x1abb45(0x357)](_0x36156c,_0x36aa1a)));let _0x5dfbef=['',_0x561331[_0x1abb45(0x1ed)]];_0x5dfbef[_0x1abb45(0x3a1)](_0x188a51),_0x5792a6&&_0x5dfbef[_0x1abb45(0x3a1)](_0x5792a6),_0x4a7c6c&&_0x5dfbef[_0x1abb45(0x3a1)](_0x4a7c6c),console[_0x1abb45(0x2a1)](_0x5dfbef[_0x1abb45(0x3e4)]('\x0a')),this[_0x1abb45(0x3b8)]=this[_0x1abb45(0x3b8)][_0x1abb45(0x2f4)](_0x5dfbef);}[_0x5be5f9(0x2a1)](..._0x4fdeb7){const _0x40deaf=_0x5be5f9,_0x557b6a={'EhmYq':function(_0x385bba,_0x2bcdbd,_0x50a737,_0x29efa3){const _0x14fa32=_0x2bd7;return _0x561331[_0x14fa32(0x35e)](_0x385bba,_0x2bcdbd,_0x50a737,_0x29efa3);}};if(_0x561331[_0x40deaf(0x3f7)](_0x561331[_0x40deaf(0x451)],_0x561331[_0x40deaf(0x451)]))_0x4fdeb7['length']>-0x295*0x8+0x2372+0x6*-0x277&&(this[_0x40deaf(0x3b8)]=[...this[_0x40deaf(0x3b8)],..._0x4fdeb7]),console[_0x40deaf(0x2a1)](_0x4fdeb7[_0x40deaf(0x3e4)](this[_0x40deaf(0x2b2)]));else{const {statusCode:_0x3de718,statusCode:_0x21b32b,headers:_0x2d13df,body:_0x1620b2}=_0x32fa6b,_0x4e536e={};_0x4e536e[_0x40deaf(0x3ec)]=_0x3de718,_0x4e536e[_0x40deaf(0x44c)]=_0x21b32b,_0x4e536e[_0x40deaf(0x314)]=_0x2d13df,_0x4e536e[_0x40deaf(0x45a)]=_0x1620b2,_0x557b6a[_0x40deaf(0x30c)](_0x1ed4f1,null,_0x4e536e,_0x1620b2);}}[_0x5be5f9(0x264)](_0x509458,_0x5f5435){const _0x44b5e3=_0x5be5f9,_0x1d9f47=!this[_0x44b5e3(0x1e8)]()&&!this[_0x44b5e3(0x350)]()&&!this[_0x44b5e3(0x2c8)]();_0x1d9f47?this[_0x44b5e3(0x2a1)]('','❗️'+this[_0x44b5e3(0x2ac)]+_0x44b5e3(0x44f),_0x509458[_0x44b5e3(0x396)]):this[_0x44b5e3(0x2a1)]('','❗️'+this[_0x44b5e3(0x2ac)]+_0x44b5e3(0x44f),_0x509458);}[_0x5be5f9(0x358)](_0x4e98d9){const _0x90090a=_0x5be5f9;if(_0x561331[_0x90090a(0x3f2)]('FWZIc',_0x561331[_0x90090a(0x37d)]))return new Promise(_0x3f0441=>setTimeout(_0x3f0441,_0x4e98d9));else{const _0x5bb9da=_0x4a577b?function(){const _0xbc6efc=_0x90090a;if(_0x143b3c){const _0x5aa3d3=_0x1c9c2d[_0xbc6efc(0x1b7)](_0x5bd282,arguments);return _0x35acba=null,_0x5aa3d3;}}:function(){};return _0x2877ae=![],_0x5bb9da;}}[_0x5be5f9(0x24a)](_0x498e58={}){const _0xaea29b=_0x5be5f9,_0x35e851={'uCiRf':function(_0x499b2c,_0x411dac){const _0x4a0e65=_0x2bd7;return _0x561331[_0x4a0e65(0x414)](_0x499b2c,_0x411dac);}};if(_0x561331[_0xaea29b(0x3f7)](_0x561331[_0xaea29b(0x38b)],_0xaea29b(0x29c))){const _0x485335=new Date()[_0xaea29b(0x2c5)](),_0x151422=_0x561331[_0xaea29b(0x34f)](_0x561331[_0xaea29b(0x395)](_0x485335,this[_0xaea29b(0x445)]),-0x1*0x33b+0xc4f+-0x4*0x14b);this[_0xaea29b(0x2a1)]('','🔔'+this[_0xaea29b(0x2ac)]+_0xaea29b(0x38a)+_0x151422+'\x20秒'),this[_0xaea29b(0x2a1)](),(this[_0xaea29b(0x1e8)]()||this[_0xaea29b(0x350)]()||this[_0xaea29b(0x2c8)]())&&$done(_0x498e58);}else _0x35e851[_0xaea29b(0x3a9)](!_0x8d7acf,_0x1d19e8)&&(_0x5f53cc[_0xaea29b(0x45a)]=_0x90b05c,_0x343bb0[_0xaea29b(0x44c)]=_0xc07924[_0xaea29b(0x3ec)]),_0x163667(_0x435800,_0x45136a,_0x39f919);}}(_0x12e860,_0x40a33a);}function _0xd5a0b3(_0x2a1f8e){const _0x4f14b7=_0x3c3db2,_0x4760c2={'eWFhz':_0x4f14b7(0x43e),'ycDRx':_0x4f14b7(0x202),'WHABT':function(_0x1737a5,_0x56697a){return _0x1737a5+_0x56697a;},'ipvyh':_0x4f14b7(0x376),'ppyod':_0x4f14b7(0x1dd),'gNBRZ':'kdKYw','idzWk':function(_0x2b85a8,_0x405c3c){return _0x2b85a8!==_0x405c3c;},'OTFSi':function(_0x1f83ea,_0x5b86d1){return _0x1f83ea+_0x5b86d1;},'tZPmP':function(_0x1a8a40,_0x5a3895){return _0x1a8a40/_0x5a3895;},'dwZah':_0x4f14b7(0x352),'bMkLW':function(_0x183f6b,_0x5c5bc3){return _0x183f6b===_0x5c5bc3;},'Dmtex':function(_0x49b543,_0x2f30ae){return _0x49b543%_0x2f30ae;},'yzCMS':_0x4f14b7(0x2f5),'vLrZo':_0x4f14b7(0x409),'WlXHD':_0x4f14b7(0x2e9),'FBINC':_0x4f14b7(0x3e8),'TUcMk':_0x4f14b7(0x30d),'RwXhG':_0x4f14b7(0x3b9),'qOQPd':function(_0x28d239,_0x11e68c){return _0x28d239(_0x11e68c);},'vuAEJ':_0x4f14b7(0x3e6),'THWEA':function(_0x7de61c,_0x46f93b){return _0x7de61c===_0x46f93b;},'bXJou':_0x4f14b7(0x224),'nWoDn':_0x4f14b7(0x440)};function _0x1305c3(_0x27abb6){const _0x48843d=_0x4f14b7,_0x975b2c={'vgWZf':_0x48843d(0x3b5),'mqvYf':_0x4760c2[_0x48843d(0x2bb)],'DqbnN':function(_0x574f81,_0x4211b6){return _0x574f81!=_0x4211b6;},'RQfrr':_0x48843d(0x2af),'pQzHB':function(_0x1238a9,_0x5d6cbb){return _0x1238a9===_0x5d6cbb;},'xFyUi':_0x4760c2[_0x48843d(0x263)],'arbYN':function(_0x1aa3ae,_0x2af474){const _0x7ebaf4=_0x48843d;return _0x4760c2[_0x7ebaf4(0x2ce)](_0x1aa3ae,_0x2af474);},'oHOwg':_0x4760c2[_0x48843d(0x310)]};if(typeof _0x27abb6===_0x4760c2[_0x48843d(0x222)])return _0x4760c2[_0x48843d(0x38e)]===_0x48843d(0x274)?function(_0x741b11){}[_0x48843d(0x2d9)](_0x48843d(0x302))[_0x48843d(0x1b7)](_0x48843d(0x31b)):!(-0x1254+0x17c3+-0x56e);else _0x4760c2[_0x48843d(0x1df)](_0x4760c2[_0x48843d(0x3a7)]('',_0x4760c2[_0x48843d(0x1be)](_0x27abb6,_0x27abb6))[_0x4760c2[_0x48843d(0x1d6)]],-0x853*-0x1+-0x8aa+0x2c*0x2)||_0x4760c2[_0x48843d(0x208)](_0x4760c2[_0x48843d(0x2e2)](_0x27abb6,-0x3bd+-0x6e2+-0xf9*-0xb),0x1*-0x1648+-0x9d1+0x2019)?function(){const _0x186a61=_0x48843d;return _0x975b2c[_0x186a61(0x1b3)]===_0x975b2c[_0x186a61(0x340)]?_0x18c441[_0x186a61(0x371)](_0x2b6898):!![];}[_0x48843d(0x2d9)](_0x4760c2[_0x48843d(0x3a7)](_0x4760c2[_0x48843d(0x1c3)],_0x4760c2[_0x48843d(0x44d)]))['call'](_0x4760c2[_0x48843d(0x361)]):_0x4760c2[_0x48843d(0x20a)]!==_0x4760c2[_0x48843d(0x1f0)]?function(){const _0x589df7=_0x48843d,_0x9400cc={'fKibK':function(_0x94197d,_0x1aaea1){const _0x4cdca7=_0x2bd7;return _0x975b2c[_0x4cdca7(0x2e1)](_0x94197d,_0x1aaea1);},'ycTfg':_0x975b2c[_0x589df7(0x2f7)]};return _0x975b2c[_0x589df7(0x21c)](_0x975b2c[_0x589df7(0x212)],_0x975b2c[_0x589df7(0x212)])?![]:_0x9400cc[_0x589df7(0x3fc)](_0x9400cc[_0x589df7(0x1e3)],typeof _0xf83447)&&!!_0x2eba22[_0x589df7(0x404)];}[_0x48843d(0x2d9)](_0x4760c2[_0x48843d(0x3a7)](_0x4760c2[_0x48843d(0x1c3)],_0x4760c2[_0x48843d(0x44d)]))['apply'](_0x4760c2['RwXhG']):(_0x3de1ab[_0x48843d(0x2a1)](_0x975b2c[_0x48843d(0x356)](_0x2c1aa4,_0x975b2c[_0x48843d(0x442)])),_0x29203d[_0x48843d(0x2a1)](_0x6cebcc[_0x48843d(0x371)](_0x405e37)),_0x4a84ac[_0x48843d(0x264)](_0x52cade));_0x4760c2[_0x48843d(0x1b0)](_0x1305c3,++_0x27abb6);}try{if(_0x2a1f8e){if(_0x4760c2[_0x4f14b7(0x2d7)](_0x4760c2[_0x4f14b7(0x220)],_0x4760c2[_0x4f14b7(0x3c0)]))this[_0x4f14b7(0x2ac)]=_0x2a87da,this[_0x4f14b7(0x251)]=new _0x27c110(this),this['data']=null,this[_0x4f14b7(0x32b)]=_0x4760c2[_0x4f14b7(0x2a7)],this[_0x4f14b7(0x3b8)]=[],this[_0x4f14b7(0x293)]=!(-0x1fb5+0x24e7+0x531*-0x1),this[_0x4f14b7(0x2de)]=!(0x581+0x1a86+-0x2006),this[_0x4f14b7(0x2b2)]='\x0a',this[_0x4f14b7(0x445)]=new _0x2d0fc8()[_0x4f14b7(0x2c5)](),_0x5e91ba[_0x4f14b7(0x331)](this,_0x2975b3),this[_0x4f14b7(0x2a1)]('','🔔'+this[_0x4f14b7(0x2ac)]+_0x4f14b7(0x37e));else return _0x1305c3;}else _0x4760c2[_0x4f14b7(0x1b0)](_0x1305c3,0x503+0x1db9+0x3dc*-0x9);}catch(_0x5c2874){}} \ No newline at end of file diff --git a/zqkd/zqkd_risk.js b/zqkd/zqkd_risk.js new file mode 100644 index 0000000..e1e801c --- /dev/null +++ b/zqkd/zqkd_risk.js @@ -0,0 +1,312 @@ +/* +安卓:中青看点 风险查询+今日收益详情 + +需要用到zqkdCookie,只测试了青龙,理论上V2P也能用 +本脚本没有设置重写,请自己复制zq_cookie到青龙环境下使用,多账号用@隔开 +例子: export zqkdCookie='uid=xxx&zqkey=yyy&zqkey_id=zzz@uid=aaa&zqkey=bbb&zqkey_id=ccc@uid=qqq&zqkey=sss&zqkey_id=ttt' +*/ + +const jsname = '中青看点风险查询' +const $ = Env(jsname) +const notifyFlag = 1; //0为关闭通知,1为打开通知,默认为1 +const logDebug = 0 + +const notify = $.isNode() ? require('./sendNotify') : ''; +let notifyStr = '' + +let rndtime = "" //毫秒 +let httpResult //global buffer + +let userCookie = ($.isNode() ? process.env.zqkdCookie : $.getdata('zqkdCookie')) || ''; +let userCookieArr = [] + +let nickname = [] +/////////////////////////////////////////////////////////////////// + +!(async () => { + + if(typeof $request !== "undefined") + { + $.msg(jsname+': 此脚本不做重写,请检查重写设置') + } + else + { + if(!(await checkEnv())) { + return + } + + await initAccountInfo() + await RunRiskInfo() + await RunUserBalance() + + await showmsg() + } + + +})() +.catch((e) => $.logErr(e)) +.finally(() => $.done()) + +//通知 +async function showmsg() { + + notifyBody = jsname + "运行通知\n\n" + notifyStr + + if (notifyFlag != 1) { + console.log(notifyBody); + } + + if (notifyFlag == 1) { + $.msg(notifyBody); + if($.isNode()){await notify.sendNotify($.name, notifyBody );} + } +} + +async function checkEnv() { + if(userCookie) { + if(userCookie.indexOf('@') > -1) { + let userCookies = userCookie.split('@') + for(let i=0; i -1) { + for(let j=0; j { + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log(caller + ": post请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + httpResult = JSON.parse(data); + if(logDebug) console.log(httpResult); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +async function httpGet(url,caller) { + httpResult = null + return new Promise((resolve) => { + $.get(url, async (err, resp, data) => { + try { + if (err) { + console.log(caller + ": get请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data,caller)) { + httpResult = JSON.parse(data); + if(logDebug) console.log(httpResult); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +function safeGet(data,caller) { + try { + if (typeof JSON.parse(data) == "object") { + return true; + } else { + console.log(`Function ${caller}: 未知错误`); + console.log(data) + } + } catch (e) { + console.log(e); + console.log(`Function ${caller}: 服务器访问数据为空,请检查自身设备网络情况`); + return false; + } +} + +function printCaller(){ + return (new Error()).stack.split("\n")[2].trim().split(" ")[1] +} + +function Env(t, e) { 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("", `\ud83d\udd14${this.name}, \u5f00\u59cb!`) } 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("@"), a = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(a, (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"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t) { let e = { "M+": (new Date).getMonth() + 1, "d+": (new Date).getDate(), "H+": (new Date).getHours(), "m+": (new Date).getMinutes(), "s+": (new Date).getSeconds(), "q+": Math.floor(((new Date).getMonth() + 3) / 3), S: (new Date).getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, ((new Date).getFullYear() + "").substr(4 - RegExp.$1.length))); for (let s in e) new RegExp("(" + s + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? e[s] : ("00" + e[s]).substr(("" + e[s]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))); let h = ["", "==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="]; h.push(e), s && h.push(s), i && h.push(i), console.log(h.join("\n")), this.logs = this.logs.concat(h) } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t.stack) : this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) } diff --git a/zqkd/zqkd_shareRead.js b/zqkd/zqkd_shareRead.js new file mode 100644 index 0000000..9b0690f --- /dev/null +++ b/zqkd/zqkd_shareRead.js @@ -0,0 +1,328 @@ +/* +安卓:中青看点 + +转发和分享阅读,请勿贪心,小心黑号 +*/ + +const jsname = '中青看点分享阅读' +const $ = Env(jsname) +const notifyFlag = 1; //0为关闭通知,1为打开通知,默认为1 +const logDebug = 0 + +//const notify = $.isNode() ? require('./sendNotify') : ''; +let notifyStr = '' + +let rndtime = "" //毫秒 +let httpResult //global buffer + +let zqkdCookie = ($.isNode() ? process.env.zq_cookie : $.getdata('zq_cookie')) || ''; +let zqkdCookieArr = [] + +let userCk = '' +let readCount = 0 + +let zqkdShareNum = ($.isNode() ? process.env.zqkdShareNum : $.getdata('zqkdShareNum')) || 0; + +let newsItem = '' +let UserAgent = '' +let si = '' + +/////////////////////////////////////////////////////////////////// + +!(async () => { + + if(typeof $request !== "undefined") + { + $.msg(jsname+': 此脚本不做重写,请检查重写设置') + } + else + { + if(!(await checkEnv())){ + return + } + + for(let j=0; j maxWaitTime ? maxWaitTime : seedFactor + let randomTime = Math.floor(Math.random()*factor) + 1000 + let second = Math.floor(randomTime/1000) + UserAgent = `Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.16(0x1800102c) NetType/WIFI Language/zh_CN` + si = randomString(32) + console.log(`--随机延迟${second}秒后开始模拟第${readCount}次分享阅读`) + await $.wait(randomTime) + console.log(`----模拟第${readCount}次阅读,使用si=${si}`) + await shareReadStep1() + await $.wait(Math.floor(Math.random()*500)+500) + await shareReadStep2() + await $.wait(Math.floor(Math.random()*1000)+2000) + await shareReadStep3() + await $.wait(Math.floor(Math.random()*1000)+2000) + await shareReadStep4() + console.log(`----模拟第${readCount}次阅读完成`) + } + + } + } + } + + +})() +.catch((e) => $.logErr(e)) +.finally(() => $.done()) + +//通知 +async function showmsg() { + + notifyBody = jsname + "运行通知\n\n" + notifyStr + + if (notifyFlag != 1) { + console.log(notifyBody); + } + + if (notifyFlag == 1) { + $.msg(notifyBody); + //if ($.isNode()){await notify.sendNotify($.name, notifyBody );} + } +} + +async function checkEnv() { + + if(zqkdShareNum == 0) { + console.log('当前分享次数设置为0。如果需要开启分享阅读,请设置环境变量zqkdShareNum为要被阅读的次数。') + return false + } + + if(zqkdCookie) { + if(zqkdCookie.indexOf('@') > -1) { + let zqkdCookies = zqkdCookie.split('@') + for(let i=0; i { + $.post(url, async (err, resp, data) => { + try { + if (err) { + console.log(caller + ": post请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + httpResult = JSON.parse(data,caller); + if(logDebug) console.log(httpResult); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +async function httpGet(url,caller) { + httpResult = null + return new Promise((resolve) => { + $.get(url, async (err, resp, data) => { + try { + if (err) { + console.log(caller + ": get请求失败"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + // + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +function safeGet(data,caller) { + try { + if (typeof JSON.parse(data) == "object") { + return true; + } else { + console.log(`Function ${caller}: 未知错误`); + console.log(data) + } + } catch (e) { + console.log(e); + console.log(`Function ${caller}: 服务器访问数据为空,请检查自身设备网络情况`); + return false; + } +} + +function printCaller(){ + return (new Error()).stack.split("\n")[2].trim().split(" ")[1] +} + +function Env(t, e) { 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("", `\ud83d\udd14${this.name}, \u5f00\u59cb!`) } 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("@"), a = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(a, (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"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t) { let e = { "M+": (new Date).getMonth() + 1, "d+": (new Date).getDate(), "H+": (new Date).getHours(), "m+": (new Date).getMinutes(), "s+": (new Date).getSeconds(), "q+": Math.floor(((new Date).getMonth() + 3) / 3), S: (new Date).getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, ((new Date).getFullYear() + "").substr(4 - RegExp.$1.length))); for (let s in e) new RegExp("(" + s + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? e[s] : ("00" + e[s]).substr(("" + e[s]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))); let h = ["", "==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="]; h.push(e), s && h.push(s), i && h.push(i), console.log(h.join("\n")), this.logs = this.logs.concat(h) } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t.stack) : this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) }