From 9860b50d469247564f0f5dacab14db40e55e2494 Mon Sep 17 00:00:00 2001 From: smallfawn <860562056@QQ.COM> Date: Tue, 7 Apr 2026 15:52:51 +0800 Subject: [PATCH] del some code --- backup/bjev.js | 428 -------------------------------------------- daily/colorful.js | 4 +- daily/dw.js | 303 +++++++++++++++++++++++++++++++ daily/hezj.js | 4 +- daily/hyjk.js | 2 +- daily/iqoo.js | 4 +- daily/xinxi.js | 4 +- wxapp/anmuxi.js | 4 +- wxapp/kangshifu.js | 4 +- wxapp/ppmt.js | 2 +- wxapp/wx_xlxyh.js | 2 +- wxapp/可口可乐吧.js | 4 +- 12 files changed, 320 insertions(+), 445 deletions(-) delete mode 100644 backup/bjev.js create mode 100644 daily/dw.js diff --git a/backup/bjev.js b/backup/bjev.js deleted file mode 100644 index cab7e48..0000000 --- a/backup/bjev.js +++ /dev/null @@ -1,428 +0,0 @@ -/** - * cron 45 21 * * * bjev.js - * Show:北京汽车 点赞每天5次 10分 签到10分 转发2次 20分 7天签到100分 30天1000分 半年5000 1年1W - * 合计1月2300分 商城最低价4900分 平均2个月换一次 - * @author https://github.com/smallfawn/QLScriptPublic - * 变量名:bjevAuth - * 变量值:https://beijing-gateway-customer.app-prod.bjev.com.cn请求头Headers中Authorization 去掉Bearer 去掉Bearer 去掉Bearer - * scriptVersionNow = "0.0.1"; - */ - -const $ = new Env("北京汽车"); -const notify = $.isNode() ? require('../sendNotify') : ''; -let ckName = "bjevAuth"; -let envSplitor = ["@", "\n"]; //多账号分隔符 -let strSplitor = "&"; //多变量分隔符 -let userIdx = 0; -let userList = []; -class UserInfo { - constructor(str) { - this.index = ++userIdx; - this.ck = str.split(strSplitor)[0]; //单账号多变量分隔符 - this.ckStatus = true; - this.artList = []//文章列表 - this.taskList = []//任务列表 - this.task_num_like = null //待做点赞任务数 - this.task_num_share = null//待做转发任务数 - this.userPoint = null - - } - async main() { - $.log(`===== 开始第[${this.index}]个账号 =====`) - await this.user_info(); - if (this.ckStatus) { - await this.user_point() - $.log(`✅运行前 - 积分[${this.userPoint}]🎉`) - await this.task_list() - if (this.taskList.length > 0) { - for (let task of this.taskList) { - //status == "0" 未完成 - //status == "1" 待领取 - //status == "2" 已完成 - if (task.taskGroupCode == "ENTITY_LIKE") { - if (task.status == "0") { - this.task_num_like = Number(task.progressLimit) - Number(task.progress) - } - $.log(`点赞 ${task.progress} / ${task.progressLimit}`) - //点赞 - } else if (task.taskGroupCode == "DAY_SIGN") { - if (task.status == "0") { - $.log(`检测未签到 执行签到`) - await this.addSign() - } else { - $.log(`签到已完成`) - } - //签到 - } else if (task.taskGroupCode == "GET_TASK_ATTENTION" && task.status == "0") { - //被关注 - } else if (task.taskGroupCode == "ENTITY_SHARE") { - if (task.status == "0") { - this.task_num_share = Number(task.progressLimit) - Number(task.progress) - } - $.log(`转发 ${task.progress} / ${task.progressLimit}`) - //转发 - } else if (task.taskGroupCode == "GET_TASK_LIKE" && task.status == "0") { - //被点赞 - } - } - if (this.task_num_like > 0 || this.task_num_share > 0) { - await this.art_list() - if (this.artList.length > 0) { - //点赞5次 转发2次 - for (let i = 0; i < 5; i++) { - await this.task_like(this.artList[i]) - await this.task_share(this.artList[i]) - } - } - - } - } - await this.task_list() - if (this.taskList.length > 0) { - for (let task of this.taskList) { - if (task.status == "1") { - await this.task_award(task.taskGroupCode) - } - } - } - await this.user_point() - $.log(`✅运行后 - 积分[${this.userPoint}]🎉`) - - } - - - - } - - - async addSign() { - try { - let options = { - fn: "签到", - method: "post", - url: `https://beijing-gateway-customer.app-prod.bjev.com.cn/beijing-zone-asset/exterior/userSignRecord/addSign?uuid_check=${this.get_uuid()}`, - body: JSON.stringify({}), - } - options.headers = this.get_headers(options.method, options.url, options.body) - let { body: result } = await httpRequest(options); - //console.log(options); - result = JSON.parse(result); - //console.log(result); - if (result.code == 0) { - $.log(`✅[${options.fn}]成功🎉`) - } else { - console.log(`❌[${options.fn}]失败`); - console.log(JSON.stringify(result)); - } - } catch (e) { - console.log(e); - } - } - - async user_info() { - try { - let options = { - fn: "信息查询", - method: "get", - url: `https://beijing-gateway-customer.app-prod.bjev.com.cn/beijing-zone-member/userCustomer/getUserInfo?buildVersion=138&uuid_check=${this.get_uuid()}`, - } - options.headers = this.get_headers(options.method, options.url) - //console.log(options); - let { body: result } = await httpRequest(options); - //console.log(options); - result = JSON.parse(result); - //console.log(result); - if (result.code == "0") { - //console.log(`✅账号[${this.index}] 欢迎用户: ${result.errcode}🎉`); - $.log(`✅[${result.data.name}][${result.data.code}][${result.data.id}]🎉`) - this.ckStatus = true; - } else { - console.log(`❌[UserInfo]查询: 失败`); - this.ckStatus = false; - console.log(result); - } - } catch (e) { - console.log(e); - } - } - async user_point() { - try { - let options = { - fn: "积分查询", - method: "get", - url: `https://beijing-gateway-customer.app-prod.bjev.com.cn/beijing-zone-member/userCustomer/getPersonalCenter?uuid_check=${this.get_uuid()}`, - } - options.headers = this.get_headers(options.method, options.url) - let { body: result } = await httpRequest(options); - //console.log(options); - result = JSON.parse(result); - //console.log(result); - if (result.code == "0") { - //console.log(`✅账号[${this.index}] 欢迎用户: ${result.errcode}🎉`); - this.userPoint = result.data.availableIntegral - - } else { - console.log(`❌[积分查询]失败`); - this.ckStatus = false; - } - } catch (e) { - console.log(e); - } - } - - async art_list() { - try { - let options = { - fn: "文章列表", - method: "get", - url: `https://beijing-gateway-customer.app-prod.bjev.com.cn/beijing-zone-dynamic/exterior/dynamic/list?isRecommend=1&pageIndex=2&pageSize=10&isHot=1&uuid_check=${this.get_uuid()}`, - } - options.headers = this.get_headers(options.method, options.url) - let { body: result } = await httpRequest(options); - //console.log(options); - result = JSON.parse(result); - //console.log(result); - if (result.code == "0") { - //领取成功 - //console.log(`✅[文章列表]成功`) - for (let artId of result.data.dataList) { - console.log(artId.liked) - if (artId.liked == "-1") {//判断未点赞的 - this.artList.push(artId.id) - - } - - } - } else { - console.log(`❌[${options.fn}]失败`) - console.log(JSON.stringify(result)) - } - } catch (e) { - console.log(e); - } - } - async task_like(entityId) { - try { - let options = { - fn: "点赞", - method: "post", - url: `https://beijing-gateway-customer.app-prod.bjev.com.cn/beijing-zone-dynamic/exterior/interact/like?uuid_check=${this.get_uuid()}`, - body: JSON.stringify({ "entityId": entityId, "listUid": "f4a67e8f-525d-4846-b1b4-52c7d6d67dab", "type": 2 }) - } - options.headers = this.get_headers(options.method, options.url, options.body) - let { body: result } = await httpRequest(options); - //console.log(options); - result = JSON.parse(result); - //console.log(result); - if (result.code == "0") { - //领取成功 - console.log(`✅[${options.fn}]成功`) - } else { - console.log(`❌[${options.fn}]失败`) - console.log(JSON.stringify(result)) - } - } catch (e) { - console.log(e); - } - } - - async task_share(entityId) { - //number - try { - let options = { - fn: "分享", - method: "post", - url: `https://beijing-gateway-customer.app-prod.bjev.com.cn/beijing-zone-dynamic/exterior/interact/dynamic/share?uuid_check=${this.get_uuid()}`, - body: JSON.stringify({ "entityId": entityId }) - } - options.headers = this.get_headers(options.method, options.url, options.body) - let { body: result } = await httpRequest(options); - //console.log(options); - result = JSON.parse(result); - //console.log(result); - if (result.code == "0") { - //领取成功 - console.log(`✅[${options.fn}]成功`) - } else { - console.log(`❌[${options.fn}]失败`) - console.log(JSON.stringify(result)) - } - } catch (e) { - console.log(e); - } - } - async task_award(taskGroupCode) { - try { - let options = { - fn: "领取奖励", - method: "post", - url: `https://beijing-gateway-customer.app-prod.bjev.com.cn/beijing-zone-asset/exterior/userTaskProgress/receiveAward?uuid_check=${this.get_uuid()}`, - body: JSON.stringify({ "taskGroupCode": taskGroupCode }) - } - options.headers = this.get_headers(options.method, options.url, options.body) - let { body: result } = await httpRequest(options); - //console.log(options); - result = JSON.parse(result); - //console.log(result); - if (result.code == "0") { - //领取成功 - $.log(`✅领取成功 获得[${result.data}]分`) - } else { - console.log(`❌[${options.fn}]失败`) - console.log(JSON.stringify(result)) - } - } catch (e) { - console.log(e); - } - } - - async task_list() { - try { - let options = { - fn: "任务列表", - method: "get", - url: `https://beijing-gateway-customer.app-prod.bjev.com.cn/beijing-zone-asset/exterior/userTaskProgress/selectTaskForMemberCenter?uuid_check=${this.get_uuid()}`, - } - options.headers = this.get_headers(options.method, options.url) - let { body: result } = await httpRequest(options); - //console.log(options); - result = JSON.parse(result); - //console.log(result); - if (result.code == "0") { - this.taskList = result.data[1].items - - } else { - console.log(`❌[${options.fn}]失败`); - - console.log(JSON.stringify(result)); - } - } catch (e) { - console.log(e); - } - } - - sha256(str) { - const crypto = require("crypto"); - return crypto.createHash("sha256").update(str).digest("hex"); - - } - get_headers(method, url, body = "") { - url = url.replace("https://beijing-gateway-customer.app-prod.bjev.com.cn", "") - let path = url.split('?')[0] - let params = url.split('?')[1].split('&').sort().join("").toLowerCase() - method = method.toUpperCase(); - let timestamp = new Date().getTime() - const key = `162e31f57f928bb34df22f99f04875de` - let str - if (method == "POST") { - str = `${method}${path}ice-auth-appkey:6164883796ice-auth-timestamp:${timestamp}json=${body}${params}${key}` - } else { - str = `${method}${path}ice-auth-appkey:6164883796ice-auth-timestamp:${timestamp}${params}${key}` - - } const sign = this.sha256(encodeURIComponent(str)) - return { - "Content-Type": "application/json;charset=UTF-8", - "User-Agent": "(Android 10; Xiaomi MI 8 Lite Build/V12.0.1.0.QDTCNXM 3.13.1 138 release bjApp baic-app-android)", - "versionInfo": "(Android 10; Xiaomi MI 8 Lite Build/V12.0.1.0.QDTCNXM 3.13.1 138 release bjApp baic-app-android)", - "Cache-Control": "no-cache", - "Authorization": `Bearer ` + this.ck, - //"userId": "", - "appKey": 6164883796, - "ice-auth-appkey": 6164883796, - "ice-auth-timestamp": timestamp, - "ice-auth-sign": sign, - "Content-Type": "application/json;charset=UTF-8", - "Host": "beijing-gateway-customer.app-prod.bjev.com.cn", - "Connection": "Keep-Alive", - "Accept-Encoding": "gzip" - } - } - get_uuid() { - return 'xxxxxxxx-xxxx-xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { - var r = Math.random() * 16 | 0, - v = c == 'x' ? r : (r & 0x3 | 0x8); - return v.toString(16); - }); - } -} - -async function start() { - let taskall = []; - for (let user of userList) { - if (user.ckStatus) { - taskall.push(await user.main()); - } - } - await Promise.all(taskall); - $.msg($.name, `任务已完成`) -} - -!(async () => { - if (!(await checkEnv())) return; - if (userList.length > 0) { - await start(); - } - - await SendMsg($.logs.join("\n")) -})() - .catch((e) => console.log(e)) - .finally(() => $.done()); - -//******************************************************** -/** - * 变量检查与处理 - * @returns - */ -async function checkEnv() { - let userCookie = ($.isNode() ? process.env[ckName] : $.getdata(ckName)) || ""; - if (userCookie) { - let e = envSplitor[0]; - for (let o of envSplitor) - if (userCookie.indexOf(o) > -1) { - e = o; - break; - } - for (let n of userCookie.split(e)) n && userList.push(new UserInfo(n)); - } else { - console.log("未找到CK"); - return; - } - return console.log(`共找到${userList.length}个账号`), true; //true == !0 -} - -///////////////////////////////////////////////////////////////////////////////////// -function httpRequest(options) { - if (!options["method"]) { - return console.log(`请求方法不存在`); - } - if (!options["fn"]) { - console.log(`函数名不存在`); - } - return new Promise((resolve) => { - $[options.method](options, (err, resp, data) => { - try { - if (err) { - $.logErr(err); - } else { - try { - resp = JSON.parse(resp); - } catch (error) { } - } - } catch (e) { - $.logErr(e, resp); - } finally { - resolve(resp); - } - }); - }); -} -async function SendMsg(message) { - if (!message) return; - if ($.isNode()) { - await notify.sendNotify($.name, message) - } else { - $.msg($.name, '', message) - } -} -// prettier-ignore -function Env(t, s) { return new (class { constructor(t, s) { (this.name = t), (this.data = null), (this.dataFile = "box.dat"), (this.logs = []), (this.logSeparator = "\n"), (this.startTime = new Date().getTime()), Object.assign(this, s), 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 } getScript(t) { return new Promise((s) => { this.get({ url: t }, (t, e, i) => s(i)) }) } runScript(t, s) { return new Promise((e) => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let o = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); (o = o ? 1 * o : 20), (o = s && s.timeout ? s.timeout : o); const [h, a] = i.split("@"), r = { url: `http://${a}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: o }, headers: { "X-Key": h, Accept: "*/*" }, }; this.post(r, (t, s, i) => e(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), s = this.path.resolve(process.cwd(), this.dataFile), e = this.fs.existsSync(t), i = !e && this.fs.existsSync(s); if (!e && !i) return {}; { const i = e ? t : s; 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), s = this.path.resolve(process.cwd(), this.dataFile), e = this.fs.existsSync(t), i = !e && this.fs.existsSync(s), o = JSON.stringify(this.data); e ? this.fs.writeFileSync(t, o) : i ? this.fs.writeFileSync(s, o) : this.fs.writeFileSync(t, o) } } lodash_get(t, s, e) { const i = s.replace(/\[(\d+)\]/g, ".$1").split("."); let o = t; for (const t of i) if (((o = Object(o)[t]), void 0 === o)) return e; return o } lodash_set(t, s, e) { return Object(t) !== t ? t : (Array.isArray(s) || (s = s.toString().match(/[^.[\]]+/g) || []), (s.slice(0, -1).reduce((t, e, i) => Object(t[e]) === t[e] ? t[e] : (t[e] = Math.abs(s[i + 1]) >> 0 == +s[i + 1] ? [] : {}), t)[s[s.length - 1]] = e), t) } getdata(t) { let s = this.getval(t); if (/^@/.test(t)) { const [, e, i] = /^@(.*?)\.(.*?)$/.exec(t), o = e ? this.getval(e) : ""; if (o) try { const t = JSON.parse(o); s = t ? this.lodash_get(t, i, "") : s } catch (t) { s = "" } } return s } setdata(t, s) { let e = !1; if (/^@/.test(s)) { const [, i, o] = /^@(.*?)\.(.*?)$/.exec(s), h = this.getval(i), a = i ? ("null" === h ? null : h || "{}") : "{}"; try { const s = JSON.parse(a); this.lodash_set(s, o, t), (e = this.setval(JSON.stringify(s), i)) } catch (s) { const h = {}; this.lodash_set(h, o, t), (e = this.setval(JSON.stringify(h), i)) } } else e = this.setval(t, s); return e } 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, s) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, s) : this.isQuanX() ? $prefs.setValueForKey(t, s) : this.isNode() ? ((this.data = this.loaddata()), (this.data[s] = t), this.writedata(), !0) : (this.data && this.data[s]) || 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, s = () => { }) { t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? $httpClient.get(t, (t, e, i) => { !t && e && ((e.body = i), (e.statusCode = e.status)), s(t, e, i) }) : this.isQuanX() ? $task.fetch(t).then((t) => { const { statusCode: e, statusCode: i, headers: o, body: h } = t; s(null, { status: e, statusCode: i, headers: o, body: h }, h) }, (t) => s(t)) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, s) => { try { const e = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); this.ckjar.setCookieSync(e, null), (s.cookieJar = this.ckjar) } catch (t) { this.logErr(t) } }).then((t) => { const { statusCode: e, statusCode: i, headers: o, body: h, } = t; s(null, { status: e, statusCode: i, headers: o, body: h }, h) }, (t) => s(t))) } post(t, s = () => { }) { if ((t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), delete t.headers["Content-Length"], this.isSurge() || this.isLoon())) $httpClient.post(t, (t, e, i) => { !t && e && ((e.body = i), (e.statusCode = e.status)), s(t, e, i) }); else if (this.isQuanX()) (t.method = "POST"), $task.fetch(t).then((t) => { const { statusCode: e, statusCode: i, headers: o, body: h } = t; s(null, { status: e, statusCode: i, headers: o, body: h }, h) }, (t) => s(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: e, ...i } = t; this.got.post(e, i).then((t) => { const { statusCode: e, statusCode: i, headers: o, body: h } = t; s(null, { status: e, statusCode: i, headers: o, body: h }, h) }, (t) => s(t)) } } time(t) { let s = { "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 e in s) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? s[e] : ("00" + s[e]).substr(("" + s[e]).length))); return t } msg(s = t, e = "", i = "", o) { const h = (t) => !t || (!this.isLoon() && this.isSurge()) ? t : "string" == typeof t ? this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : void 0 : "object" == typeof t && (t["open-url"] || t["media-url"]) ? this.isLoon() ? t["open-url"] : this.isQuanX() ? t : void 0 : void 0; this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(s, e, i, h(o)) : this.isQuanX() && $notify(s, e, i, h(o))); let logs = ['', '==============📣系统通知📣==============']; logs.push(t); e ? logs.push(e) : ''; i ? logs.push(i) : ''; console.log(logs.join('\n')); this.logs = this.logs.concat(logs) } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, s) { const e = !this.isSurge() && !this.isQuanX() && !this.isLoon(); e ? this.log("", `\u2757\ufe0f${this.name},\u9519\u8bef!`, t.stack) : this.log("", `\u2757\ufe0f${this.name},\u9519\u8bef!`, t) } wait(t) { return new Promise((s) => setTimeout(s, t)) } done(t = {}) { const s = new Date().getTime(), e = (s - this.startTime) / 1e3; this.log("", `\ud83d\udd14${this.name},\u7ed3\u675f!\ud83d\udd5b ${e}\u79d2`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } })(t, s) } diff --git a/daily/colorful.js b/daily/colorful.js index 173c6f4..b9ba1ef 100644 --- a/daily/colorful.js +++ b/daily/colorful.js @@ -91,7 +91,7 @@ class Task { const crypto = require('crypto'); return crypto.createHash('md5').update(str).digest('hex'); } - async request(options) { + request(options) { let appid = "815d8026-9a52-4445-a42c-a5443134232e" let uuid = $.uuid() let timestamp = Date.now() @@ -110,7 +110,7 @@ class Task { } options.headers = Object.assign(baseHeaders, options.headers) - return await axios.request(options) + return axios.request(options) } async signIn() { let options = { diff --git a/daily/dw.js b/daily/dw.js new file mode 100644 index 0000000..990932c --- /dev/null +++ b/daily/dw.js @@ -0,0 +1,303 @@ +/* +------------------------------------------ +@Author: sm +@Date: 2024.06.07 19:15 +@Description: 得物APP 0元抽 +cron: 30 8 * * * +------------------------------------------ +#Notice: +得物0元抽 +⚠️【免责声明】 +------------------------------------------ +1、此脚本仅用于学习研究,不保证其合法性、准确性、有效性,请根据情况自行判断,本人对此不承担任何保证责任。 +2、由于此脚本仅用于学习研究,您必须在下载后 24 小时内将所有内容从您的计算机或手机或任何存储设备中完全删除,若违反规定引起任何事件本人对此均不负责。 +3、请勿将此脚本用于任何商业或非法目的,若违反规定请自行对此负责。 +4、此脚本涉及应用与本人无关,本人对因此引起的任何隐私泄漏或其他后果不承担任何责任。 +5、本人对任何脚本引发的问题概不负责,包括但不限于由脚本错误引起的任何损失和损害。 +6、如果任何单位或个人认为此脚本可能涉嫌侵犯其权利,应及时通知并提供身份证明,所有权证明,我们将在收到认证文件确认后删除此脚本。 +7、所有直接或间接使用、查看此脚本的人均应该仔细阅读此声明。本人保留随时更改或补充此声明的权利。一旦您使用或复制了此脚本,即视为您已接受此免责声明。 +*/ +const CryptoJS = require("crypto-js"); +const { Env } = require("./tools/env") +const $ = new Env("得物0元抽"); +let ckName = `dwck`; +const strSplitor = "#"; +process.env[ckName] = "a" +const axios = require("axios"); +const defaultUserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 16_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.31(0x18001e31) NetType/WIFI Language/zh_CN miniProgram" + + +class Task { + constructor(env) { + this.index = $.userIdx++ + this.user = env.split(strSplitor); + this.token = this.user[0]; + + } + + async run() { + + await this.zeroLotteryList() + } + + async zeroLotteryList() { + let data = { "source": "wotab" } + try { + let result = await this.taskRequest_task("post", `https://app.dewu.com/api/v1/h5/oss-platform/hacking-zero-lottery/v1/activity/query-today?sign=${this.calculateSign(data)}`, data) + console.log(result); + + if (result.code == 200) { + for (let i of result.data.activityList) { + let taskStatus = false + if (i.status == 0) { + if ("taskVo" in i) { + await this.DoTask(i.taskVo) + + } else { + await this.zeroLotteryEgnageIn(i.id) + } + } + } + } else { + $.log(`❌账号[${this.index}] 获取0元购列表失败[${result.msg}]🎉`) + //console.log(result); + } + } catch (e) { + console.log(e); + } + } + + + async DoTask(body) { + try { + let taskStatusResult = {}; + let commitBody = {}; + let preStatus = false + if (body.taskType == 50) { + taskStatusResult = await this.taskRequest_task("get", `https://app.dewu.com/hacking-task/v1/task/status?taskId=${body.taskId}&taskType=50&sign=94fd23c93d62ae0f75108f94c093b198`) + if (taskStatusResult.code == 200) { + if (taskStatusResult.data.status == 1) { + //$.log(`账号[${this.index}] 开始任务成功🎉`) + commitBody = { "taskId": body.taskId, "taskType": String(body.taskType), "btd": 0, spuId: 0 } + preStatus = true + } + } + } + if (body.taskType == 1) { + if ("classify" in body) { + if (body.classify == 2) { + taskStatusResult = await this.taskRequest_task("post", `https://app.dewu.com/hacking-task/v1/task/pre_commit?sign=b7382f4d908e04356f9646688afe096c`, { taskId: body.taskId, taskType: body.taskType, btn: 0 }) + //console.log(taskStatusResult); + if (taskStatusResult.code == 200) { + if (taskStatusResult.data.isOk == true) { + //$.log(`账号[${this.index}] 开始任务成功🎉`) + $.log(`延迟${body.countdownTime + 1}秒浏览${body.taskName}`) + await $.wait((body.countdownTime + 1) * 1000) + commitBody = { "taskId": body.taskId, "taskType": String(body.taskType), "activityType": null, "activityId": null, "taskSetId": null, "venueCode": null, "venueUnitStyle": null, "taskScene": null, "btd": 0 } + preStatus = true + } + } else { + $.log(`❌账号[${this.index}] 开始任务失败[${taskStatusResult.msg}]`); + } + } + } else { + /*taskStatusResult = await this.taskRequest_task("post", `https://app.dewu.com/hacking-task/v1/task/pre_commit?sign=b7382f4d908e04356f9646688afe096c`, { taskId: body.taskId, taskType: body.taskType, btn: 0 }) + if (taskStatusResult.code == 200) { + if (taskStatusResult.data.isOk == true) { + //$.log(`账号[${this.index}] 开始任务成功🎉`) + await $.wait(16000) + commitBody = { "taskId": body.taskId, "taskType": body.taskType, "activityType": null, "activityId": null, "taskSetId": null, "venueCode": null, "venueUnitStyle": null, "taskScene": null, "btd": 0 } + preStatus = true + } + } else { + $.log(`❌账号[${this.index}] 开始任务失败[${taskStatusResult.msg}]`); + }*/ + } + + + } + if (body.taskType == 123 || body.taskType == 124) { + commitBody = { "taskType": String(body.taskType) } + preStatus = true + } + //console.log(taskStatusResult) + if (preStatus == true) { + let commitResult = await this.taskRequest_task("post", `https://app.dewu.com/hacking-task/v1/task/commit?sign=826988b593cd8cd75162b6d3b7dade15`, commitBody) + //console.log(commitResult) + if (commitResult.code == 200) { + if (commitResult.data.status == 2) { + $.log(`账号[${this.index}] [${body.taskName}]任务成功🎉`) + return true + } else { + $.log(`账号[${this.index}] [${body.taskName}]任务失败🎉`) + } + } else { + $.log(`账号[${this.index}] [${body.taskName}]任务失败🎉`) + } + } else { + return false + } + } catch (e) { + console.log(e); + } + + } + generateIds() { + var Uo = Array(32); + var oe = "0000000000000000"; + + function Ho(e) { + for (var t = 0; t < 2 * e; t++) + Uo[t] = Math.floor(16 * Math.random()) + 48, + Uo[t] >= 58 && (Uo[t] += 39); + return String.fromCharCode.apply(null, Uo.slice(0, 2 * e)); + } + + var Mo = "00000000000000000000000000000000"; // Assuming Mo is defined somewhere else in your code + + var generateSpanId = function () { + return function (e) { + var t = e(8); + if (t === oe) + return Mo; + return t; + }(Ho); + }; + + var generateTraceId = function () { + return function (e) { + var t = Math.floor(Date.now() / 1e3).toString(16), + n = e(8), + r = e(3); + return "f5" + r + t + n; + }(Ho); + }; + + return "00-" + generateTraceId() + "-" + generateSpanId() + "-01" + }; + async taskRequest_task(method, url, data = "") { + + + let headers = { + "Host": "app.dewu.com", + "Connection": "keep-alive", + //"Content-Length": "62", + //"ua": "duapp/5.37.0(android;10)", + //"Origin": "https://cdn-m.dewu.com", + //"appid": "h5", + "SK": this.sk, + "x-auth-token": "Bearer " + this.ck, + + "traceparent": this.generateIds(), + "Content-Type": "application/json", + + /*"X-Requested-With": "com.shizhuang.duapp", + "Sec-Fetch-Site": "same-site", + "Sec-Fetch-Mode": "cors", + "Referer": "https://cdn-m.dewu.com/h5-growth/game-task?gameTaskFlag=true&taskId=Nr52k&taskType=50&countdownIcon=%7B%22countdownIcon%22%3A%22https%3A%2F%2Fcdn.poizon.com%2Fnode-common%2F28c7b3d4060e086551dcc84eca7bfbeb.png%22%2C%22hideCountdownIcon%22%3A%22https%3A%2F%2Fcdn.poizon.com%2Fnode-common%2Fa8b472c7622a53454d82745345cefa71.png%22%2C%22coordinate%22%3A%2212%2C600%22%7D&scrollbarColor=%2301C1C2&fontColor=%23FFFFFF&btd=83500&goodsCollect=goodsDetail&popId=0", + "Accept-Encoding": "gzip, deflate", + "Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",*/ + "Cookie": `duToken=${this.duToken};` + } + const reqeuestOptions = { + url: url, + method: method, + headers: headers + } + data == "" ? "" : Object.assign(reqeuestOptions, { data: JSON.stringify(data) }) + //console.log(reqeuestOptions) + try { + let { data: result } = await axios.request(reqeuestOptions) + return result + } catch (error) { + // $.log(`接口请求失败 `) + return { code: 0, msg: "接口请求失败" } + } + // + + } + createEncryptedBody(data) { + const key2 = "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBANMGZPlLobHYWoZyMvHD0a6emIjEmtf5Z6Q++VIBRulxsUfYvcczjB0fMVvAnd1douKmOX4G690q9NZ6Q7z/TV8CAwEAAQ=="; + const publicKeyPem = '-----BEGIN PUBLIC KEY-----\n' + + key2 + + '-----END PUBLIC KEY-----'; + + global["window"] = {} + const jsencrypt = require("jsencrypt") + const crypt = new jsencrypt() + crypt.setKey(publicKeyPem) + const n = this.randomStr(48, 16); + const encrypted = crypt.encrypt(n) + const enBody = CryptoJS.enc.Utf8.parse(data); + const enResult = CryptoJS.AES.encrypt(enBody, CryptoJS.enc.Utf8.parse(n.substr(10, 16)), { + iv: CryptoJS.enc.Utf8.parse(n.substr(20, 16)), + mode: CryptoJS.mode.CBC, + padding: CryptoJS.pad.Pkcs7, + }); + //console.log(encrypted); + //console.log(hexToBase64(encrypted)); + const newBody = { + data: encrypted + "​" + enResult.ciphertext.toString().toUpperCase(), + }; + newBody.sign = this.calculateSign(newBody); + return { enData: newBody, n }; + function hexToBase64(hexString) { + const buffer = Buffer.from(hexString, 'hex'); + const base64String = buffer.toString('base64'); + return base64String; + } + } + randomStr(length, charset) { var tmp1, tmp2, data = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), result = []; if (((charset = charset || data["length"]), length)) for (tmp1 = 0; tmp1 < length; tmp1++)result[tmp1] = data[0 | (Math.random() * charset)]; else for (result[8] = result[13] = result[18] = result[23] = "-", result[14] = "4", tmp1 = 0; tmp1 < 36; tmp1++)result[tmp1] || ((tmp2 = 0 | (16 * Math["random"]())), (result[tmp1] = data[19 === tmp1 ? (3 & tmp2) | 8 : tmp2])); return result["join"]("") } + decryptResponseBody(result, n) { + try { + const de1 = CryptoJS.enc.Hex.parse(result), + de2 = CryptoJS.enc.Base64.stringify(de1); + const decrypted = CryptoJS.AES.decrypt(de2, CryptoJS.enc.Utf8.parse(n.substr(10, 16)), { + iv: CryptoJS.enc.Utf8.parse(n.substr(20, 16)), + mode: CryptoJS.mode.CBC, + padding: CryptoJS.pad.Pkcs7, + }).toString(CryptoJS.enc.Utf8); + return decrypted; + } catch (error) { + n = "987654321012345678901234567890123456789012345678" + const de1 = CryptoJS.enc.Hex.parse(result), + de2 = CryptoJS.enc.Base64.stringify(de1); + const decrypted = CryptoJS.AES.decrypt(de2, CryptoJS.enc.Utf8.parse(n.substr(10, 16)), { + iv: CryptoJS.enc.Utf8.parse(n.substr(20, 16)), + mode: CryptoJS.mode.CBC, + padding: CryptoJS.pad.Pkcs7, + }).toString(CryptoJS.enc.Utf8); + return decrypted; + } + + } + //修复自 修改处理后 空值删除得情况 改为不删除 + calculateSign(requestBody) { const sortedKeys = Object.keys(requestBody).sort(); let signContent = sortedKeys.reduce((acc, key) => { const value = requestBody[key]; if (value === null) { return acc } if (typeof value === 'object' && !Array.isArray(value)) { return acc.concat(key).concat(JSON.stringify(value)) } if (Array.isArray(value)) { if (value.length > 0) { let typeOfFirstItem = typeof value[0]; if (typeOfFirstItem === 'object') { let arrayStr = ''; value.forEach((item, index) => { arrayStr += JSON.stringify(item) + (index !== value.length - 1 ? ',' : '') }); return acc.concat(key).concat(arrayStr) } } return acc.concat(key).concat(value.toString()) } return acc.concat(key).concat(value.toString()) }, ''); const secretKey = "048a9c4943398714b356a696503d2d36"; const hashedContent = CryptoJS.MD5(signContent.concat(secretKey)).toString(); return hashedContent } + + + + +} + +!(async () => { + await getNotice() + $.checkEnv(ckName); + + for (let user of $.userList) { + await new Task(user).run(); + } +})() + .catch((e) => console.log(e)) + .finally(() => $.done()); + +async function getNotice() { + let options = { + url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`, + headers: { + "User-Agent": defaultUserAgent, + } + } + let { data: res } = await axios.request(options); + $.log(res) + return res +} diff --git a/daily/hezj.js b/daily/hezj.js index 9788364..1d9a34f 100644 --- a/daily/hezj.js +++ b/daily/hezj.js @@ -35,7 +35,7 @@ class Task { this.token = this.user[0]; } - async request(options) { + request(options) { let baseHeaers = { "host": "zj.haier.net", "content-type": "application/json", @@ -54,7 +54,7 @@ class Task { "sec-fetch-dest": "empty" } options.headers = Object.assign(baseHeaers, options.headers) - return await axios.request(options) + return axios.request(options) } async run() { diff --git a/daily/hyjk.js b/daily/hyjk.js index 69e623e..dacda84 100644 --- a/daily/hyjk.js +++ b/daily/hyjk.js @@ -145,7 +145,7 @@ class Task { } - async request(options) { + request(options) { const finalOptions = { timeout: Number(process.env.HYJK_HTTP_TIMEOUT || 15000), ...options, diff --git a/daily/iqoo.js b/daily/iqoo.js index 412ecf4..acabc4c 100644 --- a/daily/iqoo.js +++ b/daily/iqoo.js @@ -39,7 +39,7 @@ class Task { this.threadId = '' } - async request(options) { + request(options) { let baseHeaders = { sign: this.getSign(options.method, options.url.split('https://bbs-api.iqoo.com')[1].split("?")[0], options.data ? options.data : ''), 'authorization': 'Bearer ' + this.token, @@ -51,7 +51,7 @@ class Task { options.headers = Object.assign(baseHeaders, options.headers) - return await axios.request(options) + return axios.request(options) } async userInfo() { let options = { diff --git a/daily/xinxi.js b/daily/xinxi.js index 0ebbc1c..85c81b9 100644 --- a/daily/xinxi.js +++ b/daily/xinxi.js @@ -51,7 +51,7 @@ class Task { )).join("&"); return crypto.createHash("md5").update(t).digest("hex") } - async request(options) { + request(options) { let req_timestamp = Date.now(); let request_id = Math.random().toString(36).substr(2, 9) + "-" + req_timestamp; let baseHeaders = { @@ -62,7 +62,7 @@ class Task { "sign": this.generateMd5Signature({ data: JSON.stringify(options.data), req_timestamp, request_id, }), } options.headers = { ...baseHeaders, ...options.headers } - return await axios.request(options) + return axios.request(options) } async userInfo() { diff --git a/wxapp/anmuxi.js b/wxapp/anmuxi.js index 9e0ae16..a2c41f6 100644 --- a/wxapp/anmuxi.js +++ b/wxapp/anmuxi.js @@ -27,8 +27,8 @@ const axios = require("axios"); const defaultUserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 16_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.31(0x18001e31) NetType/WIFI Language/zh_CN miniProgram" class Public { - async request(options) { - return await axios.request(options); + request(options) { + return axios.request(options); } } class Task extends Public { diff --git a/wxapp/kangshifu.js b/wxapp/kangshifu.js index bb24b14..6c7f612 100644 --- a/wxapp/kangshifu.js +++ b/wxapp/kangshifu.js @@ -30,8 +30,8 @@ const defaultUserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 16_5 like Mac OS X) let wxcenter = process.env.wxcenter || "" let appid = 'wx54f3e6a00f7973a7' class Public { - async request(options) { - return await axios.request(options); + request(options) { + return axios.request(options); } } class Task extends Public { diff --git a/wxapp/ppmt.js b/wxapp/ppmt.js index f7160a8..602f8c8 100644 --- a/wxapp/ppmt.js +++ b/wxapp/ppmt.js @@ -315,7 +315,7 @@ async function Request(options) { const axios = require("axios"); Request = async (options) => { try { - return await axios.request(options); + return axios.request(options); } catch (error) { throw error && error.error ? error.error : "请求失败"; } diff --git a/wxapp/wx_xlxyh.js b/wxapp/wx_xlxyh.js index 5993af0..17e6952 100644 --- a/wxapp/wx_xlxyh.js +++ b/wxapp/wx_xlxyh.js @@ -31,7 +31,7 @@ class Env { async httpRequest(config) { if (this.isNode()) { const axios = require('axios'); - return await axios(config); + return axios(config); } else { return new Promise((resolve, reject) => { const xhr = new XMLHttpRequest(); diff --git a/wxapp/可口可乐吧.js b/wxapp/可口可乐吧.js index 6fefa99..c2a641b 100644 --- a/wxapp/可口可乐吧.js +++ b/wxapp/可口可乐吧.js @@ -26,8 +26,8 @@ const axios = require("axios"); const defaultUserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 16_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.31(0x18001e31) NetType/WIFI Language/zh_CN miniProgram" class Public { - async request(options) { - return await axios.request(options); + request(options) { + return axios.request(options); } } class Task extends Public {