diff --git a/trdacx.js b/trdacx.js new file mode 100644 index 0000000..25b841c --- /dev/null +++ b/trdacx.js @@ -0,0 +1,216 @@ +/** + * + * ========= 青龙--配置文件 =========== + * 只要Bearer 后面数据 + * ==================================== + * + */ +const $ = new Env('瑞天地安余额查询'); +const notify = $.isNode() ? require('./sendNotify'):''; // 这里是 node(青龙属于node环境)通知相关的 +const Notify = 1; //0为关闭通知,1为打开通知,默认为1 +const debug = 1; //0为关闭调试,1为打开调试,默认为0 +////////////////////// +let trdacx = process.env.trdacx; // 这里是 从青龙的 配置文件 读取你写的变量 +let trdacxArr = []; +let data = ''; +let msg = ''; + + +!(async () => { + + if (!(await Envs())) //多账号分割 判断变量是否为空 初步处理多账号 + return; + else { + + console.log(`脚本通知群777974608,后期联合一些大佬发布感谢支持`); // console.log是输出信息的,可以在脚本日志中看到输出(打印)的信息 + + console.log(`\n\n========================================= \n脚本执行 - 北京时间(UTC+8):${new Date( + new Date().getTime() + new Date().getTimezoneOffset() * 60 * 1000 + + 8 * 60 * 60 * 1000).toLocaleString()} \n=========================================\n`); + + await wyy(); + + console.log(`\n=================== 共找到 ${trdacxArr.length} 个账号 ===================`) + + if (debug) { + console.log(`【debug】 这是你的全部账号数组:\n ${trdacxArr}`); + } + + + for (let index = 0; index < trdacxArr.length; index++) { + + + let num = index + 1 + console.log(`\n========= 开始【第 ${num} 个账号】=========\n`) + + data = trdacxArr[index].split('&'); // 这里是分割你每个账号的每个小项 + + if (debug) { + console.log(`\n 【debug】 这是你第 ${num} 账号信息:\n ${data}\n`); + } + + + // 这里是开始做任务 需要注意的点 + // 1. await只能运行与async函数中 + // 2. 函数的名字不可以相同 + // 3. 不够可以自己复制 + + console.log('开始查询'); + await signin(); + await $.wait(2 * 1000); + + + await SendMsg(msg); // 与发送通知有关系 + } + } + +})() + .catch((e) => console.log(e)) + .finally(() => $.done()) + + + + + + +/** + * + */ + function signin(timeout = 3 * 1000) { + return new Promise((resolve) => { + let url = { + url: `https://crm.rabtv.cn/v2/index/userInfo`, // 这是请求的 url 可以直接用我们抓包、精简后的URL + headers: { + "Host":"crm.rabtv.cn", + "authorization":`Bearer ${data[0]}` + }, + } + + if (debug) { + console.log(`\n【debug】=============== 这是 签到 请求 url ===============`); + console.log(JSON.stringify(url)); + } + + $.post(url, async (error, response, data) => { // 这是一个 get 请求 , 如果是 post 记得把这里改了 + try { + if (debug) { + console.log(`\n\n【debug】===============这是 签到 返回data==============`); + console.log(data) + } + + let result = JSON.parse(data); + if (result.code == 1) { // 这里是根据服务器返回的数1据做判断 方便我们知道任务是否完成了 + + console.log(`当前余额${result.data.common_user.money}元`) + msg += `\n上传结果:${result.msg}🎉` + } + + } catch (e) { + console.log(e) + } finally { + resolve(); + } + }, timeout) + }) +} + + + + +// 如果有更多的需求,直接复制上一个函数,改个名 然后稍微更改一下内容 就可以用了 +// 不要忘记与上面的 函数调用对应起来鸭 + + + + + + + + + + + + + + +//#region 固定代码 可以不管他 +// ============================================变量检查============================================ \\ +async function Envs() { + if (trdacx) { + if (trdacx.indexOf("#") != -1) { + trdacx.split("#").forEach((item) => { + trdacxArr.push(item); + }); + } else { + trdacxArr.push(trdacx); + } + } else { + console.log(`\n 【${$.name}】:未填写变量 trdacx`) + return; + } + + return true; +} + +// ============================================发送消息============================================ \\ +async function SendMsg(message) { + if (!message) + return; + + if (Notify > 0) { + if ($.isNode()) { + var notify = require('./sendNotify'); + await notify.sendNotify($.name, message); + } else { + $.msg(message); + } + } else { + console.log(message); + } +} + +/** + * 随机数生成 + */ +function randomString(e) { + e = e || 32; + var t = "QWERTYUIOPASDFGHJKLZXCVBNM1234567890", + a = t.length, + n = ""; + for (i = 0; i < e; i++) + n += t.charAt(Math.floor(Math.random() * a)); + return n +} + +/** + * 随机整数生成 + */ +function randomInt(min, max) { + return Math.round(Math.random() * (max - min) + min) +} + +//每日网抑云 +function wyy(timeout = 3 * 1000) { + return new Promise((resolve) => { + let url = { + url: `https://keai.icu/apiwyy/api` + } + $.get(url, async (err, resp, data) => { + try { + data = JSON.parse(data) + console.log(`\n 【网抑云时间】: ${data.content} by--${data.music}`); + + } catch (e) { + console.logErr(e, resp); + } finally { + resolve() + } + }, timeout) + }) +} + +//#endregion + + +// prettier-ignore 固定代码 不用管他 +function Env(t, e) { "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); class s { constructor(t) { this.env = t } send(t, e = "GET") { t = "string" == typeof t ? { url: t } : t; let s = this.get; return "POST" === e && (s = this.post), new Promise((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } get(t) { return this.send.call(this.env, t) } post(t) { return this.send.call(this.env, t, "POST") } } return new class { constructor(t, e) { this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } isSurge() { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon() { return "undefined" != typeof $loon } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson(t, e) { let s = e; const i = this.getdata(t); if (i) try { s = JSON.parse(this.getdata(t)) } catch { } return s } setjson(t, e) { try { return this.setdata(JSON.stringify(t), e) } catch { return !1 } } getScript(t) { return new Promise(e => { this.get({ url: t }, (t, s, i) => e(i)) }) } runScript(t, e) { return new Promise(s => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; const [o, h] = i.split("@"), n = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(n, (t, e, i) => s(i)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e); if (!s && !i) return {}; { const i = s ? t : e; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of i) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, e, s) { return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; try { const e = JSON.parse(h); this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const o = {}; this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) } } else s = this.setval(t, e); return s } getval(t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null } setval(t, e) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null } initGotEnv(t) { this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) } get(t, e = (() => { })) { t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), 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(); s && 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, e = null) { const s = e ? new Date(e) : new Date; let i = { "M+": s.getMonth() + 1, "d+": s.getDate(), "H+": s.getHours(), "m+": s.getMinutes(), "s+": s.getSeconds(), "q+": Math.floor((s.getMonth() + 3) / 3), S: s.getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length))); for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).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 } } } }; if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) { let t = ["", "==============📣系统通知📣=============="]; t.push(e), s && t.push(s), i && t.push(i), console.log(t.join("\n")), this.logs = this.logs.concat(t) } } 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("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) } diff --git a/抖音极速版v1.7.js b/抖音极速版v1.8.js similarity index 93% rename from 抖音极速版v1.7.js rename to 抖音极速版v1.8.js index 5c87270..f47cc09 100644 --- a/抖音极速版v1.7.js +++ b/抖音极速版v1.8.js @@ -2,8 +2,8 @@ * * 项目类型:APP * 项目名称:抖音极速版 - * 项目更新:2023-08-14 - * 项目抓包:抓api5-normal-c-lq.amemv.com下的宝箱url#cookie#x-argus#x-ladon#user-agent填入变量 + * 项目更新:2023-08-15 + * 项目抓包:抓 *-normal-c-lq.amemv.com下的宝箱url#cookie#x-argus#x-ladon#user-agent填入变量 * 项目变量:lekebo_dyjsb_Cookie * 项目定时:每30分钟运行一次 * 定时规则: 10 7-22 * * * @@ -26,11 +26,11 @@ let ck = msg = ''; //let ck,msg let versionupdate = "0"; //版本对比升级 0关闭 1开启 let numvodie = '88'; //循环看广告次数 //===============脚本版本=================// -let scriptVersion = "v1.7"; -let update_tines = "2023-08-14"; +let scriptVersion = "v1.8"; +let update_tines = "2023-08-15"; let update_data = "2023-12-12"; //测试时间 -let scriptVersionLatest = "v1.7"; //版本对比 -let userCookie = ($.isNode() ? process.env.lekebo_dyjsb1_Cookie : $.getdata('lekebo_dyjsb1_Cookie')) || ''; +let scriptVersionLatest = "v1.8"; //版本对比 +let userCookie = ($.isNode() ? process.env.lekebo_dyjsb_Cookie : $.getdata('lekebo_dyjsb_Cookie')) || ''; let userList = []; let userIdx = 0; let date = require('silly-datetime'); @@ -202,7 +202,6 @@ class UserInfo { let result = JSON.parse(data); if (result.err_no == 0) { } else { - //DoubleLog(`\n ❌ 【${this.index}】用户信息: ${result.err_tips}`) } } } catch (e) { @@ -350,15 +349,17 @@ class UserInfo { if (error) { $.logErr(error); } else { - let result = JSON.parse(data); - if (result.err_no == 0) { - DoubleLog(`\n ✅ 【${this.index}】签到广告: 获得奖励 ${result.data.amount} 金币`); - } else if (result.err_no == 10007) { - await this.signin_video(adid,reqid,amount,2 * 1000); - } else if (result.err_no == 10009) { - await this.signin_video(adid,reqid,amount,2 * 1000); + let result = isJSON(data); + if (result == true) { + await $.wait(1000); + let result = JSON.parse(data); + if (result.err_no == 0) { + DoubleLog(`\n ✅ 【${this.index}】签到广告: 获得奖励 ${result.data.amount} 金币`); + } else { + await this.signin_video(adid,reqid,amount,2 * 1000); + } } else { - DoubleLog(`\n ❌ 【${this.index}】签到广告: ${result.err_tips}`) + await this.signin_video(adid,reqid,amount,2 * 1000); } } } catch (e) { @@ -389,16 +390,20 @@ class UserInfo { } else { let result = JSON.parse(data); if (result.err_no == 0) { - if (result.data.today_step > 0) { - DoubleLog(`\n ✅ 【${this.index}】今日步数: 今日步数:${result.data.today_step}步,已领取${result.data.today_step_reward.reward_amount}金币`); - if (result.data.today_step_reward.reward_amount == 0) { - await this.step_reward(2 * 1000); + if (timeHours > 0) { + if (result.data.today_step > 0) { + DoubleLog(`\n ✅ 【${this.index}】今日步数: 今日步数:${result.data.today_step}步,已领取${result.data.today_step_reward.reward_amount}金币`); + if (result.data.today_step_reward.reward_amount == 0) { + await this.step_reward(2 * 1000); + } + } else { + await this.step_submit(2 * 1000); } } else { - await this.step_submit(2 * 1000); + DoubleLog(`\n ❌ 【${this.index}】今日步数: 当前时间为系统结算期,暂不做操作。`); } } else { - DoubleLog(`\n ❌ 【${this.index}】今日步数: ${result.err_tips}`) + DoubleLog(`\n ❌ 【${this.index}】今日步数: ${result.err_tips}`); } } } catch (e) { @@ -465,7 +470,8 @@ class UserInfo { } else { let result = JSON.parse(data); if (result.err_no == 0) { - DoubleLog(`\n ✅ 【${this.index}】步数奖励: 获得奖励 ${result.data.reward_amount} 金币`) + DoubleLog(`\n ✅ 【${this.index}】步数奖励: 获得奖励 ${result.data.reward_amount} 金币`); + await this.step_video(2 * 1000); } else { DoubleLog(`\n ❌ 【${this.index}】步数奖励: ${result.err_tips}`) } @@ -478,6 +484,41 @@ class UserInfo { }, timeout) }) } + async step_video(aggrincomeid,timeout = 2000) { + return new Promise((resolve) => { + this.forzstop = 0; + let url = { + url: `${hostname}/luckycat/aweme/v1/task/done/excitation_ad/one_more?${this.ck[0]}`, + headers: { + Host: host, + 'Content-Type': 'application/json; charset=utf-8', + 'user-agent': this.ck[4], + 'Cookie': this.ck[1], + 'x-ladon': this.ck[3], + 'x-argus': this.ck[2], + }, + body: `{"task_key":"walk_excitation_ad","rit":"28038","creator_id":"12317000","one_more_round":0,"aggr_income_id":"${aggrincomeid}"}`, + } + $.post(url, async (error, response, data) => { + try { + if (error) { + $.logErr(error); + } else { + let result = JSON.parse(data); + if (result.err_no == 0) { + DoubleLog(`\n ✅ 【${this.index}】步数视频: 获得奖励 ${result.data.amount} 金币`); + } else { + await this.step_video(aggrincomeid,2 * 1000); + } + } + } catch (e) { + $.logErr(e, response); + } finally { + resolve(); + } + }, timeout) + }) + } async read(timeout = 2000) { return new Promise((resolve) => { let url = { @@ -543,7 +584,7 @@ class UserInfo { await $.wait(1000); await this.open_treasure(2 * 1000); } else { - DoubleLog(`\n ❌ 【${this.index}】打开宝箱: 下次开宝箱:${$.time('yyyy-MM-dd HH:mm:ss', next_time * 1000)}`) + DoubleLog(`\n ❌ 【${this.index}】打开宝箱: 下次开宝箱:${$.time('yyyy-MM-dd HH:mm:ss', next_time * 1000)}`); } } else { DoubleLog(`\n ❌ 【${this.index}】宝箱广告: ${result.err_tips}`) @@ -583,7 +624,7 @@ class UserInfo { let treasurereqid = result.data.excitation_ad_info.req_id; DoubleLog(`\n ✅ 【${this.index}】打开宝箱: 获得奖励 ${result.data.amount} 金币`); await $.wait(1000); - DoubleLog(`\n ✅ 【${this.index}】宝箱广告: 预计可获得 ${treasureamount} 金币`); + DoubleLog(`\n ✅ 【${this.index}】宝箱广告: 预计可获得 ${treasureamount} 金币,正在执行`); await $.wait(1000); await this.treasure_video(treasureamount,treasureadid,treasurereqid,2 * 1000); } else { @@ -620,6 +661,7 @@ class UserInfo { } else { let result = isJSON(data); if (result == true) { + await $.wait(1000); let result = JSON.parse(data); if (result.err_no == 0) { DoubleLog(`\n ✅ 【${this.index}】宝箱广告: 获得奖励 ${result.data.amount} 金币,执行宝箱追加任务`); @@ -783,16 +825,17 @@ class UserInfo { } else { let result = isJSON(data); if (result == true) { + await $.wait(1000); let result = JSON.parse(data); if (result.err_no == 0) { this.aggrinfoid = result.data.aggr_info.aggr_income_id; DoubleLog(`\n ✅ 【${this.index}】视频广告: 获得奖励 ${result.data.amount} 金币`); await this.video_more_status(2 * 1000); } else { - await this.open_video_stop(2 * 1000); + await this.open_video_stop(adid,reqid,result.amount,2 * 1000); } } else { - await this.open_video_stop(2 * 1000); + await this.open_video_stop(adid,reqid,result.amount,2 * 1000); } } } catch (e) { @@ -855,9 +898,15 @@ class UserInfo { if (error) { $.logErr(error); } else { - let result = JSON.parse(data); - if (result.err_no == 0) { - DoubleLog(`\n ✅ 【${this.index}】追加奖励: 获得奖励 ${result.data.amount} 金币`); + let result = isJSON(data); + if (result == true) { + await $.wait(1000); + let result = JSON.parse(data); + if (result.err_no == 0) { + DoubleLog(`\n ✅ 【${this.index}】追加奖励: 获得奖励 ${result.data.amount} 金币`); + } else { + await this.one_moread(aggrincomeid,2 * 1000); + } } else { await this.one_moread(aggrincomeid,2 * 1000); } @@ -1109,7 +1158,7 @@ class UserInfo { let result = JSON.parse(data); if (result.code == 0) { DoubleLog(`\n ✅ 【${this.index}】吃饭打卡: 获得 ${result.data.reward} 金币,看视视预计 ${result.data.excitation_ad_amount} 金币`); - //await this.doneeat_video(3,2 * 1000); + await this.doneeat_video(2 * 1000); } else { DoubleLog(`\n ❌ 【${this.index}】吃饭补贴: ${result.message}`) } @@ -1142,11 +1191,17 @@ class UserInfo { if (error) { $.logErr(error); } else { - let result = JSON.parse(data); - if (result.err_no == 0) { - DoubleLog(`\n ✅ 【${this.index}】吃饭视频: 获得奖励 ${result.data.amount} 金币`); + let result = isJSON(data); + if (result == true) { + await $.wait(1000); + let result = JSON.parse(data); + if (result.err_no == 0) { + DoubleLog(`\n ✅ 【${this.index}】吃饭视频: 获得奖励 ${result.data.amount} 金币`); + } else { + await this.doneeat_video(2 * 1000); + } } else { - DoubleLog(`\n ❌ 【${this.index}】吃饭视频: ${result.err_tips}`); + await this.doneeat_video(2 * 1000); } } } catch (e) { @@ -1246,6 +1301,7 @@ class UserInfo { console.log(`\n================ 开始执行会员脚本 ===============`) await start(); } + console.log(`\n================ 本次运行脚本结束 ===============`); //await SendMsg(msg); })() .catch((e) => console.log(e)) @@ -1296,7 +1352,6 @@ function isJSON(str) { return false; } } catch(e) { - console.log(`\n 温馨提示:服务器返回了空信息数,从新尝试获取`); return false; } }