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..7862ff4 --- /dev/null +++ b/blackUnique.js @@ -0,0 +1,1669 @@ +/* +APP:全球购骑士特权 + +直接appstore搜索下载,方便的话可以微信扫下面图片二维码走邀请注册,谢谢 +https://raw.githubusercontent.com/leafxcy/JavaScript/main/blackUnique.jpg + +定时为每小时一次,务必在0分到5分之间运行,目前只写了每日领勋章和领取存钱罐的任务,大概每天3毛 +提现需要关注微信公众号,在公众号里申请提现 +请手动点一下签到页面的【收零花钱】领一次金币,去【果园】里选择水果种子 +只测试了IOS的青龙和V2P,暂不支持多账号 + +青龙: +捉https://market.chuxingyouhui.com/promo-bargain-api/activity/mqq/api/indexTopInfo?的包,获得appId +捉https://pyp-api.chuxingyouhui.com/api/app/userCenter/v1/info的包,获得其他header +然后填在blackJSON里面,注意按照JSON格式填写。用青龙面板的环境变量或者外面用双引号的,字符串内需要用\"转义 +export blackJSON='{"black-token":"", "token":"", "User-Agent":"", "device-value":"", "device-type":"", "phpUserId":"", "appId":""}' + +V2P,圈X:重写方法 -- 点击右下角【我的】-> 【每日签到赚现金】 +[task_local] +#全球购骑士特权 +0 * * * * https://raw.githubusercontent.com/leafxcy/JavaScript/main/blackUnique.js, tag=全球购骑士特权, enabled=true +[rewrite_local] +https://pyp-api.chuxingyouhui.com/api/app/userCenter/v1/info url script-request-header https://raw.githubusercontent.com/leafxcy/JavaScript/main/blackUnique.js +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 = *.chuxingyouhui.com + +*/ + +const jsname = '全球购骑士特权' +const $ = Env(jsname) +const notifyFlag = 1; //0为关闭通知,1为打开通知,默认为1 +const logDebug = 0 + +//const notify = $.isNode() ? require('./sendNotify') : ''; +let notifyStr = '' + +let blankJSON = {"black-token":"", "token":"", "User-Agent":"", "device-value":"", "device-type":"", "phpUserId":"", "appId":""} +let blackJSONStr = ($.isNode() ? (process.env.blackJSON) : ($.getval('blackJSON'))) || '' +let blackJSON = blackJSONStr ? JSON.parse(blackJSONStr) : blankJSON + +let reqTime = '' +let userSign = '' +let redPacketId = '' +let fruitId = '' +let userFruitId = '' +let activityId = '' +let redPacketCount = 0 +let waterCount = 0 +let fertilizerCount = 0 +let clickTreeTimes = 5 +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提现需要关注微信公众号,在公众号里申请提现') + + await querySignStatus() + + await listUserTask() + + //await listRedPacket() + + await queryPiggyInfo() + + //翻卡看视频需要前置条件 + //await getUserFlopRecord() + + await userFruitDetail() + + await waterTaskList() + + await nutrientTaskList() + + await userFertilizerDetail() + + await getTreeCoupon() + + await userInfo() + + 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 getRewrite() +{ + if($request.url.indexOf("userCenter/v1/info") > -1) { + if($request.headers['black-token']) { + blackJSON['black-token'] = $request.headers['black-token'] + $.log(`获取到black-token: ${blackJSON['black-token']}`) + $.msg(`获取到black-token: ${blackJSON['black-token']}`) + } + if($request.headers['token']) { + blackJSON['token'] = $request.headers['token'] + $.log(`获取到token: ${blackJSON['token']}`) + $.msg(`获取到token: ${blackJSON['token']}`) + } + if($request.headers['User-Agent']) { + blackJSON['User-Agent'] = $request.headers['User-Agent'] + $.log(`获取到User-Agent: ${blackJSON['User-Agent']}`) + $.msg(`获取到User-Agent: ${blackJSON['User-Agent']}`) + } + if($request.headers['device-value']) { + blackJSON['device-value'] = $request.headers['device-value'] + $.log(`获取到device-value: ${blackJSON['device-value']}`) + $.msg(`获取到device-value: ${blackJSON['device-value']}`) + } + if($request.headers['device-type']) { + blackJSON['device-type'] = $request.headers['device-type'] + $.log(`获取到device-type: ${blackJSON['device-type']}`) + $.msg(`获取到device-type: ${blackJSON['device-type']}`) + } + if($request.headers['phpUserId']) { + blackJSON['phpUserId'] = $request.headers['phpUserId'] + $.log(`获取到phpUserId: ${blackJSON['phpUserId']}`) + $.msg(`获取到phpUserId: ${blackJSON['phpUserId']}`) + } + $.setdata(JSON.stringify(blackJSON),'blackJSON') + } + + if($request.url.indexOf("mqq/api/indexTopInfo?appId=") > -1) { + blackJSON['appId'] = $request.url.match(/appId=([\w]+)/)[1] + $.log(`获取到appId: ${blackJSON['appId']}`) + $.msg(`获取到appId: ${blackJSON['appId']}`) + $.setdata(JSON.stringify(blackJSON),'blackJSON') + } +} + +async function checkEnv() +{ + if(!blackJSON['black-token'] || !blackJSON['token'] || !blackJSON['User-Agent'] || !blackJSON['device-value'] || !blackJSON['device-type'] || !blackJSON['phpUserId'] || !blackJSON['appId']) + { + $.log(`捉包信息不全,请检查空白字段并重新捉包: ${JSON.stringify(blackJSON)}\n`) + $.msg(`捉包信息不全,请检查空白字段并重新捉包: ${JSON.stringify(blackJSON)}\n`) + return false + } + + 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' : blackJSON['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackJSON['User-Agent'], + 'black-token' : blackJSON['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='+blackJSON['appId'], + headers: { + 'Host' : 'market.chuxingyouhui.com', + 'Origin' : 'https://m.black-unique.com', + 'Accept-Encoding' : 'gzip, deflate, br', + 'Connection' : 'keep-alive', + 'black-token' : blackJSON['black-token'], + 'Accept' : 'application/json, text/plain, */*', + 'User-Agent' : blackJSON['User-Agent'], + 'Referer' : 'https://m.black-unique.com/', + 'token' : blackJSON['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='+blackJSON['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' : blackJSON['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackJSON['User-Agent'], + 'black-token' : blackJSON['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' : blackJSON['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackJSON['User-Agent'], + 'black-token' : blackJSON['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' : blackJSON['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackJSON['User-Agent'], + 'black-token' : blackJSON['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='+blackJSON['appId'], + headers: { + 'Host' : 'market.chuxingyouhui.com', + 'Origin' : 'https://m.black-unique.com', + 'Accept-Encoding' : 'gzip, deflate, br', + 'Connection' : 'keep-alive', + 'black-token' : blackJSON['black-token'], + 'Accept' : 'application/json, text/plain, */*', + 'User-Agent' : blackJSON['User-Agent'], + 'Referer' : 'https://m.black-unique.com/', + 'token' : blackJSON['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 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":"${blackJSON['appId']}"}` + 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' : blackJSON['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackJSON['User-Agent'], + 'black-token' : blackJSON['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":"${blackJSON['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' : blackJSON['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackJSON['User-Agent'], + 'black-token' : blackJSON['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' : blackJSON['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackJSON['User-Agent'], + 'black-token' : blackJSON['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', + 'phpUserId' : blackJSON['phpUserId'], + 'device-value' : blackJSON['device-value'], + 'device-type' : blackJSON['device-type'], + 'Accept-Language' : 'zh-CN,zh-Hans;q=0.9', + 'newcomer' : 'true', + 'Accept-Encoding' : 'gzip, deflate, br', + 'token' : blackJSON['token'], + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackJSON['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, */*', + 'phpUserId' : blackJSON['phpUserId'], + 'device-value' : blackJSON['device-value'], + 'ymd' : '0', + 'device-type' : blackJSON['device-type'], + 'newcomer' : 'true', + 'token' : blackJSON['token'], + 'Accept-Language' : 'zh-CN,zh-Hans;q=0.9', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackJSON['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, */*', + 'phpUserId' : blackJSON['phpUserId'], + 'device-value' : blackJSON['device-value'], + 'device-type' : blackJSON['device-type'], + 'Accept-Language' : 'zh-CN,zh-Hans;q=0.9', + 'token' : blackJSON['token'], + 'Accept-Encoding' : 'gzip, deflate, br', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackJSON['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":"${blackJSON['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' : blackJSON['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackJSON['User-Agent'], + 'black-token' : blackJSON['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":"${blackJSON['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' : blackJSON['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackJSON['User-Agent'], + 'black-token' : blackJSON['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' : blackJSON['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackJSON['User-Agent'], + 'black-token' : blackJSON['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' : blackJSON['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackJSON['User-Agent'], + 'black-token' : blackJSON['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' : blackJSON['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackJSON['User-Agent'], + 'black-token' : blackJSON['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' : blackJSON['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackJSON['User-Agent'], + 'black-token' : blackJSON['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' : blackJSON['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackJSON['User-Agent'], + 'black-token' : blackJSON['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' : blackJSON['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackJSON['User-Agent'], + 'black-token' : blackJSON['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' : blackJSON['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackJSON['User-Agent'], + 'black-token' : blackJSON['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' : blackJSON['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackJSON['User-Agent'], + 'black-token' : blackJSON['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' : blackJSON['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackJSON['User-Agent'], + 'black-token' : blackJSON['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":"${blackJSON['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' : blackJSON['token'], + 'Content-Type' : 'application/json;charset=utf-8', + 'Origin' : 'https://m.black-unique.com', + 'User-Agent' : blackJSON['User-Agent'], + 'black-token' : blackJSON['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}`) + } + await $.wait(1000) + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +//查询账户信息 +async function userInfo() { + console.log(`\n========= 账户信息 =========`) + notifyStr += `========= 账户信息 =========\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' : '*/*', + 'phpUserId' : blackJSON['phpUserId'], + 'device-value' : blackJSON['device-value'], + 'device-type' : blackJSON['device-type'], + 'Accept-Language' : 'zh-Hans-CN;q=1', + 'token' : blackJSON['token'], + 'User-Agent' : blackJSON['User-Agent'], + 'black-token' : blackJSON['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.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='+blackJSON['appId'], + headers: { + 'Host' : 'market.chuxingyouhui.com', + 'Origin' : 'https://m.black-unique.com', + 'Accept-Encoding' : 'gzip, deflate, br', + 'Connection' : 'keep-alive', + 'black-token' : blackJSON['black-token'], + 'Accept' : 'application/json, text/plain, */*', + 'User-Agent' : blackJSON['User-Agent'], + 'Referer' : 'https://m.black-unique.com/', + 'token' : blackJSON['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}`) + notifyStr += `【勋章余额】:${result.data.score}\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..1647ce7 --- /dev/null +++ b/daw.js @@ -0,0 +1,884 @@ +/* +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 + +炒个冷饭,之前有几位大佬已经写过了 +现在支持了苹果和安卓双端的任务,两边账户分红币独立,理论上收益可以翻倍,每天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] +#都爱玩 +15 0,1,8,15,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 coinStatus = [] + +let maxTryNum = 12 +let waitTime = 0 +let allCompFlag = 0 + +let channelIdx = 0 +let channel = ['dawbox','dawbox-android'] +let channelStr = ['苹果端','安卓端'] + +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(`找到${numBoxbody}个账户,脚本会同时做IOS和安卓端任务\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 = 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查询信息失败:${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(`完成任务【${taskItem.title}】,领取DAB币成功`) + } else { + console.log(`完成任务【${taskItem.title}】失败:${result.error}`) + if(result.error.indexOf('当前仓库已存满') > -1) { + let idx = channelIdx*numBoxbody+userIdx + if(coinStatus[idx] == 1) { + console.log(`仓库已存满,尝试先投入分红池`) + coinStatus[idx] = 2 + await $.wait(100) + await QueryCoinInfo(0) + } else if(coinStatus[idx] == 2) { + console.log(`仓库已存满,且无法投入分红池,此用户暂时不再做任务`) + } + } + } +} + +//转盘次数查询 +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(`\n获取转盘次数失败:${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(`看视频获得了一次抽奖机会`) + await $.wait(100) + waitTime -= 100 + await Turntable(taskItem) + } else { + console.log(`看视频得抽奖机会失败:${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(`抽奖成功,获得了${reward}`) + await $.wait(100) + waitTime -= 100 + await ReceiveTurntable(taskItem) + } else { + console.log(`抽奖失败:${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(`看视频获得抽奖翻倍奖励成功`) + } else { + console.log(`看视频获得抽奖翻倍奖励失败:${result.error}`) + if(result.error.indexOf('当前仓库已存满') > -1) { + let idx = channelIdx*numBoxbody+userIdx + if(coinStatus[idx] == 1) { + console.log(`仓库已存满,尝试先投入分红池`) + coinStatus[idx] = 2 + await $.wait(100) + await QueryCoinInfo(0) + } else if(coinStatus[idx] == 2) { + console.log(`仓库已存满,且无法投入分红池,此用户暂时不再做任务`) + } + } + } +} + +//瓜分池投入 +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(`投入瓜分池${num}币成功`) + notifyStr += `投入瓜分池${num}币成功\n` + coinStatus[channelIdx*numBoxbody+userIdx] = 1 + } else { + console.log(`投入瓜分池${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(`\n今日已签到`) + } + } else { + console.log(`\n获取签到信息失败:${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(`\n签到成功,获得${result.data.total_credit_num}积分`) + } else { + console.log(`\n签到失败:${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(`\n获取积分红包兑换列表失败:${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(`兑换【${exchangeItem.title}】成功`) + } else { + console.log(`兑换【${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 + let is_bind_alipay = result.data.is_bind_alipay ? result.data.is_bind_alipay : 0 + let is_bind_wechat = result.data.is_bind_wechat ? result.data.is_bind_wechat : 0 + let payType = '' + if(is_bind_alipay==1) payType += ' 支付宝' + if(is_bind_wechat==1) payType += ' 微信' + if(!payType) payType += '无' + console.log(`\n积分红包余额:${result.data.money},已绑定支付方式:${payType}`) + let withList = [] + if(result.data.withdraw_config && Array.isArray(result.data.withdraw_config)) { + for(let i=0; i= withItem.money) { + withList.push(withItem) + } + } + if(withList.length == 0) { + console.log(`积分红包余额不足,暂时无法提现`) + return + } + let sortList = withList.sort(function(a,b){return b["money"]-a["money"]}); + for(let i=0; i 0.5 && is_bind_wechat == 1 && withItem.is_wechat == 1) { + await $.wait(100) + if(await WithdrawBox(withItem,1)) break; + } else if(withItem.money > 0.5 && is_bind_alipay == 1 && withItem.is_alipay == 1) { + await $.wait(100) + if(await WithdrawBox(withItem,0)) break; + } + } + } else { + console.log(`获取积分红包提现列表失败`) + } + } else { + console.log(`\n获取积分红包提现列表失败:${result.error}`) + } +} + +//积分红包提现 +async function WithdrawBox(withItem,pay_type) { + let caller = PrintCaller() + let url = `https://v3.sdk.haowusong.com/api/box/withdraw/platform/apply?config_id=${withItem.id}&channel=${channel[channelIdx]}&pay_type=${pay_type}` + let urlObject = PopulateGetUrl(url) + await HttpPost(urlObject,caller) + let result = httpResult; + if(!result) { + console.log(`提现积分红包${withItem.money}元失败:服务器无响应`) + return false + } + + if(result.code == 200) { + console.log(`提现积分红包${withItem.money}元成功`) + notifyStr += `提现积分红包${withItem.money}元成功\n` + return true + } else { + console.log(`提现积分红包${withItem.money}元失败:${result.error}`) + if(result.error.indexOf('今日提现次数超出限制') > -1) { + return true + } + } + return false +} + +//分红提现列表查询 +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 + let is_bind_alipay = result.data.is_bind_alipay ? result.data.is_bind_alipay : 0 + let is_bind_wechat = result.data.is_bind_wechat ? result.data.is_bind_wechat : 0 + let payType = '' + if(is_bind_alipay==1) payType += ' 支付宝' + if(is_bind_wechat==1) payType += ' 微信' + if(!payType) payType += '无' + console.log(`\n分红余额:${result.data.money},已绑定支付方式:${payType}`) + let withList = [] + if(result.data.withdraw_config && Array.isArray(result.data.withdraw_config)) { + for(let i=0; i= withItem.money) { + withList.push(withItem) + } + } + if(withList.length == 0) { + console.log(`分红余额不足,暂时无法提现`) + return + } + let sortList = withList.sort(function(a,b){return b["money"]-a["money"]}); + for(let i=0; i -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_kkz_pro.js b/jckd/jckd_kkz_pro.js new file mode 100644 index 0000000..8f4d35a --- /dev/null +++ b/jckd/jckd_kkz_pro.js @@ -0,0 +1,12 @@ +/* +安卓:晶彩看点看看赚 + + +不需要捉看看赚body,只需要用到jckdCookie +目前只能在青龙上使用,需要依赖crypto-js,报错找不到依赖的自行安装 +docker exec -it qinglong bash -c "npm install -g crypto-js" +本脚本没有设置重写,可以自己复制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 _0x5c69c5=_0x2f07;(function(_0x34367c,_0xbc89a0){const _0x215f5e=_0x2f07,_0xd8c5b5=_0x34367c();while(!![]){try{const _0x4829f6=-parseInt(_0x215f5e(0x192))/0x1*(parseInt(_0x215f5e(0x112))/0x2)+parseInt(_0x215f5e(0x17e))/0x3+-parseInt(_0x215f5e(0xec))/0x4+parseInt(_0x215f5e(0x125))/0x5+-parseInt(_0x215f5e(0x118))/0x6+-parseInt(_0x215f5e(0xea))/0x7*(-parseInt(_0x215f5e(0x184))/0x8)+parseInt(_0x215f5e(0xe1))/0x9;if(_0x4829f6===_0xbc89a0)break;else _0xd8c5b5['push'](_0xd8c5b5['shift']());}catch(_0x920ae4){_0xd8c5b5['push'](_0xd8c5b5['shift']());}}}(_0x1cb9,0x9bb1c));const jsname=_0x5c69c5(0x10a),$=Env(jsname),notifyFlag=0x1,logDebug=0x0;function _0x1cb9(){const _0x322588=['isNeedRewrite','enc','message','status','exec','Pkcs7','isArray','score',':\x20服务器访问数据为空,请检查自身设备网络情况','cwd','app_name=zqkd_app&app_version=8.1.2&carrier=CMCC&channel=c1025&device_brand=HUAWEI&device_id=52373059&device_model=VOG-AL10&device_platform=android&device_type=android&dpi=240&inner_version=202107191702&language=zh-CN&memory=3&mi=0&mobile_type=1&net_type=1&network_type=WIFI&openudid=711ca30d9d3c10b7&os_api=25&os_version=VOG-AL10-user+7.1.2+HUAWEIVOG-AL10+701210917+release-keys&request_time=1637254870&resolution=720x1280&rom_version=VOG-AL10-user+7.1.2+HUAWEIVOG-AL10+701210917+release-keys&s_ad=bCWzFwAroTSg%3Dfe_DBg8kI4A4y8pzYcRAfWk86lGAgTmFju&s_im=dWRHEiWXZdUk%3D_ubVImAPVLuSMaK89fv7WA%3D%3D&sm_device_id=20211112123533c490f279d26a934ca445950324c9601a01419a1241729573&storage=61.39&','url','ant.xunsl.com','查询到','--完成第','Cookie','null','.$1','slice','isMute','error_code','abs','Function\x20','lodash_set','redirect','CBC','object','完成看看赚[id:','setCookieSync','&sign=4678cdd5513160e635326b33c05','initGotEnv','http','done','encrypt','lodash_get','http://','assign','运行通知\x0a\x0a','cookie_id=','runScript','test','mediaUrl','resolve','msg','method','match','success','startTime','Content-Length','POST','see_num','完成看看赚任务失败:','setdata','comtele_state','getMilliseconds','substr','toString','decrypt','valueForKey','的ck','set-cookie','&version_code=800&zqkey=','join','time','push','box.dat','opts','setjson','name','轮阅读,随机等待','got','undefined','Utf8','cookie=','@chavy_boxjs_userCfgs.httpapi_timeout','VOG-AL10','replace','138414ZCZJlX','keep-alive','post','concat','共找到','timeout','19744ZkwSKs','exports','getHours','Base64','logErr','trim','length','writedata','read','stringify','floor','@chavy_boxjs_userCfgs.httpapi','read_num','loaddata','471766JZdqYc','application/x-www-form-urlencoded','call','reduce','getDate','],阅读','path','charAt','所有用户开始一起做看看赚任务[id:','未找到jckdCookie','ciphertext','map','logs','阅读看看赚文章失败:','headers','random','log',':\x20post请求失败','env','logSeparator','zqkey_id=','getMinutes','--完成最后一轮阅读','==============📣系统通知📣==============',',\x20结束!\x20🕛\x20','cron','isQuanX','writeFileSync','items','toObj','*/*','data',',\x20开始!','jckdCookie','pad','11060811cyvHhH','indexOf','get','CookieJar','个用户','getTime','个有效看看赚任务','getFullYear','dataFile','693cXsrdn','write','3412316CkgkKL','getSeconds','parse',':\x20此脚本不做重写,请检查重写设置','send','isSurge','&zqkey_id=','readFileSync','https://ant.xunsl.com/v5/nameless/adlickstart.json','isNode','getMonth','Hex','split','ckjar','fetch','/v1/scripting/evaluate',':\x20get请求失败',':\x20未知错误','y82','qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM','DES','https://ant.xunsl.com/v5/nameless/adlickend.json','open-url','--用户','cookieJar','],还需阅读','body','banner_id','setValueForKey','wait','晶彩看点看看赚','getdata','tough-cookie','string','statusCode','GET','getjson','getScript','4lQHeSG','p=S1HH-fn083Io%3D','Og3','zqkey=','existsSync','已完成看看赚[id:','1924584wlUlsd','media-url','未找到有效的jckdCookie','then','catch',',\x20错误!','cktough','未完成看看赚[id:','android','uid=',']任务,获得','getval','https://ant.xunsl.com/v5/nameless/bannerstatus.json','6178250DWHBOL','Content-Type','crypto-js','toStr','非法请求,请检查用户','stack','setval','&task_id=','openUrl','finally','isLoon','mode'];_0x1cb9=function(){return _0x322588;};return _0x1cb9();}let notifyStr='',rndtime='',httpResult,CryptoJS=require(_0x5c69c5(0x127)),jckdCookie=($[_0x5c69c5(0xf5)]()?process[_0x5c69c5(0xd0)][_0x5c69c5(0xdf)]:$[_0x5c69c5(0x10b)](_0x5c69c5(0xdf)))||'',jckdCookieArr=[],kkzBodyArr=[],userIdx=0x0,allCompFlag=0x0,restNum=0x0,idStart=0x2710,idEnd=0x283c,validList=[],preBody=_0x5c69c5(0x113),bodyTemplate=_0x5c69c5(0x13b),fakeSign=_0x5c69c5(0x14e),a=_0x5c69c5(0x114),b=_0x5c69c5(0xfe),c='KE',key=a+b+c;!(async()=>{const _0x1a776a=_0x5c69c5;if(typeof $request!==_0x1a776a(0x178))$[_0x1a776a(0x15c)](jsname+_0x1a776a(0xef));else{if(!await checkEnv())return;await runLookStart(),await getStat();}})()[_0x5c69c5(0x11c)](_0x465398=>$[_0x5c69c5(0x188)](_0x465398))[_0x5c69c5(0x12e)](()=>$[_0x5c69c5(0x151)]());async function showmsg(){const _0xbce991=_0x5c69c5;notifyBody=jsname+_0xbce991(0x156)+notifyStr,notifyFlag!=0x1&&console[_0xbce991(0xce)](notifyBody),notifyFlag==0x1&&$[_0xbce991(0x15c)](notifyBody);}async function checkEnv(){const _0x4b6eec=_0x5c69c5;if(jckdCookie){if(jckdCookie[_0x4b6eec(0xe2)]('@')>-0x1){let _0x33bc74=jckdCookie[_0x4b6eec(0xf8)]('@');for(let _0x54aaf0=0x0;_0x54aaf0<_0x33bc74[_0x4b6eec(0x18a)];_0x54aaf0++){jckdCookieArr[_0x4b6eec(0x171)](replaceCookie(_0x33bc74[_0x54aaf0])),validList[_0x4b6eec(0x171)](0x0);}}else jckdCookieArr[_0x4b6eec(0x171)](replaceCookie(jckdCookie)),validList[_0x4b6eec(0x171)](0x0);}else return console[_0x4b6eec(0xce)](_0x4b6eec(0x19b)),![];if(jckdCookieArr[_0x4b6eec(0x18a)]==0x0)return console[_0x4b6eec(0xce)](_0x4b6eec(0x11a)),![];return console[_0x4b6eec(0xce)](_0x4b6eec(0x182)+jckdCookieArr[_0x4b6eec(0x18a)]+_0x4b6eec(0xe5)),!![];}function replaceCookie(_0x23e3b9){const _0x16a47c=_0x5c69c5;let _0x4458f0='',_0x57c302='',_0x533817='';if(_0x23e3b9[_0x16a47c(0xe2)](_0x16a47c(0x115))>-0x1)_0x57c302=_0x23e3b9[_0x16a47c(0x15e)](/zqkey=([\w-]+)/)[0x1];else _0x23e3b9[_0x16a47c(0xe2)](_0x16a47c(0x17a))>-0x1&&(_0x57c302=_0x23e3b9[_0x16a47c(0x15e)](/cookie=([\w-]+)/)[0x1]);if(_0x23e3b9[_0x16a47c(0xe2)](_0x16a47c(0xd2))>-0x1)_0x533817=_0x23e3b9[_0x16a47c(0x15e)](/zqkey_id=([\w-]+)/)[0x1];else _0x23e3b9[_0x16a47c(0xe2)](_0x16a47c(0x157))>-0x1&&(_0x533817=_0x23e3b9[_0x16a47c(0x15e)](/cookie_id=([\w-]+)/)[0x1]);return _0x23e3b9[_0x16a47c(0xe2)](_0x16a47c(0x121))>-0x1&&(uid=_0x23e3b9[_0x16a47c(0x15e)](/uid=([\w-]+)/)[0x1]),_0x4458f0=_0x16a47c(0x121)+uid+_0x16a47c(0x16e)+_0x57c302+_0x16a47c(0xf2)+_0x533817,_0x4458f0;}async function encodeUserBody(_0x371ec8,_0x1046df){const _0x1a90e0=_0x5c69c5;return replacedStr=bodyTemplate+(_0x1a90e0(0x12c)+_0x1046df+'&')+jckdCookieArr[_0x371ec8]+fakeSign,encodeBody=EncFunc(replacedStr),hexBody=CryptoJS[_0x1a90e0(0x132)][_0x1a90e0(0xf7)][_0x1a90e0(0xee)](encodeBody),base64Body=CryptoJS[_0x1a90e0(0x132)][_0x1a90e0(0x187)][_0x1a90e0(0x18d)](hexBody),replaceBody3=base64Body[_0x1a90e0(0x17d)](/\+/g,'-'),replaceBody4=replaceBody3[_0x1a90e0(0x17d)](/\//g,'_'),finalBody=encodeURIComponent(replaceBody4),finalBody=preBody+finalBody+randomString(0x0),finalBody;}async function runLookStart(){const _0x37124a=_0x5c69c5;for(let _0x45bfe6=idStart;_0x45bfe6restNum?_0x3501d7:restNum,console[_0x49d0a0(0xce)]('用户'+(userIdx+0x1)+_0x49d0a0(0x11f)+_0x398f58+_0x49d0a0(0x105)+_0x3501d7+'次');}else kkzCompArr[_0x49d0a0(0x171)](0x0),console[_0x49d0a0(0xce)]('用户'+(userIdx+0x1)+_0x49d0a0(0x117)+_0x398f58+']');}else{kkzCompArr[_0x49d0a0(0x171)](0x0);if(_0x19435d[_0x49d0a0(0x145)]==0x30d41)console[_0x49d0a0(0xce)](_0x49d0a0(0x129)+(userIdx+0x1)+_0x49d0a0(0x16c));return![];}return!![];}async function readLookStartArt(_0x52eb10){const _0x38ccdd=_0x5c69c5;let _0x22159e=printCaller(),_0x66fe15=_0x38ccdd(0x124),_0x45606c=populatePostUrl(_0x66fe15,_0x52eb10);await httpPost(_0x45606c,_0x22159e);let _0x4fc034=httpResult;if(!_0x4fc034)return;_0x4fc034[_0x38ccdd(0x15f)]!=!![]&&console[_0x38ccdd(0xce)](_0x38ccdd(0x103)+(userIdx+0x1)+_0x38ccdd(0x19f)+_0x4fc034[_0x38ccdd(0x133)]);}async function adlickend(_0x537a0f){const _0x28ea9e=_0x5c69c5;let _0x33cfba=printCaller(),_0x288890=_0x28ea9e(0x101),_0x4dd4e9=populatePostUrl(_0x288890,_0x537a0f);await httpPost(_0x4dd4e9,_0x33cfba);let _0x43f3bf=httpResult;if(!_0x43f3bf)return;_0x43f3bf[_0x28ea9e(0x15f)]==!![]?console[_0x28ea9e(0xce)]('用户'+(userIdx+0x1)+_0x28ea9e(0x14c)+_0x43f3bf[_0x28ea9e(0xda)][_0x28ea9e(0x107)]+_0x28ea9e(0x122)+_0x43f3bf[_0x28ea9e(0xda)][_0x28ea9e(0x138)]+'金币'):console[_0x28ea9e(0xce)]('用户'+(userIdx+0x1)+_0x28ea9e(0x164)+_0x43f3bf[_0x28ea9e(0x133)]);}function populatePostUrl(_0x578d1c,_0x863cf){const _0x1aeed9=_0x5c69c5;let _0x44d19b=Math[_0x1aeed9(0x18e)](new Date()[_0x1aeed9(0xe6)]()/0x3e8),_0x57280a={'url':_0x578d1c,'headers':{'request_time':_0x44d19b,'Host':_0x1aeed9(0x13d),'device-model':_0x1aeed9(0x17c),'device-platform':_0x1aeed9(0x120),'Connection':_0x1aeed9(0x17f)},'body':_0x863cf};return _0x57280a;}function populateGetUrl(_0x4cfa97){const _0x3a7964=_0x5c69c5;let _0x3b1ff0=Math[_0x3a7964(0x18e)](new Date()[_0x3a7964(0xe6)]()/0x3e8),_0x4f025d={'url':_0x4cfa97,'headers':{'request_time':_0x3b1ff0,'Host':_0x3a7964(0x13d),'device-model':_0x3a7964(0x17c),'device-platform':_0x3a7964(0x120),'Connection':_0x3a7964(0x17f)}};return _0x4f025d;}async function httpPost(_0x190a66,_0x207a42){return httpResult=null,new Promise(_0x1c7dde=>{const _0x46914a=_0x2f07;$[_0x46914a(0x180)](_0x190a66,async(_0x2b1974,_0x37fd8d,_0x3b8377)=>{const _0x14c3c1=_0x46914a;try{if(_0x2b1974)console[_0x14c3c1(0xce)](_0x207a42+_0x14c3c1(0xcf)),console[_0x14c3c1(0xce)](JSON[_0x14c3c1(0x18d)](_0x2b1974)),$[_0x14c3c1(0x188)](_0x2b1974);else{if(safeGet(_0x3b8377)){httpResult=JSON[_0x14c3c1(0xee)](_0x3b8377,_0x207a42);if(logDebug)console[_0x14c3c1(0xce)](httpResult);}}}catch(_0x570467){$[_0x14c3c1(0x188)](_0x570467,_0x37fd8d);}finally{_0x1c7dde();}});});}async function httpGet(_0x5f24c2,_0x1ce229){return httpResult=null,new Promise(_0x3d1d6e=>{const _0x567fc6=_0x2f07;$[_0x567fc6(0xe3)](_0x5f24c2,async(_0x39e52d,_0x280a33,_0x28e962)=>{const _0x211a1a=_0x567fc6;try{if(_0x39e52d)console[_0x211a1a(0xce)](_0x1ce229+_0x211a1a(0xfc)),console[_0x211a1a(0xce)](JSON[_0x211a1a(0x18d)](_0x39e52d)),$[_0x211a1a(0x188)](_0x39e52d);else{if(safeGet(_0x28e962,_0x1ce229)){httpResult=JSON[_0x211a1a(0xee)](_0x28e962);if(logDebug)console[_0x211a1a(0xce)](httpResult);}}}catch(_0x5332e2){$[_0x211a1a(0x188)](_0x5332e2,_0x280a33);}finally{_0x3d1d6e();}});});}function safeGet(_0x554ba4,_0x1988e0){const _0x193383=_0x5c69c5;try{if(typeof JSON[_0x193383(0xee)](_0x554ba4)==_0x193383(0x14b))return!![];else console[_0x193383(0xce)](_0x193383(0x147)+_0x1988e0+_0x193383(0xfd)),console[_0x193383(0xce)](_0x554ba4);}catch(_0x3203fc){return console[_0x193383(0xce)](_0x3203fc),console[_0x193383(0xce)](_0x193383(0x147)+_0x1988e0+_0x193383(0x139)),![];}}function printCaller(){const _0x47c4f7=_0x5c69c5;return new Error()[_0x47c4f7(0x12a)][_0x47c4f7(0xf8)]('\x0a')[0x2][_0x47c4f7(0x189)]()[_0x47c4f7(0xf8)]('\x20')[0x1];}function EncFunc(_0x1d9822){const _0x3173d4=_0x5c69c5;var _0x293431=CryptoJS[_0x3173d4(0x132)][_0x3173d4(0x179)][_0x3173d4(0xee)](key),_0x3a7ae5=CryptoJS[_0x3173d4(0x132)][_0x3173d4(0x179)][_0x3173d4(0xee)](key),_0x5a6fe1=CryptoJS[_0x3173d4(0x132)][_0x3173d4(0x179)][_0x3173d4(0xee)](_0x1d9822);return encrypted=CryptoJS[_0x3173d4(0x100)][_0x3173d4(0x152)](_0x5a6fe1,_0x293431,{'iv':_0x3a7ae5,'mode':CryptoJS[_0x3173d4(0x130)][_0x3173d4(0x14a)],'padding':CryptoJS[_0x3173d4(0xe0)][_0x3173d4(0x136)]}),encrypted[_0x3173d4(0x19c)][_0x3173d4(0x169)]();}function DecFunc(_0x16cf95){const _0x1fd603=_0x5c69c5;var _0x457762=CryptoJS[_0x1fd603(0x132)][_0x1fd603(0x179)][_0x1fd603(0xee)](key),_0x1fda07=CryptoJS[_0x1fd603(0x132)][_0x1fd603(0x179)][_0x1fd603(0xee)](key),_0x26ff4d=CryptoJS[_0x1fd603(0x100)][_0x1fd603(0x16a)]({'ciphertext':CryptoJS[_0x1fd603(0x132)][_0x1fd603(0x187)][_0x1fd603(0xee)](_0x16cf95)},_0x457762,{'iv':_0x1fda07,'mode':CryptoJS[_0x1fd603(0x130)][_0x1fd603(0x14a)],'padding':CryptoJS[_0x1fd603(0xe0)][_0x1fd603(0x136)]});return _0x26ff4d[_0x1fd603(0x169)](CryptoJS[_0x1fd603(0x132)][_0x1fd603(0x179)]);}function randomString(_0xb1fe67=0xc){const _0x3e02aa=_0x5c69c5;let _0xfa333c=_0x3e02aa(0xff),_0x2cc502=_0xfa333c[_0x3e02aa(0x18a)],_0x1b6130='';for(i=0x0;i<_0xb1fe67;i++){_0x1b6130+=_0xfa333c[_0x3e02aa(0x199)](Math[_0x3e02aa(0x18e)](Math[_0x3e02aa(0xcd)]()*_0x2cc502));}return _0x1b6130;}function Env(_0x83dfc1,_0xfac52c){const _0x169c5d=_0x5c69c5;class _0x4bd5f0{constructor(_0x22e1b4){const _0x237a6c=_0x2f07;this[_0x237a6c(0xd0)]=_0x22e1b4;}[_0x169c5d(0xf0)](_0xb74efc,_0x1dc719=_0x169c5d(0x10f)){const _0x423543=_0x169c5d;_0xb74efc=_0x423543(0x10d)==typeof _0xb74efc?{'url':_0xb74efc}:_0xb74efc;let _0x1f6f97=this[_0x423543(0xe3)];return _0x423543(0x162)===_0x1dc719&&(_0x1f6f97=this[_0x423543(0x180)]),new Promise((_0x45fa01,_0x13eee4)=>{const _0x5957d1=_0x423543;_0x1f6f97[_0x5957d1(0x194)](this,_0xb74efc,(_0x3df7c0,_0x5a8695,_0x2be6fc)=>{_0x3df7c0?_0x13eee4(_0x3df7c0):_0x45fa01(_0x5a8695);});});}[_0x169c5d(0xe3)](_0x546581){const _0x573eed=_0x169c5d;return this[_0x573eed(0xf0)][_0x573eed(0x194)](this[_0x573eed(0xd0)],_0x546581);}[_0x169c5d(0x180)](_0x25eb22){const _0x37eeb8=_0x169c5d;return this[_0x37eeb8(0xf0)][_0x37eeb8(0x194)](this[_0x37eeb8(0xd0)],_0x25eb22,_0x37eeb8(0x162));}}return new class{constructor(_0x4d9e90,_0x200899){const _0x1a91db=_0x169c5d;this[_0x1a91db(0x175)]=_0x4d9e90,this[_0x1a91db(0x150)]=new _0x4bd5f0(this),this[_0x1a91db(0xdd)]=null,this[_0x1a91db(0xe9)]=_0x1a91db(0x172),this[_0x1a91db(0x19e)]=[],this[_0x1a91db(0x144)]=!0x1,this[_0x1a91db(0x131)]=!0x1,this[_0x1a91db(0xd1)]='\x0a',this[_0x1a91db(0x160)]=new Date()[_0x1a91db(0xe6)](),Object[_0x1a91db(0x155)](this,_0x200899),this[_0x1a91db(0xce)]('','🔔'+this[_0x1a91db(0x175)]+_0x1a91db(0xde));}[_0x169c5d(0xf5)](){const _0x19e27a=_0x169c5d;return _0x19e27a(0x178)!=typeof module&&!!module[_0x19e27a(0x185)];}[_0x169c5d(0xd8)](){const _0x3ddae0=_0x169c5d;return _0x3ddae0(0x178)!=typeof $task;}[_0x169c5d(0xf1)](){const _0x3b89b8=_0x169c5d;return _0x3b89b8(0x178)!=typeof $httpClient&&_0x3b89b8(0x178)==typeof $loon;}[_0x169c5d(0x12f)](){const _0x3e37d0=_0x169c5d;return _0x3e37d0(0x178)!=typeof $loon;}[_0x169c5d(0xdb)](_0x1b351a,_0x42e99c=null){const _0x378d8a=_0x169c5d;try{return JSON[_0x378d8a(0xee)](_0x1b351a);}catch{return _0x42e99c;}}[_0x169c5d(0x128)](_0xee9585,_0x5dc468=null){const _0x1a3977=_0x169c5d;try{return JSON[_0x1a3977(0x18d)](_0xee9585);}catch{return _0x5dc468;}}[_0x169c5d(0x110)](_0x33956a,_0x4c23fa){const _0x4e8a12=_0x169c5d;let _0x37c77f=_0x4c23fa;const _0x45330b=this[_0x4e8a12(0x10b)](_0x33956a);if(_0x45330b)try{_0x37c77f=JSON[_0x4e8a12(0xee)](this[_0x4e8a12(0x10b)](_0x33956a));}catch{}return _0x37c77f;}[_0x169c5d(0x174)](_0xbfac1b,_0x53aab4){const _0x506124=_0x169c5d;try{return this[_0x506124(0x165)](JSON[_0x506124(0x18d)](_0xbfac1b),_0x53aab4);}catch{return!0x1;}}[_0x169c5d(0x111)](_0x27f366){return new Promise(_0x1c9c11=>{const _0x3ecbad=_0x2f07;this[_0x3ecbad(0xe3)]({'url':_0x27f366},(_0x5a66c9,_0x32d0db,_0x39090b)=>_0x1c9c11(_0x39090b));});}[_0x169c5d(0x158)](_0x3b4338,_0x4e323f){const _0x35478f=_0x169c5d;return new Promise(_0x28220b=>{const _0x1ad9d2=_0x2f07;let _0x2cf588=this[_0x1ad9d2(0x10b)](_0x1ad9d2(0x18f));_0x2cf588=_0x2cf588?_0x2cf588[_0x1ad9d2(0x17d)](/\n/g,'')[_0x1ad9d2(0x189)]():_0x2cf588;let _0x47b433=this[_0x1ad9d2(0x10b)](_0x1ad9d2(0x17b));_0x47b433=_0x47b433?0x1*_0x47b433:0x14,_0x47b433=_0x4e323f&&_0x4e323f[_0x1ad9d2(0x183)]?_0x4e323f[_0x1ad9d2(0x183)]:_0x47b433;const [_0x322cbf,_0x1828ff]=_0x2cf588[_0x1ad9d2(0xf8)]('@'),_0x37b9d4={'url':_0x1ad9d2(0x154)+_0x1828ff+_0x1ad9d2(0xfb),'body':{'script_text':_0x3b4338,'mock_type':_0x1ad9d2(0xd7),'timeout':_0x47b433},'headers':{'X-Key':_0x322cbf,'Accept':_0x1ad9d2(0xdc)}};this[_0x1ad9d2(0x180)](_0x37b9d4,(_0x41122a,_0x1a315f,_0x6faa5d)=>_0x28220b(_0x6faa5d));})[_0x35478f(0x11c)](_0x202abe=>this[_0x35478f(0x188)](_0x202abe));}[_0x169c5d(0x191)](){const _0x23d9ab=_0x169c5d;if(!this[_0x23d9ab(0xf5)]())return{};{this['fs']=this['fs']?this['fs']:require('fs'),this[_0x23d9ab(0x198)]=this[_0x23d9ab(0x198)]?this[_0x23d9ab(0x198)]:require(_0x23d9ab(0x198));const _0x5484d0=this[_0x23d9ab(0x198)][_0x23d9ab(0x15b)](this[_0x23d9ab(0xe9)]),_0x1edff2=this[_0x23d9ab(0x198)][_0x23d9ab(0x15b)](process[_0x23d9ab(0x13a)](),this[_0x23d9ab(0xe9)]),_0x20ca56=this['fs'][_0x23d9ab(0x116)](_0x5484d0),_0xf7f288=!_0x20ca56&&this['fs'][_0x23d9ab(0x116)](_0x1edff2);if(!_0x20ca56&&!_0xf7f288)return{};{const _0x1225ae=_0x20ca56?_0x5484d0:_0x1edff2;try{return JSON[_0x23d9ab(0xee)](this['fs'][_0x23d9ab(0xf3)](_0x1225ae));}catch(_0x9c728c){return{};}}}}[_0x169c5d(0x18b)](){const _0x577c04=_0x169c5d;if(this[_0x577c04(0xf5)]()){this['fs']=this['fs']?this['fs']:require('fs'),this[_0x577c04(0x198)]=this[_0x577c04(0x198)]?this[_0x577c04(0x198)]:require(_0x577c04(0x198));const _0x3db0a5=this[_0x577c04(0x198)][_0x577c04(0x15b)](this[_0x577c04(0xe9)]),_0x4e98e9=this[_0x577c04(0x198)][_0x577c04(0x15b)](process[_0x577c04(0x13a)](),this[_0x577c04(0xe9)]),_0x3713bd=this['fs'][_0x577c04(0x116)](_0x3db0a5),_0x18c593=!_0x3713bd&&this['fs'][_0x577c04(0x116)](_0x4e98e9),_0xc90c75=JSON[_0x577c04(0x18d)](this[_0x577c04(0xdd)]);_0x3713bd?this['fs'][_0x577c04(0xd9)](_0x3db0a5,_0xc90c75):_0x18c593?this['fs'][_0x577c04(0xd9)](_0x4e98e9,_0xc90c75):this['fs'][_0x577c04(0xd9)](_0x3db0a5,_0xc90c75);}}[_0x169c5d(0x153)](_0xf0f381,_0x5e7c11,_0x4bfc9c){const _0x41647c=_0x169c5d,_0x1b0add=_0x5e7c11[_0x41647c(0x17d)](/\[(\d+)\]/g,_0x41647c(0x142))[_0x41647c(0xf8)]('.');let _0x5baf4d=_0xf0f381;for(const _0x3a2780 of _0x1b0add)if(_0x5baf4d=Object(_0x5baf4d)[_0x3a2780],void 0x0===_0x5baf4d)return _0x4bfc9c;return _0x5baf4d;}[_0x169c5d(0x148)](_0x2497cf,_0x3d94f6,_0xc7ea9b){const _0x1a171e=_0x169c5d;return Object(_0x2497cf)!==_0x2497cf?_0x2497cf:(Array[_0x1a171e(0x137)](_0x3d94f6)||(_0x3d94f6=_0x3d94f6[_0x1a171e(0x169)]()[_0x1a171e(0x15e)](/[^.[\]]+/g)||[]),_0x3d94f6[_0x1a171e(0x143)](0x0,-0x1)[_0x1a171e(0x195)]((_0x5e7841,_0x9f8cf8,_0x4a6204)=>Object(_0x5e7841[_0x9f8cf8])===_0x5e7841[_0x9f8cf8]?_0x5e7841[_0x9f8cf8]:_0x5e7841[_0x9f8cf8]=Math[_0x1a171e(0x146)](_0x3d94f6[_0x4a6204+0x1])>>0x0==+_0x3d94f6[_0x4a6204+0x1]?[]:{},_0x2497cf)[_0x3d94f6[_0x3d94f6[_0x1a171e(0x18a)]-0x1]]=_0xc7ea9b,_0x2497cf);}[_0x169c5d(0x10b)](_0x29232a){const _0x281e59=_0x169c5d;let _0x2ab288=this[_0x281e59(0x123)](_0x29232a);if(/^@/[_0x281e59(0x159)](_0x29232a)){const [,_0x412c7f,_0x54e346]=/^@(.*?)\.(.*?)$/[_0x281e59(0x135)](_0x29232a),_0x1646f1=_0x412c7f?this[_0x281e59(0x123)](_0x412c7f):'';if(_0x1646f1)try{const _0x28c2a7=JSON[_0x281e59(0xee)](_0x1646f1);_0x2ab288=_0x28c2a7?this[_0x281e59(0x153)](_0x28c2a7,_0x54e346,''):_0x2ab288;}catch(_0x1cd543){_0x2ab288='';}}return _0x2ab288;}[_0x169c5d(0x165)](_0x49b3a9,_0x375e70){const _0x176729=_0x169c5d;let _0x30029b=!0x1;if(/^@/[_0x176729(0x159)](_0x375e70)){const [,_0x1a46f8,_0x15c6f0]=/^@(.*?)\.(.*?)$/[_0x176729(0x135)](_0x375e70),_0x370522=this[_0x176729(0x123)](_0x1a46f8),_0x49f19b=_0x1a46f8?_0x176729(0x141)===_0x370522?null:_0x370522||'{}':'{}';try{const _0x5ef289=JSON[_0x176729(0xee)](_0x49f19b);this[_0x176729(0x148)](_0x5ef289,_0x15c6f0,_0x49b3a9),_0x30029b=this[_0x176729(0x12b)](JSON[_0x176729(0x18d)](_0x5ef289),_0x1a46f8);}catch(_0xfccd4f){const _0x2a5b72={};this[_0x176729(0x148)](_0x2a5b72,_0x15c6f0,_0x49b3a9),_0x30029b=this[_0x176729(0x12b)](JSON[_0x176729(0x18d)](_0x2a5b72),_0x1a46f8);}}else _0x30029b=this[_0x176729(0x12b)](_0x49b3a9,_0x375e70);return _0x30029b;}[_0x169c5d(0x123)](_0x5506e0){const _0x500448=_0x169c5d;return this[_0x500448(0xf1)]()||this[_0x500448(0x12f)]()?$persistentStore[_0x500448(0x18c)](_0x5506e0):this[_0x500448(0xd8)]()?$prefs[_0x500448(0x16b)](_0x5506e0):this[_0x500448(0xf5)]()?(this[_0x500448(0xdd)]=this[_0x500448(0x191)](),this[_0x500448(0xdd)][_0x5506e0]):this[_0x500448(0xdd)]&&this[_0x500448(0xdd)][_0x5506e0]||null;}[_0x169c5d(0x12b)](_0x1ba78d,_0x221c04){const _0x494953=_0x169c5d;return this[_0x494953(0xf1)]()||this[_0x494953(0x12f)]()?$persistentStore[_0x494953(0xeb)](_0x1ba78d,_0x221c04):this[_0x494953(0xd8)]()?$prefs[_0x494953(0x108)](_0x1ba78d,_0x221c04):this[_0x494953(0xf5)]()?(this[_0x494953(0xdd)]=this[_0x494953(0x191)](),this[_0x494953(0xdd)][_0x221c04]=_0x1ba78d,this[_0x494953(0x18b)](),!0x0):this[_0x494953(0xdd)]&&this[_0x494953(0xdd)][_0x221c04]||null;}[_0x169c5d(0x14f)](_0x322065){const _0xce897f=_0x169c5d;this[_0xce897f(0x177)]=this[_0xce897f(0x177)]?this[_0xce897f(0x177)]:require(_0xce897f(0x177)),this[_0xce897f(0x11e)]=this[_0xce897f(0x11e)]?this[_0xce897f(0x11e)]:require(_0xce897f(0x10c)),this[_0xce897f(0xf9)]=this[_0xce897f(0xf9)]?this[_0xce897f(0xf9)]:new this[(_0xce897f(0x11e))][(_0xce897f(0xe4))](),_0x322065&&(_0x322065[_0xce897f(0x1a0)]=_0x322065[_0xce897f(0x1a0)]?_0x322065[_0xce897f(0x1a0)]:{},void 0x0===_0x322065[_0xce897f(0x1a0)][_0xce897f(0x140)]&&void 0x0===_0x322065[_0xce897f(0x104)]&&(_0x322065[_0xce897f(0x104)]=this[_0xce897f(0xf9)]));}[_0x169c5d(0xe3)](_0x238b6b,_0x4e5f54=()=>{}){const _0x3b3e94=_0x169c5d;_0x238b6b[_0x3b3e94(0x1a0)]&&(delete _0x238b6b[_0x3b3e94(0x1a0)][_0x3b3e94(0x126)],delete _0x238b6b[_0x3b3e94(0x1a0)][_0x3b3e94(0x161)]),this[_0x3b3e94(0xf1)]()||this[_0x3b3e94(0x12f)]()?(this[_0x3b3e94(0xf1)]()&&this[_0x3b3e94(0x131)]&&(_0x238b6b[_0x3b3e94(0x1a0)]=_0x238b6b[_0x3b3e94(0x1a0)]||{},Object[_0x3b3e94(0x155)](_0x238b6b[_0x3b3e94(0x1a0)],{'X-Surge-Skip-Scripting':!0x1})),$httpClient[_0x3b3e94(0xe3)](_0x238b6b,(_0x5339cd,_0x45dd0f,_0x4f234c)=>{const _0x5cafca=_0x3b3e94;!_0x5339cd&&_0x45dd0f&&(_0x45dd0f[_0x5cafca(0x106)]=_0x4f234c,_0x45dd0f[_0x5cafca(0x10e)]=_0x45dd0f[_0x5cafca(0x134)]),_0x4e5f54(_0x5339cd,_0x45dd0f,_0x4f234c);})):this[_0x3b3e94(0xd8)]()?(this[_0x3b3e94(0x131)]&&(_0x238b6b[_0x3b3e94(0x173)]=_0x238b6b[_0x3b3e94(0x173)]||{},Object[_0x3b3e94(0x155)](_0x238b6b[_0x3b3e94(0x173)],{'hints':!0x1})),$task[_0x3b3e94(0xfa)](_0x238b6b)[_0x3b3e94(0x11b)](_0x4d1b9f=>{const {statusCode:_0xc7dfe7,statusCode:_0x210641,headers:_0x519b3a,body:_0x142a10}=_0x4d1b9f;_0x4e5f54(null,{'status':_0xc7dfe7,'statusCode':_0x210641,'headers':_0x519b3a,'body':_0x142a10},_0x142a10);},_0x57e4be=>_0x4e5f54(_0x57e4be))):this[_0x3b3e94(0xf5)]()&&(this[_0x3b3e94(0x14f)](_0x238b6b),this[_0x3b3e94(0x177)](_0x238b6b)['on'](_0x3b3e94(0x149),(_0x371e55,_0x801762)=>{const _0x57dbb7=_0x3b3e94;try{if(_0x371e55[_0x57dbb7(0x1a0)][_0x57dbb7(0x16d)]){const _0x180f0e=_0x371e55[_0x57dbb7(0x1a0)][_0x57dbb7(0x16d)][_0x57dbb7(0x19d)](this[_0x57dbb7(0x11e)][_0x57dbb7(0x140)][_0x57dbb7(0xee)])[_0x57dbb7(0x169)]();this[_0x57dbb7(0xf9)][_0x57dbb7(0x14d)](_0x180f0e,null),_0x801762[_0x57dbb7(0x104)]=this[_0x57dbb7(0xf9)];}}catch(_0x347da4){this[_0x57dbb7(0x188)](_0x347da4);}})[_0x3b3e94(0x11b)](_0x3d17eb=>{const {statusCode:_0x1748b3,statusCode:_0x5a74ce,headers:_0x2ae4fa,body:_0x4d4eea}=_0x3d17eb;_0x4e5f54(null,{'status':_0x1748b3,'statusCode':_0x5a74ce,'headers':_0x2ae4fa,'body':_0x4d4eea},_0x4d4eea);},_0xabc7e2=>{const _0x5f0487=_0x3b3e94,{message:_0x29de56,response:_0x3fcd40}=_0xabc7e2;_0x4e5f54(_0x29de56,_0x3fcd40,_0x3fcd40&&_0x3fcd40[_0x5f0487(0x106)]);}));}[_0x169c5d(0x180)](_0x559668,_0x105833=()=>{}){const _0x516760=_0x169c5d;if(_0x559668[_0x516760(0x106)]&&_0x559668[_0x516760(0x1a0)]&&!_0x559668[_0x516760(0x1a0)][_0x516760(0x126)]&&(_0x559668[_0x516760(0x1a0)][_0x516760(0x126)]=_0x516760(0x193)),_0x559668[_0x516760(0x1a0)]&&delete _0x559668[_0x516760(0x1a0)][_0x516760(0x161)],this[_0x516760(0xf1)]()||this[_0x516760(0x12f)]())this[_0x516760(0xf1)]()&&this[_0x516760(0x131)]&&(_0x559668[_0x516760(0x1a0)]=_0x559668[_0x516760(0x1a0)]||{},Object[_0x516760(0x155)](_0x559668[_0x516760(0x1a0)],{'X-Surge-Skip-Scripting':!0x1})),$httpClient[_0x516760(0x180)](_0x559668,(_0x1a8680,_0x5b87ea,_0x20929b)=>{const _0x1d7267=_0x516760;!_0x1a8680&&_0x5b87ea&&(_0x5b87ea[_0x1d7267(0x106)]=_0x20929b,_0x5b87ea[_0x1d7267(0x10e)]=_0x5b87ea[_0x1d7267(0x134)]),_0x105833(_0x1a8680,_0x5b87ea,_0x20929b);});else{if(this[_0x516760(0xd8)]())_0x559668[_0x516760(0x15d)]=_0x516760(0x162),this[_0x516760(0x131)]&&(_0x559668[_0x516760(0x173)]=_0x559668[_0x516760(0x173)]||{},Object[_0x516760(0x155)](_0x559668[_0x516760(0x173)],{'hints':!0x1})),$task[_0x516760(0xfa)](_0x559668)[_0x516760(0x11b)](_0x4f85ec=>{const {statusCode:_0x5ca58a,statusCode:_0x4ab17f,headers:_0x286b87,body:_0x572597}=_0x4f85ec;_0x105833(null,{'status':_0x5ca58a,'statusCode':_0x4ab17f,'headers':_0x286b87,'body':_0x572597},_0x572597);},_0x15fde6=>_0x105833(_0x15fde6));else{if(this[_0x516760(0xf5)]()){this[_0x516760(0x14f)](_0x559668);const {url:_0x4aacfc,..._0x505498}=_0x559668;this[_0x516760(0x177)][_0x516760(0x180)](_0x4aacfc,_0x505498)[_0x516760(0x11b)](_0x512b2c=>{const {statusCode:_0x417966,statusCode:_0x2f5e84,headers:_0x360f73,body:_0x45d4c6}=_0x512b2c;_0x105833(null,{'status':_0x417966,'statusCode':_0x2f5e84,'headers':_0x360f73,'body':_0x45d4c6},_0x45d4c6);},_0x283093=>{const _0x3cc300=_0x516760,{message:_0xadff33,response:_0x41fc1e}=_0x283093;_0x105833(_0xadff33,_0x41fc1e,_0x41fc1e&&_0x41fc1e[_0x3cc300(0x106)]);});}}}}[_0x169c5d(0x170)](_0x175a66){const _0x52a6e3=_0x169c5d;let _0x54f515={'M+':new Date()[_0x52a6e3(0xf6)]()+0x1,'d+':new Date()[_0x52a6e3(0x196)](),'H+':new Date()[_0x52a6e3(0x186)](),'m+':new Date()[_0x52a6e3(0xd3)](),'s+':new Date()[_0x52a6e3(0xed)](),'q+':Math[_0x52a6e3(0x18e)]((new Date()[_0x52a6e3(0xf6)]()+0x3)/0x3),'S':new Date()[_0x52a6e3(0x167)]()};/(y+)/[_0x52a6e3(0x159)](_0x175a66)&&(_0x175a66=_0x175a66[_0x52a6e3(0x17d)](RegExp['$1'],(new Date()[_0x52a6e3(0xe8)]()+'')[_0x52a6e3(0x168)](0x4-RegExp['$1'][_0x52a6e3(0x18a)])));for(let _0x6b622c in _0x54f515)new RegExp('('+_0x6b622c+')')[_0x52a6e3(0x159)](_0x175a66)&&(_0x175a66=_0x175a66[_0x52a6e3(0x17d)](RegExp['$1'],0x1==RegExp['$1'][_0x52a6e3(0x18a)]?_0x54f515[_0x6b622c]:('00'+_0x54f515[_0x6b622c])[_0x52a6e3(0x168)]((''+_0x54f515[_0x6b622c])[_0x52a6e3(0x18a)])));return _0x175a66;}[_0x169c5d(0x15c)](_0x33fa6b=_0x83dfc1,_0x2c93fa='',_0x48b406='',_0x1c8abd){const _0x11e717=_0x169c5d,_0x4cc0e6=_0xafc82b=>{const _0x25ad83=_0x2f07;if(!_0xafc82b)return _0xafc82b;if(_0x25ad83(0x10d)==typeof _0xafc82b)return this[_0x25ad83(0x12f)]()?_0xafc82b:this[_0x25ad83(0xd8)]()?{'open-url':_0xafc82b}:this[_0x25ad83(0xf1)]()?{'url':_0xafc82b}:void 0x0;if(_0x25ad83(0x14b)==typeof _0xafc82b){if(this[_0x25ad83(0x12f)]()){let _0x46b4d5=_0xafc82b[_0x25ad83(0x12d)]||_0xafc82b[_0x25ad83(0x13c)]||_0xafc82b[_0x25ad83(0x102)],_0x221882=_0xafc82b[_0x25ad83(0x15a)]||_0xafc82b[_0x25ad83(0x119)];return{'openUrl':_0x46b4d5,'mediaUrl':_0x221882};}if(this[_0x25ad83(0xd8)]()){let _0x534e5a=_0xafc82b[_0x25ad83(0x102)]||_0xafc82b[_0x25ad83(0x13c)]||_0xafc82b[_0x25ad83(0x12d)],_0x458c5e=_0xafc82b[_0x25ad83(0x119)]||_0xafc82b[_0x25ad83(0x15a)];return{'open-url':_0x534e5a,'media-url':_0x458c5e};}if(this[_0x25ad83(0xf1)]()){let _0x182793=_0xafc82b[_0x25ad83(0x13c)]||_0xafc82b[_0x25ad83(0x12d)]||_0xafc82b[_0x25ad83(0x102)];return{'url':_0x182793};}}};this[_0x11e717(0x144)]||(this[_0x11e717(0xf1)]()||this[_0x11e717(0x12f)]()?$notification[_0x11e717(0x180)](_0x33fa6b,_0x2c93fa,_0x48b406,_0x4cc0e6(_0x1c8abd)):this[_0x11e717(0xd8)]()&&$notify(_0x33fa6b,_0x2c93fa,_0x48b406,_0x4cc0e6(_0x1c8abd)));let _0x23e2f8=['',_0x11e717(0xd5)];_0x23e2f8[_0x11e717(0x171)](_0x33fa6b),_0x2c93fa&&_0x23e2f8[_0x11e717(0x171)](_0x2c93fa),_0x48b406&&_0x23e2f8[_0x11e717(0x171)](_0x48b406),console[_0x11e717(0xce)](_0x23e2f8[_0x11e717(0x16f)]('\x0a')),this[_0x11e717(0x19e)]=this[_0x11e717(0x19e)][_0x11e717(0x181)](_0x23e2f8);}[_0x169c5d(0xce)](..._0x302396){const _0x4fff4b=_0x169c5d;_0x302396[_0x4fff4b(0x18a)]>0x0&&(this[_0x4fff4b(0x19e)]=[...this[_0x4fff4b(0x19e)],..._0x302396]),console[_0x4fff4b(0xce)](_0x302396[_0x4fff4b(0x16f)](this[_0x4fff4b(0xd1)]));}[_0x169c5d(0x188)](_0x8833e4,_0x363e87){const _0x2ef79=_0x169c5d,_0x3c8a8e=!this[_0x2ef79(0xf1)]()&&!this[_0x2ef79(0xd8)]()&&!this[_0x2ef79(0x12f)]();_0x3c8a8e?this[_0x2ef79(0xce)]('','❗️'+this[_0x2ef79(0x175)]+_0x2ef79(0x11d),_0x8833e4[_0x2ef79(0x12a)]):this[_0x2ef79(0xce)]('','❗️'+this[_0x2ef79(0x175)]+_0x2ef79(0x11d),_0x8833e4);}[_0x169c5d(0x109)](_0x58175b){return new Promise(_0x16f871=>setTimeout(_0x16f871,_0x58175b));}[_0x169c5d(0x151)](_0x56e8f0={}){const _0x3b3759=_0x169c5d,_0x51474b=new Date()[_0x3b3759(0xe6)](),_0x36aa3a=(_0x51474b-this[_0x3b3759(0x160)])/0x3e8;this[_0x3b3759(0xce)]('','🔔'+this[_0x3b3759(0x175)]+_0x3b3759(0xd6)+_0x36aa3a+'\x20秒'),this[_0x3b3759(0xce)](),(this[_0x3b3759(0xf1)]()||this[_0x3b3759(0xd8)]()||this[_0x3b3759(0x12f)]())&&$done(_0x56e8f0);}}(_0x83dfc1,_0xfac52c);} \ No newline at end of file diff --git a/jckd/jckd_shareRead.js b/jckd/jckd_shareRead.js new file mode 100644 index 0000000..b41c330 --- /dev/null +++ b/jckd/jckd_shareRead.js @@ -0,0 +1,324 @@ +/* +安卓:晶彩看点 + +转发和分享阅读,请勿贪心,小心黑号 +*/ + +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..76308f1 --- /dev/null +++ b/jctq/jctq_daily.js @@ -0,0 +1,600 @@ +/* +安卓:晶彩天气(v8.3.7) + +此脚本负责: +领转发页定时宝箱,领福利页定时宝箱,领首页气泡红包,时段转发,刷福利视频,抽奖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 jctqCookieArr = [] +let jctqBubbleBodyArr = [] +let jctqGiveBoxBodyArr = [] + +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=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 { + $.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..8f4d5a7 --- /dev/null +++ b/jctq/jctq_kkz.js @@ -0,0 +1,372 @@ +/* +安卓:晶彩天气(v8.3.7) + +此脚本负责: +完成看看赚任务,删除重复和失效的body +*/ + +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_kkz_pro.js b/jctq/jctq_kkz_pro.js new file mode 100644 index 0000000..198e35e --- /dev/null +++ b/jctq/jctq_kkz_pro.js @@ -0,0 +1,12 @@ +/* +安卓:晶彩天气看看赚 + + +不需要捉看看赚body,只需要用到jctqCookie +目前只能在青龙上使用,需要依赖crypto-js,报错找不到依赖的自行安装 +docker exec -it qinglong bash -c "npm install -g crypto-js" +本脚本没有设置重写,请自己复制jctqCookie到青龙环境下使用,多账号用@隔开 +例子: export jctqCookie='uid=xxx&zqkey=yyy&zqkey_id=zzz@uid=aaa&zqkey=bbb&zqkey_id=ccc@uid=qqq&zqkey=sss&zqkey_id=ttt' +*/ + +const _0x3bb297=_0x4bcb;(function(_0x5aa0e0,_0x3a0030){const _0x425fd8=_0x4bcb,_0x2cff1d=_0x5aa0e0();while(!![]){try{const _0x46b34b=parseInt(_0x425fd8(0xbf))/0x1*(-parseInt(_0x425fd8(0xd9))/0x2)+-parseInt(_0x425fd8(0x17a))/0x3+parseInt(_0x425fd8(0xe6))/0x4*(parseInt(_0x425fd8(0xad))/0x5)+parseInt(_0x425fd8(0x163))/0x6*(parseInt(_0x425fd8(0x124))/0x7)+parseInt(_0x425fd8(0x143))/0x8*(parseInt(_0x425fd8(0x159))/0x9)+parseInt(_0x425fd8(0xd8))/0xa+-parseInt(_0x425fd8(0x144))/0xb*(parseInt(_0x425fd8(0xe5))/0xc);if(_0x46b34b===_0x3a0030)break;else _0x2cff1d['push'](_0x2cff1d['shift']());}catch(_0x454bc5){_0x2cff1d['push'](_0x2cff1d['shift']());}}}(_0x5a87,0x9200a));const jsname=_0x3bb297(0xde),$=Env(jsname),notifyFlag=0x1,logDebug=0x0;let notifyStr='',rndtime='',httpResult,CryptoJS=require(_0x3bb297(0x123)),jctqCookie=($[_0x3bb297(0x173)]()?process[_0x3bb297(0xcc)][_0x3bb297(0xb4)]:$[_0x3bb297(0xc9)](_0x3bb297(0xb4)))||'',jctqCookieArr=[],kkzBodyArr=[],userIdx=0x0,allCompFlag=0x0,validCount=0x0,restNum=0x0,preBody=_0x3bb297(0x14c),bodyTemplate=_0x3bb297(0xe7),fakeSign=_0x3bb297(0x100),a=_0x3bb297(0x118),b=_0x3bb297(0xe1),c='v6',key=a+b+c;function _0x5a87(){const _0x10d60d=['writedata','--用户','reduce','write','共找到',':\x20服务器访问数据为空,请检查自身设备网络情况','cktough','https://tq.xunsl.com/v5/nameless/adlickstart.json','match','1837880zdgxlg','11fCGoIV','mode','所有用户开始一起做看看赚任务[id:','/v1/scripting/evaluate','map','tq.xunsl.com','encrypt','https://tq.xunsl.com/v5/nameless/bannerstatus.json','p=D9XQc_gCBVVg=','box.dat','CookieJar','Function\x20','VOG-AL10','body','send','本次运行共查询到','getSeconds','trim','@chavy_boxjs_userCfgs.httpapi_timeout','substr','keep-alive','9CyAULi','&zqkey_id=','logs','url','未完成看看赚[id:','msg','Pkcs7','runScript','isLoon','http','47628wMutdO','toObj','decrypt','getTime','undefined','done','got','setjson','message','==============📣系统通知📣==============','lodash_set','getMonth','read_num','stringify','cookie=','exec','isNode','ckjar','运行通知\x0a\x0a','&uid=','existsSync','media-url','null','2068545WBYRiO','getScript','isNeedRewrite','open-url','setval','logErr','Cookie','startTime','isSurge','getFullYear','255XkxQAD','status','time','writeFileSync','轮阅读,随机等待','未找到有效的jctqCookie',',\x20结束!\x20🕛\x20','jctqCookie','set-cookie',':\x20get请求失败','setValueForKey','getHours','test','path','--完成第','zqkey=','Content-Type','未找到jctqCookie','270587rqCTqr','slice','setdata','concat','cookie_id=','assign','Content-Length','cron','&task_id=','stack','getdata','charAt','],还需阅读','env','dataFile','application/x-www-form-urlencoded','getMilliseconds','abs','个用户','已完成看看赚[id:','cwd',']任务,获得','logSeparator','replace','post','9235080tWrzer','8OLmBwK','完成看看赚[id:','ciphertext','isQuanX','parse','晶彩天气看看赚','CBC','@chavy_boxjs_userCfgs.httpapi','EMj','toString','.$1','],阅读','9743484zdSFjG','70076QAPFdK','app_name=jckd_app&app_version=8.3.7&carrier=%E4%B8%AD%E5%9B%BD%E7%94%B5%E4%BF%A1&channel=c6005&device_brand=HUAWEI&device_id=52278379&device_model=TAS-AN00&device_platform=android&device_type=android&dpi=480&inner_version=202111012030&language=zh-CN&memory=7&mi=0&mobile_type=1&net_type=1&network_type=WIFI&oaid=9bdf7bff-f3fe-2b18-5fff-3b3f3fd6873d&openudid=d3a7920a332a158c&os_api=29&os_version=TAS-AN00+10.0.0.133%28C00E132R5P1%29&request_time=1636635425&resolution=1080x2340&rom_version=TAS-AN00+10.0.0.133%28C00E132R5P1%29&s_ad=BpnoxxlgBSPY%3DPjY34bnR9d2j4inaXj5lxigNHQqSQA1G&sm_device_id=2020031618154539f1a2741679d27a72c6745d9ed13e6801c4b79111353999&storage=109.35&','data','length','qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM','mediaUrl','loaddata','join','Hex','object','DES','uid=','POST','setCookieSync','android','call','非法请求,请检查body','banner_id','opts','getMinutes','https://tq.xunsl.com/v5/nameless/adlickend.json','items','random','indexOf','error_code','then','&sign=807b702a1b3332d150936ede33d7c0fe','Base64','阅读看看赚文章失败:','see_num','enc',',\x20错误!','http://','statusCode','success',',\x20开始!','resolve','catch','getjson','tough-cookie','valueForKey','cookieJar','--完成最后一轮阅读','read','push','个有效的看看赚任务','pad','openUrl','floor',':\x20post请求失败','od8','score','完成看看赚任务失败:','zqkey_id=','getval','exports','fetch','log','readFileSync','wait','GET','crypto-js','1001tMCHlA','method','toStr','redirect','jcweather','isMute','finally','split','Utf8','string','name','headers','timeout','comtele_state','get','lodash_get','getDate','*/*','initGotEnv','isArray',':\x20此脚本不做重写,请检查重写设置',':\x20未知错误'];_0x5a87=function(){return _0x10d60d;};return _0x5a87();}!(async()=>{const _0xa5b2a2=_0x3bb297;if(typeof $request!==_0xa5b2a2(0x167))$[_0xa5b2a2(0x15e)](jsname+_0xa5b2a2(0x138));else{if(!await checkEnv())return;await runLookStart(),console[_0xa5b2a2(0x11f)](_0xa5b2a2(0x153)+validCount+_0xa5b2a2(0x113));}})()[_0x3bb297(0x10b)](_0x294354=>$[_0x3bb297(0x17f)](_0x294354))[_0x3bb297(0x12a)](()=>$[_0x3bb297(0x168)]());async function showmsg(){const _0x3e29f0=_0x3bb297;notifyBody=jsname+_0x3e29f0(0x175)+notifyStr,notifyFlag!=0x1&&console[_0x3e29f0(0x11f)](notifyBody),notifyFlag==0x1&&$[_0x3e29f0(0x15e)](notifyBody);}async function checkEnv(){const _0x5c1687=_0x3bb297;if(jctqCookie){if(jctqCookie[_0x5c1687(0xfd)]('@')>-0x1){let _0x2d3140=jctqCookie[_0x5c1687(0x12b)]('@');for(let _0x54cd14=0x0;_0x54cd14<_0x2d3140[_0x5c1687(0xe9)];_0x54cd14++){jctqCookieArr[_0x5c1687(0x112)](replaceCookie(_0x2d3140[_0x54cd14]));}}else jctqCookieArr[_0x5c1687(0x112)](replaceCookie(jctqCookie));}else return console[_0x5c1687(0x11f)](_0x5c1687(0xbe)),![];if(jctqCookieArr[_0x5c1687(0xe9)]==0x0)return console[_0x5c1687(0x11f)](_0x5c1687(0xb2)),![];return console[_0x5c1687(0x11f)](_0x5c1687(0x13e)+jctqCookieArr[_0x5c1687(0xe9)]+_0x5c1687(0xd1)),!![];}function replaceCookie(_0x39ee9c){const _0x8efa5e=_0x3bb297;let _0x41da88='',_0x5a92ce='',_0x169c9a='';if(_0x39ee9c[_0x8efa5e(0xfd)](_0x8efa5e(0xbc))>-0x1)_0x5a92ce=_0x39ee9c[_0x8efa5e(0x142)](/zqkey=([\w-]+)/)[0x1];else _0x39ee9c[_0x8efa5e(0xfd)](_0x8efa5e(0x171))>-0x1&&(_0x5a92ce=_0x39ee9c[_0x8efa5e(0x142)](/cookie=([\w-]+)/)[0x1]);if(_0x39ee9c[_0x8efa5e(0xfd)](_0x8efa5e(0x11b))>-0x1)_0x169c9a=_0x39ee9c[_0x8efa5e(0x142)](/zqkey_id=([\w-]+)/)[0x1];else _0x39ee9c[_0x8efa5e(0xfd)](_0x8efa5e(0xc3))>-0x1&&(_0x169c9a=_0x39ee9c[_0x8efa5e(0x142)](/cookie_id=([\w-]+)/)[0x1]);return _0x39ee9c[_0x8efa5e(0xfd)](_0x8efa5e(0xf1))>-0x1&&(uid=_0x39ee9c[_0x8efa5e(0x142)](/uid=([\w-]+)/)[0x1]),_0x41da88=_0x8efa5e(0xbc)+_0x5a92ce+_0x8efa5e(0x15a)+_0x169c9a+_0x8efa5e(0x176)+uid,_0x41da88;}async function encodeUserBody(_0x26fe5c,_0x5f3a9b){const _0x4590a6=_0x3bb297;return replacedStr=bodyTemplate+(_0x4590a6(0xc7)+_0x5f3a9b+'&')+jctqCookieArr[_0x26fe5c]+fakeSign,encodeBody=myFuncB(replacedStr),hexBody=CryptoJS[_0x4590a6(0x104)][_0x4590a6(0xee)][_0x4590a6(0xdd)](encodeBody),base64Body=CryptoJS[_0x4590a6(0x104)][_0x4590a6(0x101)][_0x4590a6(0x170)](hexBody),replaceBody3=base64Body[_0x4590a6(0xd6)](/\+/g,'-'),replaceBody4=replaceBody3[_0x4590a6(0xd6)](/\//g,'_'),finalBody=preBody+replaceBody4+randomString(0x0),finalBody;}async function runLookStart(){const _0x18fae0=_0x3bb297;for(let _0x5d5aee=0x2710;_0x5d5aee<0x27d8;_0x5d5aee++){allCompFlag=0x1,restNum=0x0,kkzBodyArr=[],kkzCompArr=[];for(userIdx=0x0;userIdxrestNum?_0x4cc91d:restNum,console[_0x5f3e6e(0x11f)]('用户'+(userIdx+0x1)+_0x5f3e6e(0x15d)+_0x8cf970+_0x5f3e6e(0xcb)+_0x4cc91d+'次');}else kkzCompArr[_0x5f3e6e(0x112)](0x0),console[_0x5f3e6e(0x11f)]('用户'+(userIdx+0x1)+_0x5f3e6e(0xd2)+_0x8cf970+']');}else{if(_0x7b2ac3[_0x5f3e6e(0xfe)]==0x30d41)console[_0x5f3e6e(0x11f)](_0x5f3e6e(0xf6));return![];}return!![];}async function readLookStartArt(_0x4d63f3){const _0x58cd80=_0x3bb297;let _0x39c0eb=printCaller(),_0x5626fc=_0x58cd80(0x14b),_0x317b25=populatePostUrl(_0x5626fc,_0x4d63f3);await httpPost(_0x317b25,_0x39c0eb);let _0x2df4e4=httpResult;if(!_0x2df4e4)return;_0x2df4e4[_0x58cd80(0x108)]!=!![]&&console[_0x58cd80(0x11f)](_0x58cd80(0x13b)+(userIdx+0x1)+_0x58cd80(0x102)+_0x2df4e4[_0x58cd80(0x16b)]);}async function adlickend(_0x27ef16){const _0x5a6f0e=_0x3bb297;let _0xc58cef=printCaller(),_0x7492af=_0x5a6f0e(0xfa),_0x510ab9=populatePostUrl(_0x7492af,_0x27ef16);await httpPost(_0x510ab9,_0xc58cef);let _0x22b14b=httpResult;if(!_0x22b14b)return;_0x22b14b[_0x5a6f0e(0x108)]==!![]?console[_0x5a6f0e(0x11f)]('用户'+(userIdx+0x1)+_0x5a6f0e(0xda)+_0x22b14b[_0x5a6f0e(0xfb)][_0x5a6f0e(0xf7)]+_0x5a6f0e(0xd4)+_0x22b14b[_0x5a6f0e(0xfb)][_0x5a6f0e(0x119)]+'金币'):console[_0x5a6f0e(0x11f)]('用户'+(userIdx+0x1)+_0x5a6f0e(0x11a)+_0x22b14b[_0x5a6f0e(0x16b)]);}function populatePostUrl(_0xd2e0e6,_0x51dfe1){const _0x4197cf=_0x3bb297;let _0x853c6e=Math[_0x4197cf(0x116)](new Date()[_0x4197cf(0x166)]()/0x3e8),_0x564d77={'url':_0xd2e0e6,'headers':{'request_time':_0x853c6e,'Host':_0x4197cf(0x149),'device-model':_0x4197cf(0x150),'device-platform':_0x4197cf(0xf4),'Connection':_0x4197cf(0x158),'app-type':_0x4197cf(0x128)},'body':_0x51dfe1};return _0x564d77;}function populateGetUrl(_0x12eca0){const _0x57c225=_0x3bb297;let _0x4e6d12=Math[_0x57c225(0x116)](new Date()[_0x57c225(0x166)]()/0x3e8),_0x223a70={'url':_0x12eca0,'headers':{'request_time':_0x4e6d12,'Host':_0x57c225(0x149),'device-model':_0x57c225(0x150),'device-platform':_0x57c225(0xf4),'Connection':_0x57c225(0x158),'app-type':_0x57c225(0x128)}};return _0x223a70;}async function httpPost(_0x14c90c,_0x38613c){return httpResult=null,new Promise(_0x4ccc16=>{const _0x367499=_0x4bcb;$[_0x367499(0xd7)](_0x14c90c,async(_0x1f11a9,_0x368fd0,_0x5ab05d)=>{const _0x519ce5=_0x367499;try{if(_0x1f11a9)console[_0x519ce5(0x11f)](_0x38613c+_0x519ce5(0x117)),console[_0x519ce5(0x11f)](JSON[_0x519ce5(0x170)](_0x1f11a9)),$[_0x519ce5(0x17f)](_0x1f11a9);else{if(safeGet(_0x5ab05d)){httpResult=JSON[_0x519ce5(0xdd)](_0x5ab05d,_0x38613c);if(logDebug)console[_0x519ce5(0x11f)](httpResult);}}}catch(_0x4d29e7){$[_0x519ce5(0x17f)](_0x4d29e7,_0x368fd0);}finally{_0x4ccc16();}});});}async function httpGet(_0x19328,_0x5742b8){return httpResult=null,new Promise(_0x535004=>{const _0x37dc24=_0x4bcb;$[_0x37dc24(0x132)](_0x19328,async(_0x304183,_0x387da6,_0x109255)=>{const _0x43b56d=_0x37dc24;try{if(_0x304183)console[_0x43b56d(0x11f)](_0x5742b8+_0x43b56d(0xb6)),console[_0x43b56d(0x11f)](JSON[_0x43b56d(0x170)](_0x304183)),$[_0x43b56d(0x17f)](_0x304183);else{if(safeGet(_0x109255,_0x5742b8)){httpResult=JSON[_0x43b56d(0xdd)](_0x109255);if(logDebug)console[_0x43b56d(0x11f)](httpResult);}}}catch(_0x36a331){$[_0x43b56d(0x17f)](_0x36a331,_0x387da6);}finally{_0x535004();}});});}function safeGet(_0x551b2f,_0x4ac4ed){const _0x175eb9=_0x3bb297;try{if(typeof JSON[_0x175eb9(0xdd)](_0x551b2f)==_0x175eb9(0xef))return!![];else console[_0x175eb9(0x11f)](_0x175eb9(0x14f)+_0x4ac4ed+_0x175eb9(0x139)),console[_0x175eb9(0x11f)](_0x551b2f);}catch(_0x16de63){return console[_0x175eb9(0x11f)](_0x16de63),console[_0x175eb9(0x11f)](_0x175eb9(0x14f)+_0x4ac4ed+_0x175eb9(0x13f)),![];}}function printCaller(){const _0x3fab14=_0x3bb297;return new Error()[_0x3fab14(0xc8)][_0x3fab14(0x12b)]('\x0a')[0x2][_0x3fab14(0x155)]()[_0x3fab14(0x12b)]('\x20')[0x1];}function myFuncB(_0xd0e5e9){const _0x1c263f=_0x3bb297;var _0x44d49c=CryptoJS[_0x1c263f(0x104)][_0x1c263f(0x12c)][_0x1c263f(0xdd)](key),_0x546fbe=CryptoJS[_0x1c263f(0x104)][_0x1c263f(0x12c)][_0x1c263f(0xdd)](key),_0x4024c2=CryptoJS[_0x1c263f(0x104)][_0x1c263f(0x12c)][_0x1c263f(0xdd)](_0xd0e5e9);return encrypted=CryptoJS[_0x1c263f(0xf0)][_0x1c263f(0x14a)](_0x4024c2,_0x44d49c,{'iv':_0x546fbe,'mode':CryptoJS[_0x1c263f(0x145)][_0x1c263f(0xdf)],'padding':CryptoJS[_0x1c263f(0x114)][_0x1c263f(0x15f)]}),encrypted[_0x1c263f(0xdb)][_0x1c263f(0xe2)]();}function myFuncA(_0x46eedc){const _0x1bf9b4=_0x3bb297;var _0x57fc24=CryptoJS[_0x1bf9b4(0x104)][_0x1bf9b4(0x12c)][_0x1bf9b4(0xdd)](key),_0x47c01f=CryptoJS[_0x1bf9b4(0x104)][_0x1bf9b4(0x12c)][_0x1bf9b4(0xdd)](key),_0x4c2dbd=CryptoJS[_0x1bf9b4(0xf0)][_0x1bf9b4(0x165)]({'ciphertext':CryptoJS[_0x1bf9b4(0x104)][_0x1bf9b4(0x101)][_0x1bf9b4(0xdd)](_0x46eedc)},_0x57fc24,{'iv':_0x47c01f,'mode':CryptoJS[_0x1bf9b4(0x145)][_0x1bf9b4(0xdf)],'padding':CryptoJS[_0x1bf9b4(0x114)][_0x1bf9b4(0x15f)]});return _0x4c2dbd[_0x1bf9b4(0xe2)](CryptoJS[_0x1bf9b4(0x104)][_0x1bf9b4(0x12c)]);}function randomString(_0x3dda67=0xc){const _0x8a6d6b=_0x3bb297;let _0x443678=_0x8a6d6b(0xea),_0x3d90f5=_0x443678[_0x8a6d6b(0xe9)],_0x1bdfe3='';for(i=0x0;i<_0x3dda67;i++){_0x1bdfe3+=_0x443678[_0x8a6d6b(0xca)](Math[_0x8a6d6b(0x116)](Math[_0x8a6d6b(0xfc)]()*_0x3d90f5));}return _0x1bdfe3;}function Env(_0x5428ce,_0xc6ef39){const _0x4a25b6=_0x3bb297;class _0x5e3355{constructor(_0x1e9b6f){const _0x28145e=_0x4bcb;this[_0x28145e(0xcc)]=_0x1e9b6f;}[_0x4a25b6(0x152)](_0x493d74,_0x25f7db=_0x4a25b6(0x122)){const _0x133df8=_0x4a25b6;_0x493d74=_0x133df8(0x12d)==typeof _0x493d74?{'url':_0x493d74}:_0x493d74;let _0x5738c6=this[_0x133df8(0x132)];return _0x133df8(0xf2)===_0x25f7db&&(_0x5738c6=this[_0x133df8(0xd7)]),new Promise((_0x40dd0c,_0x356bdd)=>{const _0x1d7fd2=_0x133df8;_0x5738c6[_0x1d7fd2(0xf5)](this,_0x493d74,(_0x471cc5,_0x108195,_0x7c853e)=>{_0x471cc5?_0x356bdd(_0x471cc5):_0x40dd0c(_0x108195);});});}[_0x4a25b6(0x132)](_0x242f25){const _0xef83e5=_0x4a25b6;return this[_0xef83e5(0x152)][_0xef83e5(0xf5)](this[_0xef83e5(0xcc)],_0x242f25);}[_0x4a25b6(0xd7)](_0x257092){const _0x567fa4=_0x4a25b6;return this[_0x567fa4(0x152)][_0x567fa4(0xf5)](this[_0x567fa4(0xcc)],_0x257092,_0x567fa4(0xf2));}}return new class{constructor(_0x597ea6,_0x70ae4e){const _0x4fe54c=_0x4a25b6;this[_0x4fe54c(0x12e)]=_0x597ea6,this[_0x4fe54c(0x162)]=new _0x5e3355(this),this[_0x4fe54c(0xe8)]=null,this[_0x4fe54c(0xcd)]=_0x4fe54c(0x14d),this[_0x4fe54c(0x15b)]=[],this[_0x4fe54c(0x129)]=!0x1,this[_0x4fe54c(0x17c)]=!0x1,this[_0x4fe54c(0xd5)]='\x0a',this[_0x4fe54c(0x181)]=new Date()[_0x4fe54c(0x166)](),Object[_0x4fe54c(0xc4)](this,_0x70ae4e),this[_0x4fe54c(0x11f)]('','🔔'+this[_0x4fe54c(0x12e)]+_0x4fe54c(0x109));}[_0x4a25b6(0x173)](){const _0x25faf8=_0x4a25b6;return _0x25faf8(0x167)!=typeof module&&!!module[_0x25faf8(0x11d)];}[_0x4a25b6(0xdc)](){const _0x2d6087=_0x4a25b6;return _0x2d6087(0x167)!=typeof $task;}[_0x4a25b6(0x182)](){const _0x44b0d7=_0x4a25b6;return _0x44b0d7(0x167)!=typeof $httpClient&&_0x44b0d7(0x167)==typeof $loon;}[_0x4a25b6(0x161)](){const _0x91d7c9=_0x4a25b6;return _0x91d7c9(0x167)!=typeof $loon;}[_0x4a25b6(0x164)](_0x5c7fe1,_0x44c78a=null){const _0x392d17=_0x4a25b6;try{return JSON[_0x392d17(0xdd)](_0x5c7fe1);}catch{return _0x44c78a;}}[_0x4a25b6(0x126)](_0x1048b9,_0x2bf842=null){const _0x3f13d5=_0x4a25b6;try{return JSON[_0x3f13d5(0x170)](_0x1048b9);}catch{return _0x2bf842;}}[_0x4a25b6(0x10c)](_0x2b96c5,_0x55981d){const _0x2a15ae=_0x4a25b6;let _0x4ba0b5=_0x55981d;const _0x499e7f=this[_0x2a15ae(0xc9)](_0x2b96c5);if(_0x499e7f)try{_0x4ba0b5=JSON[_0x2a15ae(0xdd)](this[_0x2a15ae(0xc9)](_0x2b96c5));}catch{}return _0x4ba0b5;}[_0x4a25b6(0x16a)](_0x5c6c75,_0x2fbd28){const _0x219ea5=_0x4a25b6;try{return this[_0x219ea5(0xc1)](JSON[_0x219ea5(0x170)](_0x5c6c75),_0x2fbd28);}catch{return!0x1;}}[_0x4a25b6(0x17b)](_0x5cc939){return new Promise(_0x117900=>{const _0x2b438d=_0x4bcb;this[_0x2b438d(0x132)]({'url':_0x5cc939},(_0x4eaef5,_0x8d818b,_0x1e1133)=>_0x117900(_0x1e1133));});}[_0x4a25b6(0x160)](_0x48bad3,_0x52fae5){const _0x196801=_0x4a25b6;return new Promise(_0x303993=>{const _0x554481=_0x4bcb;let _0x945646=this[_0x554481(0xc9)](_0x554481(0xe0));_0x945646=_0x945646?_0x945646[_0x554481(0xd6)](/\n/g,'')[_0x554481(0x155)]():_0x945646;let _0x89623=this[_0x554481(0xc9)](_0x554481(0x156));_0x89623=_0x89623?0x1*_0x89623:0x14,_0x89623=_0x52fae5&&_0x52fae5[_0x554481(0x130)]?_0x52fae5[_0x554481(0x130)]:_0x89623;const [_0x54a198,_0x1284e4]=_0x945646[_0x554481(0x12b)]('@'),_0x1caaff={'url':_0x554481(0x106)+_0x1284e4+_0x554481(0x147),'body':{'script_text':_0x48bad3,'mock_type':_0x554481(0xc6),'timeout':_0x89623},'headers':{'X-Key':_0x54a198,'Accept':_0x554481(0x135)}};this[_0x554481(0xd7)](_0x1caaff,(_0xbac6d6,_0x54e013,_0x30c597)=>_0x303993(_0x30c597));})[_0x196801(0x10b)](_0x751e61=>this[_0x196801(0x17f)](_0x751e61));}[_0x4a25b6(0xec)](){const _0x52bc2c=_0x4a25b6;if(!this[_0x52bc2c(0x173)]())return{};{this['fs']=this['fs']?this['fs']:require('fs'),this[_0x52bc2c(0xba)]=this[_0x52bc2c(0xba)]?this[_0x52bc2c(0xba)]:require(_0x52bc2c(0xba));const _0x2d0ed8=this[_0x52bc2c(0xba)][_0x52bc2c(0x10a)](this[_0x52bc2c(0xcd)]),_0x533a59=this[_0x52bc2c(0xba)][_0x52bc2c(0x10a)](process[_0x52bc2c(0xd3)](),this[_0x52bc2c(0xcd)]),_0x182ba6=this['fs'][_0x52bc2c(0x177)](_0x2d0ed8),_0x455380=!_0x182ba6&&this['fs'][_0x52bc2c(0x177)](_0x533a59);if(!_0x182ba6&&!_0x455380)return{};{const _0x5c3632=_0x182ba6?_0x2d0ed8:_0x533a59;try{return JSON[_0x52bc2c(0xdd)](this['fs'][_0x52bc2c(0x120)](_0x5c3632));}catch(_0x1623f4){return{};}}}}[_0x4a25b6(0x13a)](){const _0x3fa449=_0x4a25b6;if(this[_0x3fa449(0x173)]()){this['fs']=this['fs']?this['fs']:require('fs'),this[_0x3fa449(0xba)]=this[_0x3fa449(0xba)]?this[_0x3fa449(0xba)]:require(_0x3fa449(0xba));const _0x227e05=this[_0x3fa449(0xba)][_0x3fa449(0x10a)](this[_0x3fa449(0xcd)]),_0x32b75b=this[_0x3fa449(0xba)][_0x3fa449(0x10a)](process[_0x3fa449(0xd3)](),this[_0x3fa449(0xcd)]),_0x7e6193=this['fs'][_0x3fa449(0x177)](_0x227e05),_0x134602=!_0x7e6193&&this['fs'][_0x3fa449(0x177)](_0x32b75b),_0x2fdd31=JSON[_0x3fa449(0x170)](this[_0x3fa449(0xe8)]);_0x7e6193?this['fs'][_0x3fa449(0xb0)](_0x227e05,_0x2fdd31):_0x134602?this['fs'][_0x3fa449(0xb0)](_0x32b75b,_0x2fdd31):this['fs'][_0x3fa449(0xb0)](_0x227e05,_0x2fdd31);}}[_0x4a25b6(0x133)](_0x598e56,_0x351162,_0x4218ea){const _0x4a8e98=_0x4a25b6,_0x5f1f84=_0x351162[_0x4a8e98(0xd6)](/\[(\d+)\]/g,_0x4a8e98(0xe3))[_0x4a8e98(0x12b)]('.');let _0x2c6361=_0x598e56;for(const _0x4d0834 of _0x5f1f84)if(_0x2c6361=Object(_0x2c6361)[_0x4d0834],void 0x0===_0x2c6361)return _0x4218ea;return _0x2c6361;}[_0x4a25b6(0x16d)](_0x1eb8ff,_0x3ce9e5,_0xfca90e){const _0x40e4a6=_0x4a25b6;return Object(_0x1eb8ff)!==_0x1eb8ff?_0x1eb8ff:(Array[_0x40e4a6(0x137)](_0x3ce9e5)||(_0x3ce9e5=_0x3ce9e5[_0x40e4a6(0xe2)]()[_0x40e4a6(0x142)](/[^.[\]]+/g)||[]),_0x3ce9e5[_0x40e4a6(0xc0)](0x0,-0x1)[_0x40e4a6(0x13c)]((_0x469336,_0x3c70de,_0x375877)=>Object(_0x469336[_0x3c70de])===_0x469336[_0x3c70de]?_0x469336[_0x3c70de]:_0x469336[_0x3c70de]=Math[_0x40e4a6(0xd0)](_0x3ce9e5[_0x375877+0x1])>>0x0==+_0x3ce9e5[_0x375877+0x1]?[]:{},_0x1eb8ff)[_0x3ce9e5[_0x3ce9e5[_0x40e4a6(0xe9)]-0x1]]=_0xfca90e,_0x1eb8ff);}[_0x4a25b6(0xc9)](_0x187e70){const _0x2873fb=_0x4a25b6;let _0x5a1cd4=this[_0x2873fb(0x11c)](_0x187e70);if(/^@/[_0x2873fb(0xb9)](_0x187e70)){const [,_0x35856a,_0x3ea7be]=/^@(.*?)\.(.*?)$/[_0x2873fb(0x172)](_0x187e70),_0x3e1b0a=_0x35856a?this[_0x2873fb(0x11c)](_0x35856a):'';if(_0x3e1b0a)try{const _0x2f2138=JSON[_0x2873fb(0xdd)](_0x3e1b0a);_0x5a1cd4=_0x2f2138?this[_0x2873fb(0x133)](_0x2f2138,_0x3ea7be,''):_0x5a1cd4;}catch(_0x40985b){_0x5a1cd4='';}}return _0x5a1cd4;}[_0x4a25b6(0xc1)](_0xd568dc,_0x370a20){const _0x2e21c9=_0x4a25b6;let _0x569aba=!0x1;if(/^@/[_0x2e21c9(0xb9)](_0x370a20)){const [,_0x21d0e9,_0x5d20e4]=/^@(.*?)\.(.*?)$/[_0x2e21c9(0x172)](_0x370a20),_0x2a9537=this[_0x2e21c9(0x11c)](_0x21d0e9),_0x1e9def=_0x21d0e9?_0x2e21c9(0x179)===_0x2a9537?null:_0x2a9537||'{}':'{}';try{const _0xe756d8=JSON[_0x2e21c9(0xdd)](_0x1e9def);this[_0x2e21c9(0x16d)](_0xe756d8,_0x5d20e4,_0xd568dc),_0x569aba=this[_0x2e21c9(0x17e)](JSON[_0x2e21c9(0x170)](_0xe756d8),_0x21d0e9);}catch(_0x185b4a){const _0x3972={};this[_0x2e21c9(0x16d)](_0x3972,_0x5d20e4,_0xd568dc),_0x569aba=this[_0x2e21c9(0x17e)](JSON[_0x2e21c9(0x170)](_0x3972),_0x21d0e9);}}else _0x569aba=this[_0x2e21c9(0x17e)](_0xd568dc,_0x370a20);return _0x569aba;}[_0x4a25b6(0x11c)](_0x2dd754){const _0x1fb827=_0x4a25b6;return this[_0x1fb827(0x182)]()||this[_0x1fb827(0x161)]()?$persistentStore[_0x1fb827(0x111)](_0x2dd754):this[_0x1fb827(0xdc)]()?$prefs[_0x1fb827(0x10e)](_0x2dd754):this[_0x1fb827(0x173)]()?(this[_0x1fb827(0xe8)]=this[_0x1fb827(0xec)](),this[_0x1fb827(0xe8)][_0x2dd754]):this[_0x1fb827(0xe8)]&&this[_0x1fb827(0xe8)][_0x2dd754]||null;}[_0x4a25b6(0x17e)](_0xd600aa,_0x2dc734){const _0x29215a=_0x4a25b6;return this[_0x29215a(0x182)]()||this[_0x29215a(0x161)]()?$persistentStore[_0x29215a(0x13d)](_0xd600aa,_0x2dc734):this[_0x29215a(0xdc)]()?$prefs[_0x29215a(0xb7)](_0xd600aa,_0x2dc734):this[_0x29215a(0x173)]()?(this[_0x29215a(0xe8)]=this[_0x29215a(0xec)](),this[_0x29215a(0xe8)][_0x2dc734]=_0xd600aa,this[_0x29215a(0x13a)](),!0x0):this[_0x29215a(0xe8)]&&this[_0x29215a(0xe8)][_0x2dc734]||null;}[_0x4a25b6(0x136)](_0x18c76a){const _0x5ac83f=_0x4a25b6;this[_0x5ac83f(0x169)]=this[_0x5ac83f(0x169)]?this[_0x5ac83f(0x169)]:require(_0x5ac83f(0x169)),this[_0x5ac83f(0x140)]=this[_0x5ac83f(0x140)]?this[_0x5ac83f(0x140)]:require(_0x5ac83f(0x10d)),this[_0x5ac83f(0x174)]=this[_0x5ac83f(0x174)]?this[_0x5ac83f(0x174)]:new this[(_0x5ac83f(0x140))][(_0x5ac83f(0x14e))](),_0x18c76a&&(_0x18c76a[_0x5ac83f(0x12f)]=_0x18c76a[_0x5ac83f(0x12f)]?_0x18c76a[_0x5ac83f(0x12f)]:{},void 0x0===_0x18c76a[_0x5ac83f(0x12f)][_0x5ac83f(0x180)]&&void 0x0===_0x18c76a[_0x5ac83f(0x10f)]&&(_0x18c76a[_0x5ac83f(0x10f)]=this[_0x5ac83f(0x174)]));}[_0x4a25b6(0x132)](_0x501eec,_0x36c90b=()=>{}){const _0x24f97f=_0x4a25b6;_0x501eec[_0x24f97f(0x12f)]&&(delete _0x501eec[_0x24f97f(0x12f)][_0x24f97f(0xbd)],delete _0x501eec[_0x24f97f(0x12f)][_0x24f97f(0xc5)]),this[_0x24f97f(0x182)]()||this[_0x24f97f(0x161)]()?(this[_0x24f97f(0x182)]()&&this[_0x24f97f(0x17c)]&&(_0x501eec[_0x24f97f(0x12f)]=_0x501eec[_0x24f97f(0x12f)]||{},Object[_0x24f97f(0xc4)](_0x501eec[_0x24f97f(0x12f)],{'X-Surge-Skip-Scripting':!0x1})),$httpClient[_0x24f97f(0x132)](_0x501eec,(_0x5980df,_0x3ece6b,_0x399074)=>{const _0x5090c9=_0x24f97f;!_0x5980df&&_0x3ece6b&&(_0x3ece6b[_0x5090c9(0x151)]=_0x399074,_0x3ece6b[_0x5090c9(0x107)]=_0x3ece6b[_0x5090c9(0xae)]),_0x36c90b(_0x5980df,_0x3ece6b,_0x399074);})):this[_0x24f97f(0xdc)]()?(this[_0x24f97f(0x17c)]&&(_0x501eec[_0x24f97f(0xf8)]=_0x501eec[_0x24f97f(0xf8)]||{},Object[_0x24f97f(0xc4)](_0x501eec[_0x24f97f(0xf8)],{'hints':!0x1})),$task[_0x24f97f(0x11e)](_0x501eec)[_0x24f97f(0xff)](_0x2d709d=>{const {statusCode:_0x180d15,statusCode:_0x16342c,headers:_0x2f02be,body:_0x3c53c1}=_0x2d709d;_0x36c90b(null,{'status':_0x180d15,'statusCode':_0x16342c,'headers':_0x2f02be,'body':_0x3c53c1},_0x3c53c1);},_0x211c5d=>_0x36c90b(_0x211c5d))):this[_0x24f97f(0x173)]()&&(this[_0x24f97f(0x136)](_0x501eec),this[_0x24f97f(0x169)](_0x501eec)['on'](_0x24f97f(0x127),(_0x42d606,_0x46fde9)=>{const _0x11ae55=_0x24f97f;try{if(_0x42d606[_0x11ae55(0x12f)][_0x11ae55(0xb5)]){const _0x15253f=_0x42d606[_0x11ae55(0x12f)][_0x11ae55(0xb5)][_0x11ae55(0x148)](this[_0x11ae55(0x140)][_0x11ae55(0x180)][_0x11ae55(0xdd)])[_0x11ae55(0xe2)]();this[_0x11ae55(0x174)][_0x11ae55(0xf3)](_0x15253f,null),_0x46fde9[_0x11ae55(0x10f)]=this[_0x11ae55(0x174)];}}catch(_0x4d6964){this[_0x11ae55(0x17f)](_0x4d6964);}})[_0x24f97f(0xff)](_0x4455c0=>{const {statusCode:_0x1540de,statusCode:_0x2255ac,headers:_0x3615a3,body:_0x5a36ed}=_0x4455c0;_0x36c90b(null,{'status':_0x1540de,'statusCode':_0x2255ac,'headers':_0x3615a3,'body':_0x5a36ed},_0x5a36ed);},_0x5ea631=>{const _0x3d93bf=_0x24f97f,{message:_0x2661fa,response:_0x94b287}=_0x5ea631;_0x36c90b(_0x2661fa,_0x94b287,_0x94b287&&_0x94b287[_0x3d93bf(0x151)]);}));}[_0x4a25b6(0xd7)](_0x492f99,_0xc97b92=()=>{}){const _0x2aa55d=_0x4a25b6;if(_0x492f99[_0x2aa55d(0x151)]&&_0x492f99[_0x2aa55d(0x12f)]&&!_0x492f99[_0x2aa55d(0x12f)][_0x2aa55d(0xbd)]&&(_0x492f99[_0x2aa55d(0x12f)][_0x2aa55d(0xbd)]=_0x2aa55d(0xce)),_0x492f99[_0x2aa55d(0x12f)]&&delete _0x492f99[_0x2aa55d(0x12f)][_0x2aa55d(0xc5)],this[_0x2aa55d(0x182)]()||this[_0x2aa55d(0x161)]())this[_0x2aa55d(0x182)]()&&this[_0x2aa55d(0x17c)]&&(_0x492f99[_0x2aa55d(0x12f)]=_0x492f99[_0x2aa55d(0x12f)]||{},Object[_0x2aa55d(0xc4)](_0x492f99[_0x2aa55d(0x12f)],{'X-Surge-Skip-Scripting':!0x1})),$httpClient[_0x2aa55d(0xd7)](_0x492f99,(_0x95bfa5,_0x3b5d39,_0x96ffef)=>{const _0x2cf8d5=_0x2aa55d;!_0x95bfa5&&_0x3b5d39&&(_0x3b5d39[_0x2cf8d5(0x151)]=_0x96ffef,_0x3b5d39[_0x2cf8d5(0x107)]=_0x3b5d39[_0x2cf8d5(0xae)]),_0xc97b92(_0x95bfa5,_0x3b5d39,_0x96ffef);});else{if(this[_0x2aa55d(0xdc)]())_0x492f99[_0x2aa55d(0x125)]=_0x2aa55d(0xf2),this[_0x2aa55d(0x17c)]&&(_0x492f99[_0x2aa55d(0xf8)]=_0x492f99[_0x2aa55d(0xf8)]||{},Object[_0x2aa55d(0xc4)](_0x492f99[_0x2aa55d(0xf8)],{'hints':!0x1})),$task[_0x2aa55d(0x11e)](_0x492f99)[_0x2aa55d(0xff)](_0x34b8ac=>{const {statusCode:_0x274d4e,statusCode:_0x35d638,headers:_0x3e4041,body:_0x501505}=_0x34b8ac;_0xc97b92(null,{'status':_0x274d4e,'statusCode':_0x35d638,'headers':_0x3e4041,'body':_0x501505},_0x501505);},_0x12af12=>_0xc97b92(_0x12af12));else{if(this[_0x2aa55d(0x173)]()){this[_0x2aa55d(0x136)](_0x492f99);const {url:_0x271905,..._0x204be7}=_0x492f99;this[_0x2aa55d(0x169)][_0x2aa55d(0xd7)](_0x271905,_0x204be7)[_0x2aa55d(0xff)](_0x4a45b7=>{const {statusCode:_0x32d033,statusCode:_0x41aaf8,headers:_0x198f58,body:_0x56dcad}=_0x4a45b7;_0xc97b92(null,{'status':_0x32d033,'statusCode':_0x41aaf8,'headers':_0x198f58,'body':_0x56dcad},_0x56dcad);},_0x54e6e0=>{const _0x5888b1=_0x2aa55d,{message:_0x46f65a,response:_0xe0770e}=_0x54e6e0;_0xc97b92(_0x46f65a,_0xe0770e,_0xe0770e&&_0xe0770e[_0x5888b1(0x151)]);});}}}}[_0x4a25b6(0xaf)](_0x36c818){const _0x126070=_0x4a25b6;let _0x8f4f35={'M+':new Date()[_0x126070(0x16e)]()+0x1,'d+':new Date()[_0x126070(0x134)](),'H+':new Date()[_0x126070(0xb8)](),'m+':new Date()[_0x126070(0xf9)](),'s+':new Date()[_0x126070(0x154)](),'q+':Math[_0x126070(0x116)]((new Date()[_0x126070(0x16e)]()+0x3)/0x3),'S':new Date()[_0x126070(0xcf)]()};/(y+)/[_0x126070(0xb9)](_0x36c818)&&(_0x36c818=_0x36c818[_0x126070(0xd6)](RegExp['$1'],(new Date()[_0x126070(0x183)]()+'')[_0x126070(0x157)](0x4-RegExp['$1'][_0x126070(0xe9)])));for(let _0x1b6565 in _0x8f4f35)new RegExp('('+_0x1b6565+')')[_0x126070(0xb9)](_0x36c818)&&(_0x36c818=_0x36c818[_0x126070(0xd6)](RegExp['$1'],0x1==RegExp['$1'][_0x126070(0xe9)]?_0x8f4f35[_0x1b6565]:('00'+_0x8f4f35[_0x1b6565])[_0x126070(0x157)]((''+_0x8f4f35[_0x1b6565])[_0x126070(0xe9)])));return _0x36c818;}[_0x4a25b6(0x15e)](_0x3eb96b=_0x5428ce,_0x29a546='',_0x5d76ab='',_0x372744){const _0x42316a=_0x4a25b6,_0x15b1b6=_0x31eb2b=>{const _0x4e2e73=_0x4bcb;if(!_0x31eb2b)return _0x31eb2b;if(_0x4e2e73(0x12d)==typeof _0x31eb2b)return this[_0x4e2e73(0x161)]()?_0x31eb2b:this[_0x4e2e73(0xdc)]()?{'open-url':_0x31eb2b}:this[_0x4e2e73(0x182)]()?{'url':_0x31eb2b}:void 0x0;if(_0x4e2e73(0xef)==typeof _0x31eb2b){if(this[_0x4e2e73(0x161)]()){let _0x57cd14=_0x31eb2b[_0x4e2e73(0x115)]||_0x31eb2b[_0x4e2e73(0x15c)]||_0x31eb2b[_0x4e2e73(0x17d)],_0x41fcc7=_0x31eb2b[_0x4e2e73(0xeb)]||_0x31eb2b[_0x4e2e73(0x178)];return{'openUrl':_0x57cd14,'mediaUrl':_0x41fcc7};}if(this[_0x4e2e73(0xdc)]()){let _0x3e874a=_0x31eb2b[_0x4e2e73(0x17d)]||_0x31eb2b[_0x4e2e73(0x15c)]||_0x31eb2b[_0x4e2e73(0x115)],_0x37b72e=_0x31eb2b[_0x4e2e73(0x178)]||_0x31eb2b[_0x4e2e73(0xeb)];return{'open-url':_0x3e874a,'media-url':_0x37b72e};}if(this[_0x4e2e73(0x182)]()){let _0x5ee7c3=_0x31eb2b[_0x4e2e73(0x15c)]||_0x31eb2b[_0x4e2e73(0x115)]||_0x31eb2b[_0x4e2e73(0x17d)];return{'url':_0x5ee7c3};}}};this[_0x42316a(0x129)]||(this[_0x42316a(0x182)]()||this[_0x42316a(0x161)]()?$notification[_0x42316a(0xd7)](_0x3eb96b,_0x29a546,_0x5d76ab,_0x15b1b6(_0x372744)):this[_0x42316a(0xdc)]()&&$notify(_0x3eb96b,_0x29a546,_0x5d76ab,_0x15b1b6(_0x372744)));let _0x14c0dc=['',_0x42316a(0x16c)];_0x14c0dc[_0x42316a(0x112)](_0x3eb96b),_0x29a546&&_0x14c0dc[_0x42316a(0x112)](_0x29a546),_0x5d76ab&&_0x14c0dc[_0x42316a(0x112)](_0x5d76ab),console[_0x42316a(0x11f)](_0x14c0dc[_0x42316a(0xed)]('\x0a')),this[_0x42316a(0x15b)]=this[_0x42316a(0x15b)][_0x42316a(0xc2)](_0x14c0dc);}[_0x4a25b6(0x11f)](..._0x541191){const _0x737707=_0x4a25b6;_0x541191[_0x737707(0xe9)]>0x0&&(this[_0x737707(0x15b)]=[...this[_0x737707(0x15b)],..._0x541191]),console[_0x737707(0x11f)](_0x541191[_0x737707(0xed)](this[_0x737707(0xd5)]));}[_0x4a25b6(0x17f)](_0x8aca1,_0xcffa5a){const _0xb7a115=_0x4a25b6,_0x399903=!this[_0xb7a115(0x182)]()&&!this[_0xb7a115(0xdc)]()&&!this[_0xb7a115(0x161)]();_0x399903?this[_0xb7a115(0x11f)]('','❗️'+this[_0xb7a115(0x12e)]+_0xb7a115(0x105),_0x8aca1[_0xb7a115(0xc8)]):this[_0xb7a115(0x11f)]('','❗️'+this[_0xb7a115(0x12e)]+_0xb7a115(0x105),_0x8aca1);}[_0x4a25b6(0x121)](_0x113a2e){return new Promise(_0x561c59=>setTimeout(_0x561c59,_0x113a2e));}[_0x4a25b6(0x168)](_0x40c7d6={}){const _0xb9b89d=_0x4a25b6,_0x4539d1=new Date()[_0xb9b89d(0x166)](),_0x5261cd=(_0x4539d1-this[_0xb9b89d(0x181)])/0x3e8;this[_0xb9b89d(0x11f)]('','🔔'+this[_0xb9b89d(0x12e)]+_0xb9b89d(0xb3)+_0x5261cd+'\x20秒'),this[_0xb9b89d(0x11f)](),(this[_0xb9b89d(0x182)]()||this[_0xb9b89d(0xdc)]()||this[_0xb9b89d(0x161)]())&&$done(_0x40c7d6);}}(_0x5428ce,_0xc6ef39);} \ No newline at end of file diff --git a/jctq/jctq_read.js b/jctq/jctq_read.js new file mode 100644 index 0000000..aa27f08 --- /dev/null +++ b/jctq/jctq_read.js @@ -0,0 +1,258 @@ +/* +安卓:晶彩天气(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 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..3ff191b --- /dev/null +++ b/jctq/jctq_reward.js @@ -0,0 +1,373 @@ +/* +安卓:晶彩天气(v8.3.7) + +此脚本负责: +签到和翻倍,任务奖励领取,统计今日收益,自动提现 + +请将定时放在看看赚和阅读任务后面 +如果不想自动提现的,请不要捉提现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..d4c3259 --- /dev/null +++ b/jctq/jctq_rewrite.js @@ -0,0 +1,225 @@ +/* +安卓:晶彩天气(v8.3.7) + +此脚本负责:捉包重写 + +脚本会自动提现,如果不想自动提现的,请不要捉提现body,或者新建环境变量jctqWithdrawFlag,写成0 + +重写: +https://tq.xunsl.com/v17/NewTask/getTaskListByWeather.json -- 点开福利页即可获取jctqCookie +https://tq.xunsl.com/v5/CommonReward/toGetReward.json -- 签到,和福利页任务奖励(目前应该只有激励视频和20篇文章的奖励),获取完建议关掉重写 +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 -- 阅读文章,浏览视频 + +*/ + +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')) || ''; + +/////////////////////////////////////////////////////////////////// + +!(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+` 获取第1个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+` 获取第1个签到/奖励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+` 获取第1个文章/视频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+` 获取第1个时长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+` 获取第1个看看赚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+` 获取第1个提现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+` 获取第1个福利页宝箱/翻倍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+` 获取第1个首页气泡/翻倍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+` 获取第1个签到翻倍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..03d415b 100644 --- a/jctq/jctq_rewrite_subscribe.json +++ b/jctq/jctq_rewrite_subscribe.json @@ -3,49 +3,69 @@ "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 } ], @@ -55,92 +75,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..36e9af6 --- /dev/null +++ b/jctq/jctq_shareRead.js @@ -0,0 +1,327 @@ +/* +安卓:晶彩天气(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/txstock.js b/txstock.js index bb4da46..04258cc 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_info=ssid=${pgv_info_ssid}; 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_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}; ts_sid=${ts_sid}; ts_uid=${ts_uid}; 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) ? '跌' : '涨' + $.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 +2183,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(`剩余猜个股涨跌次数:${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 +2350,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/zqkd/zqkd_shareRead.js b/zqkd/zqkd_shareRead.js new file mode 100644 index 0000000..9c3181b --- /dev/null +++ b/zqkd/zqkd_shareRead.js @@ -0,0 +1,324 @@ +/* +安卓:中青看点 + +转发和分享阅读,请勿贪心,小心黑号 +*/ + +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) }