From c6b8850e85d34ff930c3bc17883588a9e076b917 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Sun, 7 Feb 2021 21:32:46 +0800 Subject: [PATCH 001/128] fixed dailyYYY.js --- commands/tasks/unicom/dailyYYY.js | 67 ++++++++++++++++++++++++------- 1 file changed, 53 insertions(+), 14 deletions(-) diff --git a/commands/tasks/unicom/dailyYYY.js b/commands/tasks/unicom/dailyYYY.js index 9c051df47..65b99e1df 100644 --- a/commands/tasks/unicom/dailyYYY.js +++ b/commands/tasks/unicom/dailyYYY.js @@ -38,6 +38,25 @@ var secretkeyArray = function () { return e; } +var newjiamarr = () => { + for (var e = [], k = '', t = ['0', '1', '2', '3', '4', '5', '6', '7', '8', + '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', + 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', + 'y', 'z'], i = 0x0; 0x4 > i; i++) { + for (var n = '', s = 0x0; 16 > s; s++) { + // var a = Math.floor(62 * Math.random()); + var a = Math.floor(0x3e * Math.random()); + n += t[a]; + } + e.push(n), k += n.substring(0x0, 0x4); + } + return { + 'arr': e, + 'zfc': k + }; +}; + var encrypt = function (word, keyStr) { var key = CryptoJS.enc.Utf8.parse(keyStr); var srcs = CryptoJS.enc.Utf8.parse(word); @@ -203,7 +222,7 @@ var dailyYYY = { 'type': '广告', 'orderId': params['orderId'], 'phoneType': 'android', - 'version': '8.01' + 'version': '8.0101' } advertTimes-- @@ -211,19 +230,39 @@ var dailyYYY = { } else { freeTimes-- } + let n = Math.floor(5 * Math.random()) + let i = newjiamarr(); + params = { + "params": encrypt(JSON.stringify(t), i['zfc']) + n, + "parKey": i['arr'] + } res = await axios.request({ headers: { - "user-agent": useragent, "Authorization": `Bearer ${Authorization}`, + "user-agent": useragent, "referer": "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/shake/index.html?jump=sign", - "Content-Type": "application/x-www-form-urlencoded" + "origin": "https://m.jf.10010.com", + "Content-Type": "application/json" }, - jar: null, - url: `https://m.jf.10010.com/jf-yuech/api/gameResultV2/consumptionGameTimes`, - method: 'get', - params: transParams(p1) + url: `https://m.jf.10010.com/jf-yuech/api/gameResultV2/minusGameTimes`, + method: 'post', + data: params }).catch(err => console.log(err)) + //deprecated from official API call + // res = await axios.request({ + // headers: { + // "user-agent": useragent, + // "Authorization": `Bearer ${Authorization}`, + // "referer": "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/shake/index.html?jump=sign", + // "Content-Type": "application/x-www-form-urlencoded" + // }, + // jar: null, + // url: `https://m.jf.10010.com/jf-yuech/api/gameResultV2/consumptionGameTimes`, + // method: 'get', + // params: transParams(p1) + // }).catch(err => console.log(err)) + if (res.data.code !== 0) { throw new Error(res.data.message) @@ -239,20 +278,20 @@ var dailyYYY = { } let n = Math.floor(5 * Math.random()) - let i = secretkeyArray() - + let i = newjiamarr() params = { - "params": encrypt(JSON.stringify(t), i[n]) + n, - "parKey": i + "params": encrypt(JSON.stringify(t), i['zfc']) + n, + "parKey": i['arr'] } res = await axios.request({ headers: { "Authorization": `Bearer ${Authorization}`, "user-agent": useragent, - "referer": "https://img.jf.10010.com/", - "origin": "https://img.jf.10010.com" + "referer": "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/shake/index.html?jump=sign", + "origin": "https://m.jf.10010.com", + "Content-Type": "application/json;charset=UTF-8" }, - url: `https://m.jf.10010.com/jf-yuech/api/gameResultV2/luckDraw`, + url: `https://m.jf.10010.com/jf-yuech/api/gameResultV2/luckDrawForPrize`, method: 'post', data: params }) From 8cae609ba6b941dd0cba4f84add6146ee8a25920 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Sun, 7 Feb 2021 21:40:57 +0800 Subject: [PATCH 002/128] Update dailyYYY.js --- commands/tasks/unicom/dailyYYY.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/tasks/unicom/dailyYYY.js b/commands/tasks/unicom/dailyYYY.js index 65b99e1df..075f6ea5a 100644 --- a/commands/tasks/unicom/dailyYYY.js +++ b/commands/tasks/unicom/dailyYYY.js @@ -222,7 +222,7 @@ var dailyYYY = { 'type': '广告', 'orderId': params['orderId'], 'phoneType': 'android', - 'version': '8.0101' + 'version': '8.0102' } advertTimes-- From 2233d622301ebedd9309dbe7df9f049b258668d3 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Sun, 7 Feb 2021 22:27:09 +0800 Subject: [PATCH 003/128] Update dailyYYY.js --- commands/tasks/unicom/dailyYYY.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/commands/tasks/unicom/dailyYYY.js b/commands/tasks/unicom/dailyYYY.js index 075f6ea5a..75ef22374 100644 --- a/commands/tasks/unicom/dailyYYY.js +++ b/commands/tasks/unicom/dailyYYY.js @@ -234,7 +234,7 @@ var dailyYYY = { let i = newjiamarr(); params = { - "params": encrypt(JSON.stringify(t), i['zfc']) + n, + "params": encrypt(JSON.stringify(p1), i['zfc']) + n, "parKey": i['arr'] } res = await axios.request({ @@ -263,7 +263,7 @@ var dailyYYY = { // params: transParams(p1) // }).catch(err => console.log(err)) - + console.log(res.data); if (res.data.code !== 0) { throw new Error(res.data.message) } else { @@ -277,8 +277,8 @@ var dailyYYY = { resultId: res.data.data.resultId } - let n = Math.floor(5 * Math.random()) - let i = newjiamarr() + // n = Math.floor(5 * Math.random()) + i = newjiamarr() params = { "params": encrypt(JSON.stringify(t), i['zfc']) + n, "parKey": i['arr'] @@ -295,6 +295,7 @@ var dailyYYY = { method: 'post', data: params }) + console.log(res.data); result = res.data if (result.code !== 0) { console.log("摇一摇送好礼:", result.message) From 27d5d453b1b7e8d31f56c44246c574b7b1b8aa9e Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Sun, 7 Feb 2021 22:33:02 +0800 Subject: [PATCH 004/128] =?UTF-8?q?=E2=9C=94hidden=20console.log=20for=20s?= =?UTF-8?q?ome=20reason.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/dailyYYY.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/tasks/unicom/dailyYYY.js b/commands/tasks/unicom/dailyYYY.js index 75ef22374..f6028c537 100644 --- a/commands/tasks/unicom/dailyYYY.js +++ b/commands/tasks/unicom/dailyYYY.js @@ -295,7 +295,7 @@ var dailyYYY = { method: 'post', data: params }) - console.log(res.data); + result = res.data if (result.code !== 0) { console.log("摇一摇送好礼:", result.message) From c4232658fab799a2b8f2111b8f3ec9bcd1597c63 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Mon, 8 Feb 2021 15:18:05 +0800 Subject: [PATCH 005/128] =?UTF-8?q?=F0=9F=9A=A7=20creating=20a=20new=20gam?= =?UTF-8?q?e=20event?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/bcow.js | 334 ++++++++++++++++ commands/tasks/unicom/dailyEggachine.js | 50 +++ commands/tasks/unicom/dailyYYY.js | 498 +++++++++++++----------- commands/tasks/unicom/handlers/PAES.js | 61 +++ commands/tasks/unicom/unicom.js | 411 ++++++++++++------- 5 files changed, 982 insertions(+), 372 deletions(-) create mode 100644 commands/tasks/unicom/bcow.js create mode 100644 commands/tasks/unicom/dailyEggachine.js create mode 100644 commands/tasks/unicom/handlers/PAES.js diff --git a/commands/tasks/unicom/bcow.js b/commands/tasks/unicom/bcow.js new file mode 100644 index 000000000..1e6016609 --- /dev/null +++ b/commands/tasks/unicom/bcow.js @@ -0,0 +1,334 @@ +let crypto = require("crypto"); +let CryptoJS = require("crypto-js"); +let moment = require("moment"); +let AES = require("./handlers/PAES"); +const useragent = (options) => + `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0102,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; +module.exports = bcow = { + doTask: async (axios, options) => { + console.log("🔔开始抽牛卡\n"); + let cookies = await getOpenPlatLine(axios, options); + let data = await postFreeLoginRock(axios, options, cookies); + }, + getOpenPlatLine: async (axios, options) => { + let searchParams = {}; + let result = await axios + .request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": useragent(options), + referer: `https://img.client.10010.com/`, + origin: "https://img.client.10010.com", + }, + url: `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://m.jf.10010.com/jf-order/avoidLogin/forActive/ncow&duanlianjieabc=tbLlf`, + method: "GET", + transformResponse: (data, headers) => { + if ("location" in headers) { + let uu = new URL(headers.location); + let pp = {}; + for (let p of uu.searchParams) { + pp[p[0]] = p[1]; + } + if ("ticket" in pp) { + searchParams = pp; + } + } + return data; + }, + }) + .catch((err) => console.log(err)); + let jar1 = result.config.jar; + + let cookiesJson = jar1.toJSON(); + console.log(cookiesJson); + let ecs_token = cookiesJson.cookies.find((i) => i.key == "ecs_token"); + if (!ecs_token) { + throw new Error("ecs_token缺失"); + } + ecs_token = ecs_token.value; + let jfid = cookiesJson.cookies.find((i) => i.key == "_jf_id"); + if (!jfid) { + throw new Error("jfid缺失"); + } + jfid = jfid.value; + return { jfid, searchParams, jar1 }; + }, + postFreeLoginRock: async (axios, options, { jfid, searchParams, jar1 }) => { + let keyArr = AES.secretkeyArray(); + let keyrdm = Math.floor(Math.random() * 5); + + let params = { + activityId: "Ac-yccnk", + userCookie: jfid, + userNumber: searchParams.userNumber, + time: new Date().getTime(), + }; + let reqdata = { + params: encrypt(JSON.stringify(params), keyArr[keyrdm]) + keyrdm, + parKey: keyArr, + }; + //foods list + let res = await axios + .request({ + baseURL: "https://m.jf.10010.com/", + headers: { + "user-agent": useragent(options), + referer: + "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-qd/bcow/index.html?jump=sign", + origin: "https://img.jf.10010.com", + "Content-Type": "application/json", + }, + jar: jar1, + url: `/jf-yuech/p/freeLoginRock`, + method: "post", + data: reqdata, + }) + .catch((err) => console.log(err)); + + result = res.data; + if (result.code !== 0) { + throw new Error(result.message); + } + let activity = result.data.activityInfos.activityVOs[0]; //available items on the list from request + let Authorization = result.data.token.access_token; + let freeTimes = activity.activityTimesInfo.freeTimes; + let advertTimes = activity.activityTimesInfo.advertTimes; + return { activity, Authorization, freeTimes, advertTimes }; + }, + postTimesDrawForPrize: async ( + axios, + options, + { jfid, searchParams, jar1 }, + { activity, Authorization, freeTimes, advertTimes } + ) => { + do { + let orderId = ""; + + console.log( + "已消耗机会", + 1 + 4 - (freeTimes + advertTimes), + "剩余免费机会", + freeTimes, + "看视频广告机会", + advertTimes + ); + + if (!freeTimes && !advertTimes) { + console.log("没有游戏次数"); + break; + } + + let currentTimes = 1 + 4 - (freeTimes + advertTimes) + 1; + + let p1 = { + activityId: activity.activityId, + currentTimes: freeTimes, + type: "免费", + }; + + //check game time information + if (!freeTimes && advertTimes) { + let params = { + arguments1: "AC20200611152252", + arguments2: "GGPD", + arguments3: "627292f1243148159c58fd58917c3e67", + arguments4: new Date().getTime(), + arguments6: "517050707", + arguments7: "517050707", + arguments8: "123456", + arguments9: "4640b530b3f7481bb5821c6871854ce5", + netWay: "Wifi", + remark1: "签到翻牛牌活动", + remark: "签到看视频翻倍得积分", + version: `android@8.0102`, + codeId: 945689604, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + params.arguments6, + params.arguments7, + params.arguments8, + params.arguments9, + ]); + params["orderId"] = crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"); + params["arguments4"] = new Date().getTime(); + + result = await require("./taskcallback").reward(axios, { + ...options, + params, + jar: jar1, + }); + + let timestamp = moment().format("YYYYMMDDHHmmss"); + result = await axios.request({ + headers: { + "user-agent": useragent(options), + referer: `https://img.client.10010.com/`, + }, + url: `https://m.jf.10010.com/jf-order/avoidLogin/forActive/ncow?ticket=${searchParams.ticket}&type=02&version=android@8.0102×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&duanlianjieabc=tbLlf&userNumber=${options.user}`, + method: "GET", + }); + + p1 = { + activityId: activity.activityId, + currentTimes: advertTimes, + type: "广告", + orderId: params["orderId"], + phoneType: "android", + version: "8.0102", + }; + advertTimes--; + orderId = params["orderId"]; + } else { + freeTimes--; + } + + //join the game + let n = Math.floor(5 * Math.random()); + let i = newjiamarr(); + params = { + params: encrypt(JSON.stringify(p1), i["zfc"]) + n, + parKey: i["arr"], + }; + + res = await axios + .request({ + baseURL: "https://m.jf.10010.com/", + headers: { + Authorization: `Bearer ${Authorization}`, + "user-agent": useragent(options), + referer: + "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-qd/bcow/index.html?jump=sign", + origin: "https://m.jf.10010.com", + "Content-Type": "application/json;charset=UTF-8", + }, + url: `/jf-yuech/api/gameResultV2/timesDrawForPrize`, + method: "post", + data: params, + }) + .catch((err) => console.log(err)); + + console.log(res.data); + if (res.data.code !== 0) { + throw new Error(res.data.message); + } else { + if (res.data.data.code !== "0") { + throw new Error(res.data.data.result); + } + } + + //TODO: coding in here now... + result = res.data; + if (result.code !== 0) { + console.log("翻牛牌送好礼:", result.message); + } else { + console.log( + "翻牛牌送好礼:", + result.data.status === "中奖" + ? result.data.prizeName + : result.data.status + ); + if (result.data.doublingStatus) { + console.log("提交积分翻倍"); + await dailyYYY.lookVideoDouble(axios, { + ...options, + }); + await dailyYYY.lookVideoDoubleResult(axios, { + ...options, + Authorization, + activityId: activity.activityId, + winningRecordId: result.data.winningRecordId, + }); + } + } + } while (freeTimes || advertTimes); + }, + lookVideoDouble: async (axios, options) => { + let params = { + arguments1: "AC20200611152252", + arguments2: "GGPD", + arguments3: "627292f1243148159c58fd58917c3e67", + arguments4: new Date().getTime(), + arguments6: "517050707", + arguments7: "517050707", + arguments8: "123456", + arguments9: "4640b530b3f7481bb5821c6871854ce5", + netWay: "Wifi", + remark1: "签到翻牛牌活动", + remark: "签到看视频翻倍得积分", + version: `android@8.0102`, + codeId: 945689604, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + let { num, jar } = await require("./taskcallback").query(axios, { + ...options, + params, + }); + + if (!num) { + console.log("签到小游戏翻牛牌: 今日已完成"); + return; + } + + params = { + arguments1: "AC20200611152252", // acid + arguments2: "GGPD", // yhChannel + arguments3: "627292f1243148159c58fd58917c3e67", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "", + arguments7: "", + arguments8: "", + arguments9: "", + orderId: crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"), + netWay: "Wifi", + remark: "签到小游戏翻牛牌", + version: `android@8.0100`, + codeId: 945689604, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + await require("./taskcallback").doTask(axios, { + ...options, + params, + jar, + }); + }, + lookVideoDoubleResult: async (axios, options) => { + let { Authorization, activityId, winningRecordId } = options; + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; + let res = await axios.request({ + headers: { + Authorization: `Bearer ${Authorization}`, + "user-agent": useragent, + referer: "https://img.jf.10010.com/", + origin: "https://img.jf.10010.com", + }, + url: `https://m.jf.10010.com/jf-yuech/api/gameResult/doublingIntegral?activityId=${activityId}&winningRecordId=${winningRecordId}`, + method: "get", + }); + result = res.data; + if (result.code !== 0) { + console.log("翻牛牌送好礼翻倍结果:", result.message); + } else { + console.log("翻牛牌送好礼翻倍结果:", result.data); + } + }, +}; diff --git a/commands/tasks/unicom/dailyEggachine.js b/commands/tasks/unicom/dailyEggachine.js new file mode 100644 index 000000000..9ef99e62b --- /dev/null +++ b/commands/tasks/unicom/dailyEggachine.js @@ -0,0 +1,50 @@ +let crypto = require("crypto"); +let CryptoJS = require("crypto-js"); +let moment = require("moment"); + +module.exports = eggachine = { + doTask: async (axios, options) => { + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0102,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; + let searchParams = {}; + let result = await axios + .request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": useragent, + referer: `https://img.client.10010.com/`, + origin: "https://img.client.10010.com", + }, + url: `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://m.jf.10010.com/jf-order/avoidLogin/forActive/ncow&duanlianjieabc=tbLlf`, + url: `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://m.jf.10010.com/jf-order/avoidLogin/forActive/stxyndj`, + method: "GET", + transformResponse: (data, headers) => { + if ("location" in headers) { + let uu = new URL(headers.location); + let pp = {}; + for (let p of uu.searchParams) { + pp[p[0]] = p[1]; + } + if ("ticket" in pp) { + searchParams = pp; + } + } + return data; + }, + }) + .catch((err) => console.log(err)); + let jar1 = result.config.jar; + + let cookiesJson = jar1.toJSON(); + console.log(cookiesJson); + let ecs_token = cookiesJson.cookies.find((i) => i.key == "ecs_token"); + if (!ecs_token) { + throw new Error("ecs_token缺失"); + } + ecs_token = ecs_token.value; + let jfid = cookiesJson.cookies.find((i) => i.key == "_jf_id"); + if (!jfid) { + throw new Error("jfid缺失"); + } + jfid = jfid.value; + }, +}; diff --git a/commands/tasks/unicom/dailyYYY.js b/commands/tasks/unicom/dailyYYY.js index f6028c537..291dc5d03 100644 --- a/commands/tasks/unicom/dailyYYY.js +++ b/commands/tasks/unicom/dailyYYY.js @@ -1,59 +1,57 @@ -var crypto = require('crypto'); +var crypto = require("crypto"); var CryptoJS = require("crypto-js"); -var moment = require('moment'); +var moment = require("moment"); // 摇一摇送好礼 -var transParams = (data) => { +let transParams = (data) => { let params = new URLSearchParams(); for (let item in data) { - params.append(item, data['' + item + '']); + params.append(item, data["" + item + ""]); } return params; }; var sign = (data) => { - let str = 'integralofficial&' - let params = [] + let str = "integralofficial&"; + let params = []; data.forEach((v, i) => { if (v) { - params.push('arguments' + (i + 1) + v) + params.push("arguments" + (i + 1) + v); } }); - return crypto.createHash('md5').update(str + params.join('&')).digest('hex') -} + return crypto + .createHash("md5") + .update(str + params.join("&")) + .digest("hex"); +}; +// prettier-ignore +let charMap = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", +"F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", +"Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", +"r", "s", "t", "u", "v", "w", "x", "y", "z"]; var secretkeyArray = function () { - for (var e = [], t = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", - "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", - "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", - "r", "s", "t", "u", "v", "w", "x", "y", "z"], i = 0; - 5 > i; - i++) { - for (var n = "", s = 0; 16 > s; s++) { - var a = Math.floor(62 * Math.random()); - n += t[a] + for (let e = [], t = charMap, i = 0; 5 > i; i++) { + for (let n = "", s = 0; 16 > s; s++) { + let a = Math.floor(62 * Math.random()); + n += t[a]; } - e.push(n) + e.push(n); } return e; -} +}; var newjiamarr = () => { - for (var e = [], k = '', t = ['0', '1', '2', '3', '4', '5', '6', '7', '8', - '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', - 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', - 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', - 'y', 'z'], i = 0x0; 0x4 > i; i++) { - for (var n = '', s = 0x0; 16 > s; s++) { - // var a = Math.floor(62 * Math.random()); - var a = Math.floor(0x3e * Math.random()); + for (let e = [], k = "", t = charMap, i = 0x0; 0x4 > i; i++) { + for (let n = "", s = 0x0; 16 > s; s++) { + let a = Math.floor(0x3e * Math.random()); n += t[a]; } - e.push(n), k += n.substring(0x0, 0x4); + e.push(n), (k += n.substring(0x0, 0x4)); } return { - 'arr': e, - 'zfc': k + arr: e, + zfc: k, }; }; @@ -62,193 +60,215 @@ var encrypt = function (word, keyStr) { var srcs = CryptoJS.enc.Utf8.parse(word); var encrypted = CryptoJS.AES.encrypt(srcs, key, { mode: CryptoJS.mode.ECB, - padding: CryptoJS.pad.Pkcs7 + padding: CryptoJS.pad.Pkcs7, }); return encrypted.toString(); -} +}; var decrypt = function (word, keyStr) { var key = CryptoJS.enc.Utf8.parse(keyStr); var decrypted = CryptoJS.AES.decrypt(word, key, { mode: CryptoJS.mode.ECB, - padding: CryptoJS.pad.Pkcs7 + padding: CryptoJS.pad.Pkcs7, }); return decrypted.toString(CryptoJS.enc.Utf8); -} - - +}; var dailyYYY = { doTask: async (axios, options) => { - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}` - let searchParams = {} - let result = await axios.request({ - baseURL: 'https://m.client.10010.com/', - headers: { - "user-agent": useragent, - "referer": `https://img.client.10010.com/`, - "origin": "https://img.client.10010.com" - }, - url: `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://m.jf.10010.com/jf-order/avoidLogin/forActive/yyyqd&duanlianjieabc=tbkwx`, - method: 'GET', - transformResponse: (data, headers) => { - if ('location' in headers) { - let uu = new URL(headers.location) - let pp = {} - for (let p of uu.searchParams) { - pp[p[0]] = p[1] - } - if ('ticket' in pp) { - searchParams = pp + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; + let searchParams = {}; + let result = await axios + .request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": useragent, + referer: `https://img.client.10010.com/`, + origin: "https://img.client.10010.com", + }, + url: `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://m.jf.10010.com/jf-order/avoidLogin/forActive/yyyqd&duanlianjieabc=tbkwx`, + method: "GET", + transformResponse: (data, headers) => { + if ("location" in headers) { + let uu = new URL(headers.location); + let pp = {}; + for (let p of uu.searchParams) { + pp[p[0]] = p[1]; + } + if ("ticket" in pp) { + searchParams = pp; + } } - } - return data - } - }).catch(err => console.log(err)) - let jar1 = result.config.jar + return data; + }, + }) + .catch((err) => console.log(err)); + let jar1 = result.config.jar; - let cookiesJson = jar1.toJSON() - let ecs_token = cookiesJson.cookies.find(i => i.key == 'ecs_token') + let cookiesJson = jar1.toJSON(); + let ecs_token = cookiesJson.cookies.find((i) => i.key == "ecs_token"); if (!ecs_token) { - throw new Error('ecs_token缺失') + throw new Error("ecs_token缺失"); } - ecs_token = ecs_token.value - let jfid = cookiesJson.cookies.find(i => i.key == '_jf_id') + ecs_token = ecs_token.value; + let jfid = cookiesJson.cookies.find((i) => i.key == "_jf_id"); if (!jfid) { - throw new Error('jfid缺失') + throw new Error("jfid缺失"); } - jfid = jfid.value + jfid = jfid.value; // let ff = { "params": "vogRkS7brjqaInNHJv4oumE6HtGp7tbG7ZE9P21hmoaBq/rSwtvFjI/vcw2bNbdFUW1s27XOdaXbcBWHpgDYxmQuMP4aFj0Fy3JYp566sCH+97rQyrJRf1GzslAsSiLQJC4DQawzH+J54FIipKElMw==4", "parKey": ["YTJapEBcsMsMOU1i", "yJI3cV3zUxqZWd5j", "TmLBjGV8hTfZ7rMf", "QqAuodE1Zz9eA84p", "IM9f9CfT8LDK2RQ7"] } // console.log(decrypt(ff.params.substr(0, ff.params.length - 1), ff.parKey[parseInt(ff.params.substr(-1, 1))])) // process.exit(0) - let keyArr = secretkeyArray() - let keyrdm = Math.floor(Math.random() * 5) + let keyArr = secretkeyArray(); + let keyrdm = Math.floor(Math.random() * 5); let params = { activityId: "Ac-9b71780cb87844b9ac3ab5d34b11dd24", userCookie: jfid, userNumber: searchParams.userNumber, - time: new Date().getTime() + time: new Date().getTime(), }; let reqdata = { params: encrypt(JSON.stringify(params), keyArr[keyrdm]) + keyrdm, - parKey: keyArr - } + parKey: keyArr, + }; - let res = await axios.request({ - baseURL: 'https://m.jf.10010.com/', - headers: { - "user-agent": useragent, - "referer": "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/shake/index.html?jump=sign", - "origin": "https://img.jf.10010.com", - "Content-Type": "application/json" - }, - jar: jar1, - url: `/jf-yuech/p/freeLoginRock`, - method: 'post', - data: reqdata - }).catch(err => console.log(err)) + //foods list + let res = await axios + .request({ + baseURL: "https://m.jf.10010.com/", + headers: { + "user-agent": useragent, + referer: + "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/shake/index.html?jump=sign", + origin: "https://img.jf.10010.com", + "Content-Type": "application/json", + }, + jar: jar1, + url: `/jf-yuech/p/freeLoginRock`, + method: "post", + data: reqdata, + }) + .catch((err) => console.log(err)); - result = res.data + result = res.data; if (result.code !== 0) { - throw new Error(result.message) + throw new Error(result.message); } - let activity = result.data.activityInfos.activityVOs[0] - let Authorization = result.data.token.access_token - let freeTimes = activity.activityTimesInfo.freeTimes - let advertTimes = activity.activityTimesInfo.advertTimes + let activity = result.data.activityInfos.activityVOs[0]; //available items on the list from request + let Authorization = result.data.token.access_token; + let freeTimes = activity.activityTimesInfo.freeTimes; + let advertTimes = activity.activityTimesInfo.advertTimes; do { + let orderId = ""; - let orderId = '' - - console.log("已消耗机会", (1 + 4) - (freeTimes + advertTimes), "剩余免费机会", freeTimes, '看视频广告机会', advertTimes) + console.log( + "已消耗机会", + 1 + 4 - (freeTimes + advertTimes), + "剩余免费机会", + freeTimes, + "看视频广告机会", + advertTimes + ); if (!freeTimes && !advertTimes) { - console.log('没有游戏次数') - break + console.log("没有游戏次数"); + break; } - let currentTimes = (1 + 4) - (freeTimes + advertTimes) + 1 + let currentTimes = 1 + 4 - (freeTimes + advertTimes) + 1; let p1 = { - 'activityId': activity.activityId, - 'currentTimes': freeTimes, - 'type': '免费', - } + activityId: activity.activityId, + currentTimes: freeTimes, + type: "免费", + }; if (!freeTimes && advertTimes) { let params = { - 'arguments1': 'AC20200611152252', - 'arguments2': '', - 'arguments3': '', - 'arguments4': new Date().getTime(), - 'arguments6': '', - 'arguments7': '', - 'arguments8': '', - 'arguments9': '', - 'netWay': 'Wifi', - 'remark1': '签到小游戏摇摇乐不倒翁', - 'remark': '签到小游戏翻倍得积分', - 'version': `android@8.0100`, - 'codeId': 945689604 - } - params['sign'] = sign([params.arguments1, params.arguments2, params.arguments3, params.arguments4]) - params['orderId'] = crypto.createHash('md5').update(new Date().getTime() + '').digest('hex') - params['arguments4'] = new Date().getTime() - - result = await require('./taskcallback').reward(axios, { + arguments1: "AC20200611152252", + arguments2: "", + arguments3: "", + arguments4: new Date().getTime(), + arguments6: "", + arguments7: "", + arguments8: "", + arguments9: "", + netWay: "Wifi", + remark1: "签到小游戏摇摇乐不倒翁", + remark: "签到小游戏翻倍得积分", + version: `android@8.0100`, + codeId: 945689604, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + params["orderId"] = crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"); + params["arguments4"] = new Date().getTime(); + + result = await require("./taskcallback").reward(axios, { ...options, params, - jar: jar1 - }) + jar: jar1, + }); - let timestamp = moment().format('YYYYMMDDHHmmss') + let timestamp = moment().format("YYYYMMDDHHmmss"); result = await axios.request({ headers: { "user-agent": useragent, - "referer": `https://img.client.10010.com/`, + referer: `https://img.client.10010.com/`, }, url: `https://m.jf.10010.com/jf-order/avoidLogin/forActive/yyyqd?ticket=${searchParams.ticket}&type=02&version=android@8.0100×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&duanlianjieabc=tbkwx&userNumber=${options.user}`, - method: 'GET' - }) + method: "GET", + }); p1 = { - 'activityId': activity.activityId, - 'currentTimes': advertTimes, - 'type': '广告', - 'orderId': params['orderId'], - 'phoneType': 'android', - 'version': '8.0102' - } - advertTimes-- - - orderId = params['orderId'] + activityId: activity.activityId, + currentTimes: advertTimes, + type: "广告", + orderId: params["orderId"], + phoneType: "android", + version: "8.0102", + }; + advertTimes--; + + orderId = params["orderId"]; } else { - freeTimes-- + freeTimes--; } - let n = Math.floor(5 * Math.random()) - let i = newjiamarr(); + let n = Math.floor(5 * Math.random()); + let i = newjiamarr(); params = { - "params": encrypt(JSON.stringify(p1), i['zfc']) + n, - "parKey": i['arr'] - } - res = await axios.request({ - headers: { - "Authorization": `Bearer ${Authorization}`, - "user-agent": useragent, - "referer": "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/shake/index.html?jump=sign", - "origin": "https://m.jf.10010.com", - "Content-Type": "application/json" - }, - url: `https://m.jf.10010.com/jf-yuech/api/gameResultV2/minusGameTimes`, - method: 'post', - data: params - }).catch(err => console.log(err)) + params: encrypt(JSON.stringify(p1), i["zfc"]) + n, + parKey: i["arr"], + }; + + res = await axios + .request({ + headers: { + Authorization: `Bearer ${Authorization}`, + "user-agent": useragent, + referer: + "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/shake/index.html?jump=sign", + origin: "https://m.jf.10010.com", + "Content-Type": "application/json", + }, + url: `https://m.jf.10010.com/jf-yuech/api/gameResultV2/minusGameTimes`, + method: "post", + data: params, + }) + .catch((err) => console.log(err)); //deprecated from official API call // res = await axios.request({ // headers: { @@ -265,124 +285,144 @@ var dailyYYY = { console.log(res.data); if (res.data.code !== 0) { - throw new Error(res.data.message) + throw new Error(res.data.message); } else { - if (res.data.data.code !== '0') { - throw new Error(res.data.data.result) + if (res.data.data.code !== "0") { + throw new Error(res.data.data.result); } } let t = { activityId: activity.activityId, - resultId: res.data.data.resultId - } + resultId: res.data.data.resultId, + }; // n = Math.floor(5 * Math.random()) - i = newjiamarr() + i = newjiamarr(); params = { - "params": encrypt(JSON.stringify(t), i['zfc']) + n, - "parKey": i['arr'] - } + params: encrypt(JSON.stringify(t), i["zfc"]) + n, + parKey: i["arr"], + }; res = await axios.request({ headers: { - "Authorization": `Bearer ${Authorization}`, + Authorization: `Bearer ${Authorization}`, "user-agent": useragent, - "referer": "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/shake/index.html?jump=sign", - "origin": "https://m.jf.10010.com", - "Content-Type": "application/json;charset=UTF-8" + referer: + "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/shake/index.html?jump=sign", + origin: "https://m.jf.10010.com", + "Content-Type": "application/json;charset=UTF-8", }, url: `https://m.jf.10010.com/jf-yuech/api/gameResultV2/luckDrawForPrize`, - method: 'post', - data: params - }) + method: "post", + data: params, + }); - result = res.data + result = res.data; if (result.code !== 0) { - console.log("摇一摇送好礼:", result.message) + console.log("摇一摇送好礼:", result.message); } else { - console.log('摇一摇送好礼:', result.data.status === '中奖' ? result.data.prizeName : result.data.status) + console.log( + "摇一摇送好礼:", + result.data.status === "中奖" + ? result.data.prizeName + : result.data.status + ); + + //TODO: coding in here now... if (result.data.doublingStatus) { - console.log('提交积分翻倍') + console.log("提交积分翻倍"); await dailyYYY.lookVideoDouble(axios, { - ...options - }) + ...options, + }); await dailyYYY.lookVideoDoubleResult(axios, { ...options, Authorization, activityId: activity.activityId, - winningRecordId: result.data.winningRecordId - }) + winningRecordId: result.data.winningRecordId, + }); } } - console.log('等待15秒再继续') - await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)) - - } while (freeTimes || advertTimes) + console.log("等待15秒再继续"); + await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); + } while (freeTimes || advertTimes); }, lookVideoDouble: async (axios, options) => { let params = { - 'arguments1': 'AC20200611152252', // acid - 'arguments2': 'GGPD', // yhChannel - 'arguments3': '627292f1243148159c58fd58917c3e67', // yhTaskId menuId - 'arguments4': new Date().getTime(), // time - 'arguments6': '517050707', - 'netWay': 'Wifi', - 'version': `android@8.0100` - } - params['sign'] = sign([params.arguments1, params.arguments2, params.arguments3, params.arguments4]) - let { num, jar } = await require('./taskcallback').query(axios, { + arguments1: "AC20200611152252", // acid + arguments2: "GGPD", // yhChannel + arguments3: "627292f1243148159c58fd58917c3e67", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "517050707", + netWay: "Wifi", + version: `android@8.0100`, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + let { num, jar } = await require("./taskcallback").query(axios, { ...options, - params - }) + params, + }); if (!num) { - console.log('签到小游戏摇摇乐不倒翁: 今日已完成') - return + console.log("签到小游戏摇摇乐不倒翁: 今日已完成"); + return; } params = { - 'arguments1': 'AC20200611152252', // acid - 'arguments2': 'GGPD', // yhChannel - 'arguments3': '627292f1243148159c58fd58917c3e67', // yhTaskId menuId - 'arguments4': new Date().getTime(), // time - 'arguments6': '', - 'arguments7': '', - 'arguments8': '', - 'arguments9': '', - 'orderId': crypto.createHash('md5').update(new Date().getTime() + '').digest('hex'), - 'netWay': 'Wifi', - 'remark': '签到小游戏摇摇乐不倒翁', - 'version': `android@8.0100`, - 'codeId': 945689604 - } - params['sign'] = sign([params.arguments1, params.arguments2, params.arguments3, params.arguments4]) - await require('./taskcallback').doTask(axios, { + arguments1: "AC20200611152252", // acid + arguments2: "GGPD", // yhChannel + arguments3: "627292f1243148159c58fd58917c3e67", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "", + arguments7: "", + arguments8: "", + arguments9: "", + orderId: crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"), + netWay: "Wifi", + remark: "签到小游戏摇摇乐不倒翁", + version: `android@8.0100`, + codeId: 945689604, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + await require("./taskcallback").doTask(axios, { ...options, params, - jar - }) + jar, + }); }, lookVideoDoubleResult: async (axios, options) => { - let { Authorization, activityId, winningRecordId } = options - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}` + let { Authorization, activityId, winningRecordId } = options; + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; let res = await axios.request({ headers: { - "Authorization": `Bearer ${Authorization}`, + Authorization: `Bearer ${Authorization}`, "user-agent": useragent, - "referer": "https://img.jf.10010.com/", - "origin": "https://img.jf.10010.com" + referer: "https://img.jf.10010.com/", + origin: "https://img.jf.10010.com", }, url: `https://m.jf.10010.com/jf-yuech/api/gameResult/doublingIntegral?activityId=${activityId}&winningRecordId=${winningRecordId}`, - method: 'get' - }) - result = res.data + method: "get", + }); + result = res.data; if (result.code !== 0) { - console.log("摇一摇送好礼翻倍结果:", result.message) + console.log("摇一摇送好礼翻倍结果:", result.message); } else { - console.log("摇一摇送好礼翻倍结果:", result.data) + console.log("摇一摇送好礼翻倍结果:", result.data); } - } -} + }, +}; -module.exports = dailyYYY \ No newline at end of file +module.exports = dailyYYY; diff --git a/commands/tasks/unicom/handlers/PAES.js b/commands/tasks/unicom/handlers/PAES.js new file mode 100644 index 000000000..a26fa7a67 --- /dev/null +++ b/commands/tasks/unicom/handlers/PAES.js @@ -0,0 +1,61 @@ +/** + * 预处理AES算法集 + * + */ + +let crypto = require("crypto"); +let CryptoJS = require("crypto-js"); +// prettier-ignore +const charset = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", +"F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", +"Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", +"r", "s", "t", "u", "v", "w", "x", "y", "z"]; + +let secretkeyArray = () => { + for (let e = [], charset, i = 0; 0x05 > i; i++) { + for (let n = "", s = 0; 0x10 > s; s++) { + let a = Math.floor(0x3e * Math.random()); + n += charset[a]; + } + e.push(n); + } + return e; +}; + +let encrypt = function (word, keyStr) { + let key = CryptoJS.enc.Utf8.parse(keyStr); + let srcs = CryptoJS.enc.Utf8.parse(word); + let encrypted = CryptoJS.AES.encrypt(srcs, key, { + mode: CryptoJS.mode.ECB, + padding: CryptoJS.pad.Pkcs7, + }); + return encrypted.toString(); +}; + +let decrypt = function (word, keyStr) { + let key = CryptoJS.enc.Utf8.parse(keyStr); + let decrypted = CryptoJS.AES.decrypt(word, key, { + mode: CryptoJS.mode.ECB, + padding: CryptoJS.pad.Pkcs7, + }); + return decrypted.toString(CryptoJS.enc.Utf8); +}; +let newjiamarr = () => { + for (let e = [], k = "", t = charMap, i = 0x0; 0x4 > i; i++) { + for (let n = "", s = 0x0; 16 > s; s++) { + let a = Math.floor(0x3e * Math.random()); + n += t[a]; + } + e.push(n), (k += n.substring(0x0, 0x4)); + } + return { + arr: e, + zfc: k, + }; +}; +module.exports = { + secretkeyArray, + encrypt, + decrypt, + newjiamarr, +}; diff --git a/commands/tasks/unicom/unicom.js b/commands/tasks/unicom/unicom.js index 5fa2b5304..dab77c582 100644 --- a/commands/tasks/unicom/unicom.js +++ b/commands/tasks/unicom/unicom.js @@ -1,80 +1,123 @@ -const { scheduler } = require('../../../utils/scheduler') -const { getCookies, saveCookies } = require('../../../utils/util') -const _request = require('../../../utils/request') +const { scheduler } = require("../../../utils/scheduler"); +const { getCookies, saveCookies } = require("../../../utils/util"); +const _request = require("../../../utils/request"); var start = async (params) => { - const { cookies, options } = params + const { cookies, options } = params; let init = async (request, savedCookies) => { - await require('./init')(request, { + await require("./init")(request, { ...params, - cookies: savedCookies || cookies - }) + cookies: savedCookies || cookies, + }); return { - request - } - } + request, + }; + }; let taskOption = { - init - } + init, + }; // 每日签到积分 - await scheduler.regTask('dailysignin', async (request) => { - await require('./dailysignin').doTask(request, options) - await require('./integral').addFlow(request, options) - }, taskOption) + await scheduler.regTask( + "dailysignin", + async (request) => { + await require("./dailysignin").doTask(request, options); + await require("./integral").addFlow(request, options); + }, + taskOption + ); // 冬奥积分活动 20201231 - await scheduler.regTask('winterTwo', async (request) => { - await require('./integral').winterTwoGetIntegral(request, options) - await require('./integral').winterTwoStatus(request, options) - }, taskOption) + await scheduler.regTask( + "winterTwo", + async (request) => { + await require("./integral").winterTwoGetIntegral(request, options); + await require("./integral").winterTwoStatus(request, options); + }, + taskOption + ); // 每日定向积分 20201231 - await scheduler.regTask('dxIntegralEveryDay', async (request) => { - await require('./integral').dxIntegralEveryDay(request, options) - }, taskOption) + await scheduler.regTask( + "dxIntegralEveryDay", + async (request) => { + await require("./integral").dxIntegralEveryDay(request, options); + }, + taskOption + ); // 每日游戏楼层宝箱 - await scheduler.regTask('dailygamebox', async (request) => { - await require('./integral').gamebox(request, options) - }, taskOption) + await scheduler.regTask( + "dailygamebox", + async (request) => { + await require("./integral").gamebox(request, options); + }, + taskOption + ); // 每日抽奖 - await scheduler.regTask('dailylotteryintegral', async (request) => { - await require('./dailylotteryintegral').doTask(request, options) - }, taskOption) + await scheduler.regTask( + "dailylotteryintegral", + async (request) => { + await require("./dailylotteryintegral").doTask(request, options); + }, + taskOption + ); // 首页-游戏-娱乐中心-沃之树 - await scheduler.regTask('dailywoTree', async (request) => { - await require('./woTree').doTask(request, options) - }, taskOption) - - await scheduler.regTask('dailyBookRead', async (request) => { - // 首页-小说-阅读越有礼打卡赢话费 - await require('./dailyBookRead').doTask(request, options) - await require('./dailyVideoBook').doTask(request, options) - }, taskOption) + await scheduler.regTask( + "dailywoTree", + async (request) => { + await require("./woTree").doTask(request, options); + }, + taskOption + ); + + await scheduler.regTask( + "dailyBookRead", + async (request) => { + // 首页-小说-阅读越有礼打卡赢话费 + await require("./dailyBookRead").doTask(request, options); + await require("./dailyVideoBook").doTask(request, options); + }, + taskOption + ); // 首页-小说-读满10章赢好礼 - await scheduler.regTask('dailyBookRead10doDraw', async (request) => { - // 首页-小说-读满10章赢好礼 - await require('./dailyVideoBook').read10doDraw(request, options) - // 首页-小说-读满10章赢好礼-看视频领2积分 - await require('./dailyVideoBook').read10doDrawLookVideoDouble(request, options) - // 首页-签到有礼-免流量得福利-3积分天天拿(阅读打卡) - await require('./dailyVideoBook').giftBoints(request, options) - }, taskOption) - - await scheduler.regTask('dailyBookLuckdraw', async (request) => { - // 首页-小说-阅读福利抽大奖 - await require('./dailyBookLuckdraw').doTask(request, options) - }, taskOption) + await scheduler.regTask( + "dailyBookRead10doDraw", + async (request) => { + // 首页-小说-读满10章赢好礼 + await require("./dailyVideoBook").read10doDraw(request, options); + // 首页-小说-读满10章赢好礼-看视频领2积分 + await require("./dailyVideoBook").read10doDrawLookVideoDouble( + request, + options + ); + // 首页-签到有礼-免流量得福利-3积分天天拿(阅读打卡) + await require("./dailyVideoBook").giftBoints(request, options); + }, + taskOption + ); + + await scheduler.regTask( + "dailyBookLuckdraw", + async (request) => { + // 首页-小说-阅读福利抽大奖 + await require("./dailyBookLuckdraw").doTask(request, options); + }, + taskOption + ); // 首页-签到有礼-免费领-浏览领积分 - await scheduler.regTask('dailyLiuLan', async (request) => { - await require('./dailyTTliulan').doTask(request, options) - }, taskOption) + await scheduler.regTask( + "dailyLiuLan", + async (request) => { + await require("./dailyTTliulan").doTask(request, options); + }, + taskOption + ); // 首页-签到有礼-免费拿-看视频夺宝 // 易出现本次操作需要进行验证,暂时注释 @@ -87,82 +130,134 @@ var start = async (params) => { // }) // 首页-签到有礼-免费抽-抓OPPO手机 - await scheduler.regTask('dailyGrabdollPage', async (request) => { - await require('./dailyGrabdollPage').doTask(request, options) - }, taskOption) + await scheduler.regTask( + "dailyGrabdollPage", + async (request) => { + await require("./dailyGrabdollPage").doTask(request, options); + }, + taskOption + ); // 首页-签到有礼-免费抽-拿666积分-豪礼大派送抽奖 - await scheduler.regTask('jflottery', async (request) => { - await require('./jflottery').timesDraw(request, options) - }, taskOption) + await scheduler.regTask( + "jflottery", + async (request) => { + await require("./jflottery").timesDraw(request, options); + }, + taskOption + ); // 首页-签到有礼-免费抽-拿苹果iPad Pro(摇一摇) - await scheduler.regTask('dailyYYY', async (request) => { - await require('./dailyYYY').doTask(request, options) - }, taskOption) + await scheduler.regTask( + "dailyYYY", + async (request) => { + await require("./dailyYYY").doTask(request, options); + }, + taskOption + ); // 首页-签到有礼-免费抽-华为mate40pro(刮刮乐) - await scheduler.regTask('dailyVideoScratchcard', async (request) => { - await require('./dailyVideoScratchcard').doTask(request, options) - }, taskOption) - - // 首页-签到有礼-免费抽-赢三星Galaxy Z(试试手气) - await scheduler.regTask('dailyCheapStorePage', async (request) => { - await require('./dailyCheapStorePage').doTask(request, options) - }, { - isCircle: true, - intervalTime: 4 * 3600, - ...taskOption - }) + await scheduler.regTask( + "dailyVideoScratchcard", + async (request) => { + await require("./dailyVideoScratchcard").doTask(request, options); + }, + taskOption + ); + + // 首页-签到有礼-免费抽-赢三星Galaxy Z(试试手气) deprecated from official API. + // await scheduler.regTask('dailyCheapStorePage', async (request) => { + // await require('./dailyCheapStorePage').doTask(request, options) + // }, { + // isCircle: true, + // intervalTime: 4 * 3600, + // ...taskOption + // }) // 首页-签到有礼-免费抽-拆华为Pad(去抽奖) - await scheduler.regTask('dailyLKMH', async (request) => { - await require('./dailyLKMH').doTask(request, options) - }, taskOption) + await scheduler.regTask( + "dailyLKMH", + async (request) => { + await require("./dailyLKMH").doTask(request, options); + }, + taskOption + ); // 首页-签到有礼-免费抽-拿iPhone12(摇一摇) - await scheduler.regTask('dailyYYQ', async (request) => { - await require('./dailyYYQ').doTask(request, options) - }, taskOption) + await scheduler.regTask( + "dailyYYQ", + async (request) => { + await require("./dailyYYQ").doTask(request, options); + }, + taskOption + ); // 首页-签到有礼-免费抽-赢Apple Watch(去抽奖) - await scheduler.regTask('dailyTurntablePage', async (request) => { - await require('./dailyTurntablePage').doTask(request, options) - }, taskOption) + await scheduler.regTask( + "dailyTurntablePage", + async (request) => { + await require("./dailyTurntablePage").doTask(request, options); + }, + taskOption + ); // 首页-签到有礼-赚更多福利-看视频奖励5积分 - await scheduler.regTask('dailyVideo', async (request) => { - await require('./dailyVideo').doTask(request, options) - }, taskOption) + await scheduler.regTask( + "dailyVideo", + async (request) => { + await require("./dailyVideo").doTask(request, options); + }, + taskOption + ); // 首页-签到有礼-赚更多福利-天天抽好礼 - await scheduler.regTask('dailylottery', async (request) => { - await require('./dailylottery').doTask(request, options) - }, taskOption) + await scheduler.regTask( + "dailylottery", + async (request) => { + await require("./dailylottery").doTask(request, options); + }, + taskOption + ); // 首页-游戏-娱乐中心-每日打卡 - await scheduler.regTask('producGameSignin', async (request) => { - await require('./producGame').gameSignin(request, options) - await require('./producGame').gameBox(request, options) - }, taskOption) + await scheduler.regTask( + "producGameSignin", + async (request) => { + await require("./producGame").gameSignin(request, options); + await require("./producGame").gameBox(request, options); + }, + taskOption + ); // 首页-游戏-娱乐中心-天天领取3G流量包 - await scheduler.regTask('dailygameflow', async (request) => { - await require('./producGame').doGameFlowTask(request, options) - }, taskOption) + await scheduler.regTask( + "dailygameflow", + async (request) => { + await require("./producGame").doGameFlowTask(request, options); + }, + taskOption + ); // 首页-积分查询-游戏任务 - await scheduler.regTask('dailygameIntegral', async (request) => { - await require('./producGame').doGameIntegralTask(request, options) - }, taskOption) + await scheduler.regTask( + "dailygameIntegral", + async (request) => { + await require("./producGame").doGameIntegralTask(request, options); + }, + taskOption + ); // 首页-知识-限时免费(连续7天阶梯激励) - await scheduler.regTask('dailyCourse', async (request) => { - await require('./dailyCourse').doTask(request, options) - }, { - ...taskOption, - startTime: 9 * 3600 - }) + await scheduler.regTask( + "dailyCourse", + async (request) => { + await require("./dailyCourse").doTask(request, options); + }, + { + ...taskOption, + startTime: 9 * 3600, + } + ); // await require('./integral').getflDetail(request, options) // await require('./integral').getTxDetail(request, options) @@ -170,51 +265,81 @@ var start = async (params) => { // await require('./integral').getCoins(request, options) // 每日评论积分 - await scheduler.regTask('dailycomment', async (request) => { - await require('./commentSystem').commentTask(request, options).catch(console.log) - }, taskOption) + await scheduler.regTask( + "dailycomment", + async (request) => { + await require("./commentSystem") + .commentTask(request, options) + .catch(console.log); + }, + taskOption + ); // 首页-游戏-娱乐中心-每日打卡-完成今日任务(200m) - await scheduler.regTask('todayDailyTask', async (request) => { - await require('./producGame').doTodayDailyTask(request, options) - }, { - ...taskOption, - startTime: 20 * 3600 - }) + await scheduler.regTask( + "todayDailyTask", + async (request) => { + await require("./producGame").doTodayDailyTask(request, options); + }, + { + ...taskOption, + startTime: 20 * 3600, + } + ); // 首页-签到有礼-居家娱乐馆 - await scheduler.regTask('gameYearBox', async (request) => { - await require('./gameYearBox').doTask(request, options) - }, { - ...taskOption, - startTime: 20 * 3600 - }) + await scheduler.regTask( + "gameYearBox", + async (request) => { + await require("./gameYearBox").doTask(request, options); + }, + { + ...taskOption, + startTime: 20 * 3600, + } + ); // 首页-牛气-秒杀抢兑 - await scheduler.regTask('NiujieSpikePrize', async (request) => { - await require('./Niujie').spikePrize(request, options) - }, { - ...taskOption, - startTime: 9.6 * 3600, - ignoreRelay: true - }) + await scheduler.regTask( + "NiujieSpikePrize", + async (request) => { + await require("./Niujie").spikePrize(request, options); + }, + { + ...taskOption, + startTime: 9.6 * 3600, + ignoreRelay: true, + } + ); // 首页-牛气-转盘抽奖 - await scheduler.regTask('NiujieTask', async (request) => { - await require('./Niujie').doTask(request, options) - }, taskOption) - + await scheduler.regTask( + "NiujieTask", + async (request) => { + await require("./Niujie").doTask(request, options); + }, + taskOption + ); // 首页-牛气-场馆领牛气 - await scheduler.regTask('NiujieReceiveCalf', async (request) => { - await require('./Niujie').receiveCalf(request, options) - }, { - isCircle: true, - intervalTime: 1 * 3600, - startTime: 1, - ...taskOption - }) -} + await scheduler.regTask( + "NiujieReceiveCalf", + async (request) => { + await require("./Niujie").receiveCalf(request, options); + }, + { + isCircle: true, + intervalTime: 1 * 3600, + startTime: 1, + ...taskOption, + } + ); + + // 首页-签到有礼-赢vivo X60 + // await scheduler.regTask('bcow', async (request) => { + // await require('./bcow').doTask(request, options) + // }, taskOption) +}; module.exports = { - start -} \ No newline at end of file + start, +}; From c4f370c2627e7068546a1cee172340a6f7f07e94 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Mon, 8 Feb 2021 18:04:43 +0800 Subject: [PATCH 006/128] created bcow game event --- commands/tasks/unicom/bcow.js | 141 ++++--------------- commands/tasks/unicom/dailyYYY.js | 4 +- commands/tasks/unicom/handlers/PAES.js | 23 ++- commands/tasks/unicom/handlers/dailyEvent.js | 100 +++++++++++++ commands/tasks/unicom/handlers/myPhone.js | 5 + commands/tasks/unicom/unicom.js | 10 +- 6 files changed, 161 insertions(+), 122 deletions(-) create mode 100644 commands/tasks/unicom/handlers/dailyEvent.js create mode 100644 commands/tasks/unicom/handlers/myPhone.js diff --git a/commands/tasks/unicom/bcow.js b/commands/tasks/unicom/bcow.js index 1e6016609..1a053f12a 100644 --- a/commands/tasks/unicom/bcow.js +++ b/commands/tasks/unicom/bcow.js @@ -1,100 +1,21 @@ let crypto = require("crypto"); -let CryptoJS = require("crypto-js"); let moment = require("moment"); let AES = require("./handlers/PAES"); -const useragent = (options) => - `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0102,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; +const useragent = require("./handlers/myPhone").useragent; +const gameEvents = require("./handlers/dailyEvent"); module.exports = bcow = { doTask: async (axios, options) => { console.log("🔔开始抽牛卡\n"); - let cookies = await getOpenPlatLine(axios, options); - let data = await postFreeLoginRock(axios, options, cookies); - }, - getOpenPlatLine: async (axios, options) => { - let searchParams = {}; - let result = await axios - .request({ - baseURL: "https://m.client.10010.com/", - headers: { - "user-agent": useragent(options), - referer: `https://img.client.10010.com/`, - origin: "https://img.client.10010.com", - }, - url: `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://m.jf.10010.com/jf-order/avoidLogin/forActive/ncow&duanlianjieabc=tbLlf`, - method: "GET", - transformResponse: (data, headers) => { - if ("location" in headers) { - let uu = new URL(headers.location); - let pp = {}; - for (let p of uu.searchParams) { - pp[p[0]] = p[1]; - } - if ("ticket" in pp) { - searchParams = pp; - } - } - return data; - }, - }) - .catch((err) => console.log(err)); - let jar1 = result.config.jar; - - let cookiesJson = jar1.toJSON(); - console.log(cookiesJson); - let ecs_token = cookiesJson.cookies.find((i) => i.key == "ecs_token"); - if (!ecs_token) { - throw new Error("ecs_token缺失"); - } - ecs_token = ecs_token.value; - let jfid = cookiesJson.cookies.find((i) => i.key == "_jf_id"); - if (!jfid) { - throw new Error("jfid缺失"); - } - jfid = jfid.value; - return { jfid, searchParams, jar1 }; - }, - postFreeLoginRock: async (axios, options, { jfid, searchParams, jar1 }) => { - let keyArr = AES.secretkeyArray(); - let keyrdm = Math.floor(Math.random() * 5); - - let params = { - activityId: "Ac-yccnk", - userCookie: jfid, - userNumber: searchParams.userNumber, - time: new Date().getTime(), - }; - let reqdata = { - params: encrypt(JSON.stringify(params), keyArr[keyrdm]) + keyrdm, - parKey: keyArr, - }; - //foods list - let res = await axios - .request({ - baseURL: "https://m.jf.10010.com/", - headers: { - "user-agent": useragent(options), - referer: - "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-qd/bcow/index.html?jump=sign", - origin: "https://img.jf.10010.com", - "Content-Type": "application/json", - }, - jar: jar1, - url: `/jf-yuech/p/freeLoginRock`, - method: "post", - data: reqdata, - }) - .catch((err) => console.log(err)); - - result = res.data; - if (result.code !== 0) { - throw new Error(result.message); - } - let activity = result.data.activityInfos.activityVOs[0]; //available items on the list from request - let Authorization = result.data.token.access_token; - let freeTimes = activity.activityTimesInfo.freeTimes; - let advertTimes = activity.activityTimesInfo.advertTimes; - return { activity, Authorization, freeTimes, advertTimes }; + let cookies = await bcow.getOpenPlatLine(axios, options); + let data = await bcow.postFreeLoginRock(axios, options, cookies); + let data1 = await bcow.postTimesDrawForPrize(axios, options, cookies, data); }, + getOpenPlatLine: gameEvents.getOpenPlatLine( + `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://m.jf.10010.com/jf-order/avoidLogin/forActive/ncow&duanlianjieabc=tbLlf` + ), + postFreeLoginRock: gameEvents.postFreeLoginRock( + "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-qd/bcow/index.html?jump=sign" + ), postTimesDrawForPrize: async ( axios, options, @@ -143,7 +64,7 @@ module.exports = bcow = { version: `android@8.0102`, codeId: 945689604, }; - params["sign"] = sign([ + params["sign"] = AES.sign([ params.arguments1, params.arguments2, params.arguments3, @@ -191,9 +112,9 @@ module.exports = bcow = { //join the game let n = Math.floor(5 * Math.random()); - let i = newjiamarr(); + let i = AES.newjiamarr(); params = { - params: encrypt(JSON.stringify(p1), i["zfc"]) + n, + params: AES.encrypt(JSON.stringify(p1), i["zfc"]) + n, parKey: i["arr"], }; @@ -215,14 +136,6 @@ module.exports = bcow = { .catch((err) => console.log(err)); console.log(res.data); - if (res.data.code !== 0) { - throw new Error(res.data.message); - } else { - if (res.data.data.code !== "0") { - throw new Error(res.data.data.result); - } - } - //TODO: coding in here now... result = res.data; if (result.code !== 0) { @@ -230,20 +143,23 @@ module.exports = bcow = { } else { console.log( "翻牛牌送好礼:", - result.data.status === "中奖" - ? result.data.prizeName - : result.data.status + result.data.drawResultPO !== null + ? result.data.drawResultPO.prizeName + : "未中奖" ); - if (result.data.doublingStatus) { - console.log("提交积分翻倍"); - await dailyYYY.lookVideoDouble(axios, { + if ( + result.data.drawResultPO !== null && + result.data.drawResultPO.doublingStatus + ) { + console.log("🌈提交积分翻倍"); + await bcow.lookVideoDouble(axios, { ...options, }); - await dailyYYY.lookVideoDoubleResult(axios, { + await bcow.lookVideoDoubleResult(axios, { ...options, Authorization, activityId: activity.activityId, - winningRecordId: result.data.winningRecordId, + winningRecordId: result.data.drawResultPO.winningRecordId, }); } } @@ -265,7 +181,7 @@ module.exports = bcow = { version: `android@8.0102`, codeId: 945689604, }; - params["sign"] = sign([ + params["sign"] = AES.sign([ params.arguments1, params.arguments2, params.arguments3, @@ -299,7 +215,7 @@ module.exports = bcow = { version: `android@8.0100`, codeId: 945689604, }; - params["sign"] = sign([ + params["sign"] = AES.sign([ params.arguments1, params.arguments2, params.arguments3, @@ -313,11 +229,10 @@ module.exports = bcow = { }, lookVideoDoubleResult: async (axios, options) => { let { Authorization, activityId, winningRecordId } = options; - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; let res = await axios.request({ headers: { Authorization: `Bearer ${Authorization}`, - "user-agent": useragent, + "user-agent": useragent(options), referer: "https://img.jf.10010.com/", origin: "https://img.jf.10010.com", }, diff --git a/commands/tasks/unicom/dailyYYY.js b/commands/tasks/unicom/dailyYYY.js index 291dc5d03..3e37d8d4e 100644 --- a/commands/tasks/unicom/dailyYYY.js +++ b/commands/tasks/unicom/dailyYYY.js @@ -32,7 +32,7 @@ let charMap = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", var secretkeyArray = function () { for (let e = [], t = charMap, i = 0; 5 > i; i++) { - for (let n = "", s = 0; 16 > s; s++) { + for (var n = "", s = 0; 16 > s; s++) { let a = Math.floor(62 * Math.random()); n += t[a]; } @@ -43,7 +43,7 @@ var secretkeyArray = function () { var newjiamarr = () => { for (let e = [], k = "", t = charMap, i = 0x0; 0x4 > i; i++) { - for (let n = "", s = 0x0; 16 > s; s++) { + for (var n = "", s = 0x0; 16 > s; s++) { let a = Math.floor(0x3e * Math.random()); n += t[a]; } diff --git a/commands/tasks/unicom/handlers/PAES.js b/commands/tasks/unicom/handlers/PAES.js index a26fa7a67..6983b2d6b 100644 --- a/commands/tasks/unicom/handlers/PAES.js +++ b/commands/tasks/unicom/handlers/PAES.js @@ -5,6 +5,20 @@ let crypto = require("crypto"); let CryptoJS = require("crypto-js"); + +let sign = (data) => { + let str = "integralofficial&"; + let params = []; + data.forEach((v, i) => { + if (v) { + params.push("arguments" + (i + 1) + v); + } + }); + return crypto + .createHash("md5") + .update(str + params.join("&")) + .digest("hex"); +}; // prettier-ignore const charset = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", @@ -12,8 +26,8 @@ const charset = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C" "r", "s", "t", "u", "v", "w", "x", "y", "z"]; let secretkeyArray = () => { - for (let e = [], charset, i = 0; 0x05 > i; i++) { - for (let n = "", s = 0; 0x10 > s; s++) { + for (var e = [], i = 0; 0x05 > i; i++) { + for (var n = "", s = 0; 0x10 > s; s++) { let a = Math.floor(0x3e * Math.random()); n += charset[a]; } @@ -41,8 +55,8 @@ let decrypt = function (word, keyStr) { return decrypted.toString(CryptoJS.enc.Utf8); }; let newjiamarr = () => { - for (let e = [], k = "", t = charMap, i = 0x0; 0x4 > i; i++) { - for (let n = "", s = 0x0; 16 > s; s++) { + for (var e = [], k = "", t = charset, i = 0x0; 0x4 > i; i++) { + for (var n = "", s = 0x0; 16 > s; s++) { let a = Math.floor(0x3e * Math.random()); n += t[a]; } @@ -58,4 +72,5 @@ module.exports = { encrypt, decrypt, newjiamarr, + sign, }; diff --git a/commands/tasks/unicom/handlers/dailyEvent.js b/commands/tasks/unicom/handlers/dailyEvent.js new file mode 100644 index 000000000..d7e45f9ab --- /dev/null +++ b/commands/tasks/unicom/handlers/dailyEvent.js @@ -0,0 +1,100 @@ +const useragent = require("./myPhone").useragent; +let AES = require("./handlers/PAES"); + +/** + * @param {String} url request url absolute path + */ +let getOpenPlatLine = (url) => { + return async (axios, options) => { + let searchParams = {}; + let result = await axios + .request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": useragent(options), + referer: `https://img.client.10010.com/`, + origin: "https://img.client.10010.com", + }, + url: `${url}`, + method: "GET", + transformResponse: (data, headers) => { + if ("location" in headers) { + let uu = new URL(headers.location); + let pp = {}; + for (let p of uu.searchParams) { + pp[p[0]] = p[1]; + } + if ("ticket" in pp) { + searchParams = pp; + } + } + return data; + }, + }) + .catch((err) => console.log(err)); + let jar1 = result.config.jar; + + let cookiesJson = jar1.toJSON(); + let ecs_token = cookiesJson.cookies.find((i) => i.key == "ecs_token"); + if (!ecs_token) { + throw new Error("ecs_token缺失"); + } + ecs_token = ecs_token.value; + let jfid = cookiesJson.cookies.find((i) => i.key == "_jf_id"); + if (!jfid) { + throw new Error("jfid缺失"); + } + jfid = jfid.value; + return { jfid, searchParams, jar1 }; + }; +}; + +/** + * @param {String} referer request referer absolute path + */ +let postFreeLoginRock = (referer) => { + return async (axios, options, { jfid, searchParams, jar1 }) => { + let keyArr = AES.secretkeyArray(); + let keyrdm = Math.floor(Math.random() * 5); + let params = { + activityId: "Ac-yccnk", + userCookie: jfid, + userNumber: searchParams.userNumber, + time: new Date().getTime(), + }; + let reqdata = { + params: AES.encrypt(JSON.stringify(params), keyArr[keyrdm]) + keyrdm, + parKey: keyArr, + }; + //foods list + let res = await axios + .request({ + baseURL: "https://m.jf.10010.com/", + headers: { + "user-agent": useragent(options), + referer: `${referer}`, + origin: "https://img.jf.10010.com", + "Content-Type": "application/json", + }, + jar: jar1, + url: `/jf-yuech/p/freeLoginRock`, + method: "post", + data: reqdata, + }) + .catch((err) => console.log(err)); + + result = res.data; + if (result.code !== 0) { + throw new Error(result.message); + } + let activity = result.data.activityInfos.activityVOs[0]; //available items on the list from request + let Authorization = result.data.token.access_token; + let freeTimes = activity.activityTimesInfo.freeTimes; + let advertTimes = activity.activityTimesInfo.advertTimes; + return { activity, Authorization, freeTimes, advertTimes }; + }; +}; +module.exports = { + getOpenPlatLine, + postFreeLoginRock, +}; diff --git a/commands/tasks/unicom/handlers/myPhone.js b/commands/tasks/unicom/handlers/myPhone.js new file mode 100644 index 000000000..3a8d0d338 --- /dev/null +++ b/commands/tasks/unicom/handlers/myPhone.js @@ -0,0 +1,5 @@ +const useragent = (options) => + `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0102,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; +module.exports = { + useragent, +}; diff --git a/commands/tasks/unicom/unicom.js b/commands/tasks/unicom/unicom.js index dab77c582..28ed68dca 100644 --- a/commands/tasks/unicom/unicom.js +++ b/commands/tasks/unicom/unicom.js @@ -336,9 +336,13 @@ var start = async (params) => { ); // 首页-签到有礼-赢vivo X60 - // await scheduler.regTask('bcow', async (request) => { - // await require('./bcow').doTask(request, options) - // }, taskOption) + await scheduler.regTask( + "bcow", + async (request) => { + await require("./bcow").doTask(request, options); + }, + taskOption + ); }; module.exports = { start, From e435de70f53d38794f6cc5e2de6e1fa7c3f82c30 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Mon, 8 Feb 2021 18:07:14 +0800 Subject: [PATCH 007/128] =?UTF-8?q?=E2=9C=94hidden=20console.log=20functio?= =?UTF-8?q?n=20for=20some=20reasons.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/bcow.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/commands/tasks/unicom/bcow.js b/commands/tasks/unicom/bcow.js index 1a053f12a..21f184bad 100644 --- a/commands/tasks/unicom/bcow.js +++ b/commands/tasks/unicom/bcow.js @@ -135,8 +135,6 @@ module.exports = bcow = { }) .catch((err) => console.log(err)); - console.log(res.data); - //TODO: coding in here now... result = res.data; if (result.code !== 0) { console.log("翻牛牌送好礼:", result.message); From de2006f171fc37d69c1df8411f813b7beafc6459 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Mon, 8 Feb 2021 18:26:30 +0800 Subject: [PATCH 008/128] Update myPhone.js --- commands/tasks/unicom/handlers/myPhone.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/commands/tasks/unicom/handlers/myPhone.js b/commands/tasks/unicom/handlers/myPhone.js index 3a8d0d338..45a0a29d6 100644 --- a/commands/tasks/unicom/handlers/myPhone.js +++ b/commands/tasks/unicom/handlers/myPhone.js @@ -1,5 +1,15 @@ const useragent = (options) => `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0102,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; +// `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36;devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:};unicom{version:android@8.0102,desmobile:${options.user}}`; +const USER_AGENT = []; + +function randomNumber(min = 0, max = 100) { + return Math.min(Math.floor(min + Math.random() * (max - min)), max); +} + +//pick a random user-agent +const USER_AGENT = USER_AGENTS[randomNumber(0, USER_AGENTS.length)]; + module.exports = { useragent, }; From 53a18632a7edcd4f362fde944da76132d920cb55 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Mon, 8 Feb 2021 19:10:32 +0800 Subject: [PATCH 009/128] updated bcow --- commands/tasks/unicom/bcow.js | 33 +++++--------------- commands/tasks/unicom/handlers/dailyEvent.js | 23 ++++++++++++++ commands/tasks/unicom/handlers/myPhone.js | 2 +- 3 files changed, 31 insertions(+), 27 deletions(-) diff --git a/commands/tasks/unicom/bcow.js b/commands/tasks/unicom/bcow.js index 21f184bad..f2fd3147e 100644 --- a/commands/tasks/unicom/bcow.js +++ b/commands/tasks/unicom/bcow.js @@ -3,19 +3,19 @@ let moment = require("moment"); let AES = require("./handlers/PAES"); const useragent = require("./handlers/myPhone").useragent; const gameEvents = require("./handlers/dailyEvent"); +const referer = + "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-qd/bcow/index.html?jump=sign"; module.exports = bcow = { doTask: async (axios, options) => { - console.log("🔔开始抽牛卡\n"); + console.log("🔔 开始翻牛牌\n"); let cookies = await bcow.getOpenPlatLine(axios, options); let data = await bcow.postFreeLoginRock(axios, options, cookies); - let data1 = await bcow.postTimesDrawForPrize(axios, options, cookies, data); + await bcow.postTimesDrawForPrize(axios, options, cookies, data); }, getOpenPlatLine: gameEvents.getOpenPlatLine( `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://m.jf.10010.com/jf-order/avoidLogin/forActive/ncow&duanlianjieabc=tbLlf` ), - postFreeLoginRock: gameEvents.postFreeLoginRock( - "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-qd/bcow/index.html?jump=sign" - ), + postFreeLoginRock: gameEvents.postFreeLoginRock(referer), postTimesDrawForPrize: async ( axios, options, @@ -124,8 +124,7 @@ module.exports = bcow = { headers: { Authorization: `Bearer ${Authorization}`, "user-agent": useragent(options), - referer: - "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-qd/bcow/index.html?jump=sign", + referer, origin: "https://m.jf.10010.com", "Content-Type": "application/json;charset=UTF-8", }, @@ -225,23 +224,5 @@ module.exports = bcow = { jar, }); }, - lookVideoDoubleResult: async (axios, options) => { - let { Authorization, activityId, winningRecordId } = options; - let res = await axios.request({ - headers: { - Authorization: `Bearer ${Authorization}`, - "user-agent": useragent(options), - referer: "https://img.jf.10010.com/", - origin: "https://img.jf.10010.com", - }, - url: `https://m.jf.10010.com/jf-yuech/api/gameResult/doublingIntegral?activityId=${activityId}&winningRecordId=${winningRecordId}`, - method: "get", - }); - result = res.data; - if (result.code !== 0) { - console.log("翻牛牌送好礼翻倍结果:", result.message); - } else { - console.log("翻牛牌送好礼翻倍结果:", result.data); - } - }, + lookVideoDoubleResult: gameEvents.lookVideoDoubleResult("翻牛牌送好礼"), }; diff --git a/commands/tasks/unicom/handlers/dailyEvent.js b/commands/tasks/unicom/handlers/dailyEvent.js index d7e45f9ab..7da27b992 100644 --- a/commands/tasks/unicom/handlers/dailyEvent.js +++ b/commands/tasks/unicom/handlers/dailyEvent.js @@ -94,7 +94,30 @@ let postFreeLoginRock = (referer) => { return { activity, Authorization, freeTimes, advertTimes }; }; }; + +let lookVideoDoubleResult = (title) => { + return async (axios, options) => { + let { Authorization, activityId, winningRecordId } = options; + let res = await axios.request({ + headers: { + Authorization: `Bearer ${Authorization}`, + "user-agent": useragent(options), + referer: "https://img.jf.10010.com/", + origin: "https://img.jf.10010.com", + }, + url: `https://m.jf.10010.com/jf-yuech/api/gameResult/doublingIntegral?activityId=${activityId}&winningRecordId=${winningRecordId}`, + method: "get", + }); + result = res.data; + if (result.code !== 0) { + console.log(`⭕ ${title}翻倍结果:`, result.message); + } else { + console.log(`❌ ${title}翻倍结果:`, result.data); + } + }; +}; module.exports = { getOpenPlatLine, postFreeLoginRock, + lookVideoDoubleResult, }; diff --git a/commands/tasks/unicom/handlers/myPhone.js b/commands/tasks/unicom/handlers/myPhone.js index 45a0a29d6..daf97dfc3 100644 --- a/commands/tasks/unicom/handlers/myPhone.js +++ b/commands/tasks/unicom/handlers/myPhone.js @@ -1,7 +1,7 @@ const useragent = (options) => `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0102,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; // `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36;devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:};unicom{version:android@8.0102,desmobile:${options.user}}`; -const USER_AGENT = []; +const USER_AGENTS = []; function randomNumber(min = 0, max = 100) { return Math.min(Math.floor(min + Math.random() * (max - min)), max); From 243203dbc1cec73e9fc77ddaf338d61403a72157 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Mon, 8 Feb 2021 19:31:45 +0800 Subject: [PATCH 010/128] =?UTF-8?q?=F0=9F=90=8D=20fixed=20bug=20at=20bcow.?= =?UTF-8?q?js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 12 + commands/tasks/unicom/bcow.js | 15 +- commands/tasks/unicom/handlers/dailyEvent.js | 6 +- commands/tasks/unicom/handlers/myPhone.js | 5 +- package-lock.json | 3874 +++--------------- package.json | 1 + 6 files changed, 642 insertions(+), 3271 deletions(-) create mode 100644 .eslintrc.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 000000000..c0f9a6371 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,12 @@ +module.exports = { + env: { + browser: true, + commonjs: true, + es2021: true, + }, + extends: "eslint:recommended", + parserOptions: { + ecmaVersion: 12, + }, + rules: {}, +}; diff --git a/commands/tasks/unicom/bcow.js b/commands/tasks/unicom/bcow.js index f2fd3147e..85066f180 100644 --- a/commands/tasks/unicom/bcow.js +++ b/commands/tasks/unicom/bcow.js @@ -1,10 +1,11 @@ let crypto = require("crypto"); let moment = require("moment"); -let AES = require("./handlers/PAES"); +let AES = require("./handlers/PAES.js"); const useragent = require("./handlers/myPhone").useragent; const gameEvents = require("./handlers/dailyEvent"); const referer = "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-qd/bcow/index.html?jump=sign"; +let bcow; module.exports = bcow = { doTask: async (axios, options) => { console.log("🔔 开始翻牛牌\n"); @@ -39,7 +40,7 @@ module.exports = bcow = { break; } - let currentTimes = 1 + 4 - (freeTimes + advertTimes) + 1; + // let currentTimes = 1 + 4 - (freeTimes + advertTimes) + 1; let p1 = { activityId: activity.activityId, @@ -80,14 +81,14 @@ module.exports = bcow = { .digest("hex"); params["arguments4"] = new Date().getTime(); - result = await require("./taskcallback").reward(axios, { + await require("./taskcallback").reward(axios, { ...options, params, jar: jar1, }); let timestamp = moment().format("YYYYMMDDHHmmss"); - result = await axios.request({ + await axios.request({ headers: { "user-agent": useragent(options), referer: `https://img.client.10010.com/`, @@ -113,12 +114,12 @@ module.exports = bcow = { //join the game let n = Math.floor(5 * Math.random()); let i = AES.newjiamarr(); - params = { + let params = { params: AES.encrypt(JSON.stringify(p1), i["zfc"]) + n, parKey: i["arr"], }; - res = await axios + let res = await axios .request({ baseURL: "https://m.jf.10010.com/", headers: { @@ -134,7 +135,7 @@ module.exports = bcow = { }) .catch((err) => console.log(err)); - result = res.data; + let result = res.data; if (result.code !== 0) { console.log("翻牛牌送好礼:", result.message); } else { diff --git a/commands/tasks/unicom/handlers/dailyEvent.js b/commands/tasks/unicom/handlers/dailyEvent.js index 7da27b992..562c8ed78 100644 --- a/commands/tasks/unicom/handlers/dailyEvent.js +++ b/commands/tasks/unicom/handlers/dailyEvent.js @@ -1,5 +1,5 @@ const useragent = require("./myPhone").useragent; -let AES = require("./handlers/PAES"); +let AES = require("./PAES"); /** * @param {String} url request url absolute path @@ -83,7 +83,7 @@ let postFreeLoginRock = (referer) => { }) .catch((err) => console.log(err)); - result = res.data; + let result = res.data; if (result.code !== 0) { throw new Error(result.message); } @@ -108,7 +108,7 @@ let lookVideoDoubleResult = (title) => { url: `https://m.jf.10010.com/jf-yuech/api/gameResult/doublingIntegral?activityId=${activityId}&winningRecordId=${winningRecordId}`, method: "get", }); - result = res.data; + let result = res.data; if (result.code !== 0) { console.log(`⭕ ${title}翻倍结果:`, result.message); } else { diff --git a/commands/tasks/unicom/handlers/myPhone.js b/commands/tasks/unicom/handlers/myPhone.js index daf97dfc3..6143c416e 100644 --- a/commands/tasks/unicom/handlers/myPhone.js +++ b/commands/tasks/unicom/handlers/myPhone.js @@ -1,15 +1,16 @@ const useragent = (options) => `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0102,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; // `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36;devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:};unicom{version:android@8.0102,desmobile:${options.user}}`; -const USER_AGENTS = []; +// const USER_AGENTS = []; function randomNumber(min = 0, max = 100) { return Math.min(Math.floor(min + Math.random() * (max - min)), max); } //pick a random user-agent -const USER_AGENT = USER_AGENTS[randomNumber(0, USER_AGENTS.length)]; +// const USER_AGENT = USER_AGENTS[randomNumber(0, USER_AGENTS.length)]; module.exports = { useragent, + randomNumber, }; diff --git a/package-lock.json b/package-lock.json index 1b563448a..03c4f814d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,3265 +1,76 @@ { "name": "auto-sign-machine", "version": "1.0.0", - "lockfileVersion": 2, + "lockfileVersion": 1, "requires": true, - "packages": { - "": { - "name": "auto-sign-machine", - "version": "1.0.0", - "license": "MIT", - "dependencies": { - "axios": "^0.21.0", - "axios-cookiejar-support": "^1.0.1", - "cheerio": "^1.0.0-rc.3", - "crypto": "^1.0.1", - "crypto-js": "^4.0.0", - "dayjs": "^1.9.6", - "fs-extra": "^9.0.1", - "iconv-lite": "^0.6.2", - "moment": "^2.29.1", - "p-queue": "^6.6.2", - "protobufjs": "^6.10.2", - "qs": "^6.9.4", - "tough-cookie": "^4.0.0", - "yargs": "^16.1.0" - }, - "devDependencies": { - "serverless-tencent-scf": "^0.1.7" - } - }, - "node_modules/@protobufjs/aspromise": { - "version": "1.1.2", - "resolved": "https://registry.npm.taobao.org/@protobufjs/aspromise/download/@protobufjs/aspromise-1.1.2.tgz", - "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" - }, - "node_modules/@protobufjs/base64": { - "version": "1.1.2", - "resolved": "https://registry.npm.taobao.org/@protobufjs/base64/download/@protobufjs/base64-1.1.2.tgz", - "integrity": "sha1-TIVzDlm5ofHzSQR9vyQpYDS7JzU=" - }, - "node_modules/@protobufjs/codegen": { - "version": "2.0.4", - "resolved": "https://registry.npm.taobao.org/@protobufjs/codegen/download/@protobufjs/codegen-2.0.4.tgz", - "integrity": "sha1-fvN/DQEPsCitGtWXIuUG2SYoFcs=" - }, - "node_modules/@protobufjs/eventemitter": { - "version": "1.1.0", - "resolved": "https://registry.npm.taobao.org/@protobufjs/eventemitter/download/@protobufjs/eventemitter-1.1.0.tgz", - "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" - }, - "node_modules/@protobufjs/fetch": { - "version": "1.1.0", - "resolved": "https://registry.npm.taobao.org/@protobufjs/fetch/download/@protobufjs/fetch-1.1.0.tgz", - "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", - "dependencies": { - "@protobufjs/aspromise": "^1.1.1", - "@protobufjs/inquire": "^1.1.0" - } - }, - "node_modules/@protobufjs/float": { - "version": "1.0.2", - "resolved": "https://registry.npm.taobao.org/@protobufjs/float/download/@protobufjs/float-1.0.2.tgz", - "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" - }, - "node_modules/@protobufjs/inquire": { - "version": "1.1.0", - "resolved": "https://registry.npm.taobao.org/@protobufjs/inquire/download/@protobufjs/inquire-1.1.0.tgz", - "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" - }, - "node_modules/@protobufjs/path": { - "version": "1.1.2", - "resolved": "https://registry.npm.taobao.org/@protobufjs/path/download/@protobufjs/path-1.1.2.tgz", - "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" - }, - "node_modules/@protobufjs/pool": { - "version": "1.1.0", - "resolved": "https://registry.npm.taobao.org/@protobufjs/pool/download/@protobufjs/pool-1.1.0.tgz", - "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" - }, - "node_modules/@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npm.taobao.org/@protobufjs/utf8/download/@protobufjs/utf8-1.1.0.tgz", - "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" - }, - "node_modules/@types/long": { - "version": "4.0.1", - "resolved": "https://registry.npm.taobao.org/@types/long/download/@types/long-4.0.1.tgz?cache=0&sync_timestamp=1605055033937&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Flong%2Fdownload%2F%40types%2Flong-4.0.1.tgz", - "integrity": "sha1-RZxl+hhn2v5qjzIsTFFpVmPMVek=" - }, - "node_modules/@types/node": { - "version": "14.14.22", - "resolved": "https://registry.npm.taobao.org/@types/node/download/@types/node-14.14.22.tgz?cache=0&sync_timestamp=1611167664149&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fnode%2Fdownload%2F%40types%2Fnode-14.14.22.tgz", - "integrity": "sha1-DSnzgkcsTM872W/wzkfa9be4Sxg=" - }, - "node_modules/@types/tough-cookie": { - "version": "4.0.0", - "resolved": "https://registry.npm.taobao.org/@types/tough-cookie/download/@types/tough-cookie-4.0.0.tgz", - "integrity": "sha1-/vGQTkZotuXs7mDFLMageP+maX0=", - "peer": true - }, - "node_modules/agent-base": { - "version": "4.3.0", - "resolved": "https://registry.npm.taobao.org/agent-base/download/agent-base-4.3.0.tgz?cache=0&sync_timestamp=1603479960600&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fagent-base%2Fdownload%2Fagent-base-4.3.0.tgz", - "integrity": "sha1-gWXwHENgCbzK0LHRIvBe13Dvxu4=", - "dev": true, - "dependencies": { - "es6-promisify": "^5.0.0" - }, - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npm.taobao.org/ajv/download/ajv-6.12.6.tgz?cache=0&sync_timestamp=1609583919173&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv%2Fdownload%2Fajv-6.12.6.tgz", - "integrity": "sha1-uvWmLoArB9l3A0WG+MO69a3ybfQ=", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "node_modules/ansi-colors": { - "version": "3.2.3", - "resolved": "https://registry.npm.taobao.org/ansi-colors/download/ansi-colors-3.2.3.tgz", - "integrity": "sha1-V9NbhoboUeLMBMQD8cACA5dqGBM=", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npm.taobao.org/argparse/download/argparse-1.0.10.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fargparse%2Fdownload%2Fargparse-1.0.10.tgz", - "integrity": "sha1-vNZ5HqWuCXJeF+WtmIE0zUCz2RE=", - "dev": true, - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/array-filter": { - "version": "1.0.0", - "resolved": "https://registry.npm.taobao.org/array-filter/download/array-filter-1.0.0.tgz", - "integrity": "sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=", - "dev": true - }, - "node_modules/asn1": { - "version": "0.2.4", - "resolved": "https://registry.npm.taobao.org/asn1/download/asn1-0.2.4.tgz", - "integrity": "sha1-jSR136tVO7M+d7VOWeiAu4ziMTY=", - "dev": true, - "dependencies": { - "safer-buffer": "~2.1.0" - } - }, - "node_modules/assert": { - "version": "2.0.0", - "resolved": "https://registry.npm.taobao.org/assert/download/assert-2.0.0.tgz", - "integrity": "sha1-lfwcYW1IcTUQaA8ury0Q3SLgLTI=", - "dev": true, - "dependencies": { - "es6-object-assign": "^1.1.0", - "is-nan": "^1.2.1", - "object-is": "^1.0.1", - "util": "^0.12.0" - } - }, - "node_modules/assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npm.taobao.org/assert-plus/download/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npm.taobao.org/assertion-error/download/assertion-error-1.1.0.tgz", - "integrity": "sha1-5gtrDo8wG9l+U3UhW9pAbIURjAs=", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/async": { - "version": "2.6.3", - "resolved": "https://registry.npm.taobao.org/async/download/async-2.6.3.tgz", - "integrity": "sha1-1yYl4jRKNlbjo61Pp0n6gymdgv8=", - "dev": true, - "dependencies": { - "lodash": "^4.17.14" - } - }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npm.taobao.org/asynckit/download/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true - }, - "node_modules/at-least-node": { - "version": "1.0.0", - "resolved": "https://registry.npm.taobao.org/at-least-node/download/at-least-node-1.0.0.tgz", - "integrity": "sha1-YCzUtG6EStTv/JKoARo8RuAjjcI=", - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/atomically": { - "version": "1.7.0", - "resolved": "https://registry.npm.taobao.org/atomically/download/atomically-1.7.0.tgz", - "integrity": "sha1-wHoEWEMuptvJo1Bv/6QktIvMqv4=", - "dev": true, - "engines": { - "node": ">=10.12.0" - } - }, - "node_modules/available-typed-arrays": { - "version": "1.0.2", - "resolved": "https://registry.npm.taobao.org/available-typed-arrays/download/available-typed-arrays-1.0.2.tgz", - "integrity": "sha1-awmMqdgDkHnuP3f3t4PESAulE/U=", - "dev": true, - "dependencies": { - "array-filter": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npm.taobao.org/aws-sign2/download/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/aws4": { - "version": "1.11.0", - "resolved": "https://registry.npm.taobao.org/aws4/download/aws4-1.11.0.tgz?cache=0&sync_timestamp=1604101385256&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Faws4%2Fdownload%2Faws4-1.11.0.tgz", - "integrity": "sha1-1h9G2DslGSUOJ4Ta9bCUeai0HFk=", - "dev": true - }, - "node_modules/axios": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.0.tgz", - "integrity": "sha512-fmkJBknJKoZwem3/IKSSLpkdNXZeBu5Q7GA/aRsr2btgrptmSCxi2oFjZHqGdK9DoTil9PIHlPIZw2EcRJXRvw==", - "dependencies": { - "follow-redirects": "^1.10.0" - } - }, - "node_modules/axios-cookiejar-support": { - "version": "1.0.1", - "resolved": "https://registry.npm.taobao.org/axios-cookiejar-support/download/axios-cookiejar-support-1.0.1.tgz", - "integrity": "sha1-ezKvfZMlCFRsaLH8W6j1YohBYuE=", - "dependencies": { - "is-redirect": "^1.0.0", - "pify": "^5.0.0" - }, - "engines": { - "node": ">= 10.0.0" - }, - "peerDependencies": { - "@types/tough-cookie": ">=2.3.3", - "axios": ">=0.16.2", - "tough-cookie": ">=2.3.3" - } - }, - "node_modules/balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npm.taobao.org/balanced-match/download/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npm.taobao.org/base64-js/download/base64-js-1.5.1.tgz?cache=0&sync_timestamp=1605123700994&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbase64-js%2Fdownload%2Fbase64-js-1.5.1.tgz", - "integrity": "sha1-GxtEAWClv3rUC2UPCVljSBkDkwo=", - "dev": true - }, - "node_modules/bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npm.taobao.org/bcrypt-pbkdf/download/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "dev": true, - "dependencies": { - "tweetnacl": "^0.14.3" - } - }, - "node_modules/bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npm.taobao.org/bluebird/download/bluebird-3.7.2.tgz", - "integrity": "sha1-nyKcFb4nJFT/qXOs4NvueaGww28=", - "dev": true - }, - "node_modules/boolbase": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", - "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=" - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npm.taobao.org/brace-expansion/download/brace-expansion-1.1.11.tgz?cache=0&sync_timestamp=1601898201980&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbrace-expansion%2Fdownload%2Fbrace-expansion-1.1.11.tgz", - "integrity": "sha1-PH/L9SnYcibz0vUrlm/1Jx60Qd0=", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npm.taobao.org/browser-stdout/download/browser-stdout-1.3.1.tgz", - "integrity": "sha1-uqVZ7hTO1zRSIputcyZGfGH6vWA=", - "dev": true - }, - "node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npm.taobao.org/buffer/download/buffer-5.7.1.tgz", - "integrity": "sha1-umLnwTEzBTWCGXFghRqPZI6Z7tA=", - "dev": true, - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "node_modules/buffer-alloc": { - "version": "1.2.0", - "resolved": "https://registry.npm.taobao.org/buffer-alloc/download/buffer-alloc-1.2.0.tgz", - "integrity": "sha1-iQ3ZDZI6hz4I4Q5f1RpX5bfM4Ow=", - "dev": true, - "dependencies": { - "buffer-alloc-unsafe": "^1.1.0", - "buffer-fill": "^1.0.0" - } - }, - "node_modules/buffer-alloc-unsafe": { - "version": "1.1.0", - "resolved": "https://registry.npm.taobao.org/buffer-alloc-unsafe/download/buffer-alloc-unsafe-1.1.0.tgz", - "integrity": "sha1-vX3CauKXLQ7aJTvgYdupkjScGfA=", - "dev": true - }, - "node_modules/buffer-fill": { - "version": "1.0.0", - "resolved": "https://registry.npm.taobao.org/buffer-fill/download/buffer-fill-1.0.0.tgz", - "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=", - "dev": true - }, - "node_modules/buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npm.taobao.org/buffer-from/download/buffer-from-1.1.1.tgz", - "integrity": "sha1-MnE7wCj3XAL9txDXx7zsHyxgcO8=", - "dev": true - }, - "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npm.taobao.org/call-bind/download/call-bind-1.0.2.tgz?cache=0&sync_timestamp=1610403007655&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcall-bind%2Fdownload%2Fcall-bind-1.0.2.tgz", - "integrity": "sha1-sdTonmiBGcPJqQOtMKuy9qkZvjw=", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - } - }, - "node_modules/camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npm.taobao.org/camelcase/download/camelcase-5.3.1.tgz?cache=0&sync_timestamp=1603921799543&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcamelcase%2Fdownload%2Fcamelcase-5.3.1.tgz", - "integrity": "sha1-48mzFWnhBoEd8kL3FXJaH0xJQyA=", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/caseless": { - "version": "0.12.0", - "resolved": "https://registry.npm.taobao.org/caseless/download/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", - "dev": true - }, - "node_modules/chai": { - "version": "4.2.0", - "resolved": "https://registry.npm.taobao.org/chai/download/chai-4.2.0.tgz", - "integrity": "sha1-dgqnLPION5XoSxKHfODoNzeqKeU=", - "dev": true, - "dependencies": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.2", - "deep-eql": "^3.0.1", - "get-func-name": "^2.0.0", - "pathval": "^1.1.0", - "type-detect": "^4.0.5" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npm.taobao.org/chalk/download/chalk-2.4.2.tgz", - "integrity": "sha1-zUJUFnelQzPPVBpJEIwUMrRMlCQ=", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/chalk/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-3.2.1.tgz?cache=0&sync_timestamp=1611325836307&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fansi-styles%2Fdownload%2Fansi-styles-3.2.1.tgz", - "integrity": "sha1-QfuyAkPlCxK+DwS43tvwdSDOhB0=", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/chalk/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-1.9.3.tgz", - "integrity": "sha1-u3GFBpDh8TZWfeYp0tVHHe2kweg=", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/chalk/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "node_modules/check-error": { - "version": "1.0.2", - "resolved": "https://registry.npm.taobao.org/check-error/download/check-error-1.0.2.tgz", - "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/cheerio": { - "version": "1.0.0-rc.3", - "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.3.tgz", - "integrity": "sha512-0td5ijfUPuubwLUu0OBoe98gZj8C/AA+RW3v67GPlGOrvxWjZmBXiBCRU+I8VEiNyJzjth40POfHiz2RB3gImA==", - "dependencies": { - "css-select": "~1.2.0", - "dom-serializer": "~0.1.1", - "entities": "~1.1.1", - "htmlparser2": "^3.9.1", - "lodash": "^4.15.0", - "parse5": "^3.0.1" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ci-info": { - "version": "2.0.0", - "resolved": "https://registry.npm.taobao.org/ci-info/download/ci-info-2.0.0.tgz", - "integrity": "sha1-Z6npZL4xpR4V5QENWObxKDQAL0Y=", - "dev": true - }, - "node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "license": "ISC", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "node_modules/co": { - "version": "4.6.0", - "resolved": "https://registry.npm.taobao.org/co/download/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", - "dev": true, - "engines": { - "iojs": ">= 1.0.0", - "node": ">= 0.12.0" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "license": "MIT" - }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npm.taobao.org/combined-stream/download/combined-stream-1.0.8.tgz", - "integrity": "sha1-w9RaizT9cwYxoRCoolIGgrMdWn8=", - "dev": true, - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npm.taobao.org/concat-map/download/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "node_modules/conf": { - "version": "6.2.4", - "resolved": "https://registry.npm.taobao.org/conf/download/conf-6.2.4.tgz", - "integrity": "sha1-SdI8TiHvKsKGD3te0lt7fkhPdp8=", - "dev": true, - "dependencies": { - "ajv": "^6.10.2", - "debounce-fn": "^3.0.1", - "dot-prop": "^5.0.0", - "env-paths": "^2.2.0", - "json-schema-typed": "^7.0.1", - "make-dir": "^3.0.0", - "onetime": "^5.1.0", - "pkg-up": "^3.0.1", - "semver": "^6.2.0", - "write-file-atomic": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npm.taobao.org/core-util-is/download/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true - }, - "node_modules/cos-nodejs-sdk-v5": { - "version": "2.9.1", - "resolved": "https://registry.npm.taobao.org/cos-nodejs-sdk-v5/download/cos-nodejs-sdk-v5-2.9.1.tgz", - "integrity": "sha1-UlEx/ETr9q11Y0Ky02lykZ2kVIg=", - "dev": true, - "dependencies": { - "@types/node": "^14.14.20", - "conf": "^7.1.2", - "mime-types": "^2.1.24", - "request": "^2.88.2", - "xml2js": "^0.4.19" - } - }, - "node_modules/cos-nodejs-sdk-v5/node_modules/conf": { - "version": "7.1.2", - "resolved": "https://registry.npm.taobao.org/conf/download/conf-7.1.2.tgz", - "integrity": "sha1-2WeKnY8E3ov1zUdRBdqP2uScLsQ=", - "dev": true, - "dependencies": { - "ajv": "^6.12.2", - "atomically": "^1.3.1", - "debounce-fn": "^4.0.0", - "dot-prop": "^5.2.0", - "env-paths": "^2.2.0", - "json-schema-typed": "^7.0.3", - "make-dir": "^3.1.0", - "onetime": "^5.1.0", - "pkg-up": "^3.1.0", - "semver": "^7.3.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/cos-nodejs-sdk-v5/node_modules/debounce-fn": { - "version": "4.0.0", - "resolved": "https://registry.npm.taobao.org/debounce-fn/download/debounce-fn-4.0.0.tgz", - "integrity": "sha1-7XbSBtilDmDeDdZtSU2Cg1/+Ycc=", - "dev": true, - "dependencies": { - "mimic-fn": "^3.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/cos-nodejs-sdk-v5/node_modules/mimic-fn": { - "version": "3.1.0", - "resolved": "https://registry.npm.taobao.org/mimic-fn/download/mimic-fn-3.1.0.tgz?cache=0&sync_timestamp=1596095644798&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmimic-fn%2Fdownload%2Fmimic-fn-3.1.0.tgz", - "integrity": "sha1-ZXVRRbvz42lUuUnBZFBCdFHVynQ=", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/cos-nodejs-sdk-v5/node_modules/semver": { - "version": "7.3.4", - "resolved": "https://registry.npm.taobao.org/semver/download/semver-7.3.4.tgz?cache=0&sync_timestamp=1606853731020&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsemver%2Fdownload%2Fsemver-7.3.4.tgz", - "integrity": "sha1-J6qn0uTKdkUvmNOt0JOnLJQ+3Jc=", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/crypto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/crypto/-/crypto-1.0.1.tgz", - "integrity": "sha512-VxBKmeNcqQdiUQUW2Tzq0t377b54N2bMtXO/qiLa+6eRRmmC4qT3D4OnTGoT/U6O9aklQ/jTwbOtRMTTY8G0Ig==", - "deprecated": "This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in." - }, - "node_modules/crypto-js": { - "version": "4.0.0", - "resolved": "https://registry.npm.taobao.org/crypto-js/download/crypto-js-4.0.0.tgz", - "integrity": "sha1-KQSrJnep0EKFai6i74DekuSjbcw=" - }, - "node_modules/css-select": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", - "integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=", - "dependencies": { - "boolbase": "~1.0.0", - "css-what": "2.1", - "domutils": "1.5.1", - "nth-check": "~1.0.1" - } - }, - "node_modules/css-what": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.3.tgz", - "integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==", - "engines": { - "node": "*" - } - }, - "node_modules/dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npm.taobao.org/dashdash/download/dashdash-1.14.1.tgz?cache=0&sync_timestamp=1601073381998&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdashdash%2Fdownload%2Fdashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "dev": true, - "dependencies": { - "assert-plus": "^1.0.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/dayjs": { - "version": "1.9.6", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.9.6.tgz", - "integrity": "sha512-HngNLtPEBWRo8EFVmHFmSXAjtCX8rGNqeXQI0Gh7wCTSqwaKgPIDqu9m07wABVopNwzvOeCb+2711vQhDlcIXw==" - }, - "node_modules/debounce-fn": { - "version": "3.0.1", - "resolved": "https://registry.npm.taobao.org/debounce-fn/download/debounce-fn-3.0.1.tgz", - "integrity": "sha1-A0r+i5BNmF0ewapYnNFfOIdB1oA=", - "dev": true, - "dependencies": { - "mimic-fn": "^2.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/debug": { - "version": "3.2.6", - "resolved": "https://registry.npm.taobao.org/debug/download/debug-3.2.6.tgz?cache=0&sync_timestamp=1607566580543&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-3.2.6.tgz", - "integrity": "sha1-6D0X3hbYp++3cX7b5fsQE17uYps=", - "deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)", - "dev": true, - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npm.taobao.org/decamelize/download/decamelize-1.2.0.tgz?cache=0&sync_timestamp=1610348706789&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdecamelize%2Fdownload%2Fdecamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/deep-eql": { - "version": "3.0.1", - "resolved": "https://registry.npm.taobao.org/deep-eql/download/deep-eql-3.0.1.tgz", - "integrity": "sha1-38lARACtHI/gI+faHfHBR8S0RN8=", - "dev": true, - "dependencies": { - "type-detect": "^4.0.0" - }, - "engines": { - "node": ">=0.12" - } - }, - "node_modules/define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npm.taobao.org/define-properties/download/define-properties-1.1.3.tgz", - "integrity": "sha1-z4jabL7ib+bbcJT2HYcMvYTO6fE=", - "dev": true, - "dependencies": { - "object-keys": "^1.0.12" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npm.taobao.org/delayed-stream/download/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/detect-mocha": { - "version": "0.1.0", - "resolved": "https://registry.npm.taobao.org/detect-mocha/download/detect-mocha-0.1.0.tgz", - "integrity": "sha1-dDVauHlZUx6i7jirJQgtjSzkdAI=", - "dev": true, - "dependencies": { - "global-var": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/diff": { - "version": "3.5.0", - "resolved": "https://registry.npm.taobao.org/diff/download/diff-3.5.0.tgz?cache=0&sync_timestamp=1604803633979&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdiff%2Fdownload%2Fdiff-3.5.0.tgz", - "integrity": "sha1-gAwN0eCov7yVg1wgKtIg/jF+WhI=", - "dev": true, - "engines": { - "node": ">=0.3.1" - } - }, - "node_modules/dijkstrajs": { - "version": "1.0.1", - "resolved": "https://registry.npm.taobao.org/dijkstrajs/download/dijkstrajs-1.0.1.tgz", - "integrity": "sha1-082BIh4+pAdCz83lVtTpnpjdxxs=", - "dev": true - }, - "node_modules/dom-serializer": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.1.tgz", - "integrity": "sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==", - "dependencies": { - "domelementtype": "^1.3.0", - "entities": "^1.1.1" - } - }, - "node_modules/domelementtype": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", - "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==" - }, - "node_modules/domhandler": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz", - "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==", - "dependencies": { - "domelementtype": "1" - } - }, - "node_modules/domutils": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", - "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", - "dependencies": { - "dom-serializer": "0", - "domelementtype": "1" - } - }, - "node_modules/dot-prop": { - "version": "5.3.0", - "resolved": "https://registry.npm.taobao.org/dot-prop/download/dot-prop-5.3.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdot-prop%2Fdownload%2Fdot-prop-5.3.0.tgz", - "integrity": "sha1-kMzOcIzZzYLMTcjD3dmr3VWyDog=", - "dev": true, - "dependencies": { - "is-obj": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npm.taobao.org/ecc-jsbn/download/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "dev": true, - "dependencies": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "license": "MIT" - }, - "node_modules/end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npm.taobao.org/end-of-stream/download/end-of-stream-1.4.4.tgz", - "integrity": "sha1-WuZKX0UFe682JuwU2gyl5LJDHrA=", - "dev": true, - "dependencies": { - "once": "^1.4.0" - } - }, - "node_modules/entities": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", - "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==" - }, - "node_modules/env-paths": { - "version": "2.2.0", - "resolved": "https://registry.npm.taobao.org/env-paths/download/env-paths-2.2.0.tgz", - "integrity": "sha1-zcpVfcAJFSkX1hZuL+vh8DloXkM=", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/es-abstract": { - "version": "1.18.0-next.2", - "resolved": "https://registry.npm.taobao.org/es-abstract/download/es-abstract-1.18.0-next.2.tgz?cache=0&sync_timestamp=1610935583279&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fes-abstract%2Fdownload%2Fes-abstract-1.18.0-next.2.tgz", - "integrity": "sha1-CIEBpV8FQfWV5+BXGZ4n3cjzpcI=", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.2.2", - "is-negative-zero": "^2.0.1", - "is-regex": "^1.1.1", - "object-inspect": "^1.9.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.2", - "string.prototype.trimend": "^1.0.3", - "string.prototype.trimstart": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-abstract/node_modules/object.assign": { - "version": "4.1.2", - "resolved": "https://registry.npm.taobao.org/object.assign/download/object.assign-4.1.2.tgz?cache=0&sync_timestamp=1604115167242&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fobject.assign%2Fdownload%2Fobject.assign-4.1.2.tgz", - "integrity": "sha1-DtVKNC7Os3s4/3brgxoOeIy2OUA=", - "dev": true, - "dependencies": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "has-symbols": "^1.0.1", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-to-primitive": { - "version": "1.2.1", - "resolved": "https://registry.npm.taobao.org/es-to-primitive/download/es-to-primitive-1.2.1.tgz", - "integrity": "sha1-5VzUyc3BiLzvsDs2bHNjI/xciYo=", - "dev": true, - "dependencies": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es6-object-assign": { - "version": "1.1.0", - "resolved": "https://registry.npm.taobao.org/es6-object-assign/download/es6-object-assign-1.1.0.tgz", - "integrity": "sha1-wsNYJlYkfDnqEHyx5mUrb58kUjw=", - "dev": true - }, - "node_modules/es6-promise": { - "version": "4.2.8", - "resolved": "https://registry.npm.taobao.org/es6-promise/download/es6-promise-4.2.8.tgz", - "integrity": "sha1-TrIVlMlyvEBVPSduUQU5FD21Pgo=", - "dev": true - }, - "node_modules/es6-promisify": { - "version": "5.0.0", - "resolved": "https://registry.npm.taobao.org/es6-promisify/download/es6-promisify-5.0.0.tgz", - "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", - "dev": true, - "dependencies": { - "es6-promise": "^4.0.3" - } - }, - "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npm.taobao.org/escape-string-regexp/download/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npm.taobao.org/esprima/download/esprima-4.0.1.tgz", - "integrity": "sha1-E7BM2z5sXRnfkatph6hpVhmwqnE=", - "dev": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eventemitter3": { - "version": "4.0.7", - "resolved": "https://registry.npm.taobao.org/eventemitter3/download/eventemitter3-4.0.7.tgz?cache=0&sync_timestamp=1598517724259&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feventemitter3%2Fdownload%2Feventemitter3-4.0.7.tgz", - "integrity": "sha1-Lem2j2Uo1WRO9cWVJqG0oHMGFp8=" - }, - "node_modules/extend": { - "version": "3.0.2", - "resolved": "https://registry.npm.taobao.org/extend/download/extend-3.0.2.tgz", - "integrity": "sha1-+LETa0Bx+9jrFAr/hYsQGewpFfo=", - "dev": true - }, - "node_modules/extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npm.taobao.org/extsprintf/download/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "dev": true, - "engines": [ - "node >=0.6.0" - ] - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npm.taobao.org/fast-deep-equal/download/fast-deep-equal-3.1.3.tgz", - "integrity": "sha1-On1WtVnWy8PrUSMlJE5hmmXGxSU=", - "dev": true - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npm.taobao.org/fast-json-stable-stringify/download/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha1-h0v2nG9ATCtdmcSBNBOZ/VWJJjM=", - "dev": true - }, - "node_modules/filesize": { - "version": "5.0.3", - "resolved": "https://registry.npm.taobao.org/filesize/download/filesize-5.0.3.tgz", - "integrity": "sha1-L6KEGF6dLo7b7CkVtNrc5AQ6rDE=", - "dev": true, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/find-up": { - "version": "3.0.0", - "resolved": "https://registry.npm.taobao.org/find-up/download/find-up-3.0.0.tgz?cache=0&sync_timestamp=1597169882796&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffind-up%2Fdownload%2Ffind-up-3.0.0.tgz", - "integrity": "sha1-SRafHXmTQwZG2mHsxa41XCHJe3M=", - "dev": true, - "dependencies": { - "locate-path": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/flat": { - "version": "4.1.1", - "resolved": "https://registry.npm.taobao.org/flat/download/flat-4.1.1.tgz?cache=0&sync_timestamp=1602723427161&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fflat%2Fdownload%2Fflat-4.1.1.tgz", - "integrity": "sha1-o5IFnMOCiB/5hkL12k3eCpWfMJs=", - "dev": true, - "dependencies": { - "is-buffer": "~2.0.3" - }, - "bin": { - "flat": "cli.js" - } - }, - "node_modules/follow-redirects": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.0.tgz", - "integrity": "sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "engines": { - "node": ">=4.0" - } - }, - "node_modules/foreach": { - "version": "2.0.5", - "resolved": "https://registry.npm.taobao.org/foreach/download/foreach-2.0.5.tgz", - "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", - "dev": true - }, - "node_modules/forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npm.taobao.org/forever-agent/download/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/form-data": { - "version": "2.3.3", - "resolved": "https://registry.npm.taobao.org/form-data/download/form-data-2.3.3.tgz", - "integrity": "sha1-3M5SwF9kTymManq5Nr1yTO/786Y=", - "dev": true, - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 0.12" - } - }, - "node_modules/fs-extra": { - "version": "9.0.1", - "resolved": "https://registry.npm.taobao.org/fs-extra/download/fs-extra-9.0.1.tgz", - "integrity": "sha1-kQ2gBiQ3ukw5/t2GPxZ1zP78ufw=", - "dependencies": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^1.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npm.taobao.org/fs.realpath/download/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npm.taobao.org/function-bind/download/function-bind-1.1.1.tgz", - "integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0=", - "dev": true - }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "license": "ISC", - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npm.taobao.org/get-func-name/download/get-func-name-2.0.0.tgz", - "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/get-intrinsic": { - "version": "1.1.0", - "resolved": "https://registry.npm.taobao.org/get-intrinsic/download/get-intrinsic-1.1.0.tgz", - "integrity": "sha1-iS5ikx5pOMiiPqWq68+2e9l9qX4=", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1" - } - }, - "node_modules/get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npm.taobao.org/get-stream/download/get-stream-4.1.0.tgz?cache=0&sync_timestamp=1597056535605&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fget-stream%2Fdownload%2Fget-stream-4.1.0.tgz", - "integrity": "sha1-wbJVV189wh1Zv8ec09K0axw6VLU=", - "dev": true, - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/getpass": { - "version": "0.1.7", - "resolved": "https://registry.npm.taobao.org/getpass/download/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "dev": true, - "dependencies": { - "assert-plus": "^1.0.0" - } - }, - "node_modules/glob": { - "version": "7.1.3", - "resolved": "https://registry.npm.taobao.org/glob/download/glob-7.1.3.tgz", - "integrity": "sha1-OWCDLT8VdBCDQtr9OmezMsCWnfE=", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - } - }, - "node_modules/global-var": { - "version": "0.1.0", - "resolved": "https://registry.npm.taobao.org/global-var/download/global-var-0.1.0.tgz", - "integrity": "sha1-yOPo/5yIJ9uc1BUvZLszW498mbY=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npm.taobao.org/graceful-fs/download/graceful-fs-4.2.4.tgz", - "integrity": "sha1-Ila94U02MpWMRl68ltxGfKB6Kfs=" - }, - "node_modules/growl": { - "version": "1.10.5", - "resolved": "https://registry.npm.taobao.org/growl/download/growl-1.10.5.tgz", - "integrity": "sha1-8nNdwig2dPpnR4sQGBBZNVw2nl4=", - "dev": true, - "engines": { - "node": ">=4.x" - } - }, - "node_modules/har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npm.taobao.org/har-schema/download/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/har-validator": { - "version": "5.1.5", - "resolved": "https://registry.npm.taobao.org/har-validator/download/har-validator-5.1.5.tgz?cache=0&sync_timestamp=1596082584903&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fhar-validator%2Fdownload%2Fhar-validator-5.1.5.tgz", - "integrity": "sha1-HwgDufjLIMD6E4It8ezds2veHv0=", - "deprecated": "this", - "dev": true, - "dependencies": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npm.taobao.org/has/download/has-1.0.3.tgz", - "integrity": "sha1-ci18v8H2qoJB8W3YFOAR4fQeh5Y=", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-3.0.0.tgz?cache=0&sync_timestamp=1577797756584&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fhas-flag%2Fdownload%2Fhas-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/has-symbols": { - "version": "1.0.1", - "resolved": "https://registry.npm.taobao.org/has-symbols/download/has-symbols-1.0.1.tgz", - "integrity": "sha1-n1IUdYpEGWxAbZvXbOv4HsLdMeg=", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/he": { - "version": "1.2.0", - "resolved": "https://registry.npm.taobao.org/he/download/he-1.2.0.tgz", - "integrity": "sha1-hK5l+n6vsWX922FWauFLrwVmTw8=", - "dev": true, - "bin": { - "he": "bin/he" - } - }, - "node_modules/htmlparser2": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz", - "integrity": "sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==", - "dependencies": { - "domelementtype": "^1.3.1", - "domhandler": "^2.3.0", - "domutils": "^1.5.1", - "entities": "^1.1.1", - "inherits": "^2.0.1", - "readable-stream": "^3.1.1" - } - }, - "node_modules/http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npm.taobao.org/http-signature/download/http-signature-1.2.0.tgz?cache=0&sync_timestamp=1600868443862&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fhttp-signature%2Fdownload%2Fhttp-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "dev": true, - "dependencies": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - }, - "engines": { - "node": ">=0.8", - "npm": ">=1.3.7" - } - }, - "node_modules/https-proxy-agent": { - "version": "2.2.4", - "resolved": "https://registry.npm.taobao.org/https-proxy-agent/download/https-proxy-agent-2.2.4.tgz", - "integrity": "sha1-TuenN6vZJniik9mzShr00NCMeHs=", - "dev": true, - "dependencies": { - "agent-base": "^4.3.0", - "debug": "^3.1.0" - }, - "engines": { - "node": ">= 4.5.0" - } - }, - "node_modules/iconv-lite": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.2.tgz", - "integrity": "sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ==", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npm.taobao.org/ieee754/download/ieee754-1.2.1.tgz?cache=0&sync_timestamp=1603838623318&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fieee754%2Fdownload%2Fieee754-1.2.1.tgz", - "integrity": "sha1-jrehCmP/8l0VpXsAFYbRd9Gw01I=", - "dev": true - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npm.taobao.org/imurmurhash/download/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true, - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npm.taobao.org/inflight/download/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npm.taobao.org/ini/download/ini-1.3.8.tgz?cache=0&sync_timestamp=1607907842483&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fini%2Fdownload%2Fini-1.3.8.tgz", - "integrity": "sha1-op2kJbSIBvNHZ6Tvzjlyaa8oQyw=", - "dev": true - }, - "node_modules/is-arguments": { - "version": "1.1.0", - "resolved": "https://registry.npm.taobao.org/is-arguments/download/is-arguments-1.1.0.tgz?cache=0&sync_timestamp=1607117383813&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fis-arguments%2Fdownload%2Fis-arguments-1.1.0.tgz", - "integrity": "sha1-YjUwMd++4HzrNGVqa95Z7+yujdk=", - "dev": true, - "dependencies": { - "call-bind": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/is-buffer": { - "version": "2.0.5", - "resolved": "https://registry.npm.taobao.org/is-buffer/download/is-buffer-2.0.5.tgz?cache=0&sync_timestamp=1604429876103&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fis-buffer%2Fdownload%2Fis-buffer-2.0.5.tgz", - "integrity": "sha1-68JS5ADSL/jXf6CYiIIaJKZYwZE=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/is-callable": { - "version": "1.2.2", - "resolved": "https://registry.npm.taobao.org/is-callable/download/is-callable-1.2.2.tgz?cache=0&sync_timestamp=1600719276620&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fis-callable%2Fdownload%2Fis-callable-1.2.2.tgz", - "integrity": "sha1-x8ZxXNItTdtI0+GZcCI6zquwgNk=", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/is-date-object": { - "version": "1.0.2", - "resolved": "https://registry.npm.taobao.org/is-date-object/download/is-date-object-1.0.2.tgz?cache=0&sync_timestamp=1576729182289&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fis-date-object%2Fdownload%2Fis-date-object-1.0.2.tgz", - "integrity": "sha1-vac28s2P0G0yhE53Q7+nSUw7/X4=", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-generator-function": { - "version": "1.0.8", - "resolved": "https://registry.npm.taobao.org/is-generator-function/download/is-generator-function-1.0.8.tgz", - "integrity": "sha1-37XCsSDgKwqNnSxoBs1WIaqSL3s=", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/is-nan": { - "version": "1.3.2", - "resolved": "https://registry.npm.taobao.org/is-nan/download/is-nan-1.3.2.tgz", - "integrity": "sha1-BDpUreoxdItVts1OCara+mm9nh0=", - "dev": true, - "dependencies": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/is-negative-zero": { - "version": "2.0.1", - "resolved": "https://registry.npm.taobao.org/is-negative-zero/download/is-negative-zero-2.0.1.tgz?cache=0&sync_timestamp=1607125693555&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fis-negative-zero%2Fdownload%2Fis-negative-zero-2.0.1.tgz", - "integrity": "sha1-PedGwY3aIxkkGlNnWQjY92bxHCQ=", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/is-obj": { - "version": "2.0.0", - "resolved": "https://registry.npm.taobao.org/is-obj/download/is-obj-2.0.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fis-obj%2Fdownload%2Fis-obj-2.0.0.tgz", - "integrity": "sha1-Rz+wXZc3BeP9liBUUBjKjiLvSYI=", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-redirect": { - "version": "1.0.0", - "resolved": "https://registry.npm.taobao.org/is-redirect/download/is-redirect-1.0.0.tgz", - "integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-regex": { - "version": "1.1.1", - "resolved": "https://registry.npm.taobao.org/is-regex/download/is-regex-1.1.1.tgz?cache=0&sync_timestamp=1596555640677&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fis-regex%2Fdownload%2Fis-regex-1.1.1.tgz", - "integrity": "sha1-xvmKrMVG9s7FRooHt7FTq1ZKV7k=", - "dev": true, - "dependencies": { - "has-symbols": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npm.taobao.org/is-stream/download/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-symbol": { - "version": "1.0.3", - "resolved": "https://registry.npm.taobao.org/is-symbol/download/is-symbol-1.0.3.tgz", - "integrity": "sha1-OOEBS55jKb4N6dJKQU/XRB7GGTc=", - "dev": true, - "dependencies": { - "has-symbols": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/is-typed-array": { - "version": "1.1.4", - "resolved": "https://registry.npm.taobao.org/is-typed-array/download/is-typed-array-1.1.4.tgz", - "integrity": "sha1-H2bzSig6PJSkM1Q0ZhylP/+AESA=", - "dev": true, - "dependencies": { - "available-typed-arrays": "^1.0.2", - "call-bind": "^1.0.0", - "es-abstract": "^1.18.0-next.1", - "foreach": "^2.0.5", - "has-symbols": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npm.taobao.org/is-typedarray/download/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true - }, - "node_modules/isarray": { - "version": "2.0.5", - "resolved": "https://registry.npm.taobao.org/isarray/download/isarray-2.0.5.tgz", - "integrity": "sha1-ivHkwSISRMxiRZ+vOJQNTmRKVyM=", - "dev": true - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npm.taobao.org/isexe/download/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "node_modules/isstream": { - "version": "0.1.2", - "resolved": "https://registry.npm.taobao.org/isstream/download/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "dev": true - }, - "node_modules/js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npm.taobao.org/js-yaml/download/js-yaml-3.13.1.tgz", - "integrity": "sha1-r/FRswv9+o5J4F2iLnQV6d+jeEc=", - "dev": true, - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npm.taobao.org/jsbn/download/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true - }, - "node_modules/json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npm.taobao.org/json-schema/download/json-schema-0.2.3.tgz?cache=0&sync_timestamp=1609553637722&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjson-schema%2Fdownload%2Fjson-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", - "dev": true - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npm.taobao.org/json-schema-traverse/download/json-schema-traverse-0.4.1.tgz?cache=0&sync_timestamp=1607999852153&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjson-schema-traverse%2Fdownload%2Fjson-schema-traverse-0.4.1.tgz", - "integrity": "sha1-afaofZUTq4u4/mO9sJecRI5oRmA=", - "dev": true - }, - "node_modules/json-schema-typed": { - "version": "7.0.3", - "resolved": "https://registry.npm.taobao.org/json-schema-typed/download/json-schema-typed-7.0.3.tgz", - "integrity": "sha1-I/9IG4tO680soSO0+gQJ5mRpotk=", - "dev": true - }, - "node_modules/json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npm.taobao.org/json-stringify-safe/download/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "dev": true - }, - "node_modules/jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npm.taobao.org/jsonfile/download/jsonfile-6.1.0.tgz", - "integrity": "sha1-vFWyY0eTxnnsZAMJTrE2mKbsCq4=", - "dependencies": { - "graceful-fs": "^4.1.6", - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/jsonfile/node_modules/universalify": { - "version": "2.0.0", - "resolved": "https://registry.npm.taobao.org/universalify/download/universalify-2.0.0.tgz?cache=0&sync_timestamp=1603179970052&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Funiversalify%2Fdownload%2Funiversalify-2.0.0.tgz", - "integrity": "sha1-daSYTv7cSwiXXFrrc/Uw0C3yVxc=", - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npm.taobao.org/jsprim/download/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "dev": true, - "engines": [ - "node >=0.6.0" - ], - "dependencies": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, - "node_modules/locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npm.taobao.org/locate-path/download/locate-path-3.0.0.tgz", - "integrity": "sha1-2+w7OrdZdYBxtY/ln8QYca8hQA4=", - "dev": true, - "dependencies": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" - }, - "node_modules/log-symbols": { - "version": "2.2.0", - "resolved": "https://registry.npm.taobao.org/log-symbols/download/log-symbols-2.2.0.tgz", - "integrity": "sha1-V0Dhxdbw39pK2TI7UzIQfva0xAo=", - "dev": true, - "dependencies": { - "chalk": "^2.0.1" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/long": { - "version": "4.0.0", - "resolved": "https://registry.npm.taobao.org/long/download/long-4.0.0.tgz", - "integrity": "sha1-mntxz7fTYaGU6lVSQckvdGjVvyg=" - }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npm.taobao.org/lru-cache/download/lru-cache-6.0.0.tgz?cache=0&sync_timestamp=1594427567713&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Flru-cache%2Fdownload%2Flru-cache-6.0.0.tgz", - "integrity": "sha1-bW/mVw69lqr5D8rR2vo7JWbbOpQ=", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npm.taobao.org/make-dir/download/make-dir-3.1.0.tgz", - "integrity": "sha1-QV6WcEazp/HRhSd9hKpYIDcmoT8=", - "dev": true, - "dependencies": { - "semver": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/mime-db": { - "version": "1.45.0", - "resolved": "https://registry.npm.taobao.org/mime-db/download/mime-db-1.45.0.tgz?cache=0&sync_timestamp=1600831210195&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmime-db%2Fdownload%2Fmime-db-1.45.0.tgz", - "integrity": "sha1-zO7aIczXw6dF66LezVXUtz54eeo=", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.28", - "resolved": "https://registry.npm.taobao.org/mime-types/download/mime-types-2.1.28.tgz?cache=0&sync_timestamp=1609559952590&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmime-types%2Fdownload%2Fmime-types-2.1.28.tgz", - "integrity": "sha1-EWDEdX6rLFNjiI4AUnPs950qDs0=", - "dev": true, - "dependencies": { - "mime-db": "1.45.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npm.taobao.org/mimic-fn/download/mimic-fn-2.1.0.tgz?cache=0&sync_timestamp=1596095644798&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmimic-fn%2Fdownload%2Fmimic-fn-2.1.0.tgz", - "integrity": "sha1-ftLCzMyvhNP/y3pptXcR/CCDQBs=", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npm.taobao.org/minimatch/download/minimatch-3.0.4.tgz", - "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/minimist": { - "version": "1.2.5", - "resolved": "https://registry.npm.taobao.org/minimist/download/minimist-1.2.5.tgz", - "integrity": "sha1-Z9ZgFLZqaoqqDAg8X9WN9OTpdgI=", - "dev": true - }, - "node_modules/mkdirp": { - "version": "0.5.4", - "resolved": "https://registry.npm.taobao.org/mkdirp/download/mkdirp-0.5.4.tgz?cache=0&sync_timestamp=1589682820707&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmkdirp%2Fdownload%2Fmkdirp-0.5.4.tgz", - "integrity": "sha1-/QFQSmeX7Fyb6B/0PSBJYe1kpRI=", - "deprecated": "Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)", - "dev": true, - "dependencies": { - "minimist": "^1.2.5" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, - "node_modules/mocha": { - "version": "6.2.3", - "resolved": "https://registry.npm.taobao.org/mocha/download/mocha-6.2.3.tgz", - "integrity": "sha1-5khDIYHYuZOTQQISZkRQpMHjGRI=", - "dev": true, - "dependencies": { - "ansi-colors": "3.2.3", - "browser-stdout": "1.3.1", - "debug": "3.2.6", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "find-up": "3.0.0", - "glob": "7.1.3", - "growl": "1.10.5", - "he": "1.2.0", - "js-yaml": "3.13.1", - "log-symbols": "2.2.0", - "minimatch": "3.0.4", - "mkdirp": "0.5.4", - "ms": "2.1.1", - "node-environment-flags": "1.0.5", - "object.assign": "4.1.0", - "strip-json-comments": "2.0.1", - "supports-color": "6.0.0", - "which": "1.3.1", - "wide-align": "1.1.3", - "yargs": "13.3.2", - "yargs-parser": "13.1.2", - "yargs-unparser": "1.6.0" - }, - "bin": { - "_mocha": "bin/_mocha", - "mocha": "bin/mocha" - }, - "engines": { - "node": ">= 6.0.0" - } - }, - "node_modules/mocha/node_modules/ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npm.taobao.org/ansi-regex/download/ansi-regex-4.1.0.tgz", - "integrity": "sha1-i5+PCM8ay4Q3Vqg5yox+MWjFGZc=", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/mocha/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-3.2.1.tgz?cache=0&sync_timestamp=1611325836307&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fansi-styles%2Fdownload%2Fansi-styles-3.2.1.tgz", - "integrity": "sha1-QfuyAkPlCxK+DwS43tvwdSDOhB0=", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/mocha/node_modules/cliui": { - "version": "5.0.0", - "resolved": "https://registry.npm.taobao.org/cliui/download/cliui-5.0.0.tgz?cache=0&sync_timestamp=1604880017635&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcliui%2Fdownload%2Fcliui-5.0.0.tgz", - "integrity": "sha1-3u/P2y6AB4SqNPRvoI4GhRx7u8U=", - "dev": true, - "dependencies": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - } - }, - "node_modules/mocha/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-1.9.3.tgz", - "integrity": "sha1-u3GFBpDh8TZWfeYp0tVHHe2kweg=", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/mocha/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "node_modules/mocha/node_modules/emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npm.taobao.org/emoji-regex/download/emoji-regex-7.0.3.tgz?cache=0&sync_timestamp=1603212180491&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Femoji-regex%2Fdownload%2Femoji-regex-7.0.3.tgz", - "integrity": "sha1-kzoEBShgyF6DwSJHnEdIqOTHIVY=", - "dev": true - }, - "node_modules/mocha/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npm.taobao.org/is-fullwidth-code-point/download/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/mocha/node_modules/string-width": { - "version": "3.1.0", - "resolved": "https://registry.npm.taobao.org/string-width/download/string-width-3.1.0.tgz", - "integrity": "sha1-InZ74htirxCBV0MG9prFG2IgOWE=", - "dev": true, - "dependencies": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/mocha/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npm.taobao.org/strip-ansi/download/strip-ansi-5.2.0.tgz", - "integrity": "sha1-jJpTb+tq/JYr36WxBKUJHBrZwK4=", - "dev": true, - "dependencies": { - "ansi-regex": "^4.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/mocha/node_modules/supports-color": { - "version": "6.0.0", - "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-6.0.0.tgz?cache=0&sync_timestamp=1611394023277&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-6.0.0.tgz", - "integrity": "sha1-ds/nQs8fQbubHCmtAwaMBbTA5Ao=", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/mocha/node_modules/wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npm.taobao.org/wrap-ansi/download/wrap-ansi-5.1.0.tgz", - "integrity": "sha1-H9H2cjXVttD+54EFYAG/tpTAOwk=", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/mocha/node_modules/y18n": { - "version": "4.0.1", - "resolved": "https://registry.npm.taobao.org/y18n/download/y18n-4.0.1.tgz?cache=0&sync_timestamp=1609798736426&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fy18n%2Fdownload%2Fy18n-4.0.1.tgz", - "integrity": "sha1-jbK4PDHF11CZu4kLI/MJSJHiR9Q=", - "dev": true - }, - "node_modules/mocha/node_modules/yargs": { - "version": "13.3.2", - "resolved": "https://registry.npm.taobao.org/yargs/download/yargs-13.3.2.tgz?cache=0&sync_timestamp=1610219732978&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fyargs%2Fdownload%2Fyargs-13.3.2.tgz", - "integrity": "sha1-rX/+/sGqWVZayRX4Lcyzipwxot0=", - "dev": true, - "dependencies": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" - } - }, - "node_modules/mocha/node_modules/yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npm.taobao.org/yargs-parser/download/yargs-parser-13.1.2.tgz?cache=0&sync_timestamp=1604886709178&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fyargs-parser%2Fdownload%2Fyargs-parser-13.1.2.tgz", - "integrity": "sha1-Ew8JcC667vJlDVTObj5XBvek+zg=", - "dev": true, - "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - }, - "node_modules/moment": { - "version": "2.29.1", - "resolved": "https://registry.npm.taobao.org/moment/download/moment-2.29.1.tgz?cache=0&sync_timestamp=1601983320283&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmoment%2Fdownload%2Fmoment-2.29.1.tgz", - "integrity": "sha1-sr52n6MZQL6e7qZGnAdeNQBvo9M=", - "engines": { - "node": "*" - } - }, - "node_modules/ms": { - "version": "2.1.1", - "resolved": "https://registry.npm.taobao.org/ms/download/ms-2.1.1.tgz?cache=0&sync_timestamp=1607433842694&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fms%2Fdownload%2Fms-2.1.1.tgz", - "integrity": "sha1-MKWGTrPrsKZvLr5tcnrwagnYbgo=", - "dev": true - }, - "node_modules/node-environment-flags": { - "version": "1.0.5", - "resolved": "https://registry.npm.taobao.org/node-environment-flags/download/node-environment-flags-1.0.5.tgz", - "integrity": "sha1-+pMCdfW/Xa4YjWGSsktMi7rD12o=", - "dev": true, - "dependencies": { - "object.getownpropertydescriptors": "^2.0.3", - "semver": "^5.7.0" - } - }, - "node_modules/node-environment-flags/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npm.taobao.org/semver/download/semver-5.7.1.tgz?cache=0&sync_timestamp=1606853731020&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsemver%2Fdownload%2Fsemver-5.7.1.tgz", - "integrity": "sha1-qVT5Ma66UI0we78Gnv8MAclhFvc=", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npm.taobao.org/node-fetch/download/node-fetch-2.6.1.tgz?cache=0&sync_timestamp=1599309198465&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fnode-fetch%2Fdownload%2Fnode-fetch-2.6.1.tgz", - "integrity": "sha1-BFvTI2Mfdu0uK1VXM5RBa2OaAFI=", - "dev": true, - "engines": { - "node": "4.x || >=6.0.0" - } - }, - "node_modules/nth-check": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz", - "integrity": "sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==", - "dependencies": { - "boolbase": "~1.0.0" - } - }, - "node_modules/oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npm.taobao.org/oauth-sign/download/oauth-sign-0.9.0.tgz", - "integrity": "sha1-R6ewFrqmi1+g7PPe4IqFxnmsZFU=", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/object-inspect": { - "version": "1.9.0", - "resolved": "https://registry.npm.taobao.org/object-inspect/download/object-inspect-1.9.0.tgz?cache=0&sync_timestamp=1606804280990&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fobject-inspect%2Fdownload%2Fobject-inspect-1.9.0.tgz", - "integrity": "sha1-yQUh104RJ7ZyZt7TOUrWEWmGUzo=", - "dev": true - }, - "node_modules/object-is": { - "version": "1.1.4", - "resolved": "https://registry.npm.taobao.org/object-is/download/object-is-1.1.4.tgz", - "integrity": "sha1-Y9bIPACkP0y8lDTrl1fIpbhWUGg=", - "dev": true, - "dependencies": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npm.taobao.org/object-keys/download/object-keys-1.1.1.tgz", - "integrity": "sha1-HEfyct8nfzsdrwYWd9nILiMixg4=", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.assign": { - "version": "4.1.0", - "resolved": "https://registry.npm.taobao.org/object.assign/download/object.assign-4.1.0.tgz?cache=0&sync_timestamp=1604115167242&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fobject.assign%2Fdownload%2Fobject.assign-4.1.0.tgz", - "integrity": "sha1-lovxEA15Vrs8oIbwBvhGs7xACNo=", - "dev": true, - "dependencies": { - "define-properties": "^1.1.2", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "object-keys": "^1.0.11" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.getownpropertydescriptors": { - "version": "2.1.1", - "resolved": "https://registry.npm.taobao.org/object.getownpropertydescriptors/download/object.getownpropertydescriptors-2.1.1.tgz?cache=0&sync_timestamp=1606458074571&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fobject.getownpropertydescriptors%2Fdownload%2Fobject.getownpropertydescriptors-2.1.1.tgz", - "integrity": "sha1-Df2o0QgHTZxWPoBJDIg7ZmEJFUQ=", - "dev": true, - "dependencies": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npm.taobao.org/once/download/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npm.taobao.org/onetime/download/onetime-5.1.2.tgz", - "integrity": "sha1-0Oluu1awdHbfHdnEgG5SN5hcpF4=", - "dev": true, - "dependencies": { - "mimic-fn": "^2.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npm.taobao.org/p-finally/download/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "engines": { - "node": ">=4" - } - }, - "node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npm.taobao.org/p-limit/download/p-limit-2.3.0.tgz?cache=0&sync_timestamp=1606290276843&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fp-limit%2Fdownload%2Fp-limit-2.3.0.tgz", - "integrity": "sha1-PdM8ZHohT9//2DWTPrCG2g3CHbE=", - "dev": true, - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npm.taobao.org/p-locate/download/p-locate-3.0.0.tgz?cache=0&sync_timestamp=1597081369770&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fp-locate%2Fdownload%2Fp-locate-3.0.0.tgz", - "integrity": "sha1-Mi1poFwCZLJZl9n0DNiokasAZKQ=", - "dev": true, - "dependencies": { - "p-limit": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/p-queue": { - "version": "6.6.2", - "resolved": "https://registry.npm.taobao.org/p-queue/download/p-queue-6.6.2.tgz", - "integrity": "sha1-IGip3PjmfdDsPnory3aBD6qF5CY=", - "dependencies": { - "eventemitter3": "^4.0.4", - "p-timeout": "^3.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/p-timeout": { - "version": "3.2.0", - "resolved": "https://registry.npm.taobao.org/p-timeout/download/p-timeout-3.2.0.tgz?cache=0&sync_timestamp=1608983239871&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fp-timeout%2Fdownload%2Fp-timeout-3.2.0.tgz", - "integrity": "sha1-x+F6vJcdKnli74NiazXWNazyPf4=", - "dependencies": { - "p-finally": "^1.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npm.taobao.org/p-try/download/p-try-2.2.0.tgz", - "integrity": "sha1-yyhoVA4xPWHeWPr741zpAE1VQOY=", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/parse5": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-3.0.3.tgz", - "integrity": "sha512-rgO9Zg5LLLkfJF9E6CCmXlSE4UVceloys8JrFqCcHloC3usd/kJCyPDwH2SOlzix2j3xaP9sUX3e8+kvkuleAA==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npm.taobao.org/path-exists/download/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npm.taobao.org/path-is-absolute/download/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/pathval": { - "version": "1.1.1", - "resolved": "https://registry.npm.taobao.org/pathval/download/pathval-1.1.1.tgz", - "integrity": "sha1-hTTnenfOesWiUS6iHg/bj89sPY0=", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npm.taobao.org/performance-now/download/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "dev": true - }, - "node_modules/pify": { - "version": "5.0.0", - "resolved": "https://registry.npm.taobao.org/pify/download/pify-5.0.0.tgz", - "integrity": "sha1-H17KP16H6+wozG1UoOSq8ArMEn8=", - "engines": { - "node": ">=10" - } - }, - "node_modules/pkg-up": { - "version": "3.1.0", - "resolved": "https://registry.npm.taobao.org/pkg-up/download/pkg-up-3.1.0.tgz", - "integrity": "sha1-EA7CNcwVDk/UJRlBJZaihRKg3vU=", - "dev": true, - "dependencies": { - "find-up": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/pngjs": { - "version": "3.4.0", - "resolved": "https://registry.npm.taobao.org/pngjs/download/pngjs-3.4.0.tgz?cache=0&sync_timestamp=1603548657875&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpngjs%2Fdownload%2Fpngjs-3.4.0.tgz", - "integrity": "sha1-mcp9clll+2VYFOr2XzjxK72/VV8=", - "dev": true, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/protobufjs": { - "version": "6.10.2", - "resolved": "https://registry.npm.taobao.org/protobufjs/download/protobufjs-6.10.2.tgz?cache=0&sync_timestamp=1605559636133&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fprotobufjs%2Fdownload%2Fprotobufjs-6.10.2.tgz", - "integrity": "sha1-uctr2OyPh1FFkro/39KOk/M6Rps=", - "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": "^13.7.0", - "long": "^4.0.0" - }, - "bin": { - "pbjs": "bin/pbjs", - "pbts": "bin/pbts" - } - }, - "node_modules/protobufjs/node_modules/@types/node": { - "version": "13.13.40", - "resolved": "https://registry.npm.taobao.org/@types/node/download/@types/node-13.13.40.tgz?cache=0&sync_timestamp=1610658214168&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fnode%2Fdownload%2F%40types%2Fnode-13.13.40.tgz", - "integrity": "sha1-9lXvMnNizIORLy5pM23cYqJKn4g=" - }, - "node_modules/psl": { - "version": "1.8.0", - "resolved": "https://registry.npm.taobao.org/psl/download/psl-1.8.0.tgz", - "integrity": "sha1-kyb4vPsBOtzABf3/BWrM4CDlHCQ=" - }, - "node_modules/pump": { - "version": "3.0.0", - "resolved": "https://registry.npm.taobao.org/pump/download/pump-3.0.0.tgz", - "integrity": "sha1-tKIRaBW94vTh6mAjVOjHVWUQemQ=", - "dev": true, - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npm.taobao.org/punycode/download/punycode-2.1.1.tgz", - "integrity": "sha1-tYsBCsQMIsVldhbI0sLALHv0eew=", - "engines": { - "node": ">=6" - } - }, - "node_modules/qrcode": { - "version": "1.4.4", - "resolved": "https://registry.npm.taobao.org/qrcode/download/qrcode-1.4.4.tgz", - "integrity": "sha1-8MQ1aKfnUQpV78O4jZYC9xlj6oM=", - "dev": true, - "dependencies": { - "buffer": "^5.4.3", - "buffer-alloc": "^1.2.0", - "buffer-from": "^1.1.1", - "dijkstrajs": "^1.0.1", - "isarray": "^2.0.1", - "pngjs": "^3.3.0", - "yargs": "^13.2.4" - }, - "bin": { - "qrcode": "bin/qrcode" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/qrcode-terminal": { - "version": "0.12.0", - "resolved": "https://registry.npm.taobao.org/qrcode-terminal/download/qrcode-terminal-0.12.0.tgz", - "integrity": "sha1-u1tpnvf58FBQkqN0i+RGT+cbWBk=", - "dev": true, - "bin": { - "qrcode-terminal": "bin/qrcode-terminal.js" - } - }, - "node_modules/qrcode/node_modules/ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npm.taobao.org/ansi-regex/download/ansi-regex-4.1.0.tgz", - "integrity": "sha1-i5+PCM8ay4Q3Vqg5yox+MWjFGZc=", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/qrcode/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-3.2.1.tgz?cache=0&sync_timestamp=1611325836307&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fansi-styles%2Fdownload%2Fansi-styles-3.2.1.tgz", - "integrity": "sha1-QfuyAkPlCxK+DwS43tvwdSDOhB0=", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/qrcode/node_modules/cliui": { - "version": "5.0.0", - "resolved": "https://registry.npm.taobao.org/cliui/download/cliui-5.0.0.tgz?cache=0&sync_timestamp=1604880017635&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcliui%2Fdownload%2Fcliui-5.0.0.tgz", - "integrity": "sha1-3u/P2y6AB4SqNPRvoI4GhRx7u8U=", - "dev": true, - "dependencies": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - } - }, - "node_modules/qrcode/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-1.9.3.tgz", - "integrity": "sha1-u3GFBpDh8TZWfeYp0tVHHe2kweg=", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/qrcode/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "node_modules/qrcode/node_modules/emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npm.taobao.org/emoji-regex/download/emoji-regex-7.0.3.tgz?cache=0&sync_timestamp=1603212180491&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Femoji-regex%2Fdownload%2Femoji-regex-7.0.3.tgz", - "integrity": "sha1-kzoEBShgyF6DwSJHnEdIqOTHIVY=", - "dev": true - }, - "node_modules/qrcode/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npm.taobao.org/is-fullwidth-code-point/download/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/qrcode/node_modules/string-width": { - "version": "3.1.0", - "resolved": "https://registry.npm.taobao.org/string-width/download/string-width-3.1.0.tgz", - "integrity": "sha1-InZ74htirxCBV0MG9prFG2IgOWE=", - "dev": true, - "dependencies": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/qrcode/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npm.taobao.org/strip-ansi/download/strip-ansi-5.2.0.tgz", - "integrity": "sha1-jJpTb+tq/JYr36WxBKUJHBrZwK4=", - "dev": true, - "dependencies": { - "ansi-regex": "^4.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/qrcode/node_modules/wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npm.taobao.org/wrap-ansi/download/wrap-ansi-5.1.0.tgz", - "integrity": "sha1-H9H2cjXVttD+54EFYAG/tpTAOwk=", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/qrcode/node_modules/y18n": { - "version": "4.0.1", - "resolved": "https://registry.npm.taobao.org/y18n/download/y18n-4.0.1.tgz?cache=0&sync_timestamp=1609798736426&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fy18n%2Fdownload%2Fy18n-4.0.1.tgz", - "integrity": "sha1-jbK4PDHF11CZu4kLI/MJSJHiR9Q=", - "dev": true - }, - "node_modules/qrcode/node_modules/yargs": { - "version": "13.3.2", - "resolved": "https://registry.npm.taobao.org/yargs/download/yargs-13.3.2.tgz?cache=0&sync_timestamp=1610219732978&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fyargs%2Fdownload%2Fyargs-13.3.2.tgz", - "integrity": "sha1-rX/+/sGqWVZayRX4Lcyzipwxot0=", - "dev": true, - "dependencies": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" - } - }, - "node_modules/qrcode/node_modules/yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npm.taobao.org/yargs-parser/download/yargs-parser-13.1.2.tgz?cache=0&sync_timestamp=1604886709178&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fyargs-parser%2Fdownload%2Fyargs-parser-13.1.2.tgz", - "integrity": "sha1-Ew8JcC667vJlDVTObj5XBvek+zg=", - "dev": true, - "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - }, - "node_modules/qs": { - "version": "6.9.4", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz", - "integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==", - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/request": { - "version": "2.88.2", - "resolved": "https://registry.npm.taobao.org/request/download/request-2.88.2.tgz?cache=0&sync_timestamp=1592843183066&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frequest%2Fdownload%2Frequest-2.88.2.tgz", - "integrity": "sha1-1zyRhzHLWofaBH4gcjQUb2ZNErM=", - "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", - "dev": true, - "dependencies": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/request/node_modules/qs": { - "version": "6.5.2", - "resolved": "https://registry.npm.taobao.org/qs/download/qs-6.5.2.tgz?cache=0&sync_timestamp=1610598235973&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fqs%2Fdownload%2Fqs-6.5.2.tgz", - "integrity": "sha1-yzroBuh0BERYTvFUzo7pjUA/PjY=", - "dev": true, - "engines": { - "node": ">=0.6" - } - }, - "node_modules/request/node_modules/tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npm.taobao.org/tough-cookie/download/tough-cookie-2.5.0.tgz", - "integrity": "sha1-zZ+yoKodWhK0c72fuW+j3P9lreI=", - "dev": true, - "dependencies": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - }, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npm.taobao.org/require-main-filename/download/require-main-filename-2.0.0.tgz", - "integrity": "sha1-0LMp7MfMD2Fkn2IhW+aa9UqomJs=", - "dev": true - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "node_modules/sax": { - "version": "1.2.4", - "resolved": "https://registry.npm.taobao.org/sax/download/sax-1.2.4.tgz", - "integrity": "sha1-KBYjTiN4vdxOU1T6tcqold9xANk=", - "dev": true - }, - "node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npm.taobao.org/semver/download/semver-6.3.0.tgz?cache=0&sync_timestamp=1606853731020&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsemver%2Fdownload%2Fsemver-6.3.0.tgz", - "integrity": "sha1-7gpkyK9ejO6mdoexM3YeG+y9HT0=", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/serverless-tencent-auth-tool": { - "version": "1.0.18", - "resolved": "https://registry.npm.taobao.org/serverless-tencent-auth-tool/download/serverless-tencent-auth-tool-1.0.18.tgz", - "integrity": "sha1-gciIyyjR4SjtolrUEuqBC9p/9oI=", - "dev": true, - "dependencies": { - "qrcode": "^1.4.4", - "serverless-tencent-tools": "^0.0.11" - } - }, - "node_modules/serverless-tencent-scf": { - "version": "0.1.36", - "resolved": "https://registry.npm.taobao.org/serverless-tencent-scf/download/serverless-tencent-scf-0.1.36.tgz", - "integrity": "sha1-IAf4YCFdMIUV1zCbF3UK/DaaXSA=", - "dev": true, - "dependencies": { - "assert": "^2.0.0", - "async": "^2.6.3", - "bluebird": "^3.5.5", - "chai": "^4.2.0", - "chalk": "^2.4.2", - "ci-info": "^2.0.0", - "co": "^4.6.0", - "conf": "^6.0.1", - "cos-nodejs-sdk-v5": "^2.5.12", - "detect-mocha": "^0.1.0", - "filesize": "^5.0.3", - "fs-extra": "^8.1.0", - "ini": "^1.3.4", - "lodash": "^4.17.15", - "mocha": "^6.2.2", - "request": "^2.88.0", - "serverless-tencent-auth-tool": "^1.0.18", - "serverless-tencent-tools": "^0.0.11", - "tencent-login": "^0.1.6", - "tencentcloud-sdk-nodejs": "^3.0.87", - "universal-analytics": "^0.4.20" - } - }, - "node_modules/serverless-tencent-scf/node_modules/fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npm.taobao.org/fs-extra/download/fs-extra-8.1.0.tgz?cache=0&sync_timestamp=1611075469998&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffs-extra%2Fdownload%2Ffs-extra-8.1.0.tgz", - "integrity": "sha1-SdQ8RaiM2Wd2aMt74bRu/bjS4cA=", - "dev": true, - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - }, - "engines": { - "node": ">=6 <7 || >=8" - } - }, - "node_modules/serverless-tencent-scf/node_modules/jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npm.taobao.org/jsonfile/download/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.6" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/serverless-tencent-scf/node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npm.taobao.org/universalify/download/universalify-0.1.2.tgz?cache=0&sync_timestamp=1603179970052&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Funiversalify%2Fdownload%2Funiversalify-0.1.2.tgz", - "integrity": "sha1-tkb2m+OULavOzJ1mOcgNwQXvqmY=", - "dev": true, - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/serverless-tencent-tools": { - "version": "0.0.11", - "resolved": "https://registry.npm.taobao.org/serverless-tencent-tools/download/serverless-tencent-tools-0.0.11.tgz", - "integrity": "sha1-H/9iiVNnUXq6FTTT3hwEFMhSocE=", - "dev": true, - "dependencies": { - "qrcode": "^1.4.4", - "qrcode-terminal": "^0.12.0", - "request": "^2.88.0", - "tencentcloud-sdk-nodejs": "^3.0.87", - "urlencode": "^1.1.0", - "uuid": "^3.3.3" - } - }, - "node_modules/set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npm.taobao.org/set-blocking/download/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true - }, - "node_modules/signal-exit": { - "version": "3.0.3", - "resolved": "https://registry.npm.taobao.org/signal-exit/download/signal-exit-3.0.3.tgz", - "integrity": "sha1-oUEMLt2PB3sItOJTyOrPyvBXRhw=", - "dev": true - }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npm.taobao.org/sprintf-js/download/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, - "node_modules/sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npm.taobao.org/sshpk/download/sshpk-1.16.1.tgz", - "integrity": "sha1-+2YcC+8ps520B2nuOfpwCT1vaHc=", - "dev": true, - "dependencies": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - }, - "bin": { - "sshpk-conv": "bin/sshpk-conv", - "sshpk-sign": "bin/sshpk-sign", - "sshpk-verify": "bin/sshpk-verify" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/string-width": { - "version": "4.2.0", - "resolved": "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/string.prototype.trimend": { - "version": "1.0.3", - "resolved": "https://registry.npm.taobao.org/string.prototype.trimend/download/string.prototype.trimend-1.0.3.tgz", - "integrity": "sha1-oivVPMpcfPRNfJ1ccyEYhz1s0Ys=", - "dev": true, - "dependencies": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3" - } - }, - "node_modules/string.prototype.trimstart": { - "version": "1.0.3", - "resolved": "https://registry.npm.taobao.org/string.prototype.trimstart/download/string.prototype.trimstart-1.0.3.tgz?cache=0&sync_timestamp=1606007972027&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstring.prototype.trimstart%2Fdownload%2Fstring.prototype.trimstart-1.0.3.tgz", - "integrity": "sha1-m0y1kOEjuzZWRAHVmCQpjeUP1ao=", - "dev": true, - "dependencies": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npm.taobao.org/strip-json-comments/download/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-5.5.0.tgz?cache=0&sync_timestamp=1611394023277&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-5.5.0.tgz", - "integrity": "sha1-4uaaRKyHcveKHsCzW2id9lMO/I8=", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/tencent-login": { - "version": "0.1.7", - "resolved": "https://registry.npm.taobao.org/tencent-login/download/tencent-login-0.1.7.tgz", - "integrity": "sha1-S1FnmdvYdIwobxdR5fwCKF8tGO8=", - "dev": true, - "dependencies": { - "qrcode": "^1.4.4", - "qrcode-terminal": "^0.12.0", - "request": "^2.88.0", - "uuid": "^3.3.3" - } - }, - "node_modules/tencentcloud-sdk-nodejs": { - "version": "3.0.268", - "resolved": "https://registry.npm.taobao.org/tencentcloud-sdk-nodejs/download/tencentcloud-sdk-nodejs-3.0.268.tgz", - "integrity": "sha1-H7W5fAWSpF7126QhjI7zhz0P5lo=", - "dev": true, - "dependencies": { - "form-data": "^2.3.3", - "get-stream": "^4.1.0", - "https-proxy-agent": "^2.2.1", - "is-stream": "^1.1.0", - "node-fetch": "^2.2.0" - }, - "engines": { - "node": ">=7.10.0" - } - }, - "node_modules/tough-cookie": { - "version": "4.0.0", - "resolved": "https://registry.npm.taobao.org/tough-cookie/download/tough-cookie-4.0.0.tgz", - "integrity": "sha1-2CIjTuyogvmR8PkIgkrSYi3b7OQ=", - "dependencies": { - "psl": "^1.1.33", - "punycode": "^2.1.1", - "universalify": "^0.1.2" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/tough-cookie/node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npm.taobao.org/universalify/download/universalify-0.1.2.tgz?cache=0&sync_timestamp=1603179970052&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Funiversalify%2Fdownload%2Funiversalify-0.1.2.tgz", - "integrity": "sha1-tkb2m+OULavOzJ1mOcgNwQXvqmY=", - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npm.taobao.org/tunnel-agent/download/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dev": true, - "dependencies": { - "safe-buffer": "^5.0.1" - }, - "engines": { - "node": "*" - } - }, - "node_modules/tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npm.taobao.org/tweetnacl/download/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true - }, - "node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npm.taobao.org/type-detect/download/type-detect-4.0.8.tgz", - "integrity": "sha1-dkb7XxiHHPu3dJ5pvTmmOI63RQw=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npm.taobao.org/typedarray-to-buffer/download/typedarray-to-buffer-3.1.5.tgz?cache=0&sync_timestamp=1606167099511&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftypedarray-to-buffer%2Fdownload%2Ftypedarray-to-buffer-3.1.5.tgz", - "integrity": "sha1-qX7nqf9CaRufeD/xvFES/j/KkIA=", - "dev": true, - "dependencies": { - "is-typedarray": "^1.0.0" - } - }, - "node_modules/universal-analytics": { - "version": "0.4.23", - "resolved": "https://registry.npm.taobao.org/universal-analytics/download/universal-analytics-0.4.23.tgz", - "integrity": "sha1-2RXmdoUMJcQVZ2JHG9188uqsqKw=", - "dev": true, - "dependencies": { - "debug": "^4.1.1", - "request": "^2.88.2", - "uuid": "^3.0.0" - } - }, - "node_modules/universal-analytics/node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npm.taobao.org/debug/download/debug-4.3.1.tgz?cache=0&sync_timestamp=1607566580543&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-4.3.1.tgz", - "integrity": "sha1-8NIpxQXgxtjEmsVT0bE9wYP2su4=", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - } - }, - "node_modules/universal-analytics/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npm.taobao.org/ms/download/ms-2.1.2.tgz?cache=0&sync_timestamp=1607433842694&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fms%2Fdownload%2Fms-2.1.2.tgz", - "integrity": "sha1-0J0fNXtEP0kzgqjrPM0YOHKuYAk=", - "dev": true - }, - "node_modules/universalify": { - "version": "1.0.0", - "resolved": "https://registry.npm.taobao.org/universalify/download/universalify-1.0.0.tgz?cache=0&sync_timestamp=1603179970052&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Funiversalify%2Fdownload%2Funiversalify-1.0.0.tgz", - "integrity": "sha1-thodoXPoQ1sv48Z9Kbmt+FlL0W0=", - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npm.taobao.org/uri-js/download/uri-js-4.4.1.tgz?cache=0&sync_timestamp=1610237624359&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Furi-js%2Fdownload%2Furi-js-4.4.1.tgz", - "integrity": "sha1-mxpSWVIlhZ5V9mnZKPiMbFfyp34=", - "dev": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/urlencode": { - "version": "1.1.0", - "resolved": "https://registry.npm.taobao.org/urlencode/download/urlencode-1.1.0.tgz", - "integrity": "sha1-HyuibwE8hfATP3o61v8nMK33y7c=", - "dev": true, - "dependencies": { - "iconv-lite": "~0.4.11" - } - }, - "node_modules/urlencode/node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npm.taobao.org/iconv-lite/download/iconv-lite-0.4.24.tgz", - "integrity": "sha1-ICK0sl+93CHS9SSXSkdKr+czkIs=", - "dev": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/util": { - "version": "0.12.3", - "resolved": "https://registry.npm.taobao.org/util/download/util-0.12.3.tgz", - "integrity": "sha1-lxuwKS0swMiS2rfGpdN8K+xweIg=", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "is-arguments": "^1.0.4", - "is-generator-function": "^1.0.7", - "is-typed-array": "^1.1.3", - "safe-buffer": "^5.1.2", - "which-typed-array": "^1.1.2" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "node_modules/uuid": { - "version": "3.4.0", - "resolved": "https://registry.npm.taobao.org/uuid/download/uuid-3.4.0.tgz", - "integrity": "sha1-sj5DWK+oogL+ehAK8fX4g/AgB+4=", - "dev": true, - "bin": { - "uuid": "bin/uuid" - } - }, - "node_modules/verror": { - "version": "1.10.0", - "resolved": "https://registry.npm.taobao.org/verror/download/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "dev": true, - "engines": [ - "node >=0.6.0" - ], - "dependencies": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npm.taobao.org/which/download/which-1.3.1.tgz?cache=0&sync_timestamp=1574116262707&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fwhich%2Fdownload%2Fwhich-1.3.1.tgz", - "integrity": "sha1-pFBD1U9YBTFtqNYvn1CRjT2nCwo=", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" - } - }, - "node_modules/which-module": { - "version": "2.0.0", - "resolved": "https://registry.npm.taobao.org/which-module/download/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, - "node_modules/which-typed-array": { - "version": "1.1.4", - "resolved": "https://registry.npm.taobao.org/which-typed-array/download/which-typed-array-1.1.4.tgz", - "integrity": "sha1-j8t9PuWt8tdxBm+6fPN+Mv6HEf8=", - "dev": true, - "dependencies": { - "available-typed-arrays": "^1.0.2", - "call-bind": "^1.0.0", - "es-abstract": "^1.18.0-next.1", - "foreach": "^2.0.5", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.1", - "is-typed-array": "^1.1.3" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npm.taobao.org/wide-align/download/wide-align-1.1.3.tgz", - "integrity": "sha1-rgdOa9wMFKQx6ATmJFScYzsABFc=", - "dev": true, - "dependencies": { - "string-width": "^1.0.2 || 2" - } - }, - "node_modules/wide-align/node_modules/ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npm.taobao.org/ansi-regex/download/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/wide-align/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npm.taobao.org/is-fullwidth-code-point/download/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/wide-align/node_modules/string-width": { - "version": "2.1.1", - "resolved": "https://registry.npm.taobao.org/string-width/download/string-width-2.1.1.tgz", - "integrity": "sha1-q5Pyeo3BPSjKyBXEYhQ6bZASrp4=", - "dev": true, - "dependencies": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/wide-align/node_modules/strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npm.taobao.org/strip-ansi/download/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "dependencies": { - "ansi-regex": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npm.taobao.org/wrappy/download/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "node_modules/write-file-atomic": { - "version": "3.0.3", - "resolved": "https://registry.npm.taobao.org/write-file-atomic/download/write-file-atomic-3.0.3.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fwrite-file-atomic%2Fdownload%2Fwrite-file-atomic-3.0.3.tgz", - "integrity": "sha1-Vr1cWlxwSBzRnFcb05q5ZaXeVug=", - "dev": true, - "dependencies": { - "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" - } - }, - "node_modules/xml2js": { - "version": "0.4.23", - "resolved": "https://registry.npm.taobao.org/xml2js/download/xml2js-0.4.23.tgz?cache=0&sync_timestamp=1599054229598&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fxml2js%2Fdownload%2Fxml2js-0.4.23.tgz", - "integrity": "sha1-oMaVFnUkIesqx1juTUzPWIQ+rGY=", - "dev": true, - "dependencies": { - "sax": ">=0.6.0", - "xmlbuilder": "~11.0.0" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/xmlbuilder": { - "version": "11.0.1", - "resolved": "https://registry.npm.taobao.org/xmlbuilder/download/xmlbuilder-11.0.1.tgz", - "integrity": "sha1-vpuuHIoEbnazESdyY0fQrXACvrM=", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/y18n": { - "version": "5.0.5", - "resolved": "https://registry.yarnpkg.com/y18n/-/y18n-5.0.5.tgz", - "integrity": "sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg==", - "license": "ISC", - "engines": { - "node": ">=10" - } - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npm.taobao.org/yallist/download/yallist-4.0.0.tgz", - "integrity": "sha1-m7knkNnA7/7GO+c1GeEaNQGaOnI=", - "dev": true - }, - "node_modules/yargs": { - "version": "16.1.0", - "resolved": "https://registry.yarnpkg.com/yargs/-/yargs-16.1.0.tgz", - "integrity": "sha512-upWFJOmDdHN0syLuESuvXDmrRcWd1QafJolHskzaw79uZa7/x53gxQKiR07W59GWY1tFhhU/Th9DrtSfpS782g==", - "license": "MIT", - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.2", - "yargs-parser": "^20.2.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", - "license": "ISC", - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs-unparser": { - "version": "1.6.0", - "resolved": "https://registry.npm.taobao.org/yargs-unparser/download/yargs-unparser-1.6.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fyargs-unparser%2Fdownload%2Fyargs-unparser-1.6.0.tgz", - "integrity": "sha1-7yXCx2n/a9CeSw+dfGBfsnhG6p8=", - "dev": true, - "dependencies": { - "flat": "^4.1.0", - "lodash": "^4.17.15", - "yargs": "^13.3.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/yargs-unparser/node_modules/ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npm.taobao.org/ansi-regex/download/ansi-regex-4.1.0.tgz", - "integrity": "sha1-i5+PCM8ay4Q3Vqg5yox+MWjFGZc=", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/yargs-unparser/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-3.2.1.tgz?cache=0&sync_timestamp=1611325836307&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fansi-styles%2Fdownload%2Fansi-styles-3.2.1.tgz", - "integrity": "sha1-QfuyAkPlCxK+DwS43tvwdSDOhB0=", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/yargs-unparser/node_modules/cliui": { - "version": "5.0.0", - "resolved": "https://registry.npm.taobao.org/cliui/download/cliui-5.0.0.tgz?cache=0&sync_timestamp=1604880017635&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcliui%2Fdownload%2Fcliui-5.0.0.tgz", - "integrity": "sha1-3u/P2y6AB4SqNPRvoI4GhRx7u8U=", - "dev": true, - "dependencies": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - } - }, - "node_modules/yargs-unparser/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-1.9.3.tgz", - "integrity": "sha1-u3GFBpDh8TZWfeYp0tVHHe2kweg=", + "dependencies": { + "@babel/code-frame": { + "version": "7.12.13", + "resolved": "https://registry.npm.taobao.org/@babel/code-frame/download/@babel/code-frame-7.12.13.tgz?cache=0&sync_timestamp=1612314635887&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fcode-frame%2Fdownload%2F%40babel%2Fcode-frame-7.12.13.tgz", + "integrity": "sha1-3PyCa+72XnXFDiHTg319lXmN1lg=", "dev": true, - "dependencies": { - "color-name": "1.1.3" + "requires": { + "@babel/highlight": "^7.12.13" } }, - "node_modules/yargs-unparser/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "node_modules/yargs-unparser/node_modules/emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npm.taobao.org/emoji-regex/download/emoji-regex-7.0.3.tgz?cache=0&sync_timestamp=1603212180491&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Femoji-regex%2Fdownload%2Femoji-regex-7.0.3.tgz", - "integrity": "sha1-kzoEBShgyF6DwSJHnEdIqOTHIVY=", + "@babel/helper-validator-identifier": { + "version": "7.12.11", + "resolved": "https://registry.npm.taobao.org/@babel/helper-validator-identifier/download/@babel/helper-validator-identifier-7.12.11.tgz?cache=0&sync_timestamp=1608076959746&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelper-validator-identifier%2Fdownload%2F%40babel%2Fhelper-validator-identifier-7.12.11.tgz", + "integrity": "sha1-yaHwIZF9y1zPDU5FPjmQIpgfye0=", "dev": true }, - "node_modules/yargs-unparser/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npm.taobao.org/is-fullwidth-code-point/download/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/yargs-unparser/node_modules/string-width": { - "version": "3.1.0", - "resolved": "https://registry.npm.taobao.org/string-width/download/string-width-3.1.0.tgz", - "integrity": "sha1-InZ74htirxCBV0MG9prFG2IgOWE=", + "@babel/highlight": { + "version": "7.12.13", + "resolved": "https://registry.npm.taobao.org/@babel/highlight/download/@babel/highlight-7.12.13.tgz?cache=0&sync_timestamp=1612314644110&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhighlight%2Fdownload%2F%40babel%2Fhighlight-7.12.13.tgz", + "integrity": "sha1-irU4OT4ANwsmJxsB+gj38n8ueVw=", "dev": true, - "dependencies": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - }, - "engines": { - "node": ">=6" + "requires": { + "@babel/helper-validator-identifier": "^7.12.11", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" } }, - "node_modules/yargs-unparser/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npm.taobao.org/strip-ansi/download/strip-ansi-5.2.0.tgz", - "integrity": "sha1-jJpTb+tq/JYr36WxBKUJHBrZwK4=", + "@eslint/eslintrc": { + "version": "0.3.0", + "resolved": "https://registry.npm.taobao.org/@eslint/eslintrc/download/@eslint/eslintrc-0.3.0.tgz", + "integrity": "sha1-1zbWlj1wA7ZRTmMkvsnGAqw0Axg=", "dev": true, - "dependencies": { - "ansi-regex": "^4.1.0" + "requires": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "lodash": "^4.17.20", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" }, - "engines": { - "node": ">=6" - } - }, - "node_modules/yargs-unparser/node_modules/wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npm.taobao.org/wrap-ansi/download/wrap-ansi-5.1.0.tgz", - "integrity": "sha1-H9H2cjXVttD+54EFYAG/tpTAOwk=", - "dev": true, "dependencies": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - }, - "engines": { - "node": ">=6" + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npm.taobao.org/debug/download/debug-4.3.1.tgz?cache=0&sync_timestamp=1607566512593&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-4.3.1.tgz", + "integrity": "sha1-8NIpxQXgxtjEmsVT0bE9wYP2su4=", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npm.taobao.org/ms/download/ms-2.1.2.tgz?cache=0&sync_timestamp=1607433816745&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fms%2Fdownload%2Fms-2.1.2.tgz", + "integrity": "sha1-0J0fNXtEP0kzgqjrPM0YOHKuYAk=", + "dev": true + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npm.taobao.org/strip-json-comments/download/strip-json-comments-3.1.1.tgz?cache=0&sync_timestamp=1594567582667&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstrip-json-comments%2Fdownload%2Fstrip-json-comments-3.1.1.tgz", + "integrity": "sha1-MfEoGzgyYwQ0gxwxDAHMzajL4AY=", + "dev": true + } } }, - "node_modules/yargs-unparser/node_modules/y18n": { - "version": "4.0.1", - "resolved": "https://registry.npm.taobao.org/y18n/download/y18n-4.0.1.tgz?cache=0&sync_timestamp=1609798736426&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fy18n%2Fdownload%2Fy18n-4.0.1.tgz", - "integrity": "sha1-jbK4PDHF11CZu4kLI/MJSJHiR9Q=", - "dev": true - }, - "node_modules/yargs-unparser/node_modules/yargs": { - "version": "13.3.2", - "resolved": "https://registry.npm.taobao.org/yargs/download/yargs-13.3.2.tgz?cache=0&sync_timestamp=1610219732978&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fyargs%2Fdownload%2Fyargs-13.3.2.tgz", - "integrity": "sha1-rX/+/sGqWVZayRX4Lcyzipwxot0=", - "dev": true, - "dependencies": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" - } - }, - "node_modules/yargs-unparser/node_modules/yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npm.taobao.org/yargs-parser/download/yargs-parser-13.1.2.tgz?cache=0&sync_timestamp=1604886709178&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fyargs-parser%2Fdownload%2Fyargs-parser-13.1.2.tgz", - "integrity": "sha1-Ew8JcC667vJlDVTObj5XBvek+zg=", - "dev": true, - "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } - }, - "dependencies": { "@protobufjs/aspromise": { "version": "1.1.2", "resolved": "https://registry.npm.taobao.org/@protobufjs/aspromise/download/@protobufjs/aspromise-1.1.2.tgz", @@ -3324,11 +135,17 @@ "resolved": "https://registry.npm.taobao.org/@types/node/download/@types/node-14.14.22.tgz?cache=0&sync_timestamp=1611167664149&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fnode%2Fdownload%2F%40types%2Fnode-14.14.22.tgz", "integrity": "sha1-DSnzgkcsTM872W/wzkfa9be4Sxg=" }, - "@types/tough-cookie": { - "version": "4.0.0", - "resolved": "https://registry.npm.taobao.org/@types/tough-cookie/download/@types/tough-cookie-4.0.0.tgz", - "integrity": "sha1-/vGQTkZotuXs7mDFLMageP+maX0=", - "peer": true + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npm.taobao.org/acorn/download/acorn-7.4.1.tgz?cache=0&sync_timestamp=1611561113015&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Facorn%2Fdownload%2Facorn-7.4.1.tgz", + "integrity": "sha1-/q7SVZc9LndVW4PbwIhRpsY1IPo=", + "dev": true + }, + "acorn-jsx": { + "version": "5.3.1", + "resolved": "https://registry.npm.taobao.org/acorn-jsx/download/acorn-jsx-5.3.1.tgz?cache=0&sync_timestamp=1599499053189&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Facorn-jsx%2Fdownload%2Facorn-jsx-5.3.1.tgz", + "integrity": "sha1-/IZh4Rt6wVOcR9v+oucrOvNNJns=", + "dev": true }, "agent-base": { "version": "4.3.0", @@ -3418,6 +235,12 @@ "integrity": "sha1-5gtrDo8wG9l+U3UhW9pAbIURjAs=", "dev": true }, + "astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/astral-regex/download/astral-regex-2.0.0.tgz", + "integrity": "sha1-SDFDxWeu7UeFdZwIZXhtx319LjE=", + "dev": true + }, "async": { "version": "2.6.3", "resolved": "https://registry.npm.taobao.org/async/download/async-2.6.3.tgz", @@ -3578,6 +401,12 @@ "get-intrinsic": "^1.0.2" } }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npm.taobao.org/callsites/download/callsites-3.1.0.tgz", + "integrity": "sha1-s2MKvYlDQy9Us/BRkjjjPNffL3M=", + "dev": true + }, "camelcase": { "version": "5.3.1", "resolved": "https://registry.npm.taobao.org/camelcase/download/camelcase-5.3.1.tgz?cache=0&sync_timestamp=1603921799543&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcamelcase%2Fdownload%2Fcamelcase-5.3.1.tgz", @@ -3786,7 +615,29 @@ "integrity": "sha1-J6qn0uTKdkUvmNOt0JOnLJQ+3Jc=", "dev": true, "requires": { - "lru-cache": "^6.0.0" + "lru-cache": "^6.0.0" + } + } + } + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npm.taobao.org/cross-spawn/download/cross-spawn-7.0.3.tgz", + "integrity": "sha1-9zqFudXUHQRVUcF34ogtSshXKKY=", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "dependencies": { + "which": { + "version": "2.0.2", + "resolved": "https://registry.npm.taobao.org/which/download/which-2.0.2.tgz?cache=0&sync_timestamp=1589682812246&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fwhich%2Fdownload%2Fwhich-2.0.2.tgz", + "integrity": "sha1-fGqN0KY2oDJ+ELWckobu6T8/UbE=", + "dev": true, + "requires": { + "isexe": "^2.0.0" } } } @@ -3864,6 +715,12 @@ "type-detect": "^4.0.0" } }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npm.taobao.org/deep-is/download/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, "define-properties": { "version": "1.1.3", "resolved": "https://registry.npm.taobao.org/define-properties/download/define-properties-1.1.3.tgz", @@ -3900,6 +757,15 @@ "integrity": "sha1-082BIh4+pAdCz83lVtTpnpjdxxs=", "dev": true }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/doctrine/download/doctrine-3.0.0.tgz", + "integrity": "sha1-rd6+rXKmV023g2OdyHoSF3OXOWE=", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, "dom-serializer": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.1.tgz", @@ -3964,6 +830,23 @@ "once": "^1.4.0" } }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npm.taobao.org/enquirer/download/enquirer-2.3.6.tgz?cache=0&sync_timestamp=1593693238207&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fenquirer%2Fdownload%2Fenquirer-2.3.6.tgz", + "integrity": "sha1-Kn/l3WNKHkElqXXsmU/1RW3Dc00=", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1" + }, + "dependencies": { + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npm.taobao.org/ansi-colors/download/ansi-colors-4.1.1.tgz", + "integrity": "sha1-y7muJWv3UK8eqzRPIpqif+lLo0g=", + "dev": true + } + } + }, "entities": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", @@ -4054,12 +937,212 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, + "eslint": { + "version": "7.19.0", + "resolved": "https://registry.npm.taobao.org/eslint/download/eslint-7.19.0.tgz", + "integrity": "sha1-ZxliGxlrX61y5DOHmBMU5dDcP0E=", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@eslint/eslintrc": "^0.3.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.1", + "esquery": "^1.2.0", + "esutils": "^2.0.2", + "file-entry-cache": "^6.0.0", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash": "^4.17.20", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^6.0.4", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npm.taobao.org/chalk/download/chalk-4.1.0.tgz", + "integrity": "sha1-ThSHCmGNni7dl92DRf2dncMVZGo=", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npm.taobao.org/debug/download/debug-4.3.1.tgz?cache=0&sync_timestamp=1607566512593&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-4.3.1.tgz", + "integrity": "sha1-8NIpxQXgxtjEmsVT0bE9wYP2su4=", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz", + "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", + "dev": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npm.taobao.org/ms/download/ms-2.1.2.tgz?cache=0&sync_timestamp=1607433816745&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fms%2Fdownload%2Fms-2.1.2.tgz", + "integrity": "sha1-0J0fNXtEP0kzgqjrPM0YOHKuYAk=", + "dev": true + }, + "semver": { + "version": "7.3.4", + "resolved": "https://registry.npm.taobao.org/semver/download/semver-7.3.4.tgz?cache=0&sync_timestamp=1606852122426&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsemver%2Fdownload%2Fsemver-7.3.4.tgz", + "integrity": "sha1-J6qn0uTKdkUvmNOt0JOnLJQ+3Jc=", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npm.taobao.org/strip-json-comments/download/strip-json-comments-3.1.1.tgz?cache=0&sync_timestamp=1594567582667&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstrip-json-comments%2Fdownload%2Fstrip-json-comments-3.1.1.tgz", + "integrity": "sha1-MfEoGzgyYwQ0gxwxDAHMzajL4AY=", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.2.0.tgz?cache=0&sync_timestamp=1611394043517&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.2.0.tgz", + "integrity": "sha1-G33NyzK4E4gBs+R4umpRyqiWSNo=", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npm.taobao.org/eslint-scope/download/eslint-scope-5.1.1.tgz?cache=0&sync_timestamp=1599933589759&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint-scope%2Fdownload%2Feslint-scope-5.1.1.tgz", + "integrity": "sha1-54blmmbLkrP2wfsNUIqrF0hI9Iw=", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npm.taobao.org/eslint-utils/download/eslint-utils-2.1.0.tgz?cache=0&sync_timestamp=1592222193833&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint-utils%2Fdownload%2Feslint-utils-2.1.0.tgz", + "integrity": "sha1-0t5eA0JOcH3BDHQGjd7a5wh0Gyc=", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npm.taobao.org/eslint-visitor-keys/download/eslint-visitor-keys-1.3.0.tgz?cache=0&sync_timestamp=1597435347526&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint-visitor-keys%2Fdownload%2Feslint-visitor-keys-1.3.0.tgz", + "integrity": "sha1-MOvR73wv3/AcOk8VEESvJfqwUj4=", + "dev": true + } + } + }, + "eslint-visitor-keys": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/eslint-visitor-keys/download/eslint-visitor-keys-2.0.0.tgz?cache=0&sync_timestamp=1597435347526&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint-visitor-keys%2Fdownload%2Feslint-visitor-keys-2.0.0.tgz", + "integrity": "sha1-If3I+82ceVzAMh8FY3AglXUVEag=", + "dev": true + }, + "espree": { + "version": "7.3.1", + "resolved": "https://registry.npm.taobao.org/espree/download/espree-7.3.1.tgz?cache=0&sync_timestamp=1607144079766&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fespree%2Fdownload%2Fespree-7.3.1.tgz", + "integrity": "sha1-8t8zC3Usb1UBn4vYm3ZgA5wbu7Y=", + "dev": true, + "requires": { + "acorn": "^7.4.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^1.3.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npm.taobao.org/eslint-visitor-keys/download/eslint-visitor-keys-1.3.0.tgz?cache=0&sync_timestamp=1597435347526&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint-visitor-keys%2Fdownload%2Feslint-visitor-keys-1.3.0.tgz", + "integrity": "sha1-MOvR73wv3/AcOk8VEESvJfqwUj4=", + "dev": true + } + } + }, "esprima": { "version": "4.0.1", "resolved": "https://registry.npm.taobao.org/esprima/download/esprima-4.0.1.tgz", "integrity": "sha1-E7BM2z5sXRnfkatph6hpVhmwqnE=", "dev": true }, + "esquery": { + "version": "1.4.0", + "resolved": "https://registry.npm.taobao.org/esquery/download/esquery-1.4.0.tgz?cache=0&sync_timestamp=1612565659324&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fesquery%2Fdownload%2Fesquery-1.4.0.tgz", + "integrity": "sha1-IUj/w4uC6McFff7UhCWz5h8PJKU=", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npm.taobao.org/estraverse/download/estraverse-5.2.0.tgz?cache=0&sync_timestamp=1596641353460&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Festraverse%2Fdownload%2Festraverse-5.2.0.tgz", + "integrity": "sha1-MH30JUfmzHMk088DwVXVzbjFOIA=", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npm.taobao.org/esrecurse/download/esrecurse-4.3.0.tgz", + "integrity": "sha1-eteWTWeauyi+5yzsY3WLHF0smSE=", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npm.taobao.org/estraverse/download/estraverse-5.2.0.tgz?cache=0&sync_timestamp=1596641353460&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Festraverse%2Fdownload%2Festraverse-5.2.0.tgz", + "integrity": "sha1-MH30JUfmzHMk088DwVXVzbjFOIA=", + "dev": true + } + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npm.taobao.org/estraverse/download/estraverse-4.3.0.tgz?cache=0&sync_timestamp=1596641353460&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Festraverse%2Fdownload%2Festraverse-4.3.0.tgz", + "integrity": "sha1-OYrT88WiSUi+dyXoPRGn3ijNvR0=", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npm.taobao.org/esutils/download/esutils-2.0.3.tgz", + "integrity": "sha1-dNLrTeC42hKTcRkQ1Qd1ubcQ72Q=", + "dev": true + }, "eventemitter3": { "version": "4.0.7", "resolved": "https://registry.npm.taobao.org/eventemitter3/download/eventemitter3-4.0.7.tgz?cache=0&sync_timestamp=1598517724259&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feventemitter3%2Fdownload%2Feventemitter3-4.0.7.tgz", @@ -4089,6 +1172,21 @@ "integrity": "sha1-h0v2nG9ATCtdmcSBNBOZ/VWJJjM=", "dev": true }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npm.taobao.org/fast-levenshtein/download/fast-levenshtein-2.0.6.tgz?cache=0&sync_timestamp=1595428045324&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffast-levenshtein%2Fdownload%2Ffast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "file-entry-cache": { + "version": "6.0.0", + "resolved": "https://registry.npm.taobao.org/file-entry-cache/download/file-entry-cache-6.0.0.tgz", + "integrity": "sha1-eSGonDkcbZPv7CFprGvzAMUn6go=", + "dev": true, + "requires": { + "flat-cache": "^3.0.4" + } + }, "filesize": { "version": "5.0.3", "resolved": "https://registry.npm.taobao.org/filesize/download/filesize-5.0.3.tgz", @@ -4113,6 +1211,22 @@ "is-buffer": "~2.0.3" } }, + "flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npm.taobao.org/flat-cache/download/flat-cache-3.0.4.tgz?cache=0&sync_timestamp=1604831825098&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fflat-cache%2Fdownload%2Fflat-cache-3.0.4.tgz", + "integrity": "sha1-YbAzgwKy/p+Vfcwy/CqH8cMEixE=", + "dev": true, + "requires": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + } + }, + "flatted": { + "version": "3.1.1", + "resolved": "https://registry.npm.taobao.org/flatted/download/flatted-3.1.1.tgz?cache=0&sync_timestamp=1611059830264&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fflatted%2Fdownload%2Fflatted-3.1.1.tgz", + "integrity": "sha1-xLSJ6ACW2d8d/JfHmHGup8YXxGk=", + "dev": true + }, "follow-redirects": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.0.tgz", @@ -4164,6 +1278,12 @@ "integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0=", "dev": true }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/functional-red-black-tree/download/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -4218,12 +1338,30 @@ "path-is-absolute": "^1.0.0" } }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npm.taobao.org/glob-parent/download/glob-parent-5.1.1.tgz", + "integrity": "sha1-tsHvQXxOVmPqSY8cRa+saRa7wik=", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, "global-var": { "version": "0.1.0", "resolved": "https://registry.npm.taobao.org/global-var/download/global-var-0.1.0.tgz", "integrity": "sha1-yOPo/5yIJ9uc1BUvZLszW498mbY=", "dev": true }, + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npm.taobao.org/globals/download/globals-12.4.0.tgz?cache=0&sync_timestamp=1608438471160&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fglobals%2Fdownload%2Fglobals-12.4.0.tgz", + "integrity": "sha1-oYgTV2pBsAokqX5/gVkYwuGZJfg=", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } + }, "graceful-fs": { "version": "4.2.4", "resolved": "https://registry.npm.taobao.org/graceful-fs/download/graceful-fs-4.2.4.tgz", @@ -4326,6 +1464,22 @@ "integrity": "sha1-jrehCmP/8l0VpXsAFYbRd9Gw01I=", "dev": true }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npm.taobao.org/ignore/download/ignore-4.0.6.tgz", + "integrity": "sha1-dQ49tYYgh7RzfrrIIH/9HvJ7Jfw=", + "dev": true + }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npm.taobao.org/import-fresh/download/import-fresh-3.3.0.tgz?cache=0&sync_timestamp=1608469520474&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fimport-fresh%2Fdownload%2Fimport-fresh-3.3.0.tgz", + "integrity": "sha1-NxYsJfy566oublPVtNiM4X2eDCs=", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npm.taobao.org/imurmurhash/download/imurmurhash-0.1.4.tgz", @@ -4380,6 +1534,12 @@ "integrity": "sha1-vac28s2P0G0yhE53Q7+nSUw7/X4=", "dev": true }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npm.taobao.org/is-extglob/download/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -4391,6 +1551,15 @@ "integrity": "sha1-37XCsSDgKwqNnSxoBs1WIaqSL3s=", "dev": true }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npm.taobao.org/is-glob/download/is-glob-4.0.1.tgz", + "integrity": "sha1-dWfb6fL14kZ7x3q4PEopSCQHpdw=", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, "is-nan": { "version": "1.3.2", "resolved": "https://registry.npm.taobao.org/is-nan/download/is-nan-1.3.2.tgz", @@ -4479,6 +1648,12 @@ "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", "dev": true }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/js-tokens/download/js-tokens-4.0.0.tgz", + "integrity": "sha1-GSA/tZmR35jjoocFDUZHzerzJJk=", + "dev": true + }, "js-yaml": { "version": "3.13.1", "resolved": "https://registry.npm.taobao.org/js-yaml/download/js-yaml-3.13.1.tgz", @@ -4513,6 +1688,12 @@ "integrity": "sha1-I/9IG4tO680soSO0+gQJ5mRpotk=", "dev": true }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/json-stable-stringify-without-jsonify/download/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npm.taobao.org/json-stringify-safe/download/json-stringify-safe-5.0.1.tgz", @@ -4547,6 +1728,16 @@ "verror": "1.10.0" } }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npm.taobao.org/levn/download/levn-0.4.1.tgz", + "integrity": "sha1-rkViwAdHO5MqYgDUAyaN0v/8at4=", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, "locate-path": { "version": "3.0.0", "resolved": "https://registry.npm.taobao.org/locate-path/download/locate-path-3.0.0.tgz", @@ -4810,6 +2001,12 @@ "integrity": "sha1-MKWGTrPrsKZvLr5tcnrwagnYbgo=", "dev": true }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npm.taobao.org/natural-compare/download/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, "node-environment-flags": { "version": "1.0.5", "resolved": "https://registry.npm.taobao.org/node-environment-flags/download/node-environment-flags-1.0.5.tgz", @@ -4911,6 +2108,20 @@ "mimic-fn": "^2.1.0" } }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npm.taobao.org/optionator/download/optionator-0.9.1.tgz", + "integrity": "sha1-TyNqY3Pa4FZqbUPhMmZ09QwpFJk=", + "dev": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, "p-finally": { "version": "1.0.0", "resolved": "https://registry.npm.taobao.org/p-finally/download/p-finally-1.0.0.tgz", @@ -4957,6 +2168,15 @@ "integrity": "sha1-yyhoVA4xPWHeWPr741zpAE1VQOY=", "dev": true }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/parent-module/download/parent-module-1.0.1.tgz", + "integrity": "sha1-aR0nCeeMefrjoVZiJFLQB2LKqqI=", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, "parse5": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/parse5/-/parse5-3.0.3.tgz", @@ -4977,6 +2197,12 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npm.taobao.org/path-key/download/path-key-3.1.1.tgz", + "integrity": "sha1-WB9q3mWMu6ZaDTOA3ndTKVBU83U=", + "dev": true + }, "pathval": { "version": "1.1.1", "resolved": "https://registry.npm.taobao.org/pathval/download/pathval-1.1.1.tgz", @@ -5009,6 +2235,18 @@ "integrity": "sha1-mcp9clll+2VYFOr2XzjxK72/VV8=", "dev": true }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npm.taobao.org/prelude-ls/download/prelude-ls-1.2.1.tgz", + "integrity": "sha1-3rxkidem5rDnYRiIzsiAM30xY5Y=", + "dev": true + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npm.taobao.org/progress/download/progress-2.0.3.tgz", + "integrity": "sha1-foz42PW48jnBvGi+tOt4Vn1XLvg=", + "dev": true + }, "protobufjs": { "version": "6.10.2", "resolved": "https://registry.npm.taobao.org/protobufjs/download/protobufjs-6.10.2.tgz?cache=0&sync_timestamp=1605559636133&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fprotobufjs%2Fdownload%2Fprotobufjs-6.10.2.tgz", @@ -5212,6 +2450,12 @@ "util-deprecate": "^1.0.1" } }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npm.taobao.org/regexpp/download/regexpp-3.1.0.tgz", + "integrity": "sha1-IG0K0KVkjP+9uK5GQ489xRyfeOI=", + "dev": true + }, "request": { "version": "2.88.2", "resolved": "https://registry.npm.taobao.org/request/download/request-2.88.2.tgz?cache=0&sync_timestamp=1592843183066&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frequest%2Fdownload%2Frequest-2.88.2.tgz", @@ -5263,12 +2507,33 @@ "resolved": "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npm.taobao.org/require-from-string/download/require-from-string-2.0.2.tgz", + "integrity": "sha1-iaf92TgmEmcxjq/hT5wy5ZjDaQk=", + "dev": true + }, "require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npm.taobao.org/require-main-filename/download/require-main-filename-2.0.0.tgz", "integrity": "sha1-0LMp7MfMD2Fkn2IhW+aa9UqomJs=", "dev": true }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/resolve-from/download/resolve-from-4.0.0.tgz", + "integrity": "sha1-SrzYUq0y3Xuqv+m0DgCjbbXzkuY=", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npm.taobao.org/rimraf/download/rimraf-3.0.2.tgz?cache=0&sync_timestamp=1589682814592&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frimraf%2Fdownload%2Frimraf-3.0.2.tgz", + "integrity": "sha1-8aVAK6YiCtUswSgrrBrjqkn9Bho=", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -5378,12 +2643,38 @@ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/shebang-command/download/shebang-command-2.0.0.tgz", + "integrity": "sha1-zNCvT4g1+9wmW4JGGq8MNmY/NOo=", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/shebang-regex/download/shebang-regex-3.0.0.tgz", + "integrity": "sha1-rhbxZE2HPsrYQ7AwexQzYtTEIXI=", + "dev": true + }, "signal-exit": { "version": "3.0.3", "resolved": "https://registry.npm.taobao.org/signal-exit/download/signal-exit-3.0.3.tgz", "integrity": "sha1-oUEMLt2PB3sItOJTyOrPyvBXRhw=", "dev": true }, + "slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/slice-ansi/download/slice-ansi-4.0.0.tgz", + "integrity": "sha1-UA6N0P1VsFgVCGJVsxla3ypF/ms=", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + } + }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npm.taobao.org/sprintf-js/download/sprintf-js-1.0.3.tgz", @@ -5407,14 +2698,6 @@ "tweetnacl": "~0.14.0" } }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "requires": { - "safe-buffer": "~5.2.0" - } - }, "string-width": { "version": "4.2.0", "resolved": "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz", @@ -5445,6 +2728,14 @@ "define-properties": "^1.1.3" } }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "requires": { + "safe-buffer": "~5.2.0" + } + }, "strip-ansi": { "version": "6.0.0", "resolved": "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz", @@ -5468,6 +2759,38 @@ "has-flag": "^3.0.0" } }, + "table": { + "version": "6.0.7", + "resolved": "https://registry.npm.taobao.org/table/download/table-6.0.7.tgz?cache=0&sync_timestamp=1609732718890&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftable%2Fdownload%2Ftable-6.0.7.tgz", + "integrity": "sha1-5FiX/7zBvPnoqHv0IPLJ5aelKjQ=", + "dev": true, + "requires": { + "ajv": "^7.0.2", + "lodash": "^4.17.20", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.0" + }, + "dependencies": { + "ajv": { + "version": "7.0.4", + "resolved": "https://registry.npm.taobao.org/ajv/download/ajv-7.0.4.tgz", + "integrity": "sha1-gn5fWuMvXlwWN9th8lOhEiKbXi8=", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/json-schema-traverse/download/json-schema-traverse-1.0.0.tgz", + "integrity": "sha1-rnvLNlard6c7pcSb9lTzjmtoYOI=", + "dev": true + } + } + }, "tencent-login": { "version": "0.1.7", "resolved": "https://registry.npm.taobao.org/tencent-login/download/tencent-login-0.1.7.tgz", @@ -5493,6 +2816,12 @@ "node-fetch": "^2.2.0" } }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npm.taobao.org/text-table/download/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, "tough-cookie": { "version": "4.0.0", "resolved": "https://registry.npm.taobao.org/tough-cookie/download/tough-cookie-4.0.0.tgz", @@ -5525,12 +2854,27 @@ "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", "dev": true }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npm.taobao.org/type-check/download/type-check-0.4.0.tgz", + "integrity": "sha1-B7ggO/pwVsBlcFDjzNLDdzC6uPE=", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, "type-detect": { "version": "4.0.8", "resolved": "https://registry.npm.taobao.org/type-detect/download/type-detect-4.0.8.tgz", "integrity": "sha1-dkb7XxiHHPu3dJ5pvTmmOI63RQw=", "dev": true }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npm.taobao.org/type-fest/download/type-fest-0.8.1.tgz?cache=0&sync_timestamp=1606470665567&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftype-fest%2Fdownload%2Ftype-fest-0.8.1.tgz", + "integrity": "sha1-CeJJ696FHTseSNJ8EFREZn8XuD0=", + "dev": true + }, "typedarray-to-buffer": { "version": "3.1.5", "resolved": "https://registry.npm.taobao.org/typedarray-to-buffer/download/typedarray-to-buffer-3.1.5.tgz?cache=0&sync_timestamp=1606167099511&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftypedarray-to-buffer%2Fdownload%2Ftypedarray-to-buffer-3.1.5.tgz", @@ -5627,6 +2971,12 @@ "integrity": "sha1-sj5DWK+oogL+ehAK8fX4g/AgB+4=", "dev": true }, + "v8-compile-cache": { + "version": "2.2.0", + "resolved": "https://registry.npm.taobao.org/v8-compile-cache/download/v8-compile-cache-2.2.0.tgz", + "integrity": "sha1-lHHvo++RKNL3xqfKOcTda1BVsTI=", + "dev": true + }, "verror": { "version": "1.10.0", "resolved": "https://registry.npm.taobao.org/verror/download/verror-1.10.0.tgz", @@ -5710,6 +3060,12 @@ } } }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npm.taobao.org/word-wrap/download/word-wrap-1.2.3.tgz?cache=0&sync_timestamp=1589683603678&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fword-wrap%2Fdownload%2Fword-wrap-1.2.3.tgz", + "integrity": "sha1-YQY29rH3A4kb00dxzLF/uTtHB5w=", + "dev": true + }, "wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz", diff --git a/package.json b/package.json index 393f13644..9cf9cde5f 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "yargs": "^16.1.0" }, "devDependencies": { + "eslint": "^7.19.0", "serverless-tencent-scf": "^0.1.7" } } From dbfd49642e26ed32a71db99a5a615c1d30189c84 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Mon, 8 Feb 2021 19:35:12 +0800 Subject: [PATCH 011/128] =?UTF-8?q?=F0=9F=90=8D=20fixed=20bug=20at=20bcow.?= =?UTF-8?q?js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/bcow.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/commands/tasks/unicom/bcow.js b/commands/tasks/unicom/bcow.js index 85066f180..a9c9b9f1b 100644 --- a/commands/tasks/unicom/bcow.js +++ b/commands/tasks/unicom/bcow.js @@ -20,6 +20,7 @@ module.exports = bcow = { postTimesDrawForPrize: async ( axios, options, + // eslint-disable-next-line no-unused-vars { jfid, searchParams, jar1 }, { activity, Authorization, freeTimes, advertTimes } ) => { @@ -106,6 +107,7 @@ module.exports = bcow = { version: "8.0102", }; advertTimes--; + // eslint-disable-next-line no-unused-vars orderId = params["orderId"]; } else { freeTimes--; From 4945b838cf6fc63f1496ef020e212002186a2d27 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Mon, 8 Feb 2021 19:40:10 +0800 Subject: [PATCH 012/128] Update bcow.js --- commands/tasks/unicom/bcow.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/commands/tasks/unicom/bcow.js b/commands/tasks/unicom/bcow.js index a9c9b9f1b..9e0aed4c4 100644 --- a/commands/tasks/unicom/bcow.js +++ b/commands/tasks/unicom/bcow.js @@ -5,6 +5,9 @@ const useragent = require("./handlers/myPhone").useragent; const gameEvents = require("./handlers/dailyEvent"); const referer = "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-qd/bcow/index.html?jump=sign"; +/** + * 入口:首页=>签到=>免费抽 赢牛拿奖 + */ let bcow; module.exports = bcow = { doTask: async (axios, options) => { From 78b898dd24861265a90fbbc7c2866c78309bffaa Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Mon, 8 Feb 2021 19:48:05 +0800 Subject: [PATCH 013/128] format file --- commands/tasks/unicom/dailyYYQ.js | 380 ++++++++++++++++-------------- 1 file changed, 204 insertions(+), 176 deletions(-) diff --git a/commands/tasks/unicom/dailyYYQ.js b/commands/tasks/unicom/dailyYYQ.js index da20f2730..c1f48b43e 100644 --- a/commands/tasks/unicom/dailyYYQ.js +++ b/commands/tasks/unicom/dailyYYQ.js @@ -1,26 +1,30 @@ -var crypto = require('crypto'); +var crypto = require("crypto"); var CryptoJS = require("crypto-js"); // 快乐摇摇球 var transParams = (data) => { let params = new URLSearchParams(); for (let item in data) { - params.append(item, data['' + item + '']); + params.append(item, data["" + item + ""]); } return params; }; var sign = (data) => { - let str = 'integralofficial&' - let params = [] + let str = "integralofficial&"; + let params = []; data.forEach((v, i) => { if (v) { - params.push('arguments' + (i + 1) + v) + params.push("arguments" + (i + 1) + v); } }); - return crypto.createHash('md5').update(str + params.join('&')).digest('hex') -} + return crypto + .createHash("md5") + .update(str + params.join("&")) + .digest("hex"); +}; +// prettier-ignore var secretkeyArray = function () { for (var e = [], t = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", @@ -42,266 +46,290 @@ var encrypt = function (word, keyStr) { var srcs = CryptoJS.enc.Utf8.parse(word); var encrypted = CryptoJS.AES.encrypt(srcs, key, { mode: CryptoJS.mode.ECB, - padding: CryptoJS.pad.Pkcs7 + padding: CryptoJS.pad.Pkcs7, }); return encrypted.toString(); -} +}; var decrypt = function (word, keyStr) { var key = CryptoJS.enc.Utf8.parse(keyStr); var decrypted = CryptoJS.AES.decrypt(word, key, { mode: CryptoJS.mode.ECB, - padding: CryptoJS.pad.Pkcs7 + padding: CryptoJS.pad.Pkcs7, }); return decrypted.toString(CryptoJS.enc.Utf8); -} - - +}; -var dailyYYQ = { +let dailyYYQ = { doTask: async (axios, options) => { - - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}` - let searchParams = {} - let result = await axios.request({ - baseURL: 'https://m.client.10010.com/', - headers: { - "user-agent": useragent, - "referer": `https://img.client.10010.com/`, - "origin": "https://img.client.10010.com" - }, - url: `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://m.jf.10010.com/jf-order/avoidLogin/forActive/stxyndj`, - method: 'GET', - transformResponse: (data, headers) => { - if ('location' in headers) { - let uu = new URL(headers.location) - let pp = {} - for (let p of uu.searchParams) { - pp[p[0]] = p[1] - } - if ('ticket' in pp) { - searchParams = pp + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; + let searchParams = {}; + let result = await axios + .request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": useragent, + referer: `https://img.client.10010.com/`, + origin: "https://img.client.10010.com", + }, + url: `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://m.jf.10010.com/jf-order/avoidLogin/forActive/stxyndj`, + method: "GET", + transformResponse: (data, headers) => { + if ("location" in headers) { + let uu = new URL(headers.location); + let pp = {}; + for (let p of uu.searchParams) { + pp[p[0]] = p[1]; + } + if ("ticket" in pp) { + searchParams = pp; + } } - } - return data - } - }).catch(err => console.log(err)) - let jar1 = result.config.jar + return data; + }, + }) + .catch((err) => console.log(err)); + let jar1 = result.config.jar; - let cookiesJson = jar1.toJSON() - let ecs_token = cookiesJson.cookies.find(i => i.key == 'ecs_token') - ecs_token = ecs_token.value + let cookiesJson = jar1.toJSON(); + let ecs_token = cookiesJson.cookies.find((i) => i.key == "ecs_token"); + ecs_token = ecs_token.value; if (!ecs_token) { - throw new Error('ecs_token缺失') + throw new Error("ecs_token缺失"); } - let jfid = cookiesJson.cookies.find(i => i.key == '_jf_id') + let jfid = cookiesJson.cookies.find((i) => i.key == "_jf_id"); if (!jfid) { - throw new Error('jfid缺失') + throw new Error("jfid缺失"); } - jfid = jfid.value + jfid = jfid.value; - let keyArr = secretkeyArray() - let keyrdm = Math.floor(Math.random() * 5) + let keyArr = secretkeyArray(); + let keyrdm = Math.floor(Math.random() * 5); let params = { activityId: "Ac-da377d4512124eb49cc3ea4e0d25e379", userCookie: jfid, userNumber: searchParams.userNumber, - time: new Date().getTime() + time: new Date().getTime(), }; let reqdata = { - params: encrypt(JSON.stringify(params), "5de7e29919fad4d5") - } + params: encrypt(JSON.stringify(params), "5de7e29919fad4d5"), + }; - let res = await axios.request({ - baseURL: 'https://m.jf.10010.com/', - headers: { - "user-agent": useragent, - "Authorization": "Bearer null", - "referer": "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/eggachine/index.html?id=Ac-da377d4512124eb49cc3ea4e0d25e379", - "origin": "https://img.jf.10010.com", - "Content-Type": "application/json" - }, - jar: jar1, - url: `/jf-yuech/p/freeLogin`, - method: 'post', - data: reqdata - }).catch(err => console.log(err)) + let res = await axios + .request({ + baseURL: "https://m.jf.10010.com/", + headers: { + "user-agent": useragent, + Authorization: "Bearer null", + referer: + "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/eggachine/index.html?id=Ac-da377d4512124eb49cc3ea4e0d25e379", + origin: "https://img.jf.10010.com", + "Content-Type": "application/json", + }, + jar: jar1, + url: `/jf-yuech/p/freeLogin`, + method: "post", + data: reqdata, + }) + .catch((err) => console.log(err)); - result = res.data + result = res.data; if (result.code !== 0) { - throw new Error(result.message) + throw new Error(result.message); } - let activity = result.data.activity - let Authorization = result.data.token.access_token - let freeTimes = activity.freeGameTimes - let advertTimes = activity.advertLimitNum - let times = 5 + let activity = result.data.activity; + let Authorization = result.data.token.access_token; + let freeTimes = activity.freeGameTimes; + let advertTimes = activity.advertLimitNum; + let times = 5; // /jf-yuech/api/integralLogs/surplusFreeGame?activityId=Ac-da377d4512124eb49cc3ea4e0d25e379 do { - let orderId = '' - console.log("第" + times + "次") + let orderId = ""; + console.log("第" + times + "次"); res = await axios.request({ headers: { - "Authorization": `Bearer ${Authorization}`, + Authorization: `Bearer ${Authorization}`, "user-agent": useragent, - "referer": "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/eggachine/index.html?id=" + activity.activityId, - "origin": "https://img.jf.10010.com" + referer: + "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/eggachine/index.html?id=" + + activity.activityId, + origin: "https://img.jf.10010.com", }, url: `https://m.jf.10010.com/jf-yuech/api/gameResult/advertFreeGame?activityId=${activity.activityId}`, - method: 'get' - }) + method: "get", + }); if (res.data.code !== 0) { - console.log('签到小游戏买扭蛋机2: ' + res.data.message) - break + console.log("签到小游戏买扭蛋机2: " + res.data.message); + break; } if (times < 5) { - let params = { - 'arguments1': 'AC20200611152252', - 'arguments2': '', - 'arguments3': '', - 'arguments4': new Date().getTime(), - 'arguments6': '', - 'arguments7': '', - 'arguments8': '', - 'arguments9': '', - 'netWay': 'Wifi', - 'remark': '签到小游戏买扭蛋机2', - 'version': `android@8.0100`, - 'codeId': 945535686 - } + arguments1: "AC20200611152252", + arguments2: "", + arguments3: "", + arguments4: new Date().getTime(), + arguments6: "", + arguments7: "", + arguments8: "", + arguments9: "", + netWay: "Wifi", + remark: "签到小游戏买扭蛋机2", + version: `android@8.0100`, + codeId: 945535686, + }; - params['sign'] = sign([params.arguments1, params.arguments2, params.arguments3, params.arguments4]) - params['orderId'] = crypto.createHash('md5').update(new Date().getTime() + '').digest('hex') - params['arguments4'] = new Date().getTime() + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + params["orderId"] = crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"); + params["arguments4"] = new Date().getTime(); - result = await require('./taskcallback').reward(axios, { + result = await require("./taskcallback").reward(axios, { ...options, params, - jar: jar1 - }) + jar: jar1, + }); - orderId = params['orderId'] + orderId = params["orderId"]; } - let n = Math.floor(5 * Math.random()) - let i = secretkeyArray() + let n = Math.floor(5 * Math.random()); + let i = secretkeyArray(); let t = { - "activityId": activity.activityId, - "version": 8.01, - "orderId": orderId, - "phoneType": "android" - } + activityId: activity.activityId, + version: 8.01, + orderId: orderId, + phoneType: "android", + }; params = { - "params": encrypt(JSON.stringify(t), i[n]) + n, - "parKey": i - } + params: encrypt(JSON.stringify(t), i[n]) + n, + parKey: i, + }; res = await axios.request({ headers: { - "Authorization": `Bearer ${Authorization}`, + Authorization: `Bearer ${Authorization}`, "user-agent": useragent, - "referer": "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/eggachine/index.html?id=Ac-da377d4512124eb49cc3ea4e0d25e379", - "origin": "https://img.jf.10010.com" + referer: + "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/eggachine/index.html?id=Ac-da377d4512124eb49cc3ea4e0d25e379", + origin: "https://img.jf.10010.com", }, url: `https://m.jf.10010.com/jf-yuech/api/gameResult/advertLuckDraw`, - method: 'post', - data: params - }) - result = res.data + method: "post", + data: params, + }); + result = res.data; if (result.code !== 0) { - console.log("快乐摇摇球:", result.message) + console.log("快乐摇摇球:", result.message); } else { - console.log('快乐摇摇球:', result.data.prizeName) + console.log("快乐摇摇球:", result.data.prizeName); if (result.data.doublingStatus) { - console.log('提交积分翻倍') + console.log("提交积分翻倍"); await dailyYYQ.lookVideoDouble(axios, { - ...options - }) + ...options, + }); await dailyYYQ.lookVideoDoubleResult(axios, { ...options, Authorization, activityId: activity.activityId, - winningRecordId: result.data.winningRecordId - }) + winningRecordId: result.data.winningRecordId, + }); } } - console.log('等待15秒再继续') - await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)) - - } while (--times) + console.log("等待15秒再继续"); + await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); + } while (--times); }, lookVideoDouble: async (axios, options) => { let params = { - 'arguments1': 'AC20200611152252', // acid - 'arguments2': 'GGPD', // yhChannel - 'arguments3': '73e3907bbf9c4748b2fe9a053cee5e82', // yhTaskId menuId - 'arguments4': new Date().getTime(), // time - 'arguments6': '517050707', - 'netWay': 'Wifi', - 'version': `android@8.0100` - } - params['sign'] = sign([params.arguments1, params.arguments2, params.arguments3, params.arguments4]) - let { num, jar } = await require('./taskcallback').query(axios, { + arguments1: "AC20200611152252", // acid + arguments2: "GGPD", // yhChannel + arguments3: "73e3907bbf9c4748b2fe9a053cee5e82", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "517050707", + netWay: "Wifi", + version: `android@8.0100`, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + let { num, jar } = await require("./taskcallback").query(axios, { ...options, - params - }) + params, + }); if (!num) { - console.log('签到小游戏买扭蛋机2: 今日已完成') - return + console.log("签到小游戏买扭蛋机2: 今日已完成"); + return; } params = { - 'arguments1': 'AC20200611152252', // acid - 'arguments2': 'GGPD', // yhChannel - 'arguments3': '73e3907bbf9c4748b2fe9a053cee5e82', // yhTaskId menuId - 'arguments4': new Date().getTime(), // time - 'arguments6': '', - 'arguments7': '', - 'arguments8': '', - 'arguments9': '', - 'orderId': crypto.createHash('md5').update(new Date().getTime() + '').digest('hex'), - 'netWay': 'Wifi', - 'remark': '签到小游戏买扭蛋机2', - 'version': `android@8.0100`, - 'codeId': 945535686 - } - params['sign'] = sign([params.arguments1, params.arguments2, params.arguments3, params.arguments4]) - await require('./taskcallback').doTask(axios, { + arguments1: "AC20200611152252", // acid + arguments2: "GGPD", // yhChannel + arguments3: "73e3907bbf9c4748b2fe9a053cee5e82", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "", + arguments7: "", + arguments8: "", + arguments9: "", + orderId: crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"), + netWay: "Wifi", + remark: "签到小游戏买扭蛋机2", + version: `android@8.0100`, + codeId: 945535686, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + await require("./taskcallback").doTask(axios, { ...options, params, - jar - }) + jar, + }); }, lookVideoDoubleResult: async (axios, options) => { - let { Authorization, activityId, winningRecordId } = options - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}` + let { Authorization, activityId, winningRecordId } = options; + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; let res = await axios.request({ headers: { - "Authorization": `Bearer ${Authorization}`, + Authorization: `Bearer ${Authorization}`, "user-agent": useragent, - "referer": "https://img.jf.10010.com/", - "origin": "https://img.jf.10010.com" + referer: "https://img.jf.10010.com/", + origin: "https://img.jf.10010.com", }, url: `https://m.jf.10010.com/jf-yuech/api/gameResult/doublingIntegral?activityId=${activityId}&winningRecordId=${winningRecordId}`, - method: 'get' - }) - result = res.data + method: "get", + }); + result = res.data; if (result.code !== 0) { - console.log("签到小游戏买扭蛋机2翻倍结果:", result.message) + console.log("签到小游戏买扭蛋机2翻倍结果:", result.message); } else { - console.log("签到小游戏买扭蛋机2翻倍结果:", result.data) + console.log("签到小游戏买扭蛋机2翻倍结果:", result.data); } - } -} + }, +}; -module.exports = dailyYYQ \ No newline at end of file +module.exports = dailyYYQ; From 651b710b42aaf7e52a540de83757b1601369f9db Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Mon, 8 Feb 2021 20:06:49 +0800 Subject: [PATCH 014/128] add gameUtils.js file --- commands/tasks/unicom/dailyYYQ.js | 14 +++++--------- commands/tasks/unicom/handlers/gameUtils.js | 11 +++++++++++ 2 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 commands/tasks/unicom/handlers/gameUtils.js diff --git a/commands/tasks/unicom/dailyYYQ.js b/commands/tasks/unicom/dailyYYQ.js index c1f48b43e..115f3a12e 100644 --- a/commands/tasks/unicom/dailyYYQ.js +++ b/commands/tasks/unicom/dailyYYQ.js @@ -1,15 +1,11 @@ var crypto = require("crypto"); var CryptoJS = require("crypto-js"); -// 快乐摇摇球 -var transParams = (data) => { - let params = new URLSearchParams(); - for (let item in data) { - params.append(item, data["" + item + ""]); - } - return params; -}; - +/** + * 欢乐摇摇球 + * 入口:首页=>签到=>免费抽 摇一摇 + * + */ var sign = (data) => { let str = "integralofficial&"; let params = []; diff --git a/commands/tasks/unicom/handlers/gameUtils.js b/commands/tasks/unicom/handlers/gameUtils.js new file mode 100644 index 000000000..80749ad79 --- /dev/null +++ b/commands/tasks/unicom/handlers/gameUtils.js @@ -0,0 +1,11 @@ +let transParams = (data) => { + let params = new URLSearchParams(); + for (let item in data) { + params.append(item, data["" + item + ""]); + } + return params; +}; + +module.exports = { + transParams, +}; From 44a8e64b0072cb9bd19e63b7e52f281459b8d63a Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Mon, 8 Feb 2021 20:09:27 +0800 Subject: [PATCH 015/128] Update PAES.js --- commands/tasks/unicom/handlers/PAES.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/commands/tasks/unicom/handlers/PAES.js b/commands/tasks/unicom/handlers/PAES.js index 6983b2d6b..2a4aff089 100644 --- a/commands/tasks/unicom/handlers/PAES.js +++ b/commands/tasks/unicom/handlers/PAES.js @@ -26,8 +26,8 @@ const charset = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C" "r", "s", "t", "u", "v", "w", "x", "y", "z"]; let secretkeyArray = () => { - for (var e = [], i = 0; 0x05 > i; i++) { - for (var n = "", s = 0; 0x10 > s; s++) { + for (var e = [], i = 0x0; 0x05 > i; i++) { + for (var n = "", s = 0x0; 0x10 > s; s++) { let a = Math.floor(0x3e * Math.random()); n += charset[a]; } @@ -56,7 +56,7 @@ let decrypt = function (word, keyStr) { }; let newjiamarr = () => { for (var e = [], k = "", t = charset, i = 0x0; 0x4 > i; i++) { - for (var n = "", s = 0x0; 16 > s; s++) { + for (var n = "", s = 0x0; 0x10 > s; s++) { let a = Math.floor(0x3e * Math.random()); n += t[a]; } From e70455f2865b666a73685a93f97dcb4fffa54150 Mon Sep 17 00:00:00 2001 From: cooip-jm <78735965+cooip-jm@users.noreply.github.com> Date: Mon, 8 Feb 2021 21:12:13 +0800 Subject: [PATCH 016/128] Update myPhone.js --- commands/tasks/unicom/handlers/myPhone.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/commands/tasks/unicom/handlers/myPhone.js b/commands/tasks/unicom/handlers/myPhone.js index 6143c416e..cbc561294 100644 --- a/commands/tasks/unicom/handlers/myPhone.js +++ b/commands/tasks/unicom/handlers/myPhone.js @@ -1,7 +1,10 @@ const useragent = (options) => `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0102,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; // `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36;devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:};unicom{version:android@8.0102,desmobile:${options.user}}`; -// const USER_AGENTS = []; +// const USER_AGENTS = [ +// 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 unicom{version:iphone_c@8.0102}{systemVersion:dis}{yw_code:}', +// 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 unicom{version:iphone_c@8.0102}{systemVersion:dis}{yw_code:}' +//]; function randomNumber(min = 0, max = 100) { return Math.min(Math.floor(min + Math.random() * (max - min)), max); From 40ef9f31845da028aa5c4cc180961cfc4238a05f Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Tue, 9 Feb 2021 00:06:52 +0800 Subject: [PATCH 017/128] Update dailyYYY.js --- commands/tasks/unicom/dailyYYY.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/tasks/unicom/dailyYYY.js b/commands/tasks/unicom/dailyYYY.js index 3e37d8d4e..dafc44661 100644 --- a/commands/tasks/unicom/dailyYYY.js +++ b/commands/tasks/unicom/dailyYYY.js @@ -31,7 +31,7 @@ let charMap = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "r", "s", "t", "u", "v", "w", "x", "y", "z"]; var secretkeyArray = function () { - for (let e = [], t = charMap, i = 0; 5 > i; i++) { + for (var e = [], t = charMap, i = 0; 5 > i; i++) { for (var n = "", s = 0; 16 > s; s++) { let a = Math.floor(62 * Math.random()); n += t[a]; @@ -42,7 +42,7 @@ var secretkeyArray = function () { }; var newjiamarr = () => { - for (let e = [], k = "", t = charMap, i = 0x0; 0x4 > i; i++) { + for (var e = [], k = "", t = charMap, i = 0x0; 0x4 > i; i++) { for (var n = "", s = 0x0; 16 > s; s++) { let a = Math.floor(0x3e * Math.random()); n += t[a]; From 53c6d3cbcc754652f0ee8a5abc8d13f341b306f2 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Tue, 9 Feb 2021 00:46:36 +0800 Subject: [PATCH 018/128] =?UTF-8?q?=F0=9F=9A=A7=20fixing=20YYQ?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/dailyYYQ.js | 188 ++++--------------- commands/tasks/unicom/handlers/dailyEvent.js | 27 ++- commands/tasks/unicom/unicom.js | 16 +- 3 files changed, 70 insertions(+), 161 deletions(-) diff --git a/commands/tasks/unicom/dailyYYQ.js b/commands/tasks/unicom/dailyYYQ.js index 115f3a12e..2338fca83 100644 --- a/commands/tasks/unicom/dailyYYQ.js +++ b/commands/tasks/unicom/dailyYYQ.js @@ -1,154 +1,47 @@ var crypto = require("crypto"); -var CryptoJS = require("crypto-js"); - +let AES = require("./handlers/PAES"); +const useragent = require("./handlers/myPhone").useragent; +const gameEvents = require("./handlers/dailyEvent"); +let referer = + "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/eggachine/index.html?id=Ac-da377d4512124eb49cc3ea4e0d25e379"; /** * 欢乐摇摇球 * 入口:首页=>签到=>免费抽 摇一摇 * */ -var sign = (data) => { - let str = "integralofficial&"; - let params = []; - data.forEach((v, i) => { - if (v) { - params.push("arguments" + (i + 1) + v); - } - }); - return crypto - .createHash("md5") - .update(str + params.join("&")) - .digest("hex"); -}; - -// prettier-ignore -var secretkeyArray = function () { - for (var e = [], t = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", - "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", - "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", - "r", "s", "t", "u", "v", "w", "x", "y", "z"], i = 0; - 5 > i; - i++) { - for (var n = "", s = 0; 16 > s; s++) { - var a = Math.floor(62 * Math.random()); - n += t[a] - } - e.push(n) - } - return e; -} - -var encrypt = function (word, keyStr) { - var key = CryptoJS.enc.Utf8.parse(keyStr); - var srcs = CryptoJS.enc.Utf8.parse(word); - var encrypted = CryptoJS.AES.encrypt(srcs, key, { - mode: CryptoJS.mode.ECB, - padding: CryptoJS.pad.Pkcs7, - }); - return encrypted.toString(); -}; - -var decrypt = function (word, keyStr) { - var key = CryptoJS.enc.Utf8.parse(keyStr); - var decrypted = CryptoJS.AES.decrypt(word, key, { - mode: CryptoJS.mode.ECB, - padding: CryptoJS.pad.Pkcs7, - }); - return decrypted.toString(CryptoJS.enc.Utf8); -}; let dailyYYQ = { doTask: async (axios, options) => { - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; - let searchParams = {}; - let result = await axios - .request({ - baseURL: "https://m.client.10010.com/", - headers: { - "user-agent": useragent, - referer: `https://img.client.10010.com/`, - origin: "https://img.client.10010.com", - }, - url: `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://m.jf.10010.com/jf-order/avoidLogin/forActive/stxyndj`, - method: "GET", - transformResponse: (data, headers) => { - if ("location" in headers) { - let uu = new URL(headers.location); - let pp = {}; - for (let p of uu.searchParams) { - pp[p[0]] = p[1]; - } - if ("ticket" in pp) { - searchParams = pp; - } - } - return data; - }, - }) - .catch((err) => console.log(err)); - let jar1 = result.config.jar; - - let cookiesJson = jar1.toJSON(); - let ecs_token = cookiesJson.cookies.find((i) => i.key == "ecs_token"); - ecs_token = ecs_token.value; - if (!ecs_token) { - throw new Error("ecs_token缺失"); - } - let jfid = cookiesJson.cookies.find((i) => i.key == "_jf_id"); - if (!jfid) { - throw new Error("jfid缺失"); - } - jfid = jfid.value; - - let keyArr = secretkeyArray(); - let keyrdm = Math.floor(Math.random() * 5); - - let params = { - activityId: "Ac-da377d4512124eb49cc3ea4e0d25e379", - userCookie: jfid, - userNumber: searchParams.userNumber, - time: new Date().getTime(), - }; - - let reqdata = { - params: encrypt(JSON.stringify(params), "5de7e29919fad4d5"), - }; - - let res = await axios - .request({ - baseURL: "https://m.jf.10010.com/", - headers: { - "user-agent": useragent, - Authorization: "Bearer null", - referer: - "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/eggachine/index.html?id=Ac-da377d4512124eb49cc3ea4e0d25e379", - origin: "https://img.jf.10010.com", - "Content-Type": "application/json", - }, - jar: jar1, - url: `/jf-yuech/p/freeLogin`, - method: "post", - data: reqdata, - }) - .catch((err) => console.log(err)); - - result = res.data; - if (result.code !== 0) { - throw new Error(result.message); - } - - let activity = result.data.activity; - let Authorization = result.data.token.access_token; - let freeTimes = activity.freeGameTimes; - let advertTimes = activity.advertLimitNum; + console.log("🔔 开始欢乐摇摇球\n"); + let cookies = await dailyYYQ.getOpenPlatLine(axios, options); + let data = await dailyYYQ.postFreeLoginRock(axios, options, cookies); + await dailyYYQ.postGame(axios, options, cookies, data); + }, + getOpenPlatLine: gameEvents.getOpenPlatLine( + `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://m.jf.10010.com/jf-order/avoidLogin/forActive/stxyndj` + ), + postFreeLoginRock: gameEvents.postFreeLoginRock(referer, "freeLogin"), + postGame: async ( + axios, + options, + // eslint-disable-next-line no-unused-vars + { jfid, searchParams, jar1 }, + { activity, Authorization, freeTimes, advertTimes } + ) => { let times = 5; - // /jf-yuech/api/integralLogs/surplusFreeGame?activityId=Ac-da377d4512124eb49cc3ea4e0d25e379 - do { let orderId = ""; - console.log("第" + times + "次"); - - res = await axios.request({ + console.log( + "已消耗机会", + 1 + 4 - (freeTimes + advertTimes), + "剩余免费机会", + freeTimes, + "看视频广告机会", + advertTimes + ); + + let res = await axios.request({ headers: { Authorization: `Bearer ${Authorization}`, "user-agent": useragent, @@ -182,7 +75,7 @@ let dailyYYQ = { codeId: 945535686, }; - params["sign"] = sign([ + params["sign"] = AES.sign([ params.arguments1, params.arguments2, params.arguments3, @@ -194,7 +87,7 @@ let dailyYYQ = { .digest("hex"); params["arguments4"] = new Date().getTime(); - result = await require("./taskcallback").reward(axios, { + await require("./taskcallback").reward(axios, { ...options, params, jar: jar1, @@ -204,7 +97,7 @@ let dailyYYQ = { } let n = Math.floor(5 * Math.random()); - let i = secretkeyArray(); + let i = AES.secretkeyArray(); let t = { activityId: activity.activityId, @@ -212,8 +105,8 @@ let dailyYYQ = { orderId: orderId, phoneType: "android", }; - params = { - params: encrypt(JSON.stringify(t), i[n]) + n, + let params = { + params: AES.encrypt(JSON.stringify(t), i[n]) + n, parKey: i, }; res = await axios.request({ @@ -228,7 +121,7 @@ let dailyYYQ = { method: "post", data: params, }); - result = res.data; + let result = res.data; if (result.code !== 0) { console.log("快乐摇摇球:", result.message); } else { @@ -248,6 +141,7 @@ let dailyYYQ = { } console.log("等待15秒再继续"); + // eslint-disable-next-line no-unused-vars await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); } while (--times); }, @@ -261,7 +155,7 @@ let dailyYYQ = { netWay: "Wifi", version: `android@8.0100`, }; - params["sign"] = sign([ + params["sign"] = AES.sign([ params.arguments1, params.arguments2, params.arguments3, @@ -294,7 +188,7 @@ let dailyYYQ = { version: `android@8.0100`, codeId: 945535686, }; - params["sign"] = sign([ + params["sign"] = AES.sign([ params.arguments1, params.arguments2, params.arguments3, @@ -319,7 +213,7 @@ let dailyYYQ = { url: `https://m.jf.10010.com/jf-yuech/api/gameResult/doublingIntegral?activityId=${activityId}&winningRecordId=${winningRecordId}`, method: "get", }); - result = res.data; + let result = res.data; if (result.code !== 0) { console.log("签到小游戏买扭蛋机2翻倍结果:", result.message); } else { diff --git a/commands/tasks/unicom/handlers/dailyEvent.js b/commands/tasks/unicom/handlers/dailyEvent.js index 562c8ed78..6f35fbbbd 100644 --- a/commands/tasks/unicom/handlers/dailyEvent.js +++ b/commands/tasks/unicom/handlers/dailyEvent.js @@ -52,7 +52,7 @@ let getOpenPlatLine = (url) => { /** * @param {String} referer request referer absolute path */ -let postFreeLoginRock = (referer) => { +let postFreeLoginRock = (referer, freeLoginRock = "freeLoginRock") => { return async (axios, options, { jfid, searchParams, jar1 }) => { let keyArr = AES.secretkeyArray(); let keyrdm = Math.floor(Math.random() * 5); @@ -77,7 +77,7 @@ let postFreeLoginRock = (referer) => { "Content-Type": "application/json", }, jar: jar1, - url: `/jf-yuech/p/freeLoginRock`, + url: `/jf-yuech/p/${freeLoginRock}`, method: "post", data: reqdata, }) @@ -87,10 +87,25 @@ let postFreeLoginRock = (referer) => { if (result.code !== 0) { throw new Error(result.message); } - let activity = result.data.activityInfos.activityVOs[0]; //available items on the list from request - let Authorization = result.data.token.access_token; - let freeTimes = activity.activityTimesInfo.freeTimes; - let advertTimes = activity.activityTimesInfo.advertTimes; + + let activity, Authorization, freeTimes, advertTimes; + switch (freeLoginRock) { + case "freeLogin": + activity = result.data.activity; + Authorization = result.data.token.access_token; + freeTimes = activity.freeGameTimes; + advertTimes = activity.advertLimitNum; + break; + case "freeLoginRock": + activity = result.data.activityInfos.activityVOs[0]; //available items on the list from request + Authorization = result.data.token.access_token; + freeTimes = activity.activityTimesInfo.freeTimes; + advertTimes = activity.activityTimesInfo.advertTimes; + break; + default: + throw new Error("new function got!!!"); + } + return { activity, Authorization, freeTimes, advertTimes }; }; }; diff --git a/commands/tasks/unicom/unicom.js b/commands/tasks/unicom/unicom.js index 28ed68dca..a5d02ec18 100644 --- a/commands/tasks/unicom/unicom.js +++ b/commands/tasks/unicom/unicom.js @@ -183,14 +183,14 @@ var start = async (params) => { taskOption ); - // 首页-签到有礼-免费抽-拿iPhone12(摇一摇) - await scheduler.regTask( - "dailyYYQ", - async (request) => { - await require("./dailyYYQ").doTask(request, options); - }, - taskOption - ); + // 首页-签到有礼-免费抽-拿iPhone12(摇一摇) TODO: 待上线 + // await scheduler.regTask( + // "dailyYYQ", + // async (request) => { + // await require("./dailyYYQ").doTask(request, options); + // }, + // taskOption + // ); // 首页-签到有礼-免费抽-赢Apple Watch(去抽奖) await scheduler.regTask( From f384f33375ee5ea859ae9fb7f3c3d027370e5541 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Tue, 9 Feb 2021 02:06:35 +0800 Subject: [PATCH 019/128] =?UTF-8?q?=F0=9F=9A=A7=20updating=20some=20files.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/bcow.js | 15 +-- commands/tasks/unicom/dailyYYQ.js | 38 ++++--- commands/tasks/unicom/dailyYYY.js | 10 +- commands/tasks/unicom/handlers/dailyEvent.js | 101 ++++++++++++++----- 4 files changed, 101 insertions(+), 63 deletions(-) diff --git a/commands/tasks/unicom/bcow.js b/commands/tasks/unicom/bcow.js index 9e0aed4c4..22c0f7bc2 100644 --- a/commands/tasks/unicom/bcow.js +++ b/commands/tasks/unicom/bcow.js @@ -19,7 +19,7 @@ module.exports = bcow = { getOpenPlatLine: gameEvents.getOpenPlatLine( `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://m.jf.10010.com/jf-order/avoidLogin/forActive/ncow&duanlianjieabc=tbLlf` ), - postFreeLoginRock: gameEvents.postFreeLoginRock(referer), + postFreeLoginRock: gameEvents.postFreeLoginRock(referer, "Ac-yccnk"), postTimesDrawForPrize: async ( axios, options, @@ -29,7 +29,6 @@ module.exports = bcow = { ) => { do { let orderId = ""; - console.log( "已消耗机会", 1 + 4 - (freeTimes + advertTimes), @@ -101,29 +100,23 @@ module.exports = bcow = { method: "GET", }); + orderId = params["orderId"]; p1 = { activityId: activity.activityId, currentTimes: advertTimes, type: "广告", - orderId: params["orderId"], + orderId: orderId, phoneType: "android", version: "8.0102", }; advertTimes--; // eslint-disable-next-line no-unused-vars - orderId = params["orderId"]; } else { freeTimes--; } //join the game - let n = Math.floor(5 * Math.random()); - let i = AES.newjiamarr(); - let params = { - params: AES.encrypt(JSON.stringify(p1), i["zfc"]) + n, - parKey: i["arr"], - }; - + let params = gameEvents.encodeParams(p1, true); let res = await axios .request({ baseURL: "https://m.jf.10010.com/", diff --git a/commands/tasks/unicom/dailyYYQ.js b/commands/tasks/unicom/dailyYYQ.js index 2338fca83..32e95cfbe 100644 --- a/commands/tasks/unicom/dailyYYQ.js +++ b/commands/tasks/unicom/dailyYYQ.js @@ -14,13 +14,16 @@ let dailyYYQ = { doTask: async (axios, options) => { console.log("🔔 开始欢乐摇摇球\n"); let cookies = await dailyYYQ.getOpenPlatLine(axios, options); - let data = await dailyYYQ.postFreeLoginRock(axios, options, cookies); + let data = await dailyYYQ.postFreeLogin(axios, options, cookies); await dailyYYQ.postGame(axios, options, cookies, data); }, getOpenPlatLine: gameEvents.getOpenPlatLine( `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://m.jf.10010.com/jf-order/avoidLogin/forActive/stxyndj` ), - postFreeLoginRock: gameEvents.postFreeLoginRock(referer, "freeLogin"), + postFreeLogin: gameEvents.postFreeLogin( + referer, + "Ac-da377d4512124eb49cc3ea4e0d25e379" + ), postGame: async ( axios, options, @@ -41,10 +44,11 @@ let dailyYYQ = { advertTimes ); + //广告试听 let res = await axios.request({ headers: { Authorization: `Bearer ${Authorization}`, - "user-agent": useragent, + "user-agent": useragent(options), referer: "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/eggachine/index.html?id=" + activity.activityId, @@ -55,7 +59,7 @@ let dailyYYQ = { }); if (res.data.code !== 0) { - console.log("签到小游戏买扭蛋机2: " + res.data.message); + console.log("签到小游戏视频买扭蛋机: " + res.data.message); break; } @@ -71,7 +75,7 @@ let dailyYYQ = { arguments9: "", netWay: "Wifi", remark: "签到小游戏买扭蛋机2", - version: `android@8.0100`, + version: `android@8.0102`, codeId: 945535686, }; @@ -96,38 +100,33 @@ let dailyYYQ = { orderId = params["orderId"]; } - let n = Math.floor(5 * Math.random()); - let i = AES.secretkeyArray(); - + //join the game let t = { activityId: activity.activityId, - version: 8.01, + version: 8.0102, orderId: orderId, phoneType: "android", }; - let params = { - params: AES.encrypt(JSON.stringify(t), i[n]) + n, - parKey: i, - }; + let params = gameEvents.encodeParams(t, true); res = await axios.request({ headers: { Authorization: `Bearer ${Authorization}`, - "user-agent": useragent, + "user-agent": useragent(options), referer: "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/eggachine/index.html?id=Ac-da377d4512124eb49cc3ea4e0d25e379", origin: "https://img.jf.10010.com", }, - url: `https://m.jf.10010.com/jf-yuech/api/gameResult/advertLuckDraw`, + url: `https://m.jf.10010.com/jf-yuech/api/gameResult/twisingLuckDraw`, method: "post", data: params, }); let result = res.data; if (result.code !== 0) { - console.log("快乐摇摇球:", result.message); + console.log("❌ 快乐摇摇球:", result.message); } else { - console.log("快乐摇摇球:", result.data.prizeName); + console.log("🎉 快乐摇摇球:", result.data.prizeName); if (result.data.doublingStatus) { - console.log("提交积分翻倍"); + console.log("🎉 提交积分翻倍"); await dailyYYQ.lookVideoDouble(axios, { ...options, }); @@ -202,11 +201,10 @@ let dailyYYQ = { }, lookVideoDoubleResult: async (axios, options) => { let { Authorization, activityId, winningRecordId } = options; - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; let res = await axios.request({ headers: { Authorization: `Bearer ${Authorization}`, - "user-agent": useragent, + "user-agent": useragent(options), referer: "https://img.jf.10010.com/", origin: "https://img.jf.10010.com", }, diff --git a/commands/tasks/unicom/dailyYYY.js b/commands/tasks/unicom/dailyYYY.js index dafc44661..2ca56e7f7 100644 --- a/commands/tasks/unicom/dailyYYY.js +++ b/commands/tasks/unicom/dailyYYY.js @@ -232,27 +232,23 @@ var dailyYYY = { method: "GET", }); + orderId = params["orderId"]; p1 = { activityId: activity.activityId, currentTimes: advertTimes, type: "广告", - orderId: params["orderId"], + orderId: orderId, phoneType: "android", version: "8.0102", }; advertTimes--; - - orderId = params["orderId"]; } else { freeTimes--; } let n = Math.floor(5 * Math.random()); let i = newjiamarr(); - params = { - params: encrypt(JSON.stringify(p1), i["zfc"]) + n, - parKey: i["arr"], - }; + params = gameEvents.encodeParams(t, true); res = await axios .request({ diff --git a/commands/tasks/unicom/handlers/dailyEvent.js b/commands/tasks/unicom/handlers/dailyEvent.js index 6f35fbbbd..c2dcbe5d7 100644 --- a/commands/tasks/unicom/handlers/dailyEvent.js +++ b/commands/tasks/unicom/handlers/dailyEvent.js @@ -52,20 +52,15 @@ let getOpenPlatLine = (url) => { /** * @param {String} referer request referer absolute path */ -let postFreeLoginRock = (referer, freeLoginRock = "freeLoginRock") => { +let postFreeLoginRock = (referer, freeLoginRockID) => { return async (axios, options, { jfid, searchParams, jar1 }) => { - let keyArr = AES.secretkeyArray(); - let keyrdm = Math.floor(Math.random() * 5); let params = { - activityId: "Ac-yccnk", + activityId: freeLoginRockID, userCookie: jfid, userNumber: searchParams.userNumber, time: new Date().getTime(), }; - let reqdata = { - params: AES.encrypt(JSON.stringify(params), keyArr[keyrdm]) + keyrdm, - parKey: keyArr, - }; + let reqdata = encodeParams(params, false); //foods list let res = await axios .request({ @@ -77,7 +72,7 @@ let postFreeLoginRock = (referer, freeLoginRock = "freeLoginRock") => { "Content-Type": "application/json", }, jar: jar1, - url: `/jf-yuech/p/${freeLoginRock}`, + url: `/jf-yuech/p/freeLoginRock`, method: "post", data: reqdata, }) @@ -89,23 +84,52 @@ let postFreeLoginRock = (referer, freeLoginRock = "freeLoginRock") => { } let activity, Authorization, freeTimes, advertTimes; - switch (freeLoginRock) { - case "freeLogin": - activity = result.data.activity; - Authorization = result.data.token.access_token; - freeTimes = activity.freeGameTimes; - advertTimes = activity.advertLimitNum; - break; - case "freeLoginRock": - activity = result.data.activityInfos.activityVOs[0]; //available items on the list from request - Authorization = result.data.token.access_token; - freeTimes = activity.activityTimesInfo.freeTimes; - advertTimes = activity.activityTimesInfo.advertTimes; - break; - default: - throw new Error("new function got!!!"); - } + activity = result.data.activityInfos.activityVOs[0]; //available items on the list from request + Authorization = result.data.token.access_token; + freeTimes = activity.activityTimesInfo.freeTimes; + advertTimes = activity.activityTimesInfo.advertTimes; + + return { activity, Authorization, freeTimes, advertTimes }; + }; +}; + +let postFreeLogin = (referer, freeLoginID) => { + return async (axios, options, { jfid, searchParams, jar1 }) => { + let params = { + activityId: freeLoginID, + userCookie: jfid, + userNumber: searchParams.userNumber, + time: new Date().getTime(), + }; + let reqdata = { + params: AES.encrypt(JSON.stringify(params), "5de7e29919fad4d5"), + }; + let res = await axios + .request({ + baseURL: "https://m.jf.10010.com/", + headers: { + "user-agent": useragent(options), + Authorization: "Bearer null", + referer, + origin: "https://img.jf.10010.com", + "Content-Type": "application/json", + }, + jar: jar1, + url: `/jf-yuech/p/freeLogin`, + method: "post", + data: reqdata, + }) + .catch((err) => console.log(err)); + let result = res.data; + if (result.code !== 0) { + throw new Error(result.message); + } + let activity, Authorization, freeTimes, advertTimes; + activity = result.data.activity; + Authorization = result.data.token.access_token; + freeTimes = activity.freeGameTimes; + advertTimes = activity.advertLimitNum; return { activity, Authorization, freeTimes, advertTimes }; }; }; @@ -131,8 +155,35 @@ let lookVideoDoubleResult = (title) => { } }; }; + +/** + * + * @param {JSON} p1 提交参数 + * @param {boolean} isNewGame 新游戏更新后的参数方法 + */ +let encodeParams = (p1, isNewGame = false) => { + let n = Math.floor(5 * Math.random()); + let params; + if (isNewGame) { + //join the game + let i = AES.newjiamarr(); + params = { + params: AES.encrypt(JSON.stringify(p1), i["zfc"]) + n, + parKey: i["arr"], + }; + } else { + let i = AES.secretkeyArray(); + params = { + params: AES.encrypt(JSON.stringify(p1), i[n]) + n, + parKey: i, + }; + return params; + } +}; module.exports = { getOpenPlatLine, postFreeLoginRock, + postFreeLogin, lookVideoDoubleResult, + encodeParams, }; From f4e5def242038f38f7179c3d406e459f127c307f Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Tue, 9 Feb 2021 08:10:41 +0800 Subject: [PATCH 020/128] =?UTF-8?q?=F0=9F=90=8D=20fixed=20YYQ?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/dailyYYQ.js | 3 +-- commands/tasks/unicom/handlers/dailyEvent.js | 6 ++---- commands/tasks/unicom/unicom.js | 14 +++++++------- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/commands/tasks/unicom/dailyYYQ.js b/commands/tasks/unicom/dailyYYQ.js index 32e95cfbe..56896227d 100644 --- a/commands/tasks/unicom/dailyYYQ.js +++ b/commands/tasks/unicom/dailyYYQ.js @@ -99,7 +99,6 @@ let dailyYYQ = { orderId = params["orderId"]; } - //join the game let t = { activityId: activity.activityId, @@ -114,7 +113,7 @@ let dailyYYQ = { "user-agent": useragent(options), referer: "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/eggachine/index.html?id=Ac-da377d4512124eb49cc3ea4e0d25e379", - origin: "https://img.jf.10010.com", + origin: "https://m.jf.10010.com", }, url: `https://m.jf.10010.com/jf-yuech/api/gameResult/twisingLuckDraw`, method: "post", diff --git a/commands/tasks/unicom/handlers/dailyEvent.js b/commands/tasks/unicom/handlers/dailyEvent.js index c2dcbe5d7..5b6223f79 100644 --- a/commands/tasks/unicom/handlers/dailyEvent.js +++ b/commands/tasks/unicom/handlers/dailyEvent.js @@ -163,21 +163,19 @@ let lookVideoDoubleResult = (title) => { */ let encodeParams = (p1, isNewGame = false) => { let n = Math.floor(5 * Math.random()); - let params; if (isNewGame) { //join the game let i = AES.newjiamarr(); - params = { + return { params: AES.encrypt(JSON.stringify(p1), i["zfc"]) + n, parKey: i["arr"], }; } else { let i = AES.secretkeyArray(); - params = { + return { params: AES.encrypt(JSON.stringify(p1), i[n]) + n, parKey: i, }; - return params; } }; module.exports = { diff --git a/commands/tasks/unicom/unicom.js b/commands/tasks/unicom/unicom.js index a5d02ec18..5d91e05c2 100644 --- a/commands/tasks/unicom/unicom.js +++ b/commands/tasks/unicom/unicom.js @@ -184,13 +184,13 @@ var start = async (params) => { ); // 首页-签到有礼-免费抽-拿iPhone12(摇一摇) TODO: 待上线 - // await scheduler.regTask( - // "dailyYYQ", - // async (request) => { - // await require("./dailyYYQ").doTask(request, options); - // }, - // taskOption - // ); + await scheduler.regTask( + "dailyYYQ", + async (request) => { + await require("./dailyYYQ").doTask(request, options); + }, + taskOption + ); // 首页-签到有礼-免费抽-赢Apple Watch(去抽奖) await scheduler.regTask( From 54c527dfa2a2dd7a3cb4a1d76bb3cc97b2b92206 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Tue, 9 Feb 2021 08:24:30 +0800 Subject: [PATCH 021/128] =?UTF-8?q?=20=F0=9F=90=8D=20fixed=20LKMH?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/dailyLKMH.js | 389 ++++++++++++++++------------- 1 file changed, 211 insertions(+), 178 deletions(-) diff --git a/commands/tasks/unicom/dailyLKMH.js b/commands/tasks/unicom/dailyLKMH.js index 1ac82efae..18c930b7e 100644 --- a/commands/tasks/unicom/dailyLKMH.js +++ b/commands/tasks/unicom/dailyLKMH.js @@ -1,27 +1,39 @@ -var crypto = require('crypto'); +var crypto = require("crypto"); var CryptoJS = require("crypto-js"); +// let AES = require("./handlers/PAES.js"); +// const useragent = require("./handlers/myPhone").useragent; +const gameEvents = require("./handlers/dailyEvent"); + +/** + * 乐开盲盒 + * 入口:首页-签到有礼-免费抽-拆华为Pad(去抽奖) + * + */ -// 乐开盲盒 var transParams = (data) => { let params = new URLSearchParams(); for (let item in data) { - params.append(item, data['' + item + '']); + params.append(item, data["" + item + ""]); } return params; }; var sign = (data) => { - let str = 'integralofficial&' - let params = [] + let str = "integralofficial&"; + let params = []; data.forEach((v, i) => { if (v) { - params.push('arguments' + (i + 1) + v) + params.push("arguments" + (i + 1) + v); } }); - return crypto.createHash('md5').update(str + params.join('&')).digest('hex') -} + return crypto + .createHash("md5") + .update(str + params.join("&")) + .digest("hex"); +}; var secretkeyArray = function () { + // prettier-ignore for (var e = [], t = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", @@ -35,266 +47,287 @@ var secretkeyArray = function () { e.push(n) } return e; -} +}; var encrypt = function (word, keyStr) { var key = CryptoJS.enc.Utf8.parse(keyStr); var srcs = CryptoJS.enc.Utf8.parse(word); var encrypted = CryptoJS.AES.encrypt(srcs, key, { mode: CryptoJS.mode.ECB, - padding: CryptoJS.pad.Pkcs7 + padding: CryptoJS.pad.Pkcs7, }); return encrypted.toString(); -} +}; var decrypt = function (word, keyStr) { var key = CryptoJS.enc.Utf8.parse(keyStr); var decrypted = CryptoJS.AES.decrypt(word, key, { mode: CryptoJS.mode.ECB, - padding: CryptoJS.pad.Pkcs7 + padding: CryptoJS.pad.Pkcs7, }); return decrypted.toString(CryptoJS.enc.Utf8); -} - - +}; var dailyLKMH = { doTask: async (axios, options) => { - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}` - let searchParams = {} - let result = await axios.request({ - baseURL: 'https://m.client.10010.com/', - headers: { - "user-agent": useragent, - "referer": `https://img.client.10010.com/`, - "origin": "https://img.client.10010.com" - }, - url: `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://m.jf.10010.com/jf-order/avoidLogin/forActive/lkmh&duanlianjieabc=tbkBl`, - method: 'GET', - transformResponse: (data, headers) => { - if ('location' in headers) { - let uu = new URL(headers.location) - let pp = {} - for (let p of uu.searchParams) { - pp[p[0]] = p[1] - } - if ('ticket' in pp) { - searchParams = pp + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; + let searchParams = {}; + let result = await axios + .request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": useragent, + referer: `https://img.client.10010.com/`, + origin: "https://img.client.10010.com", + }, + url: `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://m.jf.10010.com/jf-order/avoidLogin/forActive/lkmh&duanlianjieabc=tbkBl`, + method: "GET", + transformResponse: (data, headers) => { + if ("location" in headers) { + let uu = new URL(headers.location); + let pp = {}; + for (let p of uu.searchParams) { + pp[p[0]] = p[1]; + } + if ("ticket" in pp) { + searchParams = pp; + } } - } - return data - } - }).catch(err => console.log(err)) - let jar1 = result.config.jar + return data; + }, + }) + .catch((err) => console.log(err)); + let jar1 = result.config.jar; - let cookiesJson = jar1.toJSON() - let ecs_token = cookiesJson.cookies.find(i => i.key == 'ecs_token') - ecs_token = ecs_token.value + let cookiesJson = jar1.toJSON(); + let ecs_token = cookiesJson.cookies.find((i) => i.key == "ecs_token"); + ecs_token = ecs_token.value; if (!ecs_token) { - throw new Error('ecs_token缺失') + throw new Error("ecs_token缺失"); } - let jfid = cookiesJson.cookies.find(i => i.key == '_jf_id') - jfid = jfid.value + let jfid = cookiesJson.cookies.find((i) => i.key == "_jf_id"); + jfid = jfid.value; - let keyArr = secretkeyArray() - let keyrdm = Math.floor(Math.random() * 5) + let keyArr = secretkeyArray(); + let keyrdm = Math.floor(Math.random() * 5); let params = { activityId: "Ac-f4557b3ac6004a48b1187e32ea343ca8", userCookie: jfid, userNumber: searchParams.userNumber, - time: new Date().getTime() + time: new Date().getTime(), }; let reqdata = { - params: encrypt(JSON.stringify(params), "5de7e29919fad4d5") - } + params: encrypt(JSON.stringify(params), "5de7e29919fad4d5"), + }; - let res = await axios.request({ - baseURL: 'https://m.jf.10010.com/', - headers: { - "user-agent": useragent, - "Authorization": "Bearer null", - "referer": "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/eggachine/index.html?id=Ac-f4557b3ac6004a48b1187e32ea343ca8&jump=sign", - "origin": "https://img.jf.10010.com", - "Content-Type": "application/json" - }, - jar: jar1, - url: `/jf-yuech/p/freeLogin`, - method: 'post', - data: reqdata - }).catch(err => console.log(err)) + let res = await axios + .request({ + baseURL: "https://m.jf.10010.com/", + headers: { + "user-agent": useragent, + Authorization: "Bearer null", + referer: + "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/eggachine/index.html?id=Ac-f4557b3ac6004a48b1187e32ea343ca8&jump=sign", + origin: "https://img.jf.10010.com", + "Content-Type": "application/json", + }, + jar: jar1, + url: `/jf-yuech/p/freeLogin`, + method: "post", + data: reqdata, + }) + .catch((err) => console.log(err)); - result = res.data + result = res.data; if (result.code !== 0) { - throw new Error(result.message) + throw new Error(result.message); } - let activity = result.data.activity - let Authorization = result.data.token.access_token - let times = 3 + let activity = result.data.activity; + let Authorization = result.data.token.access_token; + let times = 3; do { - let orderId = '' - console.log("第" + times + "次") + let orderId = ""; + console.log("第" + times + "次"); res = await axios.request({ headers: { - "Authorization": `Bearer ${Authorization}`, + Authorization: `Bearer ${Authorization}`, "user-agent": useragent, - "referer": "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/eggachine/index.html?id=" + activity.activityId, - "origin": "https://img.jf.10010.com" + referer: + "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/eggachine/index.html?id=" + + activity.activityId, + origin: "https://img.jf.10010.com", }, url: `https://m.jf.10010.com/jf-yuech/api/gameResult/advertFreeGame?activityId=${activity.activityId}`, - method: 'get' - }) + method: "get", + }); if (res.data.code !== 0) { - console.log('签到小游戏盲盒: ' + res.data.message) - break + console.log("签到小游戏盲盒: " + res.data.message); + break; } if (times < 3) { - let params = { - 'arguments1': 'AC20200611152252', - 'arguments2': '', - 'arguments3': '', - 'arguments4': new Date().getTime(), - 'arguments6': '', - 'arguments7': '', - 'arguments8': '', - 'arguments9': '', - 'netWay': 'Wifi', - 'remark': '签到小游戏翻倍得积分', - 'remark1': '签到小游戏盲盒', - 'version': `android@8.0100`, - 'codeId': 945535633 - } + arguments1: "AC20200611152252", + arguments2: "", + arguments3: "", + arguments4: new Date().getTime(), + arguments6: "", + arguments7: "", + arguments8: "", + arguments9: "", + netWay: "Wifi", + remark: "签到小游戏翻倍得积分", + remark1: "签到小游戏盲盒", + version: `android@8.0100`, + codeId: 945535633, + }; - params['sign'] = sign([params.arguments1, params.arguments2, params.arguments3, params.arguments4]) - params['orderId'] = crypto.createHash('md5').update(new Date().getTime() + '').digest('hex') - params['arguments4'] = new Date().getTime() + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + params["orderId"] = crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"); + params["arguments4"] = new Date().getTime(); - result = await require('./taskcallback').reward(axios, { + result = await require("./taskcallback").reward(axios, { ...options, params, - jar: jar1 - }) + jar: jar1, + }); - orderId = params['orderId'] + orderId = params["orderId"]; } - let n = Math.floor(5 * Math.random()) - let i = secretkeyArray() - + //join the game let t = { - "activityId": activity.activityId, - "version": 8.01, - "orderId": orderId, - "phoneType": "android" - } - params = { - "params": encrypt(JSON.stringify(t), i[n]) + n, - "parKey": i - } + activityId: activity.activityId, + version: 8.0102, + orderId: orderId, + phoneType: "android", + }; + let params = gameEvents.encodeParams(t, true); res = await axios.request({ headers: { - "Authorization": `Bearer ${Authorization}`, + Authorization: `Bearer ${Authorization}`, "user-agent": useragent, - "referer": "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/eggachine/index.html?id=" + activity.activityId, - "origin": "https://img.jf.10010.com" + referer: + "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/eggachine/index.html?id=" + + activity.activityId, + origin: "https://m.jf.10010.com", }, - url: `https://m.jf.10010.com/jf-yuech/api/gameResult/advertLuckDraw`, - method: 'post', - data: params - }) - result = res.data + url: `https://m.jf.10010.com/jf-yuech/api/gameResult/twisingLuckDraw`, + method: "post", + data: params, + }); + result = res.data; if (result.code !== 0) { - console.log("乐开盲盒:", result.message) + console.log("❌ 乐开盲盒:", result.message); } else { - console.log('乐开盲盒:', result.data.prizeName) + console.log("🎉 乐开盲盒:", result.data.prizeName); if (result.data.doublingStatus) { - console.log('提交积分翻倍') + console.log("🎉 提交积分翻倍"); await dailyLKMH.lookVideoDouble(axios, { - ...options - }) + ...options, + }); await dailyLKMH.lookVideoDoubleResult(axios, { ...options, Authorization, activityId: activity.activityId, - winningRecordId: result.data.winningRecordId - }) + winningRecordId: result.data.winningRecordId, + }); } } - console.log('等待15秒再继续') - await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)) - - } while (--times) + console.log("等待15秒再继续"); + await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); + } while (--times); }, lookVideoDouble: async (axios, options) => { let params = { - 'arguments1': 'AC20200611152252', // acid - 'arguments2': 'GGPD', // yhChannel - 'arguments3': '627292f1243148159c58fd58917c3e67', // yhTaskId menuId - 'arguments4': new Date().getTime(), // time - 'arguments6': '517050707', - 'netWay': 'Wifi', - 'version': `android@8.0100` - } - params['sign'] = sign([params.arguments1, params.arguments2, params.arguments3, params.arguments4]) - let { num, jar } = await require('./taskcallback').query(axios, { + arguments1: "AC20200611152252", // acid + arguments2: "GGPD", // yhChannel + arguments3: "627292f1243148159c58fd58917c3e67", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "517050707", + netWay: "Wifi", + version: `android@8.0100`, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + let { num, jar } = await require("./taskcallback").query(axios, { ...options, - params - }) + params, + }); if (!num) { - console.log('签到小游戏盲盒: 今日已完成') - return + console.log("签到小游戏盲盒: 今日已完成"); + return; } params = { - 'arguments1': 'AC20200611152252', // acid - 'arguments2': 'GGPD', // yhChannel - 'arguments3': '627292f1243148159c58fd58917c3e67', // yhTaskId menuId - 'arguments4': new Date().getTime(), // time - 'arguments6': '', - 'arguments7': '', - 'arguments8': '', - 'arguments9': '', - 'orderId': crypto.createHash('md5').update(new Date().getTime() + '').digest('hex'), - 'netWay': 'Wifi', - 'remark': '签到小游戏翻倍得积分', - 'remark1': '签到小游戏盲盒', - 'version': `android@8.0100`, - 'codeId': 945535633 - } - params['sign'] = sign([params.arguments1, params.arguments2, params.arguments3, params.arguments4]) - await require('./taskcallback').doTask(axios, { + arguments1: "AC20200611152252", // acid + arguments2: "GGPD", // yhChannel + arguments3: "627292f1243148159c58fd58917c3e67", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "", + arguments7: "", + arguments8: "", + arguments9: "", + orderId: crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"), + netWay: "Wifi", + remark: "签到小游戏翻倍得积分", + remark1: "签到小游戏盲盒", + version: `android@8.0100`, + codeId: 945535633, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + await require("./taskcallback").doTask(axios, { ...options, params, - jar - }) + jar, + }); }, lookVideoDoubleResult: async (axios, options) => { - let { Authorization, activityId, winningRecordId } = options - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}` + let { Authorization, activityId, winningRecordId } = options; + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; let res = await axios.request({ headers: { - "Authorization": `Bearer ${Authorization}`, + Authorization: `Bearer ${Authorization}`, "user-agent": useragent, - "referer": "https://img.jf.10010.com/", - "origin": "https://img.jf.10010.com" + referer: "https://img.jf.10010.com/", + origin: "https://img.jf.10010.com", }, url: `https://m.jf.10010.com/jf-yuech/api/gameResult/doublingIntegral?activityId=${activityId}&winningRecordId=${winningRecordId}`, - method: 'get' - }) - result = res.data + method: "get", + }); + result = res.data; if (result.code !== 0) { - console.log("签到小游戏盲盒翻倍结果:", result.message) + console.log("签到小游戏盲盒翻倍结果:", result.message); } else { - console.log("签到小游戏盲盒翻倍结果:", result.data) + console.log("签到小游戏盲盒翻倍结果:", result.data); } - } -} + }, +}; -module.exports = dailyLKMH \ No newline at end of file +module.exports = dailyLKMH; From 8104fe400917581549ed4fce0755da3e03d165fb Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Tue, 9 Feb 2021 13:58:49 +0800 Subject: [PATCH 022/128] fixed some bugs --- .eslintrc.js | 4 +- .github/workflows/daily-task.yml | 115 ---------------------- .prettierrc | 7 ++ AutoSignMachine.js | 21 ++-- commands/tasks/unicom/dailyYYY.js | 25 +---- commands/tasks/unicom/handlers/myPhone.js | 27 +++-- package-lock.json | 36 +++++++ package.json | 3 + tscf.js | 22 ++--- 9 files changed, 90 insertions(+), 170 deletions(-) delete mode 100644 .github/workflows/daily-task.yml create mode 100644 .prettierrc diff --git a/.eslintrc.js b/.eslintrc.js index c0f9a6371..a3ee90afa 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,10 +1,10 @@ module.exports = { env: { - browser: true, + node: true, commonjs: true, es2021: true, }, - extends: "eslint:recommended", + extends: ["eslint:recommended", "plugin:prettier/recommended"], parserOptions: { ecmaVersion: 12, }, diff --git a/.github/workflows/daily-task.yml b/.github/workflows/daily-task.yml deleted file mode 100644 index 66554b3af..000000000 --- a/.github/workflows/daily-task.yml +++ /dev/null @@ -1,115 +0,0 @@ -name: daily-task - - -on: - - push: # push触发 - branches: [ main ] - workflow_dispatch: # 手动触发 - schedule: # 计划任务触发 - - cron: '*/30 20-23,0-15 * * *' # cron表达式,Actions时区是UTC时间,所以要往前推8个小时(4-23) - - -jobs: - daily-task: - if: github.event.repository.owner.id == github.event.sender.id - - env: - ENABLE_52POJIE: ${{secrets.ENABLE_52POJIE}} - ENABLE_BILIBILI: ${{secrets.ENABLE_BILIBILI}} - ENABLE_IQIYI: ${{secrets.ENABLE_IQIYI}} - ENABLE_UNICOM: ${{secrets.ENABLE_UNICOM}} - - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [12] - node-registry: ['https://registry.npmjs.org'] - - steps: - - # 检出 - - name: Checkout - uses: actions/checkout@v2 - - # 设置服务器时区为东八区 - - name: Set time zone - run: sudo timedatectl set-timezone 'Asia/Shanghai' - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - registry-url: ${{ matrix.node-registry }} - - - name: Get npm cache directory - id: npm-cache - run: | - echo "::set-output name=dir::$(npm config get cache)" - - - name: restore npm cache - uses: actions/cache@v2 - id: use-npm-cache - with: - path: ${{ steps.npm-cache.outputs.dir }} - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - - - name: restore npm dependencies - uses: actions/cache@v2 - id: use-npm-depends - with: - path: | - node_modules - */*/node_modules - key: ${{ runner.os }}-depends-${{ hashFiles('**/package-lock.json') }} - - - name: restore task cache - uses: actions/cache@v2 - id: use-task-cache - with: - path: | - /home/runner/.AutoSignMachine - key: ${{ runner.os }}-task-${{ hashFiles('**/package-lock.json') }} - - - name: Install dependencies - if: steps.use-npm-cache.outputs.cache-hit != 'true' || steps.use-npm-depends.outputs.cache-hit != 'true' - run: npm install - - # 运行 52pojie 签到任务 - - name: Run 52pojie daily task - if: ${{ env.ENABLE_52POJIE }} - env: - htVD_2132_auth: ${{secrets.pojie_htVD_2132_auth}} - htVD_2132_saltkey: ${{secrets.pojie_htVD_2132_saltkey}} - run: node index.js 52pojie --htVD_2132_auth=${htVD_2132_auth} --htVD_2132_saltkey=${htVD_2132_saltkey} - - # 运行 bilibili 签到任务 - - name: Run bilibili daily task - if: ${{ env.ENABLE_BILIBILI }} - env: - DedeUserID: ${{secrets.bilibili_USERID}} - SESSDATA: ${{secrets.bilibili_SESSDATA}} - bili_jct: ${{secrets.bilibili_BILIJCT}} - otherConfigs: ${{secrets.bilibili_OTHERCONFIGS}} - run: node index.js bilibili --DedeUserID=${DedeUserID} --SESSDATA=${SESSDATA} --bili_jct=${bili_jct} ${otherConfigs} - - # 运行 iqiyi 签到任务 - - name: Run iqiyi daily task - if: ${{ env.ENABLE_IQIYI }} - env: - P00001: ${{secrets.iqiyi_P00001}} - P00PRU: ${{secrets.iqiyi_P00PRU}} - QC005: ${{secrets.iqiyi_QC005}} - dfp: ${{secrets.iqiyi_DFP}} - run: node index.js iqiyi --P00001=${P00001} --P00PRU=${P00PRU} --QC005=${QC005} --dfp=${dfp} - - # 运行 unicom 签到任务 - - name: Run unicom daily task - if: ${{ env.ENABLE_UNICOM }} - env: - user: ${{secrets.unicom_user}} - password: ${{secrets.unicom_password}} - appid: ${{secrets.unicom_appid}} - run: node index.js unicom --user=${user} --password=${password} --appid=${appid} - diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 000000000..a059c584e --- /dev/null +++ b/.prettierrc @@ -0,0 +1,7 @@ +{ + "trailingComma": "es5", + "tabWidth": 2, + "semi": true, + "singleQuote": false, + "endOfLine": "lf" + } \ No newline at end of file diff --git a/AutoSignMachine.js b/AutoSignMachine.js index 674e3de79..73bddd53b 100644 --- a/AutoSignMachine.js +++ b/AutoSignMachine.js @@ -1,20 +1,19 @@ -const yargs = require('yargs/yargs') +const yargs = require("yargs/yargs"); // const { hideBin } = require('yargs/helpers') /** * 命令执行入口 */ var AutoSignMachine_Run = (argv) => { yargs((argv || process.argv).slice(2)) - .commandDir('commands') + .commandDir("commands") .demand(1) - .config('config', 'JSON配置文件路径') + .config("config", "JSON配置文件路径") .help() - .alias('h', 'help') - .locale('en') - .showHelpOnFail(true, '使用--help查看有效选项') - .epilog('copyright 2020 LunnLew') - .argv; -} + .alias("h", "help") + .locale("en") + .showHelpOnFail(true, "使用--help查看有效选项") + .epilog("copyright 2020 LunnLew").argv; +}; module.exports = { - run: AutoSignMachine_Run -} \ No newline at end of file + run: AutoSignMachine_Run, +}; diff --git a/commands/tasks/unicom/dailyYYY.js b/commands/tasks/unicom/dailyYYY.js index 2ca56e7f7..c0e2ede85 100644 --- a/commands/tasks/unicom/dailyYYY.js +++ b/commands/tasks/unicom/dailyYYY.js @@ -1,16 +1,8 @@ var crypto = require("crypto"); var CryptoJS = require("crypto-js"); var moment = require("moment"); - +const gameEvents = require("./handlers/dailyEvent"); // 摇一摇送好礼 -let transParams = (data) => { - let params = new URLSearchParams(); - for (let item in data) { - params.append(item, data["" + item + ""]); - } - return params; -}; - var sign = (data) => { let str = "integralofficial&"; let params = []; @@ -65,15 +57,6 @@ var encrypt = function (word, keyStr) { return encrypted.toString(); }; -var decrypt = function (word, keyStr) { - var key = CryptoJS.enc.Utf8.parse(keyStr); - var decrypted = CryptoJS.AES.decrypt(word, key, { - mode: CryptoJS.mode.ECB, - padding: CryptoJS.pad.Pkcs7, - }); - return decrypted.toString(CryptoJS.enc.Utf8); -}; - var dailyYYY = { doTask: async (axios, options) => { const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; @@ -165,10 +148,10 @@ var dailyYYY = { do { let orderId = ""; - + let currentTimes = 1 + 4 - (freeTimes + advertTimes) + 1; console.log( "已消耗机会", - 1 + 4 - (freeTimes + advertTimes), + currentTimes, "剩余免费机会", freeTimes, "看视频广告机会", @@ -180,8 +163,6 @@ var dailyYYY = { break; } - let currentTimes = 1 + 4 - (freeTimes + advertTimes) + 1; - let p1 = { activityId: activity.activityId, currentTimes: freeTimes, diff --git a/commands/tasks/unicom/handlers/myPhone.js b/commands/tasks/unicom/handlers/myPhone.js index cbc561294..a5fe84d9d 100644 --- a/commands/tasks/unicom/handlers/myPhone.js +++ b/commands/tasks/unicom/handlers/myPhone.js @@ -1,18 +1,27 @@ -const useragent = (options) => - `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0102,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; +const util = require("util"); + +/** + * pick a random user-agent + * @param {object} options must be included appversion and user + */ +const useragent = (options) => { + return util.format( + USER_AGENTS[randomNumber(0, USER_AGENTS.length)], + options.appversion || "8.0102", + options.user + ); +}; // `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36;devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:};unicom{version:android@8.0102,desmobile:${options.user}}`; -// const USER_AGENTS = [ -// 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 unicom{version:iphone_c@8.0102}{systemVersion:dis}{yw_code:}', -// 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 unicom{version:iphone_c@8.0102}{systemVersion:dis}{yw_code:}' -//]; +const USER_AGENTS = [ + "Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@%s,desmobile:%s;devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}", + "Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 unicom{version:iphone_c@%s,desmobile:%s}{systemVersion:dis}{yw_code:}", + "Mozilla/5.0 (iPhone; CPU iPhone OS 12_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 unicom{version:iphone_c@%s,desmobile:%s}{systemVersion:dis}{yw_code:}", +]; function randomNumber(min = 0, max = 100) { return Math.min(Math.floor(min + Math.random() * (max - min)), max); } -//pick a random user-agent -// const USER_AGENT = USER_AGENTS[randomNumber(0, USER_AGENTS.length)]; - module.exports = { useragent, randomNumber, diff --git a/package-lock.json b/package-lock.json index 03c4f814d..9f633761f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1039,6 +1039,21 @@ } } }, + "eslint-config-prettier": { + "version": "7.2.0", + "resolved": "https://registry.npm.taobao.org/eslint-config-prettier/download/eslint-config-prettier-7.2.0.tgz", + "integrity": "sha1-9KS9KDLoEOjMfBQR7IWz6FwMU/k=", + "dev": true + }, + "eslint-plugin-prettier": { + "version": "3.3.1", + "resolved": "https://registry.npm.taobao.org/eslint-plugin-prettier/download/eslint-plugin-prettier-3.3.1.tgz?cache=0&sync_timestamp=1609800842572&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint-plugin-prettier%2Fdownload%2Feslint-plugin-prettier-3.3.1.tgz", + "integrity": "sha1-cHnPoklweJBQEeb4Lo3YRT0Tcbc=", + "dev": true, + "requires": { + "prettier-linter-helpers": "^1.0.0" + } + }, "eslint-scope": { "version": "5.1.1", "resolved": "https://registry.npm.taobao.org/eslint-scope/download/eslint-scope-5.1.1.tgz?cache=0&sync_timestamp=1599933589759&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint-scope%2Fdownload%2Feslint-scope-5.1.1.tgz", @@ -1166,6 +1181,12 @@ "integrity": "sha1-On1WtVnWy8PrUSMlJE5hmmXGxSU=", "dev": true }, + "fast-diff": { + "version": "1.2.0", + "resolved": "https://registry.npm.taobao.org/fast-diff/download/fast-diff-1.2.0.tgz", + "integrity": "sha1-c+4RmC2Gyq95WYKNUZz+kn+sXwM=", + "dev": true + }, "fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npm.taobao.org/fast-json-stable-stringify/download/fast-json-stable-stringify-2.1.0.tgz", @@ -2241,6 +2262,21 @@ "integrity": "sha1-3rxkidem5rDnYRiIzsiAM30xY5Y=", "dev": true }, + "prettier": { + "version": "2.2.1", + "resolved": "https://registry.npm.taobao.org/prettier/download/prettier-2.2.1.tgz?cache=0&sync_timestamp=1606521409892&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fprettier%2Fdownload%2Fprettier-2.2.1.tgz", + "integrity": "sha1-eVoaeN1S8HPaDNQrIfnJE4GSP/U=", + "dev": true + }, + "prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/prettier-linter-helpers/download/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha1-0j1B/hN1ZG3i0BBNNFSjAIgCz3s=", + "dev": true, + "requires": { + "fast-diff": "^1.1.2" + } + }, "progress": { "version": "2.0.3", "resolved": "https://registry.npm.taobao.org/progress/download/progress-2.0.3.tgz", diff --git a/package.json b/package.json index 9cf9cde5f..5db40ae9b 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,9 @@ }, "devDependencies": { "eslint": "^7.19.0", + "eslint-config-prettier": "^7.2.0", + "eslint-plugin-prettier": "^3.3.1", + "prettier": "2.2.1", "serverless-tencent-scf": "^0.1.7" } } diff --git a/tscf.js b/tscf.js index bc4787e20..4c83c3d3a 100644 --- a/tscf.js +++ b/tscf.js @@ -1,19 +1,19 @@ -'use strict'; +"use strict"; // see https://github.com/serverless/serverless/blob/master/README_CN.md#how-to-install-a-service exports.main_handler = (event, context, callback) => { - let argv = process.argv - argv[2] = process.env.cmd - argv[3] = '--config' - argv[4] = process.env.USER_CODE_ROOT + '/' + process.env.config - argv[5] = '--tasks' - argv[6] = process.env.tasks - console.log(argv.join(' ')) + let argv = process.argv; + argv[2] = process.env.cmd; + argv[3] = "--config"; + argv[4] = process.env.USER_CODE_ROOT + "/" + process.env.config; + argv[5] = "--tasks"; + argv[6] = process.env.tasks; + console.log(argv.join(" ")); if (!process.env.tasks) { - callback(null, '必须单独指定任务'); + callback(null, "必须单独指定任务"); } else { - require('./AutoSignMachine.js').run(argv) - callback(null, '触发任务执行成功'); + require("./AutoSignMachine.js").run(argv); + callback(null, "触发任务执行成功"); } }; From 984bf01468c20dd166d2df2d6ea302c14ca03ef5 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Tue, 9 Feb 2021 14:07:03 +0800 Subject: [PATCH 023/128] fixed bcow --- commands/tasks/unicom/bcow.js | 2 +- commands/tasks/unicom/dailyYYY.js | 3 +- commands/tasks/unicom/handlers/dailyEvent.js | 4 +- commands/tasks/unicom/woTree.js | 300 ++++++++++--------- utils/util.js | 178 ++++++----- 5 files changed, 257 insertions(+), 230 deletions(-) diff --git a/commands/tasks/unicom/bcow.js b/commands/tasks/unicom/bcow.js index 22c0f7bc2..b43138745 100644 --- a/commands/tasks/unicom/bcow.js +++ b/commands/tasks/unicom/bcow.js @@ -147,7 +147,7 @@ module.exports = bcow = { result.data.drawResultPO !== null && result.data.drawResultPO.doublingStatus ) { - console.log("🌈提交积分翻倍"); + console.log("🌈 提交积分翻倍"); await bcow.lookVideoDouble(axios, { ...options, }); diff --git a/commands/tasks/unicom/dailyYYY.js b/commands/tasks/unicom/dailyYYY.js index c0e2ede85..6d8ccbb54 100644 --- a/commands/tasks/unicom/dailyYYY.js +++ b/commands/tasks/unicom/dailyYYY.js @@ -229,8 +229,7 @@ var dailyYYY = { let n = Math.floor(5 * Math.random()); let i = newjiamarr(); - params = gameEvents.encodeParams(t, true); - + params = gameEvents.encodeParams(p1, true); res = await axios .request({ headers: { diff --git a/commands/tasks/unicom/handlers/dailyEvent.js b/commands/tasks/unicom/handlers/dailyEvent.js index 5b6223f79..653dab535 100644 --- a/commands/tasks/unicom/handlers/dailyEvent.js +++ b/commands/tasks/unicom/handlers/dailyEvent.js @@ -149,9 +149,9 @@ let lookVideoDoubleResult = (title) => { }); let result = res.data; if (result.code !== 0) { - console.log(`⭕ ${title}翻倍结果:`, result.message); + console.log(`❌ ${title}翻倍结果:`, result.message); } else { - console.log(`❌ ${title}翻倍结果:`, result.data); + console.log(`⭕ ${title}翻倍结果:`, result.data); } }; }; diff --git a/commands/tasks/unicom/woTree.js b/commands/tasks/unicom/woTree.js index db7a607f7..6cbf92fd8 100644 --- a/commands/tasks/unicom/woTree.js +++ b/commands/tasks/unicom/woTree.js @@ -1,238 +1,254 @@ -var crypto = require('crypto'); -const { buildUnicomUserAgent } = require('../../../utils/util') +var crypto = require("crypto"); +const { buildUnicomUserAgent } = require("../../../utils/util"); var sign = (data) => { - let str = 'integralofficial&' - let params = [] + let str = "integralofficial&"; + let params = []; data.forEach((v, i) => { if (v) { - params.push('arguments' + (i + 1) + v) + params.push("arguments" + (i + 1) + v); } }); - return crypto.createHash('md5').update(str + params.join('&')).digest('hex') -} + return crypto + .createHash("md5") + .update(str + params.join("&")) + .digest("hex"); +}; var transParams = (data) => { let params = new URLSearchParams(); for (let item in data) { - params.append(item, data['' + item + '']); + params.append(item, data["" + item + ""]); } return params; }; var woTree = { entry: async (axios, options) => { - const useragent = buildUnicomUserAgent(options, 'p') - let searchParams = {} - let result = await axios.request({ - baseURL: 'https://m.client.10010.com/', - headers: { - "user-agent": useragent, - "referer": `https://img.client.10010.com/`, - "origin": "https://img.client.10010.com" - }, - url: `https://m.client.10010.com/mobileService/openPlatform/openPlatLineNew.htm?to_url=https://img.client.10010.com/mactivity/woTree/index.html&duanlianjieabc=qA504`, - method: 'get', - transformResponse: (data, headers) => { - if ('location' in headers) { - let uu = new URL(headers.location) - let pp = {} - for (let p of uu.searchParams) { - pp[p[0]] = p[1] - } - if ('ticket' in pp) { - searchParams = pp + const useragent = buildUnicomUserAgent(options, "p"); + let searchParams = {}; + let result = await axios + .request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": useragent, + referer: `https://img.client.10010.com/`, + origin: "https://img.client.10010.com", + }, + url: `https://m.client.10010.com/mobileService/openPlatform/openPlatLineNew.htm?to_url=https://img.client.10010.com/mactivity/woTree/index.html&duanlianjieabc=qA504`, + method: "get", + transformResponse: (data, headers) => { + if ("location" in headers) { + let uu = new URL(headers.location); + let pp = {}; + for (let p of uu.searchParams) { + pp[p[0]] = p[1]; + } + if ("ticket" in pp) { + searchParams = pp; + } } - } - return data - } - }).catch(err => console.log(err)) + return data; + }, + }) + .catch((err) => console.log(err)); - let jar = result.config.jar - let cookiesJson = jar.toJSON() - let ecs_token = cookiesJson.cookies.find(i => i.key == 'ecs_token') + let jar = result.config.jar; + let cookiesJson = jar.toJSON(); + let ecs_token = cookiesJson.cookies.find((i) => i.key == "ecs_token"); if (!ecs_token) { - throw new Error('ecs_token缺失') + throw new Error("ecs_token缺失"); } - ecs_token = ecs_token.value + ecs_token = ecs_token.value; return { searchParams, ecs_token, - jar - } + jar, + }; }, getStatus: (axios, options) => { - const useragent = buildUnicomUserAgent(options, 'p') + const useragent = buildUnicomUserAgent(options, "p"); return new Promise((resolve, reject) => { - axios.request({ - baseURL: 'https://m.client.10010.com/', - headers: { - "user-agent": useragent, - "referer": "https://img.client.10010.com", - "origin": "https://img.client.10010.com" - }, - url: `/mactivity/arbordayJson/index.htm`, - method: 'post' - }).then(res => { - let result = res.data - if (result.code !== '0000') { - console.log(result.msg) - } else { - resolve(result.data) - } - }).catch(reject) - }) + axios + .request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": useragent, + referer: "https://img.client.10010.com", + origin: "https://img.client.10010.com", + }, + url: `/mactivity/arbordayJson/index.htm`, + method: "post", + }) + .then((res) => { + let result = res.data; + if (result.code !== "0000") { + console.log(result.msg); + } else { + resolve(result.data); + } + }) + .catch(reject); + }); }, takeFlow: async (axios, params) => { - const { options, flowChangeList } = params - const useragent = buildUnicomUserAgent(options, 'p') + const { options, flowChangeList } = params; + const useragent = buildUnicomUserAgent(options, "p"); // type 1 看视频得流量 0 普通任务 for (let flow of flowChangeList) { const { data } = await axios.request({ - baseURL: 'https://m.client.10010.com/', + baseURL: "https://m.client.10010.com/", headers: { "user-agent": useragent, - "referer": "https://img.client.10010.com", - "origin": "https://img.client.10010.com" + referer: "https://img.client.10010.com", + origin: "https://img.client.10010.com", }, - url: flow.type === '1' ? `/mactivity/flowData/refresh.htm?flowId=${flow.id}` : `/mactivity/flowData/takeFlow.htm?flowId=${flow.id}`, - method: 'post' - }) - if (data.code !== '0000') { - console.log(data.msg) + url: + flow.type === "1" + ? `/mactivity/flowData/refresh.htm?flowId=${flow.id}` + : `/mactivity/flowData/takeFlow.htm?flowId=${flow.id}`, + method: "post", + }); + if (data.code !== "0000") { + console.log(data.msg); } else { - console.log('领取流量+', flow.countTransFlowStr, 'M成功') + console.log("领取流量+", flow.countTransFlowStr, "M成功"); } } }, takePop: async (axios, params) => { - const { options, popList } = params - const useragent = buildUnicomUserAgent(options, 'p') + const { options, popList } = params; + const useragent = buildUnicomUserAgent(options, "p"); for (let pop of popList) { const { data } = await axios.request({ - baseURL: 'https://m.client.10010.com/', + baseURL: "https://m.client.10010.com/", headers: { "user-agent": useragent, - "referer": "https://img.client.10010.com", - "origin": "https://img.client.10010.com" + referer: "https://img.client.10010.com", + origin: "https://img.client.10010.com", }, url: `/mactivity/arbordayJson/arbor/${pop.id}/${pop.type}/${pop.friendNum}/grow.htm`, - method: 'post' - }) - if (data.code !== '0000') { - console.log(data.msg) + method: "post", + }); + if (data.code !== "0000") { + console.log(data.msg); } else { - console.log('领取话费+', data.data.addedValue) + console.log("领取话费+", data.data.addedValue); } } }, water: async (axios, options) => { - const { jar } = await woTree.entry(axios, options) - const useragent = buildUnicomUserAgent(options, 'p') + const { jar } = await woTree.entry(axios, options); + const useragent = buildUnicomUserAgent(options, "p"); const { data } = await axios.request({ - baseURL: 'https://m.client.10010.com/', + baseURL: "https://m.client.10010.com/", headers: { "user-agent": useragent, - "referer": "https://img.client.10010.com", - "origin": "https://img.client.10010.com" + referer: "https://img.client.10010.com", + origin: "https://img.client.10010.com", }, url: `/mactivity/arbordayJson/getChanceByIndex.htm?index=0`, - method: 'post' - }) + method: "post", + }); - if (data.code !== '0000') { - console.log('查询浇水机会失败') - return + if (data.code !== "0000") { + console.log("查询浇水机会失败"); + return; } if (data.data.chance_0 === 0) { - console.log('暂无浇水机会,跳过') - return + console.log("暂无浇水机会,跳过"); + return; } - let num = 2 + let num = 2; do { if (num < 2) { - console.log('看视频浇水') + console.log("看视频浇水"); let params = { - 'arguments1': '', - 'arguments2': '', - 'arguments3': '', - 'arguments4': new Date().getTime(), - 'arguments6': '', - 'arguments7': '', - 'arguments8': '', - 'arguments9': '', - 'netWay': 'Wifi', - 'remark1': '沃之树看视频得浇水机会', - 'remark': '', - 'version': `android@8.0100`, - 'codeId': 945535626 - } - params['sign'] = sign([params.arguments1, params.arguments2, params.arguments3, params.arguments4]) - let result = await require('./taskcallback').reward(axios, { + arguments1: "", + arguments2: "", + arguments3: "", + arguments4: new Date().getTime(), + arguments6: "", + arguments7: "", + arguments8: "", + arguments9: "", + netWay: "Wifi", + remark1: "沃之树看视频得浇水机会", + remark: "", + version: `android@8.0100`, + codeId: 945535626, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + let result = await require("./taskcallback").reward(axios, { ...options, params, - jar - }) + jar, + }); result = await axios.request({ headers: { "user-agent": useragent, - "referer": `https://img.client.10010.com/`, - "origin": "https://img.client.10010.com", + referer: `https://img.client.10010.com/`, + origin: "https://img.client.10010.com", }, url: `https://m.client.10010.com/mactivity/arbordayJson/giveGrowChance.htm`, - method: 'POST', + method: "POST", data: transParams({ - "{}": "" - }) - }) - console.log(result.data.msg) + "{}": "", + }), + }); + console.log(result.data.msg); } let res = await axios.request({ headers: { "user-agent": useragent, - "referer": `https://img.client.10010.com/`, - "origin": "https://img.client.10010.com", + referer: `https://img.client.10010.com/`, + origin: "https://img.client.10010.com", }, url: `https://m.client.10010.com/mactivity/arbordayJson/arbor/3/0/3/grow.htm`, - method: 'POST', + method: "POST", data: transParams({ - "{}": "" - }) - }) - let result = res.data - if (result.code !== '0000') { - console.log('浇水失败', result.msg) + "{}": "", + }), + }); + let result = res.data; + if (result.code !== "0000") { + console.log("浇水失败", result.msg); } else { if (result.data.addedValue) { - console.log('浇水成功', '培养值+' + result.data.addedValue) + console.log("浇水成功", "培养值+" + result.data.addedValue); } else { - console.log('浇水操作完成') + console.log("浇水操作完成"); } } - } while (--num) + } while (--num); }, doTask: async (request, options) => { // 沃之树 浇水 - await woTree.water(request, options) - let i = 2 - let result + await woTree.water(request, options); + let i = 2; + let result; do { // 普通 - 看视频 似乎是分开的两次 - result = await woTree.getStatus(request, options) + result = await woTree.getStatus(request, options); await woTree.takeFlow(request, { options, - flowChangeList: result.flowChangeList - }) - } while (i--) + flowChangeList: result.flowChangeList, + }); + } while (i--); await woTree.takePop(request, { options, - popList: result.popList - }) - } -} + popList: result.popList, + }); + }, +}; -module.exports = woTree \ No newline at end of file +module.exports = woTree; diff --git a/utils/util.js b/utils/util.js index 18e4ec323..c3f0352b2 100644 --- a/utils/util.js +++ b/utils/util.js @@ -1,86 +1,98 @@ -const os = require('os') -const path = require('path') -const fs = require('fs-extra') +const os = require("os"); +const path = require("path"); +const fs = require("fs-extra"); module.exports = { - async delCookiesFile(key) { - let dir = path.join(os.homedir(), '.AutoSignMachine') - if ('TENCENTCLOUD_RUNENV' in process.env && process.env.TENCENTCLOUD_RUNENV === 'SCF') { - dir = path.join('/tmp', '.AutoSignMachine') - } - if (!fs.existsSync(dir)) { - fs.mkdirpSync(dir) - } - let cookieFile = path.join(dir, 'cookieFile_' + key + '.txt') - if (fs.existsSync(cookieFile)) { - fs.unlinkSync(cookieFile) - } - }, - getCookies: (key) => { - let dir = path.join(os.homedir(), '.AutoSignMachine') - if ('TENCENTCLOUD_RUNENV' in process.env && process.env.TENCENTCLOUD_RUNENV === 'SCF') { - dir = path.join('/tmp', '.AutoSignMachine') - } - if (!fs.existsSync(dir)) { - fs.mkdirpSync(dir) - } - let cookieFile = path.join(dir, 'cookieFile_' + key + '.txt') - if (fs.existsSync(cookieFile)) { - let cookies = fs.readFileSync(cookieFile).toString('utf-8') - return cookies - } - return '' - }, - saveCookies: (key, cookies, cookiesJar) => { - let dir = path.join(os.homedir(), '.AutoSignMachine') - if ('TENCENTCLOUD_RUNENV' in process.env && process.env.TENCENTCLOUD_RUNENV === 'SCF') { - dir = path.join('/tmp', '.AutoSignMachine') - } - if (!fs.existsSync(dir)) { - fs.mkdirpSync(dir) - } - let cookieFile = path.join(dir, 'cookieFile_' + key + '.txt') - let allcookies = {} - if (cookies) { - cookies.split('; ').map(c => { - let item = c.split('=') - allcookies[item[0]] = item[1] || '' - }) - } - if (cookiesJar) { - cookiesJar.toJSON().cookies.map(c => { - allcookies[c.key] = c.value || '' - }) - } - let cc = [] - for (let key in allcookies) { - cc.push({ - key: key, - value: allcookies[key] || '' - }) - } - fs.ensureFileSync(cookieFile) - fs.writeFileSync(cookieFile, cc.map(c => c.key + '=' + c.value).join('; ') - ) - }, - buildUnicomUserAgent: (options, tplname) => { - var tpl = { - 'p': 'Mozilla/5.0 (Linux; Android {android_version}; {deviceModel} Build/{buildSn}; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:{unicom_version},desmobile:{desmobile}};devicetype{deviceBrand:{deviceBrand},deviceModel:{deviceModel}};{yw_code:}' - } - var rdm = { - android_version: '7.1.2', - unicom_version: 'android@8.0100', - deviceBrand: 'samsung', - deviceModel: 'SM-G977N', - buildSn: 'LMY48Z', - desmobile: options.user - } - var fmt = (str, params) => { - for (let key in params) { - str = str.replace(new RegExp("\\{" + key + "\\}", "g"), params[key]); - } - return str - } - return fmt(tpl[tplname], Object.assign(rdm, options)) + async delCookiesFile(key) { + let dir = path.join(os.homedir(), ".AutoSignMachine"); + if ( + "TENCENTCLOUD_RUNENV" in process.env && + process.env.TENCENTCLOUD_RUNENV === "SCF" + ) { + dir = path.join("/tmp", ".AutoSignMachine"); } -} \ No newline at end of file + if (!fs.existsSync(dir)) { + fs.mkdirpSync(dir); + } + let cookieFile = path.join(dir, "cookieFile_" + key + ".txt"); + if (fs.existsSync(cookieFile)) { + fs.unlinkSync(cookieFile); + } + }, + getCookies: (key) => { + let dir = path.join(os.homedir(), ".AutoSignMachine"); + if ( + "TENCENTCLOUD_RUNENV" in process.env && + process.env.TENCENTCLOUD_RUNENV === "SCF" + ) { + dir = path.join("/tmp", ".AutoSignMachine"); + } + if (!fs.existsSync(dir)) { + fs.mkdirpSync(dir); + } + let cookieFile = path.join(dir, "cookieFile_" + key + ".txt"); + if (fs.existsSync(cookieFile)) { + let cookies = fs.readFileSync(cookieFile).toString("utf-8"); + return cookies; + } + return ""; + }, + saveCookies: (key, cookies, cookiesJar) => { + let dir = path.join(os.homedir(), ".AutoSignMachine"); + if ( + "TENCENTCLOUD_RUNENV" in process.env && + process.env.TENCENTCLOUD_RUNENV === "SCF" + ) { + dir = path.join("/tmp", ".AutoSignMachine"); + } + if (!fs.existsSync(dir)) { + fs.mkdirpSync(dir); + } + let cookieFile = path.join(dir, "cookieFile_" + key + ".txt"); + let allcookies = {}; + if (cookies) { + cookies.split("; ").map((c) => { + let item = c.split("="); + allcookies[item[0]] = item[1] || ""; + }); + } + if (cookiesJar) { + cookiesJar.toJSON().cookies.map((c) => { + allcookies[c.key] = c.value || ""; + }); + } + let cc = []; + for (let key in allcookies) { + cc.push({ + key: key, + value: allcookies[key] || "", + }); + } + fs.ensureFileSync(cookieFile); + fs.writeFileSync( + cookieFile, + cc.map((c) => c.key + "=" + c.value).join("; ") + ); + }, + buildUnicomUserAgent: (options, tplname) => { + var tpl = { + p: + "Mozilla/5.0 (Linux; Android {android_version}; {deviceModel} Build/{buildSn}; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:{unicom_version},desmobile:{desmobile}};devicetype{deviceBrand:{deviceBrand},deviceModel:{deviceModel}};{yw_code:}", + }; + var rdm = { + android_version: "7.1.2", + unicom_version: "android@8.0100", + deviceBrand: "samsung", + deviceModel: "SM-G977N", + buildSn: "LMY48Z", + desmobile: options.user, + }; + var fmt = (str, params) => { + for (let key in params) { + str = str.replace(new RegExp("\\{" + key + "\\}", "g"), params[key]); + } + return str; + }; + return fmt(tpl[tplname], Object.assign(rdm, options)); + }, +}; From 9c8158aa1249b8b35d249c2684c379f31374a00a Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Tue, 9 Feb 2021 14:18:40 +0800 Subject: [PATCH 024/128] =?UTF-8?q?=F0=9F=90=8D=20fixed=20bugs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/dailyBookLuckdraw.js | 281 +++++++++++---------- commands/tasks/unicom/dailyLKMH.js | 42 +-- commands/tasks/unicom/dailyYYQ.js | 22 +- commands/tasks/unicom/dailyYYY.js | 26 +- 4 files changed, 157 insertions(+), 214 deletions(-) diff --git a/commands/tasks/unicom/dailyBookLuckdraw.js b/commands/tasks/unicom/dailyBookLuckdraw.js index fb8ac46e6..8db7bcad3 100644 --- a/commands/tasks/unicom/dailyBookLuckdraw.js +++ b/commands/tasks/unicom/dailyBookLuckdraw.js @@ -1,150 +1,165 @@ - -var crypto = require('crypto'); +var crypto = require("crypto"); var CryptoJS = require("crypto-js"); -const { RSAUtils } = require('./RSAUtils'); +const { RSAUtils } = require("./RSAUtils"); var transParams = (data) => { - let params = new URLSearchParams(); - for (let item in data) { - params.append(item, data['' + item + '']); - } - return params; + let params = new URLSearchParams(); + for (let item in data) { + params.append(item, data["" + item + ""]); + } + return params; }; var sign = (data) => { - let str = 'integralofficial&' - let params = [] - data.forEach((v, i) => { - if (v) { - params.push('arguments' + (i + 1) + v) - } - }); - return crypto.createHash('md5').update(str + params.join('&')).digest('hex') -} + let str = "integralofficial&"; + let params = []; + data.forEach((v, i) => { + if (v) { + params.push("arguments" + (i + 1) + v); + } + }); + return crypto + .createHash("md5") + .update(str + params.join("&")) + .digest("hex"); +}; var dailyBookLuckdraw = { - oauthMethod: async (axios, options) => { - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} ` - let { data } = await axios.request({ - headers: { - "user-agent": useragent, - "referer": `https://img.client.10010.com/`, - "origin": "https://img.client.10010.com" - }, - url: `https://m.client.10010.com/finderInterface/woReadOauth/?typeCode=oauthMethod`, - method: 'GET' - }) - return data.data.key - }, - login: async (axios, options) => { - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} ` - - //密码加密 - var modulus = "00D9C7EE8B8C599CD75FC2629DBFC18625B677E6BA66E81102CF2D644A5C3550775163095A3AA7ED9091F0152A0B764EF8C301B63097495C7E4EA7CF2795029F61229828221B510AAE9A594CA002BA4F44CA7D1196697AEB833FD95F2FA6A5B9C2C0C44220E1761B4AB1A1520612754E94C55DC097D02C2157A8E8F159232ABC87"; - var exponent = "010001"; - var key = RSAUtils.getKeyPair(exponent, '', modulus); - let phonenum = RSAUtils.encryptedString(key, options.user); - let { data, config } = await axios.request({ - headers: { - "user-agent": useragent, - "X-Requested-With": "com.sinovatech.unicom.ui" - }, - url: `https://m.iread.wo.cn/touchextenernal/common/shouTingLogin.action`, - method: 'POST', - data: transParams({ - phonenum - }) - }) - let jar = config.jar - let cookiesJson = jar.toJSON() - let diwert = cookiesJson.cookies.find(i => i.key == 'diwert') - let useraccount = cookiesJson.cookies.find(i => i.key == 'useraccount') - if (!useraccount || !diwert) { - throw new Error('获取用户信息失败') - } + oauthMethod: async (axios, options) => { + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} `; + let { data } = await axios.request({ + headers: { + "user-agent": useragent, + referer: `https://img.client.10010.com/`, + origin: "https://img.client.10010.com", + }, + url: `https://m.client.10010.com/finderInterface/woReadOauth/?typeCode=oauthMethod`, + method: "GET", + }); + return data.data.key; + }, + login: async (axios, options) => { + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} `; - await axios.request({ - headers: { - "user-agent": useragent - }, - jar, - url: `http://m.iread.wo.cn/touchextenernal/seeadvertluckdraw/index.action?channelid=18000018&yw_code=&desmobile=${options.user}&version=android@8.0100`, - method: 'GET' - }) + //密码加密 + var modulus = + "00D9C7EE8B8C599CD75FC2629DBFC18625B677E6BA66E81102CF2D644A5C3550775163095A3AA7ED9091F0152A0B764EF8C301B63097495C7E4EA7CF2795029F61229828221B510AAE9A594CA002BA4F44CA7D1196697AEB833FD95F2FA6A5B9C2C0C44220E1761B4AB1A1520612754E94C55DC097D02C2157A8E8F159232ABC87"; + var exponent = "010001"; + var key = RSAUtils.getKeyPair(exponent, "", modulus); + let phonenum = RSAUtils.encryptedString(key, options.user); + let { data, config } = await axios.request({ + headers: { + "user-agent": useragent, + "X-Requested-With": "com.sinovatech.unicom.ui", + }, + url: `https://m.iread.wo.cn/touchextenernal/common/shouTingLogin.action`, + method: "POST", + data: transParams({ + phonenum, + }), + }); + let jar = config.jar; + let cookiesJson = jar.toJSON(); + let diwert = cookiesJson.cookies.find((i) => i.key == "diwert"); + let useraccount = cookiesJson.cookies.find((i) => i.key == "useraccount"); + if (!useraccount || !diwert) { + throw new Error("获取用户信息失败"); + } - return { - jar - } - }, - doTask: async (axios, options) => { - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} ` - let Authorization = await dailyBookLuckdraw.oauthMethod(axios, options) - let { jar } = await dailyBookLuckdraw.login(axios, { - ...options, - Authorization - }) + await axios.request({ + headers: { + "user-agent": useragent, + }, + jar, + url: `http://m.iread.wo.cn/touchextenernal/seeadvertluckdraw/index.action?channelid=18000018&yw_code=&desmobile=${options.user}&version=android@8.0100`, + method: "GET", + }); - let times = 5 - do { - if (times < 5) { - let params = { - 'arguments1': 'AC20200521222721', - 'arguments2': 'GGPD', - 'arguments3': '', - 'arguments4': new Date().getTime(), - 'arguments6': '', - 'arguments7': '', - 'arguments8': '', - 'arguments9': '', - 'netWay': 'Wifi', - 'remark': '阅读每日读书福利广告1', - 'remark1': '阅读每日读书福利广告1', - 'version': `android@8.0100`, - 'codeId': 945535424 - } + return { + jar, + }; + }, + doTask: async (axios, options) => { + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} `; + let Authorization = await dailyBookLuckdraw.oauthMethod(axios, options); + let { jar } = await dailyBookLuckdraw.login(axios, { + ...options, + Authorization, + }); - params['sign'] = sign([params.arguments1, params.arguments2, params.arguments3, params.arguments4]) - params['orderId'] = crypto.createHash('md5').update(new Date().getTime() + '').digest('hex') - params['arguments4'] = new Date().getTime() + let times = 5; + do { + if (times < 5) { + let params = { + arguments1: "AC20200521222721", + arguments2: "GGPD", + arguments3: "", + arguments4: new Date().getTime(), + arguments6: "", + arguments7: "", + arguments8: "", + arguments9: "", + netWay: "Wifi", + remark: "阅读每日读书福利广告1", + remark1: "阅读每日读书福利广告1", + version: `android@8.0100`, + codeId: 945535424, + }; - await require('./taskcallback').reward(axios, { - ...options, - params, - jar - }) - } + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + params["orderId"] = crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"); + params["arguments4"] = new Date().getTime(); - let res = await axios.request({ - headers: { - "user-agent": useragent - }, - jar, - url: `http://m.iread.wo.cn/touchextenernal/seeadvertluckdraw/doDraw.action`, - method: 'POST', - data: transParams({ - 'acticeindex': 'NzJBQTQxMEE2QzQwQUE2MDYxMEI5MDNGQjFEMEEzODI=' - }) - }).catch(err => { - if (err.response.status !== 200) { - console.log('访问错误', err.response.statusText) - throw new Error('访问错误:' + [err.response.status, err.response.statusText].join('-')) - } - }) - let result = res.data - if (result.code === '0000') { - console.log('阅读每日读书福利抽奖', result.prizedesc) - } else if (result.code === '9999') { - console.log('阅读每日读书福利抽奖', result.message) - break - } else { - console.log('阅读每日读书福利抽奖', result.message) - } + await require("./taskcallback").reward(axios, { + ...options, + params, + jar, + }); + } - console.log('等待15秒再继续') - await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)) + let res = await axios + .request({ + headers: { + "user-agent": useragent, + }, + jar, + url: `http://m.iread.wo.cn/touchextenernal/seeadvertluckdraw/doDraw.action`, + method: "POST", + data: transParams({ + acticeindex: "NzJBQTQxMEE2QzQwQUE2MDYxMEI5MDNGQjFEMEEzODI=", + }), + }) + .catch((err) => { + if (err.response.status !== 200) { + console.log("访问错误", err.response.statusText); + throw new Error( + "访问错误:" + + [err.response.status, err.response.statusText].join("-") + ); + } + }); + let result = res.data; + if (result.code === "0000") { + console.log("阅读每日读书福利抽奖", result.prizedesc); + } else if (result.code === "9999") { + console.log("阅读每日读书福利抽奖", result.message); + break; + } else { + console.log("阅读每日读书福利抽奖", result.message); + } - } while (--times) - } -} + console.log("等待15秒再继续"); + await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); + } while (--times); + }, +}; -module.exports = dailyBookLuckdraw \ No newline at end of file +module.exports = dailyBookLuckdraw; diff --git a/commands/tasks/unicom/dailyLKMH.js b/commands/tasks/unicom/dailyLKMH.js index 18c930b7e..4f7148864 100644 --- a/commands/tasks/unicom/dailyLKMH.js +++ b/commands/tasks/unicom/dailyLKMH.js @@ -10,14 +10,6 @@ const gameEvents = require("./handlers/dailyEvent"); * */ -var transParams = (data) => { - let params = new URLSearchParams(); - for (let item in data) { - params.append(item, data["" + item + ""]); - } - return params; -}; - var sign = (data) => { let str = "integralofficial&"; let params = []; @@ -59,15 +51,6 @@ var encrypt = function (word, keyStr) { return encrypted.toString(); }; -var decrypt = function (word, keyStr) { - var key = CryptoJS.enc.Utf8.parse(keyStr); - var decrypted = CryptoJS.AES.decrypt(word, key, { - mode: CryptoJS.mode.ECB, - padding: CryptoJS.pad.Pkcs7, - }); - return decrypted.toString(CryptoJS.enc.Utf8); -}; - var dailyLKMH = { doTask: async (axios, options) => { const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; @@ -108,9 +91,6 @@ var dailyLKMH = { let jfid = cookiesJson.cookies.find((i) => i.key == "_jf_id"); jfid = jfid.value; - let keyArr = secretkeyArray(); - let keyrdm = Math.floor(Math.random() * 5); - let params = { activityId: "Ac-f4557b3ac6004a48b1187e32ea343ca8", userCookie: jfid, @@ -250,6 +230,7 @@ var dailyLKMH = { } console.log("等待15秒再继续"); + // eslint-disable-next-line no-unused-vars await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); } while (--times); }, @@ -308,26 +289,7 @@ var dailyLKMH = { jar, }); }, - lookVideoDoubleResult: async (axios, options) => { - let { Authorization, activityId, winningRecordId } = options; - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; - let res = await axios.request({ - headers: { - Authorization: `Bearer ${Authorization}`, - "user-agent": useragent, - referer: "https://img.jf.10010.com/", - origin: "https://img.jf.10010.com", - }, - url: `https://m.jf.10010.com/jf-yuech/api/gameResult/doublingIntegral?activityId=${activityId}&winningRecordId=${winningRecordId}`, - method: "get", - }); - result = res.data; - if (result.code !== 0) { - console.log("签到小游戏盲盒翻倍结果:", result.message); - } else { - console.log("签到小游戏盲盒翻倍结果:", result.data); - } - }, + lookVideoDoubleResult: gameEvents.lookVideoDoubleResult("签到小游戏盲盒"), }; module.exports = dailyLKMH; diff --git a/commands/tasks/unicom/dailyYYQ.js b/commands/tasks/unicom/dailyYYQ.js index 56896227d..58fa7ed6a 100644 --- a/commands/tasks/unicom/dailyYYQ.js +++ b/commands/tasks/unicom/dailyYYQ.js @@ -198,25 +198,9 @@ let dailyYYQ = { jar, }); }, - lookVideoDoubleResult: async (axios, options) => { - let { Authorization, activityId, winningRecordId } = options; - let res = await axios.request({ - headers: { - Authorization: `Bearer ${Authorization}`, - "user-agent": useragent(options), - referer: "https://img.jf.10010.com/", - origin: "https://img.jf.10010.com", - }, - url: `https://m.jf.10010.com/jf-yuech/api/gameResult/doublingIntegral?activityId=${activityId}&winningRecordId=${winningRecordId}`, - method: "get", - }); - let result = res.data; - if (result.code !== 0) { - console.log("签到小游戏买扭蛋机2翻倍结果:", result.message); - } else { - console.log("签到小游戏买扭蛋机2翻倍结果:", result.data); - } - }, + lookVideoDoubleResult: gameEvents.lookVideoDoubleResult( + "签到小游戏买扭蛋机2" + ), }; module.exports = dailyYYQ; diff --git a/commands/tasks/unicom/dailyYYY.js b/commands/tasks/unicom/dailyYYY.js index 6d8ccbb54..d0c9b6550 100644 --- a/commands/tasks/unicom/dailyYYY.js +++ b/commands/tasks/unicom/dailyYYY.js @@ -148,10 +148,10 @@ var dailyYYY = { do { let orderId = ""; - let currentTimes = 1 + 4 - (freeTimes + advertTimes) + 1; + // let currentTimes = 1 + 4 - (freeTimes + advertTimes) + 1; console.log( "已消耗机会", - currentTimes, + 1 + 4 - (freeTimes + advertTimes), "剩余免费机会", freeTimes, "看视频广告机会", @@ -320,6 +320,7 @@ var dailyYYY = { } console.log("等待15秒再继续"); + // eslint-disable-next-line no-unused-vars await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); } while (freeTimes || advertTimes); }, @@ -379,26 +380,7 @@ var dailyYYY = { jar, }); }, - lookVideoDoubleResult: async (axios, options) => { - let { Authorization, activityId, winningRecordId } = options; - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; - let res = await axios.request({ - headers: { - Authorization: `Bearer ${Authorization}`, - "user-agent": useragent, - referer: "https://img.jf.10010.com/", - origin: "https://img.jf.10010.com", - }, - url: `https://m.jf.10010.com/jf-yuech/api/gameResult/doublingIntegral?activityId=${activityId}&winningRecordId=${winningRecordId}`, - method: "get", - }); - result = res.data; - if (result.code !== 0) { - console.log("摇一摇送好礼翻倍结果:", result.message); - } else { - console.log("摇一摇送好礼翻倍结果:", result.data); - } - }, + lookVideoDoubleResult: gameEvents.lookVideoDoubleResult("摇一摇送好礼"), }; module.exports = dailyYYY; From 2a1ae8f7d87408f7474614e556d82a9b0b3458e8 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Tue, 9 Feb 2021 14:30:08 +0800 Subject: [PATCH 025/128] =?UTF-8?q?=F0=9F=9A=82=20delete=20unnecessary=20c?= =?UTF-8?q?ode=20at=20LKMH?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/dailyLKMH.js | 45 +----------------------------- 1 file changed, 1 insertion(+), 44 deletions(-) diff --git a/commands/tasks/unicom/dailyLKMH.js b/commands/tasks/unicom/dailyLKMH.js index 4f7148864..89fb59682 100644 --- a/commands/tasks/unicom/dailyLKMH.js +++ b/commands/tasks/unicom/dailyLKMH.js @@ -1,6 +1,5 @@ var crypto = require("crypto"); -var CryptoJS = require("crypto-js"); -// let AES = require("./handlers/PAES.js"); +let { encrypt, sign } = require("./handlers/PAES.js"); // const useragent = require("./handlers/myPhone").useragent; const gameEvents = require("./handlers/dailyEvent"); @@ -9,48 +8,6 @@ const gameEvents = require("./handlers/dailyEvent"); * 入口:首页-签到有礼-免费抽-拆华为Pad(去抽奖) * */ - -var sign = (data) => { - let str = "integralofficial&"; - let params = []; - data.forEach((v, i) => { - if (v) { - params.push("arguments" + (i + 1) + v); - } - }); - return crypto - .createHash("md5") - .update(str + params.join("&")) - .digest("hex"); -}; - -var secretkeyArray = function () { - // prettier-ignore - for (var e = [], t = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", - "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", - "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", - "r", "s", "t", "u", "v", "w", "x", "y", "z"], i = 0; - 5 > i; - i++) { - for (var n = "", s = 0; 16 > s; s++) { - var a = Math.floor(62 * Math.random()); - n += t[a] - } - e.push(n) - } - return e; -}; - -var encrypt = function (word, keyStr) { - var key = CryptoJS.enc.Utf8.parse(keyStr); - var srcs = CryptoJS.enc.Utf8.parse(word); - var encrypted = CryptoJS.AES.encrypt(srcs, key, { - mode: CryptoJS.mode.ECB, - padding: CryptoJS.pad.Pkcs7, - }); - return encrypted.toString(); -}; - var dailyLKMH = { doTask: async (axios, options) => { const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; From ddae99a972921dde29dfdef6482c7493ac602265 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Tue, 9 Feb 2021 14:45:12 +0800 Subject: [PATCH 026/128] =?UTF-8?q?=F0=9F=9A=82=20delete=20unnecessary=20c?= =?UTF-8?q?ode=20at=20LKMH?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/dailyYYY.js | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/commands/tasks/unicom/dailyYYY.js b/commands/tasks/unicom/dailyYYY.js index d0c9b6550..9d1aba335 100644 --- a/commands/tasks/unicom/dailyYYY.js +++ b/commands/tasks/unicom/dailyYYY.js @@ -2,6 +2,7 @@ var crypto = require("crypto"); var CryptoJS = require("crypto-js"); var moment = require("moment"); const gameEvents = require("./handlers/dailyEvent"); +const useragent = require("./handlers/myPhone").useragent; // 摇一摇送好礼 var sign = (data) => { let str = "integralofficial&"; @@ -59,13 +60,12 @@ var encrypt = function (word, keyStr) { var dailyYYY = { doTask: async (axios, options) => { - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; let searchParams = {}; let result = await axios .request({ baseURL: "https://m.client.10010.com/", headers: { - "user-agent": useragent, + "user-agent": useragent(options), referer: `https://img.client.10010.com/`, origin: "https://img.client.10010.com", }, @@ -123,7 +123,7 @@ var dailyYYY = { .request({ baseURL: "https://m.jf.10010.com/", headers: { - "user-agent": useragent, + "user-agent": useragent(options), referer: "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/shake/index.html?jump=sign", origin: "https://img.jf.10010.com", @@ -206,7 +206,7 @@ var dailyYYY = { let timestamp = moment().format("YYYYMMDDHHmmss"); result = await axios.request({ headers: { - "user-agent": useragent, + "user-agent": useragent(options), referer: `https://img.client.10010.com/`, }, url: `https://m.jf.10010.com/jf-order/avoidLogin/forActive/yyyqd?ticket=${searchParams.ticket}&type=02&version=android@8.0100×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&duanlianjieabc=tbkwx&userNumber=${options.user}`, @@ -234,7 +234,7 @@ var dailyYYY = { .request({ headers: { Authorization: `Bearer ${Authorization}`, - "user-agent": useragent, + "user-agent": useragent(options), referer: "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/shake/index.html?jump=sign", origin: "https://m.jf.10010.com", @@ -245,19 +245,6 @@ var dailyYYY = { data: params, }) .catch((err) => console.log(err)); - //deprecated from official API call - // res = await axios.request({ - // headers: { - // "user-agent": useragent, - // "Authorization": `Bearer ${Authorization}`, - // "referer": "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/shake/index.html?jump=sign", - // "Content-Type": "application/x-www-form-urlencoded" - // }, - // jar: null, - // url: `https://m.jf.10010.com/jf-yuech/api/gameResultV2/consumptionGameTimes`, - // method: 'get', - // params: transParams(p1) - // }).catch(err => console.log(err)) console.log(res.data); if (res.data.code !== 0) { @@ -282,7 +269,7 @@ var dailyYYY = { res = await axios.request({ headers: { Authorization: `Bearer ${Authorization}`, - "user-agent": useragent, + "user-agent": useragent(options), referer: "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/shake/index.html?jump=sign", origin: "https://m.jf.10010.com", @@ -332,7 +319,7 @@ var dailyYYY = { arguments4: new Date().getTime(), // time arguments6: "517050707", netWay: "Wifi", - version: `android@8.0100`, + version: `android@8.0102`, }; params["sign"] = sign([ params.arguments1, From 78c5eb777e77f3b90a6e5c0280f0fd5e4cc752fe Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Tue, 9 Feb 2021 15:21:44 +0800 Subject: [PATCH 027/128] =?UTF-8?q?=F0=9F=8F=B3=E2=80=8D=F0=9F=8C=88=20add?= =?UTF-8?q?=20some=20comments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/unicom.js | 132 ++++++++++++++++++++------------ 1 file changed, 85 insertions(+), 47 deletions(-) diff --git a/commands/tasks/unicom/unicom.js b/commands/tasks/unicom/unicom.js index 5d91e05c2..f3927b82b 100644 --- a/commands/tasks/unicom/unicom.js +++ b/commands/tasks/unicom/unicom.js @@ -1,3 +1,41 @@ +/** + * 目前实现的软体业务归总 + * 每日类: + * 每日签到积分 + * 冬奥积分活动 20201231 + * 每日定向积分 20201231 + * 每日游戏楼层宝箱 + * 每日抽奖 + * 每日评论积分 + * 首页-游戏-娱乐中心-沃之树 + * 首页-小说-阅读越有礼打卡赢话费 + * 首页-小说-读满10章赢好礼 + * 首页-小说-阅读福利抽大奖 + * 首页-签到有礼-免费领-浏览领积分 + * 首页-签到有礼-免费拿-看视频夺宝 TODO:易出现本次操作需要进行验证,暂时注释 + * 首页-签到有礼-免费抽-抓OPPO手机 + * 首页-签到有礼-免费抽-拿666积分-豪礼大派送抽奖 + * 首页-签到有礼-免费抽-拿苹果iPad Pro(摇一摇) + * 首页-签到有礼-免费抽-拆华为Pad(去抽奖) + * 首页-签到有礼-免费抽-拿iPhone12(摇一摇) + * 首页-签到有礼-免费抽-赢Apple Watch(去抽奖) + * 首页-签到有礼-赢vivo X60(翻牛牌) + * 首页-签到有礼-赚更多福利-看视频奖励5积分 + * 首页-签到有礼-赚更多福利-天天抽好礼 + * 首页-签到有礼-居家娱乐馆 + * 首页-游戏-娱乐中心-每日打卡 + * 首页-游戏-娱乐中心-天天领取3G流量包 + * 首页-游戏-娱乐中心-每日打卡-完成今日任务(200m) + * 首页-积分查询-游戏任务 + * 首页-知识-限时免费(连续7天阶梯激励) + * 节日类 + * 首页-牛气-秒杀抢兑 + * 首页-牛气-转盘抽奖 + * 首页-牛气-场馆领牛气 + * + * + * + */ const { scheduler } = require("../../../utils/scheduler"); const { getCookies, saveCookies } = require("../../../utils/util"); const _request = require("../../../utils/request"); @@ -65,6 +103,17 @@ var start = async (params) => { taskOption ); + // 每日评论积分 + await scheduler.regTask( + "dailycomment", + async (request) => { + await require("./commentSystem") + .commentTask(request, options) + .catch(console.log); + }, + taskOption + ); + // 首页-游戏-娱乐中心-沃之树 await scheduler.regTask( "dailywoTree", @@ -74,10 +123,10 @@ var start = async (params) => { taskOption ); + // 首页-小说-阅读越有礼打卡赢话费 await scheduler.regTask( "dailyBookRead", async (request) => { - // 首页-小说-阅读越有礼打卡赢话费 await require("./dailyBookRead").doTask(request, options); await require("./dailyVideoBook").doTask(request, options); }, @@ -101,10 +150,10 @@ var start = async (params) => { taskOption ); + // 首页-小说-阅读福利抽大奖 await scheduler.regTask( "dailyBookLuckdraw", async (request) => { - // 首页-小说-阅读福利抽大奖 await require("./dailyBookLuckdraw").doTask(request, options); }, taskOption @@ -183,7 +232,7 @@ var start = async (params) => { taskOption ); - // 首页-签到有礼-免费抽-拿iPhone12(摇一摇) TODO: 待上线 + // 首页-签到有礼-免费抽-拿iPhone12(摇一摇) await scheduler.regTask( "dailyYYQ", async (request) => { @@ -201,6 +250,15 @@ var start = async (params) => { taskOption ); + // 首页-签到有礼-赢vivo X60(翻牛牌) + await scheduler.regTask( + "bcow", + async (request) => { + await require("./bcow").doTask(request, options); + }, + taskOption + ); + // 首页-签到有礼-赚更多福利-看视频奖励5积分 await scheduler.regTask( "dailyVideo", @@ -219,6 +277,18 @@ var start = async (params) => { taskOption ); + // 首页-签到有礼-居家娱乐馆 + await scheduler.regTask( + "gameYearBox", + async (request) => { + await require("./gameYearBox").doTask(request, options); + }, + { + ...taskOption, + startTime: 20 * 3600, + } + ); + // 首页-游戏-娱乐中心-每日打卡 await scheduler.regTask( "producGameSignin", @@ -238,6 +308,18 @@ var start = async (params) => { taskOption ); + // 首页-游戏-娱乐中心-每日打卡-完成今日任务(200m) + await scheduler.regTask( + "todayDailyTask", + async (request) => { + await require("./producGame").doTodayDailyTask(request, options); + }, + { + ...taskOption, + startTime: 20 * 3600, + } + ); + // 首页-积分查询-游戏任务 await scheduler.regTask( "dailygameIntegral", @@ -264,41 +346,6 @@ var start = async (params) => { // await require('./integral').getDxDetail(request, options) // await require('./integral').getCoins(request, options) - // 每日评论积分 - await scheduler.regTask( - "dailycomment", - async (request) => { - await require("./commentSystem") - .commentTask(request, options) - .catch(console.log); - }, - taskOption - ); - - // 首页-游戏-娱乐中心-每日打卡-完成今日任务(200m) - await scheduler.regTask( - "todayDailyTask", - async (request) => { - await require("./producGame").doTodayDailyTask(request, options); - }, - { - ...taskOption, - startTime: 20 * 3600, - } - ); - - // 首页-签到有礼-居家娱乐馆 - await scheduler.regTask( - "gameYearBox", - async (request) => { - await require("./gameYearBox").doTask(request, options); - }, - { - ...taskOption, - startTime: 20 * 3600, - } - ); - // 首页-牛气-秒杀抢兑 await scheduler.regTask( "NiujieSpikePrize", @@ -334,15 +381,6 @@ var start = async (params) => { ...taskOption, } ); - - // 首页-签到有礼-赢vivo X60 - await scheduler.regTask( - "bcow", - async (request) => { - await require("./bcow").doTask(request, options); - }, - taskOption - ); }; module.exports = { start, From ec7139f5ce3b0ce604c5394ea29f731e7b98d537 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Tue, 9 Feb 2021 15:59:23 +0800 Subject: [PATCH 028/128] Update dailyVideoScratchcard.js --- .../tasks/unicom/dailyVideoScratchcard.js | 224 ++++++++++-------- 1 file changed, 122 insertions(+), 102 deletions(-) diff --git a/commands/tasks/unicom/dailyVideoScratchcard.js b/commands/tasks/unicom/dailyVideoScratchcard.js index b4ff68fe9..a34a36d85 100644 --- a/commands/tasks/unicom/dailyVideoScratchcard.js +++ b/commands/tasks/unicom/dailyVideoScratchcard.js @@ -1,162 +1,182 @@ -var crypto = require('crypto'); +var crypto = require("crypto"); // 疯狂刮刮乐 var transParams = (data) => { let params = new URLSearchParams(); for (let item in data) { - params.append(item, data['' + item + '']); + params.append(item, data["" + item + ""]); } return params; }; -function w () { - var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {} - , t = []; - return Object.keys(e).forEach((function (a) { - t.push("".concat(a, "=").concat(encodeURIComponent(e[a]))) - } - )), +function w() { + var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + t = []; + return ( + Object.keys(e).forEach(function (a) { + t.push("".concat(a, "=").concat(encodeURIComponent(e[a]))); + }), t.join("&") + ); } var sign = (data) => { - let str = 'integralofficial&' - let params = [] + let str = "integralofficial&"; + let params = []; data.forEach((v, i) => { if (v) { - params.push('arguments' + (i + 1) + v) + params.push("arguments" + (i + 1) + v); } }); - return crypto.createHash('md5').update(str + params.join('&')).digest('hex') -} + return crypto + .createHash("md5") + .update(str + params.join("&")) + .digest("hex"); +}; -function encryption (data, key) { +function encryption(data, key) { var iv = ""; - var cipherEncoding = 'base64'; - var cipher = crypto.createCipheriv('aes-128-ecb', key, iv); + var cipherEncoding = "base64"; + var cipher = crypto.createCipheriv("aes-128-ecb", key, iv); cipher.setAutoPadding(true); - return Buffer.concat([cipher.update(data), cipher.final()]).toString(cipherEncoding); + return Buffer.concat([cipher.update(data), cipher.final()]).toString( + cipherEncoding + ); } var dailyVideoScratchcard = { getGoodsList: async (axios, options) => { - let phone = encryption(options.user, 'gb6YCccUvth75Tm2') - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} ` + let phone = encryption(options.user, "gb6YCccUvth75Tm2"); + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} `; let result = await axios.request({ headers: { "user-agent": useragent, - "referer": `https://wxapp.msmds.cn/`, - "origin": "https://wxapp.msmds.cn" + referer: `https://wxapp.msmds.cn/`, + origin: "https://wxapp.msmds.cn", }, url: `https://wxapp.msmds.cn/jplus/h5/channelScratchCard/findAllCard`, - method: 'GET', + method: "GET", params: transParams({ - 'channelId': 'LT_channel', - 'phone': phone, - 'token': options.ecs_token, - 'sourceCode': 'lt_scratchcard' - }) - }) - return result.data.data.allCards.filter(c => !c.status) + channelId: "LT_channel", + phone: phone, + token: options.ecs_token, + sourceCode: "lt_scratchcard", + }), + }); + return result.data.data.allCards.filter((c) => !c.status); }, doTask: async (axios, options) => { - - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}` - let searchParams = {} - let result = await axios.request({ - baseURL: 'https://m.client.10010.com/', - headers: { - "user-agent": useragent, - "referer": `https://img.client.10010.com/`, - "origin": "https://img.client.10010.com" - }, - url: `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://wxapp.msmds.cn/h5/react_web/unicom/scratchcardPage?source=unicom&duanlianjieabc=tbkR2`, - method: 'get', - transformResponse: (data, headers) => { - if ('location' in headers) { - let uu = new URL(headers.location) - let pp = {} - for (let p of uu.searchParams) { - pp[p[0]] = p[1] - } - if ('ticket' in pp) { - searchParams = pp + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; + let searchParams = {}; + let result = await axios + .request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": useragent, + referer: `https://img.client.10010.com/`, + origin: "https://img.client.10010.com", + }, + url: `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://wxapp.msmds.cn/h5/react_web/unicom/scratchcardPage?source=unicom&duanlianjieabc=tbkR2`, + method: "get", + transformResponse: (data, headers) => { + if ("location" in headers) { + let uu = new URL(headers.location); + let pp = {}; + for (let p of uu.searchParams) { + pp[p[0]] = p[1]; + } + if ("ticket" in pp) { + searchParams = pp; + } } - } - return data - } - }).catch(err => console.log(err)) + return data; + }, + }) + .catch((err) => console.log(err)); - let jar1 = result.config.jar + let jar1 = result.config.jar; - let cookiesJson = jar1.toJSON() - let ecs_token = cookiesJson.cookies.find(i => i.key == 'ecs_token') + let cookiesJson = jar1.toJSON(); + let ecs_token = cookiesJson.cookies.find((i) => i.key == "ecs_token"); if (!ecs_token) { - throw new Error('ecs_token缺失') + throw new Error("ecs_token缺失"); } - ecs_token = ecs_token.value + ecs_token = ecs_token.value; - let phone = encryption(options.user, 'gb6YCccUvth75Tm2') + let phone = encryption(options.user, "gb6YCccUvth75Tm2"); let goods = await dailyVideoScratchcard.getGoodsList(axios, { ...options, ecs_token, - phone - }) + phone, + }); let params = { - 'arguments1': '', - 'arguments2': '', - 'arguments3': '', - 'arguments4': new Date().getTime(), - 'arguments6': '', - 'arguments7': '', - 'arguments8': '', - 'arguments9': '', - 'netWay': 'Wifi', - 'remark': '签到小游戏幸运刮刮卡', - 'version': `android@8.0100`, - 'codeId': 945597731 - } - params['sign'] = sign([params.arguments1, params.arguments2, params.arguments3, params.arguments4]) + arguments1: "", + arguments2: "", + arguments3: "", + arguments4: new Date().getTime(), + arguments6: "", + arguments7: "", + arguments8: "", + arguments9: "", + netWay: "Wifi", + remark: "签到小游戏幸运刮刮卡", + version: `android@8.0100`, + codeId: 945597731, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); if (goods.length) { for (let good of goods) { - console.log('开始处理', good.name) - params['orderId'] = crypto.createHash('md5').update(new Date().getTime() + '').digest('hex') - params['arguments4'] = new Date().getTime() + console.log("开始处理", good.name); + params["orderId"] = crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"); + params["arguments4"] = new Date().getTime(); - result = await require('./taskcallback').reward(axios, { + result = await require("./taskcallback").reward(axios, { ...options, params, - jar: jar1 - }) + jar: jar1, + }); let a = { - 'channelId': 'LT_channel', - "phone": phone, - 'token': ecs_token, - 'cardId': good.id, - 'sourceCode': 'lt_scratchcard' - } + channelId: "LT_channel", + phone: phone, + token: ecs_token, + cardId: good.id, + sourceCode: "lt_scratchcard", + }; result = await axios.request({ headers: { "user-agent": useragent, - "referer": `https://wxapp.msmds.cn/h5/react_web/unicom/scratchcardItemPage`, - "origin": "https://wxapp.msmds.cn" + referer: `https://wxapp.msmds.cn/h5/react_web/unicom/scratchcardItemPage`, + origin: "https://wxapp.msmds.cn", }, - url: `https://wxapp.msmds.cn/jplus/h5/channelScratchCard/doScratchCard?` + w(a), - method: 'GET' - }) + url: + `https://wxapp.msmds.cn/jplus/h5/channelScratchCard/doScratchCard?` + + w(a), + method: "GET", + }); if (result.data.code !== 200) { - console.log(result.data.msg) + console.log(result.data.msg); } else { - console.log('提交任务成功', `+${result.data.data.prizeType ? result.data.data.integral : 0}`) + console.log( + "提交任务成功", + `+${result.data.data.prizeType ? result.data.data.integral : 0}` + ); } - console.log('等待15秒再继续') - await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)) + console.log("等待15秒再继续"); + await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); } } else { - console.log('暂无可刮得商品') + console.log("暂无可刮得商品"); } - } -} + }, +}; -module.exports = dailyVideoScratchcard \ No newline at end of file +module.exports = dailyVideoScratchcard; From 80fb54493aaf200ef15bdadb086f00613294c68e Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Tue, 9 Feb 2021 17:55:31 +0800 Subject: [PATCH 029/128] =?UTF-8?q?=E2=9D=8C=20deprecated=20dailyTurntable?= =?UTF-8?q?Page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .prettierrc | 1 + commands/tasks/unicom/init.js | 227 ++++++------ commands/tasks/unicom/unicom.js | 18 +- commands/unicom.js | 126 +++---- index.js | 4 +- utils/request.js | 88 ++--- utils/scheduler.js | 607 ++++++++++++++++++-------------- utils/util.js | 6 +- 8 files changed, 593 insertions(+), 484 deletions(-) diff --git a/.prettierrc b/.prettierrc index a059c584e..c00e96acf 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,6 +1,7 @@ { "trailingComma": "es5", "tabWidth": 2, + "printWidth": 80, "semi": true, "singleQuote": false, "endOfLine": "lf" diff --git a/commands/tasks/unicom/init.js b/commands/tasks/unicom/init.js index 7ad031943..6ac1d816d 100644 --- a/commands/tasks/unicom/init.js +++ b/commands/tasks/unicom/init.js @@ -1,35 +1,40 @@ -const { getCookies, saveCookies } = require('../../../utils/util') -var crypto = require('crypto'); -var moment = require('moment'); -moment.locale('zh-cn'); +const { getCookies, saveCookies } = require("../../../utils/util"); +var crypto = require("crypto"); +var moment = require("moment"); +moment.locale("zh-cn"); // 联通APP版本 -const unicom_version = '8.0100' +const unicom_version = "8.0100"; const publicKey = `-----BEGIN PUBLIC KEY----- MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDc+CZK9bBA9IU+gZUOc6 FUGu7yO9WpTNB0PzmgFBh96Mg1WrovD1oqZ+eIF4LjvxKXGOdI79JRdve9 NPhQo07+uqGQgE4imwNnRx7PFtCRryiIEcUoavuNtuRVoBAm6qdB0Srctg aqGfLgKvZHOnwTjyNqjBUxzMeQlEC2czEMSwIDAQAB ------END PUBLIC KEY-----`.toString('ascii') +-----END PUBLIC KEY-----`.toString("ascii"); // 创建加密算法 const rsapublicKeyEncode = function (data) { - let crypted = crypto.publicEncrypt({ - key: publicKey, - padding: crypto.constants.RSA_PKCS1_PADDING - }, Buffer.from(data)).toString('base64'); + let crypted = crypto + .publicEncrypt( + { + key: publicKey, + padding: crypto.constants.RSA_PKCS1_PADDING, + }, + Buffer.from(data) + ) + .toString("base64"); return crypted; }; var transParams = (data) => { let params = new URLSearchParams(); for (let item in data) { - params.append(item, data['' + item + '']); + params.append(item, data["" + item + ""]); } return params; }; -var chars = ['1', '2', '3', '4', '5', '6', '7', '8', '9']; +var chars = ["1", "2", "3", "4", "5", "6", "7", "8", "9"]; function generateMixed(n) { let res = ""; for (var i = 0; i < n; i++) { @@ -40,129 +45,143 @@ function generateMixed(n) { } module.exports = async (axios, params) => { - let { cookies, options } = params - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} ` - let token_online - let appId - let data + let { cookies, options } = params; + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0102,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} `; + let token_online; + let appId; + let data; if (cookies) { let res = await axios.request({ - baseURL: 'https://m.client.10010.com', + baseURL: "https://m.client.10010.com", headers: { "user-agent": useragent, - "referer": "https://m.client.10010.com", - "origin": "https://m.client.10010.com" + referer: "https://m.client.10010.com", + origin: "https://m.client.10010.com", }, url: `/mobileService/customer/query/getMyUnicomDateTotle.htm`, - method: 'post' - }) - data = res.data - config = res.config - let cookiesJson = config.jar.toJSON() - token_online = cookiesJson.cookies.find(i => i.key == 'token_online') + method: "post", + }); + data = res.data; + let config = res.config; + let cookiesJson = config.jar.toJSON(); + token_online = cookiesJson.cookies.find((i) => i.key == "token_online"); if (token_online) { - token_online = token_online.value + token_online = token_online.value; } else { - token_online = undefined + token_online = undefined; } - appId = cookiesJson.cookies.find(i => i.key == 'appId') + appId = cookiesJson.cookies.find((i) => i.key == "appId"); if (appId) { - appId = appId.value || options.appid + appId = appId.value || options.appid; } else { - appId = undefined + appId = undefined; } } - if (Object.prototype.toString.call(data) !== '[object Object]' || !data || !('phone' in data)) { - console.log('cookies凭据访问失败,将使用账户密码登录') - if (!('appid' in options) || !options['appid']) { - throw new Error("需要提供appid") + if ( + Object.prototype.toString.call(data) !== "[object Object]" || + !data || + !("phone" in data) + ) { + console.log("cookies凭据访问失败,将使用账户密码登录"); + if (!("appid" in options) || !options["appid"]) { + throw new Error("需要提供appid"); } - if (options['user']) { - if (!('password' in options) || !options['password']) { - throw new Error("需要提供登陆密码") + if (options["user"]) { + if (!("password" in options) || !options["password"]) { + throw new Error("需要提供登陆密码"); } } else if (!cookies) { - throw new Error("需要提供登录信息,使用密码账号或者cookies") + throw new Error("需要提供登录信息,使用密码账号或者cookies"); } - const deviceId = generateMixed(15) - var params = { + const deviceId = generateMixed(15); + var params1 = { // ChinaunicomMobileBusiness - 'appId': appId || options.appid, - 'deviceBrand': 'samsung', - 'deviceCode': deviceId + '', - 'deviceId': deviceId + '', - 'deviceModel': 'SM-G977N', - 'deviceOS': 'android7.1.2', - 'isRemberPwd': 'true', - 'keyVersion': '', - 'mobile': rsapublicKeyEncode(options.user), - 'netWay': 'Wifi', - 'password': rsapublicKeyEncode(options.password), - 'pip': '172.16.70.15', - 'provinceChanel': 'general', - 'simCount': '0', - 'timestamp': moment().format('YYYYMMDDHHmmss'), - 'version': `android@${unicom_version}`, - 'yw_code': '' - } + appId: appId || options.appid, + deviceBrand: "samsung", + deviceCode: deviceId + "", + deviceId: deviceId + "", + deviceModel: "SM-G977N", + deviceOS: "android7.1.2", + isRemberPwd: "true", + keyVersion: "", + mobile: rsapublicKeyEncode(options.user), + netWay: "Wifi", + password: rsapublicKeyEncode(options.password), + pip: "172.16.70.15", + provinceChanel: "general", + simCount: "0", + timestamp: moment().format("YYYYMMDDHHmmss"), + version: `android@${unicom_version}`, + yw_code: "", + }; const { data, config } = await axios.request({ - baseURL: 'https://m.client.10010.com', + baseURL: "https://m.client.10010.com", headers: { "user-agent": useragent, - "referer": "https://m.client.10010.com", - "origin": "https://m.client.10010.com" + referer: "https://m.client.10010.com", + origin: "https://m.client.10010.com", }, url: `/mobileService/login.htm`, - method: 'post', - data: transParams(params) - }) - if (data.code !== '0') { - throw new Error('登陆失败:' + data.dsc) + method: "post", + data: transParams(params1), + }); + if (data.code !== "0") { + throw new Error("登陆失败:" + data.dsc); } - cookies = 'token_online=' + data.token_online + '; appId=' + data.appId - await saveCookies('unicom_' + (options.user || 'default'), cookies, config.jar) - console.log('获得登录状态成功') + cookies = "token_online=" + data.token_online + "; appId=" + data.appId; + await saveCookies( + "unicom_" + (options.user || "default"), + cookies, + config.jar + ); + console.log("获得登录状态成功"); } else { - const deviceId = generateMixed(15) - var params = { - 'appId': appId, - 'deviceBrand': 'samsung', - 'deviceCode': deviceId, - 'deviceId': deviceId, - 'deviceModel': 'SM-G977N', - 'deviceOS': 'android7.1.2', - 'netWay': 'Wifi', - 'platformToken': '0867442035025655300000391200CN01', - 'pushPlatform': 'samsung', - 'reqtime': new Date().getTime(), - 'token_online': token_online, - 'version': `android@${unicom_version}`, - } + const deviceId = generateMixed(15); + params = { + appId: appId, + deviceBrand: "samsung", + deviceCode: deviceId, + deviceId: deviceId, + deviceModel: "SM-G977N", + deviceOS: "android7.1.2", + netWay: "Wifi", + platformToken: "0867442035025655300000391200CN01", + pushPlatform: "samsung", + reqtime: new Date().getTime(), + token_online: token_online, + version: `android@${unicom_version}`, + }; if (!params.appId) { - throw new Error('appId参数无效') + throw new Error("appId参数无效"); } if (!params.token_online) { - throw new Error('token_online参数无效') + throw new Error("token_online参数无效"); } - const { data, config } = await axios.request({ - baseURL: 'https://m.client.10010.com', - headers: { - "user-agent": useragent, - "referer": "https://m.client.10010.com", - "origin": "https://m.client.10010.com" - }, - url: `/mobileService/onLine.htm`, - method: 'post', - data: transParams(params) - }).catch(err => console.log(err)) + const { data, config } = await axios + .request({ + baseURL: "https://m.client.10010.com", + headers: { + "user-agent": useragent, + referer: "https://m.client.10010.com", + origin: "https://m.client.10010.com", + }, + url: `/mobileService/onLine.htm`, + method: "post", + data: transParams(params), + }) + .catch((err) => console.log(err)); - if (data.code !== '0') { - console.log(data.dsc) + if (data.code !== "0") { + console.log(data.dsc); } - cookies += '; token_online=' + data.token_online + '; appId=' + data.appId - await saveCookies('unicom_' + (options.user || 'default'), cookies, config.jar) - console.log('获得登录状态成功') + cookies += "; token_online=" + data.token_online + "; appId=" + data.appId; + await saveCookies( + "unicom_" + (options.user || "default"), + cookies, + config.jar + ); + console.log("获得登录状态成功"); } -} \ No newline at end of file +}; diff --git a/commands/tasks/unicom/unicom.js b/commands/tasks/unicom/unicom.js index f3927b82b..4cc67e22a 100644 --- a/commands/tasks/unicom/unicom.js +++ b/commands/tasks/unicom/unicom.js @@ -18,7 +18,7 @@ * 首页-签到有礼-免费抽-拿苹果iPad Pro(摇一摇) * 首页-签到有礼-免费抽-拆华为Pad(去抽奖) * 首页-签到有礼-免费抽-拿iPhone12(摇一摇) - * 首页-签到有礼-免费抽-赢Apple Watch(去抽奖) + * 首页-签到有礼-免费抽-赢Apple Watch(去抽奖) [活动取消] * 首页-签到有礼-赢vivo X60(翻牛牌) * 首页-签到有礼-赚更多福利-看视频奖励5积分 * 首页-签到有礼-赚更多福利-天天抽好礼 @@ -241,14 +241,14 @@ var start = async (params) => { taskOption ); - // 首页-签到有礼-免费抽-赢Apple Watch(去抽奖) - await scheduler.regTask( - "dailyTurntablePage", - async (request) => { - await require("./dailyTurntablePage").doTask(request, options); - }, - taskOption - ); + // // 首页-签到有礼-免费抽-赢Apple Watch(去抽奖) + // await scheduler.regTask( + // "dailyTurntablePage", + // async (request) => { + // await require("./dailyTurntablePage").doTask(request, options); + // }, + // taskOption + // ); // 首页-签到有礼-赢vivo X60(翻牛牌) await scheduler.regTask( diff --git a/commands/unicom.js b/commands/unicom.js index 91d9f11a6..08071031c 100644 --- a/commands/unicom.js +++ b/commands/unicom.js @@ -1,87 +1,91 @@ +const path = require("path"); +const { scheduler } = require("../utils/scheduler"); -const path = require('path') -const { scheduler } = require('../utils/scheduler') +exports.command = "unicom"; -exports.command = 'unicom' - -exports.describe = 'unicom任务' +exports.describe = "unicom任务"; exports.builder = function (yargs) { return yargs - .option('user', { - describe: '用于登录的手机号码', - default: '', - type: 'string' + .option("user", { + describe: "用于登录的手机号码", + default: "", + type: "string", }) - .option('password', { - describe: '用于登录的账户密码', - default: '', - type: 'string' + .option("password", { + describe: "用于登录的账户密码", + default: "", + type: "string", }) - .option('appid', { - describe: 'appid', - default: '', - type: 'string' + .option("appid", { + describe: "appid", + default: "", + type: "string", }) - .option('cookies', { - describe: '签到cookies', - default: '', - type: 'string' + .option("cookies", { + describe: "签到cookies", + default: "", + type: "string", }) .help() - .showHelpOnFail(true, '使用--help查看有效选项') - .epilog('copyright 2020 LunnLew'); -} + .showHelpOnFail(true, "使用--help查看有效选项") + .epilog("copyright 2020 LunnLew"); +}; exports.handler = async function (argv) { - var command = argv._[0] - var accounts = [] - if ('accountSn' in argv && argv.accountSn) { - let accountSns = (argv.accountSn + '').split(',') + var command = argv._[0]; + var accounts = []; + if ("accountSn" in argv && argv.accountSn) { + let accountSns = (argv.accountSn + "").split(","); for (let sn of accountSns) { - if (('user-' + sn) in argv) { + if ("user-" + sn in argv) { let account = { - cookies: argv['cookies-' + sn], - user: argv['user-' + sn] + '', - password: argv['password-' + sn] + '', - appid: argv['appid-' + sn], - tasks: argv['tasks-' + sn] || argv['tasks'] - } - if (('tryrun-' + sn) in argv) { - account['tryrun'] = true + cookies: argv["cookies-" + sn], + user: argv["user-" + sn] + "", + password: argv["password-" + sn] + "", + appid: argv["appid-" + sn], + tasks: argv["tasks-" + sn] || argv["tasks"], + }; + if ("tryrun-" + sn in argv) { + account["tryrun"] = true; } - accounts.push(account) + accounts.push(account); } } } else { accounts.push({ - cookies: argv['cookies'], - user: argv['user'] + '', - password: argv['password'] + '', - appid: argv['appid'], - tasks: argv['tasks'] - }) + cookies: argv["cookies"], + user: argv["user"] + "", + password: argv["password"] + "", + appid: argv["appid"], + tasks: argv["tasks"], + }); } - console.log('总账户数', accounts.length) + console.log("总账户数", accounts.length); for (let account of accounts) { - await require(path.join(__dirname, 'tasks', command, command)).start({ - cookies: account.cookies, - options: { - appid: account.appid, - user: account.user, - password: account.password - } - }).catch(err => console.log("unicom任务:", err)) + await require(path.join(__dirname, "tasks", command, command)) + .start({ + cookies: account.cookies, + options: { + appid: account.appid, + user: account.user, + password: account.password, + }, + }) + .catch((err) => console.log(" unicom任务:", err)); let hasTasks = await scheduler.hasWillTask(command, { - tryrun: 'tryrun' in argv, - taskKey: account.user - }) + tryrun: "tryrun" in argv, + taskKey: account.user, + }); if (hasTasks) { - scheduler.execTask(command, account.tasks).catch(err => console.log("unicom任务:", err)).finally(() => { - console.log('当前任务执行完毕!') - }) + scheduler + .execTask(command, account.tasks) + .catch((err) => console.log("unicom任务:", err)) + .finally(() => { + console.log("当前任务执行完毕!"); + }); } else { - console.log('暂无可执行任务!') + console.log("暂无可执行任务!"); } } -} \ No newline at end of file +}; diff --git a/index.js b/index.js index fe309d750..6bfd9acf9 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,3 @@ (async () => { - require('./AutoSignMachine.js').run() -})() \ No newline at end of file + require("./AutoSignMachine.js").run(); +})(); diff --git a/utils/request.js b/utils/request.js index 89ed802c4..a8a5b03f7 100644 --- a/utils/request.js +++ b/utils/request.js @@ -1,66 +1,68 @@ -const axios = require('axios'); -const axiosCookieJarSupport = require('axios-cookiejar-support').default; -const tough = require('tough-cookie'); +const axios = require("axios"); +const axiosCookieJarSupport = require("axios-cookiejar-support").default; +const tough = require("tough-cookie"); axiosCookieJarSupport(axios); const err = (error) => { - return Promise.reject(error) -} + return Promise.reject(error); +}; var parseDefaultCookie = function (cookies) { - let cookie = [] - if (Object.prototype.toString.call(cookies) == '[object String]') { - cookie = cookies ? [cookies] : [] - } else if (Object.prototype.toString.call(cookies) == '[object Object]') { - Object.keys(cookies).forEach(item => { - cookie.push(item + '=' + cookies[item]) - }) + let cookie = []; + if (Object.prototype.toString.call(cookies) == "[object String]") { + cookie = cookies ? [cookies] : []; + } else if (Object.prototype.toString.call(cookies) == "[object Object]") { + Object.keys(cookies).forEach((item) => { + cookie.push(item + "=" + cookies[item]); + }); } - return cookie.join('; ') -} + return cookie.join("; "); +}; var setCookieString = function (jar, cookies, config) { - let url - if (config.url.indexOf('http') === 0) { - url = config.url + let url; + if (config.url.indexOf("http") === 0) { + url = config.url; } else { - url = config.baseURL + config.url + url = config.baseURL + config.url; } - let uuuu = new URL(url) + let uuuu = new URL(url); // console.log('setCookieString for', uuuu.origin) - cookies = parseDefaultCookie(cookies) - if (Object.prototype.toString.call(cookies) == '[object String]') { - cookies.length && cookies.split('; ').forEach(cookie => { - jar.setCookieSync(cookie, uuuu.origin + '/', {}) - }) + cookies = parseDefaultCookie(cookies); + if (Object.prototype.toString.call(cookies) == "[object String]") { + cookies.length && + cookies.split("; ").forEach((cookie) => { + jar.setCookieSync(cookie, uuuu.origin + "/", {}); + }); } - return jar -} + return jar; +}; -module.exports = cookies => { +module.exports = (cookies) => { const service = axios.create({ headers: { - Cookie: parseDefaultCookie(cookies) + Cookie: parseDefaultCookie(cookies), }, jar: new tough.CookieJar(), timeout: 60000, - withCredentials: true - }) - service.interceptors.request.use(async config => { - if (!('user-agent' in config.headers)) { - config.headers['user-agent'] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36' + withCredentials: true, + }); + service.interceptors.request.use(async (config) => { + if (!("user-agent" in config.headers)) { + config.headers["user-agent"] = + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36"; } - let jar = config.jar + let jar = config.jar; if (!jar) { - jar = new tough.CookieJar() + jar = new tough.CookieJar(); } else { - config.headers['Cookie'] = '' + config.headers["Cookie"] = ""; } - config.jar = setCookieString(jar, cookies, config) - return config - }, err) - service.interceptors.response.use(async response => { - return response - }, err) + config.jar = setCookieString(jar, cookies, config); + return config; + }, err); + service.interceptors.response.use(async (response) => { + return response; + }, err); return service; -} \ No newline at end of file +}; diff --git a/utils/scheduler.js b/utils/scheduler.js index 218cde9bb..760d23acb 100644 --- a/utils/scheduler.js +++ b/utils/scheduler.js @@ -1,285 +1,368 @@ -const os = require('os') -const path = require('path') -const fs = require('fs-extra') -var moment = require('moment'); -moment.locale('zh-cn'); -const { getCookies, saveCookies, delCookiesFile } = require('./util') -const _request = require('./request') -var crypto = require('crypto'); -const { default: PQueue } = require('p-queue'); +const os = require("os"); +const path = require("path"); +const fs = require("fs-extra"); +var moment = require("moment"); +moment.locale("zh-cn"); +const { getCookies } = require("./util"); +const _request = require("./request"); +var crypto = require("crypto"); +const { default: PQueue } = require("p-queue"); String.prototype.replaceWithMask = function (start, end) { - return this.substr(0, start) + '******' + this.substr(-end, end) -} + return this.substr(0, start) + "******" + this.substr(-end, end); +}; const randomDate = (options) => { - let startDate = moment(); - let endDate = moment().endOf('days').subtract(2, 'hours'); - if (options && options.startHours) { - startDate = moment().startOf('days').add(options.startHours, 'hours') - } - if (options && options.endHours) { - endDate = moment().startOf('days').add(options.endHours, 'hours') - } - return new Date(+startDate.toDate() + Math.random() * (endDate.toDate() - startDate.toDate())); + let startDate = moment(); + let endDate = moment().endOf("days").subtract(2, "hours"); + if (options && options.startHours) { + startDate = moment().startOf("days").add(options.startHours, "hours"); + } + if (options && options.endHours) { + endDate = moment().startOf("days").add(options.endHours, "hours"); + } + // eslint-disable-next-line prettier/prettier + return new Date( + startDate.toDate() + Math.random() * (endDate.toDate() - startDate.toDate()) + ); }; -let tasks = {} +let tasks = {}; let scheduler = { - taskFile: path.join(os.homedir(), '.AutoSignMachine', 'taskFile.json'), - today: '', - isRunning: false, - isTryRun: false, - taskJson: undefined, - queues: [], - will_queues: [], - taskKey: 'default', - clean: async () => { - scheduler.today = ''; - scheduler.isRunning = false; - scheduler.isTryRun = false; - scheduler.taskJson = undefined; - scheduler.queues = []; - scheduler.will_queues = []; - scheduler.taskKey = 'default'; - }, - buildQueues: async () => { - let queues = [] - let taskNames = Object.keys(tasks) - for (let taskName of taskNames) { - let options = tasks[taskName].options - let willTime = moment(randomDate(options)); - let waitTime = options.dev ? 0 : Math.floor(Math.random() * 600) - if (options) { - if (options.isCircle || options.dev) { - willTime = moment().startOf('days'); - } - if (options.startTime) { - willTime = moment().startOf('days').add(options.startTime, 'seconds'); - } - if (options.ignoreRelay) { - waitTime = 0; - } - } - if (scheduler.isTryRun) { - willTime = moment().startOf('days'); - waitTime = 0; - } - queues.push({ - taskName: taskName, - taskState: 0, - willTime: willTime.format('YYYY-MM-DD HH:mm:ss'), - waitTime: waitTime - }) - } - return queues - }, - // 初始化待执行的任务队列 - initTasksQueue: async () => { - const today = moment().format('YYYYMMDD') - if (!fs.existsSync(scheduler.taskFile)) { - console.log('任务配置文件不存在,创建配置中') - let queues = await scheduler.buildQueues() - fs.ensureFileSync(scheduler.taskFile) - fs.writeFileSync(scheduler.taskFile, JSON.stringify({ - today, - queues - })) - } else { - let taskJson = fs.readFileSync(scheduler.taskFile).toString('utf-8') - taskJson = JSON.parse(taskJson) - if (taskJson.today !== today) { - console.log('日期已变更,重新生成任务配置') - let queues = await scheduler.buildQueues() - fs.writeFileSync(scheduler.taskFile, JSON.stringify({ - today, - queues - })) - } - - if (taskJson.queues.length !== Object.keys(tasks).length) { - console.log('数量已变更,重新生成任务配置') - let queues = await scheduler.buildQueues() - fs.writeFileSync(scheduler.taskFile, JSON.stringify({ - today, - queues - })) - } - } - scheduler.today = today - }, - genFileName(command) { - let dir = path.join(os.homedir(), '.AutoSignMachine') - if ('TENCENTCLOUD_RUNENV' in process.env && process.env.TENCENTCLOUD_RUNENV === 'SCF') { - dir = path.join('/tmp', '.AutoSignMachine') - // 暂不支持持久化配置,使用一次性执行机制,函数超时时间受functions.timeout影响 - scheduler.isTryRun = true + taskFile: path.join(os.homedir(), ".AutoSignMachine", "taskFile.json"), + today: "", + isRunning: false, + isTryRun: false, + taskJson: undefined, + queues: [], + will_queues: [], + taskKey: "default", + clean: async () => { + scheduler.today = ""; + scheduler.isRunning = false; + scheduler.isTryRun = false; + scheduler.taskJson = undefined; + scheduler.queues = []; + scheduler.will_queues = []; + scheduler.taskKey = "default"; + }, + buildQueues: async () => { + let queues = []; + let taskNames = Object.keys(tasks); + for (let taskName of taskNames) { + let options = tasks[taskName].options; + let willTime = moment(randomDate(options)); + let waitTime = options.dev ? 0 : Math.floor(Math.random() * 600); + if (options) { + if (options.isCircle || options.dev) { + willTime = moment().startOf("days"); } - if (!fs.existsSync(dir)) { - fs.mkdirpSync(dir) + if (options.startTime) { + willTime = moment().startOf("days").add(options.startTime, "seconds"); } - scheduler.taskFile = path.join(dir, `taskFile_${command}_${scheduler.taskKey}.json`) - let maskFile = path.join(dir, `taskFile_${command}_${scheduler.taskKey.replaceWithMask(2, 3)}.json`) - scheduler.today = moment().format('YYYYMMDD') - console.log('获得配置文件', maskFile, '当前日期', scheduler.today) - }, - loadTasksQueue: async () => { - let queues = [] - let will_queues = [] - let taskJson = {} - if (fs.existsSync(scheduler.taskFile)) { - taskJson = fs.readFileSync(scheduler.taskFile).toString('utf-8') - taskJson = JSON.parse(taskJson) - if (taskJson.today === scheduler.today) { - queues = taskJson.queues - } - if (scheduler.isTryRun) { - fs.unlinkSync(scheduler.taskFile) - } - } - for (let task of queues) { - if (task.taskState === 0 && moment(task.willTime).isBefore(moment(), 'minutes')) { - will_queues.push(task) - } + if (options.ignoreRelay) { + waitTime = 0; } - scheduler.taskJson = taskJson - scheduler.queues = queues - scheduler.will_queues = will_queues - return { - taskJson, + } + if (scheduler.isTryRun) { + willTime = moment().startOf("days"); + waitTime = 0; + } + queues.push({ + taskName: taskName, + taskState: 0, + willTime: willTime.format("YYYY-MM-DD HH:mm:ss"), + waitTime: waitTime, + }); + } + return queues; + }, + // 初始化待执行的任务队列 + initTasksQueue: async () => { + const today = moment().format("YYYYMMDD"); + if (!fs.existsSync(scheduler.taskFile)) { + console.log("任务配置文件不存在,创建配置中"); + let queues = await scheduler.buildQueues(); + fs.createFileSync(scheduler.taskFile); + fs.writeFileSync( + scheduler.taskFile, + JSON.stringify({ + today, + queues, + }) + ); + console.log("📑 任务配置文件创建完毕 等待5秒再继续"); + // eslint-disable-next-line no-unused-vars + await new Promise((resolve, reject) => setTimeout(resolve, 5 * 1000)); + } else { + let taskJson = fs.readFileSync(scheduler.taskFile).toString("utf-8"); + taskJson = JSON.parse(taskJson); + if (taskJson.today !== today) { + console.log("日期已变更,重新生成任务配置"); + let queues = await scheduler.buildQueues(); + fs.writeFileSync( + scheduler.taskFile, + JSON.stringify({ + today, queues, - will_queues - } - }, - regTask: async (taskName, callback, options) => { - tasks[taskName] = { - callback, - options - } - }, - hasWillTask: async (command, params) => { - const { taskKey, tryrun } = params - scheduler.clean() - scheduler.isTryRun = tryrun - scheduler.taskKey = taskKey || 'default' - if (scheduler.isTryRun) { - console.log('!!!当前运行在TryRun模式,仅建议在测试时运行!!!') - await new Promise((resolve) => setTimeout(resolve, 3000)) - } - console.log('将使用', scheduler.taskKey.replaceWithMask(2, 3), '作为账户识别码') - console.log('计算可执行任务') - await scheduler.genFileName(command) - await scheduler.initTasksQueue() - let { will_queues } = await scheduler.loadTasksQueue() - scheduler.isRunning = true - return will_queues.length - }, - execTask: async (command, selectedTasks) => { - console.log('开始执行任务') - if (!scheduler.isRunning) { - await scheduler.genFileName(command) - await scheduler.initTasksQueue() - } - if (Object.prototype.toString.call(selectedTasks) == '[object String]') { - selectedTasks = selectedTasks.split(',').filter(q => q) - } else { - selectedTasks = [] - } - if (selectedTasks.length) { - console.log('将只执行选择的任务', selectedTasks.join(',')) - } - let { taskJson, queues, will_queues } = scheduler - - let will_tasks = will_queues.filter(task => task.taskName in tasks && (!selectedTasks.length || selectedTasks.length && selectedTasks.indexOf(task.taskName) !== -1)) + }) + ); + console.log("📑 任务配置文件更新完毕 等待5秒再继续"); + // eslint-disable-next-line no-unused-vars + await new Promise((resolve, reject) => setTimeout(resolve, 5 * 1000)); + } - console.log(`获取总任务数${taskJson.queues.length},已完成任务数${queues.filter(q => q.taskState === 1).length},截至当前可执行任务数${will_tasks.length}`) + if (taskJson.queues.length !== Object.keys(tasks).length) { + console.log("数量已变更,重新生成任务配置"); + let queues = await scheduler.buildQueues(); + fs.writeFileSync( + scheduler.taskFile, + JSON.stringify({ + today, + queues, + }) + ); + console.log("📑 任务配置文件更新完毕 等待5秒再继续"); + // eslint-disable-next-line no-unused-vars + await new Promise((resolve, reject) => setTimeout(resolve, 5 * 1000)); + } + } + scheduler.today = today; + }, + genFileName(command) { + let dir = path.join(os.homedir(), ".AutoSignMachine"); + if ( + "TENCENTCLOUD_RUNENV" in process.env && + process.env.TENCENTCLOUD_RUNENV === "SCF" + ) { + dir = path.join("/tmp", ".AutoSignMachine"); + // 暂不支持持久化配置,使用一次性执行机制,函数超时时间受functions.timeout影响 + scheduler.isTryRun = true; + } + if (!fs.existsSync(dir)) { + fs.mkdirpSync(dir); + } + scheduler.taskFile = path.join( + dir, + `taskFile_${command}_${scheduler.taskKey}.json` + ); + let maskFile = path.join( + dir, + `taskFile_${command}_${scheduler.taskKey.replaceWithMask(2, 3)}.json` + ); + scheduler.today = moment().format("YYYYMMDD"); + console.log("获得配置文件", maskFile, "当前日期", scheduler.today); + }, + loadTasksQueue: async () => { + let queues = []; + let will_queues = []; + let taskJson = {}; + if (fs.existsSync(scheduler.taskFile)) { + taskJson = fs.readFileSync(scheduler.taskFile).toString("utf-8"); + console.log("📑 任务配置文件读取完毕 等待5秒再继续"); + // eslint-disable-next-line no-unused-vars + await new Promise((resolve, reject) => setTimeout(resolve, 5 * 1000)); + taskJson = JSON.parse(taskJson); + if (taskJson.today === scheduler.today) { + queues = taskJson.queues; + } + if (scheduler.isTryRun) { + fs.unlinkSync(scheduler.taskFile); + } + } + for (let task of queues) { + if ( + task.taskState === 0 && + moment(task.willTime).isBefore(moment(), "minutes") + ) { + will_queues.push(task); + } + } + scheduler.taskJson = taskJson; + scheduler.queues = queues; + scheduler.will_queues = will_queues; + return { + taskJson, + queues, + will_queues, + }; + }, + regTask: async (taskName, callback, options) => { + tasks[taskName] = { + callback, + options, + }; + }, + hasWillTask: async (command, params) => { + const { taskKey, tryrun } = params; + scheduler.clean(); + scheduler.isTryRun = tryrun; + scheduler.taskKey = taskKey || "default"; + if (scheduler.isTryRun) { + console.log("👉 当前运行在TryRun模式,仅建议在测试时运行!"); + await new Promise((resolve) => setTimeout(resolve, 3000)); + } + console.log( + "将使用", + scheduler.taskKey.replaceWithMask(2, 3), + "作为账户识别码" + ); + console.log("计算可执行任务..."); + scheduler.genFileName(command); + await scheduler.initTasksQueue(); + let { will_queues } = await scheduler.loadTasksQueue(); + scheduler.isRunning = true; + return will_queues.length; + }, + execTask: async (command, selectedTasks) => { + console.log("🤨 开始执行任务"); + if (!scheduler.isRunning) { + await scheduler.genFileName(command); + await scheduler.initTasksQueue(); + } + if (Object.prototype.toString.call(selectedTasks) == "[object String]") { + selectedTasks = selectedTasks.split(",").filter((q) => q); + } else { + selectedTasks = []; + } + if (selectedTasks.length) { + console.log("👉 将只执行选择的任务", selectedTasks.join(",")); + } + let { taskJson, queues, will_queues } = scheduler; - if (will_tasks.length) { - if (scheduler.isTryRun) { - await delCookiesFile([command, scheduler.taskKey].join('_')) - } + let will_tasks = will_queues.filter( + (task) => + task.taskName in tasks && + (!selectedTasks.length || + (selectedTasks.length && selectedTasks.indexOf(task.taskName) !== -1)) + ); - // 初始化处理 - let init_funcs = {} - let init_funcs_result = {} - for (let task of will_tasks) { - let ttt = tasks[task.taskName] - let tttOptions = ttt.options || {} + console.log( + `👇 获取总任务数${taskJson.queues.length},已完成任务数${ + queues.filter((q) => q.taskState === 1).length + },截至当前可执行任务数${will_tasks.length}` + ); - let savedCookies = await getCookies([command, scheduler.taskKey].join('_')) || tttOptions.cookies - let request = _request(savedCookies) + if (will_tasks.length) { + //TODO: deprecated Cookies will be deleted on TryRun mode + // if (scheduler.isTryRun) { + // console.log("👉 TryRun模式将清除CK操作"); + // await delCookiesFile([command, scheduler.taskKey].join("_")); + // } + // 初始化处理 + let init_funcs = {}; + let init_funcs_result = {}; + for (let task of will_tasks) { + let ttt = tasks[task.taskName]; + let tttOptions = ttt.options || {}; + let savedCookies = + getCookies([command, scheduler.taskKey].join("_")) || + tttOptions.cookies; + let request = _request(savedCookies); - if (tttOptions.init) { - if (Object.prototype.toString.call(tttOptions.init) === '[object AsyncFunction]') { - let hash = crypto.createHash('md5').update(tttOptions.init.toString()).digest('hex') - if (!(hash in init_funcs)) { - init_funcs_result[task.taskName + '_init'] = await tttOptions['init'](request, savedCookies) - init_funcs[hash] = task.taskName + '_init' - } else { - init_funcs_result[task.taskName + '_init'] = init_funcs_result[init_funcs[hash]] - } - } else { - console.log('not apply') - } - } else { - init_funcs_result[task.taskName + '_init'] = { request } - } + if (tttOptions.init) { + if ( + Object.prototype.toString.call(tttOptions.init) === + "[object AsyncFunction]" + ) { + let hash = crypto + .createHash("md5") + .update(tttOptions.init.toString()) + .digest("hex"); + if (!(hash in init_funcs)) { + init_funcs_result[task.taskName + "_init"] = await tttOptions[ + "init" + ](request, savedCookies); + init_funcs[hash] = task.taskName + "_init"; + } else { + init_funcs_result[task.taskName + "_init"] = + init_funcs_result[init_funcs[hash]]; } + } else { + console.log("not apply"); + } + } else { + init_funcs_result[task.taskName + "_init"] = { request }; + } + } - // 任务执行 - let queue = new PQueue({ concurrency: 2 }); - console.log('调度任务中', '并发数', 2) - for (let task of will_tasks) { - queue.add(async () => { - try { - if (task.waitTime) { - console.log('延迟执行', task.taskName, task.waitTime, 'seconds') - await new Promise((resolve, reject) => setTimeout(resolve, task.waitTime * 1000)) - } + // 任务执行 + let queue = new PQueue({ concurrency: 2 }); + console.log("👉 调度任务中", "并发数", 2); + for (let task of will_tasks) { + queue.add(async () => { + try { + if (task.waitTime) { + console.log( + "☕ 延迟执行", + task.taskName, + task.waitTime, + "seconds" + ); + // eslint-disable-next-line no-unused-vars + await new Promise((resolve, reject) => + setTimeout(resolve, task.waitTime * 1000) + ); + } - let ttt = tasks[task.taskName] - if (Object.prototype.toString.call(ttt.callback) === '[object AsyncFunction]') { - await ttt.callback.apply(this, Object.values(init_funcs_result[task.taskName + '_init'])) - } else { - console.log('任务执行内容空') - } + let ttt = tasks[task.taskName]; + if ( + Object.prototype.toString.call(ttt.callback) === + "[object AsyncFunction]" + ) { + await ttt.callback.apply( + this, + Object.values(init_funcs_result[task.taskName + "_init"]) + ); + } else { + console.log("❌ 任务执行内容空"); + } - let isupdate = false - let newTask = {} - if (ttt.options) { - if (!ttt.options.isCircle) { - newTask.taskState = 1 - isupdate = true - } - if (ttt.options.isCircle && ttt.options.intervalTime) { - newTask.willTime = moment().add(ttt.options.intervalTime, 'seconds').format('YYYY-MM-DD HH:mm:ss') - isupdate = true - } - } else { - newTask.taskState = 1 - isupdate = true - } + let isupdate = false; + let newTask = {}; + if (ttt.options) { + if (!ttt.options.isCircle) { + newTask.taskState = 1; + isupdate = true; + } + if (ttt.options.isCircle && ttt.options.intervalTime) { + newTask.willTime = moment() + .add(ttt.options.intervalTime, "seconds") + .format("YYYY-MM-DD HH:mm:ss"); + isupdate = true; + } + } else { + newTask.taskState = 1; + isupdate = true; + } - if (isupdate) { - let taskindex = queues.findIndex(q => q.taskName === task.taskName) - if (taskindex !== -1) { - taskJson.queues[taskindex] = { - ...task, - ...newTask - } - } - fs.writeFileSync(scheduler.taskFile, JSON.stringify(taskJson)) - } - } catch (err) { - console.log('任务错误:', err) - } - }) + if (isupdate) { + let taskindex = queues.findIndex( + (q) => q.taskName === task.taskName + ); + if (taskindex !== -1) { + taskJson.queues[taskindex] = { + ...task, + ...newTask, + }; + } + fs.writeFileSync(scheduler.taskFile, JSON.stringify(taskJson)); + console.log("📑 任务配置文件更新完毕 等待5秒再继续"); + // eslint-disable-next-line no-unused-vars + await new Promise((resolve, reject) => + setTimeout(resolve, 5 * 1000) + ); } - await queue.onIdle() - } else { - console.log('暂无需要执行的任务') - } + } catch (err) { + console.log("❌ 任务错误:", err); + } + }); + } + await queue.onIdle(); + } else { + console.log("⭕ 暂无需要执行的任务"); } -} + }, +}; module.exports = { - scheduler -} \ No newline at end of file + scheduler, +}; diff --git a/utils/util.js b/utils/util.js index c3f0352b2..933cca930 100644 --- a/utils/util.js +++ b/utils/util.js @@ -21,6 +21,7 @@ module.exports = { }, getCookies: (key) => { let dir = path.join(os.homedir(), ".AutoSignMachine"); + let cookies = ""; if ( "TENCENTCLOUD_RUNENV" in process.env && process.env.TENCENTCLOUD_RUNENV === "SCF" @@ -32,10 +33,9 @@ module.exports = { } let cookieFile = path.join(dir, "cookieFile_" + key + ".txt"); if (fs.existsSync(cookieFile)) { - let cookies = fs.readFileSync(cookieFile).toString("utf-8"); - return cookies; + cookies = fs.readFileSync(cookieFile).toString("utf-8"); } - return ""; + return cookies; }, saveCookies: (key, cookies, cookiesJar) => { let dir = path.join(os.homedir(), ".AutoSignMachine"); From b34e0b70283703e2bab9e8c0afef625335961f64 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Tue, 9 Feb 2021 18:42:28 +0800 Subject: [PATCH 030/128] =?UTF-8?q?=F0=9F=9A=A7=20updating=20task?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/unicom.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/commands/tasks/unicom/unicom.js b/commands/tasks/unicom/unicom.js index 4cc67e22a..c1c5d2d14 100644 --- a/commands/tasks/unicom/unicom.js +++ b/commands/tasks/unicom/unicom.js @@ -37,8 +37,6 @@ * */ const { scheduler } = require("../../../utils/scheduler"); -const { getCookies, saveCookies } = require("../../../utils/util"); -const _request = require("../../../utils/request"); var start = async (params) => { const { cookies, options } = params; From 212b066984037d718bb11c788eb2843ccf4d5b2d Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Tue, 9 Feb 2021 18:49:12 +0800 Subject: [PATCH 031/128] =?UTF-8?q?=F0=9F=8F=B3=E2=80=8D=F0=9F=8C=88=20upd?= =?UTF-8?q?ated=20UA=20collections?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .prettierrc | 11 +++++------ commands/tasks/unicom/handlers/myPhone.js | 5 ++++- commands/tasks/unicom/init.js | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.prettierrc b/.prettierrc index c00e96acf..e4f453949 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,8 +1,7 @@ { - "trailingComma": "es5", - "tabWidth": 2, - "printWidth": 80, - "semi": true, - "singleQuote": false, - "endOfLine": "lf" + "trailingComma": "es5", + "tabWidth": 2, + "printWidth": 80, + "semi": true, + "singleQuote": false } \ No newline at end of file diff --git a/commands/tasks/unicom/handlers/myPhone.js b/commands/tasks/unicom/handlers/myPhone.js index a5fe84d9d..4a1771cb6 100644 --- a/commands/tasks/unicom/handlers/myPhone.js +++ b/commands/tasks/unicom/handlers/myPhone.js @@ -13,9 +13,12 @@ const useragent = (options) => { }; // `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36;devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:};unicom{version:android@8.0102,desmobile:${options.user}}`; const USER_AGENTS = [ - "Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@%s,desmobile:%s;devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}", + "Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@%s,desmobile:%s};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}", "Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 unicom{version:iphone_c@%s,desmobile:%s}{systemVersion:dis}{yw_code:}", "Mozilla/5.0 (iPhone; CPU iPhone OS 12_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 unicom{version:iphone_c@%s,desmobile:%s}{systemVersion:dis}{yw_code:}", + "Mozilla/5.0 (Linux; Android 10; V1981A Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.96 Mobile Safari/537.36; unicom{version:android@%s,desmobile:%s};devicetype{deviceBrand:vivo,deviceModel:V1981A};{yw_code:}", + "Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 unicom{version:iphone_c@%s,desmobile:%s}{systemVersion:dis}{yw_code:}", + "Mozilla/5.0 (Linux; Android 9; MI 6 Build/PKQ1-wesley_iui-19.08.24; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.136 Mobile Safari/537.36; unicom{version:android@%s,desmobile:%s};devicetype{deviceBrand:Xiaomi,deviceModel:MI 6};{yw_code:}", ]; function randomNumber(min = 0, max = 100) { diff --git a/commands/tasks/unicom/init.js b/commands/tasks/unicom/init.js index 6ac1d816d..c186f858d 100644 --- a/commands/tasks/unicom/init.js +++ b/commands/tasks/unicom/init.js @@ -1,4 +1,4 @@ -const { getCookies, saveCookies } = require("../../../utils/util"); +const { saveCookies } = require("../../../utils/util"); var crypto = require("crypto"); var moment = require("moment"); moment.locale("zh-cn"); From c0980a27064fd4cd99e3d3a5854fd9b45c28a770 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Tue, 9 Feb 2021 18:53:02 +0800 Subject: [PATCH 032/128] =?UTF-8?q?=F0=9F=8F=B3=E2=80=8D=F0=9F=8C=88=20upd?= =?UTF-8?q?ated=20UA=20collections?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/handlers/myPhone.js | 1 + 1 file changed, 1 insertion(+) diff --git a/commands/tasks/unicom/handlers/myPhone.js b/commands/tasks/unicom/handlers/myPhone.js index 4a1771cb6..0cbf4dc8a 100644 --- a/commands/tasks/unicom/handlers/myPhone.js +++ b/commands/tasks/unicom/handlers/myPhone.js @@ -19,6 +19,7 @@ const USER_AGENTS = [ "Mozilla/5.0 (Linux; Android 10; V1981A Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.96 Mobile Safari/537.36; unicom{version:android@%s,desmobile:%s};devicetype{deviceBrand:vivo,deviceModel:V1981A};{yw_code:}", "Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 unicom{version:iphone_c@%s,desmobile:%s}{systemVersion:dis}{yw_code:}", "Mozilla/5.0 (Linux; Android 9; MI 6 Build/PKQ1-wesley_iui-19.08.24; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.136 Mobile Safari/537.36; unicom{version:android@%s,desmobile:%s};devicetype{deviceBrand:Xiaomi,deviceModel:MI 6};{yw_code:}", + "Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 unicom{version:iphone_c@%s,desmobile:%s}{systemVersion:dis}{yw_code:}", ]; function randomNumber(min = 0, max = 100) { From b111be13a217f9d014edd4b9e4328e0e20a5d02c Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Tue, 9 Feb 2021 19:05:00 +0800 Subject: [PATCH 033/128] =?UTF-8?q?=F0=9F=90=8D=20fixed=20time=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/scheduler.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/scheduler.js b/utils/scheduler.js index 760d23acb..62157c78c 100644 --- a/utils/scheduler.js +++ b/utils/scheduler.js @@ -23,7 +23,8 @@ const randomDate = (options) => { } // eslint-disable-next-line prettier/prettier return new Date( - startDate.toDate() + Math.random() * (endDate.toDate() - startDate.toDate()) + +startDate.toDate() + + Math.random() * (endDate.toDate() - startDate.toDate()) ); }; let tasks = {}; From 86d445bff2a4b48454023fa76fe563637a002ebc Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Tue, 9 Feb 2021 19:43:32 +0800 Subject: [PATCH 034/128] Update .gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index ca424bb7c..c023dc090 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ yarn.lock jspm_packages -.serverless \ No newline at end of file +.serverless +demo.js \ No newline at end of file From c7ce8124dc0c150b6c199611a82ee961cee9b4d5 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Tue, 9 Feb 2021 19:49:23 +0800 Subject: [PATCH 035/128] =?UTF-8?q?=F0=9F=8F=B3=E2=80=8D=F0=9F=8C=88add=20?= =?UTF-8?q?emoji=20icon=20at=20schedule?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/scheduler.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/scheduler.js b/utils/scheduler.js index 62157c78c..e8f6f9cf0 100644 --- a/utils/scheduler.js +++ b/utils/scheduler.js @@ -81,7 +81,7 @@ let scheduler = { initTasksQueue: async () => { const today = moment().format("YYYYMMDD"); if (!fs.existsSync(scheduler.taskFile)) { - console.log("任务配置文件不存在,创建配置中"); + console.log("📑 任务配置文件不存在,创建配置中"); let queues = await scheduler.buildQueues(); fs.createFileSync(scheduler.taskFile); fs.writeFileSync( @@ -98,7 +98,7 @@ let scheduler = { let taskJson = fs.readFileSync(scheduler.taskFile).toString("utf-8"); taskJson = JSON.parse(taskJson); if (taskJson.today !== today) { - console.log("日期已变更,重新生成任务配置"); + console.log("📑 日期已变更,重新生成任务配置"); let queues = await scheduler.buildQueues(); fs.writeFileSync( scheduler.taskFile, @@ -113,7 +113,7 @@ let scheduler = { } if (taskJson.queues.length !== Object.keys(tasks).length) { - console.log("数量已变更,重新生成任务配置"); + console.log("📑 数量已变更,重新生成任务配置"); let queues = await scheduler.buildQueues(); fs.writeFileSync( scheduler.taskFile, @@ -207,7 +207,7 @@ let scheduler = { scheduler.taskKey.replaceWithMask(2, 3), "作为账户识别码" ); - console.log("计算可执行任务..."); + console.log("🤨 计算可执行任务..."); scheduler.genFileName(command); await scheduler.initTasksQueue(); let { will_queues } = await scheduler.loadTasksQueue(); From efc18ec4c7ae45fc513239b45e65598e78c11a2c Mon Sep 17 00:00:00 2001 From: cooip-jm <78735965+cooip-jm@users.noreply.github.com> Date: Tue, 9 Feb 2021 22:14:12 +0800 Subject: [PATCH 036/128] Update init.js fix Cookies files d_deviceId=undefine --- commands/tasks/unicom/init.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/commands/tasks/unicom/init.js b/commands/tasks/unicom/init.js index c186f858d..bf4ab1bfc 100644 --- a/commands/tasks/unicom/init.js +++ b/commands/tasks/unicom/init.js @@ -34,11 +34,11 @@ var transParams = (data) => { return params; }; -var chars = ["1", "2", "3", "4", "5", "6", "7", "8", "9"]; +var chars = ["1", "2", "3", "4", "5", "6", "7", "8", "9","0","a","b","c","d","e","f"]; function generateMixed(n) { let res = ""; for (var i = 0; i < n; i++) { - var id = Math.ceil(Math.random() * 61); + var id = Math.floor(16 * Math.random()); res += chars[id]; } return res; @@ -95,7 +95,7 @@ module.exports = async (axios, params) => { } else if (!cookies) { throw new Error("需要提供登录信息,使用密码账号或者cookies"); } - const deviceId = generateMixed(15); + const deviceId = generateMixed(32); var params1 = { // ChinaunicomMobileBusiness appId: appId || options.appid, @@ -138,7 +138,7 @@ module.exports = async (axios, params) => { ); console.log("获得登录状态成功"); } else { - const deviceId = generateMixed(15); + const deviceId = generateMixed(32); params = { appId: appId, deviceBrand: "samsung", From 97ed3d8c937dad21656adcdd73a48ddfaf909ace Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Tue, 9 Feb 2021 23:05:04 +0800 Subject: [PATCH 037/128] updating task --- commands/tasks/unicom/dailyCheapStorePage.js | 430 ++++++++++--------- commands/tasks/unicom/handlers/PAES.js | 11 + commands/tasks/unicom/handlers/dailyEvent.js | 20 +- commands/tasks/unicom/ingotsPage.js | 52 +++ commands/tasks/unicom/unicom.js | 9 + 5 files changed, 319 insertions(+), 203 deletions(-) create mode 100644 commands/tasks/unicom/ingotsPage.js diff --git a/commands/tasks/unicom/dailyCheapStorePage.js b/commands/tasks/unicom/dailyCheapStorePage.js index 1ce93bfbc..0c9198c04 100644 --- a/commands/tasks/unicom/dailyCheapStorePage.js +++ b/commands/tasks/unicom/dailyCheapStorePage.js @@ -1,337 +1,373 @@ -var crypto = require('crypto'); -var moment = require('moment'); +var crypto = require("crypto"); +var moment = require("moment"); // 首页-签到有礼-免费抽-赢三星Galaxy Z(试试手气) var transParams = (data) => { let params = new URLSearchParams(); for (let item in data) { - params.append(item, data['' + item + '']); + params.append(item, data["" + item + ""]); } return params; }; function w() { - var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {} - , t = []; - return Object.keys(e).forEach((function (a) { - t.push("".concat(a, "=").concat(encodeURIComponent(e[a]))) - } - )), + var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + t = []; + return ( + Object.keys(e).forEach(function (a) { + t.push("".concat(a, "=").concat(encodeURIComponent(e[a]))); + }), t.join("&") + ); } var sign = (data) => { - let str = 'integralofficial&' - let params = [] + let str = "integralofficial&"; + let params = []; data.forEach((v, i) => { if (v) { - params.push('arguments' + (i + 1) + v) + params.push("arguments" + (i + 1) + v); } }); - return crypto.createHash('md5').update(str + params.join('&')).digest('hex') -} + return crypto + .createHash("md5") + .update(str + params.join("&")) + .digest("hex"); +}; function encryption(data, key) { var iv = ""; - var cipherEncoding = 'base64'; - var cipher = crypto.createCipheriv('aes-128-ecb', key, iv); + var cipherEncoding = "base64"; + var cipher = crypto.createCipheriv("aes-128-ecb", key, iv); cipher.setAutoPadding(true); - return Buffer.concat([cipher.update(data), cipher.final()]).toString(cipherEncoding); + return Buffer.concat([cipher.update(data), cipher.final()]).toString( + cipherEncoding + ); } var dailyCheapStorePage = { getGoodsList: async (axios, options) => { - let phone = encryption(options.user, 'gb6YCccUvth75Tm2') - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} ` + let phone = encryption(options.user, "gb6YCccUvth75Tm2"); + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} `; let result = await axios.request({ headers: { "user-agent": useragent, - "referer": `https://wxapp.msmds.cn/`, - "origin": "https://wxapp.msmds.cn" + referer: `https://wxapp.msmds.cn/`, + origin: "https://wxapp.msmds.cn", }, url: `https://wxapp.msmds.cn/jplus/api/change/collect/chip/gift/v1/home/info`, - method: 'POST', + method: "POST", data: transParams({ - 'channelId': 'LT_channel', - 'phone': phone, - 'token': options.ecs_token, - 'sourceCode': 'lt_cheapStore' - }) - }) - result.data.data.list.forEach(g => { - console.log('已有【' + g.giftName + '】碎片', `(${g.haveCount}/${g.limitCode})`) - }) - return result.data.data + channelId: "LT_channel", + phone: phone, + token: options.ecs_token, + sourceCode: "lt_cheapStore", + }), + }); + result.data.data.list.forEach((g) => { + console.log( + "已有【" + g.giftName + "】碎片", + `(${g.haveCount}/${g.limitCode})` + ); + }); + return result.data.data; }, doTask: async (axios, options) => { - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}` - let searchParams = {} - let result = await axios.request({ - baseURL: 'https://m.client.10010.com/', - headers: { - "user-agent": useragent, - "referer": `https://img.client.10010.com/`, - "origin": "https://img.client.10010.com" - }, - url: `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://wxapp.msmds.cn/h5/react_web/unicom/cheapStorePage?source=unicom&duanlianjieabc=tbkEG`, - method: 'GET', - transformResponse: (data, headers) => { - if ('location' in headers) { - let uu = new URL(headers.location) - let pp = {} - for (let p of uu.searchParams) { - pp[p[0]] = p[1] - } - if ('ticket' in pp) { - searchParams = pp + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; + let searchParams = {}; + let result = await axios + .request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": useragent, + referer: `https://img.client.10010.com/`, + origin: "https://img.client.10010.com", + }, + url: `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://wxapp.msmds.cn/h5/react_web/unicom/cheapStorePage?source=unicom&duanlianjieabc=tbkEG`, + method: "GET", + transformResponse: (data, headers) => { + if ("location" in headers) { + let uu = new URL(headers.location); + let pp = {}; + for (let p of uu.searchParams) { + pp[p[0]] = p[1]; + } + if ("ticket" in pp) { + searchParams = pp; + } } - } - return data - } - }).catch(err => console.log(err)) - let jar1 = result.config.jar + return data; + }, + }) + .catch((err) => console.log(err)); + let jar1 = result.config.jar; - let cookiesJson = jar1.toJSON() - let ecs_token = cookiesJson.cookies.find(i => i.key == 'ecs_token') + let cookiesJson = jar1.toJSON(); + let ecs_token = cookiesJson.cookies.find((i) => i.key == "ecs_token"); if (!ecs_token) { - throw new Error('ecs_token缺失') + throw new Error("ecs_token缺失"); } - ecs_token = ecs_token.value + ecs_token = ecs_token.value; - let phone = encryption(options.user, 'gb6YCccUvth75Tm2') - let playCounts = 0 - let bottleCount = 0 + let phone = encryption(options.user, "gb6YCccUvth75Tm2"); + let playCounts = 0; + let bottleCount = 0; // 每6个小时6次机会,可使用能量瓶重置机会 - let tryn = 5 + let tryn = 5; do { let res = await dailyCheapStorePage.getGoodsList(axios, { ...options, ecs_token, - phone - }) + phone, + }); - playCounts = res.playCounts - bottleCount = res.bottleCount - console.log('剩余能量瓶:', bottleCount, '剩余游戏机会:', playCounts) + playCounts = res.playCounts; + bottleCount = res.bottleCount; + console.log("剩余能量瓶:", bottleCount, "剩余游戏机会:", playCounts); - if ('times' in res) { - console.log('每6个小时6次机会', moment(new Date(res.times)).format('YYYY-MM-DD HH:mm:ss') + ' 后可再次尝试') + if ("times" in res) { + console.log( + "每6个小时6次机会", + moment(new Date(res.times)).format("YYYY-MM-DD HH:mm:ss") + + " 后可再次尝试" + ); } - if (!playCounts) {// 用完机会再使用能量瓶重置 - console.log('尝试使用能量瓶重置机会') - let bs = 1 + if (!playCounts) { + // 用完机会再使用能量瓶重置 + console.log("尝试使用能量瓶重置机会"); + let bs = 1; if (!bottleCount) { bs = await dailyCheapStorePage.getBottle(axios, { ...options, jar: jar1, searchParams, - ecs_token - }) + ecs_token, + }); } if (bs === 2) { - break + break; } else if (bs === 1) { await dailyCheapStorePage.bottleExpend(axios, { ...options, jar: jar1, searchParams, - ecs_token - }) - playCounts = 6 - console.log('重置机会成功+', playCounts) + ecs_token, + }); + playCounts = 6; + console.log("重置机会成功+", playCounts); } else if (bs === 0) { // 防止错误循环 - tryn = tryn - 1 + tryn = tryn - 1; if (!tryn) { - console.log('出现错误,重试重置机会超过5次,跳过任务') - break + console.log("出现错误,重试重置机会超过5次,跳过任务"); + break; } else { - console.log('出现错误,重试重置机会') - continue + console.log("出现错误,重试重置机会"); + continue; } } } let a = { - 'channelId': 'LT_channel', - 'code': '', - "phone": phone, - 'token': ecs_token, - 'sourceCode': 'lt_cheapStore' - } + channelId: "LT_channel", + code: "", + phone: phone, + token: ecs_token, + sourceCode: "lt_cheapStore", + }; - let timestamp = moment().format('YYYYMMDDHHmmss') + let timestamp = moment().format("YYYYMMDDHHmmss"); result = await axios.request({ headers: { "user-agent": useragent, - "referer": `https://wxapp.msmds.cn/h5/react_web/unicom/cheapStorePage?source=unicom&type=02&ticket=${searchParams.ticket}&version=android@8.0100×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&duanlianjieabc=tbkEG&userNumber=${options.user}`, - "origin": "https://wxapp.msmds.cn" + referer: `https://wxapp.msmds.cn/h5/react_web/unicom/cheapStorePage?source=unicom&type=02&ticket=${searchParams.ticket}&version=android@8.0100×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&duanlianjieabc=tbkEG&userNumber=${options.user}`, + origin: "https://wxapp.msmds.cn", }, - url: `https://wxapp.msmds.cn/jplus/api/change/collect/chip/gift/v1/play/luck/draw?` + w(a), - method: 'POST' - }) + url: + `https://wxapp.msmds.cn/jplus/api/change/collect/chip/gift/v1/play/luck/draw?` + + w(a), + method: "POST", + }); if (result.data.code !== 200) { - console.log('提交任务失败', result.data.msg) - if (result.data.msg.indexOf('请勿频繁操作') !== -1) { - throw new Error('取消本次任务') + console.log("提交任务失败", result.data.msg); + if (result.data.msg.indexOf("请勿频繁操作") !== -1) { + throw new Error("取消本次任务"); } } else { - let data = result.data.data - let good = res.list.find(f => f.giftId === data.giftId) - console.log('提交任务成功,获得', good.giftName, '累计商品碎片x' + data.fragmentCount, data.desc + data.playCounts) + let data = result.data.data; + let good = res.list.find((f) => f.giftId === data.giftId); + console.log( + "提交任务成功,获得", + good.giftName, + "累计商品碎片x" + data.fragmentCount, + data.desc + data.playCounts + ); } if (playCounts) { - console.log('等待15秒再继续') - await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)) + console.log("等待15秒再继续"); + await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); } + } while (playCounts); - } while (playCounts) - - console.log('进入下一轮的尝试等待期') + console.log("进入下一轮的尝试等待期"); }, getBottleState: async (axios, options) => { - const { jar, searchParams, ecs_token } = options - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}` - let phone = encryption(options.user, 'gb6YCccUvth75Tm2') + const { jar, searchParams, ecs_token } = options; + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; + let phone = encryption(options.user, "gb6YCccUvth75Tm2"); let a = { - 'channelId': 'LT_channel', - "phone": phone, - 'isDetails': 'false', - 'token': ecs_token, - 'sourceCode': 'lt_cheapStore' - } - let timestamp = moment().format('YYYYMMDDHHmmss') + channelId: "LT_channel", + phone: phone, + isDetails: "false", + token: ecs_token, + sourceCode: "lt_cheapStore", + }; + let timestamp = moment().format("YYYYMMDDHHmmss"); result = await axios.request({ headers: { "user-agent": useragent, - "referer": `https://wxapp.msmds.cn/h5/react_web/unicom/cheapStorePage?source=unicom&type=02&ticket=${searchParams.ticket}&version=android@8.0100×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&duanlianjieabc=tbkEG&userNumber=${options.user}`, - "origin": "https://wxapp.msmds.cn" + referer: `https://wxapp.msmds.cn/h5/react_web/unicom/cheapStorePage?source=unicom&type=02&ticket=${searchParams.ticket}&version=android@8.0100×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&duanlianjieabc=tbkEG&userNumber=${options.user}`, + origin: "https://wxapp.msmds.cn", }, url: `https://wxapp.msmds.cn/jplus/api/change/collect/chip/gift/v1/bottle/add`, - method: 'POST', - data: transParams(a) - }) + method: "POST", + data: transParams(a), + }); if (result.data.code !== 200) { - console.log('查询能量瓶状态失败', result.data.msg) + console.log("查询能量瓶状态失败", result.data.msg); } else { if (result.data.data.status === 1) { - if ('times' in result.data.data) { - let m = moment(new Date(result.data.data.times)).format('YYYY-MM-DD HH:mm:ss') + ' 后可再次尝试' - console.log(result.data.data.text, m) - return false + if ("times" in result.data.data) { + let m = + moment(new Date(result.data.data.times)).format( + "YYYY-MM-DD HH:mm:ss" + ) + " 后可再次尝试"; + console.log(result.data.data.text, m); + return false; } } else { - return true + return true; } } - return false + return false; }, // 获取能量瓶 4个小时只能获取3次能量瓶的机会 getBottle: async (axios, options) => { - const { jar, searchParams, ecs_token } = options - let state = await dailyCheapStorePage.getBottleState(axios, options) + const { jar, searchParams, ecs_token } = options; + let state = await dailyCheapStorePage.getBottleState(axios, options); if (!state) { - console.log('跳过获取能量瓶') - return 2 + console.log("跳过获取能量瓶"); + return 2; } - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}` - let phone = encryption(options.user, 'gb6YCccUvth75Tm2') + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; + let phone = encryption(options.user, "gb6YCccUvth75Tm2"); // 每4小时3次, 等每轮机会用完再获取 let params = { - 'arguments1': '', - 'arguments2': '', - 'arguments3': '', - 'arguments4': new Date().getTime(), - 'arguments6': '', - 'arguments7': '', - 'arguments8': '', - 'arguments9': '', - 'netWay': 'Wifi', - 'remark': '签到小游戏买什么都省申请便利店抽奖', - 'version': `android@8.0100`, - 'codeId': 945535693 - } - params['sign'] = sign([params.arguments1, params.arguments2, params.arguments3, params.arguments4]) - params['orderId'] = crypto.createHash('md5').update(new Date().getTime() + '').digest('hex') - params['arguments4'] = new Date().getTime() + arguments1: "", + arguments2: "", + arguments3: "", + arguments4: new Date().getTime(), + arguments6: "", + arguments7: "", + arguments8: "", + arguments9: "", + netWay: "Wifi", + remark: "签到小游戏买什么都省申请便利店抽奖", + version: `android@8.0100`, + codeId: 945535693, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + params["orderId"] = crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"); + params["arguments4"] = new Date().getTime(); - let result = await require('./taskcallback').reward(axios, { + let result = await require("./taskcallback").reward(axios, { ...options, params, - jar - }) + jar, + }); let a = { - 'channelId': 'LT_channel', - "phone": phone, - 'isDetails': 'false', - 'token': ecs_token, - 'videoOrderNo': params['orderId'], - 'sourceCode': 'lt_cheapStore' - } - let timestamp = moment().format('YYYYMMDDHHmmss') + channelId: "LT_channel", + phone: phone, + isDetails: "false", + token: ecs_token, + videoOrderNo: params["orderId"], + sourceCode: "lt_cheapStore", + }; + let timestamp = moment().format("YYYYMMDDHHmmss"); result = await axios.request({ headers: { "user-agent": useragent, - "referer": `https://wxapp.msmds.cn/h5/react_web/unicom/cheapStorePage?source=unicom&type=02&ticket=${searchParams.ticket}&version=android@8.0100×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&duanlianjieabc=tbkEG&userNumber=${options.user}`, - "origin": "https://wxapp.msmds.cn" + referer: `https://wxapp.msmds.cn/h5/react_web/unicom/cheapStorePage?source=unicom&type=02&ticket=${searchParams.ticket}&version=android@8.0100×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&duanlianjieabc=tbkEG&userNumber=${options.user}`, + origin: "https://wxapp.msmds.cn", }, url: `https://wxapp.msmds.cn/jplus/api/change/collect/chip/gift/v1/bottle/add`, - method: 'POST', - data: transParams(a) - }) + method: "POST", + data: transParams(a), + }); if (result.data.code !== 200) { - console.log('提交任务失败', result.data.msg) + console.log("提交任务失败", result.data.msg); } else { if (result.data.data.status === 0) { - console.log('提交任务成功', `获得能量瓶+${result.data.data.bottleCounts}`) - return 1 + console.log( + "提交任务成功", + `获得能量瓶+${result.data.data.bottleCounts}` + ); + return 1; } else { - console.log('提交任务成功', `已无法获得能量瓶`, result.data.data.text) - return 2 + console.log("提交任务成功", `已无法获得能量瓶`, result.data.data.text); + return 2; } } - console.log('等待5秒再继续') - await new Promise((resolve, reject) => setTimeout(resolve, 5 * 1000)) + console.log("等待5秒再继续"); + await new Promise((resolve, reject) => setTimeout(resolve, 5 * 1000)); - return 0 + return 0; }, // 能量瓶兑换机会 bottleExpend: async (axios, options) => { - const { jar, searchParams, ecs_token } = options - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}` - let phone = encryption(options.user, 'gb6YCccUvth75Tm2') + const { jar, searchParams, ecs_token } = options; + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; + let phone = encryption(options.user, "gb6YCccUvth75Tm2"); let a = { - 'channelId': 'LT_channel', - "phone": phone, - 'token': ecs_token, - 'sourceCode': 'lt_cheapStore' - } - let timestamp = moment().format('YYYYMMDDHHmmss') + channelId: "LT_channel", + phone: phone, + token: ecs_token, + sourceCode: "lt_cheapStore", + }; + let timestamp = moment().format("YYYYMMDDHHmmss"); result = await axios.request({ headers: { "user-agent": useragent, - "referer": `https://wxapp.msmds.cn/h5/react_web/unicom/cheapStorePage?source=unicom&type=02&ticket=${searchParams.ticket}&version=android@8.0100×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&duanlianjieabc=tbkEG&userNumber=${options.user}`, - "origin": "https://wxapp.msmds.cn" + referer: `https://wxapp.msmds.cn/h5/react_web/unicom/cheapStorePage?source=unicom&type=02&ticket=${searchParams.ticket}&version=android@8.0100×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&duanlianjieabc=tbkEG&userNumber=${options.user}`, + origin: "https://wxapp.msmds.cn", }, url: `https://wxapp.msmds.cn/jplus/api/change/collect/chip/gift/v1/bottle/expend`, - method: 'POST', - data: transParams(a) - }) + method: "POST", + data: transParams(a), + }); if (result.data.code !== 200) { - console.log('提交任务失败', result.data.msg) + console.log("提交任务失败", result.data.msg); } else { - console.log('提交任务成功', `能量瓶兑换抽奖机会成功`) + console.log("提交任务成功", `能量瓶兑换抽奖机会成功`); } - } -} + }, +}; -module.exports = dailyCheapStorePage \ No newline at end of file +module.exports = dailyCheapStorePage; diff --git a/commands/tasks/unicom/handlers/PAES.js b/commands/tasks/unicom/handlers/PAES.js index 2a4aff089..e14f69271 100644 --- a/commands/tasks/unicom/handlers/PAES.js +++ b/commands/tasks/unicom/handlers/PAES.js @@ -54,6 +54,16 @@ let decrypt = function (word, keyStr) { }); return decrypted.toString(CryptoJS.enc.Utf8); }; + +let encryptPhone = (data, key) => { + var iv = ""; + var cipherEncoding = "base64"; + var cipher = crypto.createCipheriv("aes-128-ecb", key, iv); + cipher.setAutoPadding(true); + return Buffer.concat([cipher.update(data), cipher.final()]).toString( + cipherEncoding + ); +}; let newjiamarr = () => { for (var e = [], k = "", t = charset, i = 0x0; 0x4 > i; i++) { for (var n = "", s = 0x0; 0x10 > s; s++) { @@ -73,4 +83,5 @@ module.exports = { decrypt, newjiamarr, sign, + encryptPhone, }; diff --git a/commands/tasks/unicom/handlers/dailyEvent.js b/commands/tasks/unicom/handlers/dailyEvent.js index 653dab535..e6ffd7065 100644 --- a/commands/tasks/unicom/handlers/dailyEvent.js +++ b/commands/tasks/unicom/handlers/dailyEvent.js @@ -4,7 +4,7 @@ let AES = require("./PAES"); /** * @param {String} url request url absolute path */ -let getOpenPlatLine = (url) => { +let getOpenPlatLine = (url, cnf = { base: "" }) => { return async (axios, options) => { let searchParams = {}; let result = await axios @@ -40,12 +40,20 @@ let getOpenPlatLine = (url) => { throw new Error("ecs_token缺失"); } ecs_token = ecs_token.value; - let jfid = cookiesJson.cookies.find((i) => i.key == "_jf_id"); - if (!jfid) { - throw new Error("jfid缺失"); + let jfid; + switch (cnf.base) { + case "msmds": + console.log("🐱‍🏍 msmds游戏调度"); + return { ecs_token, searchParams, jar1 }; + default: + console.log("🐱‍🏍 平台游戏调度"); + jfid = cookiesJson.cookies.find((i) => i.key == "_jf_id"); + if (!jfid) { + throw new Error("jfid缺失"); + } + jfid = jfid.value; + return { jfid, searchParams, jar1 }; } - jfid = jfid.value; - return { jfid, searchParams, jar1 }; }; }; diff --git a/commands/tasks/unicom/ingotsPage.js b/commands/tasks/unicom/ingotsPage.js new file mode 100644 index 000000000..7e4a656ff --- /dev/null +++ b/commands/tasks/unicom/ingotsPage.js @@ -0,0 +1,52 @@ +let crypto = require("crypto"); +let moment = require("moment"); +let { encryptPhone } = require("./handlers/PAES.js"); +const useragent = require("./handlers/myPhone").useragent; +const gameEvents = require("./handlers/dailyEvent"); +let { transParams } = require("./handlers/gameUtils"); +const referer = + "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-qd/bcow/index.html?jump=sign"; +let ingotsPage = { + doTask: async (axios, options) => { + let { ecs_token } = await ingotsPage.getOpenPlatLine(axios, options); + await ingotsPage.postIndexInfo(axios, { + ...options, + ecs_token, + }); + }, + postIndexInfo: async (axios, options) => { + let phone = encryptPhone(options.user, "gb6YCccUvth75Tm2"); + let result = await axios.request({ + headers: { + "user-agent": useragent(options), + referer: `https://wxapp.msmds.cn/`, + origin: "https://wxapp.msmds.cn", + }, + url: `https://wxapp.msmds.cn/jplus/h5/greetGoldIngot/IndexInfo`, + method: "POST", + data: transParams({ + channelId: "LT_channel", + phone: phone, + token: options.ecs_token, + sourceCode: "lt_ingots", + }), + }); + if (result.data.code !== 200) { + throw new Error("❌ something errors: ", result.data.msg); + } + next(result.data.data); + function next(data) { + console.log( + "😒 聚宝盆签到:" + (data["signTimes"] === 1 ? "已签到" : "未签到") + ); + } + }, + getOpenPlatLine: gameEvents.getOpenPlatLine( + `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://wxapp.msmds.cn/h5/react_web/unicom/ingotsPage?source=unicom&duanlianjieabc=tbLm0`, + { + base: "msmds", + } + ), +}; + +module.exports = ingotsPage; diff --git a/commands/tasks/unicom/unicom.js b/commands/tasks/unicom/unicom.js index c1c5d2d14..fa05f63ce 100644 --- a/commands/tasks/unicom/unicom.js +++ b/commands/tasks/unicom/unicom.js @@ -379,6 +379,15 @@ var start = async (params) => { ...taskOption, } ); + + //首页-签到有礼-聚宝盆 [广告图] + await scheduler.regTask( + "ingots", + async (request) => { + await require("./ingotsPage").doTask(request, options); + }, + taskOption + ); }; module.exports = { start, From 22dda001209594daf7d66738199e936bbc3eb77f Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Wed, 10 Feb 2021 11:37:43 +0800 Subject: [PATCH 038/128] updated some files --- commands/tasks/unicom/ingotsPage.js | 92 +++++- commands/tasks/unicom/taskcallback.js | 405 ++++++++++++++------------ 2 files changed, 298 insertions(+), 199 deletions(-) diff --git a/commands/tasks/unicom/ingotsPage.js b/commands/tasks/unicom/ingotsPage.js index 7e4a656ff..1f6994f47 100644 --- a/commands/tasks/unicom/ingotsPage.js +++ b/commands/tasks/unicom/ingotsPage.js @@ -8,13 +8,13 @@ const referer = "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-qd/bcow/index.html?jump=sign"; let ingotsPage = { doTask: async (axios, options) => { - let { ecs_token } = await ingotsPage.getOpenPlatLine(axios, options); - await ingotsPage.postIndexInfo(axios, { - ...options, - ecs_token, - }); + console.log("😒 游玩聚宝盆..."); + let cookies = await ingotsPage.getOpenPlatLine(axios, options); + await ingotsPage.postIndexInfo(axios, options, cookies); + let result = await ingotsPage.postSign(axios, options, cookies); + await ingotsPage.signDouble(axios, options, { ...cookies, ...result }); }, - postIndexInfo: async (axios, options) => { + postIndexInfo: async (axios, options, { ecs_token, searchParams, jar1 }) => { let phone = encryptPhone(options.user, "gb6YCccUvth75Tm2"); let result = await axios.request({ headers: { @@ -27,7 +27,7 @@ let ingotsPage = { data: transParams({ channelId: "LT_channel", phone: phone, - token: options.ecs_token, + token: ecs_token, sourceCode: "lt_ingots", }), }); @@ -37,10 +37,86 @@ let ingotsPage = { next(result.data.data); function next(data) { console.log( - "😒 聚宝盆签到:" + (data["signTimes"] === 1 ? "已签到" : "未签到") + "😒 聚宝盆状态: " + (data["sign"] ? "已签到" : "未签到"), + "签到次数: " + data["signTimes"] + ); + console.log( + "😒 聚宝盆游玩次数:" + data["leftTimes"], + "预计视频奖励测试: 4" + ); + } + }, + postSign: async (axios, options) => { + let phone = encryptPhone(options.user, "gb6YCccUvth75Tm2"); + let result = await axios.request({ + headers: { + "user-agent": useragent(options), + referer: `https://wxapp.msmds.cn/`, + origin: "https://wxapp.msmds.cn", + }, + url: `https://wxapp.msmds.cn/jplus/h5/greetGoldIngot/sign`, + method: "POST", + data: transParams({ + channelId: "LT_channel", + phone: phone, + token: options.ecs_token, + sourceCode: "lt_ingots", + }), + }); + switch (result.data.code) { + case 200: + next(result.data.data); + break; + case 500: + console.log("😒 聚宝盆签到:" + result.data["msg"]); + return null; + default: + throw new Error("❌ something errors: ", result.data.msg); + } + function next(data) { + console.log("😒 聚宝盆签到获取积分:" + data["prizeName"]); + console.log( + "😒 聚宝盆签到翻倍状态:" + (data["double"] ? "可翻倍" : "不可翻倍"), + "预计视频奖励测试: 4" ); + return { recordId: data["recordId"], double: data["double"] }; } }, + signDouble: async (axios, options, cookies) => { + console.log("😒 聚宝盆签到翻倍...待完善"); + // let params = { + // arguments1: "AC20200611152252", + // arguments2: "", + // arguments3: "", + // arguments4: new Date().getTime(), + // arguments6: "", + // arguments7: "", + // arguments8: "", + // arguments9: "", + // netWay: "Wifi", + // remark: "签到小游戏买扭蛋机2", + // version: `android@8.0102`, + // codeId: 945535686, + // }; + + // params["sign"] = AES.sign([ + // params.arguments1, + // params.arguments2, + // params.arguments3, + // params.arguments4, + // ]); + // params["orderId"] = crypto + // .createHash("md5") + // .update(new Date().getTime() + "") + // .digest("hex"); + // params["arguments4"] = new Date().getTime(); + + // await require("./taskcallback").reward(axios, { + // ...options, + // params, + // jar: jar1, + // }); + }, getOpenPlatLine: gameEvents.getOpenPlatLine( `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://wxapp.msmds.cn/h5/react_web/unicom/ingotsPage?source=unicom&duanlianjieabc=tbLm0`, { diff --git a/commands/tasks/unicom/taskcallback.js b/commands/tasks/unicom/taskcallback.js index 8dac95d94..e03a48aec 100644 --- a/commands/tasks/unicom/taskcallback.js +++ b/commands/tasks/unicom/taskcallback.js @@ -1,210 +1,233 @@ -var crypto = require('crypto'); +var crypto = require("crypto"); var transParams = (data) => { - let params = new URLSearchParams(); - for (let item in data) { - params.append(item, data['' + item + '']); - } - return params; + let params = new URLSearchParams(); + for (let item in data) { + params.append(item, data["" + item + ""]); + } + return params; }; //data 是准备加密的字符串,key是你的密钥 -function encryption (data, key) { - var iv = ""; - var cipherEncoding = 'base64'; - var cipher = crypto.createCipheriv('aes-128-ecb', key, iv); - cipher.setAutoPadding(true); - return Buffer.concat([cipher.update(data), cipher.final()]).toString(cipherEncoding); +function encryption(data, key) { + var iv = ""; + var cipherEncoding = "base64"; + var cipher = crypto.createCipheriv("aes-128-ecb", key, iv); + cipher.setAutoPadding(true); + return Buffer.concat([cipher.update(data), cipher.final()]).toString( + cipherEncoding + ); } //data 是你的准备解密的字符串,key是你的密钥 -function decryption (data, key) { - var iv = ""; - var clearEncoding = 'utf8'; - var cipherEncoding = 'base64'; - var decipher = crypto.createDecipheriv('aes-128-ecb', key, iv); - decipher.setAutoPadding(true); - return Buffer.concat([decipher.update(data, cipherEncoding), decipher.final()]).toString(clearEncoding); +function decryption(data, key) { + var iv = ""; + var clearEncoding = "utf8"; + var cipherEncoding = "base64"; + var decipher = crypto.createDecipheriv("aes-128-ecb", key, iv); + decipher.setAutoPadding(true); + return Buffer.concat([ + decipher.update(data, cipherEncoding), + decipher.final(), + ]).toString(clearEncoding); } -function a (str) { - str = str + str - return str.substr(8, 16) +function a(str) { + str = str + str; + return str.substr(8, 16); } var taskcallback = { - // 查询活动状态 - query: async (axios, options) => { - let { params } = options - const useragent = `okhttp/4.4.0` - - let { data, config } = await axios.request({ - baseURL: 'https://m.client.10010.com/', - headers: { - "user-agent": useragent, - "referer": `https://img.client.10010.com/`, - "origin": "https://img.client.10010.com" - }, - url: `/taskcallback/taskfilter/query`, - method: 'POST', - data: transParams(params) - }) - if (data.code === '0000') { - console.log(data.timeflag === '1' ? `今日参加活动已达上限(${data.achieve}/${data.allocation}次)` : `活动可参加(${data.achieve}/${data.allocation}次)`) - return { - num: parseInt(data.allocation) - parseInt(data.achieve), - jar: config.jar - } - } else { - console.log('查询出错', data.desc) - return false - } - }, - reward: async (axios, options) => { - let { params, jar } = options - let cookiesJson = jar.toJSON() - let ecs_token = cookiesJson.cookies.find(i => i.key == 'ecs_token') - if (!ecs_token) { - throw new Error('ecs_token缺失') - } - ecs_token = ecs_token.value - let orderId = params.orderId || crypto.createHash('md5').update(new Date().getTime() + '').digest('hex') - let codeId = parseInt(params.codeId || 945535616) - let app_id = "5049584" - let media_extra = [ - ecs_token, - options.user, - 'android', - params.arguments1, - params.arguments2, - orderId,// orderId - codeId, //codeId - params.remark, - 'Wifi' - ] + // 查询活动状态 + query: async (axios, options) => { + let { params } = options; + const useragent = `okhttp/4.4.0`; - var data = { - "oversea_version_type": 0, - "reward_name": `android-${params.remark1 || params.remark}-激励视频`, - "reward_amount": 1, - "network": 4, - // "latitude": 26.611770629882812, - // "longitude": 106.63581085205078, - "sdk_version": "3.3.0.3", - "user_agent": "Mozilla\/5.0 (Linux; Android 9; VKY-AL00 Build\/HUAWEIVKY-AL00; wv) AppleWebKit\/537.36 (KHTML, like Gecko) Version\/4.0 Chrome\/86.0.4240.198 Mobile Safari\/537.36", - "extra": { - // "ad_slot_type": 7, - // "oaid": "ebdde3b9-def7-6cc3-fdfe-9bfff7ce4126", - // "language": "golang", - // "ug_creative_id": "", - // "ad_id": 1687489184287789, - // "creative_id": 1687493310795863, - // "convert_id": 1682419505842179, - // "uid": 95981094553, - // "ad_type": 1, - // "pricing": 9, - // "ut": 12, - // "version_code": "8.1", - // "device_id": 50137151117, - // "width": 360, - // "height": 640, - // "mac": "10:44:00:73:74:BF", - // "uuid": "867442035025655", - // "uuid_md5": "8a4dac2481580bd94f8c4b17787b74cd", - // "os": "android", - // "client_ip": "111.121.67.62", - // "open_udid": "", - // "os_type": null, - // "app_name": "手机营业厅", - // "device_type": "VKY-AL00", - // "os_version": "9", - // "app_id": "5049584", - // "template_id": 0, - // "template_rate": 0, - // "promotion_type": 0, - // "img_gen_type": 0, - // "img_md5": "", - // "source_type": 1, - // "pack_time": "{pack_time}", - // "cid": 1687493310795863, - // "interaction_type": 4, - // "src_type": "app", - // "package_name": "com.sinovatech.unicom.ui", - // "pos": 5, - // "landing_type": 3, - // "is_sdk": true, - // "is_dsp_ad": false, - // "imei": "867442035025655", - // "req_id": "e9da96b1-2d0c-49d0-b5b0-3fd6540d22d4u2997", - "rit": codeId - }, - "media_extra": encodeURI(media_extra.join('|')), - "video_duration": 28.143, - "play_start_ts": new Date().getTime() - 32 * 1000, - "play_end_ts": 0, - "duration": 28143, - "user_id": app_id, - "trans_id": crypto.createHash('md5').update(new Date().getTime() + '').digest('hex') - } + let { data, config } = await axios.request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": useragent, + referer: `https://img.client.10010.com/`, + origin: "https://img.client.10010.com", + }, + url: `/taskcallback/taskfilter/query`, + method: "POST", + data: transParams(params), + }); + if (data.code === "0000") { + console.log( + data.timeflag === "1" + ? `今日参加活动已达上限(${data.achieve}/${data.allocation}次)` + : `活动可参加(${data.achieve}/${data.allocation}次)` + ); + return { + num: parseInt(data.allocation) - parseInt(data.achieve), + jar: config.jar, + }; + } else { + console.log("查询出错", data.desc); + return false; + } + }, + reward: async (axios, options) => { + let { params, jar } = options; + let cookiesJson = jar.toJSON(); + let ecs_token = cookiesJson.cookies.find((i) => i.key == "ecs_token"); + if (!ecs_token) { + throw new Error("ecs_token缺失"); + } + ecs_token = ecs_token.value; + let orderId = + params.orderId || + crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"); + let codeId = parseInt(params.codeId || 945535616); + let app_id = "5049584"; + let media_extra = [ + ecs_token, + options.user, + "android", + params.arguments1, + params.arguments2, + orderId, // orderId + codeId, //codeId + params.remark, + "Wifi", + ]; - let key = crypto.createHash('md5').update(new Date().getTime() + '').digest('hex').substr(8, 16) - let t = JSON.stringify(data).replace(/\//g, "\\\/")//.replace('"{pack_time}"', '1.609770734935479E9') - let m = encryption(t, a(key)).replace(/(.{76})/g, '$1\n') - m = '2' + key + m + var data = { + oversea_version_type: 0, + reward_name: `android-${params.remark1 || params.remark}-激励视频`, + reward_amount: 1, + network: 4, + // "latitude": 26.611770629882812, + // "longitude": 106.63581085205078, + sdk_version: "3.3.0.3", + user_agent: + "Mozilla/5.0 (Linux; Android 9; VKY-AL00 Build/HUAWEIVKY-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/86.0.4240.198 Mobile Safari/537.36", + extra: { + // "ad_slot_type": 7, + // "oaid": "ebdde3b9-def7-6cc3-fdfe-9bfff7ce4126", + // "language": "golang", + // "ug_creative_id": "", + // "ad_id": 1687489184287789, + // "creative_id": 1687493310795863, + // "convert_id": 1682419505842179, + // "uid": 95981094553, + // "ad_type": 1, + // "pricing": 9, + // "ut": 12, + // "version_code": "8.1", + // "device_id": 50137151117, + // "width": 360, + // "height": 640, + // "mac": "10:44:00:73:74:BF", + // "uuid": "867442035025655", + // "uuid_md5": "8a4dac2481580bd94f8c4b17787b74cd", + // "os": "android", + // "client_ip": "111.121.67.62", + // "open_udid": "", + // "os_type": null, + // "app_name": "手机营业厅", + // "device_type": "VKY-AL00", + // "os_version": "9", + // "app_id": "5049584", + // "template_id": 0, + // "template_rate": 0, + // "promotion_type": 0, + // "img_gen_type": 0, + // "img_md5": "", + // "source_type": 1, + // "pack_time": "{pack_time}", + // "cid": 1687493310795863, + // "interaction_type": 4, + // "src_type": "app", + // "package_name": "com.sinovatech.unicom.ui", + // "pos": 5, + // "landing_type": 3, + // "is_sdk": true, + // "is_dsp_ad": false, + // "imei": "867442035025655", + // "req_id": "e9da96b1-2d0c-49d0-b5b0-3fd6540d22d4u2997", + rit: codeId, + }, + media_extra: encodeURI(media_extra.join("|")), + video_duration: 28.143, + play_start_ts: new Date().getTime() - 32 * 1000, + play_end_ts: 0, + duration: 28143, + user_id: app_id, + trans_id: crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"), + }; - var message = { - message: m, - cypher: 2 - } - // let s = a(message.message.substr(1, 16)) - // console.log(decryption(message.message.replace(/\n/g, '').substr(17), s)) - // process.exit(0) + let key = crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex") + .substr(8, 16); + let t = JSON.stringify(data).replace(/\//g, "\\/"); //.replace('"{pack_time}"', '1.609770734935479E9') + let m = encryption(t, a(key)).replace(/(.{76})/g, "$1\n"); + m = "2" + key + m; - const useragent = `VADNetAgent/0` - let res = await axios.request({ - headers: { - "user-agent": useragent, - "Content-Type": "application/json; charset=utf-8" - }, - url: `https://api-access.pangolin-sdk-toutiao.com/api/ad/union/sdk/reward_video/reward/`, - method: 'POST', - data: message - }) - data = res.data - // s = a(data.message.substr(1, 16)) - // console.log(decryption(data.message.replace(/\n/g, '').substr(17), s)) - if ('code' in data) { - throw new Error('获取激励信息出错') - } + var message = { + message: m, + cypher: 2, + }; + // let s = a(message.message.substr(1, 16)) + // console.log(decryption(message.message.replace(/\n/g, '').substr(17), s)) + // process.exit(0) - return { - orderId - } + const useragent = `VADNetAgent/0`; + let res = await axios.request({ + headers: { + "user-agent": useragent, + "Content-Type": "application/json; charset=utf-8", + }, + url: `https://api-access.pangolin-sdk-toutiao.com/api/ad/union/sdk/reward_video/reward/`, + method: "POST", + data: message, + }); + data = res.data; + // console.log(data); + // s = a(data.message.substr(1, 16)); + // console.log(decryption(data.message.replace(/\n/g, "").substr(17), s)); + if ("code" in data) { + console.log(data); + throw new Error("获取激励信息出错"); + } - }, - // 提交任务 - doTask: async (axios, options) => { - let result = await taskcallback.reward(axios, options) - let params = options.params - params['orderId'] = result['orderId'] - delete params.codeId - const useragent = `okhttp/4.4.0` - let { data } = await axios.request({ - baseURL: 'https://m.client.10010.com/', - headers: { - "user-agent": useragent, - "referer": `https://img.client.10010.com/`, - "origin": "https://img.client.10010.com" - }, - url: `/taskcallback/taskfilter/dotasks`, - method: 'POST', - data: transParams(params) - }) - if (data.code === '0000') { - console.log('提交任务成功', data.prizeName + '+' + data.prizeCount) - } else { - console.log('提交任务出错', data.desc) - } - }, -} -module.exports = taskcallback \ No newline at end of file + return { + orderId, + }; + }, + // 提交任务 + doTask: async (axios, options) => { + let result = await taskcallback.reward(axios, options); + let params = options.params; + params["orderId"] = result["orderId"]; + delete params.codeId; + const useragent = `okhttp/4.4.0`; + let { data } = await axios.request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": useragent, + referer: `https://img.client.10010.com/`, + origin: "https://img.client.10010.com", + }, + url: `/taskcallback/taskfilter/dotasks`, + method: "POST", + data: transParams(params), + }); + if (data.code === "0000") { + console.log("提交任务成功", data.prizeName + "+" + data.prizeCount); + } else { + console.log("提交任务出错", data.desc); + } + }, +}; +module.exports = taskcallback; From 42291f53eeb23524ebaef063849ea88e68bf4af8 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Wed, 10 Feb 2021 13:25:14 +0800 Subject: [PATCH 039/128] =?UTF-8?q?=F0=9F=9A=A7=20updating=20task=20ingots?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/ingotsPage.js | 104 +++++++++++++++++--------- commands/tasks/unicom/taskcallback.js | 9 ++- 2 files changed, 74 insertions(+), 39 deletions(-) diff --git a/commands/tasks/unicom/ingotsPage.js b/commands/tasks/unicom/ingotsPage.js index 1f6994f47..0e060b4d7 100644 --- a/commands/tasks/unicom/ingotsPage.js +++ b/commands/tasks/unicom/ingotsPage.js @@ -1,6 +1,5 @@ let crypto = require("crypto"); -let moment = require("moment"); -let { encryptPhone } = require("./handlers/PAES.js"); +let { encryptPhone, sign } = require("./handlers/PAES.js"); const useragent = require("./handlers/myPhone").useragent; const gameEvents = require("./handlers/dailyEvent"); let { transParams } = require("./handlers/gameUtils"); @@ -14,6 +13,7 @@ let ingotsPage = { let result = await ingotsPage.postSign(axios, options, cookies); await ingotsPage.signDouble(axios, options, { ...cookies, ...result }); }, + // eslint-disable-next-line no-unused-vars postIndexInfo: async (axios, options, { ecs_token, searchParams, jar1 }) => { let phone = encryptPhone(options.user, "gb6YCccUvth75Tm2"); let result = await axios.request({ @@ -69,7 +69,7 @@ let ingotsPage = { break; case 500: console.log("😒 聚宝盆签到:" + result.data["msg"]); - return null; + return { double: false }; default: throw new Error("❌ something errors: ", result.data.msg); } @@ -83,39 +83,73 @@ let ingotsPage = { } }, signDouble: async (axios, options, cookies) => { - console.log("😒 聚宝盆签到翻倍...待完善"); - // let params = { - // arguments1: "AC20200611152252", - // arguments2: "", - // arguments3: "", - // arguments4: new Date().getTime(), - // arguments6: "", - // arguments7: "", - // arguments8: "", - // arguments9: "", - // netWay: "Wifi", - // remark: "签到小游戏买扭蛋机2", - // version: `android@8.0102`, - // codeId: 945535686, - // }; - - // params["sign"] = AES.sign([ - // params.arguments1, - // params.arguments2, - // params.arguments3, - // params.arguments4, - // ]); - // params["orderId"] = crypto - // .createHash("md5") - // .update(new Date().getTime() + "") - // .digest("hex"); - // params["arguments4"] = new Date().getTime(); + console.log("😒 聚宝盆签到翻倍...测试"); + if (!cookies.double) { + console.log("❌ 聚宝盆签到翻倍失败"); + return; + } + try { + await ingotsPage.lookVideoDouble(axios, { ...options, ...cookies }); + } catch (err) { + console.log("❌ 聚宝盆签到报错: ", err); + } + }, + // postCreditsDouble: (axios, options) => {}, + lookVideoDouble: async (axios, options) => { + let params = { + arguments1: "AC20200716103629", // acid + arguments2: "GGPD", // yhChannel + arguments3: "45d6dbc3ad144c938cfa6b8e81803b85", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "517050707", + arguments7: "517050707", + netWay: "Wifi", + version: `android@8.0102`, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + let { num, jar } = await require("./taskcallback").query(axios, { + ...options, + params, + }); - // await require("./taskcallback").reward(axios, { - // ...options, - // params, - // jar: jar1, - // }); + if (!num) { + console.log("😒 签到小游戏聚宝盆: 今日已完成"); + return; + } + params = { + arguments1: "AC20200716103629", // acid + arguments2: "GGPD", // yhChannel + arguments3: "73e3907bbf9c4748b2fe9a053cee5e82", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "", + arguments7: "", + arguments8: "", + arguments9: "", + orderId: crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"), + netWay: "Wifi", + remark: "签到小游戏聚宝盆", + version: `android@8.0100`, + codeId: 945757412, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + await require("./taskcallback").doTask(axios, { + ...options, + params, + jar, + }); }, getOpenPlatLine: gameEvents.getOpenPlatLine( `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://wxapp.msmds.cn/h5/react_web/unicom/ingotsPage?source=unicom&duanlianjieabc=tbLm0`, diff --git a/commands/tasks/unicom/taskcallback.js b/commands/tasks/unicom/taskcallback.js index e03a48aec..7789eb8e8 100644 --- a/commands/tasks/unicom/taskcallback.js +++ b/commands/tasks/unicom/taskcallback.js @@ -41,14 +41,14 @@ var taskcallback = { // 查询活动状态 query: async (axios, options) => { let { params } = options; - const useragent = `okhttp/4.4.0`; + const useragent = `ChinaUnicom4.x/1.0 CFNetwork/1209 Darwin/20.2.0`; let { data, config } = await axios.request({ baseURL: "https://m.client.10010.com/", headers: { "user-agent": useragent, - referer: `https://img.client.10010.com/`, - origin: "https://img.client.10010.com", + referer: `https://m.client.10010.com`, + origin: "https://m.client.10010.com", }, url: `/taskcallback/taskfilter/query`, method: "POST", @@ -211,7 +211,8 @@ var taskcallback = { let params = options.params; params["orderId"] = result["orderId"]; delete params.codeId; - const useragent = `okhttp/4.4.0`; + // const useragent = `okhttp/4.4.0`; + const useragent = ` ChinaUnicom4.x/1.0 CFNetwork/1209 Darwin/20.2.0`; let { data } = await axios.request({ baseURL: "https://m.client.10010.com/", headers: { From abc642f8fd302a35797cf0c3bff90aa0623fe9e2 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Wed, 10 Feb 2021 13:43:23 +0800 Subject: [PATCH 040/128] updating --- commands/tasks/unicom/ingotsPage.js | 10 ++++++---- commands/tasks/unicom/taskcallback.js | 8 ++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/commands/tasks/unicom/ingotsPage.js b/commands/tasks/unicom/ingotsPage.js index 0e060b4d7..2142e4ce6 100644 --- a/commands/tasks/unicom/ingotsPage.js +++ b/commands/tasks/unicom/ingotsPage.js @@ -84,10 +84,12 @@ let ingotsPage = { }, signDouble: async (axios, options, cookies) => { console.log("😒 聚宝盆签到翻倍...测试"); - if (!cookies.double) { - console.log("❌ 聚宝盆签到翻倍失败"); - return; - } + console.log(cookies.double); + // return; + // if (!cookies.double) { + // console.log("❌ 聚宝盆签到翻倍失败"); + // return; + // } try { await ingotsPage.lookVideoDouble(axios, { ...options, ...cookies }); } catch (err) { diff --git a/commands/tasks/unicom/taskcallback.js b/commands/tasks/unicom/taskcallback.js index 7789eb8e8..f7046dd77 100644 --- a/commands/tasks/unicom/taskcallback.js +++ b/commands/tasks/unicom/taskcallback.js @@ -211,14 +211,14 @@ var taskcallback = { let params = options.params; params["orderId"] = result["orderId"]; delete params.codeId; - // const useragent = `okhttp/4.4.0`; - const useragent = ` ChinaUnicom4.x/1.0 CFNetwork/1209 Darwin/20.2.0`; + const useragent = `okhttp/4.4.0`; + // const useragent = ` ChinaUnicom4.x/1.0 CFNetwork/1209 Darwin/20.2.0`; let { data } = await axios.request({ baseURL: "https://m.client.10010.com/", headers: { "user-agent": useragent, - referer: `https://img.client.10010.com/`, - origin: "https://img.client.10010.com", + referer: `https://m.client.10010.com/`, + origin: "https://m.client.10010.com", }, url: `/taskcallback/taskfilter/dotasks`, method: "POST", From a5df7dae255a95ad9719cb2d91d1085b3f30fa22 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Wed, 10 Feb 2021 13:45:28 +0800 Subject: [PATCH 041/128] Update ingotsPage.js --- commands/tasks/unicom/ingotsPage.js | 1 + 1 file changed, 1 insertion(+) diff --git a/commands/tasks/unicom/ingotsPage.js b/commands/tasks/unicom/ingotsPage.js index 2142e4ce6..4f7992e8c 100644 --- a/commands/tasks/unicom/ingotsPage.js +++ b/commands/tasks/unicom/ingotsPage.js @@ -105,6 +105,7 @@ let ingotsPage = { arguments4: new Date().getTime(), // time arguments6: "517050707", arguments7: "517050707", + arguments9: "4640b530b3f7481bb5821c6871854ce5", netWay: "Wifi", version: `android@8.0102`, }; From 2901ea48537b93f01daeca22c7aa0db2f371d0b2 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Wed, 10 Feb 2021 13:46:43 +0800 Subject: [PATCH 042/128] Update ingotsPage.js --- commands/tasks/unicom/ingotsPage.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/commands/tasks/unicom/ingotsPage.js b/commands/tasks/unicom/ingotsPage.js index 4f7992e8c..a32512cd6 100644 --- a/commands/tasks/unicom/ingotsPage.js +++ b/commands/tasks/unicom/ingotsPage.js @@ -105,6 +105,7 @@ let ingotsPage = { arguments4: new Date().getTime(), // time arguments6: "517050707", arguments7: "517050707", + arguments8: "123456", arguments9: "4640b530b3f7481bb5821c6871854ce5", netWay: "Wifi", version: `android@8.0102`, @@ -129,10 +130,10 @@ let ingotsPage = { arguments2: "GGPD", // yhChannel arguments3: "73e3907bbf9c4748b2fe9a053cee5e82", // yhTaskId menuId arguments4: new Date().getTime(), // time - arguments6: "", - arguments7: "", - arguments8: "", - arguments9: "", + arguments6: "517050707", + arguments7: "517050707", + arguments8: "123456", + arguments9: "4640b530b3f7481bb5821c6871854ce5", orderId: crypto .createHash("md5") .update(new Date().getTime() + "") From 0f89477d90e198a49ab72b54a1a81ba6a5cf9853 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Wed, 10 Feb 2021 13:48:41 +0800 Subject: [PATCH 043/128] Update ingotsPage.js --- commands/tasks/unicom/ingotsPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/tasks/unicom/ingotsPage.js b/commands/tasks/unicom/ingotsPage.js index a32512cd6..7eaf6155f 100644 --- a/commands/tasks/unicom/ingotsPage.js +++ b/commands/tasks/unicom/ingotsPage.js @@ -128,7 +128,7 @@ let ingotsPage = { params = { arguments1: "AC20200716103629", // acid arguments2: "GGPD", // yhChannel - arguments3: "73e3907bbf9c4748b2fe9a053cee5e82", // yhTaskId menuId + arguments3: "45d6dbc3ad144c938cfa6b8e81803b85", // yhTaskId menuId arguments4: new Date().getTime(), // time arguments6: "517050707", arguments7: "517050707", From 80e7346be82e5758593d3e738bc78e20f28bf979 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Wed, 10 Feb 2021 13:50:39 +0800 Subject: [PATCH 044/128] Update ingotsPage.js --- commands/tasks/unicom/ingotsPage.js | 1 + 1 file changed, 1 insertion(+) diff --git a/commands/tasks/unicom/ingotsPage.js b/commands/tasks/unicom/ingotsPage.js index 7eaf6155f..8987ccba1 100644 --- a/commands/tasks/unicom/ingotsPage.js +++ b/commands/tasks/unicom/ingotsPage.js @@ -92,6 +92,7 @@ let ingotsPage = { // } try { await ingotsPage.lookVideoDouble(axios, { ...options, ...cookies }); + console.log("😒 聚宝盆签到完成"); } catch (err) { console.log("❌ 聚宝盆签到报错: ", err); } From baa97ff9d9cc7e2a01c634ee94f694102519b67a Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Wed, 10 Feb 2021 13:57:39 +0800 Subject: [PATCH 045/128] Update ingotsPage.js --- commands/tasks/unicom/ingotsPage.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/commands/tasks/unicom/ingotsPage.js b/commands/tasks/unicom/ingotsPage.js index 8987ccba1..e7d169455 100644 --- a/commands/tasks/unicom/ingotsPage.js +++ b/commands/tasks/unicom/ingotsPage.js @@ -84,7 +84,10 @@ let ingotsPage = { }, signDouble: async (axios, options, cookies) => { console.log("😒 聚宝盆签到翻倍...测试"); + console.log("等待15秒再继续"); console.log(cookies.double); + // eslint-disable-next-line no-unused-vars + await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); // return; // if (!cookies.double) { // console.log("❌ 聚宝盆签到翻倍失败"); @@ -92,7 +95,7 @@ let ingotsPage = { // } try { await ingotsPage.lookVideoDouble(axios, { ...options, ...cookies }); - console.log("😒 聚宝盆签到完成"); + console.log("⭕ 聚宝盆签到完成"); } catch (err) { console.log("❌ 聚宝盆签到报错: ", err); } From bd825538f8662193d16f1516601492e1b3b2995e Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Wed, 10 Feb 2021 14:30:37 +0800 Subject: [PATCH 046/128] =?UTF-8?q?=F0=9F=90=8D=20fixed=20bug=20at=20ingot?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/ingotsPage.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/commands/tasks/unicom/ingotsPage.js b/commands/tasks/unicom/ingotsPage.js index e7d169455..7ab60f375 100644 --- a/commands/tasks/unicom/ingotsPage.js +++ b/commands/tasks/unicom/ingotsPage.js @@ -65,8 +65,7 @@ let ingotsPage = { }); switch (result.data.code) { case 200: - next(result.data.data); - break; + return next(result.data.data); case 500: console.log("😒 聚宝盆签到:" + result.data["msg"]); return { double: false }; @@ -76,8 +75,7 @@ let ingotsPage = { function next(data) { console.log("😒 聚宝盆签到获取积分:" + data["prizeName"]); console.log( - "😒 聚宝盆签到翻倍状态:" + (data["double"] ? "可翻倍" : "不可翻倍"), - "预计视频奖励测试: 4" + "😒 聚宝盆签到翻倍状态:" + (data["double"] ? "可翻倍" : "不可翻倍") ); return { recordId: data["recordId"], double: data["double"] }; } From 1ab1ef909b15eaba81a40b7fbf5267d98b10e75a Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Wed, 10 Feb 2021 16:20:17 +0800 Subject: [PATCH 047/128] =?UTF-8?q?=F0=9F=9A=A7=20updating=20task=20ingots?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/ingotsPage.js | 187 ++++++++++++++++++++++++++-- 1 file changed, 175 insertions(+), 12 deletions(-) diff --git a/commands/tasks/unicom/ingotsPage.js b/commands/tasks/unicom/ingotsPage.js index 7ab60f375..f57b64e06 100644 --- a/commands/tasks/unicom/ingotsPage.js +++ b/commands/tasks/unicom/ingotsPage.js @@ -1,17 +1,17 @@ let crypto = require("crypto"); -let { encryptPhone, sign } = require("./handlers/PAES.js"); -const useragent = require("./handlers/myPhone").useragent; +let moment = require("moment"); +let { encryptPhone, sign, encrypt } = require("./handlers/PAES.js"); +const { useragent, randomNumber } = require("./handlers/myPhone"); const gameEvents = require("./handlers/dailyEvent"); let { transParams } = require("./handlers/gameUtils"); -const referer = - "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-qd/bcow/index.html?jump=sign"; let ingotsPage = { doTask: async (axios, options) => { console.log("😒 游玩聚宝盆..."); let cookies = await ingotsPage.getOpenPlatLine(axios, options); - await ingotsPage.postIndexInfo(axios, options, cookies); + let info = await ingotsPage.postIndexInfo(axios, options, cookies); let result = await ingotsPage.postSign(axios, options, cookies); await ingotsPage.signDouble(axios, options, { ...cookies, ...result }); + await ingotsPage.postGame(axios, options, cookies, info); }, // eslint-disable-next-line no-unused-vars postIndexInfo: async (axios, options, { ecs_token, searchParams, jar1 }) => { @@ -34,7 +34,7 @@ let ingotsPage = { if (result.data.code !== 200) { throw new Error("❌ something errors: ", result.data.msg); } - next(result.data.data); + return next(result.data.data); function next(data) { console.log( "😒 聚宝盆状态: " + (data["sign"] ? "已签到" : "未签到"), @@ -44,6 +44,7 @@ let ingotsPage = { "😒 聚宝盆游玩次数:" + data["leftTimes"], "预计视频奖励测试: 4" ); + return { freeTimes: data["leftTimes"], advertTimes: 4 }; } }, postSign: async (axios, options) => { @@ -87,10 +88,10 @@ let ingotsPage = { // eslint-disable-next-line no-unused-vars await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); // return; - // if (!cookies.double) { - // console.log("❌ 聚宝盆签到翻倍失败"); - // return; - // } + if (!cookies.double) { + console.log("❌ 聚宝盆签到翻倍失败"); + return; + } try { await ingotsPage.lookVideoDouble(axios, { ...options, ...cookies }); console.log("⭕ 聚宝盆签到完成"); @@ -98,7 +99,169 @@ let ingotsPage = { console.log("❌ 聚宝盆签到报错: ", err); } }, - // postCreditsDouble: (axios, options) => {}, + postGame: async ( + axios, + options, + // eslint-disable-next-line no-unused-vars + { ecs_token, searchParams, jar1 }, + { freeTimes, advertTimes } + ) => { + console.log("😒 聚宝盆游玩...测试"); + console.log(freeTimes, advertTimes); + let data; + //check game time information + do { + console.log( + "已消耗机会", + 1 + 4 - (freeTimes + advertTimes), + "剩余免费机会", + freeTimes, + "看视频广告机会", + advertTimes + ); + if (!freeTimes && advertTimes) { + console.log("视频补充"); + let params = { + arguments1: "AC20200716103629", // acid + arguments2: "GGPD", // yhChannel + arguments3: "45d6dbc3ad144c938cfa6b8e81803b85", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "517050707", + arguments7: "517050707", + arguments8: "123456", + arguments9: "4640b530b3f7481bb5821c6871854ce5", + netWay: "Wifi", + remark1: "签到聚宝盆活动", + remark: "签到页小游戏", + version: `android@8.0102`, + codeId: 945757412, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + params.arguments6, + params.arguments7, + params.arguments8, + params.arguments9, + ]); + params["orderId"] = crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"); + params["arguments4"] = new Date().getTime(); + + await require("./taskcallback").reward(axios, { + ...options, + params, + jar: jar1, + }); + advertTimes--; + } else { + freeTimes--; + } + let phone = encryptPhone(options.user, "gb6YCccUvth75Tm2"); + let score = encrypt(randomNumber(12, 20) * 10, "gb6YCccUvth75Tm2"); + let timestamp = moment().format("YYYYMMDDHHmmss"); + let result = await axios.request({ + headers: { + "user-agent": useragent(options), + referer: `https://wxapp.msmds.cn/h5/react_web/unicom/ingotsPage?source=unicom&type=02&ticket=${searchParams.ticket}&version=iphone_c@8.0102×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&duanlianjieabc=tbLm0&userNumber=${options.user}`, + origin: "https://wxapp.msmds.cn", + "Content-Type": "application/x-www-form-urlencoded", + }, + url: `https://wxapp.msmds.cn/jplus/h5/greetGoldIngot/startGame`, + method: "POST", + data: transParams({ + channelId: "LT_channel", + phone: phone, + token: ecs_token, + score: score, + sourceCode: "lt_ingots", + }), + }); + console.log(result.data); + if (result.data.code !== 200) { + throw new Error("❌ something errors: ", result.data.msg); + } + console.log("😒 聚宝盆游玩获得积分: ", result.data.data.prizeName); + if (!result.data.double) { + console.log(result.data.double); + console.log("❌ 聚宝盆游玩暂无翻倍"); + data = { double: false }; + } else { + data = { double: true }; + } + await ingotsPage.postGameDouble(axios, options, data); + } while (freeTimes || advertTimes); + return data; + }, + postGameDouble: async (axios, options, cookies) => { + console.log("😒 聚宝盆游玩开始翻倍"); + console.log("等待15秒再继续"); + console.log(cookies.double); + // eslint-disable-next-line no-unused-vars + await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); + + let params = { + arguments1: "AC20200716103629", // acid + arguments2: "GGPD", // yhChannel + // arguments3: "56ff7ad4a6e84886b18ae8716dfd1d6d", // yhTaskId menuId + arguments3: "56ff7ad4a6e84886b18ae8716dfd1d6d", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "517050707", + arguments7: "517050707", + arguments8: "123456", + arguments9: "4640b530b3f7481bb5821c6871854ce5", + netWay: "Wifi", + version: `android@8.0102`, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + let { num, jar } = await require("./taskcallback").query(axios, { + ...options, + params, + }); + + if (!num) { + console.log("😒 签到小游戏聚宝盆: 今日已完成"); + return; + } + params = { + arguments1: "AC20200716103629", // acid + arguments2: "GGPD", // yhChannel + arguments3: "56ff7ad4a6e84886b18ae8716dfd1d6d", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "517050707", + arguments7: "517050707", + arguments8: "123456", + arguments9: "4640b530b3f7481bb5821c6871854ce5", + orderId: crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"), + netWay: "Wifi", + remark: "签到小游戏聚宝盆", + version: `android@8.0102`, + codeId: 945757412, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + await require("./taskcallback").doTask(axios, { + ...options, + params, + jar, + }); + }, lookVideoDouble: async (axios, options) => { let params = { arguments1: "AC20200716103629", // acid @@ -142,7 +305,7 @@ let ingotsPage = { .digest("hex"), netWay: "Wifi", remark: "签到小游戏聚宝盆", - version: `android@8.0100`, + version: `android@8.0102`, codeId: 945757412, }; params["sign"] = sign([ From 676daad23165a8cc858d646f47df985ccfd8cd4e Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Wed, 10 Feb 2021 17:08:01 +0800 Subject: [PATCH 048/128] =?UTF-8?q?=F0=9F=9A=A7=20updating=20task=20ingots?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/dailyGrabdollPage.js | 377 +++++++++++---------- commands/tasks/unicom/ingotsPage.js | 46 ++- 2 files changed, 230 insertions(+), 193 deletions(-) diff --git a/commands/tasks/unicom/dailyGrabdollPage.js b/commands/tasks/unicom/dailyGrabdollPage.js index b77d43977..49efe4533 100644 --- a/commands/tasks/unicom/dailyGrabdollPage.js +++ b/commands/tasks/unicom/dailyGrabdollPage.js @@ -1,205 +1,218 @@ -var crypto = require('crypto'); -var moment = require('moment'); +var crypto = require("crypto"); +var moment = require("moment"); // 开心抓大奖 var transParams = (data) => { - let params = new URLSearchParams(); - for (let item in data) { - params.append(item, data['' + item + '']); - } - return params; + let params = new URLSearchParams(); + for (let item in data) { + params.append(item, data["" + item + ""]); + } + return params; }; function w() { - var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {} - , t = []; - return Object.keys(e).forEach((function (a) { - t.push("".concat(a, "=").concat(encodeURIComponent(e[a]))) - } - )), - t.join("&") + var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + t = []; + return ( + Object.keys(e).forEach(function (a) { + t.push("".concat(a, "=").concat(encodeURIComponent(e[a]))); + }), + t.join("&") + ); } var sign = (data) => { - let str = 'integralofficial&' - let params = [] - data.forEach((v, i) => { - if (v) { - params.push('arguments' + (i + 1) + v) - } - }); - return crypto.createHash('md5').update(str + params.join('&')).digest('hex') -} + let str = "integralofficial&"; + let params = []; + data.forEach((v, i) => { + if (v) { + params.push("arguments" + (i + 1) + v); + } + }); + return crypto + .createHash("md5") + .update(str + params.join("&")) + .digest("hex"); +}; function encryption(data, key) { - var iv = ""; - var cipherEncoding = 'base64'; - var cipher = crypto.createCipheriv('aes-128-ecb', key, iv); - cipher.setAutoPadding(true); - return Buffer.concat([cipher.update(data), cipher.final()]).toString(cipherEncoding); + var iv = ""; + var cipherEncoding = "base64"; + var cipher = crypto.createCipheriv("aes-128-ecb", key, iv); + cipher.setAutoPadding(true); + return Buffer.concat([cipher.update(data), cipher.final()]).toString( + cipherEncoding + ); } var dailyGrabdollPage = { - getState: async (axios, options) => { - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}` - const { searchParams, ecs_token } = options - let phone = encryption(options.user, 'gb6YCccUvth75Tm2') - let timestamp = moment().format('YYYYMMDDHHmmss') - let { data, config } = await axios.request({ - headers: { - "user-agent": useragent, - "referer": `https://wxapp.msmds.cn/h5/react_web/unicom/grabdollPage?source=unicom&type=02&ticket=${searchParams.ticket}&version=android@8.0100×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&duanlianjieabc=tbKHR&userNumber=${options.user}`, - }, - url: `https://wxapp.msmds.cn/jplus/api/channelGrabDoll/index`, - method: 'POST', - data: transParams({ - 'channelId': 'LT_channel', - "phone": phone, - 'token': ecs_token, - 'sourceCode': 'lt_zhuawawa' - }) - }) - if (data.code !== 200) { - console.log('获取任务状态失败') - return { - jar: config.jar, - state: false + getState: async (axios, options) => { + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; + const { searchParams, ecs_token } = options; + let phone = encryption(options.user, "gb6YCccUvth75Tm2"); + let timestamp = moment().format("YYYYMMDDHHmmss"); + let { data, config } = await axios.request({ + headers: { + "user-agent": useragent, + referer: `https://wxapp.msmds.cn/h5/react_web/unicom/grabdollPage?source=unicom&type=02&ticket=${searchParams.ticket}&version=android@8.0100×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&duanlianjieabc=tbKHR&userNumber=${options.user}`, + }, + url: `https://wxapp.msmds.cn/jplus/api/channelGrabDoll/index`, + method: "POST", + data: transParams({ + channelId: "LT_channel", + phone: phone, + token: ecs_token, + sourceCode: "lt_zhuawawa", + }), + }); + if (data.code !== 200) { + console.log("获取任务状态失败"); + return { + jar: config.jar, + state: false, + }; + } else { + return { + jar: config.jar, + state: data.data.grabDollAgain, + }; + } + }, + doTask: async (axios, options) => { + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; + let searchParams = {}; + let result = await axios + .request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": useragent, + referer: `https://img.client.10010.com/`, + origin: "https://img.client.10010.com", + }, + url: `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://wxapp.msmds.cn/h5/react_web/unicom/grabdollPage?source=unicom&duanlianjieabc=tbKHR`, + method: "GET", + transformResponse: (data, headers) => { + if ("location" in headers) { + let uu = new URL(headers.location); + let pp = {}; + for (let p of uu.searchParams) { + pp[p[0]] = p[1]; } - } else { - return { - jar: config.jar, - state: data.data.grabDollAgain + if ("ticket" in pp) { + searchParams = pp; } - } - }, - doTask: async (axios, options) => { - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}` - let searchParams = {} - let result = await axios.request({ - baseURL: 'https://m.client.10010.com/', - headers: { - "user-agent": useragent, - "referer": `https://img.client.10010.com/`, - "origin": "https://img.client.10010.com" - }, - url: `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://wxapp.msmds.cn/h5/react_web/unicom/grabdollPage?source=unicom&duanlianjieabc=tbKHR`, - method: 'GET', - transformResponse: (data, headers) => { - if ('location' in headers) { - let uu = new URL(headers.location) - let pp = {} - for (let p of uu.searchParams) { - pp[p[0]] = p[1] - } - if ('ticket' in pp) { - searchParams = pp - } - } - return data - } - }).catch(err => console.log(err)) - let jar1 = result.config.jar + } + return data; + }, + }) + .catch((err) => console.log(err)); + let jar1 = result.config.jar; - let cookiesJson = jar1.toJSON() - let ecs_token = cookiesJson.cookies.find(i => i.key == 'ecs_token') - ecs_token = ecs_token.value - if (!ecs_token) { - throw new Error('ecs_token缺失') - } - let { state, jar: gjar } = await dailyGrabdollPage.getState(axios, { - ...options, - ecs_token, - searchParams - }) - if (!state) { - console.log('任务已完成,明日再来') - return - } - let phone = encryption(options.user, 'gb6YCccUvth75Tm2') - let times = 5 - do { - - if (times < 5) { - let params = { - 'arguments1': 'AC20200624091508', - 'arguments2': 'GGPD', - 'arguments3': '734225b6ec9946cca3bcdc6a6e14fc1f', - 'arguments4': new Date().getTime(), - 'arguments6': '', - 'arguments7': '', - 'arguments8': '', - 'arguments9': '', - 'netWay': 'Wifi', - 'remark': '签到看视频得积分2', - 'remark1': '签到看视频得积分2', - 'version': `android@8.0100`, - 'codeId': 945474727 - } - - params['sign'] = sign([params.arguments1, params.arguments2, params.arguments3, params.arguments4]) - params['orderId'] = crypto.createHash('md5').update(new Date().getTime() + '').digest('hex') - params['arguments4'] = new Date().getTime() - - let result = await require('./taskcallback').reward(axios, { - ...options, - params, - jar: jar1 - }) - let a = { - 'channelId': 'LT_channel', - "phone": phone, - 'token': ecs_token, - 'sourceCode': 'lt_zhuawawa' - } + let cookiesJson = jar1.toJSON(); + let ecs_token = cookiesJson.cookies.find((i) => i.key == "ecs_token"); + ecs_token = ecs_token.value; + if (!ecs_token) { + throw new Error("ecs_token缺失"); + } + let { state, jar: gjar } = await dailyGrabdollPage.getState(axios, { + ...options, + ecs_token, + searchParams, + }); + if (!state) { + console.log("任务已完成,明日再来"); + return; + } + let phone = encryption(options.user, "gb6YCccUvth75Tm2"); + let times = 5; + do { + if (times < 5) { + let params = { + arguments1: "AC20200624091508", + arguments2: "GGPD", + arguments3: "734225b6ec9946cca3bcdc6a6e14fc1f", + arguments4: new Date().getTime(), + arguments6: "", + arguments7: "", + arguments8: "", + arguments9: "", + netWay: "Wifi", + remark: "签到看视频得积分2", + remark1: "签到看视频得积分2", + version: `android@8.0100`, + codeId: 945474727, + }; - let timestamp = moment().format('YYYYMMDDHHmmss') - result = await axios.request({ - headers: { - "user-agent": useragent, - "referer": `https://wxapp.msmds.cn/h5/react_web/unicom/grabdollPage?source=unicom&type=02&ticket=${searchParams.ticket}&version=android@8.0100×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&duanlianjieabc=tbKHR&userNumber=${options.user}`, - "origin": "https://wxapp.msmds.cn" - }, - jar: gjar, - url: `https://wxapp.msmds.cn/jplus/api/channelGrabDoll/playAgainByLookingVideos`, - method: 'POST', - data: transParams(a) - }) + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + params["orderId"] = crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"); + params["arguments4"] = new Date().getTime(); - if (result.data.code !== 200) { - console.log('提交任务失败', result.data.msg) - } else { - console.log('提交任务成功', `${result.data.data}`) - } + let result = await require("./taskcallback").reward(axios, { + ...options, + params, + jar: jar1, + }); + let a = { + channelId: "LT_channel", + phone: phone, + token: ecs_token, + sourceCode: "lt_zhuawawa", + }; - } + let timestamp = moment().format("YYYYMMDDHHmmss"); + result = await axios.request({ + headers: { + "user-agent": useragent, + referer: `https://wxapp.msmds.cn/h5/react_web/unicom/grabdollPage?source=unicom&type=02&ticket=${searchParams.ticket}&version=android@8.0100×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&duanlianjieabc=tbKHR&userNumber=${options.user}`, + origin: "https://wxapp.msmds.cn", + }, + jar: gjar, + url: `https://wxapp.msmds.cn/jplus/api/channelGrabDoll/playAgainByLookingVideos`, + method: "POST", + data: transParams(a), + }); - let timestamp = moment().format('YYYYMMDDHHmmss') - let res = await axios.request({ - headers: { - "user-agent": useragent, - "referer": `https://wxapp.msmds.cn/h5/react_web/unicom/grabdollPage?source=unicom&type=02&ticket=${searchParams.ticket}&version=android@8.0100×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&duanlianjieabc=tbKHR&userNumber=${options.user}`, - }, - jar: gjar, - url: `https://wxapp.msmds.cn/jplus/api/channelGrabDoll/startGame`, - method: 'POST', - data: transParams({ - 'channelId': 'LT_channel', - "phone": phone, - 'token': ecs_token, - 'sourceCode': 'lt_zhuawawa' - }) - }) + if (result.data.code !== 200) { + console.log("提交任务失败", result.data.msg); + } else { + console.log("提交任务成功", `${result.data.data}`); + } + } - let result = res.data - if (result.code === 200) { - console.log('阅读开心抓大奖', result.data.goodsName) - } else { - console.log('阅读开心抓大奖', result.msg) - } + let timestamp = moment().format("YYYYMMDDHHmmss"); + let res = await axios.request({ + headers: { + "user-agent": useragent, + referer: `https://wxapp.msmds.cn/h5/react_web/unicom/grabdollPage?source=unicom&type=02&ticket=${searchParams.ticket}&version=android@8.0100×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&duanlianjieabc=tbKHR&userNumber=${options.user}`, + }, + jar: gjar, + url: `https://wxapp.msmds.cn/jplus/api/channelGrabDoll/startGame`, + method: "POST", + data: transParams({ + channelId: "LT_channel", + phone: phone, + token: ecs_token, + sourceCode: "lt_zhuawawa", + }), + }); - console.log('等待15秒再继续') - await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)) + let result = res.data; + if (result.code === 200) { + console.log("阅读开心抓大奖", result.data.goodsName); + } else { + console.log("阅读开心抓大奖", result.msg); + } - } while (--times) - } -} + console.log("等待15秒再继续"); + await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); + } while (--times); + }, +}; -module.exports = dailyGrabdollPage \ No newline at end of file +module.exports = dailyGrabdollPage; diff --git a/commands/tasks/unicom/ingotsPage.js b/commands/tasks/unicom/ingotsPage.js index f57b64e06..a10e27535 100644 --- a/commands/tasks/unicom/ingotsPage.js +++ b/commands/tasks/unicom/ingotsPage.js @@ -40,10 +40,6 @@ let ingotsPage = { "😒 聚宝盆状态: " + (data["sign"] ? "已签到" : "未签到"), "签到次数: " + data["signTimes"] ); - console.log( - "😒 聚宝盆游玩次数:" + data["leftTimes"], - "预计视频奖励测试: 4" - ); return { freeTimes: data["leftTimes"], advertTimes: 4 }; } }, @@ -108,6 +104,7 @@ let ingotsPage = { ) => { console.log("😒 聚宝盆游玩...测试"); console.log(freeTimes, advertTimes); + let phone = encryptPhone(options.user, "gb6YCccUvth75Tm2"); let data; //check game time information do { @@ -131,8 +128,8 @@ let ingotsPage = { arguments8: "123456", arguments9: "4640b530b3f7481bb5821c6871854ce5", netWay: "Wifi", - remark1: "签到聚宝盆活动", - remark: "签到页小游戏", + remark1: "签到看视频得积分2", + remark: "签到看视频得积分2", version: `android@8.0102`, codeId: 945757412, }; @@ -141,10 +138,6 @@ let ingotsPage = { params.arguments2, params.arguments3, params.arguments4, - params.arguments6, - params.arguments7, - params.arguments8, - params.arguments9, ]); params["orderId"] = crypto .createHash("md5") @@ -157,11 +150,37 @@ let ingotsPage = { params, jar: jar1, }); + + let a = { + channelId: "LT_channel", + phone: phone, + token: ecs_token, + videoOrderNo: "3EE16FBF54F3942BDDC0FE121360661A", + sourceCode: "lt_ingots", + }; + + let timestamp = moment().format("YYYYMMDDHHmmss"); + let result = await axios.request({ + headers: { + "user-agent": useragent(options), + referer: `https://wxapp.msmds.cn/h5/react_web/unicom/ingotsPage?source=unicom&type=02&ticket=${searchParams.ticket}&version=android@8.0102×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&duanlianjieabc=tbLm0&userNumber=${options.user}`, + origin: "https://wxapp.msmds.cn", + }, + jar: jar1, + url: `https://wxapp.msmds.cn/jplus/h5/greetGoldIngot/playAgainByLookingVideos`, + method: "POST", + data: transParams(a), + }); + console.log(result.data); + if (result.data.code !== 200) { + console.log("提交任务失败", result.data.msg); + } else { + console.log("提交任务成功", `${result.data.data}`); + } advertTimes--; } else { freeTimes--; } - let phone = encryptPhone(options.user, "gb6YCccUvth75Tm2"); let score = encrypt(randomNumber(12, 20) * 10, "gb6YCccUvth75Tm2"); let timestamp = moment().format("YYYYMMDDHHmmss"); let result = await axios.request({ @@ -170,6 +189,7 @@ let ingotsPage = { referer: `https://wxapp.msmds.cn/h5/react_web/unicom/ingotsPage?source=unicom&type=02&ticket=${searchParams.ticket}&version=iphone_c@8.0102×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&duanlianjieabc=tbLm0&userNumber=${options.user}`, origin: "https://wxapp.msmds.cn", "Content-Type": "application/x-www-form-urlencoded", + jar: jar1, }, url: `https://wxapp.msmds.cn/jplus/h5/greetGoldIngot/startGame`, method: "POST", @@ -194,6 +214,10 @@ let ingotsPage = { data = { double: true }; } await ingotsPage.postGameDouble(axios, options, data); + + console.log("等待15秒再继续"); + // eslint-disable-next-line no-unused-vars + await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); } while (freeTimes || advertTimes); return data; }, From 716695127cd7677bbe6e738ca0cd797af8bf9b31 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Wed, 10 Feb 2021 17:31:32 +0800 Subject: [PATCH 049/128] =?UTF-8?q?=F0=9F=9A=A7=20updating=20task=20ingots?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/handlers/myPhone.js | 8 ++++++++ commands/tasks/unicom/ingotsPage.js | 13 +++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/commands/tasks/unicom/handlers/myPhone.js b/commands/tasks/unicom/handlers/myPhone.js index 0cbf4dc8a..05a3dfd47 100644 --- a/commands/tasks/unicom/handlers/myPhone.js +++ b/commands/tasks/unicom/handlers/myPhone.js @@ -11,6 +11,13 @@ const useragent = (options) => { options.user ); }; + +// androidCodeId: "945757409", +// iosCodeId: "945757412", +const getCodeId = (useragent) => { + return useragent.indexOf("Android") != -1 ? 945757409 : 945757412; +}; + // `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36;devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:};unicom{version:android@8.0102,desmobile:${options.user}}`; const USER_AGENTS = [ "Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@%s,desmobile:%s};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}", @@ -29,4 +36,5 @@ function randomNumber(min = 0, max = 100) { module.exports = { useragent, randomNumber, + getCodeId, }; diff --git a/commands/tasks/unicom/ingotsPage.js b/commands/tasks/unicom/ingotsPage.js index a10e27535..8b75537e9 100644 --- a/commands/tasks/unicom/ingotsPage.js +++ b/commands/tasks/unicom/ingotsPage.js @@ -1,7 +1,7 @@ let crypto = require("crypto"); let moment = require("moment"); let { encryptPhone, sign, encrypt } = require("./handlers/PAES.js"); -const { useragent, randomNumber } = require("./handlers/myPhone"); +const { useragent, randomNumber, getCodeId } = require("./handlers/myPhone"); const gameEvents = require("./handlers/dailyEvent"); let { transParams } = require("./handlers/gameUtils"); let ingotsPage = { @@ -106,6 +106,7 @@ let ingotsPage = { console.log(freeTimes, advertTimes); let phone = encryptPhone(options.user, "gb6YCccUvth75Tm2"); let data; + let UA = useragent(options); //check game time information do { console.log( @@ -131,7 +132,7 @@ let ingotsPage = { remark1: "签到看视频得积分2", remark: "签到看视频得积分2", version: `android@8.0102`, - codeId: 945757412, + codeId: getCodeId(UA), }; params["sign"] = sign([ params.arguments1, @@ -162,7 +163,7 @@ let ingotsPage = { let timestamp = moment().format("YYYYMMDDHHmmss"); let result = await axios.request({ headers: { - "user-agent": useragent(options), + "user-agent": UA, referer: `https://wxapp.msmds.cn/h5/react_web/unicom/ingotsPage?source=unicom&type=02&ticket=${searchParams.ticket}&version=android@8.0102×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&duanlianjieabc=tbLm0&userNumber=${options.user}`, origin: "https://wxapp.msmds.cn", }, @@ -185,7 +186,7 @@ let ingotsPage = { let timestamp = moment().format("YYYYMMDDHHmmss"); let result = await axios.request({ headers: { - "user-agent": useragent(options), + "user-agent": UA, referer: `https://wxapp.msmds.cn/h5/react_web/unicom/ingotsPage?source=unicom&type=02&ticket=${searchParams.ticket}&version=iphone_c@8.0102×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&duanlianjieabc=tbLm0&userNumber=${options.user}`, origin: "https://wxapp.msmds.cn", "Content-Type": "application/x-www-form-urlencoded", @@ -272,7 +273,7 @@ let ingotsPage = { netWay: "Wifi", remark: "签到小游戏聚宝盆", version: `android@8.0102`, - codeId: 945757412, + codeId: getCodeId("Android"), }; params["sign"] = sign([ params.arguments1, @@ -330,7 +331,7 @@ let ingotsPage = { netWay: "Wifi", remark: "签到小游戏聚宝盆", version: `android@8.0102`, - codeId: 945757412, + codeId: getCodeId("Android"), }; params["sign"] = sign([ params.arguments1, From 6b6cf3bbc39de1913bdb04c92a17578aefc034c7 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Wed, 10 Feb 2021 20:22:10 +0800 Subject: [PATCH 050/128] =?UTF-8?q?=F0=9F=8F=B3=E2=80=8D=F0=9F=8C=88=20cre?= =?UTF-8?q?ated=20three=20squirrels=20task?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tasks/unicom/dailyVideoScratchcard.js | 64 +++++++++++++ commands/tasks/unicom/handlers/gameUtils.js | 58 ++++++++++++ commands/tasks/unicom/ingotsPage.js | 9 +- commands/tasks/unicom/threeSquirrels.js | 92 +++++++++++++++++++ commands/tasks/unicom/unicom.js | 11 +++ 5 files changed, 230 insertions(+), 4 deletions(-) create mode 100644 commands/tasks/unicom/threeSquirrels.js diff --git a/commands/tasks/unicom/dailyVideoScratchcard.js b/commands/tasks/unicom/dailyVideoScratchcard.js index a34a36d85..cbfd8f356 100644 --- a/commands/tasks/unicom/dailyVideoScratchcard.js +++ b/commands/tasks/unicom/dailyVideoScratchcard.js @@ -64,6 +64,7 @@ var dailyVideoScratchcard = { return result.data.data.allCards.filter((c) => !c.status); }, doTask: async (axios, options) => { + console.log("🤔 刮刮卡游玩开始..."); const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; let searchParams = {}; let result = await axios @@ -177,6 +178,69 @@ var dailyVideoScratchcard = { console.log("暂无可刮得商品"); } }, + lookVideoDouble: async (axios, options) => { + let params = { + arguments1: "AC20200611152252", + arguments2: "GGPD", + arguments3: "4640b530b3f7481bb5821c6871854ce5", + arguments4: new Date().getTime(), + arguments6: "517050707", + arguments7: "517050707", + arguments8: "123456", + arguments9: "4640b530b3f7481bb5821c6871854ce5", + netWay: "Wifi", + remark1: "签到翻牛牌活动", + remark: "签到看视频翻倍得积分", + version: `android@8.0102`, + codeId: 945689604, + }; + params["sign"] = AES.sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + let { num, jar } = await require("./taskcallback").query(axios, { + ...options, + params, + }); + + if (!num) { + console.log("签到小游戏翻牛牌: 今日已完成"); + return; + } + + params = { + arguments1: "AC20200611152252", // acid + arguments2: "GGPD", // yhChannel + arguments3: "627292f1243148159c58fd58917c3e67", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "", + arguments7: "", + arguments8: "", + arguments9: "", + orderId: crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"), + netWay: "Wifi", + remark: "签到小游戏翻牛牌", + version: `android@8.0100`, + codeId: 945689604, + }; + params["sign"] = AES.sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + await require("./taskcallback").doTask(axios, { + ...options, + params, + jar, + }); + }, + lookVideoDoubleResult: gameEvents.lookVideoDoubleResult("翻牛牌送好礼"), }; module.exports = dailyVideoScratchcard; diff --git a/commands/tasks/unicom/handlers/gameUtils.js b/commands/tasks/unicom/handlers/gameUtils.js index 80749ad79..c36eb2a12 100644 --- a/commands/tasks/unicom/handlers/gameUtils.js +++ b/commands/tasks/unicom/handlers/gameUtils.js @@ -6,6 +6,64 @@ let transParams = (data) => { return params; }; +//OLD=>NEW +var codeMap = { + 945510695: "945535750", //android-游戏频道看视频得积分2-激励视频 + 945490759: "945535754", //android-买什么都省0.1元薅羊毛-激励视频 + 945490446: "945535421", //android-阅读每日读书福利广告2-激励视频 + 945490436: "945535424", //android-阅读每日读书福利广告1-激励视频 + 945490433: "945535429", //android-阅读打卡视频广告2-激励视频 + 945488048: "945535497", //android-买什么都省刮机票-激励视频 + 945485144: "945535532", //android-签到领福利赚积分翻牌活动-激励视频 + 945479131: "945535537", //android-分享看视频翻倍得积分-激励视频 + 945474727: "945535596", //android-签到看视频得积分2-激励视频 + 945444936: "945535612", //android-签到领福利赚积分-激励视频 + 945432413: "945535616", //android-阅读打卡看视频得积分-激励视频 + 945430422: "945535625", //android-签到任务读小说赚积分-激励视频 + 945413733: "945535626", //android-沃之树看视频得浇水机会-激励视频 + 945399856: "945535628", //android-沃之树看视频发流量-激励视频 + 945398647: "945535629", //android-签到小游戏盲盒4-激励视频 + 945398637: "945535631", //android-签到小游戏盲盒3-激励视频 + 945398632: "945535632", //android-签到小游戏盲盒2-激励视频 + 945398627: "945535633", //android-签到小游戏盲盒-激励视频 + 945369958: "945535634", //android-积分商城积分夺宝-激励视频 + 945369931: "945535635", //android-积分商城女神口红-激励视频 + 945369805: "945535636", //android-积分商城小游戏-激励视频 + 945363378: "945535637", //android-买什么都省刮刮卡积分翻倍-激励视频 + 945363376: "945535641", //android-买什么都省刮刮卡-激励视频 + 945358647: "945535673", //android-阅读章节视频得积分2-激励视频 + 945358646: "945535674", //android-阅读章节视频得积分1-激励视频 + 945349372: "945535675", //android-买什么都省神奇便利店2-激励视频 + 945349368: "945535676", //android-买什么都省神奇便利店-激励视频 + 945340295: "945535677", //android-聚人气看视频得助力-激励视频 + 945339639: "945535679", //android-签到小游戏买幸运转转赚4-激励视频 + 945339636: "945535680", //android-签到小游戏买扭蛋机4-激励视频 + 945339630: "945535681", //android-签到小游戏买幸运转转赚3-激励视频 + 945339624: "945535683", //android-签到小游戏买扭蛋机3-激励视频 + 945339619: "945535684", //android-签到小游戏买幸运转转赚2-激励视频 + 945339610: "945535686", //android-签到小游戏买扭蛋机2-激励视频 + 945318810: "945535689", //android-签到小游戏买什么都省免费夺宝-激励视频 + 945318808: "945535693", //android-签到小游戏买什么都省申请便利店抽奖-激励视频 + 945318805: "945535695", //android-签到小游戏买什么都省转盘抽奖-激励视频 + 945292330: "945535698", //android-沃砍看视频砍价-激励视频 + 945290261: "945535700", //ios-游戏佰多惠看视频得道具-激励视频 + 945281443: "945535703", //android-业务查询看视频得积分-激励视频 + 945254827: "945535704", //android-签到看视频得积分-激励视频 + 945254821: "945535705", //android-福利订单看视频得积分-激励视频 + 945254816: "945535706", //android-10分精彩看视频得积分-激励视频 + 945235460: "945535707", //android-签到小游戏-激励视频 + 945228773: "945535710", //android-签到任务看视频领流量-激励视频 + 945228768: "945535712", //android-游戏漫乐游看视频得道具-激励视频 + 945228766: "945535714", //android-游戏杭州西米看视频得道具-激励视频 + 945228764: "945535718", //android-游戏悠游看视频得道具-激励视频 + 945228762: "945535724", //android-游戏触推河北看视频得道具-激励视频 + 945228759: "945535729", //android-游戏互娱看视频得道具-激励视频 + 945210860: "945535731", //android-游戏深圳微应看视频得道具-激励视频 + 945188117: "945535734", //android-游戏掌上乐游看视频得道具-激励视频 + 945188116: "945535736", //android-游戏频道看视频得积分-激励视频 + 945188114: "945535740", //android-阅读计时器看视频得积分-激励视频 + 945188112: "945535743", //android-签到看视频翻倍得积分-激励视频 +}; module.exports = { transParams, }; diff --git a/commands/tasks/unicom/ingotsPage.js b/commands/tasks/unicom/ingotsPage.js index 8b75537e9..4adcdc19b 100644 --- a/commands/tasks/unicom/ingotsPage.js +++ b/commands/tasks/unicom/ingotsPage.js @@ -122,7 +122,7 @@ let ingotsPage = { let params = { arguments1: "AC20200716103629", // acid arguments2: "GGPD", // yhChannel - arguments3: "45d6dbc3ad144c938cfa6b8e81803b85", // yhTaskId menuId + arguments3: "56ff7ad4a6e84886b18ae8716dfd1d6d", // yhTaskId menuId arguments4: new Date().getTime(), // time arguments6: "517050707", arguments7: "517050707", @@ -156,7 +156,7 @@ let ingotsPage = { channelId: "LT_channel", phone: phone, token: ecs_token, - videoOrderNo: "3EE16FBF54F3942BDDC0FE121360661A", + videoOrderNo: "83C87F22F5C687BAA914B07ECC5174F1", sourceCode: "lt_ingots", }; @@ -164,8 +164,9 @@ let ingotsPage = { let result = await axios.request({ headers: { "user-agent": UA, - referer: `https://wxapp.msmds.cn/h5/react_web/unicom/ingotsPage?source=unicom&type=02&ticket=${searchParams.ticket}&version=android@8.0102×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&duanlianjieabc=tbLm0&userNumber=${options.user}`, + referer: `https://wxapp.msmds.cn/h5/react_web/unicom/ingotsPage?source=unicom&type=06&ticket=${searchParams.ticket}&version=android@8.0102×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&duanlianjieabc=tbLm0&userNumber=${options.user}`, origin: "https://wxapp.msmds.cn", + "Content-Type": "application/x-www-form-urlencoded", }, jar: jar1, url: `https://wxapp.msmds.cn/jplus/h5/greetGoldIngot/playAgainByLookingVideos`, @@ -187,7 +188,7 @@ let ingotsPage = { let result = await axios.request({ headers: { "user-agent": UA, - referer: `https://wxapp.msmds.cn/h5/react_web/unicom/ingotsPage?source=unicom&type=02&ticket=${searchParams.ticket}&version=iphone_c@8.0102×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&duanlianjieabc=tbLm0&userNumber=${options.user}`, + referer: `https://wxapp.msmds.cn/h5/react_web/unicom/ingotsPage?source=unicom&type=06&ticket=${searchParams.ticket}&version=iphone_c@8.0102×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&duanlianjieabc=tbLm0&userNumber=${options.user}`, origin: "https://wxapp.msmds.cn", "Content-Type": "application/x-www-form-urlencoded", jar: jar1, diff --git a/commands/tasks/unicom/threeSquirrels.js b/commands/tasks/unicom/threeSquirrels.js new file mode 100644 index 000000000..2c98c629b --- /dev/null +++ b/commands/tasks/unicom/threeSquirrels.js @@ -0,0 +1,92 @@ +var crypto = require("crypto"); +var sign = (data) => { + let str = "integralofficial&"; + let params = []; + data.forEach((v, i) => { + if (v) { + params.push("arguments" + (i + 1) + v); + } + }); + return crypto + .createHash("md5") + .update(str + params.join("&")) + .digest("hex"); +}; +let account = { + yhTaskId: "10e36b51060a46499e48082656602bf8", + yhChannel: "GGPD", + accountChannel: "517050707", + accountUserName: "517050707", + accountPassword: "123456", + accountToken: "4640b530b3f7481bb5821c6871854ce5", +}; +var threeSquirrels = { + query: async (request, options) => { + let params = { + arguments1: "AC20200624091508", // acid + arguments2: account.yhChannel, // yhChannel + arguments3: account.yhTaskId, // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: account.accountChannel, + netWay: "Wifi", + version: `android@8.0102`, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + return await require("./taskcallback").query(request, { + ...options, + params, + }); + }, + doTask: async (request, options) => { + console.log("🐀 三只松鼠看视频得积分..."); + let { num, jar } = await threeSquirrels.query(request, options); + if (!num) { + console.log("🐀 三只松鼠看视频得积分: 今日已完成"); + return; + } + do { + console.log("第", num, "次"); + let params = { + arguments1: "AC20200624091508", // acid + arguments2: account.yhChannel, // yhChannel + arguments3: account.yhTaskId, // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "", + arguments7: "", + arguments8: "", + arguments9: "", + orderId: crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"), + netWay: "Wifi", + remark: "支付页", + version: `android@8.0100`, + codeId: 945535636, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + await require("./taskcallback").doTask(request, { + ...options, + params, + jar, + }); + + let s = Math.floor(Math.random() * 20); + console.log("☕ 等待%s秒再继续", s); + // eslint-disable-next-line no-unused-vars + await new Promise((resolve, reject) => setTimeout(resolve, s * 1000)); + } while (--num); + }, +}; + +module.exports = threeSquirrels; diff --git a/commands/tasks/unicom/unicom.js b/commands/tasks/unicom/unicom.js index fa05f63ce..30c173d7f 100644 --- a/commands/tasks/unicom/unicom.js +++ b/commands/tasks/unicom/unicom.js @@ -19,6 +19,7 @@ * 首页-签到有礼-免费抽-拆华为Pad(去抽奖) * 首页-签到有礼-免费抽-拿iPhone12(摇一摇) * 首页-签到有礼-免费抽-赢Apple Watch(去抽奖) [活动取消] + * 首页-签到有礼-免费抽-华为mate40pro(刮刮乐) * 首页-签到有礼-赢vivo X60(翻牛牌) * 首页-签到有礼-赚更多福利-看视频奖励5积分 * 首页-签到有礼-赚更多福利-天天抽好礼 @@ -28,6 +29,7 @@ * 首页-游戏-娱乐中心-每日打卡-完成今日任务(200m) * 首页-积分查询-游戏任务 * 首页-知识-限时免费(连续7天阶梯激励) + * 首页-积分商城-10分精彩看视频得积分-三只松鼠 [支付页] * 节日类 * 首页-牛气-秒杀抢兑 * 首页-牛气-转盘抽奖 @@ -388,6 +390,15 @@ var start = async (params) => { }, taskOption ); + + //首页-积分商城-10分精彩看视频得积分-三只松鼠 [支付页] + await scheduler.regTask( + "threeSquirrels", + async (request) => { + await require("./threeSquirrels").doTask(request, options); + }, + taskOption + ); }; module.exports = { start, From 200b0ea35649dd7e0ea58f28f4a4b4c78d817543 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Wed, 10 Feb 2021 21:29:54 +0800 Subject: [PATCH 051/128] =?UTF-8?q?=F0=9F=90=8D=20fixed=20jflottery?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/jflottery.js | 461 +++++++++++++++-------------- commands/tasks/unicom/unicom.js | 2 +- 2 files changed, 232 insertions(+), 231 deletions(-) diff --git a/commands/tasks/unicom/jflottery.js b/commands/tasks/unicom/jflottery.js index 262729ee6..084514319 100644 --- a/commands/tasks/unicom/jflottery.js +++ b/commands/tasks/unicom/jflottery.js @@ -1,238 +1,239 @@ -var crypto = require('crypto'); -var CryptoJS = require("crypto-js"); -const { URL } = require('url'); +var crypto = require("crypto"); +let moment = require("moment"); +let { sign } = require("./handlers/PAES"); +const gameEvents = require("./handlers/dailyEvent"); +const referer = + "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/tigerarm/index.html?jump=sign"; // 豪礼大派送 -var transParams = (data) => { - let params = new URLSearchParams(); - for (let item in data) { - params.append(item, data['' + item + '']); - } - return params; -}; - -var secretkeyArray = function () { - for (var e = [], t = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", - "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", - "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", - "r", "s", "t", "u", "v", "w", "x", "y", "z"], i = 0; - 5 > i; - i++) { - for (var n = "", s = 0; 16 > s; s++) { - var a = Math.floor(62 * Math.random()); - n += t[a] - } - e.push(n) - } - return e; -} - -var encrypt = function (word, keyStr) { - var key = CryptoJS.enc.Utf8.parse(keyStr); - var srcs = CryptoJS.enc.Utf8.parse(word); - var encrypted = CryptoJS.AES.encrypt(srcs, key, { - mode: CryptoJS.mode.ECB, - padding: CryptoJS.pad.Pkcs7 - }); - return encrypted.toString(); -} - -var decrypt = function (word, keyStr) { - var key = CryptoJS.enc.Utf8.parse(keyStr); - var decrypted = CryptoJS.AES.decrypt(word, key, { - mode: CryptoJS.mode.ECB, - padding: CryptoJS.pad.Pkcs7 - }); - return decrypted.toString(CryptoJS.enc.Utf8); -} -var sign = (data) => { - let str = 'integralofficial&' - let params = [] - data.forEach((v, i) => { - if (v) { - params.push('arguments' + (i + 1) + v) - } - }); - return crypto.createHash('md5').update(str + params.join('&')).digest('hex') -} -module.exports = { - getTicket: async (axios, options) => { - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} ` - let searchParams = {} - let res = await axios.request({ - headers: { - "user-agent": useragent, - "referer": "https://m.jf.10010.com/", - "origin": "https://m.jf.10010.com" - }, - url: `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://m.jf.10010.com/jf-order/avoidLogin/forActive/tigerarmqd&duanlianjieabc=tbkyH`, - method: 'get', - transformResponse: (data, headers) => { - if ('location' in headers) { - let uu = new URL(headers.location) - let pp = {} - for (let p of uu.searchParams) { - pp[p[0]] = p[1] - } - if ('ticket' in pp) { - searchParams = pp - } - } - return data - } - }).catch(err => console.log(err)) - return { - searchParams, - jar: res.config.jar - } - }, - timesDraw: async (axios, options) => { - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} ` - let { searchParams, jar } = await module.exports.getTicket(axios, options) - let cookiesJson = jar.toJSON() - let jfid = cookiesJson.cookies.find(i => i.key == '_jf_id') - if (!jfid) { - throw new Error('jfid缺失') - } - jfid = jfid.value - - let keyArr = secretkeyArray() - let keyrdm = Math.floor(Math.random() * 5) - +const useragent = require("./handlers/myPhone").useragent; +let jflottery; +module.exports = jflottery = { + getOpenPlatLine: gameEvents.getOpenPlatLine( + `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://m.jf.10010.com/jf-order/avoidLogin/forActive/tigerarmqd&duanlianjieabc=tbkyH` + ), + postFreeLoginRock: gameEvents.postFreeLoginRock( + referer, + "Ac-de644531df54410e875ba08ca2256b6a" + ), + doTask: async (axios, options) => { + console.log("🔔 开始666积分\n"); + let cookies = await jflottery.getOpenPlatLine(axios, options); + let data = await jflottery.postFreeLoginRock(axios, options, cookies); + await jflottery.postTimesDraw(axios, options, cookies, data); + }, + postTimesDraw: async ( + axios, + options, + // eslint-disable-next-line no-unused-vars + { jfid, searchParams, jar1 }, + { activity, Authorization, freeTimes, advertTimes } + ) => { + do { + console.log( + "已消耗机会", + 1 + 4 - (freeTimes + advertTimes), + "剩余免费机会", + freeTimes, + "看视频广告机会", + advertTimes + ); + + if (!freeTimes && !advertTimes) { + console.log("没有游戏次数"); + break; + } + // let currentTimes = 1 + 4 - (freeTimes + advertTimes) + 1; + + let p1 = { + activityId: activity.activityId, + currentTimes: freeTimes, + type: "积分", + }; + + if (!freeTimes && advertTimes) { let params = { - activityId: "Ac-de644531df54410e875ba08ca2256b6a", - userCookie: jfid, - userNumber: searchParams.userNumber, - time: new Date().getTime() + arguments1: "AC20200611152252", + arguments2: "GGPD", + arguments3: "", + arguments4: new Date().getTime(), + arguments6: "517050707", + arguments7: "517050707", + arguments8: "123456", + arguments9: "", + netWay: "Wifi", + remark1: "到小游戏豪礼派送", + remark: "签到小游戏翻倍得积分", + version: `android@8.0102`, + codeId: 945705532, }; - - let reqdata = JSON.stringify({ - params: encrypt(JSON.stringify(params), keyArr[keyrdm]) + keyrdm, - parKey: keyArr + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + params["orderId"] = crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"); + params["arguments4"] = new Date().getTime(); + + await require("./taskcallback").reward(axios, { + ...options, + params, + jar: jar1, + }); + + let timestamp = moment().format("YYYYMMDDHHmmss"); + await axios.request({ + headers: { + "user-agent": useragent(options), + referer: `https://img.client.10010.com/`, + }, + url: `https://m.jf.10010.com/jf-order/avoidLogin/forActive/tigerarmqd?ticket=${searchParams.ticket}&type=02&version=android@8.0102×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&duanlianjieabc=tbLlf&userNumber=${options.user}`, + method: "GET", + }); + + p1 = { + activityId: activity.activityId, + currentTimes: advertTimes, + type: "广告", + orderId: params["orderId"], + phoneType: "android", + version: "8.0102", + }; + advertTimes--; + } else { + freeTimes--; + } + + //join the game + let params = gameEvents.encodeParams(p1, true); + let res = await axios + .request({ + baseURL: "https://m.jf.10010.com/", + headers: { + Authorization: `Bearer ${Authorization}`, + "user-agent": useragent(options), + referer: "https://m.jf.10010.com", + origin: "https://m.jf.10010.com", + "Content-Type": "application/json;charset=UTF-8", + }, + url: `/jf-yuech/api/gameResultV2/timesDrawForPrize`, + method: "post", + data: params, }) - - let res = await axios.request({ - baseURL: 'https://m.jf.10010.com/', - headers: { - "user-agent": useragent, - "referer": "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/tigerarm/index.html?jump=sign", - "origin": "https://img.jf.10010.com", - "Content-Type": "application/json" - }, - jar, - url: `/jf-yuech/p/freeLoginRock`, - method: 'post', - data: reqdata - }).catch(err => console.log(err)) - let result = res.data - if (result.code !== 0) { - throw new Error(result.message) - } - let jar1 = res.config.jar - - let activity = result.data.activityInfos.activityVOs[0] - let Authorization = result.data.token.access_token - let freeTimes = activity.activityTimesInfo.freeTimes - let advertTimes = activity.activityTimesInfo.advertTimes - - do { - console.log("已消耗机会", (1 + 4) - (freeTimes + advertTimes), "剩余免费机会", freeTimes, '看视频广告机会', advertTimes) - - if (!freeTimes && !advertTimes) { - console.log('没有游戏次数') - break - } - let currentTimes = (1 + 4) - (freeTimes + advertTimes) + 1 - - let p1 = { - activityId: activity.activityId, - currentTimes: freeTimes, - type: "积分" - } - - if (!freeTimes && advertTimes) { - let params = { - 'arguments1': 'AC20200611152252', - 'arguments2': '', - 'arguments3': '', - 'arguments4': new Date().getTime(), - 'arguments6': '', - 'arguments7': '', - 'arguments8': '', - 'arguments9': '', - 'netWay': 'Wifi', - 'remark1': '到小游戏豪礼派送', - 'remark': '签到小游戏翻倍得积分', - 'version': `android@8.0100`, - 'codeId': 945705532 - } - params['sign'] = sign([params.arguments1, params.arguments2, params.arguments3, params.arguments4]) - params['orderId'] = crypto.createHash('md5').update(new Date().getTime() + '').digest('hex') - params['arguments4'] = new Date().getTime() - - result = await require('./taskcallback').reward(axios, { - ...options, - params, - jar: jar1 - }) - - p1 = { - 'activityId': activity.activityId, - 'currentTimes': advertTimes, - 'type': '广告', - 'orderId': params['orderId'], - 'phoneType': 'android', - 'version': '8.01' - } - advertTimes-- + .catch((err) => console.log(err)); + let result = res.data; + if (result.code !== 0) { + console.log("豪礼大派送抽奖:", result.message); + } else { + if (result.data.consumptionV1Infos.code !== "0") { + console.log("豪礼大派送抽奖:", result.data.consumptionV1Infos.result); + } else { + if ( + result.data.consumptionV1Infos.gameResult.prizeStatus === "中奖" + ) { + if (result.data.consumptionV1Infos.gameResult.integralScore) { + console.log( + "🔔 豪礼大派送抽奖:", + "中奖+", + result.data.consumptionV1Infos.gameResult.integralScore + ); } else { - freeTimes-- - } - - let n = Math.floor(5 * Math.random()) - let i = secretkeyArray() - - params = { - "params": encrypt(JSON.stringify(p1), i[n]) + n, - "parKey": i - } - res = await axios.request({ - baseURL: 'https://m.jf.10010.com/', - headers: { - "Authorization": `Bearer ${Authorization}`, - "user-agent": useragent, - "referer": "https://img.jf.10010.com/", - "origin": "https://img.jf.10010.com" - }, - url: `/jf-yuech/api/gameResultV2/timesDraw`, - method: 'post', - data: params - }) - result = res.data - if (result.code !== 0) { - console.log("豪礼大派送抽奖:", result.message) - } else { - if (result.data.consumptionV1Infos.code !== '0') { - console.log("豪礼大派送抽奖:", result.data.consumptionV1Infos.result) - } else { - if (result.data.consumptionV1Infos.gameResult.prizeStatus === '中奖') { - if(result.data.consumptionV1Infos.gameResult.integralScore){ - console.log('豪礼大派送抽奖:', '中奖+', result.data.consumptionV1Infos.gameResult.integralScore) - } else { - console.log(result.data.consumptionV1Infos) - console.log('豪礼大派送抽奖:', '中奖') - } - } else { - - console.log('豪礼大派送抽奖:', result.data.consumptionV1Infos.gameResult.prizeStatus) - } - } - } - - if (freeTimes && advertTimes) { - console.log('等待15秒再继续') - await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)) + console.log(result.data.consumptionV1Infos); + console.log("🔔 豪礼大派送抽奖:", "中奖"); } + } else { + console.log( + "豪礼大派送抽奖:", + result.data.consumptionV1Infos.gameResult.prizeStatus + ); + } + if ( + result.data.drawResultPO !== null && + result.data.drawResultPO.doublingStatus + ) { + console.log("🌈 提交积分翻倍"); + await jflottery.lookVideoDouble(axios, { + ...options, + }); + await jflottery.lookVideoDoubleResult(axios, { + ...options, + Authorization, + activityId: activity.activityId, + winningRecordId: result.data.drawResultPO.winningRecordId, + }); + } + } + } + + console.log("☕ 等待15秒再继续"); + // eslint-disable-next-line no-unused-vars + await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); + } while (freeTimes || advertTimes); + }, + lookVideoDouble: async (axios, options) => { + let params = { + arguments1: "AC20200611152252", // acid + arguments2: "GGPD", // yhChannel + arguments3: "627292f1243148159c58fd58917c3e67", // yhTaskId menuId + arguments4: new Date().getTime(), + arguments6: "517050707", + arguments7: "517050707", + arguments8: "123456", + arguments9: "4640b530b3f7481bb5821c6871854ce5", + netWay: "Wifi", + remark1: "签到小游戏豪礼派送", + remark: "签到小游戏翻倍得积分", + version: `android@8.0102`, + codeId: 945689604, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + let { num, jar } = await require("./taskcallback").query(axios, { + ...options, + params, + }); - } while (freeTimes || advertTimes) + if (!num) { + console.log("签到小游戏翻牛牌: 今日已完成"); + return; } -} \ No newline at end of file + + params = { + arguments1: "AC20200611152252", // acid + arguments2: "GGPD", // yhChannel + arguments3: "627292f1243148159c58fd58917c3e67", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "517050707", + arguments7: "517050707", + arguments8: "123456", + arguments9: "4640b530b3f7481bb5821c6871854ce5", + orderId: crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"), + netWay: "Wifi", + remark: "签到看视频翻倍得积分", + version: `android@8.0102`, + codeId: 945689604, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + await require("./taskcallback").doTask(axios, { + ...options, + params, + jar, + }); + }, + lookVideoDoubleResult: gameEvents.lookVideoDoubleResult("豪礼大派送"), +}; diff --git a/commands/tasks/unicom/unicom.js b/commands/tasks/unicom/unicom.js index 30c173d7f..6146c9054 100644 --- a/commands/tasks/unicom/unicom.js +++ b/commands/tasks/unicom/unicom.js @@ -191,7 +191,7 @@ var start = async (params) => { await scheduler.regTask( "jflottery", async (request) => { - await require("./jflottery").timesDraw(request, options); + await require("./jflottery").doTask(request, options); }, taskOption ); From 40953442da0ce6edd770df31e3eb4740bb48ea09 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Wed, 10 Feb 2021 21:36:30 +0800 Subject: [PATCH 052/128] Update README.md --- README.md | 173 ------------------------------------------------------ 1 file changed, 173 deletions(-) diff --git a/README.md b/README.md index 1dad27db3..5b4bccc9e 100644 --- a/README.md +++ b/README.md @@ -1,175 +1,2 @@ -# AutoSignMachine - > Due to a third-party risk dispute, this script stopped sharing > 由于第三方风险争议,此脚本停止分享 - -**一个自动执行任务的工具,通过它可以实现账号自动签到,自动领取权益等功能,帮助我们轻松升级。** - -## bilibili签到任务 -**实现现B站帐号的每日自动观看、分享、投币视频,获取经验,每月自动领取会员权益等功能,帮助我们轻松升级会员到Lv6并赚取电池。** - -详细功能目录如下: - -* **每天自动登录,获取经验** -* **每天自动观看、分享、投币视频** -* **每天漫画自动签到** -* **每天自动直播签到,领取奖励** -* **每天自动使用直播中心银瓜子兑换B币** -* **每个月自动领取5张B币券和大会员权益** - -```sh -node index.js bilibili --cookies "b6*********4a581;" -``` - -### docker部署 -```sh -# 构建 -docker build -t auto-sign-machine:latest -f docker/Dockerfile . -# 运行 -docker run \ - --name auto-sign-machine \ - -d \ - -e enable_bilibili=true \ - -e DedeUserID=41*****1073 \ - -e SESSDATA=05*********333*b1 \ - -e bili_jct=b6*********4a581 \ - auto-sign-machine:latest -``` - -## 52pojie签到任务 -**实现现52pojie帐号的每日签到任务。** - -```sh -node index.js 52pojie --htVD_2132_auth b22d**********************aNjr --htVD_2132_saltkey Jc***********I -``` - -### docker部署 -```sh -# 构建 -docker build -t auto-sign-machine:latest -f docker/Dockerfile . -# 运行 -docker run \ - --name auto-sign-machine \ - -d \ - --label traefik.enable=false \ - -e enable_52pojie=true \ - -e htVD_2132_auth=b******************jr \ - -e htVD_2132_saltkey=Jc************I \ - auto-sign-machine:latest -``` -、 -## iqiyi签到任务 -**实现现iqiyi帐号的每日签到任务。** -详细功能目录如下: - -* **普通用户每天自动获取积分** -* **vip用户每日签到随机成长值及积分** -* **vip用户每日浏览会员俱乐部+1成长值** - -```sh -node index.js iqiyi --P00001 b********jr --P00PRU 12***24 --QC005 5f******6fe --dfp Jc************I -``` - -### docker部署 -```sh -# 构建 -docker build -t auto-sign-machine:latest -f docker/Dockerfile . -# 运行 -docker run \ - --name auto-sign-machine \ - -d \ - --label traefik.enable=false \ - -e enable_iqiyi=true \ - -e P00001=b********jr \ - -e P00PRU=12***24 \ - -e QC005=5f******6fe \ - -e dfp=Jc************I \ - auto-sign-machine:latest -``` - - -、 -## 联通APP签到任务 -**实现现联通帐号的每日签到任务。** -详细功能目录如下: - -* **每日签到积分** -* **冬奥积分活动** -* **每日定向积分** -* **每日游戏楼层宝箱** -* **每日抽奖** -* **首页-游戏-娱乐中心-沃之树** -* **首页-小说-阅读越有礼打卡赢话费** -* **首页-小说-读满10章赢好礼** -* **首页-小说-读满10章赢好礼-看视频领2积分** -* **首页-签到有礼-免流量得福利-3积分天天拿(阅读打卡)** -* **首页-小说-阅读福利抽大奖** -* **首页-签到有礼-免费领-浏览领积分** -* **首页-签到有礼-免费拿-看视频夺宝** -* **首页-签到有礼-免费抽** -* **首页-签到有礼-赚更多福利** -* **首页-游戏-娱乐中心-每日打卡** -* **每日游戏时长-天天领取3G流量包** -* **首页-积分查询-游戏任务** - -```sh -node index.js unicom --user 131*******12 --password 11****11 --appid f7af****ebb -``` - -### docker部署 -```sh -# 构建 -docker build -t auto-sign-machine:latest -f docker/Dockerfile . -# 运行(cookies和账号密码两种方式二选一) -docker run \ - --name auto-sign-machine \ - -d \ - --label traefik.enable=false \ - -e enable_unicom=true \ - -e user=131*******12 \ - -e password=11****11 \ - -e appid=f7af****ebb \ - auto-sign-machine:latest -``` - -### 注意 -#### cron中`%`号需要转义`\%` - -### 脚本运行机制 -任务并非在一次命令执行时全部执行完毕,任务创建时会根据某个时间段,将所有任务分配到该时间段内的随机的某个时间点,然后使用定时任务定时运行脚本入口,内部子任务的运行时机依赖于任务配置项的运行时间及延迟时间,这种机制意味着,只有当脚本的运行时间在当前定时任务运行时间之前,脚本子任务才有可能有选择的被调度出来运行 - -### crontab 任务示例 -在4-23小时之间每隔三十分钟尝试运行可运行的脚本子任务 -```txt -*/30 4-23 * * * /bin/node /workspace/AutoSignMachine/index.js unicom --user 1******5 --password 7****** --appid 1************9 -``` - -### 多用户配置 -启用`--accountSn`表示账户序号,例如`1,2`, 则将提取`option-sn`选项的值,例如`user-1`,`user-2` - -### 配置文件示例 -启用`--config /path/to/mycfg.json`表示配置文件 -```json -{ - "accountSn": "1,2", - "user-1": "22******1", - "password-1": "31******1", - "appid-1": "41******1", - "user-2": "25******1", - "password-3": "72******1", - "appid-2": "92******1" -} -``` - -### 运行测试 -```sh -## 立即模式, 一次性执行所有任务,仅建议测试任务是否正常时运行,该方式无法重试周期任务 -## 该模式不缓存cookie信息,频繁使用将可能导致账号安全警告 -#增加 --tryrun - -## 指定任务模式,可以指定仅需要运行的子任务,多用户使用规则参看`多用户配置` -#增加 --tasks taskName1,taskName2,taskName3 -``` - -### GitHub Actions 运行问题 -暂未处理GitHub Actions支持 \ No newline at end of file From b49df89bc6ce4f880d803c6fda66ddc63370452d Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Thu, 11 Feb 2021 13:18:08 +0800 Subject: [PATCH 053/128] =?UTF-8?q?=F0=9F=90=8D=20updated=20dailyVideoScra?= =?UTF-8?q?tchcard=20task?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/dailyTurntablePage.js | 365 ++++++++++-------- .../tasks/unicom/dailyVideoScratchcard.js | 176 ++++----- commands/tasks/unicom/ingotsPage.js | 2 +- commands/tasks/unicom/init.js | 1 + 4 files changed, 288 insertions(+), 256 deletions(-) diff --git a/commands/tasks/unicom/dailyTurntablePage.js b/commands/tasks/unicom/dailyTurntablePage.js index b27763f74..ba14194d4 100644 --- a/commands/tasks/unicom/dailyTurntablePage.js +++ b/commands/tasks/unicom/dailyTurntablePage.js @@ -1,261 +1,290 @@ -var crypto = require('crypto'); -var moment = require('moment'); +var crypto = require("crypto"); +var moment = require("moment"); // 幸运大转盘 var transParams = (data) => { let params = new URLSearchParams(); for (let item in data) { - params.append(item, data['' + item + '']); + params.append(item, data["" + item + ""]); } return params; }; function w() { - var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {} - , t = []; - return Object.keys(e).forEach((function (a) { - t.push("".concat(a, "=").concat(encodeURIComponent(e[a]))) - } - )), + var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + t = []; + return ( + Object.keys(e).forEach(function (a) { + t.push("".concat(a, "=").concat(encodeURIComponent(e[a]))); + }), t.join("&") + ); } var sign = (data) => { - let str = 'integralofficial&' - let params = [] + let str = "integralofficial&"; + let params = []; data.forEach((v, i) => { if (v) { - params.push('arguments' + (i + 1) + v) + params.push("arguments" + (i + 1) + v); } }); - return crypto.createHash('md5').update(str + params.join('&')).digest('hex') -} + return crypto + .createHash("md5") + .update(str + params.join("&")) + .digest("hex"); +}; function encryption(data, key) { var iv = ""; - var cipherEncoding = 'base64'; - var cipher = crypto.createCipheriv('aes-128-ecb', key, iv); + var cipherEncoding = "base64"; + var cipher = crypto.createCipheriv("aes-128-ecb", key, iv); cipher.setAutoPadding(true); - return Buffer.concat([cipher.update(data), cipher.final()]).toString(cipherEncoding); + return Buffer.concat([cipher.update(data), cipher.final()]).toString( + cipherEncoding + ); } var dailyTurntablePage = { getGoodsList: async (axios, options) => { - let phone = encryption(options.user, 'gb6YCccUvth75Tm2') - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} ` + let phone = encryption(options.user, "gb6YCccUvth75Tm2"); + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} `; let result = await axios.request({ headers: { "user-agent": useragent, - "referer": `https://wxapp.msmds.cn/`, - "origin": "https://wxapp.msmds.cn" + referer: `https://wxapp.msmds.cn/`, + origin: "https://wxapp.msmds.cn", }, url: `https://wxapp.msmds.cn/jplus/api/change/luck/draw/gift/v1/list`, - method: 'POST', + method: "POST", data: transParams({ - 'channelId': 'LT_channel', - 'phone': phone, - 'token': options.ecs_token, - 'sourceCode': 'lt_turntable' - }) - }) - return result.data.data + channelId: "LT_channel", + phone: phone, + token: options.ecs_token, + sourceCode: "lt_turntable", + }), + }); + return result.data.data; }, doTask: async (axios, options) => { - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}` - let searchParams = {} - let result = await axios.request({ - baseURL: 'https://m.client.10010.com/', - headers: { - "user-agent": useragent, - "referer": `https://img.client.10010.com/`, - "origin": "https://img.client.10010.com" - }, - url: `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://wxapp.msmds.cn/h5/react_web/unicom/turntablePage`, - method: 'GET', - transformResponse: (data, headers) => { - if ('location' in headers) { - let uu = new URL(headers.location) - let pp = {} - for (let p of uu.searchParams) { - pp[p[0]] = p[1] - } - if ('ticket' in pp) { - searchParams = pp + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; + let searchParams = {}; + let result = await axios + .request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": useragent, + referer: `https://img.client.10010.com/`, + origin: "https://img.client.10010.com", + }, + url: `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://wxapp.msmds.cn/h5/react_web/unicom/turntablePage`, + method: "GET", + transformResponse: (data, headers) => { + if ("location" in headers) { + let uu = new URL(headers.location); + let pp = {}; + for (let p of uu.searchParams) { + pp[p[0]] = p[1]; + } + if ("ticket" in pp) { + searchParams = pp; + } } - } - return data - } - }).catch(err => console.log(err)) - let jar1 = result.config.jar + return data; + }, + }) + .catch((err) => console.log(err)); + let jar1 = result.config.jar; - let cookiesJson = jar1.toJSON() - let ecs_token = cookiesJson.cookies.find(i => i.key == 'ecs_token') - ecs_token = ecs_token.value + let cookiesJson = jar1.toJSON(); + let ecs_token = cookiesJson.cookies.find((i) => i.key == "ecs_token"); + ecs_token = ecs_token.value; if (!ecs_token) { - throw new Error('ecs_token缺失') + throw new Error("ecs_token缺失"); } - let phone = encryption(options.user, 'gb6YCccUvth75Tm2') - let playCounts = 0 - let isLookVideo = false + let phone = encryption(options.user, "gb6YCccUvth75Tm2"); + let playCounts = 0; + let isLookVideo = false; do { let res = await dailyTurntablePage.getGoodsList(axios, { ...options, ecs_token, - phone - }) + phone, + }); - - playCounts = res.playCounts - isLookVideo = res.isLookVideo + playCounts = res.playCounts; + isLookVideo = res.isLookVideo; if (!playCounts && !isLookVideo) { - console.log('没有游戏次数') - break + console.log("没有游戏次数"); + break; } if (!playCounts && isLookVideo) { - let params = { - 'arguments1': '', - 'arguments2': '', - 'arguments3': '', - 'arguments4': new Date().getTime(), - 'arguments6': '', - 'arguments7': '', - 'arguments8': '', - 'arguments9': '', - 'netWay': 'Wifi', - 'remark': '签到小游戏买什么都省转盘抽奖', - 'version': `android@8.0100`, - 'codeId': 945535695 - } - params['sign'] = sign([params.arguments1, params.arguments2, params.arguments3, params.arguments4]) - params['orderId'] = crypto.createHash('md5').update(new Date().getTime() + '').digest('hex') - params['arguments4'] = new Date().getTime() + arguments1: "", + arguments2: "", + arguments3: "", + arguments4: new Date().getTime(), + arguments6: "", + arguments7: "", + arguments8: "", + arguments9: "", + netWay: "Wifi", + remark: "签到小游戏买什么都省转盘抽奖", + version: `android@8.0100`, + codeId: 945535695, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + params["orderId"] = crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"); + params["arguments4"] = new Date().getTime(); - result = await require('./taskcallback').reward(axios, { + result = await require("./taskcallback").reward(axios, { ...options, params, - jar: jar1 - }) + jar: jar1, + }); let a = { - 'channelId': 'LT_channel', - "phone": phone, - 'token': ecs_token, - 'videoOrderNo': params['orderId'], - 'sourceCode': 'lt_turntable' - } + channelId: "LT_channel", + phone: phone, + token: ecs_token, + videoOrderNo: params["orderId"], + sourceCode: "lt_turntable", + }; - let timestamp = moment().format('YYYYMMDDHHmmss') + let timestamp = moment().format("YYYYMMDDHHmmss"); result = await axios.request({ headers: { "user-agent": useragent, - "referer": `https://wxapp.msmds.cn/h5/react_web/unicom/turntablePage?ticket=${searchParams.ticket}&type=02&version=android@8.0100×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&userNumber=${options.user}`, - "origin": "https://wxapp.msmds.cn" + referer: `https://wxapp.msmds.cn/h5/react_web/unicom/turntablePage?ticket=${searchParams.ticket}&type=02&version=android@8.0100×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&userNumber=${options.user}`, + origin: "https://wxapp.msmds.cn", }, url: `https://wxapp.msmds.cn/jplus/api/change/luck/draw/gift/v1/liantong/look/video`, - method: 'POST', - data: transParams(a) - }) + method: "POST", + data: transParams(a), + }); if (result.data.code !== 200) { - console.log('提交任务失败', result.data.msg) + console.log("提交任务失败", result.data.msg); } else { - console.log('提交任务成功', `${result.data.data}`) + console.log("提交任务成功", `${result.data.data}`); } } let a = { - 'channelId': 'LT_channel', - 'code': '', - 'flag': '', - "phone": phone, - 'token': ecs_token, - 'taskId': '', - 'sourceCode': 'lt_turntable' - } + channelId: "LT_channel", + code: "", + flag: "", + phone: phone, + token: ecs_token, + taskId: "", + sourceCode: "lt_turntable", + }; - let timestamp = moment().format('YYYYMMDDHHmmss') + let timestamp = moment().format("YYYYMMDDHHmmss"); result = await axios.request({ headers: { "user-agent": useragent, - "referer": `https://wxapp.msmds.cn/h5/react_web/unicom/turntablePage?ticket=${searchParams.ticket}&type=02&version=android@8.0100×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&userNumber=${options.user}`, - "origin": "https://wxapp.msmds.cn" + referer: `https://wxapp.msmds.cn/h5/react_web/unicom/turntablePage?ticket=${searchParams.ticket}&type=02&version=android@8.0100×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&userNumber=${options.user}`, + origin: "https://wxapp.msmds.cn", }, - url: `https://wxapp.msmds.cn/jplus/api/change/luck/draw/gift/v1/playLuckDraw?` + w(a), - method: 'POST' - }) + url: + `https://wxapp.msmds.cn/jplus/api/change/luck/draw/gift/v1/playLuckDraw?` + + w(a), + method: "POST", + }); if (result.data.code !== 200) { - console.log('提交任务失败', result.data.msg) + console.log("提交任务失败", result.data.msg); } else { - let good = result.data.data.list.find(f => f.giftId === result.data.data.giftId) - console.log('提交任务成功,获得', good.giftName) + let good = result.data.data.list.find( + (f) => f.giftId === result.data.data.giftId + ); + console.log("提交任务成功,获得", good.giftName); if (result.data.data.lookVideoDouble) { - console.log('提交积分翻倍') + console.log("提交积分翻倍"); await dailyTurntablePage.lookVideoDouble(axios, { ...options, - jar: result.config.jar - }) + jar: result.config.jar, + }); } } - console.log('等待25秒再继续') - await new Promise((resolve, reject) => setTimeout(resolve, 25 * 1000)) - - } while (playCounts || isLookVideo) + console.log("等待25秒再继续"); + await new Promise((resolve, reject) => setTimeout(resolve, 25 * 1000)); + } while (playCounts || isLookVideo); }, lookVideoDouble: async (axios, options) => { - const { jar } = options + const { jar } = options; let params = { - 'arguments1': 'AC20200716103629', // acid - 'arguments2': 'GGPD', // yhChannel - 'arguments3': 'fc32b68892de4299b6ccfb2de72e1ab8', // yhTaskId menuId - 'arguments4': new Date().getTime(), // time - 'arguments6': '517050707', - 'netWay': 'Wifi', - 'version': `android@8.0100` - } - params['sign'] = sign([params.arguments1, params.arguments2, params.arguments3, params.arguments4]) - let { num } = await require('./taskcallback').query(axios, { + arguments1: "AC20200716103629", // acid + arguments2: "GGPD", // yhChannel + arguments3: "fc32b68892de4299b6ccfb2de72e1ab8", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "517050707", + netWay: "Wifi", + version: `android@8.0100`, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + let { num } = await require("./taskcallback").query(axios, { ...options, - params - }) + params, + }); if (!num) { - console.log('签到小游戏买什么都省转盘抽奖: 今日已完成') - return + console.log("签到小游戏买什么都省转盘抽奖: 今日已完成"); + return; } do { - console.log('第', num, '次') + console.log("第", num, "次"); let params = { - 'arguments1': 'AC20200716103629', // acid - 'arguments2': 'GGPD', // yhChannel - 'arguments3': 'fc32b68892de4299b6ccfb2de72e1ab8', // yhTaskId menuId - 'arguments4': new Date().getTime(), // time - 'arguments6': '', - 'arguments7': '', - 'arguments8': '', - 'arguments9': '', - 'orderId': crypto.createHash('md5').update(new Date().getTime() + '').digest('hex'), - 'netWay': 'Wifi', - 'remark': '签到小游戏买什么都省转盘抽奖', - 'version': `android@8.0100`, - 'codeId': 945535695 - } - params['sign'] = sign([params.arguments1, params.arguments2, params.arguments3, params.arguments4]) - await require('./taskcallback').doTask(axios, { + arguments1: "AC20200716103629", // acid + arguments2: "GGPD", // yhChannel + arguments3: "fc32b68892de4299b6ccfb2de72e1ab8", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "", + arguments7: "", + arguments8: "", + arguments9: "", + orderId: crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"), + netWay: "Wifi", + remark: "签到小游戏买什么都省转盘抽奖", + version: `android@8.0100`, + codeId: 945535695, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + await require("./taskcallback").doTask(axios, { ...options, params, - jar - }) - + jar, + }); + if (num) { - console.log('等待15秒再继续') - await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)) + console.log("等待15秒再继续"); + await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); } + } while (--num); + }, +}; - } while (--num) - } -} - -module.exports = dailyTurntablePage \ No newline at end of file +module.exports = dailyTurntablePage; diff --git a/commands/tasks/unicom/dailyVideoScratchcard.js b/commands/tasks/unicom/dailyVideoScratchcard.js index cbfd8f356..d734fb55f 100644 --- a/commands/tasks/unicom/dailyVideoScratchcard.js +++ b/commands/tasks/unicom/dailyVideoScratchcard.js @@ -1,5 +1,7 @@ var crypto = require("crypto"); - +let AES = require("./handlers/PAES.js"); +const useragent = require("./handlers/myPhone").useragent; +const gameEvents = require("./handlers/dailyEvent"); // 疯狂刮刮乐 var transParams = (data) => { let params = new URLSearchParams(); @@ -45,10 +47,9 @@ function encryption(data, key) { var dailyVideoScratchcard = { getGoodsList: async (axios, options) => { let phone = encryption(options.user, "gb6YCccUvth75Tm2"); - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} `; let result = await axios.request({ headers: { - "user-agent": useragent, + "user-agent": useragent(options), referer: `https://wxapp.msmds.cn/`, origin: "https://wxapp.msmds.cn", }, @@ -63,47 +64,17 @@ var dailyVideoScratchcard = { }); return result.data.data.allCards.filter((c) => !c.status); }, + getOpenPlatLine: gameEvents.getOpenPlatLine( + `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://wxapp.msmds.cn/h5/react_web/unicom/scratchcardPage?source=unicom&duanlianjieabc=tbkR2`, + { base: "msmds" } + ), doTask: async (axios, options) => { console.log("🤔 刮刮卡游玩开始..."); - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; - let searchParams = {}; - let result = await axios - .request({ - baseURL: "https://m.client.10010.com/", - headers: { - "user-agent": useragent, - referer: `https://img.client.10010.com/`, - origin: "https://img.client.10010.com", - }, - url: `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://wxapp.msmds.cn/h5/react_web/unicom/scratchcardPage?source=unicom&duanlianjieabc=tbkR2`, - method: "get", - transformResponse: (data, headers) => { - if ("location" in headers) { - let uu = new URL(headers.location); - let pp = {}; - for (let p of uu.searchParams) { - pp[p[0]] = p[1]; - } - if ("ticket" in pp) { - searchParams = pp; - } - } - return data; - }, - }) - .catch((err) => console.log(err)); - - let jar1 = result.config.jar; - - let cookiesJson = jar1.toJSON(); - let ecs_token = cookiesJson.cookies.find((i) => i.key == "ecs_token"); - if (!ecs_token) { - throw new Error("ecs_token缺失"); - } - ecs_token = ecs_token.value; - + let { ecs_token, jar1 } = await dailyVideoScratchcard.getOpenPlatLine( + axios, + options + ); let phone = encryption(options.user, "gb6YCccUvth75Tm2"); - let goods = await dailyVideoScratchcard.getGoodsList(axios, { ...options, ecs_token, @@ -111,18 +82,18 @@ var dailyVideoScratchcard = { }); let params = { - arguments1: "", - arguments2: "", - arguments3: "", + arguments1: "AC20200716103629", + arguments2: "GGPD", + arguments3: "79b0275d6a5742ce96af76a663cde0ab", arguments4: new Date().getTime(), - arguments6: "", - arguments7: "", - arguments8: "", - arguments9: "", + arguments6: "517050707", + arguments7: "517050707", + arguments8: "123456", + arguments9: "4640b530b3f7481bb5821c6871854ce5", netWay: "Wifi", remark: "签到小游戏幸运刮刮卡", - version: `android@8.0100`, - codeId: 945597731, + version: `android@8.0102`, + codeId: 945597742, }; params["sign"] = sign([ params.arguments1, @@ -133,14 +104,14 @@ var dailyVideoScratchcard = { if (goods.length) { for (let good of goods) { - console.log("开始处理", good.name); + console.log("开始处理: ", good.name); params["orderId"] = crypto .createHash("md5") .update(new Date().getTime() + "") .digest("hex"); params["arguments4"] = new Date().getTime(); - result = await require("./taskcallback").reward(axios, { + let result = await require("./taskcallback").reward(axios, { ...options, params, jar: jar1, @@ -154,7 +125,7 @@ var dailyVideoScratchcard = { }; result = await axios.request({ headers: { - "user-agent": useragent, + "user-agent": useragent(options), referer: `https://wxapp.msmds.cn/h5/react_web/unicom/scratchcardItemPage`, origin: "https://wxapp.msmds.cn", }, @@ -170,8 +141,31 @@ var dailyVideoScratchcard = { "提交任务成功", `+${result.data.data.prizeType ? result.data.data.integral : 0}` ); + let a = { + channelId: "LT_channel", + phone: phone, + token: ecs_token, + id: good.id, + sourceCode: "lt_scratchcard", + }; + console.log("测试 视频翻倍"); + result = await axios.request({ + headers: { + "user-agent": useragent(options), + referer: `https://wxapp.msmds.cn/h5/react_web/unicom/scratchcardItemPage`, + origin: "https://wxapp.msmds.cn", + }, + url: `https://wxapp.msmds.cn/jplus/h5/channelScratchCard/lookVideoDouble`, + method: "POST", + data: w(a), + }); + + await dailyVideoScratchcard.lookVideoDouble(axios, { + ...options, + }); } console.log("等待15秒再继续"); + // eslint-disable-next-line no-unused-vars await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); } } else { @@ -180,16 +174,16 @@ var dailyVideoScratchcard = { }, lookVideoDouble: async (axios, options) => { let params = { - arguments1: "AC20200611152252", + arguments1: "AC20200716103629", arguments2: "GGPD", - arguments3: "4640b530b3f7481bb5821c6871854ce5", + arguments3: "79b0275d6a5742ce96af76a663cde0ab", arguments4: new Date().getTime(), arguments6: "517050707", arguments7: "517050707", arguments8: "123456", arguments9: "4640b530b3f7481bb5821c6871854ce5", netWay: "Wifi", - remark1: "签到翻牛牌活动", + remark1: "签到小游戏幸运刮刮卡", remark: "签到看视频翻倍得积分", version: `android@8.0102`, codeId: 945689604, @@ -206,41 +200,49 @@ var dailyVideoScratchcard = { }); if (!num) { - console.log("签到小游戏翻牛牌: 今日已完成"); + console.log("签到小游戏幸运刮刮卡: 今日已完成"); return; } - params = { - arguments1: "AC20200611152252", // acid - arguments2: "GGPD", // yhChannel - arguments3: "627292f1243148159c58fd58917c3e67", // yhTaskId menuId - arguments4: new Date().getTime(), // time - arguments6: "", - arguments7: "", - arguments8: "", - arguments9: "", - orderId: crypto - .createHash("md5") - .update(new Date().getTime() + "") - .digest("hex"), - netWay: "Wifi", - remark: "签到小游戏翻牛牌", - version: `android@8.0100`, - codeId: 945689604, - }; - params["sign"] = AES.sign([ - params.arguments1, - params.arguments2, - params.arguments3, - params.arguments4, - ]); - await require("./taskcallback").doTask(axios, { - ...options, - params, - jar, - }); + do { + console.log("🎞 看视频第", num, "次"); + params = { + arguments1: "AC20200716103629", // acid + arguments2: "GGPD", // yhChannel + arguments3: "79b0275d6a5742ce96af76a663cde0ab", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "517050707", + arguments7: "517050707", + arguments8: "123456", + arguments9: "4640b530b3f7481bb5821c6871854ce5", + orderId: crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"), + netWay: "Wifi", + remark: "签到小游戏翻倍得积分", + version: `android@8.0102`, + codeId: 945689604, + }; + params["sign"] = AES.sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + await require("./taskcallback").doTask(axios, { + ...options, + params, + jar, + }); + if (num) { + console.log("等待15秒再继续"); + // eslint-disable-next-line no-unused-vars + await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); + } + } while (--num); }, - lookVideoDoubleResult: gameEvents.lookVideoDoubleResult("翻牛牌送好礼"), + lookVideoDoubleResult: gameEvents.lookVideoDoubleResult("幸运刮刮卡"), }; module.exports = dailyVideoScratchcard; diff --git a/commands/tasks/unicom/ingotsPage.js b/commands/tasks/unicom/ingotsPage.js index 4adcdc19b..46263fd6f 100644 --- a/commands/tasks/unicom/ingotsPage.js +++ b/commands/tasks/unicom/ingotsPage.js @@ -156,7 +156,7 @@ let ingotsPage = { channelId: "LT_channel", phone: phone, token: ecs_token, - videoOrderNo: "83C87F22F5C687BAA914B07ECC5174F1", + videoOrderNo: params["orderId"], sourceCode: "lt_ingots", }; diff --git a/commands/tasks/unicom/init.js b/commands/tasks/unicom/init.js index bf4ab1bfc..ca9b4f375 100644 --- a/commands/tasks/unicom/init.js +++ b/commands/tasks/unicom/init.js @@ -34,6 +34,7 @@ var transParams = (data) => { return params; }; +// prettier-ignore var chars = ["1", "2", "3", "4", "5", "6", "7", "8", "9","0","a","b","c","d","e","f"]; function generateMixed(n) { let res = ""; From 5e1ab7c0af6ae7eddca518aa05c9e041a689b620 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Thu, 11 Feb 2021 13:28:46 +0800 Subject: [PATCH 054/128] =?UTF-8?q?=E2=9C=94=20updated=20event=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tasks/unicom/dailyVideoScratchcard.js | 80 ++++++------------- commands/tasks/unicom/handlers/dailyEvent.js | 42 +++++++++- 2 files changed, 64 insertions(+), 58 deletions(-) diff --git a/commands/tasks/unicom/dailyVideoScratchcard.js b/commands/tasks/unicom/dailyVideoScratchcard.js index d734fb55f..286a75d83 100644 --- a/commands/tasks/unicom/dailyVideoScratchcard.js +++ b/commands/tasks/unicom/dailyVideoScratchcard.js @@ -172,8 +172,8 @@ var dailyVideoScratchcard = { console.log("暂无可刮得商品"); } }, - lookVideoDouble: async (axios, options) => { - let params = { + lookVideoDouble: gameEvents.lookVideoDouble( + { arguments1: "AC20200716103629", arguments2: "GGPD", arguments3: "79b0275d6a5742ce96af76a663cde0ab", @@ -187,61 +187,27 @@ var dailyVideoScratchcard = { remark: "签到看视频翻倍得积分", version: `android@8.0102`, codeId: 945689604, - }; - params["sign"] = AES.sign([ - params.arguments1, - params.arguments2, - params.arguments3, - params.arguments4, - ]); - let { num, jar } = await require("./taskcallback").query(axios, { - ...options, - params, - }); - - if (!num) { - console.log("签到小游戏幸运刮刮卡: 今日已完成"); - return; - } - - do { - console.log("🎞 看视频第", num, "次"); - params = { - arguments1: "AC20200716103629", // acid - arguments2: "GGPD", // yhChannel - arguments3: "79b0275d6a5742ce96af76a663cde0ab", // yhTaskId menuId - arguments4: new Date().getTime(), // time - arguments6: "517050707", - arguments7: "517050707", - arguments8: "123456", - arguments9: "4640b530b3f7481bb5821c6871854ce5", - orderId: crypto - .createHash("md5") - .update(new Date().getTime() + "") - .digest("hex"), - netWay: "Wifi", - remark: "签到小游戏翻倍得积分", - version: `android@8.0102`, - codeId: 945689604, - }; - params["sign"] = AES.sign([ - params.arguments1, - params.arguments2, - params.arguments3, - params.arguments4, - ]); - await require("./taskcallback").doTask(axios, { - ...options, - params, - jar, - }); - if (num) { - console.log("等待15秒再继续"); - // eslint-disable-next-line no-unused-vars - await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); - } - } while (--num); - }, + }, + { + arguments1: "AC20200716103629", // acid + arguments2: "GGPD", // yhChannel + arguments3: "79b0275d6a5742ce96af76a663cde0ab", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "517050707", + arguments7: "517050707", + arguments8: "123456", + arguments9: "4640b530b3f7481bb5821c6871854ce5", + orderId: crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"), + netWay: "Wifi", + remark: "签到小游戏翻倍得积分", + version: `android@8.0102`, + codeId: 945689604, + }, + "幸运刮刮卡" + ), lookVideoDoubleResult: gameEvents.lookVideoDoubleResult("幸运刮刮卡"), }; diff --git a/commands/tasks/unicom/handlers/dailyEvent.js b/commands/tasks/unicom/handlers/dailyEvent.js index e6ffd7065..48b4f1f74 100644 --- a/commands/tasks/unicom/handlers/dailyEvent.js +++ b/commands/tasks/unicom/handlers/dailyEvent.js @@ -1,6 +1,6 @@ const useragent = require("./myPhone").useragent; let AES = require("./PAES"); - +let crypto = require("crypto"); /** * @param {String} url request url absolute path */ @@ -163,6 +163,45 @@ let lookVideoDoubleResult = (title) => { } }; }; +let lookVideoDouble = (params1, params2, title) => { + return async (axios, options) => { + params1["sign"] = AES.sign([ + params1.arguments1, + params1.arguments2, + params1.arguments3, + params1.arguments4, + ]); + let { num, jar } = await require("./taskcallback").query(axios, { + ...options, + params1, + }); + + if (!num) { + console.log(`签到小游戏${title}: 今日已完成`); + return; + } + + do { + console.log("🎞 看视频第", num, "次"); + params2["sign"] = AES.sign([ + params2.arguments1, + params2.arguments2, + params2.arguments3, + params2.arguments4, + ]); + await require("./taskcallback").doTask(axios, { + ...options, + params2, + jar, + }); + if (num) { + console.log("等待15秒再继续"); + // eslint-disable-next-line no-unused-vars + await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); + } + } while (--num); + }; +}; /** * @@ -192,4 +231,5 @@ module.exports = { postFreeLogin, lookVideoDoubleResult, encodeParams, + lookVideoDouble, }; From c1594e5c4f4a38f5d0eba433dd886c00717458e1 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Thu, 11 Feb 2021 15:14:39 +0800 Subject: [PATCH 055/128] fixed bugs --- .../tasks/unicom/{bcow.js => dailyBcow.js} | 0 ...reeSquirrels.js => dailyThreeSquirrels.js} | 0 .../tasks/unicom/dailyVideoScratchcard.js | 1 - commands/tasks/unicom/handlers/dailyEvent.js | 10 +- commands/tasks/unicom/ingotsPage.js | 127 ++++++------------ commands/tasks/unicom/unicom.js | 4 +- 6 files changed, 45 insertions(+), 97 deletions(-) rename commands/tasks/unicom/{bcow.js => dailyBcow.js} (100%) rename commands/tasks/unicom/{threeSquirrels.js => dailyThreeSquirrels.js} (100%) diff --git a/commands/tasks/unicom/bcow.js b/commands/tasks/unicom/dailyBcow.js similarity index 100% rename from commands/tasks/unicom/bcow.js rename to commands/tasks/unicom/dailyBcow.js diff --git a/commands/tasks/unicom/threeSquirrels.js b/commands/tasks/unicom/dailyThreeSquirrels.js similarity index 100% rename from commands/tasks/unicom/threeSquirrels.js rename to commands/tasks/unicom/dailyThreeSquirrels.js diff --git a/commands/tasks/unicom/dailyVideoScratchcard.js b/commands/tasks/unicom/dailyVideoScratchcard.js index 286a75d83..3b99929cf 100644 --- a/commands/tasks/unicom/dailyVideoScratchcard.js +++ b/commands/tasks/unicom/dailyVideoScratchcard.js @@ -1,5 +1,4 @@ var crypto = require("crypto"); -let AES = require("./handlers/PAES.js"); const useragent = require("./handlers/myPhone").useragent; const gameEvents = require("./handlers/dailyEvent"); // 疯狂刮刮乐 diff --git a/commands/tasks/unicom/handlers/dailyEvent.js b/commands/tasks/unicom/handlers/dailyEvent.js index 48b4f1f74..3224f0253 100644 --- a/commands/tasks/unicom/handlers/dailyEvent.js +++ b/commands/tasks/unicom/handlers/dailyEvent.js @@ -1,6 +1,5 @@ const useragent = require("./myPhone").useragent; let AES = require("./PAES"); -let crypto = require("crypto"); /** * @param {String} url request url absolute path */ @@ -164,6 +163,7 @@ let lookVideoDoubleResult = (title) => { }; }; let lookVideoDouble = (params1, params2, title) => { + console.log(`😒 ${title}游玩开始翻倍`); return async (axios, options) => { params1["sign"] = AES.sign([ params1.arguments1, @@ -171,9 +171,9 @@ let lookVideoDouble = (params1, params2, title) => { params1.arguments3, params1.arguments4, ]); - let { num, jar } = await require("./taskcallback").query(axios, { + let { num, jar } = await require("../taskcallback").query(axios, { ...options, - params1, + params: params1, }); if (!num) { @@ -189,9 +189,9 @@ let lookVideoDouble = (params1, params2, title) => { params2.arguments3, params2.arguments4, ]); - await require("./taskcallback").doTask(axios, { + await require("../taskcallback").doTask(axios, { ...options, - params2, + params: params2, jar, }); if (num) { diff --git a/commands/tasks/unicom/ingotsPage.js b/commands/tasks/unicom/ingotsPage.js index 46263fd6f..6bd9c4a3c 100644 --- a/commands/tasks/unicom/ingotsPage.js +++ b/commands/tasks/unicom/ingotsPage.js @@ -1,7 +1,7 @@ let crypto = require("crypto"); let moment = require("moment"); let { encryptPhone, sign, encrypt } = require("./handlers/PAES.js"); -const { useragent, randomNumber, getCodeId } = require("./handlers/myPhone"); +const { useragent, randomNumber } = require("./handlers/myPhone"); const gameEvents = require("./handlers/dailyEvent"); let { transParams } = require("./handlers/gameUtils"); let ingotsPage = { @@ -132,7 +132,7 @@ let ingotsPage = { remark1: "签到看视频得积分2", remark: "签到看视频得积分2", version: `android@8.0102`, - codeId: getCodeId(UA), + codeId: 945597742, }; params["sign"] = sign([ params.arguments1, @@ -146,22 +146,22 @@ let ingotsPage = { .digest("hex"); params["arguments4"] = new Date().getTime(); - await require("./taskcallback").reward(axios, { + let result = await require("./taskcallback").reward(axios, { ...options, params, jar: jar1, }); - + console.log(result); let a = { channelId: "LT_channel", phone: phone, token: ecs_token, - videoOrderNo: params["orderId"], + videoOrderNo: result["orderId"], sourceCode: "lt_ingots", }; let timestamp = moment().format("YYYYMMDDHHmmss"); - let result = await axios.request({ + result = await axios.request({ headers: { "user-agent": UA, referer: `https://wxapp.msmds.cn/h5/react_web/unicom/ingotsPage?source=unicom&type=06&ticket=${searchParams.ticket}&version=android@8.0102×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&duanlianjieabc=tbLm0&userNumber=${options.user}`, @@ -223,42 +223,23 @@ let ingotsPage = { } while (freeTimes || advertTimes); return data; }, - postGameDouble: async (axios, options, cookies) => { - console.log("😒 聚宝盆游玩开始翻倍"); - console.log("等待15秒再继续"); - console.log(cookies.double); - // eslint-disable-next-line no-unused-vars - await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); - - let params = { - arguments1: "AC20200716103629", // acid - arguments2: "GGPD", // yhChannel - // arguments3: "56ff7ad4a6e84886b18ae8716dfd1d6d", // yhTaskId menuId - arguments3: "56ff7ad4a6e84886b18ae8716dfd1d6d", // yhTaskId menuId - arguments4: new Date().getTime(), // time + postGameDouble: gameEvents.lookVideoDouble( + { + arguments1: "AC20200716103629", + arguments2: "GGPD", + arguments3: "56ff7ad4a6e84886b18ae8716dfd1d6d", + arguments4: new Date().getTime(), arguments6: "517050707", arguments7: "517050707", arguments8: "123456", arguments9: "4640b530b3f7481bb5821c6871854ce5", netWay: "Wifi", + remark1: "签到小游戏聚宝盆", + remark: "签到看视频翻倍得积分", version: `android@8.0102`, - }; - params["sign"] = sign([ - params.arguments1, - params.arguments2, - params.arguments3, - params.arguments4, - ]); - let { num, jar } = await require("./taskcallback").query(axios, { - ...options, - params, - }); - - if (!num) { - console.log("😒 签到小游戏聚宝盆: 今日已完成"); - return; - } - params = { + codeId: 945689604, + }, + { arguments1: "AC20200716103629", // acid arguments2: "GGPD", // yhChannel arguments3: "56ff7ad4a6e84886b18ae8716dfd1d6d", // yhTaskId menuId @@ -272,51 +253,29 @@ let ingotsPage = { .update(new Date().getTime() + "") .digest("hex"), netWay: "Wifi", - remark: "签到小游戏聚宝盆", + remark: "签到小游戏翻倍得积分", version: `android@8.0102`, - codeId: getCodeId("Android"), - }; - params["sign"] = sign([ - params.arguments1, - params.arguments2, - params.arguments3, - params.arguments4, - ]); - await require("./taskcallback").doTask(axios, { - ...options, - params, - jar, - }); - }, - lookVideoDouble: async (axios, options) => { - let params = { - arguments1: "AC20200716103629", // acid - arguments2: "GGPD", // yhChannel - arguments3: "45d6dbc3ad144c938cfa6b8e81803b85", // yhTaskId menuId - arguments4: new Date().getTime(), // time + codeId: 945689604, + }, + "聚宝盆" + ), + lookVideoDouble: gameEvents.lookVideoDouble( + { + arguments1: "AC20200716103629", + arguments2: "GGPD", + arguments3: "45d6dbc3ad144c938cfa6b8e81803b85", + arguments4: new Date().getTime(), arguments6: "517050707", arguments7: "517050707", arguments8: "123456", arguments9: "4640b530b3f7481bb5821c6871854ce5", netWay: "Wifi", + remark1: "签到小游戏聚宝盆", + remark: "签到看视频翻倍得积分", version: `android@8.0102`, - }; - params["sign"] = sign([ - params.arguments1, - params.arguments2, - params.arguments3, - params.arguments4, - ]); - let { num, jar } = await require("./taskcallback").query(axios, { - ...options, - params, - }); - - if (!num) { - console.log("😒 签到小游戏聚宝盆: 今日已完成"); - return; - } - params = { + codeId: 945689604, + }, + { arguments1: "AC20200716103629", // acid arguments2: "GGPD", // yhChannel arguments3: "45d6dbc3ad144c938cfa6b8e81803b85", // yhTaskId menuId @@ -330,22 +289,12 @@ let ingotsPage = { .update(new Date().getTime() + "") .digest("hex"), netWay: "Wifi", - remark: "签到小游戏聚宝盆", + remark: "签到小游戏翻倍得积分", version: `android@8.0102`, - codeId: getCodeId("Android"), - }; - params["sign"] = sign([ - params.arguments1, - params.arguments2, - params.arguments3, - params.arguments4, - ]); - await require("./taskcallback").doTask(axios, { - ...options, - params, - jar, - }); - }, + codeId: 945689604, + }, + "聚宝盆" + ), getOpenPlatLine: gameEvents.getOpenPlatLine( `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://wxapp.msmds.cn/h5/react_web/unicom/ingotsPage?source=unicom&duanlianjieabc=tbLm0`, { diff --git a/commands/tasks/unicom/unicom.js b/commands/tasks/unicom/unicom.js index 6146c9054..a597797f9 100644 --- a/commands/tasks/unicom/unicom.js +++ b/commands/tasks/unicom/unicom.js @@ -254,7 +254,7 @@ var start = async (params) => { await scheduler.regTask( "bcow", async (request) => { - await require("./bcow").doTask(request, options); + await require("./dailyBcow").doTask(request, options); }, taskOption ); @@ -395,7 +395,7 @@ var start = async (params) => { await scheduler.regTask( "threeSquirrels", async (request) => { - await require("./threeSquirrels").doTask(request, options); + await require("./dailyThreeSquirrels.js").doTask(request, options); }, taskOption ); From f3486240450d76f5c5cede85461b29a7f6ceaac0 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Thu, 11 Feb 2021 15:42:45 +0800 Subject: [PATCH 056/128] =?UTF-8?q?=F0=9F=9A=A7=20updating=20ingots?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/ingotsPage.js | 56 ++++++++++++++++++++------- commands/tasks/unicom/taskcallback.js | 1 + 2 files changed, 43 insertions(+), 14 deletions(-) diff --git a/commands/tasks/unicom/ingotsPage.js b/commands/tasks/unicom/ingotsPage.js index 6bd9c4a3c..0899b61f1 100644 --- a/commands/tasks/unicom/ingotsPage.js +++ b/commands/tasks/unicom/ingotsPage.js @@ -132,7 +132,7 @@ let ingotsPage = { remark1: "签到看视频得积分2", remark: "签到看视频得积分2", version: `android@8.0102`, - codeId: 945597742, + codeId: 945535695, }; params["sign"] = sign([ params.arguments1, @@ -156,7 +156,7 @@ let ingotsPage = { channelId: "LT_channel", phone: phone, token: ecs_token, - videoOrderNo: result["orderId"], + videoOrderNo: params["orderId"], sourceCode: "lt_ingots", }; @@ -207,19 +207,47 @@ let ingotsPage = { if (result.data.code !== 200) { throw new Error("❌ something errors: ", result.data.msg); } - console.log("😒 聚宝盆游玩获得积分: ", result.data.data.prizeName); - if (!result.data.double) { - console.log(result.data.double); - console.log("❌ 聚宝盆游玩暂无翻倍"); - data = { double: false }; - } else { - data = { double: true }; - } - await ingotsPage.postGameDouble(axios, options, data); - console.log("等待15秒再继续"); - // eslint-disable-next-line no-unused-vars - await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); + if (result.data.data.length > 0) { + for (let i of result.data.data) { + console.log("😒 聚宝盆游玩获得: ", i["prizeName"]); + if (i["recordId"] != null && i["double"]) { + console.log("尝试翻倍"); + let recordId = i["recordId"]; + let timestamp = moment().format("YYYYMMDDHHmmss"); + let result = await axios.request({ + headers: { + "user-agent": UA, + referer: `https://wxapp.msmds.cn/h5/react_web/unicom/ingotsPage?source=unicom&type=06&ticket=${searchParams.ticket}&version=iphone_c@8.0102×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&duanlianjieabc=tbLm0&userNumber=${options.user}`, + origin: "https://wxapp.msmds.cn", + "Content-Type": "application/x-www-form-urlencoded", + jar: jar1, + }, + url: `https://wxapp.msmds.cn/jplus/h5/greetGoldIngot/creditsDouble`, + method: "POST", + data: transParams({ + channelId: "LT_channel", + phone: phone, + token: ecs_token, + recordId: recordId, + sourceCode: "lt_ingots", + }), + }); + console.log(result); + data = { double: false }; + console.log("😒 聚宝盆游玩翻倍 测试"); + console.log("等待15秒再继续"); + // eslint-disable-next-line no-unused-vars + await new Promise((resolve, reject) => + setTimeout(resolve, 15 * 1000) + ); + await ingotsPage.postGameDouble(axios, options); + } else { + console.log("❌ 聚宝盆游玩暂无翻倍"); + data = { double: false }; + } + } + } } while (freeTimes || advertTimes); return data; }, diff --git a/commands/tasks/unicom/taskcallback.js b/commands/tasks/unicom/taskcallback.js index f7046dd77..69eeb1de5 100644 --- a/commands/tasks/unicom/taskcallback.js +++ b/commands/tasks/unicom/taskcallback.js @@ -20,6 +20,7 @@ function encryption(data, key) { } //data 是你的准备解密的字符串,key是你的密钥 +// eslint-disable-next-line no-unused-vars function decryption(data, key) { var iv = ""; var clearEncoding = "utf8"; From 2d15783000f2b3c98f198ee96e120d0bb303ad4b Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Thu, 11 Feb 2021 20:37:26 +0800 Subject: [PATCH 057/128] =?UTF-8?q?=F0=9F=9A=A7=20=20updating=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .editorconfig | 25 + commands/tasks/unicom/Niujie.js | 321 +++-- commands/tasks/unicom/handlers/myPhone.js | 6 +- commands/tasks/unicom/init.js | 9 +- commands/tasks/unicom/producGame.js | 1316 +++++++++++---------- 5 files changed, 878 insertions(+), 799 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..798410577 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,25 @@ +# http://editorconfig.org + +root = true + +[*] + +charset = utf-8 + +indent_style = space + +indent_size = 2 + +end_of_line = lf + +insert_final_newline = true + +trim_trailing_whitespace = true + + + +[*.md] + +insert_final_newline = false + +trim_trailing_whitespace = false diff --git a/commands/tasks/unicom/Niujie.js b/commands/tasks/unicom/Niujie.js index 50887c1b6..b94ac283f 100644 --- a/commands/tasks/unicom/Niujie.js +++ b/commands/tasks/unicom/Niujie.js @@ -1,167 +1,166 @@ var transParams = (data) => { - let params = new URLSearchParams(); - for (let item in data) { - params.append(item, data['' + item + '']); - } - return params; + let params = new URLSearchParams(); + for (let item in data) { + params.append(item, data["" + item + ""]); + } + return params; }; var Niujie = { - // 转盘抽奖3次-1000牛气抽1次 - CalfLottery: async (axios, options) => { - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} ` - let n = 3 - do { - console.log('第', n, '次') - let { data } = await axios.request({ - headers: { - "user-agent": useragent, - "referer": "https://img.client.10010.com/2021springfestival/index.html", - "origin": "https://img.client.10010.com" - }, - url: `https://m.client.10010.com/Niujie/calf/CalfLottery`, - method: 'POST' - }) - console.log(data) - await new Promise((resolve, reject) => setTimeout(resolve, 2500)) - } while (--n) - }, - // 牛气如意-秒杀抢兑 - spikePrize: async (axios, options) => { - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} ` - let prizes = [ - { - name: 'vivos7', - prizeId: '21013015030315978' - }, - { - name: '8折充值券', - prizeId: '21013123452511221' - }, - { - name: '10G流量日包', - prizeId: '21013015071318307' - }, - { - name: '腾讯视频会员', - prizeId: '21012919443117040' - } - ] - for (let prize of prizes) { - console.log('尝试抢兑', prize.name) - let { data } = await axios.request({ - headers: { - "user-agent": useragent, - "referer": "https://img.client.10010.com/2021springfestival/index.html", - "origin": "https://img.client.10010.com" - }, - url: `https://m.client.10010.com/Niujie/imazamox/spikePrize`, - method: 'POST', - data: transParams({ - 'prizeId': prize.prizeId - }) - }) - console.log(data) - } - - }, - getTaskList: async (axios, options) => { - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} ` - console.log('获取牛气任务中') - let { data } = await axios.request({ - headers: { - "user-agent": useragent, - "referer": "https://img.client.10010.com/2021springfestival/index.html", - "origin": "https://img.client.10010.com" - }, - url: `https://m.client.10010.com/Niujie/task/getTaskList`, - method: 'POST' - }) - return data.data - }, - doNiuqiTask: async (axios, options) => { - const { task } = options - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} ` - console.log('完成牛气任务中') - let { data } = await axios.request({ - headers: { - "user-agent": useragent, - "referer": "https://img.client.10010.com/2021springfestival/index.html", - "origin": "https://img.client.10010.com" - }, - url: `https://m.client.10010.com/Niujie/task/doTask`, - method: 'POST', - data: transParams({ - 'taskId': task.taskId - }) - }) - await axios.request({ - headers: { - "user-agent": useragent, - "referer": "https://img.client.10010.com/2021springfestival/index.html", - "origin": "https://img.client.10010.com" - }, - url: task.taskUrl, - method: 'get' - }) - console.log(data) - await new Promise((resolve, reject) => setTimeout(resolve, 500)) - }, - doNiuqiTasks: async (axios, options) => { - let tasklist = await Niujie.getTaskList(axios, options) - tasklist = tasklist.filter(t => t.taskStatus === '1') - if (!tasklist.length) { - console.log('每天领取牛气任务已完成,跳过') - } - for (let task of tasklist) { - console.log('去完成', task.taskName) - await Niujie.doNiuqiTask(axios, { - ...options, - task - }) - } - }, - doTask: async (axios, options) => { - await Niujie.doNiuqiTasks(axios, options) - await Niujie.CalfLottery(axios, options) - }, - receiveCalf: async (axios, options) => { - console.log('开始领取牛气值') - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} ` - await axios.request({ - headers: { - "user-agent": useragent, - "origin": "https://img.client.10010.com" - }, - url: 'https://img.client.10010.com/2021springfestival/index.html', - method: 'get' - }) - let shops = [ - 'BdShopVenue', - 'CfShopVenue', - 'DpShopVenue', - 'FGShopVenue', - 'JjShopVenue', - 'HqShopVenue', - 'NqShopVenue', - 'WzShopVenue', - 'XxShopVenue' - ] - for (let shop of shops) { - let { data } = await axios.request({ - headers: { - "user-agent": useragent, - "referer": "https://img.client.10010.com/2021springfestival/index.html", - "origin": "https://img.client.10010.com" - }, - url: 'https://m.client.10010.com/Niujie/calf/receiveCalf?shop=' + shop, - method: 'get' - }) - console.log(data.message) - await new Promise((resolve, reject) => setTimeout(resolve, 500)) - } - console.log('本轮牛气值领取完毕') + // 转盘抽奖3次-1000牛气抽1次 + CalfLottery: async (axios, options) => { + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} `; + let n = 3; + do { + console.log("第", n, "次"); + let { data } = await axios.request({ + headers: { + "user-agent": useragent, + referer: "https://img.client.10010.com/2021springfestival/index.html", + origin: "https://img.client.10010.com", + }, + url: `https://m.client.10010.com/Niujie/calf/CalfLottery`, + method: "POST", + }); + console.log(data); + await new Promise((resolve, reject) => setTimeout(resolve, 2500)); + } while (--n); + }, + // 牛气如意-秒杀抢兑 + spikePrize: async (axios, options) => { + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} `; + let prizes = [ + { + name: "vivos7", + prizeId: "21013015030315978", + }, + { + name: "8折充值券", + prizeId: "21013123452511221", + }, + { + name: "10G流量日包", + prizeId: "21013015071318307", + }, + { + name: "腾讯视频会员", + prizeId: "21012919443117040", + }, + ]; + for (let prize of prizes) { + console.log("尝试抢兑", prize.name); + let { data } = await axios.request({ + headers: { + "user-agent": useragent, + referer: "https://img.client.10010.com/2021springfestival/index.html", + origin: "https://img.client.10010.com", + }, + url: `https://m.client.10010.com/Niujie/imazamox/spikePrize`, + method: "POST", + data: transParams({ + prizeId: prize.prizeId, + }), + }); + console.log(data); + } + }, + getTaskList: async (axios, options) => { + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} `; + console.log("获取牛气任务中"); + let { data } = await axios.request({ + headers: { + "user-agent": useragent, + referer: "https://img.client.10010.com/2021springfestival/index.html", + origin: "https://img.client.10010.com", + }, + url: `https://m.client.10010.com/Niujie/task/getTaskList`, + method: "POST", + }); + return data.data; + }, + doNiuqiTask: async (axios, options) => { + const { task } = options; + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} `; + console.log("完成牛气任务中"); + let { data } = await axios.request({ + headers: { + "user-agent": useragent, + referer: "https://img.client.10010.com/2021springfestival/index.html", + origin: "https://img.client.10010.com", + }, + url: `https://m.client.10010.com/Niujie/task/doTask`, + method: "POST", + data: transParams({ + taskId: task.taskId, + }), + }); + await axios.request({ + headers: { + "user-agent": useragent, + referer: "https://img.client.10010.com/2021springfestival/index.html", + origin: "https://img.client.10010.com", + }, + url: task.taskUrl, + method: "get", + }); + console.log(data); + await new Promise((resolve, reject) => setTimeout(resolve, 500)); + }, + doNiuqiTasks: async (axios, options) => { + let tasklist = await Niujie.getTaskList(axios, options); + tasklist = tasklist.filter((t) => t.taskStatus === "1"); + if (!tasklist.length) { + console.log("每天领取牛气任务已完成,跳过"); } -} + for (let task of tasklist) { + console.log("去完成", task.taskName); + await Niujie.doNiuqiTask(axios, { + ...options, + task, + }); + } + }, + doTask: async (axios, options) => { + await Niujie.doNiuqiTasks(axios, options); + await Niujie.CalfLottery(axios, options); + }, + receiveCalf: async (axios, options) => { + console.log("开始领取牛气值"); + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} `; + await axios.request({ + headers: { + "user-agent": useragent, + origin: "https://img.client.10010.com", + }, + url: "https://img.client.10010.com/2021springfestival/index.html", + method: "get", + }); + let shops = [ + "BdShopVenue", + "CfShopVenue", + "DpShopVenue", + "FGShopVenue", + "JjShopVenue", + "HqShopVenue", + "NqShopVenue", + "WzShopVenue", + "XxShopVenue", + ]; + for (let shop of shops) { + let { data } = await axios.request({ + headers: { + "user-agent": useragent, + referer: "https://img.client.10010.com/2021springfestival/index.html", + origin: "https://img.client.10010.com", + }, + url: "https://m.client.10010.com/Niujie/calf/receiveCalf?shop=" + shop, + method: "get", + }); + console.log(data.message); + await new Promise((resolve, reject) => setTimeout(resolve, 500)); + } + console.log("本轮牛气值领取完毕"); + }, +}; -module.exports = Niujie \ No newline at end of file +module.exports = Niujie; diff --git a/commands/tasks/unicom/handlers/myPhone.js b/commands/tasks/unicom/handlers/myPhone.js index 05a3dfd47..6779c4ca4 100644 --- a/commands/tasks/unicom/handlers/myPhone.js +++ b/commands/tasks/unicom/handlers/myPhone.js @@ -21,12 +21,12 @@ const getCodeId = (useragent) => { // `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36;devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:};unicom{version:android@8.0102,desmobile:${options.user}}`; const USER_AGENTS = [ "Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@%s,desmobile:%s};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}", - "Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 unicom{version:iphone_c@%s,desmobile:%s}{systemVersion:dis}{yw_code:}", - "Mozilla/5.0 (iPhone; CPU iPhone OS 12_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 unicom{version:iphone_c@%s,desmobile:%s}{systemVersion:dis}{yw_code:}", + "Mozilla/5.0 (Linux; Android 9; MI 6 Build/PKQ1-wesley_iui-19.08.24; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.136 Mobile Safari/537.36; unicom{version:android@%s,desmobile:%s};devicetype{deviceBrand:Xiaomi,deviceModel:MI 6};{yw_code:}", "Mozilla/5.0 (Linux; Android 10; V1981A Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.96 Mobile Safari/537.36; unicom{version:android@%s,desmobile:%s};devicetype{deviceBrand:vivo,deviceModel:V1981A};{yw_code:}", "Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 unicom{version:iphone_c@%s,desmobile:%s}{systemVersion:dis}{yw_code:}", - "Mozilla/5.0 (Linux; Android 9; MI 6 Build/PKQ1-wesley_iui-19.08.24; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.136 Mobile Safari/537.36; unicom{version:android@%s,desmobile:%s};devicetype{deviceBrand:Xiaomi,deviceModel:MI 6};{yw_code:}", + "Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 unicom{version:iphone_c@%s,desmobile:%s}{systemVersion:dis}{yw_code:}", "Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 unicom{version:iphone_c@%s,desmobile:%s}{systemVersion:dis}{yw_code:}", + "Mozilla/5.0 (iPhone; CPU iPhone OS 12_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 unicom{version:iphone_c@%s,desmobile:%s}{systemVersion:dis}{yw_code:}", ]; function randomNumber(min = 0, max = 100) { diff --git a/commands/tasks/unicom/init.js b/commands/tasks/unicom/init.js index ca9b4f375..119f1e8aa 100644 --- a/commands/tasks/unicom/init.js +++ b/commands/tasks/unicom/init.js @@ -2,6 +2,7 @@ const { saveCookies } = require("../../../utils/util"); var crypto = require("crypto"); var moment = require("moment"); moment.locale("zh-cn"); +const { useragent } = require("./handlers/myPhone"); // 联通APP版本 const unicom_version = "8.0100"; @@ -47,16 +48,16 @@ function generateMixed(n) { module.exports = async (axios, params) => { let { cookies, options } = params; - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0102,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} `; let token_online; let appId; let data; + const UA = useragent(options); if (cookies) { let res = await axios.request({ baseURL: "https://m.client.10010.com", headers: { - "user-agent": useragent, + "user-agent": UA, referer: "https://m.client.10010.com", origin: "https://m.client.10010.com", }, @@ -120,7 +121,7 @@ module.exports = async (axios, params) => { const { data, config } = await axios.request({ baseURL: "https://m.client.10010.com", headers: { - "user-agent": useragent, + "user-agent": UA, referer: "https://m.client.10010.com", origin: "https://m.client.10010.com", }, @@ -164,7 +165,7 @@ module.exports = async (axios, params) => { .request({ baseURL: "https://m.client.10010.com", headers: { - "user-agent": useragent, + "user-agent": UA, referer: "https://m.client.10010.com", origin: "https://m.client.10010.com", }, diff --git a/commands/tasks/unicom/producGame.js b/commands/tasks/unicom/producGame.js index c7bd355b7..d831e71b2 100644 --- a/commands/tasks/unicom/producGame.js +++ b/commands/tasks/unicom/producGame.js @@ -1,649 +1,703 @@ // 娱乐中心 const CryptoJS = require("crypto-js"); -var crypto = require('crypto'); -const { default: PQueue } = require('p-queue'); -const moment = require('moment'); -const path = require('path'); -const { buildUnicomUserAgent } = require('../../../utils/util') +var crypto = require("crypto"); +const { default: PQueue } = require("p-queue"); +const moment = require("moment"); +const path = require("path"); +const { buildUnicomUserAgent } = require("../../../utils/util"); +const { useragent } = require("./handlers/myPhone"); var transParams = (data) => { - let params = new URLSearchParams(); - for (let item in data) { - params.append(item, data['' + item + '']); - } - return params; + let params = new URLSearchParams(); + for (let item in data) { + params.append(item, data["" + item + ""]); + } + return params; }; var sign = (data) => { - let str = 'integralofficial&' - let params = [] - data.forEach((v, i) => { - if (v) { - params.push('arguments' + (i + 1) + v) - } - }); - return crypto.createHash('md5').update(str + params.join('&')).digest('hex') -} + let str = "integralofficial&"; + let params = []; + data.forEach((v, i) => { + if (v) { + params.push("arguments" + (i + 1) + v); + } + }); + return crypto + .createHash("md5") + .update(str + params.join("&")) + .digest("hex"); +}; var deviceInfos = [ - 'm=VKY-AL00&o=9&a=28&p=1080*1920&f=HUAWEI&mm=5725&cf=1800&cc=8&qqversion=null', - 'm=SM-G977N&o=7&a=24&p=1080*1920&f=samsung&mm=5725&cf=1800&cc=8&qqversion=null', - 'm=Pixel&o=8&a=27&p=1080*1920&f=google&mm=5725&cf=1800&cc=8&qqversion=null' -] -var deviceInfo = deviceInfos[Math.floor(Math.random() * deviceInfos.length)] + "m=VKY-AL00&o=9&a=28&p=1080*1920&f=HUAWEI&mm=5725&cf=1800&cc=8&qqversion=null", + "m=SM-G977N&o=7&a=24&p=1080*1920&f=samsung&mm=5725&cf=1800&cc=8&qqversion=null", + "m=Pixel&o=8&a=27&p=1080*1920&f=google&mm=5725&cf=1800&cc=8&qqversion=null", +]; +var deviceInfo = deviceInfos[Math.floor(Math.random() * deviceInfos.length)]; var producGame = { - // 娱乐中心每日签到-打卡 - gameSignin: (axios, options) => { - const useragent = buildUnicomUserAgent(options, 'p') - let data = { - 'methodType': 'signin' - } - return new Promise((resolve, reject) => { - axios.request({ - baseURL: 'https://m.client.10010.com/', - headers: { - "user-agent": useragent, - "referer": "https://img.client.10010.com", - "origin": "https://img.client.10010.com" - }, - url: `/producGame_signin`, - method: 'post', - data: transParams(data) - }).then(res => { - let result = res.data - if (result) { - if (result.respCode !== '0000') { - console.log('娱乐中心每日签到失败', result.respDesc) - } else { - console.log('娱乐中心每日签到获得+' + result.currentIntegral) - } - } else { - console.log('娱乐中心每日签到失败') - } - resolve() - }).catch(reject) - }) - }, - - playGame: async (axios, options) => { - const { game, launchid, jar } = options - - let cookiesJson = jar.toJSON() - let jwt = cookiesJson.cookies.find(i => i.key == 'jwt') - if (!jwt) { - throw new Error('jwt缺失') - } - jwt = jwt.value - - let playGame = require(path.resolve(path.join(__dirname, './playGame.json'))); - let protobufRoot = require('protobufjs').Root; - let root = protobufRoot.fromJSON(playGame); - let mc = root.lookupType('JudgeTimingBusiBuff'); - let launchId1 = launchid || new Date().getTime() + '' - - let n = 1; - - do { - console.log('第', n, '次') - let dd = moment().format('MMDDHHmmss') - let time = new Date().getTime() % 1000 - let s = Math.floor(Math.random() * 90000) + 10000 - let traceid = `${options.user}_${dd}${time}_${s}` - let Seq = n * 3 - - let a = { - 'uin': `${options.user}`, - 'sig': jwt, - 'platform': '2001', - 'type': 0, - 'appid': '101794394' - } - let busiBuff = { - extInfo: null, - appid: game.gameCode, - factType: n == 6 ? 13 : 12, - duration: null, - reportTime: Math.floor(new Date().getTime() / 1000) + n * 62, - afterCertify: 0, - appType: 1, - scene: 1001, - totalTime: n * 62, - launchId: launchId1, - via: '', - AdsTotalTime: 0, - hostExtInfo: null - } - let c = { - 'Seq': Seq, - 'qua': 'V1_AND_MINISDK_1.5.3_0_RELEASE_B', - 'deviceInfo': deviceInfo, - 'busiBuff': busiBuff, - 'traceid': traceid, - 'Module': `mini_app_growguard`, - 'Cmdname': 'JudgeTiming', - 'loginSig': a, - 'Crypto': null, - 'Extinfo': null, - 'contentType': 0 - } - - let infoEncodeMessage = mc.encode(mc.create(c)).finish(); - - let Nonce = Math.floor(Math.random() * 90000) + 10000 - let Timestamp = Math.floor(new Date().getTime() / 1000) - - let str = `POST /mini/OpenChannel?Action=input&Nonce=${Nonce}&PlatformID=2001&SignatureMethod=HmacSHA256&Timestamp=${Timestamp}` - let Signature = CryptoJS.HmacSHA256(str, 'test') - let hashInBase64 = CryptoJS.enc.Base64.stringify(Signature); - - let res = await axios.request({ - headers: { - "user-agent": "okhttp/4.4.0" - }, - jar: null, - url: `https://q.qq.com/mini/OpenChannel?Action=input&Nonce=${Nonce}&PlatformID=2001&SignatureMethod=HmacSHA256&Timestamp=${Timestamp}&Signature=${hashInBase64}`, - method: 'post', - responseType: 'arrayBuffer', - data: infoEncodeMessage - }).catch(err => console.log(err)) - - console.log(Buffer.from(res.data).toString('hex')) - - // 这里不等待1分钟,上面使用 n*62 时长累计来替代,也可正常领取 - await new Promise((resolve, reject) => setTimeout(resolve, 35 * 1000)) - - ++n - } while (n <= 6) - }, - gameInfo: async (axios, options) => { - const { game, jar } = options - - let cookiesJson = jar.toJSON() - let jwt = cookiesJson.cookies.find(i => i.key == 'jwt') - if (!jwt) { - throw new Error('jwt缺失') - } - jwt = jwt.value - - let playGame = require(path.resolve(path.join(__dirname, './playGame.json'))); - let protobufRoot = require('protobufjs').Root; - let root = protobufRoot.fromJSON(playGame); - let mc = root.lookupType('GetAppInfoByLinkBusiBuff'); - - let n = 1; - - let dd = moment().format('MMDDHHmmss') - let time = new Date().getTime() % 1000 - let s = Math.floor(Math.random() * 90000) + 10000 - let traceid = `${options.user}_${dd}${time}_${s}` - let Seq = n * 3 - - let a = { - 'uin': `${options.user}`, - 'sig': jwt, - 'platform': '2001', - 'type': 0, - 'appid': '101794394' - } - let busiBuff = { - link: game.url, - linkType: 0 - } - let c = { - 'Seq': Seq, - 'qua': 'V1_AND_MINISDK_1.5.3_0_RELEASE_B', - 'deviceInfo': deviceInfo, - 'busiBuff': Buffer.from(JSON.stringify(busiBuff)), - 'traceid': traceid, - 'Module': `mini_app_info`, - 'Cmdname': 'GetAppInfoByLink', - 'loginSig': a, - 'Crypto': null, - 'Extinfo': null, - 'contentType': 1 - } - - let infoEncodeMessage = mc.encode(mc.create(c)).finish(); - - let Nonce = Math.floor(Math.random() * 90000) + 10000 - let Timestamp = Math.floor(new Date().getTime() / 1000) - - let str = `POST /mini/OpenChannel?Action=input&Nonce=${Nonce}&PlatformID=2001&SignatureMethod=HmacSHA256&Timestamp=${Timestamp}` - let Signature = CryptoJS.HmacSHA256(str, 'test') - let hashInBase64 = CryptoJS.enc.Base64.stringify(Signature); - - let res = await axios.request({ - headers: { - "user-agent": "okhttp/4.4.0" - }, - jar: null, - url: `https://q.qq.com/mini/OpenChannel?Action=input&Nonce=${Nonce}&PlatformID=2001&SignatureMethod=HmacSHA256&Timestamp=${Timestamp}&Signature=${hashInBase64}`, - method: 'post', - responseType: 'arrayBuffer', - data: infoEncodeMessage - }).catch(err => console.log(err)) - let result = JSON.parse(Buffer.from(res.data).slice(0x7).toString('utf-8')) - return result - }, - popularGames: async (axios, options) => { - const useragent = buildUnicomUserAgent(options, 'p') - let params = { - 'methodType': 'popularGames', - 'deviceType': 'Android', - 'clientVersion': '8.0100', - } - let { data, config } = await axios.request({ - baseURL: 'https://m.client.10010.com/', - headers: { - "user-agent": useragent, - "referer": "https://img.client.10010.com", - "origin": "https://img.client.10010.com" - }, - url: `/producGameApp`, - method: 'post', - data: transParams(params) - }) - if (data) { - return { - jar: config.jar, - popularList: data.popularList || [] - } - } else { - console.log('记录失败') - } - }, - gameverify: async (axios, options) => { - const { jar } = options - let cookiesJson = jar.toJSON() - let jwt = cookiesJson.cookies.find(i => i.key == 'jwt') - if (!jwt) { - throw new Error('jwt缺失') - } - jwt = jwt.value - - let { data } = await axios.request({ - baseURL: 'https://m.client.10010.com/', - headers: { - "user-agent": "okhttp/4.4.0", - "referer": "https://img.client.10010.com", - "origin": "https://img.client.10010.com" - }, - url: `/game/verify`, - method: 'post', - data: { - "extInfo": jwt, - "auth": { - "uin": options.user, - "sig": jwt - } - } - }) - if (data) { - if (data.respCode !== 0) { - console.log(data.errorMessage) - } - } else { - console.log('记录失败') - } - }, - gamerecord: async (axios, options) => { - const { gameId } = options - const useragent = buildUnicomUserAgent(options, 'p') - let params = { - 'methodType': 'record', - 'deviceType': 'Android', - 'clientVersion': '8.0100', - 'gameId': gameId, - 'taskId': '' - } - let { data } = await axios.request({ - headers: { - "user-agent": useragent, - "referer": "https://img.client.10010.com", - "origin": "https://img.client.10010.com" - }, - url: `https://m.client.10010.com/producGameApp`, - method: 'post', - data: transParams(params) - }) - if (data) { - console.log(data.msg) - } else { - console.log('记录失败') - } - }, - queryIntegral: async (axios, options) => { - const useragent = buildUnicomUserAgent(options, 'p') - let params = { - 'methodType': 'queryIntegral', - 'taskCenterId': options.taskCenterId, - 'videoIntegral': '0', - 'isVideo': 'Y', - 'clientVersion': '8.0100', - 'deviceType': 'Android' - } - let { data, config } = await axios.request({ - headers: { - "user-agent": useragent, - "referer": "https://img.client.10010.com", - "origin": "https://img.client.10010.com" - }, - url: `https://m.client.10010.com/producGameTaskCenter`, - method: 'post', - data: transParams(params) - }) - if (data.code === '0000') { - console.log('获取积分任务状态成功') - } else { - console.log('获取积分任务状态失败') - } - }, - getTaskList: async (axios, options) => { - const useragent = buildUnicomUserAgent(options, 'p') - let params = { - 'methodType': 'queryTaskCenter', - 'deviceType': 'Android', - 'clientVersion': '8.0100' - } - let { data, config } = await axios.request({ - headers: { - "user-agent": useragent, - "referer": "https://img.client.10010.com", - "origin": "https://img.client.10010.com" - }, - url: `https://m.client.10010.com/producGameTaskCenter`, - method: 'post', - data: transParams(params) + // 娱乐中心每日签到-打卡 + gameSignin: (axios, options) => { + const useragent = buildUnicomUserAgent(options, "p"); + let data = { + methodType: "signin", + }; + return new Promise((resolve, reject) => { + axios + .request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": useragent, + referer: "https://img.client.10010.com", + origin: "https://img.client.10010.com", + }, + url: `/producGame_signin`, + method: "post", + data: transParams(data), }) - if (data.code === '0000') { - // reachState 0未完成, 1未领取, 2已完成 - return { - jar: config.jar, - games: data.data + .then((res) => { + let result = res.data; + if (result) { + if (result.respCode !== "0000") { + console.log("娱乐中心每日签到失败", result.respDesc); + } else { + console.log("娱乐中心每日签到获得+" + result.currentIntegral); } - } else { - console.log('获取游戏任务失败') - return {} - } - }, - doGameFlowTask: async (axios, options) => { - let { popularList: allgames, jar } = await producGame.popularGames(axios, options) - let games = await producGame.timeTaskQuery(axios, options) - games = allgames.filter(g => games.filter(g => g.state === '0').map(i => i.gameId).indexOf(g.id) !== -1) - console.log('剩余未完成game', games.length) - let queue = new PQueue({ concurrency: 2 }); - - console.log('调度任务中', '并发数', 2) - for (let game of games) { - queue.add(async () => { - console.log(game.name) - await producGame.gameverify(axios, { - ...options, - jar, - game - }) - await producGame.playGame(axios, { - ...options, - jar, - game - }) - await producGame.timeTaskQuery(axios, options) - await producGame.gameFlowGet(axios, { - ...options, - gameId: game.gameId - }) - }) - } - - await queue.onIdle() - - await new Promise((resolve, reject) => setTimeout(resolve, (Math.floor(Math.random() * 10) + 30) * 1000)) - games = await producGame.timeTaskQuery(axios, options) - games = games.filter(g => g.state === '1') - console.log('剩余未领取game', games.length) - for (let game of games) { - await new Promise((resolve, reject) => setTimeout(resolve, (Math.floor(Math.random() * 10) + 15) * 1000)) - await producGame.gameFlowGet(axios, { - ...options, - gameId: game.gameId - }) - } - }, - doGameIntegralTask: async (axios, options) => { - let { games, jar } = await producGame.getTaskList(axios, options) - games = games.filter(d => d.task === '5' && d.reachState === '0' && d.task_type === 'duration') - console.log('剩余未完成game', games.length) - let queue = new PQueue({ concurrency: 2 }); - - console.log('调度任务中', '并发数', 2) - for (let game of games) { - queue.add(async () => { - console.log(game.name) - await producGame.gameverify(axios, { - ...options, - jar, - game - }) - await producGame.gamerecord(axios, { - ...options, - gameId: game.game_id - }) - await producGame.playGame(axios, { - ...options, - jar, - game: { - ...game, - gameCode: game.resource_id - } - }) - await producGame.getTaskList(axios, options) - await producGame.gameIntegralGet(axios, { - ...options, - taskCenterId: game.id - }) - }) - } - - await queue.onIdle() - - await new Promise((resolve, reject) => setTimeout(resolve, (Math.floor(Math.random() * 10) + 30) * 1000)) - let { games: cgames } = await producGame.getTaskList(axios, options) - games = cgames.filter(d => d.task === '5' && d.reachState === '1' && d.task_type === 'duration') - console.log('剩余未领取game', games.length) - for (let game of games) { - await new Promise((resolve, reject) => setTimeout(resolve, (Math.floor(Math.random() * 10) + 20) * 1000)) - await producGame.gameIntegralGet(axios, { - ...options, - taskCenterId: game.id - }) - } - - await new Promise((resolve, reject) => setTimeout(resolve, (Math.floor(Math.random() * 5) + 5) * 1000)) - let { games: ngames } = await producGame.getTaskList(axios, options) - let task_times = ngames.find(d => d.task === '3' && d.task_type === 'times') - if (task_times && task_times.reachState === '1') { - await new Promise((resolve, reject) => setTimeout(resolve, (Math.floor(Math.random() * 10) + 15) * 1000)) - await producGame.gameIntegralGet(axios, { - ...options, - taskCenterId: task_times.id - }) - } - }, - timeTaskQuery: async (axios, options) => { - const useragent = buildUnicomUserAgent(options, 'p') - let params = { - 'methodType': 'timeTaskQuery', - 'deviceType': 'Android', - 'clientVersion': '8.0100' - } - let { data } = await axios.request({ - baseURL: 'https://m.client.10010.com/', - headers: { - "user-agent": useragent, - "referer": "https://img.client.10010.com", - "origin": "https://img.client.10010.com" - }, - url: `/producGameApp`, - method: 'post', - data: transParams(params) + } else { + console.log("娱乐中心每日签到失败"); + } + resolve(); }) - if (data) { - console.log(data.msg) - return data.data//0未进行 state=1待领取 state=2已完成 - } else { - console.log('记录失败') - } - }, - gameFlowGet: async (axios, options) => { - const { gameId } = options - const useragent = buildUnicomUserAgent(options, 'p') - let params = { - 'userNumber': options.user, - 'methodType': 'flowGet', - 'gameId': gameId, - 'deviceType': 'Android', - 'clientVersion': '8.0100', - } - let { data } = await axios.request({ - baseURL: 'https://m.client.10010.com/', - headers: { - "user-agent": useragent, - "referer": "https://img.client.10010.com", - "origin": "https://img.client.10010.com", - "X-Requested-With": "com.sinovatech.unicom.ui" - }, - url: `/producGameApp`, - method: 'post', - data: transParams(params) - }) - if (data) { - console.log(data.msg) - if (data.msg.indexOf('防刷策略接口校验不通过') !== -1) { - throw new Error('出现【防刷策略接口校验不通过】, 取消本次执行') - } - } else { - console.log('获取奖励失败') - } - }, - gameIntegralGet: async (axios, options) => { - const { taskCenterId } = options - const useragent = buildUnicomUserAgent(options, 'p') - let params = { - 'methodType': 'taskGetReward', - 'taskCenterId': taskCenterId, - 'deviceType': 'Android', - 'clientVersion': '8.0100', - } - let { data } = await axios.request({ - headers: { - "user-agent": useragent, - "referer": "https://img.client.10010.com", - "origin": "https://img.client.10010.com" - }, - url: `https://m.client.10010.com/producGameTaskCenter`, - method: 'post', - data: transParams(params) - }) - if (data) { - console.log(data.msg) - if (data.msg.indexOf('防刷策略接口校验不通过') !== -1) { - throw new Error('出现【防刷策略接口校验不通过】, 取消本次执行') - } - } else { - console.log('获取奖励失败') - } - }, - gameBox: async (axios, options) => { - let { games: v_games } = await producGame.getTaskList(axios, options) - let box_task = v_games.find(d => d.id === '98' && d.reachState !== '2') - if (box_task) { - await producGame.gameIntegralGet(axios, { - ...options, - taskCenterId: box_task.id - }) - } - }, - watch3TimesVideoQuery: async (request, options) => { - let params = { - 'arguments1': 'AC20200728150217', // acid - 'arguments2': 'GGPD', // yhChannel - 'arguments3': '96945964804e42299634340cd2650451', // yhTaskId menuId - 'arguments4': new Date().getTime(), // time - 'arguments6': '', - 'netWay': 'Wifi', - 'version': `android@8.0100`, - } - params['sign'] = sign([params.arguments1, params.arguments2, params.arguments3, params.arguments4]) - return await require('./taskcallback').query(request, { - ...options, - params - }) - }, - watch3TimesVideo: async (axios, options) => { - const { jar } = options - let params = { - 'arguments1': 'AC20200728150217', - 'arguments2': 'GGPD', - 'arguments3': '96945964804e42299634340cd2650451', - 'arguments4': new Date().getTime(), - 'arguments6': '', - 'arguments7': '', - 'arguments8': '', - 'arguments9': '', - 'netWay': 'Wifi', - 'remark1': '游戏频道看视频得积分', - 'remark': '游戏视频任务积分', - 'version': `android@8.0100`, - 'codeId': 945535736 - } - params['sign'] = sign([params.arguments1, params.arguments2, params.arguments3, params.arguments4]) - await require('./taskcallback').doTask(axios, { - ...options, - params, - jar + .catch(reject); + }); + }, + + playGame: async (axios, options) => { + const { game, launchid, jar } = options; + + let cookiesJson = jar.toJSON(); + let jwt = cookiesJson.cookies.find((i) => i.key == "jwt"); + if (!jwt) { + throw new Error("jwt缺失"); + } + jwt = jwt.value; + + let playGame = require(path.resolve( + path.join(__dirname, "./playGame.json") + )); + let protobufRoot = require("protobufjs").Root; + let root = protobufRoot.fromJSON(playGame); + let mc = root.lookupType("JudgeTimingBusiBuff"); + let launchId1 = launchid || new Date().getTime() + ""; + + let n = 1; + + do { + console.log("第", n, "次"); + let dd = moment().format("MMDDHHmmss"); + let time = new Date().getTime() % 1000; + let s = Math.floor(Math.random() * 90000) + 10000; + let traceid = `${options.user}_${dd}${time}_${s}`; + let Seq = n * 3; + + let a = { + uin: `${options.user}`, + sig: jwt, + platform: "2001", + type: 0, + appid: "101794394", + }; + let busiBuff = { + extInfo: null, + appid: game.gameCode, + factType: n == 6 ? 13 : 12, + duration: null, + reportTime: Math.floor(new Date().getTime() / 1000) + n * 62, + afterCertify: 0, + appType: 1, + scene: 1001, + totalTime: n * 62, + launchId: launchId1, + via: "", + AdsTotalTime: 0, + hostExtInfo: null, + }; + let c = { + Seq: Seq, + qua: "V1_AND_MINISDK_1.5.3_0_RELEASE_B", + deviceInfo: deviceInfo, + busiBuff: busiBuff, + traceid: traceid, + Module: `mini_app_growguard`, + Cmdname: "JudgeTiming", + loginSig: a, + Crypto: null, + Extinfo: null, + contentType: 0, + }; + + let infoEncodeMessage = mc.encode(mc.create(c)).finish(); + + let Nonce = Math.floor(Math.random() * 90000) + 10000; + let Timestamp = Math.floor(new Date().getTime() / 1000); + + let str = `POST /mini/OpenChannel?Action=input&Nonce=${Nonce}&PlatformID=2001&SignatureMethod=HmacSHA256&Timestamp=${Timestamp}`; + let Signature = CryptoJS.HmacSHA256(str, "test"); + let hashInBase64 = CryptoJS.enc.Base64.stringify(Signature); + + let res = await axios + .request({ + headers: { + "user-agent": "okhttp/4.4.0", + }, + jar: null, + url: `https://q.qq.com/mini/OpenChannel?Action=input&Nonce=${Nonce}&PlatformID=2001&SignatureMethod=HmacSHA256&Timestamp=${Timestamp}&Signature=${hashInBase64}`, + method: "post", + responseType: "arrayBuffer", + data: infoEncodeMessage, }) - }, - doTodayDailyTask: async (axios, options) => { - - let { games: v_games } = await producGame.getTaskList(axios, options) - let video_task = v_games.find(d => d.task_type === 'video') - - if (video_task.reachState === '0') { - let n = parseInt(video_task.task) - parseInt(video_task.progress) - console.log('领取视频任务奖励,剩余', n, '次') - let { jar } = await producGame.watch3TimesVideoQuery(axios, options) - let i = 1 - while (i <= n) { - await producGame.watch3TimesVideo(axios, { - ...options, - jar - }) - await new Promise((resolve, reject) => setTimeout(resolve, (Math.floor(Math.random() * 5) + 2) * 200)) - await producGame.getTaskList(axios, options) - await producGame.queryIntegral(axios, { - ...options, - taskCenterId: video_task.id - }) - ++i - } - } - - let { games } = await producGame.getTaskList(axios, options) - let today_task = games.find(d => d.task_type === 'todayTask') - if (today_task.reachState === '0') { - throw new Error('部分日常任务未完成,下次再尝试领取完成今日任务流量') - } else if (today_task.reachState === '1') { - await producGame.gameIntegralGet(axios, { - ...options, - taskCenterId: today_task.id - }) - console.log('领取完成今日任务流量+200') - } else if (today_task.reachState === '2') { - console.log('每日日常任务已完成') - } + .catch((err) => console.log(err)); + + console.log(Buffer.from(res.data).toString("hex")); + + // 这里不等待1分钟,上面使用 n*62 时长累计来替代,也可正常领取 + await new Promise((resolve, reject) => setTimeout(resolve, 35 * 1000)); + + ++n; + } while (n <= 6); + }, + gameInfo: async (axios, options) => { + const { game, jar } = options; + + let cookiesJson = jar.toJSON(); + let jwt = cookiesJson.cookies.find((i) => i.key == "jwt"); + if (!jwt) { + throw new Error("jwt缺失"); + } + jwt = jwt.value; + + let playGame = require(path.resolve( + path.join(__dirname, "./playGame.json") + )); + let protobufRoot = require("protobufjs").Root; + let root = protobufRoot.fromJSON(playGame); + let mc = root.lookupType("GetAppInfoByLinkBusiBuff"); + + let n = 1; + + let dd = moment().format("MMDDHHmmss"); + let time = new Date().getTime() % 1000; + let s = Math.floor(Math.random() * 90000) + 10000; + let traceid = `${options.user}_${dd}${time}_${s}`; + let Seq = n * 3; + + let a = { + uin: `${options.user}`, + sig: jwt, + platform: "2001", + type: 0, + appid: "101794394", + }; + let busiBuff = { + link: game.url, + linkType: 0, + }; + let c = { + Seq: Seq, + qua: "V1_AND_MINISDK_1.5.3_0_RELEASE_B", + deviceInfo: deviceInfo, + busiBuff: Buffer.from(JSON.stringify(busiBuff)), + traceid: traceid, + Module: `mini_app_info`, + Cmdname: "GetAppInfoByLink", + loginSig: a, + Crypto: null, + Extinfo: null, + contentType: 1, + }; + + let infoEncodeMessage = mc.encode(mc.create(c)).finish(); + + let Nonce = Math.floor(Math.random() * 90000) + 10000; + let Timestamp = Math.floor(new Date().getTime() / 1000); + + let str = `POST /mini/OpenChannel?Action=input&Nonce=${Nonce}&PlatformID=2001&SignatureMethod=HmacSHA256&Timestamp=${Timestamp}`; + let Signature = CryptoJS.HmacSHA256(str, "test"); + let hashInBase64 = CryptoJS.enc.Base64.stringify(Signature); + + let res = await axios + .request({ + headers: { + "user-agent": "okhttp/4.4.0", + }, + jar: null, + url: `https://q.qq.com/mini/OpenChannel?Action=input&Nonce=${Nonce}&PlatformID=2001&SignatureMethod=HmacSHA256&Timestamp=${Timestamp}&Signature=${hashInBase64}`, + method: "post", + responseType: "arrayBuffer", + data: infoEncodeMessage, + }) + .catch((err) => console.log(err)); + let result = JSON.parse(Buffer.from(res.data).slice(0x7).toString("utf-8")); + return result; + }, + popularGames: async (axios, options) => { + const useragent = buildUnicomUserAgent(options, "p"); + let params = { + methodType: "popularGames", + deviceType: "Android", + clientVersion: "8.0100", + }; + let { data, config } = await axios.request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": useragent, + referer: "https://img.client.10010.com", + origin: "https://img.client.10010.com", + }, + url: `/producGameApp`, + method: "post", + data: transParams(params), + }); + if (data) { + return { + jar: config.jar, + popularList: data.popularList || [], + }; + } else { + console.log("记录失败"); + } + }, + gameverify: async (axios, options) => { + const { jar } = options; + let cookiesJson = jar.toJSON(); + let jwt = cookiesJson.cookies.find((i) => i.key == "jwt"); + if (!jwt) { + throw new Error("jwt缺失"); + } + jwt = jwt.value; + + let { data } = await axios.request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": "okhttp/4.4.0", + referer: "https://img.client.10010.com", + origin: "https://img.client.10010.com", + }, + url: `/game/verify`, + method: "post", + data: { + extInfo: jwt, + auth: { + uin: options.user, + sig: jwt, + }, + }, + }); + if (data) { + if (data.respCode !== 0) { + console.log(data.errorMessage); + } + } else { + console.log("记录失败"); + } + }, + gamerecord: async (axios, options) => { + const { gameId } = options; + const useragent = buildUnicomUserAgent(options, "p"); + let params = { + methodType: "record", + deviceType: "Android", + clientVersion: "8.0100", + gameId: gameId, + taskId: "", + }; + let { data } = await axios.request({ + headers: { + "user-agent": useragent, + referer: "https://img.client.10010.com", + origin: "https://img.client.10010.com", + }, + url: `https://m.client.10010.com/producGameApp`, + method: "post", + data: transParams(params), + }); + if (data) { + console.log(data.msg); + } else { + console.log("记录失败"); + } + }, + queryIntegral: async (axios, options) => { + const useragent = buildUnicomUserAgent(options, "p"); + let params = { + methodType: "queryIntegral", + taskCenterId: options.taskCenterId, + videoIntegral: "0", + isVideo: "Y", + clientVersion: "8.0100", + deviceType: "Android", + }; + let { data, config } = await axios.request({ + headers: { + "user-agent": useragent, + referer: "https://img.client.10010.com", + origin: "https://img.client.10010.com", + }, + url: `https://m.client.10010.com/producGameTaskCenter`, + method: "post", + data: transParams(params), + }); + if (data.code === "0000") { + console.log("获取积分任务状态成功"); + } else { + console.log("获取积分任务状态失败"); + } + }, + getTaskList: async (axios, options) => { + const useragent = buildUnicomUserAgent(options, "p"); + let params = { + methodType: "queryTaskCenter", + deviceType: "Android", + clientVersion: "8.0100", + }; + let { data, config } = await axios.request({ + headers: { + "user-agent": useragent, + referer: "https://img.client.10010.com", + origin: "https://img.client.10010.com", + }, + url: `https://m.client.10010.com/producGameTaskCenter`, + method: "post", + data: transParams(params), + }); + if (data.code === "0000") { + // reachState 0未完成, 1未领取, 2已完成 + return { + jar: config.jar, + games: data.data, + }; + } else { + console.log("获取游戏任务失败"); + return {}; + } + }, + doGameFlowTask: async (axios, options) => { + let { popularList: allgames, jar } = await producGame.popularGames( + axios, + options + ); + let games = await producGame.timeTaskQuery(axios, options); + games = allgames.filter( + (g) => + games + .filter((g) => g.state === "0") + .map((i) => i.gameId) + .indexOf(g.id) !== -1 + ); + console.log("剩余未完成game", games.length); + let queue = new PQueue({ concurrency: 2 }); + + console.log("调度任务中", "并发数", 2); + for (let game of games) { + queue.add(async () => { + console.log(game.name); + await producGame.gameverify(axios, { + ...options, + jar, + game, + }); + await producGame.playGame(axios, { + ...options, + jar, + game, + }); + await producGame.timeTaskQuery(axios, options); + await producGame.gameFlowGet(axios, { + ...options, + gameId: game.gameId, + }); + }); + } + + await queue.onIdle(); + + await new Promise((resolve, reject) => + setTimeout(resolve, (Math.floor(Math.random() * 10) + 30) * 1000) + ); + games = await producGame.timeTaskQuery(axios, options); + games = games.filter((g) => g.state === "1"); + console.log("剩余未领取game", games.length); + for (let game of games) { + await new Promise((resolve, reject) => + setTimeout(resolve, (Math.floor(Math.random() * 10) + 15) * 1000) + ); + await producGame.gameFlowGet(axios, { + ...options, + gameId: game.gameId, + }); + } + }, + doGameIntegralTask: async (axios, options) => { + let { games, jar } = await producGame.getTaskList(axios, options); + games = games.filter( + (d) => + d.task === "5" && d.reachState === "0" && d.task_type === "duration" + ); + console.log("剩余未完成game", games.length); + let queue = new PQueue({ concurrency: 2 }); + + console.log("调度任务中", "并发数", 2); + for (let game of games) { + queue.add(async () => { + console.log(game.name); + await producGame.gameverify(axios, { + ...options, + jar, + game, + }); + await producGame.gamerecord(axios, { + ...options, + gameId: game.game_id, + }); + await producGame.playGame(axios, { + ...options, + jar, + game: { + ...game, + gameCode: game.resource_id, + }, + }); + await producGame.getTaskList(axios, options); + await producGame.gameIntegralGet(axios, { + ...options, + taskCenterId: game.id, + }); + }); + } + + await queue.onIdle(); + + await new Promise((resolve, reject) => + setTimeout(resolve, (Math.floor(Math.random() * 10) + 30) * 1000) + ); + let { games: cgames } = await producGame.getTaskList(axios, options); + games = cgames.filter( + (d) => + d.task === "5" && d.reachState === "1" && d.task_type === "duration" + ); + console.log("剩余未领取game", games.length); + for (let game of games) { + await new Promise((resolve, reject) => + setTimeout(resolve, (Math.floor(Math.random() * 10) + 20) * 1000) + ); + await producGame.gameIntegralGet(axios, { + ...options, + taskCenterId: game.id, + }); } -} + await new Promise((resolve, reject) => + setTimeout(resolve, (Math.floor(Math.random() * 5) + 5) * 1000) + ); + let { games: ngames } = await producGame.getTaskList(axios, options); + let task_times = ngames.find( + (d) => d.task === "3" && d.task_type === "times" + ); + if (task_times && task_times.reachState === "1") { + await new Promise((resolve, reject) => + setTimeout(resolve, (Math.floor(Math.random() * 10) + 15) * 1000) + ); + await producGame.gameIntegralGet(axios, { + ...options, + taskCenterId: task_times.id, + }); + } + }, + timeTaskQuery: async (axios, options) => { + const useragent = buildUnicomUserAgent(options, "p"); + let params = { + methodType: "timeTaskQuery", + deviceType: "Android", + clientVersion: "8.0100", + }; + let { data } = await axios.request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": useragent, + referer: "https://img.client.10010.com", + origin: "https://img.client.10010.com", + }, + url: `/producGameApp`, + method: "post", + data: transParams(params), + }); + if (data) { + console.log(data.msg); + return data.data; //0未进行 state=1待领取 state=2已完成 + } else { + console.log("记录失败"); + } + }, + gameFlowGet: async (axios, options) => { + const { gameId } = options; + const useragent = buildUnicomUserAgent(options, "p"); + let params = { + userNumber: options.user, + methodType: "flowGet", + gameId: gameId, + deviceType: "Android", + clientVersion: "8.0100", + }; + let { data } = await axios.request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": useragent, + referer: "https://img.client.10010.com", + origin: "https://img.client.10010.com", + "X-Requested-With": "com.sinovatech.unicom.ui", + }, + url: `/producGameApp`, + method: "post", + data: transParams(params), + }); + if (data) { + console.log(data.msg); + if (data.msg.indexOf("防刷策略接口校验不通过") !== -1) { + throw new Error("出现【防刷策略接口校验不通过】, 取消本次执行"); + } + } else { + console.log("获取奖励失败"); + } + }, + gameIntegralGet: async (axios, options) => { + const { taskCenterId } = options; + const useragent = buildUnicomUserAgent(options, "p"); + let params = { + methodType: "taskGetReward", + taskCenterId: taskCenterId, + deviceType: "Android", + clientVersion: "8.0100", + }; + let { data } = await axios.request({ + headers: { + "user-agent": useragent, + referer: "https://img.client.10010.com", + origin: "https://img.client.10010.com", + }, + url: `https://m.client.10010.com/producGameTaskCenter`, + method: "post", + data: transParams(params), + }); + if (data) { + console.log(data.msg); + if (data.msg.indexOf("防刷策略接口校验不通过") !== -1) { + throw new Error("出现【防刷策略接口校验不通过】, 取消本次执行"); + } + } else { + console.log("获取奖励失败"); + } + }, + gameBox: async (axios, options) => { + let { games: v_games } = await producGame.getTaskList(axios, options); + let box_task = v_games.find((d) => d.id === "98" && d.reachState !== "2"); + if (box_task) { + await producGame.gameIntegralGet(axios, { + ...options, + taskCenterId: box_task.id, + }); + } + }, + watch3TimesVideoQuery: async (request, options) => { + let params = { + arguments1: "AC20200728150217", // acid + arguments2: "GGPD", // yhChannel + arguments3: "96945964804e42299634340cd2650451", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "", + netWay: "Wifi", + version: `android@8.0100`, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + return await require("./taskcallback").query(request, { + ...options, + params, + }); + }, + watch3TimesVideo: async (axios, options) => { + const { jar } = options; + let params = { + arguments1: "AC20200728150217", + arguments2: "GGPD", + arguments3: "96945964804e42299634340cd2650451", + arguments4: new Date().getTime(), + arguments6: "", + arguments7: "", + arguments8: "", + arguments9: "", + netWay: "Wifi", + remark1: "游戏频道看视频得积分", + remark: "游戏视频任务积分", + version: `android@8.0100`, + codeId: 945535736, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + await require("./taskcallback").doTask(axios, { + ...options, + params, + jar, + }); + }, + doTodayDailyTask: async (axios, options) => { + let { games: v_games } = await producGame.getTaskList(axios, options); + let video_task = v_games.find((d) => d.task_type === "video"); + + if (video_task.reachState === "0") { + let n = parseInt(video_task.task) - parseInt(video_task.progress); + console.log("领取视频任务奖励,剩余", n, "次"); + let { jar } = await producGame.watch3TimesVideoQuery(axios, options); + let i = 1; + while (i <= n) { + await producGame.watch3TimesVideo(axios, { + ...options, + jar, + }); + await new Promise((resolve, reject) => + setTimeout(resolve, (Math.floor(Math.random() * 5) + 2) * 200) + ); + await producGame.getTaskList(axios, options); + await producGame.queryIntegral(axios, { + ...options, + taskCenterId: video_task.id, + }); + ++i; + } + } + + let { games } = await producGame.getTaskList(axios, options); + let today_task = games.find((d) => d.task_type === "todayTask"); + if (today_task.reachState === "0") { + throw new Error("部分日常任务未完成,下次再尝试领取完成今日任务流量"); + } else if (today_task.reachState === "1") { + await producGame.gameIntegralGet(axios, { + ...options, + taskCenterId: today_task.id, + }); + console.log("领取完成今日任务流量+200"); + } else if (today_task.reachState === "2") { + console.log("每日日常任务已完成"); + } + }, +}; -module.exports = producGame \ No newline at end of file +module.exports = producGame; From 426681332c84c3eea09caa00ff897e79501cbb01 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Thu, 11 Feb 2021 21:02:17 +0800 Subject: [PATCH 058/128] =?UTF-8?q?=20=F0=9F=90=8D=20=20updated=20UA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/handlers/myPhone.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/commands/tasks/unicom/handlers/myPhone.js b/commands/tasks/unicom/handlers/myPhone.js index 6779c4ca4..57cc4d9e2 100644 --- a/commands/tasks/unicom/handlers/myPhone.js +++ b/commands/tasks/unicom/handlers/myPhone.js @@ -5,6 +5,7 @@ const util = require("util"); * @param {object} options must be included appversion and user */ const useragent = (options) => { + let USER_AGENTS = [...USER_AGENTS_ANDROID, ...USER_AGENTS_IOS]; return util.format( USER_AGENTS[randomNumber(0, USER_AGENTS.length)], options.appversion || "8.0102", @@ -19,16 +20,22 @@ const getCodeId = (useragent) => { }; // `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36;devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:};unicom{version:android@8.0102,desmobile:${options.user}}`; -const USER_AGENTS = [ +const USER_AGENTS_ANDROID = [ "Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@%s,desmobile:%s};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}", "Mozilla/5.0 (Linux; Android 9; MI 6 Build/PKQ1-wesley_iui-19.08.24; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.136 Mobile Safari/537.36; unicom{version:android@%s,desmobile:%s};devicetype{deviceBrand:Xiaomi,deviceModel:MI 6};{yw_code:}", "Mozilla/5.0 (Linux; Android 10; V1981A Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.96 Mobile Safari/537.36; unicom{version:android@%s,desmobile:%s};devicetype{deviceBrand:vivo,deviceModel:V1981A};{yw_code:}", + "Mozilla/5.0 (Linux; Android 9; MI 6 Build/PKQ1.190118.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 Mobile Safari/537.36; unicom{version:android@%s,desmobile:%s};devicetype{deviceBrand:Xiaomi,deviceModel:MI 6};{yw_code:}", //小米6 + "Mozilla/5.0 (Linux; Android 10; EVR-AL00 Build/HUAWEIEVR-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.186 Mobile Safari/537.36; unicom{version:android@%s,desmobile:%s};devicetype{deviceBrand:HUAWEI,deviceModel:EVR-AL00};{yw_code:}", //华为Mate 20 X + "Mozilla/5.0 (Linux; Android 9; JKM-AL00b Build/HUAWEIJKM-AL00b; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/045130 Mobile Safari/537.3; unicom{version:android@%s,desmobile:%s};devicetype{deviceBrand:HUAWEI,deviceModel:JKM-AL00b};{yw_code:}", //华为nova4 + "Mozilla/5.0 (Linux; Android 10; CLT-AL00 Build/HUAWEICLT-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 Mobile Safari/537.36; unicom{version:android@%s,desmobile:%s};devicetype{deviceBrand:HUAWEI,deviceModel:HUAWEICLT-AL00};{yw_code:}", + "Mozilla/5.0 (Linux; Android 8.1.0; PBAM00 Build/OPM1.171019.026; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 Mobile Safari/537.36; unicom{version:android@%s,desmobile:%s};devicetype{deviceBrand:OPPO,deviceModel:PBAM00};{yw_code:}", //OPPO A5 +]; +const USER_AGENTS_IOS = [ "Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 unicom{version:iphone_c@%s,desmobile:%s}{systemVersion:dis}{yw_code:}", "Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 unicom{version:iphone_c@%s,desmobile:%s}{systemVersion:dis}{yw_code:}", "Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 unicom{version:iphone_c@%s,desmobile:%s}{systemVersion:dis}{yw_code:}", "Mozilla/5.0 (iPhone; CPU iPhone OS 12_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 unicom{version:iphone_c@%s,desmobile:%s}{systemVersion:dis}{yw_code:}", ]; - function randomNumber(min = 0, max = 100) { return Math.min(Math.floor(min + Math.random() * (max - min)), max); } From 92a0cb125f92a4cc56e8ed6636e5c9c4bc10c850 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Fri, 12 Feb 2021 14:03:08 +0800 Subject: [PATCH 059/128] =?UTF-8?q?=F0=9F=90=8D=20updating=20task?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/bilibili/dailyTaskStatus.js | 47 +- commands/tasks/unicom/handlers/myPhone.js | 3 +- commands/tasks/unicom/ingotsPage.js | 27 +- commands/tasks/unicom/integral.js | 493 +++++++++++---------- 4 files changed, 315 insertions(+), 255 deletions(-) diff --git a/commands/tasks/bilibili/dailyTaskStatus.js b/commands/tasks/bilibili/dailyTaskStatus.js index ab94c75d2..d2efb8829 100644 --- a/commands/tasks/bilibili/dailyTaskStatus.js +++ b/commands/tasks/bilibili/dailyTaskStatus.js @@ -1,21 +1,30 @@ module.exports = (axios) => { return new Promise((resolve, reject) => { - axios.request({ - headers: { - "referer": "https://account.bilibili.com/account/home", - "origin": "https://www.bilibili.com", - }, - url: 'https://api.bilibili.com/x/member/web/exp/reward', - method:'get' - }).then(res => { - let result = res.data - if (result.code !== 0) { - console.log('获取每日任务状态失败', result.message) - throw new Error('获取每日任务状态失败:' + result.message) - } else { - console.log('获取每日任务状态成功 ', '每日登录+5' + (result.data.login ? '完成' : '未完成'), '每日观看视频+5' + (result.data.watch ? '完成' : '未完成'), '每日投币+50' + (result.data.coins ? '完成' : '未完成'), '每日分享视频+5' + (result.data.share ? '完成' : '未完成')) - resolve(result.data) - } - }).catch(reject) - }) -} \ No newline at end of file + axios + .request({ + headers: { + referer: "https://account.bilibili.com/account/home", + origin: "https://www.bilibili.com", + }, + url: "https://api.bilibili.com/x/member/web/exp/reward", + method: "get", + }) + .then((res) => { + let result = res.data; + if (result.code !== 0) { + console.log("获取每日任务状态失败", result.message); + throw new Error("获取每日任务状态失败:" + result.message); + } else { + console.log( + "获取每日任务状态成功 ", + "每日登录+5" + (result.data.login ? "完成" : "未完成"), + "每日观看视频+5" + (result.data.watch ? "完成" : "未完成"), + "每日投币+50" + (result.data.coins ? "完成" : "未完成"), + "每日分享视频+5" + (result.data.share ? "完成" : "未完成") + ); + resolve(result.data); + } + }) + .catch(reject); + }); +}; diff --git a/commands/tasks/unicom/handlers/myPhone.js b/commands/tasks/unicom/handlers/myPhone.js index 57cc4d9e2..61ab70e73 100644 --- a/commands/tasks/unicom/handlers/myPhone.js +++ b/commands/tasks/unicom/handlers/myPhone.js @@ -5,7 +5,7 @@ const util = require("util"); * @param {object} options must be included appversion and user */ const useragent = (options) => { - let USER_AGENTS = [...USER_AGENTS_ANDROID, ...USER_AGENTS_IOS]; + let USER_AGENTS = [...USER_AGENTS_ANDROID]; return util.format( USER_AGENTS[randomNumber(0, USER_AGENTS.length)], options.appversion || "8.0102", @@ -30,6 +30,7 @@ const USER_AGENTS_ANDROID = [ "Mozilla/5.0 (Linux; Android 10; CLT-AL00 Build/HUAWEICLT-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 Mobile Safari/537.36; unicom{version:android@%s,desmobile:%s};devicetype{deviceBrand:HUAWEI,deviceModel:HUAWEICLT-AL00};{yw_code:}", "Mozilla/5.0 (Linux; Android 8.1.0; PBAM00 Build/OPM1.171019.026; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 Mobile Safari/537.36; unicom{version:android@%s,desmobile:%s};devicetype{deviceBrand:OPPO,deviceModel:PBAM00};{yw_code:}", //OPPO A5 ]; +// eslint-disable-next-line no-unused-vars const USER_AGENTS_IOS = [ "Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 unicom{version:iphone_c@%s,desmobile:%s}{systemVersion:dis}{yw_code:}", "Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 unicom{version:iphone_c@%s,desmobile:%s}{systemVersion:dis}{yw_code:}", diff --git a/commands/tasks/unicom/ingotsPage.js b/commands/tasks/unicom/ingotsPage.js index 0899b61f1..3d718b7eb 100644 --- a/commands/tasks/unicom/ingotsPage.js +++ b/commands/tasks/unicom/ingotsPage.js @@ -129,10 +129,10 @@ let ingotsPage = { arguments8: "123456", arguments9: "4640b530b3f7481bb5821c6871854ce5", netWay: "Wifi", - remark1: "签到看视频得积分2", - remark: "签到看视频得积分2", + remark1: "签到小游戏聚宝盆", + remark: "签到页小游戏", version: `android@8.0102`, - codeId: 945535695, + codeId: 945757409, }; params["sign"] = sign([ params.arguments1, @@ -156,6 +156,7 @@ let ingotsPage = { channelId: "LT_channel", phone: phone, token: ecs_token, + // videoOrderNo: "eef1e9b47e419c37a6cf3029671669a7", videoOrderNo: params["orderId"], sourceCode: "lt_ingots", }; @@ -167,6 +168,7 @@ let ingotsPage = { referer: `https://wxapp.msmds.cn/h5/react_web/unicom/ingotsPage?source=unicom&type=06&ticket=${searchParams.ticket}&version=android@8.0102×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&duanlianjieabc=tbLm0&userNumber=${options.user}`, origin: "https://wxapp.msmds.cn", "Content-Type": "application/x-www-form-urlencoded", + "X-Requested-With": "com.sinovatech.unicom.ui", }, jar: jar1, url: `https://wxapp.msmds.cn/jplus/h5/greetGoldIngot/playAgainByLookingVideos`, @@ -183,15 +185,16 @@ let ingotsPage = { } else { freeTimes--; } - let score = encrypt(randomNumber(12, 20) * 10, "gb6YCccUvth75Tm2"); + let score = encrypt(randomNumber(12, 17) * 10, "gb6YCccUvth75Tm2"); let timestamp = moment().format("YYYYMMDDHHmmss"); let result = await axios.request({ headers: { "user-agent": UA, - referer: `https://wxapp.msmds.cn/h5/react_web/unicom/ingotsPage?source=unicom&type=06&ticket=${searchParams.ticket}&version=iphone_c@8.0102×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&duanlianjieabc=tbLm0&userNumber=${options.user}`, + referer: `https://wxapp.msmds.cn/h5/react_web/unicom/ingotsPage?source=unicom&type=06&ticket=${searchParams.ticket}&version=android@8.0102×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&duanlianjieabc=tbLm0&userNumber=${options.user}`, origin: "https://wxapp.msmds.cn", "Content-Type": "application/x-www-form-urlencoded", jar: jar1, + "X-Requested-With": "com.sinovatech.unicom.ui", }, url: `https://wxapp.msmds.cn/jplus/h5/greetGoldIngot/startGame`, method: "POST", @@ -213,6 +216,13 @@ let ingotsPage = { console.log("😒 聚宝盆游玩获得: ", i["prizeName"]); if (i["recordId"] != null && i["double"]) { console.log("尝试翻倍"); + console.log("😒 聚宝盆游玩翻倍 测试"); + await ingotsPage.postGameDouble(axios, options); + console.log("等待15秒再继续"); + // eslint-disable-next-line no-unused-vars + await new Promise((resolve, reject) => + setTimeout(resolve, 15 * 1000) + ); let recordId = i["recordId"]; let timestamp = moment().format("YYYYMMDDHHmmss"); let result = await axios.request({ @@ -235,13 +245,6 @@ let ingotsPage = { }); console.log(result); data = { double: false }; - console.log("😒 聚宝盆游玩翻倍 测试"); - console.log("等待15秒再继续"); - // eslint-disable-next-line no-unused-vars - await new Promise((resolve, reject) => - setTimeout(resolve, 15 * 1000) - ); - await ingotsPage.postGameDouble(axios, options); } else { console.log("❌ 聚宝盆游玩暂无翻倍"); data = { double: false }; diff --git a/commands/tasks/unicom/integral.js b/commands/tasks/unicom/integral.js index ec57b5d39..afa09e716 100644 --- a/commands/tasks/unicom/integral.js +++ b/commands/tasks/unicom/integral.js @@ -1,333 +1,380 @@ -var crypto = require('crypto'); +var crypto = require("crypto"); var transParams = (data) => { let params = new URLSearchParams(); for (let item in data) { - params.append(item, data['' + item + '']); + params.append(item, data["" + item + ""]); } return params; }; var sign = (data) => { - let str = 'integralofficial&' - let params = [] + let str = "integralofficial&"; + let params = []; data.forEach((v, i) => { if (v) { - params.push('arguments' + (i + 1) + v) + params.push("arguments" + (i + 1) + v); } }); - return crypto.createHash('md5').update(str + params.join('&')).digest('hex') -} + return crypto + .createHash("md5") + .update(str + params.join("&")) + .digest("hex"); +}; var integral = { getflDetail: (axios, options) => { - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} ` + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} `; return new Promise((resolve, reject) => { - axios.request({ - baseURL: 'https://m.client.10010.com/', - headers: { - "user-agent": useragent, - "referer": "https://img.client.10010.com/jifenshangcheng/jifen?loginType=0&scopeType=fl", - "origin": "https://img.client.10010.com" - }, - url: `/welfare-mall-front/mobile/show/flDetail/v1/0`, - method: 'post' - }).then(res => { - let result = res.data - if (result.code !== '0') { - console.log('查询奖励积分失败', result.msg) - } else { - console.log('总奖励积分%s,可用奖励积分%s', result.resdata.score.totalscore, result.resdata.score.availablescore) - } - resolve() - }).catch(reject) - }) + axios + .request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": useragent, + referer: + "https://img.client.10010.com/jifenshangcheng/jifen?loginType=0&scopeType=fl", + origin: "https://img.client.10010.com", + }, + url: `/welfare-mall-front/mobile/show/flDetail/v1/0`, + method: "post", + }) + .then((res) => { + let result = res.data; + if (result.code !== "0") { + console.log("查询奖励积分失败", result.msg); + } else { + console.log( + "总奖励积分%s,可用奖励积分%s", + result.resdata.score.totalscore, + result.resdata.score.availablescore + ); + } + resolve(); + }) + .catch(reject); + }); }, getTxDetail: (axios, options) => { - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} ` + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} `; return new Promise((resolve, reject) => { - axios.request({ - baseURL: 'https://m.client.10010.com/', - headers: { - "user-agent": useragent, - "referer": "https://img.client.10010.com/jifenshangcheng/jifen?loginType=0&scopeType=fl", - "origin": "https://img.client.10010.com" - }, - url: `/welfare-mall-front/mobile/show/txDetail/v1/0`, - method: 'post' - }).then(res => { - let result = res.data - if (result.code !== '0') { - console.log('查询通信积分失败', result.msg) - } else { - console.log('总通信积分%s,可用通信积分%s', result.resdata.score.totalscore, result.resdata.score.availablescore) - } - resolve() - }).catch(reject) - }) + axios + .request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": useragent, + referer: + "https://img.client.10010.com/jifenshangcheng/jifen?loginType=0&scopeType=fl", + origin: "https://img.client.10010.com", + }, + url: `/welfare-mall-front/mobile/show/txDetail/v1/0`, + method: "post", + }) + .then((res) => { + let result = res.data; + if (result.code !== "0") { + console.log("查询通信积分失败", result.msg); + } else { + console.log( + "总通信积分%s,可用通信积分%s", + result.resdata.score.totalscore, + result.resdata.score.availablescore + ); + } + resolve(); + }) + .catch(reject); + }); }, getDxDetail: (axios, options) => { - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} ` + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} `; return new Promise((resolve, reject) => { - axios.request({ - baseURL: 'https://m.client.10010.com/', - headers: { - "user-agent": useragent, - "referer": "https://img.client.10010.com/jifenshangcheng/jifen?loginType=0&scopeType=fl", - "origin": "https://img.client.10010.com" - }, - url: `/welfare-mall-front/mobile/newShow/pointsdetails`, - method: 'post' - }).then(res => { - let result = res.data - if (result.code !== '200') { - console.log('查询定向积分失败', result.msg) - } else { - console.log('总定向积分%s,可用定向积分%s,月到期%s', result.resdata.total, result.resdata.Surplus, result.resdata.expnum) - } - resolve() - }).catch(reject) - }) + axios + .request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": useragent, + referer: + "https://img.client.10010.com/jifenshangcheng/jifen?loginType=0&scopeType=fl", + origin: "https://img.client.10010.com", + }, + url: `/welfare-mall-front/mobile/newShow/pointsdetails`, + method: "post", + }) + .then((res) => { + let result = res.data; + if (result.code !== "200") { + console.log("查询定向积分失败", result.msg); + } else { + console.log( + "总定向积分%s,可用定向积分%s,月到期%s", + result.resdata.total, + result.resdata.Surplus, + result.resdata.expnum + ); + } + resolve(); + }) + .catch(reject); + }); }, addFlow: async (axios, options) => { - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} ` - let i = 1 + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} `; + let i = 1; do { // 签到看视频流量 let { data } = await axios.request({ headers: { "user-agent": useragent, - "referer": "https://act.10010.com/SigninApp/", - "origin": "https://act.10010.com" + referer: "https://act.10010.com/SigninApp/", + origin: "https://act.10010.com", }, url: `https://act.10010.com/SigninApp/mySignin/addFlow`, - method: 'post', - data: 'stepflag=22' - }) + method: "post", + data: "stepflag=22", + }); - if (data.reason === '00') { - console.log('获得流量+', data.addNum) + if (data.reason === "00") { + console.log("获得流量+", data.addNum); } // 签到下载App奖励 let { data: datan } = await axios.request({ headers: { "user-agent": useragent, - "referer": "https://act.10010.com/SigninApp/", - "origin": "https://act.10010.com" + referer: "https://act.10010.com/SigninApp/", + origin: "https://act.10010.com", }, url: `https://act.10010.com/SigninApp/mySignin/addFlow`, - method: 'post', - data: 'stepflag=23' - }) - if (datan.reason === '00') { - console.log('获得流量+', datan.addNum) + method: "post", + data: "stepflag=23", + }); + if (datan.reason === "00") { + console.log("获得流量+", datan.addNum); } - ++i - - } while (i <= 3) + ++i; + } while (i <= 3); }, getCoins: (axios, options) => { - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} ` + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} `; return new Promise((resolve, reject) => { - axios.request({ - baseURL: 'https://act.10010.com/', - headers: { - "user-agent": useragent, - "referer": "https://act.10010.com/SigninApp/signinCoinDetails/jumpCoinDetails.do", - "origin": "https://act.10010.com" - }, - url: `/SigninApp/signin/getGoldTotal`, - method: 'post' - }).then(res => { - let result = res.data - if (result.status !== '0000') { - console.log('查询金币信息失败', result.msg) - } else { - console.log('总金币%s', result.data.goldTotal) - } - resolve() - }).catch(reject) - }) + axios + .request({ + baseURL: "https://act.10010.com/", + headers: { + "user-agent": useragent, + referer: + "https://act.10010.com/SigninApp/signinCoinDetails/jumpCoinDetails.do", + origin: "https://act.10010.com", + }, + url: `/SigninApp/signin/getGoldTotal`, + method: "post", + }) + .then((res) => { + let result = res.data; + if (result.status !== "0000") { + console.log("查询金币信息失败", result.msg); + } else { + console.log("总金币%s", result.data.goldTotal); + } + resolve(); + }) + .catch(reject); + }); }, winterTwoGetIntegral: async (axios, options) => { - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} ` + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} `; let { data: ndata } = await axios.request({ headers: { "user-agent": useragent, - "referer": "https://img.client.10010.com/", - "origin": "https://img.client.10010.com" + referer: "https://img.client.10010.com/", + origin: "https://img.client.10010.com", }, url: `https://m.client.10010.com/welfare-mall-front/mobile/winterTwo/getIntegral/v1`, - method: 'post' - }) + method: "post", + }); - if (ndata.resdata.code !== '0000') { - console.log('东奥积分活动领取失败', ndata.resdata.desc) + if (ndata.resdata.code !== "0000") { + console.log("东奥积分活动领取失败", ndata.resdata.desc); } else { - console.log('东奥积分活动领取成功') + console.log("东奥积分活动领取成功"); } }, winterTwoStatus: (axios, options) => { - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} ` + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} `; return new Promise((resolve, reject) => { - axios.request({ - baseURL: 'https://m.client.10010.com/', - headers: { - "user-agent": useragent, - "referer": "https://img.client.10010.com/", - "origin": "https://img.client.10010.com" - }, - url: `/welfare-mall-front/mobile/winterTwo/winterTwoShop/v1`, - method: 'post' - }).then(res => { - let result = res.data - if (result.resdata.code !== '0000') { - console.log('获取东奥积分活动状态失败', result.resdata.desc) - } else { - console.log('获取东奥积分活动状态成功 已连续领取%s天', result.resdata.signDays) - } - resolve() - }).catch(reject) - }) + axios + .request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": useragent, + referer: "https://img.client.10010.com/", + origin: "https://img.client.10010.com", + }, + url: `/welfare-mall-front/mobile/winterTwo/winterTwoShop/v1`, + method: "post", + }) + .then((res) => { + let result = res.data; + if (result.resdata.code !== "0000") { + console.log("获取东奥积分活动状态失败", result.resdata.desc); + } else { + console.log( + "获取东奥积分活动状态成功 已连续领取%s天", + result.resdata.signDays + ); + } + resolve(); + }) + .catch(reject); + }); }, dxIntegralEveryDay: (axios, options) => { - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} ` + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} `; return new Promise((resolve, reject) => { - axios.request({ - baseURL: 'https://m.client.10010.com/', - headers: { - "user-agent": useragent, - "referer": "https://img.client.10010.com/", - "origin": "https://img.client.10010.com" - }, - url: `/welfare-mall-front/mobile/integral/gettheintegral/v1`, - method: 'post' - }).then(res => { - let result = res.data - if (result.code !== '0') { - console.log('每日定向积分领取失败', result.msg) - } else { - console.log('每日定向积分领取成功') - } - resolve() - }).catch(reject) - }) + axios + .request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": useragent, + referer: "https://img.client.10010.com/", + origin: "https://img.client.10010.com", + }, + url: `/welfare-mall-front/mobile/integral/gettheintegral/v1`, + method: "post", + }) + .then((res) => { + let result = res.data; + if (result.code !== "0") { + console.log("每日定向积分领取失败", result.msg); + } else { + console.log("每日定向积分领取成功"); + } + resolve(); + }) + .catch(reject); + }); }, todaySign: async (axios, options) => { - const useragent = `okhttp/4.4.0` + const useragent = `okhttp/4.4.0`; let { data } = await axios.request({ - baseURL: 'https://act.10010.com/', + baseURL: "https://act.10010.com/", headers: { "user-agent": useragent, - "referer": "https://img.client.10010.com", - "origin": "https://img.client.10010.com" + referer: "https://img.client.10010.com", + origin: "https://img.client.10010.com", }, url: `/SigninApp/signin/todaySign`, - method: 'post' - }) - if (data.status = '0000') { - console.log('翻倍签到成功') + method: "post", + }); + if ((data.status = "0000")) { + console.log("翻倍签到成功"); } else { - console.log('翻倍签到失败') + console.log("翻倍签到失败"); } }, gamebox: async (axios, options) => { - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} ` + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} `; let params = { - 'methodType': 'reward', - 'deviceType': 'Android', - 'clientVersion': '8.0100', - 'isVideo': 'N' - } + methodType: "reward", + deviceType: "Android", + clientVersion: "8.0100", + isVideo: "N", + }; let { data, config } = await axios.request({ - baseURL: 'https://m.client.10010.com/', + baseURL: "https://m.client.10010.com/", headers: { "user-agent": useragent, - "referer": "https://img.client.10010.com", - "origin": "https://img.client.10010.com" + referer: "https://img.client.10010.com", + origin: "https://img.client.10010.com", }, url: `/game_box`, - method: 'post', - data: transParams(params) - }) + method: "post", + data: transParams(params), + }); if (data) { - if (data.code !== '0000') { - console.log(data.desc) + if (data.code !== "0000") { + console.log(data.desc); } else { - console.log('宝箱领取成功', data.desc) - if (data.flag === 'N' && data.data.secondState !== 'Y') { + console.log("宝箱领取成功", data.desc); + if (data.flag === "N" && data.data.secondState !== "Y") { await integral.gameboxVideo(axios, { ...options, - jar: config.jar - }) + jar: config.jar, + }); } } } else { - console.log('宝箱领取失败') + console.log("宝箱领取失败"); } }, gameboxVideo: async (axios, options) => { - const { jar } = options - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} ` + const { jar } = options; + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} `; let params = { - 'arguments1': 'AC20200728150217', - 'arguments2': 'GGPD', - 'arguments3': '528a06737ac24317a3166027c1e3fe06', - 'arguments4': new Date().getTime(), - 'arguments6': '', - 'arguments7': '', - 'arguments8': '', - 'arguments9': '', - 'netWay': 'Wifi', - 'remark1': '游戏视频广告积分', - 'remark': '游戏视频广告积分', - 'version': `android@8.0100`, - 'codeId': 945510695 - } + arguments1: "AC20200728150217", + arguments2: "GGPD", + arguments3: "528a06737ac24317a3166027c1e3fe06", + arguments4: new Date().getTime(), + arguments6: "", + arguments7: "", + arguments8: "", + arguments9: "", + netWay: "Wifi", + remark1: "游戏视频广告积分", + remark: "游戏视频广告积分", + version: `android@8.0100`, + codeId: 945510695, + }; - params['sign'] = sign([params.arguments1, params.arguments2, params.arguments3, params.arguments4]) - params['orderId'] = crypto.createHash('md5').update(new Date().getTime() + '').digest('hex') - params['arguments4'] = new Date().getTime() + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + params["orderId"] = crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"); + params["arguments4"] = new Date().getTime(); - await require('./taskcallback').reward(axios, { + await require("./taskcallback").reward(axios, { ...options, params, - jar - }) + jar, + }); params = { - 'methodType': 'reward', - 'deviceType': 'Android', - 'clientVersion': '8.0100', - 'isVideo': 'Y' - } + methodType: "reward", + deviceType: "Android", + clientVersion: "8.0100", + isVideo: "Y", + }; let { data } = await axios.request({ - baseURL: 'https://m.client.10010.com/', + baseURL: "https://m.client.10010.com/", headers: { "user-agent": useragent, - "referer": "https://img.client.10010.com", - "origin": "https://img.client.10010.com" + referer: "https://img.client.10010.com", + origin: "https://img.client.10010.com", }, url: `/game_box`, - method: 'post', - data: transParams(params) - }) + method: "post", + data: transParams(params), + }); if (data) { - if (data.code !== '0000') { - console.log(data.desc) + if (data.code !== "0000") { + console.log(data.desc); } else { - console.log('视频宝箱领取成功', data.desc) + console.log("视频宝箱领取成功", data.desc); } } else { - console.log('视频宝箱领取失败') + console.log("视频宝箱领取失败"); } - - } -} -module.exports = integral \ No newline at end of file + }, +}; +module.exports = integral; From 0f0f14db7143f2a44970973c42f2e1ff8649d665 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Fri, 12 Feb 2021 17:00:58 +0800 Subject: [PATCH 060/128] =?UTF-8?q?=F0=9F=90=8D=20updating=20task?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/52pojie.js | 92 ++++----- commands/tasks/52pojie/52pojie.js | 49 +++-- commands/tasks/unicom/freeDownFloorAd.js | 238 +++++++++++++++++++++++ commands/tasks/unicom/unicom.js | 9 + commands/wps.js | 122 ++++++------ 5 files changed, 386 insertions(+), 124 deletions(-) create mode 100644 commands/tasks/unicom/freeDownFloorAd.js diff --git a/commands/52pojie.js b/commands/52pojie.js index 104b48daa..4cb064404 100644 --- a/commands/52pojie.js +++ b/commands/52pojie.js @@ -1,68 +1,72 @@ +const path = require("path"); +const { scheduler } = require("../utils/scheduler"); -const path = require('path') -const { scheduler } = require('../utils/scheduler') +exports.command = "52pojie"; -exports.command = '52pojie' - -exports.describe = '52pojie签到任务' +exports.describe = "52pojie签到任务"; exports.builder = function (yargs) { return yargs - .option('htVD_2132_auth', { - describe: 'cookie项htVD_2132_auth的值', - type: 'string' + .option("htVD_2132_auth", { + describe: "cookie项htVD_2132_auth的值", + type: "string", }) - .option('htVD_2132_saltkey', { - describe: 'cookie项htVD_2132_saltkey的值', - type: 'string' + .option("htVD_2132_saltkey", { + describe: "cookie项htVD_2132_saltkey的值", + type: "string", }) .help() - .showHelpOnFail(true, '使用--help查看有效选项') - .epilog('copyright 2020 LunnLew'); -} + .showHelpOnFail(true, "使用--help查看有效选项") + .epilog("copyright 2020 LunnLew"); +}; exports.handler = async function (argv) { - var command = argv._[0] - var accounts = [] - if ('accountSn' in argv && argv.accountSn) { - let accountSns = argv.accountSn.split(',') + var command = argv._[0]; + var accounts = []; + if ("accountSn" in argv && argv.accountSn) { + let accountSns = argv.accountSn.split(","); for (let sn of accountSns) { - if (('htVD_2132_auth-' + sn) in argv) { + if ("htVD_2132_auth-" + sn in argv) { let account = { - htVD_2132_auth: argv['htVD_2132_auth-' + sn], - htVD_2132_saltkey: argv['htVD_2132_saltkey-' + sn], - tasks: argv['tasks-' + sn] - } - if (('tryrun-' + sn) in argv) { - account['tryrun'] = true + htVD_2132_auth: argv["htVD_2132_auth-" + sn], + htVD_2132_saltkey: argv["htVD_2132_saltkey-" + sn], + tasks: argv["tasks-" + sn], + }; + if ("tryrun-" + sn in argv) { + account["tryrun"] = true; } - accounts.push(account) + accounts.push(account); } } } else { accounts.push({ - ...argv - }) + ...argv, + }); } - console.log('总账户数', accounts.length) + console.log("总账户数", accounts.length); for (let account of accounts) { - await require(path.join(__dirname, 'tasks', command, command)).start({ - cookies: { - htVD_2132_auth: account.htVD_2132_auth, - htVD_2132_saltkey: account.htVD_2132_saltkey - }, - options: {} - }).catch(err => console.log("52pojie签到任务:", err.message)) + await require(path.join(__dirname, "tasks", command, command)) + .start({ + cookies: { + htVD_2132_auth: account.htVD_2132_auth, + htVD_2132_saltkey: account.htVD_2132_saltkey, + }, + options: {}, + }) + .catch((err) => console.log("52pojie签到任务:", err.message)); let hasTasks = await scheduler.hasWillTask(command, { - tryrun: 'tryrun' in argv, - taskKey: account.htVD_2132_auth - }) + tryrun: "tryrun" in argv, + taskKey: account.htVD_2132_auth, + }); if (hasTasks) { - scheduler.execTask(command, account.tasks).catch(err => console.log("52pojie签到任务:", err.message)).finally(() => { - console.log('当前任务执行完毕!') - }) + scheduler + .execTask(command, account.tasks) + .catch((err) => console.log("52pojie签到任务:", err.message)) + .finally(() => { + console.log("当前任务执行完毕!"); + }); } else { - console.log('暂无可执行任务!') + console.log("暂无可执行任务!"); } } -} \ No newline at end of file +}; diff --git a/commands/tasks/52pojie/52pojie.js b/commands/tasks/52pojie/52pojie.js index 1a5689010..2e3a31b11 100644 --- a/commands/tasks/52pojie/52pojie.js +++ b/commands/tasks/52pojie/52pojie.js @@ -1,35 +1,42 @@ -const _request = require('../../../utils/request') -const { scheduler } = require('../../../utils/scheduler') +const _request = require("../../../utils/request"); +const { scheduler } = require("../../../utils/scheduler"); var start = async (params) => { - const { cookies, options } = params + const { cookies, options } = params; let init = async (request, savedCookies) => { if (!savedCookies) { - if (!cookies || !('htVD_2132_auth' in cookies) || !cookies['htVD_2132_auth']) { - throw new Error("需要提供htVD_2132_auth参数") + if ( + !cookies || + !("htVD_2132_auth" in cookies) || + !cookies["htVD_2132_auth"] + ) { + throw new Error("需要提供htVD_2132_auth参数"); } - if (!('htVD_2132_saltkey' in cookies) || !cookies['htVD_2132_saltkey']) { - throw new Error("需要提供htVD_2132_saltkey参数") + if (!("htVD_2132_saltkey" in cookies) || !cookies["htVD_2132_saltkey"]) { + throw new Error("需要提供htVD_2132_saltkey参数"); } return { - request: _request(cookies) - } + request: _request(cookies), + }; } else { return { - request - } + request, + }; } - } + }; let taskOption = { - init - } - - await scheduler.regTask('dailySign', async (request) => { - await require('./sign')(request) - }, taskOption) + init, + }; -} + await scheduler.regTask( + "dailySign", + async (request) => { + await require("./sign")(request); + }, + taskOption + ); +}; module.exports = { - start -} \ No newline at end of file + start, +}; diff --git a/commands/tasks/unicom/freeDownFloorAd.js b/commands/tasks/unicom/freeDownFloorAd.js new file mode 100644 index 000000000..5cee5260f --- /dev/null +++ b/commands/tasks/unicom/freeDownFloorAd.js @@ -0,0 +1,238 @@ +let crypto = require("crypto"); +let moment = require("moment"); +let { encryptPhone, sign, encrypt } = require("./handlers/PAES.js"); +const { useragent, randomNumber } = require("./handlers/myPhone"); +const gameEvents = require("./handlers/dailyEvent"); +let { transParams } = require("./handlers/gameUtils"); +const appList = [ + { + mMainTitle: "线上桌游吧,随时随地玩桌游", + mSubTitle: "会玩", + mPkgName: "com.wepie.weplay", + }, +]; + +let Data = { + commonInfo: { + traceId: "10000820210212012126257215774155", + currentTime: "20210212012126257", + channelCode: "100008", + }, + params: { + serialNumber: "", + appList: [], + operator: "onAdClick", + }, + methodType: "2", +}; + +let freeDownFloorAd = { + doTask: async (axios, options) => { + // 10000820210212140437577215167304 + //"10000820210212155412093 215210247", + // "20210212155412093", + let currentTime = moment().format("YYYYMMDDHHmmssSSS"); + let traceId = "100008" + currentTime + "215210247"; + Data.commonInfo.traceId = traceId; + Data.commonInfo.currentTime = currentTime; + Data.params.serialNumber = options.user; + Data.params.appList.push(appList[0]); + let jar1 = await freeDownFloorAd.onAdDisplay(axios, options, Data); + await freeDownFloorAd.onAdClick(axios, options, Data); + await freeDownFloorAd.findAll(axios, options); + await freeDownFloorAd.onAdAppDownloadStart(axios, options, Data); + await freeDownFloorAd.onAdAppDownloadSucceed(axios, options, Data); + await freeDownFloorAd.onAdAppInstall(axios, options, Data); + await freeDownFloorAd.onAdAppActive(axios, options, Data); + await freeDownFloorAd.getIntegralFree(axios, options, jar1); + await freeDownFloorAd.onAdDisplay(axios, options, Data); + }, + onAdDisplay: async (axios, options, appinfo) => { + let currentTime = moment().format("YYYYMMDDHHmmssSSS"); + let traceId = "100008" + currentTime + "215210247"; + appinfo.commonInfo.traceId = traceId; + appinfo.commonInfo.currentTime = currentTime; + appinfo.params.operator = "onAdDisplay"; + let res = await axios + .request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": "okhttp/4.4.0", + origin: "https://m.client.10010.com/", + "Content-Type": "application/json;charset=UTF-8", + }, + url: `/uniAdmsInterface/getFreeDownFloorAd`, + method: "post", + data: appinfo, + }) + .catch((err) => console.log(err)); + let jar1 = res.config.jar.toJSON(); + jar1.cookies.push({ + key: "req_wheel", + value: "ssss", + expires: "2021-02-13T09:43:35.000Z", + domain: "10010.com", + path: "/", + hostOnly: false, + creation: "2021-02-12T08:43:35.008Z", + lastAccessed: "2021-02-12T08:43:35.008Z", + }); + console.log(res.data); + console.log("等待15秒再继续"); + // eslint-disable-next-line no-unused-vars + await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); + return jar1; + }, + findAll: async (axios, options) => { + let res = await axios + .request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": "okhttp/4.4.0", + "Content-Type": "application/json;charset=UTF-8", + }, + url: `/mobileService/downloads/findAll.htm`, + method: "post", + }) + .catch((err) => console.log(err)); + console.log(res.data); + }, + onAdClick: async (axios, options, appinfo) => { + let currentTime = moment().format("YYYYMMDDHHmmssSSS"); + let traceId = "100008" + currentTime + "215210247"; + appinfo.commonInfo.traceId = traceId; + appinfo.commonInfo.currentTime = currentTime; + appinfo.params.operator = "onAdClick"; + let res = await axios + .request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": "okhttp/4.4.0", + origin: "https://m.client.10010.com", + "Content-Type": "application/json;charset=UTF-8", + }, + url: `/uniAdmsInterface/getFreeDownFloorAd`, + method: "post", + data: appinfo, + }) + .catch((err) => console.log(err)); + console.log(res.data); + console.log("等待15秒再继续"); + // eslint-disable-next-line no-unused-vars + await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); + }, + onAdAppDownloadStart: async (axios, options, appinfo) => { + let currentTime = moment().format("YYYYMMDDHHmmssSSS"); + let traceId = "100008" + currentTime + "215210247"; + appinfo.commonInfo.traceId = traceId; + appinfo.commonInfo.currentTime = currentTime; + appinfo.params.operator = "onAdAppDownloadStart"; + let res = await axios + .request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": "okhttp/4.4.0", + origin: "https://m.client.10010.com", + "Content-Type": "application/json;charset=UTF-8", + }, + url: `/uniAdmsInterface/getFreeDownFloorAd`, + method: "post", + data: appinfo, + }) + .catch((err) => console.log(err)); + console.log(res.data); + console.log("等待15秒再继续"); + // eslint-disable-next-line no-unused-vars + await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); + }, + onAdAppDownloadSucceed: async (axios, options, appinfo) => { + let currentTime = moment().format("YYYYMMDDHHmmssSSS"); + let traceId = "100008" + currentTime + "215210247"; + appinfo.commonInfo.traceId = traceId; + appinfo.commonInfo.currentTime = currentTime; + appinfo.params.operator = "onAdAppDownloadSucceed"; + let res = await axios + .request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": "okhttp/4.4.0", + origin: "https://m.client.10010.com", + "Content-Type": "application/json;charset=UTF-8", + }, + url: `/uniAdmsInterface/getFreeDownFloorAd`, + method: "post", + data: appinfo, + }) + .catch((err) => console.log(err)); + console.log(res.data); + console.log("等待15秒再继续"); + // eslint-disable-next-line no-unused-vars + await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); + }, + onAdAppInstall: async (axios, options, appinfo) => { + let currentTime = moment().format("YYYYMMDDHHmmssSSS"); + let traceId = "100008" + currentTime + "215210247"; + appinfo.commonInfo.traceId = traceId; + appinfo.commonInfo.currentTime = currentTime; + appinfo.params.operator = "onAdAppInstall"; + let res = await axios + .request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": "okhttp/4.4.0", + origin: "https://m.client.10010.com", + "Content-Type": "application/json;charset=UTF-8", + }, + url: `/uniAdmsInterface/getFreeDownFloorAd`, + method: "post", + data: appinfo, + }) + .catch((err) => console.log(err)); + console.log(res.data); + console.log("等待15秒再继续"); + // eslint-disable-next-line no-unused-vars + await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); + }, + onAdAppActive: async (axios, options, appinfo) => { + let currentTime = moment().format("YYYYMMDDHHmmssSSS"); + let traceId = "100008" + currentTime + "215210247"; + appinfo.commonInfo.traceId = traceId; + appinfo.commonInfo.currentTime = currentTime; + appinfo.params.operator = "onAdAppActive"; + let res = await axios + .request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": "okhttp/4.4.0", + origin: "https://m.client.10010.com", + "Content-Type": "application/json;charset=UTF-8", + }, + url: `/uniAdmsInterface/getFreeDownFloorAd`, + method: "post", + data: appinfo, + }) + .catch((err) => console.log(err)); + console.log(res.data); + console.log("等待15秒再继续"); + // eslint-disable-next-line no-unused-vars + await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); + }, + getIntegralFree: async (axios, options, jar) => { + let res = await axios + .request({ + headers: { + "user-agent": useragent(options), + origin: "https://img.client.10010.com", + "Content-Type": "application/x-www-form-urlencoded", + Cookie: "req_wheel=ssss;", + }, + url: `https://act.10010.com/SigninApp/floorData/getIntegralFree`, + method: "post", + Referer: `https://img.client.10010.com/SigininApp/index.html?yw_code=&desmobile=${options.user}&version=android@8.0102`, + "X-Requested-With": "com.sinovatech.unicom.ui", + }) + .catch((err) => console.log(err)); + console.log(res.data); + }, +}; +module.exports = freeDownFloorAd; diff --git a/commands/tasks/unicom/unicom.js b/commands/tasks/unicom/unicom.js index a597797f9..2a5461886 100644 --- a/commands/tasks/unicom/unicom.js +++ b/commands/tasks/unicom/unicom.js @@ -399,6 +399,15 @@ var start = async (params) => { }, taskOption ); + + //首页-下载app + await scheduler.regTask( + "freeDownFloorAd", + async (request) => { + await require("./freeDownFloorAd.js").doTask(request, options); + }, + taskOption + ); }; module.exports = { start, diff --git a/commands/wps.js b/commands/wps.js index 747f315f3..0a378d4de 100644 --- a/commands/wps.js +++ b/commands/wps.js @@ -1,68 +1,72 @@ +const path = require("path"); +const { scheduler } = require("../utils/scheduler"); -const path = require('path') -const { scheduler } = require('../utils/scheduler') +exports.command = "wps"; -exports.command = 'wps' - -exports.describe = 'wps签到任务' +exports.describe = "wps签到任务"; exports.builder = function (yargs) { - return yargs - .option('wps_sid', { - describe: 'cookie项wps_sid的值', - type: 'string' - }) - .option('csrf', { - describe: 'cookie项csrf的值', - type: 'string' - }) - .help() - .showHelpOnFail(true, '使用--help查看有效选项') - .epilog('copyright 2020 LunnLew'); -} + return yargs + .option("wps_sid", { + describe: "cookie项wps_sid的值", + type: "string", + }) + .option("csrf", { + describe: "cookie项csrf的值", + type: "string", + }) + .help() + .showHelpOnFail(true, "使用--help查看有效选项") + .epilog("copyright 2020 LunnLew"); +}; exports.handler = async function (argv) { - var command = argv._[0] - var accounts = [] - if ('accountSn' in argv && argv.accountSn) { - let accountSns = argv.accountSn.split(',') - for (let sn of accountSns) { - if (('wps_sid-' + sn) in argv) { - let account = { - wps_sid: argv['wps_sid-' + sn], - csrf: argv['csrf-' + sn], - tasks: argv['tasks-' + sn] - } - if (('tryrun-' + sn) in argv) { - account['tryrun'] = true - } - accounts.push(account) - } + var command = argv._[0]; + var accounts = []; + if ("accountSn" in argv && argv.accountSn) { + let accountSns = argv.accountSn.split(","); + for (let sn of accountSns) { + if ("wps_sid-" + sn in argv) { + let account = { + wps_sid: argv["wps_sid-" + sn], + csrf: argv["csrf-" + sn], + tasks: argv["tasks-" + sn], + }; + if ("tryrun-" + sn in argv) { + account["tryrun"] = true; } - } else { - accounts.push({ - ...argv - }) + accounts.push(account); + } } - console.log('总账户数', accounts.length) - for (let account of accounts) { - await require(path.join(__dirname, 'tasks', command, command)).start({ - cookies: { - wps_sid: account.wps_sid, - csrf: account.csrf, - }, - options: {} - }).catch(err => console.log("wps签到任务:", err.message)) - let hasTasks = await scheduler.hasWillTask(command, { - tryrun: 'tryrun' in argv, - taskKey: account.wps_sid - }) - if (hasTasks) { - scheduler.execTask(command, account.tasks).catch(err => console.log("wps签到任务:", err.message)).finally(() => { - console.log('当前任务执行完毕!') - }) - } else { - console.log('暂无可执行任务!') - } + } else { + accounts.push({ + ...argv, + }); + } + console.log("总账户数", accounts.length); + for (let account of accounts) { + await require(path.join(__dirname, "tasks", command, command)) + .start({ + cookies: { + wps_sid: account.wps_sid, + csrf: account.csrf, + }, + options: {}, + }) + .catch((err) => console.log("wps签到任务:", err.message)); + let hasTasks = await scheduler.hasWillTask(command, { + tryrun: "tryrun" in argv, + taskKey: account.wps_sid, + }); + if (hasTasks) { + scheduler + .execTask(command, account.tasks) + .catch((err) => console.log("wps签到任务:", err.message)) + .finally(() => { + console.log("当前任务执行完毕!"); + }); + } else { + console.log("暂无可执行任务!"); } -} \ No newline at end of file + } +}; From 22f89cb44040f199ae7c6f9af8ff98ab189036de Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Fri, 12 Feb 2021 17:57:12 +0800 Subject: [PATCH 061/128] Update ingotsPage.js --- commands/tasks/unicom/ingotsPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/tasks/unicom/ingotsPage.js b/commands/tasks/unicom/ingotsPage.js index 3d718b7eb..f23b5c37a 100644 --- a/commands/tasks/unicom/ingotsPage.js +++ b/commands/tasks/unicom/ingotsPage.js @@ -243,7 +243,7 @@ let ingotsPage = { sourceCode: "lt_ingots", }), }); - console.log(result); + console.log(result.data); data = { double: false }; } else { console.log("❌ 聚宝盆游玩暂无翻倍"); From de8c736f59a168ca6ac700ae275962b1df700c4d Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Fri, 12 Feb 2021 20:02:31 +0800 Subject: [PATCH 062/128] =?UTF-8?q?=F0=9F=9A=A7=20updating=20task?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/freeDownFloorAd.js | 37 ++++++++++++++++++++++++ commands/tasks/unicom/taskcallback.js | 2 ++ 2 files changed, 39 insertions(+) diff --git a/commands/tasks/unicom/freeDownFloorAd.js b/commands/tasks/unicom/freeDownFloorAd.js index 5cee5260f..300cdab3f 100644 --- a/commands/tasks/unicom/freeDownFloorAd.js +++ b/commands/tasks/unicom/freeDownFloorAd.js @@ -44,6 +44,7 @@ let freeDownFloorAd = { await freeDownFloorAd.onAdAppDownloadSucceed(axios, options, Data); await freeDownFloorAd.onAdAppInstall(axios, options, Data); await freeDownFloorAd.onAdAppActive(axios, options, Data); + await freeDownFloorAd.lookVideoDouble(axios, options); await freeDownFloorAd.getIntegralFree(axios, options, jar1); await freeDownFloorAd.onAdDisplay(axios, options, Data); }, @@ -234,5 +235,41 @@ let freeDownFloorAd = { .catch((err) => console.log(err)); console.log(res.data); }, + lookVideoDouble: gameEvents.lookVideoDouble( + { + arguments1: "AC20200624091508", + arguments2: "GGPD", + arguments3: "f65cd1e62af1407f88b069c0ffd4e1d8", + arguments4: new Date().getTime(), + arguments6: "517050707", + arguments7: "517050707", + arguments8: "123456", + arguments9: "4640b530b3f7481bb5821c6871854ce5", + netWay: "Wifi", + remark1: "签到任务下载应用得积分", + remark: "签到任务下载应用得积分", + version: `android@8.0102`, + codeId: 812759, + }, + { + arguments1: "AC20200624091508", // acid + arguments2: "GGPD", // yhChannel + arguments3: "f65cd1e62af1407f88b069c0ffd4e1d8", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "517050707", + arguments7: "517050707", + arguments8: "123456", + arguments9: "4640b530b3f7481bb5821c6871854ce5", + orderId: crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"), + netWay: "Wifi", + remark: "签到任务下载应用得积分", + version: `android@8.0102`, + codeId: 812759, + }, + "任务下载应用得积分" + ), }; module.exports = freeDownFloorAd; diff --git a/commands/tasks/unicom/taskcallback.js b/commands/tasks/unicom/taskcallback.js index 69eeb1de5..f3b058ea1 100644 --- a/commands/tasks/unicom/taskcallback.js +++ b/commands/tasks/unicom/taskcallback.js @@ -55,6 +55,7 @@ var taskcallback = { method: "POST", data: transParams(params), }); + console.log(data); if (data.code === "0000") { console.log( data.timeflag === "1" @@ -225,6 +226,7 @@ var taskcallback = { method: "POST", data: transParams(params), }); + console.log(data); if (data.code === "0000") { console.log("提交任务成功", data.prizeName + "+" + data.prizeCount); } else { From 8cdd8ad6c06a4242e111f0591d33ca02ba705a5c Mon Sep 17 00:00:00 2001 From: cooip-jm <78735965+cooip-jm@users.noreply.github.com> Date: Fri, 12 Feb 2021 20:22:48 +0800 Subject: [PATCH 063/128] Update myPhone.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 低版本系统屏蔽 --- commands/tasks/unicom/handlers/myPhone.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/tasks/unicom/handlers/myPhone.js b/commands/tasks/unicom/handlers/myPhone.js index 61ab70e73..10a1478c8 100644 --- a/commands/tasks/unicom/handlers/myPhone.js +++ b/commands/tasks/unicom/handlers/myPhone.js @@ -21,7 +21,7 @@ const getCodeId = (useragent) => { // `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36;devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:};unicom{version:android@8.0102,desmobile:${options.user}}`; const USER_AGENTS_ANDROID = [ - "Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@%s,desmobile:%s};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}", + // "Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@%s,desmobile:%s};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}", "Mozilla/5.0 (Linux; Android 9; MI 6 Build/PKQ1-wesley_iui-19.08.24; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.136 Mobile Safari/537.36; unicom{version:android@%s,desmobile:%s};devicetype{deviceBrand:Xiaomi,deviceModel:MI 6};{yw_code:}", "Mozilla/5.0 (Linux; Android 10; V1981A Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.96 Mobile Safari/537.36; unicom{version:android@%s,desmobile:%s};devicetype{deviceBrand:vivo,deviceModel:V1981A};{yw_code:}", "Mozilla/5.0 (Linux; Android 9; MI 6 Build/PKQ1.190118.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 Mobile Safari/537.36; unicom{version:android@%s,desmobile:%s};devicetype{deviceBrand:Xiaomi,deviceModel:MI 6};{yw_code:}", //小米6 From a3f33e82dd2dc31b7c8bdafd8e020a5fa4adc369 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Sat, 13 Feb 2021 00:53:59 +0800 Subject: [PATCH 064/128] =?UTF-8?q?=F0=9F=8F=B3=E2=80=8D=F0=9F=8C=88=20upd?= =?UTF-8?q?ated=20task=20ingots?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/dailyVideoFreeGoods.js | 290 +++++++++++-------- commands/tasks/unicom/handlers/dailyEvent.js | 6 + commands/tasks/unicom/ingotsPage.js | 14 +- 3 files changed, 177 insertions(+), 133 deletions(-) diff --git a/commands/tasks/unicom/dailyVideoFreeGoods.js b/commands/tasks/unicom/dailyVideoFreeGoods.js index 1f02831bc..7828fefee 100644 --- a/commands/tasks/unicom/dailyVideoFreeGoods.js +++ b/commands/tasks/unicom/dailyVideoFreeGoods.js @@ -1,59 +1,64 @@ -var crypto = require('crypto'); -var moment = require('moment'); +var crypto = require("crypto"); +var moment = require("moment"); // 签到小游戏买什么都省免费夺宝 var transParams = (data) => { let params = new URLSearchParams(); for (let item in data) { - params.append(item, data['' + item + '']); + params.append(item, data["" + item + ""]); } return params; }; var sign = (data) => { - let str = 'integralofficial&' - let params = [] + let str = "integralofficial&"; + let params = []; data.forEach((v, i) => { if (v) { - params.push('arguments' + (i + 1) + v) + params.push("arguments" + (i + 1) + v); } }); - return crypto.createHash('md5').update(str + params.join('&')).digest('hex') -} + return crypto + .createHash("md5") + .update(str + params.join("&")) + .digest("hex"); +}; -function encryption (data, key) { +function encryption(data, key) { var iv = ""; - var cipherEncoding = 'base64'; - var cipher = crypto.createCipheriv('aes-128-ecb', key, iv); + var cipherEncoding = "base64"; + var cipher = crypto.createCipheriv("aes-128-ecb", key, iv); cipher.setAutoPadding(true); - return Buffer.concat([cipher.update(data), cipher.final()]).toString(cipherEncoding); + return Buffer.concat([cipher.update(data), cipher.final()]).toString( + cipherEncoding + ); } var dailyVideoFreeGoods = { getGoodsList: async (axios, options) => { - const { token } = options - let phone = encryption(options.user, 'gb6YCccUvth75Tm2') - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} ` + const { token } = options; + let phone = encryption(options.user, "gb6YCccUvth75Tm2"); + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} `; let res = await axios.request({ headers: { "user-agent": useragent, - "referer": `https://wxapp.msmds.cn/`, - "origin": "https://wxapp.msmds.cn" + referer: `https://wxapp.msmds.cn/`, + origin: "https://wxapp.msmds.cn", }, url: `https://wxapp.msmds.cn/jplus/api/channel/integral/free/goods/findAll`, - method: 'POST', + method: "POST", data: transParams({ - 'fromType': '22', - 'status': '0', - 'pageNo': '1', - 'pageSize': '10', - 'channelId': 'LT_channel', - 'phone': phone, - 'token': token, - 'sourceCode': 'lt_freeTake' - }) - }) - let result = res.data + fromType: "22", + status: "0", + pageNo: "1", + pageSize: "10", + channelId: "LT_channel", + phone: phone, + token: token, + sourceCode: "lt_freeTake", + }), + }); + let result = res.data; return { goods: result.data.goodsList.data, freeTimes: result.data.freeTimes, @@ -61,146 +66,181 @@ var dailyVideoFreeGoods = { time: result.data.time, getFreeTime: result.data.getFreeTime, sameGoodsMaxTimes: result.data.sameGoodsMaxTimes, - } + }; }, doTask: async (axios, options) => { - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}` - let searchParams = {} - let result = await axios.request({ - baseURL: 'https://m.client.10010.com/', - headers: { - "user-agent": useragent, - "referer": `https://img.client.10010.com/`, - "origin": "https://img.client.10010.com" - }, - url: `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://wxapp.msmds.cn/h5/react_web/unicom/freeTakePage`, - method: 'get', - transformResponse: (data, headers) => { - if ('location' in headers) { - let uu = new URL(headers.location) - let pp = {} - for (let p of uu.searchParams) { - pp[p[0]] = p[1] - } - if ('ticket' in pp) { - searchParams = pp + const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; + let searchParams = {}; + let result = await axios + .request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": useragent, + referer: `https://img.client.10010.com/`, + origin: "https://img.client.10010.com", + }, + url: `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://wxapp.msmds.cn/h5/react_web/unicom/freeTakePage`, + method: "get", + transformResponse: (data, headers) => { + if ("location" in headers) { + let uu = new URL(headers.location); + let pp = {}; + for (let p of uu.searchParams) { + pp[p[0]] = p[1]; + } + if ("ticket" in pp) { + searchParams = pp; + } } - } - return data - } - }).catch(err => console.log(err)) + return data; + }, + }) + .catch((err) => console.log(err)); - let jar1 = result.config.jar - let cookiesJson = jar1.toJSON() - let ecs_token = cookiesJson.cookies.find(i => i.key == 'ecs_token') + let jar1 = result.config.jar; + let cookiesJson = jar1.toJSON(); + let ecs_token = cookiesJson.cookies.find((i) => i.key == "ecs_token"); if (!ecs_token) { - throw new Error('ecs_token缺失') + throw new Error("ecs_token缺失"); } - ecs_token = ecs_token.value - let { goods, freeTimes, leftTimes, time, getFreeTime, sameGoodsMaxTimes } = await dailyVideoFreeGoods.getGoodsList(axios, { + ecs_token = ecs_token.value; + let { + goods, + freeTimes, + leftTimes, + time, + getFreeTime, + sameGoodsMaxTimes, + } = await dailyVideoFreeGoods.getGoodsList(axios, { ...options, - token: ecs_token - }) - console.log('签到小游戏买什么都省免费夺宝', `剩余机会(${leftTimes}/${freeTimes})`) + token: ecs_token, + }); + console.log( + "签到小游戏买什么都省免费夺宝", + `剩余机会(${leftTimes}/${freeTimes})` + ); if (!leftTimes) { if (time) { - console.log(`签到小游戏买什么都省免费夺宝: 剩余机会不足,等待下一轮,` + moment().add(time, 'seconds').format('YYYY-MM-DD HH:mm:ss') + ' 后可再次尝试') + console.log( + `签到小游戏买什么都省免费夺宝: 剩余机会不足,等待下一轮,` + + moment().add(time, "seconds").format("YYYY-MM-DD HH:mm:ss") + + " 后可再次尝试" + ); } } let params = { - 'arguments1': '', - 'arguments2': '', - 'arguments3': '', - 'arguments4': new Date().getTime(), - 'arguments6': '', - 'arguments7': '', - 'arguments8': '', - 'arguments9': '', - 'netWay': 'Wifi', - 'remark': '签到小游戏买什么都省免费夺宝', - 'version': `android@8.0100`, - 'codeId': 945535689 - } - params['sign'] = sign([params.arguments1, params.arguments2, params.arguments3, params.arguments4]) - - let phone = encryption(options.user, 'gb6YCccUvth75Tm2') + arguments1: "", + arguments2: "", + arguments3: "", + arguments4: new Date().getTime(), + arguments6: "", + arguments7: "", + arguments8: "", + arguments9: "", + netWay: "Wifi", + remark: "签到小游戏买什么都省免费夺宝", + version: `android@8.0100`, + codeId: 945535689, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + + let phone = encryption(options.user, "gb6YCccUvth75Tm2"); // 同一期商品最多3次机会,每4小时可获得5次机会 for (let good of goods) { - - console.log('开始处理', good.goodsName) - params['orderId'] = crypto.createHash('md5').update(new Date().getTime() + '').digest('hex') - params['arguments4'] = new Date().getTime() + console.log("开始处理", good.goodsName); + params["orderId"] = crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"); + params["arguments4"] = new Date().getTime(); let p = { - 'channelId': 'LT_channel', - 'phone': phone, - 'token': ecs_token, - 'sourceCode': 'lt_freeTake' - } + channelId: "LT_channel", + phone: phone, + token: ecs_token, + sourceCode: "lt_freeTake", + }; - let timestamp = moment().format('YYYYMMDDHHmmss') + let timestamp = moment().format("YYYYMMDDHHmmss"); result = await axios.request({ - baseURL: 'https://m.client.10010.com/', + baseURL: "https://m.client.10010.com/", headers: { "user-agent": useragent, - "referer": `https://wxapp.msmds.cn/h5/react_web/unicom/freeTakeGoodDetail/${good.id}?source=unicom&type=02&ticket=${searchParams.ticket}&version=android@8.0100×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&userNumber=${options.user} `, - "origin": "https://wxapp.msmds.cn" + referer: `https://wxapp.msmds.cn/h5/react_web/unicom/freeTakeGoodDetail/${good.id}?source=unicom&type=02&ticket=${searchParams.ticket}&version=android@8.0100×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&userNumber=${options.user} `, + origin: "https://wxapp.msmds.cn", }, url: `https://wxapp.msmds.cn/jplus/api/channel/integral/free/goods/getTimes`, - method: 'GET', - params: transParams(p) - }) + method: "GET", + params: transParams(p), + }); if (result.data.data.time) { - console.log(`已处于限制期,` + moment().add(result.data.data.time, 'seconds').format('YYYY-MM-DD HH:mm:ss') + ' 后可再次尝试,跳过') - break + console.log( + `已处于限制期,` + + moment() + .add(result.data.data.time, "seconds") + .format("YYYY-MM-DD HH:mm:ss") + + " 后可再次尝试,跳过" + ); + break; } - result = await require('./taskcallback').reward(axios, { + result = await require("./taskcallback").reward(axios, { ...options, params, - jar: jar1 - }) + jar: jar1, + }); - timestamp = moment().format('YYYYMMDDHHmmss') + timestamp = moment().format("YYYYMMDDHHmmss"); result = await axios.request({ headers: { "user-agent": useragent, - "referer": `https://wxapp.msmds.cn/h5/react_web/unicom/freeTakeGoodDetail/${good.id}?source=unicom&type=02&ticket=${searchParams.ticket}&version=android@8.0100×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&userNumber=${options.user}`, - "origin": "https://wxapp.msmds.cn" + referer: `https://wxapp.msmds.cn/h5/react_web/unicom/freeTakeGoodDetail/${good.id}?source=unicom&type=02&ticket=${searchParams.ticket}&version=android@8.0100×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&userNumber=${options.user}`, + origin: "https://wxapp.msmds.cn", }, url: `https://wxapp.msmds.cn/jplus/api/channel/integral/free/goods/doFreeGoods`, - method: 'POST', + method: "POST", data: transParams({ - 'channelId': 'LT_channel', - 'code': '', - 'flag': '', - 'id': good.id, - "phone": phone, - 'sourceCode': 'lt_freeTake', - 'taskId': '', - 'token': ecs_token, - 'videoOrderNo': params.orderId - }) - }) + channelId: "LT_channel", + code: "", + flag: "", + id: good.id, + phone: phone, + sourceCode: "lt_freeTake", + taskId: "", + token: ecs_token, + videoOrderNo: params.orderId, + }), + }); if (result.data.code !== 2000) { - console.log(result.data.msg) + console.log(result.data.msg); } else { if (result.data.data.luckCode) { - console.log('提交任务成功', `券码:${result.data.data.luckCode}`) + console.log("提交任务成功", `券码:${result.data.data.luckCode}`); } else if (result.data.data.time) { - throw new Error(`已处于限制期,` + moment().add(result.data.data.time, 'seconds').format('YYYY-MM-DD HH:mm:ss') + ' 后可再次尝试') + throw new Error( + `已处于限制期,` + + moment() + .add(result.data.data.time, "seconds") + .format("YYYY-MM-DD HH:mm:ss") + + " 后可再次尝试" + ); } else { - console.log('提交任务成功') + console.log("提交任务成功"); } } - console.log('等待25秒再继续') - await new Promise((resolve, reject) => setTimeout(resolve, 25 * 1000)) + console.log("等待25秒再继续"); + await new Promise((resolve, reject) => setTimeout(resolve, 25 * 1000)); } - } -} + }, +}; -module.exports = dailyVideoFreeGoods \ No newline at end of file +module.exports = dailyVideoFreeGoods; diff --git a/commands/tasks/unicom/handlers/dailyEvent.js b/commands/tasks/unicom/handlers/dailyEvent.js index 3224f0253..3b1e88d7f 100644 --- a/commands/tasks/unicom/handlers/dailyEvent.js +++ b/commands/tasks/unicom/handlers/dailyEvent.js @@ -162,6 +162,12 @@ let lookVideoDoubleResult = (title) => { } }; }; +/** + * + * @param {json} params1 https://m.client.10010.com/taskcallback/taskfilter/query + * @param {*} params2 https://m.client.10010.com/taskcallback/taskfilter/dotasks + * @param {*} title + */ let lookVideoDouble = (params1, params2, title) => { console.log(`😒 ${title}游玩开始翻倍`); return async (axios, options) => { diff --git a/commands/tasks/unicom/ingotsPage.js b/commands/tasks/unicom/ingotsPage.js index f23b5c37a..e118e036f 100644 --- a/commands/tasks/unicom/ingotsPage.js +++ b/commands/tasks/unicom/ingotsPage.js @@ -185,6 +185,9 @@ let ingotsPage = { } else { freeTimes--; } + console.log("等待15秒再继续"); + // eslint-disable-next-line no-unused-vars + await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); let score = encrypt(randomNumber(12, 17) * 10, "gb6YCccUvth75Tm2"); let timestamp = moment().format("YYYYMMDDHHmmss"); let result = await axios.request({ @@ -240,6 +243,7 @@ let ingotsPage = { phone: phone, token: ecs_token, recordId: recordId, + prizeNum: i["prizeNum"], sourceCode: "lt_ingots", }), }); @@ -294,22 +298,16 @@ let ingotsPage = { { arguments1: "AC20200716103629", arguments2: "GGPD", - arguments3: "45d6dbc3ad144c938cfa6b8e81803b85", + arguments3: "56ff7ad4a6e84886b18ae8716dfd1d6d", arguments4: new Date().getTime(), arguments6: "517050707", - arguments7: "517050707", - arguments8: "123456", - arguments9: "4640b530b3f7481bb5821c6871854ce5", netWay: "Wifi", - remark1: "签到小游戏聚宝盆", - remark: "签到看视频翻倍得积分", version: `android@8.0102`, - codeId: 945689604, }, { arguments1: "AC20200716103629", // acid arguments2: "GGPD", // yhChannel - arguments3: "45d6dbc3ad144c938cfa6b8e81803b85", // yhTaskId menuId + arguments3: "56ff7ad4a6e84886b18ae8716dfd1d6d", // yhTaskId menuId arguments4: new Date().getTime(), // time arguments6: "517050707", arguments7: "517050707", From 5043d6482b64004b7a67a64c8504cc65ade02ce9 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Sat, 13 Feb 2021 01:04:16 +0800 Subject: [PATCH 065/128] =?UTF-8?q?=F0=9F=8F=B3=E2=80=8D=F0=9F=8C=88=20upd?= =?UTF-8?q?ated=20task=20ingots?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/ingotsPage.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/commands/tasks/unicom/ingotsPage.js b/commands/tasks/unicom/ingotsPage.js index e118e036f..80f783afd 100644 --- a/commands/tasks/unicom/ingotsPage.js +++ b/commands/tasks/unicom/ingotsPage.js @@ -161,6 +161,9 @@ let ingotsPage = { sourceCode: "lt_ingots", }; + console.log("等待30秒再继续"); + // eslint-disable-next-line no-unused-vars + await new Promise((resolve, reject) => setTimeout(resolve, 30 * 1000)); let timestamp = moment().format("YYYYMMDDHHmmss"); result = await axios.request({ headers: { @@ -221,10 +224,10 @@ let ingotsPage = { console.log("尝试翻倍"); console.log("😒 聚宝盆游玩翻倍 测试"); await ingotsPage.postGameDouble(axios, options); - console.log("等待15秒再继续"); + console.log("等待30秒再继续"); // eslint-disable-next-line no-unused-vars await new Promise((resolve, reject) => - setTimeout(resolve, 15 * 1000) + setTimeout(resolve, 30 * 1000) ); let recordId = i["recordId"]; let timestamp = moment().format("YYYYMMDDHHmmss"); From 7a440c5a7be29a609e544b65a7737c37122f2246 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Sat, 13 Feb 2021 01:06:46 +0800 Subject: [PATCH 066/128] =?UTF-8?q?=F0=9F=8F=B3=E2=80=8D=F0=9F=8C=88=20upd?= =?UTF-8?q?ated=20task=20ingots?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/ingotsPage.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/commands/tasks/unicom/ingotsPage.js b/commands/tasks/unicom/ingotsPage.js index 80f783afd..41fcb006d 100644 --- a/commands/tasks/unicom/ingotsPage.js +++ b/commands/tasks/unicom/ingotsPage.js @@ -160,10 +160,9 @@ let ingotsPage = { videoOrderNo: params["orderId"], sourceCode: "lt_ingots", }; - - console.log("等待30秒再继续"); + console.log("等待35秒再继续"); // eslint-disable-next-line no-unused-vars - await new Promise((resolve, reject) => setTimeout(resolve, 30 * 1000)); + await new Promise((resolve, reject) => setTimeout(resolve, 35 * 1000)); let timestamp = moment().format("YYYYMMDDHHmmss"); result = await axios.request({ headers: { @@ -188,9 +187,9 @@ let ingotsPage = { } else { freeTimes--; } - console.log("等待15秒再继续"); + console.log("等待35秒再继续"); // eslint-disable-next-line no-unused-vars - await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); + await new Promise((resolve, reject) => setTimeout(resolve, 35 * 1000)); let score = encrypt(randomNumber(12, 17) * 10, "gb6YCccUvth75Tm2"); let timestamp = moment().format("YYYYMMDDHHmmss"); let result = await axios.request({ @@ -224,10 +223,10 @@ let ingotsPage = { console.log("尝试翻倍"); console.log("😒 聚宝盆游玩翻倍 测试"); await ingotsPage.postGameDouble(axios, options); - console.log("等待30秒再继续"); + console.log("等待35秒再继续"); // eslint-disable-next-line no-unused-vars await new Promise((resolve, reject) => - setTimeout(resolve, 30 * 1000) + setTimeout(resolve, 35 * 1000) ); let recordId = i["recordId"]; let timestamp = moment().format("YYYYMMDDHHmmss"); From 0f7cca7a47967c7f5623e94f7da7007fb0ed31db Mon Sep 17 00:00:00 2001 From: cooip-jm <78735965+cooip-jm@users.noreply.github.com> Date: Sat, 13 Feb 2021 17:51:09 +0800 Subject: [PATCH 067/128] Update dailyGrabdollPage.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 延长视频等待时间 --- commands/tasks/unicom/dailyGrabdollPage.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/tasks/unicom/dailyGrabdollPage.js b/commands/tasks/unicom/dailyGrabdollPage.js index 49efe4533..41089f176 100644 --- a/commands/tasks/unicom/dailyGrabdollPage.js +++ b/commands/tasks/unicom/dailyGrabdollPage.js @@ -209,8 +209,8 @@ var dailyGrabdollPage = { console.log("阅读开心抓大奖", result.msg); } - console.log("等待15秒再继续"); - await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); + console.log("等待35秒再继续"); + await new Promise((resolve, reject) => setTimeout(resolve, 35 * 1000)); } while (--times); }, }; From 4a1bb04a9dae41c8a8c7bee2b755b0867c13dd70 Mon Sep 17 00:00:00 2001 From: cooip-jm <78735965+cooip-jm@users.noreply.github.com> Date: Sat, 13 Feb 2021 17:54:48 +0800 Subject: [PATCH 068/128] Update dailyVideoBook.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 延长等待时间 --- commands/tasks/unicom/dailyVideoBook.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/commands/tasks/unicom/dailyVideoBook.js b/commands/tasks/unicom/dailyVideoBook.js index dc04dac7c..744475074 100644 --- a/commands/tasks/unicom/dailyVideoBook.js +++ b/commands/tasks/unicom/dailyVideoBook.js @@ -495,8 +495,8 @@ var dailyVideoBook = { } } ++n - console.log('等待3秒') - await new Promise((resolve, reject) => setTimeout(resolve, 3000)) + console.log('等待13秒') + await new Promise((resolve, reject) => setTimeout(resolve, 13000)) } while (n <= 5) }, // 阅读拉力赛报名 @@ -596,8 +596,8 @@ var dailyVideoBook = { jar: st_jar }) - console.log('等待3秒') - await new Promise((resolve, reject) => setTimeout(resolve, 3000)) + console.log('等待13秒') + await new Promise((resolve, reject) => setTimeout(resolve, 13000)) } while (--n) console.log('阅读10章完成') @@ -712,4 +712,4 @@ var dailyVideoBook = { } } -module.exports = dailyVideoBook \ No newline at end of file +module.exports = dailyVideoBook From b48b1a39491a325a66dbafedab10e58e326b20f6 Mon Sep 17 00:00:00 2001 From: cooip-jm <78735965+cooip-jm@users.noreply.github.com> Date: Sat, 13 Feb 2021 17:58:57 +0800 Subject: [PATCH 069/128] Update dailyVideoScratchcard.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 延长视频等待时间 --- commands/tasks/unicom/dailyVideoScratchcard.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/tasks/unicom/dailyVideoScratchcard.js b/commands/tasks/unicom/dailyVideoScratchcard.js index 3b99929cf..c55ba0d49 100644 --- a/commands/tasks/unicom/dailyVideoScratchcard.js +++ b/commands/tasks/unicom/dailyVideoScratchcard.js @@ -163,9 +163,9 @@ var dailyVideoScratchcard = { ...options, }); } - console.log("等待15秒再继续"); + console.log("等待35秒再继续"); // eslint-disable-next-line no-unused-vars - await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); + await new Promise((resolve, reject) => setTimeout(resolve, 35 * 1000)); } } else { console.log("暂无可刮得商品"); From efa07336caf51eb6f4de81054939c71d86257e74 Mon Sep 17 00:00:00 2001 From: cooip-jm <78735965+cooip-jm@users.noreply.github.com> Date: Sat, 13 Feb 2021 18:00:22 +0800 Subject: [PATCH 070/128] Update dailyYYQ.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 延长视频等待时间 --- commands/tasks/unicom/dailyYYQ.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/tasks/unicom/dailyYYQ.js b/commands/tasks/unicom/dailyYYQ.js index 58fa7ed6a..64b52d7a7 100644 --- a/commands/tasks/unicom/dailyYYQ.js +++ b/commands/tasks/unicom/dailyYYQ.js @@ -138,9 +138,9 @@ let dailyYYQ = { } } - console.log("等待15秒再继续"); + console.log("在看视频,等待35秒再继续"); // eslint-disable-next-line no-unused-vars - await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); + await new Promise((resolve, reject) => setTimeout(resolve, 35 * 1000)); } while (--times); }, lookVideoDouble: async (axios, options) => { From b83fcb4209b7181ef1fa1495bb0d2a77a16bf9fe Mon Sep 17 00:00:00 2001 From: cooip-jm <78735965+cooip-jm@users.noreply.github.com> Date: Sat, 13 Feb 2021 18:01:51 +0800 Subject: [PATCH 071/128] Update dailyYYY.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 延长视频等待时间 --- commands/tasks/unicom/dailyYYY.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/tasks/unicom/dailyYYY.js b/commands/tasks/unicom/dailyYYY.js index 9d1aba335..f91ce1bb7 100644 --- a/commands/tasks/unicom/dailyYYY.js +++ b/commands/tasks/unicom/dailyYYY.js @@ -306,9 +306,9 @@ var dailyYYY = { } } - console.log("等待15秒再继续"); + console.log("在看视频,等待35秒再继续"); // eslint-disable-next-line no-unused-vars - await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); + await new Promise((resolve, reject) => setTimeout(resolve, 35 * 1000)); } while (freeTimes || advertTimes); }, lookVideoDouble: async (axios, options) => { From c502e6d7a549734aaf0b74301a3e46f8c1caa546 Mon Sep 17 00:00:00 2001 From: cooip-jm <78735965+cooip-jm@users.noreply.github.com> Date: Sat, 13 Feb 2021 18:03:33 +0800 Subject: [PATCH 072/128] Update dailylottery.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 延长视频等待时间 --- commands/tasks/unicom/dailylottery.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/commands/tasks/unicom/dailylottery.js b/commands/tasks/unicom/dailylottery.js index 49414995b..8800c37f4 100644 --- a/commands/tasks/unicom/dailylottery.js +++ b/commands/tasks/unicom/dailylottery.js @@ -52,10 +52,10 @@ var dailylottery = { console.log(result.RspMsg) } - console.log('等待15秒再继续') - await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)) + console.log('在看视频,不要着急,等待35秒再继续') + await new Promise((resolve, reject) => setTimeout(resolve, 35 * 1000)) } while (--usableAcFreq) } } -module.exports = dailylottery \ No newline at end of file +module.exports = dailylottery From d308a92671b54fc314cec6fbc4563705a452245e Mon Sep 17 00:00:00 2001 From: cooip-jm <78735965+cooip-jm@users.noreply.github.com> Date: Sat, 13 Feb 2021 18:11:24 +0800 Subject: [PATCH 073/128] Update jflottery.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 延长视频等待时间 --- commands/tasks/unicom/jflottery.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/tasks/unicom/jflottery.js b/commands/tasks/unicom/jflottery.js index 084514319..c10459ef4 100644 --- a/commands/tasks/unicom/jflottery.js +++ b/commands/tasks/unicom/jflottery.js @@ -168,9 +168,9 @@ module.exports = jflottery = { } } - console.log("☕ 等待15秒再继续"); + console.log("☕ 喘口气歇会,等待35秒再继续"); // eslint-disable-next-line no-unused-vars - await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); + await new Promise((resolve, reject) => setTimeout(resolve, 35 * 1000)); } while (freeTimes || advertTimes); }, lookVideoDouble: async (axios, options) => { From 9190eddac80a1b2824f27ed21fa97dc63f9bb975 Mon Sep 17 00:00:00 2001 From: cooip-jm <78735965+cooip-jm@users.noreply.github.com> Date: Sat, 13 Feb 2021 18:27:26 +0800 Subject: [PATCH 074/128] Update producGame.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增大时间范围,减少防刷的报错 --- commands/tasks/unicom/producGame.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/tasks/unicom/producGame.js b/commands/tasks/unicom/producGame.js index d831e71b2..37f4a1ddd 100644 --- a/commands/tasks/unicom/producGame.js +++ b/commands/tasks/unicom/producGame.js @@ -673,7 +673,7 @@ var producGame = { jar, }); await new Promise((resolve, reject) => - setTimeout(resolve, (Math.floor(Math.random() * 5) + 2) * 200) + setTimeout(resolve, (Math.floor(Math.random() * 5) + 3) * 300) ); await producGame.getTaskList(axios, options); await producGame.queryIntegral(axios, { From ca7de1d748a05ec7475168eee4ffe1648856c0b9 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Sat, 13 Feb 2021 21:55:06 +0800 Subject: [PATCH 075/128] =?UTF-8?q?=F0=9F=8F=B3=E2=80=8D=F0=9F=8C=88=20=20?= =?UTF-8?q?updated=20task=20video=20free=20goods?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/dailyVideoFreeGoods.js | 257 ++++++++----------- commands/tasks/unicom/freeDownFloorAd.js | 91 +++++-- commands/tasks/unicom/handlers/gameUtils.js | 7 +- commands/tasks/unicom/ingotsPage.js | 1 + commands/tasks/unicom/unicom.js | 18 +- 5 files changed, 188 insertions(+), 186 deletions(-) diff --git a/commands/tasks/unicom/dailyVideoFreeGoods.js b/commands/tasks/unicom/dailyVideoFreeGoods.js index 7828fefee..0a9c9e868 100644 --- a/commands/tasks/unicom/dailyVideoFreeGoods.js +++ b/commands/tasks/unicom/dailyVideoFreeGoods.js @@ -1,47 +1,18 @@ var crypto = require("crypto"); var moment = require("moment"); - -// 签到小游戏买什么都省免费夺宝 -var transParams = (data) => { - let params = new URLSearchParams(); - for (let item in data) { - params.append(item, data["" + item + ""]); - } - return params; -}; - -var sign = (data) => { - let str = "integralofficial&"; - let params = []; - data.forEach((v, i) => { - if (v) { - params.push("arguments" + (i + 1) + v); - } - }); - return crypto - .createHash("md5") - .update(str + params.join("&")) - .digest("hex"); -}; - -function encryption(data, key) { - var iv = ""; - var cipherEncoding = "base64"; - var cipher = crypto.createCipheriv("aes-128-ecb", key, iv); - cipher.setAutoPadding(true); - return Buffer.concat([cipher.update(data), cipher.final()]).toString( - cipherEncoding - ); -} +const gameEvents = require("./handlers/dailyEvent"); +let { encryptPhone, sign, encrypt } = require("./handlers/PAES.js"); +const { useragent } = require("./handlers/myPhone"); +const { transParams, sleep } = require("./handlers/gameUtils"); +// 签到小游戏买什么都省免费夺宝 [夺宝大挑战] var dailyVideoFreeGoods = { - getGoodsList: async (axios, options) => { - const { token } = options; - let phone = encryption(options.user, "gb6YCccUvth75Tm2"); - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:} `; + // eslint-disable-next-line no-unused-vars + getGoodsList: async (axios, options, { ecs_token, searchParams, jar1 }) => { + let phone = encryptPhone(options.user, "gb6YCccUvth75Tm2"); let res = await axios.request({ headers: { - "user-agent": useragent, + "user-agent": useragent(options), referer: `https://wxapp.msmds.cn/`, origin: "https://wxapp.msmds.cn", }, @@ -51,10 +22,10 @@ var dailyVideoFreeGoods = { fromType: "22", status: "0", pageNo: "1", - pageSize: "10", + pageSize: "30", channelId: "LT_channel", phone: phone, - token: token, + token: ecs_token, sourceCode: "lt_freeTake", }), }); @@ -68,53 +39,23 @@ var dailyVideoFreeGoods = { sameGoodsMaxTimes: result.data.sameGoodsMaxTimes, }; }, + getOpenPlatLine: gameEvents.getOpenPlatLine( + `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://wxapp.msmds.cn/h5/react_web/unicom/freeTakePage`, + { base: "msmds" } + ), doTask: async (axios, options) => { - const useragent = `Mozilla/5.0 (Linux; Android 7.1.2; SM-G977N Build/LMY48Z; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36; unicom{version:android@8.0100,desmobile:${options.user}};devicetype{deviceBrand:samsung,deviceModel:SM-G977N};{yw_code:}`; - let searchParams = {}; - let result = await axios - .request({ - baseURL: "https://m.client.10010.com/", - headers: { - "user-agent": useragent, - referer: `https://img.client.10010.com/`, - origin: "https://img.client.10010.com", - }, - url: `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://wxapp.msmds.cn/h5/react_web/unicom/freeTakePage`, - method: "get", - transformResponse: (data, headers) => { - if ("location" in headers) { - let uu = new URL(headers.location); - let pp = {}; - for (let p of uu.searchParams) { - pp[p[0]] = p[1]; - } - if ("ticket" in pp) { - searchParams = pp; - } - } - return data; - }, - }) - .catch((err) => console.log(err)); - - let jar1 = result.config.jar; - let cookiesJson = jar1.toJSON(); - let ecs_token = cookiesJson.cookies.find((i) => i.key == "ecs_token"); - if (!ecs_token) { - throw new Error("ecs_token缺失"); - } - ecs_token = ecs_token.value; + console.log("🔔 开始夺宝大挑战\n"); + let cookies = await dailyVideoFreeGoods.getOpenPlatLine(axios, options); let { goods, freeTimes, leftTimes, time, + // eslint-disable-next-line no-unused-vars getFreeTime, + // eslint-disable-next-line no-unused-vars sameGoodsMaxTimes, - } = await dailyVideoFreeGoods.getGoodsList(axios, { - ...options, - token: ecs_token, - }); + } = await dailyVideoFreeGoods.getGoodsList(axios, options, cookies); console.log( "签到小游戏买什么都省免费夺宝", `剩余机会(${leftTimes}/${freeTimes})` @@ -140,8 +81,8 @@ var dailyVideoFreeGoods = { arguments8: "", arguments9: "", netWay: "Wifi", - remark: "签到小游戏买什么都省免费夺宝", - version: `android@8.0100`, + remark: "签到页小游戏", + version: `android@8.0102`, codeId: 945535689, }; params["sign"] = sign([ @@ -151,94 +92,102 @@ var dailyVideoFreeGoods = { params.arguments4, ]); - let phone = encryption(options.user, "gb6YCccUvth75Tm2"); + let phone = encryptPhone(options.user, "gb6YCccUvth75Tm2"); // 同一期商品最多3次机会,每4小时可获得5次机会 + console.log("注意本接口只获取积分!"); + console.log("抽奖时,可能会出现[不存在的奖品],此状态为无库存"); for (let good of goods) { - console.log("开始处理", good.goodsName); - params["orderId"] = crypto - .createHash("md5") - .update(new Date().getTime() + "") - .digest("hex"); - params["arguments4"] = new Date().getTime(); + if (good.id !== null && good.goodsName.indexOf("积分") > -1) { + console.log("开始抽奖: ", good.goodsName); + params["orderId"] = crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"); + params["arguments4"] = new Date().getTime(); - let p = { - channelId: "LT_channel", - phone: phone, - token: ecs_token, - sourceCode: "lt_freeTake", - }; - - let timestamp = moment().format("YYYYMMDDHHmmss"); - result = await axios.request({ - baseURL: "https://m.client.10010.com/", - headers: { - "user-agent": useragent, - referer: `https://wxapp.msmds.cn/h5/react_web/unicom/freeTakeGoodDetail/${good.id}?source=unicom&type=02&ticket=${searchParams.ticket}&version=android@8.0100×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&userNumber=${options.user} `, - origin: "https://wxapp.msmds.cn", - }, - url: `https://wxapp.msmds.cn/jplus/api/channel/integral/free/goods/getTimes`, - method: "GET", - params: transParams(p), - }); - - if (result.data.data.time) { - console.log( - `已处于限制期,` + - moment() - .add(result.data.data.time, "seconds") - .format("YYYY-MM-DD HH:mm:ss") + - " 后可再次尝试,跳过" - ); - break; - } - - result = await require("./taskcallback").reward(axios, { - ...options, - params, - jar: jar1, - }); - - timestamp = moment().format("YYYYMMDDHHmmss"); - result = await axios.request({ - headers: { - "user-agent": useragent, - referer: `https://wxapp.msmds.cn/h5/react_web/unicom/freeTakeGoodDetail/${good.id}?source=unicom&type=02&ticket=${searchParams.ticket}&version=android@8.0100×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&userNumber=${options.user}`, - origin: "https://wxapp.msmds.cn", - }, - url: `https://wxapp.msmds.cn/jplus/api/channel/integral/free/goods/doFreeGoods`, - method: "POST", - data: transParams({ + let p = { channelId: "LT_channel", - code: "", - flag: "", - id: good.id, phone: phone, + token: cookies.ecs_token, sourceCode: "lt_freeTake", - taskId: "", - token: ecs_token, - videoOrderNo: params.orderId, - }), - }); - if (result.data.code !== 2000) { - console.log(result.data.msg); - } else { - if (result.data.data.luckCode) { - console.log("提交任务成功", `券码:${result.data.data.luckCode}`); - } else if (result.data.data.time) { - throw new Error( + }; + + //请求抽奖次数情况 + console.log("查询抽奖时效"); + let timestamp = moment().format("YYYYMMDDHHmmss"); + let result = await axios.request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": useragent(options), + referer: `https://wxapp.msmds.cn/h5/react_web/unicom/freeTakeGoodDetail/${good.id}?source=unicom&type=02&ticket=${cookies.searchParams.ticket}&version=android@8.0100×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${cookies.searchParams.postage}&userNumber=${options.user} `, + origin: "https://wxapp.msmds.cn", + }, + url: `https://wxapp.msmds.cn/jplus/api/channel/integral/free/goods/getTimes`, + method: "GET", + params: transParams(p), + }); + + // console.log(result.data); + if (result.data.data.time) { + console.log( `已处于限制期,` + moment() .add(result.data.data.time, "seconds") .format("YYYY-MM-DD HH:mm:ss") + - " 后可再次尝试" + " 后可再次尝试,跳过" ); + break; + } + await sleep(30); + console.log("查询抽奖接口"); + result = await require("./taskcallback").reward(axios, { + ...options, + params, + jar: cookies.jar1, + }); + + timestamp = moment().format("YYYYMMDDHHmmss"); + result = await axios.request({ + headers: { + "user-agent": useragent(options), + referer: `https://wxapp.msmds.cn/h5/react_web/unicom/freeTakeGoodDetail/${good.id}?source=unicom&type=02&ticket=${cookies.searchParams.ticket}&version=android@8.0100×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${cookies.searchParams.postage}&userNumber=${options.user}`, + origin: "https://wxapp.msmds.cn", + }, + url: `https://wxapp.msmds.cn/jplus/api/channel/integral/free/goods/doFreeGoods`, + method: "POST", + data: transParams({ + channelId: "LT_channel", + code: "", + flag: "", + id: good.id, + phone: phone, + sourceCode: "lt_freeTake", + taskId: "", + token: cookies.ecs_token, + videoOrderNo: params.orderId, + }), + }); + // console.log(result.data); + if (result.data.code !== 2000) { + console.log(result.data.msg); } else { - console.log("提交任务成功"); + if (result.data.data.luckCode) { + console.log("提交任务成功", `券码:${result.data.data.luckCode}`); + } else if (result.data.data.time) { + throw new Error( + `已处于限制期,` + + moment() + .add(result.data.data.time, "seconds") + .format("YYYY-MM-DD HH:mm:ss") + + " 后可再次尝试" + ); + } else { + console.log("提交任务成功"); + } } + await sleep(25); } - console.log("等待25秒再继续"); - await new Promise((resolve, reject) => setTimeout(resolve, 25 * 1000)); } }, }; diff --git a/commands/tasks/unicom/freeDownFloorAd.js b/commands/tasks/unicom/freeDownFloorAd.js index 300cdab3f..359bcd610 100644 --- a/commands/tasks/unicom/freeDownFloorAd.js +++ b/commands/tasks/unicom/freeDownFloorAd.js @@ -4,6 +4,7 @@ let { encryptPhone, sign, encrypt } = require("./handlers/PAES.js"); const { useragent, randomNumber } = require("./handlers/myPhone"); const gameEvents = require("./handlers/dailyEvent"); let { transParams } = require("./handlers/gameUtils"); +const { v4: uuidv4 } = require("uuid"); const appList = [ { mMainTitle: "线上桌游吧,随时随地玩桌游", @@ -38,7 +39,8 @@ let freeDownFloorAd = { Data.params.serialNumber = options.user; Data.params.appList.push(appList[0]); let jar1 = await freeDownFloorAd.onAdDisplay(axios, options, Data); - await freeDownFloorAd.onAdClick(axios, options, Data); + let { citycode } = await freeDownFloorAd.onAdClick(axios, options, Data); + await freeDownFloorAd.getCoins(axios, options, citycode); await freeDownFloorAd.findAll(axios, options); await freeDownFloorAd.onAdAppDownloadStart(axios, options, Data); await freeDownFloorAd.onAdAppDownloadSucceed(axios, options, Data); @@ -84,6 +86,7 @@ let freeDownFloorAd = { await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); return jar1; }, + // eslint-disable-next-line no-unused-vars findAll: async (axios, options) => { let res = await axios .request({ @@ -118,9 +121,18 @@ let freeDownFloorAd = { }) .catch((err) => console.log(err)); console.log(res.data); + let jar1 = res.config.jar; + + let cookiesJson = jar1.toJSON(); + let citycode = cookiesJson.cookies.find((i) => i.key == "city"); + if (!citycode) { + throw new Error("citycode缺失"); + } + citycode = citycode.value; console.log("等待15秒再继续"); // eslint-disable-next-line no-unused-vars await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); + return { citycode: citycode }; }, onAdAppDownloadStart: async (axios, options, appinfo) => { let currentTime = moment().format("YYYYMMDDHHmmssSSS"); @@ -214,10 +226,20 @@ let freeDownFloorAd = { }) .catch((err) => console.log(err)); console.log(res.data); + let jar1 = res.config.jar; + + let cookiesJson = jar1.toJSON(); + let citycode = cookiesJson.cookies.find((i) => i.key == "city"); + if (!citycode) { + throw new Error("citycode缺失"); + } + citycode = citycode.value; console.log("等待15秒再继续"); // eslint-disable-next-line no-unused-vars await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); + return { citycode: citycode }; }, + // eslint-disable-next-line no-unused-vars getIntegralFree: async (axios, options, jar) => { let res = await axios .request({ @@ -235,8 +257,33 @@ let freeDownFloorAd = { .catch((err) => console.log(err)); console.log(res.data); }, - lookVideoDouble: gameEvents.lookVideoDouble( - { + getCoins: async (axios, options, { citycode }) => { + let URL = + `https://img.client.10010.com/SigininApp/index.html?` + + `yw_code=&desmobile=${options.user}&version=android@8.0102#/&` + + `operation=click&localUrl=https://img.client.10010.com/SigininApp/index.html?yw_code=&desmobile=${ + options.user + }&version=android@8.0102&nodename=DIV&path=wrap0item0item-wrap0items-wrap0content2container6home0app&stc=&citycode=${citycode}&jfuser=${ + options.user + }||&t=${new Date().getTime()}&uuid=${uuidv4()}`; + URL = + "https://m.jf.10010.com/jf-log/4.gif?domain=img.client.10010.com&href=" + + encodeURIComponent(URL); + await axios + .request({ + headers: { + "user-agent": useragent(options), + origin: "https://img.client.10010.com", + }, + url: URL, + method: "get", + Referer: `https://img.client.10010.com/SigininApp/index.html?yw_code=&desmobile=${options.user}&version=android@8.0102`, + "X-Requested-With": "com.sinovatech.unicom.ui", + }) + .catch((err) => console.log(err)); + }, + lookVideoDouble: async (axios, options) => { + let params1 = { arguments1: "AC20200624091508", arguments2: "GGPD", arguments3: "f65cd1e62af1407f88b069c0ffd4e1d8", @@ -250,26 +297,22 @@ let freeDownFloorAd = { remark: "签到任务下载应用得积分", version: `android@8.0102`, codeId: 812759, - }, - { - arguments1: "AC20200624091508", // acid - arguments2: "GGPD", // yhChannel - arguments3: "f65cd1e62af1407f88b069c0ffd4e1d8", // yhTaskId menuId - arguments4: new Date().getTime(), // time - arguments6: "517050707", - arguments7: "517050707", - arguments8: "123456", - arguments9: "4640b530b3f7481bb5821c6871854ce5", - orderId: crypto - .createHash("md5") - .update(new Date().getTime() + "") - .digest("hex"), - netWay: "Wifi", - remark: "签到任务下载应用得积分", - version: `android@8.0102`, - codeId: 812759, - }, - "任务下载应用得积分" - ), + }; + params1["sign"] = sign([ + params1.arguments1, + params1.arguments2, + params1.arguments3, + params1.arguments4, + ]); + let { num, jar } = await require("./taskcallback").query(axios, { + ...options, + params: params1, + }); + + if (!num) { + console.log(`签到小游戏: 今日已完成`); + return; + } + }, }; module.exports = freeDownFloorAd; diff --git a/commands/tasks/unicom/handlers/gameUtils.js b/commands/tasks/unicom/handlers/gameUtils.js index c36eb2a12..77a276087 100644 --- a/commands/tasks/unicom/handlers/gameUtils.js +++ b/commands/tasks/unicom/handlers/gameUtils.js @@ -5,7 +5,11 @@ let transParams = (data) => { } return params; }; - +let sleep = async (seconds) => { + console.log(`☕ 等待${seconds}秒再继续`); + // eslint-disable-next-line no-unused-vars + return new Promise((resolve, reject) => setTimeout(resolve, seconds * 1000)); +}; //OLD=>NEW var codeMap = { 945510695: "945535750", //android-游戏频道看视频得积分2-激励视频 @@ -66,4 +70,5 @@ var codeMap = { }; module.exports = { transParams, + sleep, }; diff --git a/commands/tasks/unicom/ingotsPage.js b/commands/tasks/unicom/ingotsPage.js index 41fcb006d..b5857140b 100644 --- a/commands/tasks/unicom/ingotsPage.js +++ b/commands/tasks/unicom/ingotsPage.js @@ -180,6 +180,7 @@ let ingotsPage = { console.log(result.data); if (result.data.code !== 200) { console.log("提交任务失败", result.data.msg); + break; } else { console.log("提交任务成功", `${result.data.data}`); } diff --git a/commands/tasks/unicom/unicom.js b/commands/tasks/unicom/unicom.js index 2a5461886..2a4fde5a6 100644 --- a/commands/tasks/unicom/unicom.js +++ b/commands/tasks/unicom/unicom.js @@ -170,13 +170,17 @@ var start = async (params) => { // 首页-签到有礼-免费拿-看视频夺宝 // 易出现本次操作需要进行验证,暂时注释 - // await scheduler.regTask('dailyVideoFreeGoods', async (request) => { - // await require('./dailyVideoFreeGoods').doTask(request, options) - // }, { - // isCircle: true, - // startTime: 10 * 3600, - // intervalTime: 4 * 3600 - // }) + await scheduler.regTask( + "dailyVideoFreeGoods", + async (request) => { + await require("./dailyVideoFreeGoods").doTask(request, options); + }, + { + isCircle: true, + startTime: 10 * 3600, + intervalTime: 4 * 3600, + } + ); // 首页-签到有礼-免费抽-抓OPPO手机 await scheduler.regTask( From d659c4d57426f1a033e6572550943dc96ad425fa Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Sun, 14 Feb 2021 11:27:13 +0800 Subject: [PATCH 076/128] updating files --- .eslintrc.js | 3 + commands/tasks/unicom/dailyTTliulan.js | 112 +++++++++-------- commands/tasks/unicom/dailyVideoFreeGoods.js | 107 ++++++++-------- commands/tasks/unicom/handlers/dailyEvent.js | 4 +- commands/tasks/unicom/handlers/gameUtils.js | 123 ++++++++++--------- package-lock.json | 83 +++++++------ package.json | 3 +- 7 files changed, 239 insertions(+), 196 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index a3ee90afa..a927ef4de 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -6,7 +6,10 @@ module.exports = { }, extends: ["eslint:recommended", "plugin:prettier/recommended"], parserOptions: { + es6: true, + sourceType: "module", ecmaVersion: 12, }, + // parser: "@babel/eslint-parser", rules: {}, }; diff --git a/commands/tasks/unicom/dailyTTliulan.js b/commands/tasks/unicom/dailyTTliulan.js index 6d6c0ca79..692ec5e93 100644 --- a/commands/tasks/unicom/dailyTTliulan.js +++ b/commands/tasks/unicom/dailyTTliulan.js @@ -1,14 +1,17 @@ -var crypto = require('crypto'); +var crypto = require("crypto"); var sign = (data) => { - let str = 'integralofficial&' - let params = [] + let str = "integralofficial&"; + let params = []; data.forEach((v, i) => { if (v) { - params.push('arguments' + (i + 1) + v) + params.push("arguments" + (i + 1) + v); } }); - return crypto.createHash('md5').update(str + params.join('&')).digest('hex') -} + return crypto + .createHash("md5") + .update(str + params.join("&")) + .digest("hex"); +}; let account = { yhTaskId: "6c54032f662c4d2bb576872ed408232c", yhChannel: "GGPD", @@ -16,59 +19,72 @@ let account = { accountUserName: "517050707", accountPassword: "123456", accountToken: "4640b530b3f7481bb5821c6871854ce5", -} +}; var dailyTTliulan = { query: async (request, options) => { let params = { - 'arguments1': 'AC20200814162815', // acid - 'arguments2': account.yhChannel, // yhChannel - 'arguments3': account.yhTaskId, // yhTaskId menuId - 'arguments4': new Date().getTime(), // time - 'arguments6': account.accountChannel, - 'netWay': 'Wifi', - 'version': `android@8.0100`, - } - params['sign'] = sign([params.arguments1, params.arguments2, params.arguments3, params.arguments4]) - return await require('./taskcallback').query(request, { + arguments1: "AC20200814162815", // acid + arguments2: account.yhChannel, // yhChannel + arguments3: account.yhTaskId, // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: account.accountChannel, + netWay: "Wifi", + version: `android@8.0100`, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + return await require("./taskcallback").query(request, { ...options, - params - }) + params, + }); }, doTask: async (request, options) => { - let { num, jar } = await dailyTTliulan.query(request, options) + let { num, jar } = await dailyTTliulan.query(request, options); if (!num) { - console.log('手厅浏览有礼发积分: 今日已完成') - return + console.log("手厅浏览有礼发积分: 今日已完成"); + return; } do { - console.log('第', num, '次') + console.log("第", num, "次"); let params = { - 'arguments1': 'AC20200814162815', // acid - 'arguments2': account.yhChannel, // yhChannel - 'arguments3': account.yhTaskId, // yhTaskId menuId - 'arguments4': new Date().getTime(), // time - 'arguments6': account.accountChannel, - 'arguments7': account.accountUserName, - 'arguments8': account.accountPassword, - 'arguments9': account.accountToken, - 'orderId': crypto.createHash('md5').update(new Date().getTime() + '').digest('hex'), - 'netWay': 'Wifi', - 'remark': '手厅浏览有礼发积分', - 'version': `android@8.0100`, - 'codeId': 945535616 - } - params['sign'] = sign([params.arguments1, params.arguments2, params.arguments3, params.arguments4]) - await require('./taskcallback').doTask(request, { + arguments1: "AC20200814162815", // acid + arguments2: account.yhChannel, // yhChannel + arguments3: account.yhTaskId, // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: account.accountChannel, + arguments7: account.accountUserName, + arguments8: account.accountPassword, + arguments9: account.accountToken, + orderId: crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"), + netWay: "Wifi", + remark: "手厅浏览有礼发积分", + version: `android@8.0100`, + codeId: 945535616, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + await require("./taskcallback").doTask(request, { ...options, params, - jar - }) + jar, + }); - let s = Math.floor(Math.random() * 20) - console.log('等待%s秒再继续', s) - await new Promise((resolve, reject) => setTimeout(resolve, s * 1000)) - } while (--num) - } -} + let s = Math.floor(Math.random() * 20); + console.log("等待%s秒再继续", s); + await new Promise((resolve, reject) => setTimeout(resolve, s * 1000)); + } while (--num); + }, +}; -module.exports = dailyTTliulan \ No newline at end of file +module.exports = dailyTTliulan; diff --git a/commands/tasks/unicom/dailyVideoFreeGoods.js b/commands/tasks/unicom/dailyVideoFreeGoods.js index 0a9c9e868..60caea3b5 100644 --- a/commands/tasks/unicom/dailyVideoFreeGoods.js +++ b/commands/tasks/unicom/dailyVideoFreeGoods.js @@ -3,32 +3,33 @@ var moment = require("moment"); const gameEvents = require("./handlers/dailyEvent"); let { encryptPhone, sign, encrypt } = require("./handlers/PAES.js"); const { useragent } = require("./handlers/myPhone"); -const { transParams, sleep } = require("./handlers/gameUtils"); +const { + transParams, + sleep, + UnicomRequest, + encodePhone, +} = require("./handlers/gameUtils"); // 签到小游戏买什么都省免费夺宝 [夺宝大挑战] var dailyVideoFreeGoods = { // eslint-disable-next-line no-unused-vars getGoodsList: async (axios, options, { ecs_token, searchParams, jar1 }) => { - let phone = encryptPhone(options.user, "gb6YCccUvth75Tm2"); - let res = await axios.request({ - headers: { - "user-agent": useragent(options), - referer: `https://wxapp.msmds.cn/`, - origin: "https://wxapp.msmds.cn", - }, - url: `https://wxapp.msmds.cn/jplus/api/channel/integral/free/goods/findAll`, - method: "POST", - data: transParams({ - fromType: "22", - status: "0", - pageNo: "1", - pageSize: "30", - channelId: "LT_channel", - phone: phone, - token: ecs_token, - sourceCode: "lt_freeTake", - }), - }); + let phone = encodePhone(options.user); + let request = new UnicomRequest(axios, options); + let body = { + fromType: "22", + status: "0", + pageNo: "1", + pageSize: "30", + channelId: "LT_channel", + phone: phone, + token: ecs_token, + sourceCode: "lt_freeTake", + }; + let res = await request.postMsmds( + "https://wxapp.msmds.cn/jplus/api/channel/integral/free/goods/findAll", + body + ); let result = res.data; return { goods: result.data.goodsList.data, @@ -92,7 +93,7 @@ var dailyVideoFreeGoods = { params.arguments4, ]); - let phone = encryptPhone(options.user, "gb6YCccUvth75Tm2"); + let phone = encodePhone(options.user); // 同一期商品最多3次机会,每4小时可获得5次机会 console.log("注意本接口只获取积分!"); @@ -116,18 +117,21 @@ var dailyVideoFreeGoods = { //请求抽奖次数情况 console.log("查询抽奖时效"); let timestamp = moment().format("YYYYMMDDHHmmss"); - let result = await axios.request({ - baseURL: "https://m.client.10010.com/", - headers: { - "user-agent": useragent(options), - referer: `https://wxapp.msmds.cn/h5/react_web/unicom/freeTakeGoodDetail/${good.id}?source=unicom&type=02&ticket=${cookies.searchParams.ticket}&version=android@8.0100×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${cookies.searchParams.postage}&userNumber=${options.user} `, + let body = { + channelId: "LT_channel", + phone: phone, + token: cookies.ecs_token, + sourceCode: "lt_freeTake", + }; + let request = new UnicomRequest(axios, options); + let result = await request.getMsmds( + "https://wxapp.msmds.cn/jplus/api/channel/integral/free/goods/getTimes", + body, + { + referer: `https://wxapp.msmds.cn/h5/react_web/unicom/freeTakeGoodDetail/${good.id}?source=unicom&type=02&ticket=${cookies.searchParams.ticket}&version=android@8.0100×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${cookies.searchParams.postage}&userNumber=${options.user}`, origin: "https://wxapp.msmds.cn", - }, - url: `https://wxapp.msmds.cn/jplus/api/channel/integral/free/goods/getTimes`, - method: "GET", - params: transParams(p), - }); - + } + ); // console.log(result.data); if (result.data.data.time) { console.log( @@ -148,26 +152,25 @@ var dailyVideoFreeGoods = { }); timestamp = moment().format("YYYYMMDDHHmmss"); - result = await axios.request({ - headers: { - "user-agent": useragent(options), - referer: `https://wxapp.msmds.cn/h5/react_web/unicom/freeTakeGoodDetail/${good.id}?source=unicom&type=02&ticket=${cookies.searchParams.ticket}&version=android@8.0100×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${cookies.searchParams.postage}&userNumber=${options.user}`, + body = { + channelId: "LT_channel", + code: "", + flag: "", + id: good.id, + phone: phone, + sourceCode: "lt_freeTake", + taskId: "", + token: cookies.ecs_token, + videoOrderNo: params.orderId, + }; + result = await request.postMsmds( + "https://wxapp.msmds.cn/jplus/api/channel/integral/free/goods/doFreeGoods", + body, + { + referer: `https://wxapp.msmds.cn/h5/react_web/unicom/freeTakeGoodDetail/${good.id}?source=unicom&type=02&ticket=${cookies.searchParams.ticket}&version=android@8.0102×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${cookies.searchParams.postage}&userNumber=${options.user}`, origin: "https://wxapp.msmds.cn", - }, - url: `https://wxapp.msmds.cn/jplus/api/channel/integral/free/goods/doFreeGoods`, - method: "POST", - data: transParams({ - channelId: "LT_channel", - code: "", - flag: "", - id: good.id, - phone: phone, - sourceCode: "lt_freeTake", - taskId: "", - token: cookies.ecs_token, - videoOrderNo: params.orderId, - }), - }); + } + ); // console.log(result.data); if (result.data.code !== 2000) { console.log(result.data.msg); diff --git a/commands/tasks/unicom/handlers/dailyEvent.js b/commands/tasks/unicom/handlers/dailyEvent.js index 3b1e88d7f..df7e822c0 100644 --- a/commands/tasks/unicom/handlers/dailyEvent.js +++ b/commands/tasks/unicom/handlers/dailyEvent.js @@ -1,7 +1,9 @@ const useragent = require("./myPhone").useragent; let AES = require("./PAES"); /** - * @param {String} url request url absolute path + * + * @param {*} url request url absolute path + * @param {*} cnf = {base 平台类别[msmds,]如果是自身平台无需参数绑定 } */ let getOpenPlatLine = (url, cnf = { base: "" }) => { return async (axios, options) => { diff --git a/commands/tasks/unicom/handlers/gameUtils.js b/commands/tasks/unicom/handlers/gameUtils.js index 77a276087..35bc590f5 100644 --- a/commands/tasks/unicom/handlers/gameUtils.js +++ b/commands/tasks/unicom/handlers/gameUtils.js @@ -1,3 +1,6 @@ +let AES = require("./PAES"); +let { useragent } = require("./myPhone"); + let transParams = (data) => { let params = new URLSearchParams(); for (let item in data) { @@ -8,67 +11,71 @@ let transParams = (data) => { let sleep = async (seconds) => { console.log(`☕ 等待${seconds}秒再继续`); // eslint-disable-next-line no-unused-vars - return new Promise((resolve, reject) => setTimeout(resolve, seconds * 1000)); + return new Promise((resolve) => setTimeout(resolve, seconds * 1000)); }; -//OLD=>NEW -var codeMap = { - 945510695: "945535750", //android-游戏频道看视频得积分2-激励视频 - 945490759: "945535754", //android-买什么都省0.1元薅羊毛-激励视频 - 945490446: "945535421", //android-阅读每日读书福利广告2-激励视频 - 945490436: "945535424", //android-阅读每日读书福利广告1-激励视频 - 945490433: "945535429", //android-阅读打卡视频广告2-激励视频 - 945488048: "945535497", //android-买什么都省刮机票-激励视频 - 945485144: "945535532", //android-签到领福利赚积分翻牌活动-激励视频 - 945479131: "945535537", //android-分享看视频翻倍得积分-激励视频 - 945474727: "945535596", //android-签到看视频得积分2-激励视频 - 945444936: "945535612", //android-签到领福利赚积分-激励视频 - 945432413: "945535616", //android-阅读打卡看视频得积分-激励视频 - 945430422: "945535625", //android-签到任务读小说赚积分-激励视频 - 945413733: "945535626", //android-沃之树看视频得浇水机会-激励视频 - 945399856: "945535628", //android-沃之树看视频发流量-激励视频 - 945398647: "945535629", //android-签到小游戏盲盒4-激励视频 - 945398637: "945535631", //android-签到小游戏盲盒3-激励视频 - 945398632: "945535632", //android-签到小游戏盲盒2-激励视频 - 945398627: "945535633", //android-签到小游戏盲盒-激励视频 - 945369958: "945535634", //android-积分商城积分夺宝-激励视频 - 945369931: "945535635", //android-积分商城女神口红-激励视频 - 945369805: "945535636", //android-积分商城小游戏-激励视频 - 945363378: "945535637", //android-买什么都省刮刮卡积分翻倍-激励视频 - 945363376: "945535641", //android-买什么都省刮刮卡-激励视频 - 945358647: "945535673", //android-阅读章节视频得积分2-激励视频 - 945358646: "945535674", //android-阅读章节视频得积分1-激励视频 - 945349372: "945535675", //android-买什么都省神奇便利店2-激励视频 - 945349368: "945535676", //android-买什么都省神奇便利店-激励视频 - 945340295: "945535677", //android-聚人气看视频得助力-激励视频 - 945339639: "945535679", //android-签到小游戏买幸运转转赚4-激励视频 - 945339636: "945535680", //android-签到小游戏买扭蛋机4-激励视频 - 945339630: "945535681", //android-签到小游戏买幸运转转赚3-激励视频 - 945339624: "945535683", //android-签到小游戏买扭蛋机3-激励视频 - 945339619: "945535684", //android-签到小游戏买幸运转转赚2-激励视频 - 945339610: "945535686", //android-签到小游戏买扭蛋机2-激励视频 - 945318810: "945535689", //android-签到小游戏买什么都省免费夺宝-激励视频 - 945318808: "945535693", //android-签到小游戏买什么都省申请便利店抽奖-激励视频 - 945318805: "945535695", //android-签到小游戏买什么都省转盘抽奖-激励视频 - 945292330: "945535698", //android-沃砍看视频砍价-激励视频 - 945290261: "945535700", //ios-游戏佰多惠看视频得道具-激励视频 - 945281443: "945535703", //android-业务查询看视频得积分-激励视频 - 945254827: "945535704", //android-签到看视频得积分-激励视频 - 945254821: "945535705", //android-福利订单看视频得积分-激励视频 - 945254816: "945535706", //android-10分精彩看视频得积分-激励视频 - 945235460: "945535707", //android-签到小游戏-激励视频 - 945228773: "945535710", //android-签到任务看视频领流量-激励视频 - 945228768: "945535712", //android-游戏漫乐游看视频得道具-激励视频 - 945228766: "945535714", //android-游戏杭州西米看视频得道具-激励视频 - 945228764: "945535718", //android-游戏悠游看视频得道具-激励视频 - 945228762: "945535724", //android-游戏触推河北看视频得道具-激励视频 - 945228759: "945535729", //android-游戏互娱看视频得道具-激励视频 - 945210860: "945535731", //android-游戏深圳微应看视频得道具-激励视频 - 945188117: "945535734", //android-游戏掌上乐游看视频得道具-激励视频 - 945188116: "945535736", //android-游戏频道看视频得积分-激励视频 - 945188114: "945535740", //android-阅读计时器看视频得积分-激励视频 - 945188112: "945535743", //android-签到看视频翻倍得积分-激励视频 + +/** + * 加密用户电话号码 + * @param {string} phone 明文电话号码 + */ +let encodePhone = (phone) => { + return AES.encryptPhone(phone, "gb6YCccUvth75Tm2"); }; +/** + * 各平台游戏请求封装 + */ +const Referer_msmds = `https://wxapp.msmds.cn/`; +const Origin_msmds = `https://wxapp.msmds.cn/`; +class UnicomRequest { + axios; + options; + constructor(axios, options) { + this.axios = axios; + this.options = options; + } + async postMsmds( + url, + data, + headers = { referer: null, origin: null }, + USER_AGENTS = null + ) { + return await this.axios.request({ + headers: { + "user-agent": USER_AGENTS ? USER_AGENTS : useragent(this.options), + referer: headers.referer ? headers.referer : Referer_msmds, + origin: headers.origin ? headers.origin : Origin_msmds, + }, + url, + method: "POST", + data: transParams(data), + }); + } + async getMsmds( + url, + data, + headers = { referer: null, origin: null }, + USER_AGENTS = null + ) { + return await axios.request({ + // baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": USER_AGENTS ? USER_AGENTS : useragent(this.options), + referer: headers.referer ? headers.referer : Referer_msmds, + origin: headers.origin ? headers.origin : Origin_msmds, + }, + url, + method: "GET", + params: transParams(data), + }); + } +} + module.exports = { transParams, sleep, + encodePhone, + UnicomRequest, }; + +//OLD=>NEW +// eslint-disable-next-line no-unused-vars diff --git a/package-lock.json b/package-lock.json index 9f633761f..8bd4e6987 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,12 +5,23 @@ "requires": true, "dependencies": { "@babel/code-frame": { - "version": "7.12.13", - "resolved": "https://registry.npm.taobao.org/@babel/code-frame/download/@babel/code-frame-7.12.13.tgz?cache=0&sync_timestamp=1612314635887&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fcode-frame%2Fdownload%2F%40babel%2Fcode-frame-7.12.13.tgz", - "integrity": "sha1-3PyCa+72XnXFDiHTg319lXmN1lg=", + "version": "7.12.11", + "resolved": "https://registry.npm.taobao.org/@babel/code-frame/download/@babel/code-frame-7.12.11.tgz?cache=0&sync_timestamp=1612314635887&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fcode-frame%2Fdownload%2F%40babel%2Fcode-frame-7.12.11.tgz", + "integrity": "sha1-9K1DWqJj25NbjxDyxVLSP7cWpj8=", "dev": true, "requires": { - "@babel/highlight": "^7.12.13" + "@babel/highlight": "^7.10.4" + } + }, + "@babel/eslint-parser": { + "version": "7.12.16", + "resolved": "https://registry.npm.taobao.org/@babel/eslint-parser/download/@babel/eslint-parser-7.12.16.tgz", + "integrity": "sha1-4j1aOYae96DRUeEVAqs2vIY54gs=", + "dev": true, + "requires": { + "eslint-scope": "5.1.0", + "eslint-visitor-keys": "^1.3.0", + "semver": "^6.3.0" } }, "@babel/helper-validator-identifier": { @@ -938,12 +949,12 @@ "dev": true }, "eslint": { - "version": "7.19.0", - "resolved": "https://registry.npm.taobao.org/eslint/download/eslint-7.19.0.tgz", - "integrity": "sha1-ZxliGxlrX61y5DOHmBMU5dDcP0E=", + "version": "7.20.0", + "resolved": "https://registry.npm.taobao.org/eslint/download/eslint-7.20.0.tgz", + "integrity": "sha1-2wfEyk7aLiMW56pXrH/JHsVQvcc=", "dev": true, "requires": { - "@babel/code-frame": "^7.0.0", + "@babel/code-frame": "7.12.11", "@eslint/eslintrc": "^0.3.0", "ajv": "^6.10.0", "chalk": "^4.0.0", @@ -955,7 +966,7 @@ "eslint-utils": "^2.1.0", "eslint-visitor-keys": "^2.0.0", "espree": "^7.3.1", - "esquery": "^1.2.0", + "esquery": "^1.4.0", "esutils": "^2.0.2", "file-entry-cache": "^6.0.0", "functional-red-black-tree": "^1.0.1", @@ -1001,6 +1012,22 @@ "ms": "2.1.2" } }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npm.taobao.org/eslint-scope/download/eslint-scope-5.1.1.tgz?cache=0&sync_timestamp=1599933589759&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint-scope%2Fdownload%2Feslint-scope-5.1.1.tgz", + "integrity": "sha1-54blmmbLkrP2wfsNUIqrF0hI9Iw=", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "eslint-visitor-keys": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/eslint-visitor-keys/download/eslint-visitor-keys-2.0.0.tgz?cache=0&sync_timestamp=1597435347526&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint-visitor-keys%2Fdownload%2Feslint-visitor-keys-2.0.0.tgz", + "integrity": "sha1-If3I+82ceVzAMh8FY3AglXUVEag=", + "dev": true + }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz", @@ -1055,12 +1082,12 @@ } }, "eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npm.taobao.org/eslint-scope/download/eslint-scope-5.1.1.tgz?cache=0&sync_timestamp=1599933589759&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint-scope%2Fdownload%2Feslint-scope-5.1.1.tgz", - "integrity": "sha1-54blmmbLkrP2wfsNUIqrF0hI9Iw=", + "version": "5.1.0", + "resolved": "https://registry.npm.taobao.org/eslint-scope/download/eslint-scope-5.1.0.tgz?cache=0&sync_timestamp=1599933589759&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint-scope%2Fdownload%2Feslint-scope-5.1.0.tgz", + "integrity": "sha1-0Plx3+WcaeDK2mhLI9Sdv4JgDOU=", "dev": true, "requires": { - "esrecurse": "^4.3.0", + "esrecurse": "^4.1.0", "estraverse": "^4.1.1" } }, @@ -1071,20 +1098,12 @@ "dev": true, "requires": { "eslint-visitor-keys": "^1.1.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npm.taobao.org/eslint-visitor-keys/download/eslint-visitor-keys-1.3.0.tgz?cache=0&sync_timestamp=1597435347526&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint-visitor-keys%2Fdownload%2Feslint-visitor-keys-1.3.0.tgz", - "integrity": "sha1-MOvR73wv3/AcOk8VEESvJfqwUj4=", - "dev": true - } } }, "eslint-visitor-keys": { - "version": "2.0.0", - "resolved": "https://registry.npm.taobao.org/eslint-visitor-keys/download/eslint-visitor-keys-2.0.0.tgz?cache=0&sync_timestamp=1597435347526&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint-visitor-keys%2Fdownload%2Feslint-visitor-keys-2.0.0.tgz", - "integrity": "sha1-If3I+82ceVzAMh8FY3AglXUVEag=", + "version": "1.3.0", + "resolved": "https://registry.npm.taobao.org/eslint-visitor-keys/download/eslint-visitor-keys-1.3.0.tgz?cache=0&sync_timestamp=1597435347526&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint-visitor-keys%2Fdownload%2Feslint-visitor-keys-1.3.0.tgz", + "integrity": "sha1-MOvR73wv3/AcOk8VEESvJfqwUj4=", "dev": true }, "espree": { @@ -1096,14 +1115,6 @@ "acorn": "^7.4.0", "acorn-jsx": "^5.3.1", "eslint-visitor-keys": "^1.3.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npm.taobao.org/eslint-visitor-keys/download/eslint-visitor-keys-1.3.0.tgz?cache=0&sync_timestamp=1597435347526&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint-visitor-keys%2Fdownload%2Feslint-visitor-keys-1.3.0.tgz", - "integrity": "sha1-MOvR73wv3/AcOk8VEESvJfqwUj4=", - "dev": true - } } }, "esprima": { @@ -2808,9 +2819,9 @@ }, "dependencies": { "ajv": { - "version": "7.0.4", - "resolved": "https://registry.npm.taobao.org/ajv/download/ajv-7.0.4.tgz", - "integrity": "sha1-gn5fWuMvXlwWN9th8lOhEiKbXi8=", + "version": "7.1.0", + "resolved": "https://registry.npm.taobao.org/ajv/download/ajv-7.1.0.tgz?cache=0&sync_timestamp=1613033016878&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv%2Fdownload%2Fajv-7.1.0.tgz", + "integrity": "sha1-+YLqeTPcfxAS6unuxahmh9gFQhs=", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", @@ -2907,7 +2918,7 @@ }, "type-fest": { "version": "0.8.1", - "resolved": "https://registry.npm.taobao.org/type-fest/download/type-fest-0.8.1.tgz?cache=0&sync_timestamp=1606470665567&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftype-fest%2Fdownload%2Ftype-fest-0.8.1.tgz", + "resolved": "https://registry.npm.taobao.org/type-fest/download/type-fest-0.8.1.tgz?cache=0&sync_timestamp=1613149957486&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftype-fest%2Fdownload%2Ftype-fest-0.8.1.tgz", "integrity": "sha1-CeJJ696FHTseSNJ8EFREZn8XuD0=", "dev": true }, diff --git a/package.json b/package.json index 5db40ae9b..003cadb84 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,8 @@ "yargs": "^16.1.0" }, "devDependencies": { - "eslint": "^7.19.0", + "@babel/eslint-parser": "^7.12.16", + "eslint": "^7.20.0", "eslint-config-prettier": "^7.2.0", "eslint-plugin-prettier": "^3.3.1", "prettier": "2.2.1", From b49b04257aaa527dd5ef5795bf5180809dd97ffb Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Sun, 14 Feb 2021 14:29:08 +0800 Subject: [PATCH 077/128] =?UTF-8?q?=F0=9F=8F=B3=E2=80=8D=F0=9F=8C=88=20upd?= =?UTF-8?q?ated=20task=20bawangCard?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By cooip --- commands/tasks/unicom/dailyBaWangcard.js | 200 +++++++++++++++++++++++ commands/tasks/unicom/unicom.js | 12 +- 2 files changed, 211 insertions(+), 1 deletion(-) create mode 100644 commands/tasks/unicom/dailyBaWangcard.js diff --git a/commands/tasks/unicom/dailyBaWangcard.js b/commands/tasks/unicom/dailyBaWangcard.js new file mode 100644 index 000000000..2073b0fbc --- /dev/null +++ b/commands/tasks/unicom/dailyBaWangcard.js @@ -0,0 +1,200 @@ +var crypto = require("crypto"); +var moment = require("moment"); +const gameEvents = require("./handlers/dailyEvent"); +let { sign } = require("./handlers/PAES.js"); +const { sleep, UnicomRequest, encodePhone } = require("./handlers/gameUtils"); +// 霸王餐刮刮卡 +let dailyBaWangcard = { + getOpenPlatLine: gameEvents.getOpenPlatLine( + `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://wxapp.msmds.cn/h5/react_web/unicom/luckCardPage&duanlianjieabc=tbkd2`, + { base: "msmds" } + ), + doTask: async (axios, options) => { + console.log("🤔 刮刮霸王餐开始..."); + let phone = encodePhone(options.user); + let cookies = await dailyBaWangcard.getOpenPlatLine(axios, options); + let times = await dailyBaWangcard.getScratchCardNum(axios, options, { + ...cookies, + phone, + }); + await dailyBaWangcard.postScratch( + axios, + options, + { ...cookies, phone }, + times + ); + }, + getScratchCardNum: async ( + axios, + options, + // eslint-disable-next-line no-unused-vars + { ecs_token, searchParams, jar1, phone } + ) => { + let request = new UnicomRequest(axios, options); + let result = await request.postMsmds( + "https://wxapp.msmds.cn/jplus/api/scratchCardRecord/getScratchCardNum", + { + channelId: "unicom_scratch_card", + phone: phone, + token: ecs_token, + }, + { + referer: `https://wxapp.msmds.cn/`, + origin: "https://wxapp.msmds.cn", + } + ); + if (result.data.code !== 200) { + throw new Error("❌ something errors: ", result.data.msg); + } + return { + freeTimes: result.data.data.surplusNum, + advertTimes: result.data.data.canLookVideo + ? 4 - result.data.data.playNum + : 0, + }; + }, + postScratch: async ( + axios, + options, + { ecs_token, searchParams, jar1, phone }, + { freeTimes, advertTimes } + ) => { + do { + console.log( + "已消耗机会", + 1 + 4 - (freeTimes + advertTimes), + "剩余免费机会", + freeTimes, + "看视频广告机会", + advertTimes + ); + if (!freeTimes && advertTimes) { + console.log("视频补充"); + let params = { + arguments1: "AC20200716103629", // acid + arguments2: "GGPD", // yhChannel + arguments3: "9e368d7f6c474cc8a1491d6a9fabad45", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "517050707", + arguments7: "517050707", + arguments8: "123456", + arguments9: "4640b530b3f7481bb5821c6871854ce5", + netWay: "Wifi", + remark1: "签到小游戏刮刮卡", + remark: "签到页小游戏", + version: `android@8.0102`, + codeId: 945363379, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + params["orderId"] = crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"); + params["arguments4"] = new Date().getTime(); + console.log("看视频广告中..."); + let result = await require("./taskcallback").reward(axios, { + ...options, + params, + jar: jar1, + }); + console.log(`广告ID:`, result["orderId"]); + // channelId=unicom_scratch_card&phone=J0c5lPxzAsbEhu4SB7h%2BDg%3D%3D&num=4&token=eyJkYXRhIjoiNWVjMzc1MzNjZDhiYmJhZTEwYWQ1NDMzYjIyNDJkODc2M2Q4ZWU2M2U4ZjAxYTk5OGEzNTQ2NDcwMDFmNzI3NDIyNDc0ZWNiNDM4MjJlOWI1Mjc4NjM3YjhkMzQ4ODJlZTZkMmJjZjk2OGRkNjIxMzI1ZWIwYzQ2NzMwOWVjYTFhYzVkYWQ4MjQwYWIzM2MxZTVhYTRhMDE3OWEyNWU0YWM0MzEwNGRkYTIyNzFhYzhmMTRjYTY2Mjc1MGQ2ODVlIiwidmVyc2lvbiI6IjAwIn0%3D + let body = { + channelId: "unicom_scratch_card", + phone: phone, + num: advertTimes, + token: ecs_token, + videoOrderNo: params["orderId"], + }; + let request = new UnicomRequest(axios, options); + let timestamp = moment().format("YYYYMMDDHHmmss"); + let { data } = await request.postMsmds( + "https://wxapp.msmds.cn/jplus/api/scratchCardRecord/addScratchCardNum", + body, + { + referer: `https://wxapp.msmds.cn/h5/react_web/unicom/luckCardPage?source=unicom&type=06&ticket=${searchParams.ticket}&version=android@8.0102×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&duanlianjieabc=tbkd2&userNumber=${options.user}`, + } + ); + + console.log("观看视频得机会..."); + await sleep(30); + if (data.code !== 200) { + console.log("提交任务失败", data.msg); + break; + } else { + console.log("提交任务成功", `${data.data.msg}`); + } + advertTimes--; + } else { + freeTimes--; + } + + let body = { + channelId: "unicom_scratch_card", + phone: phone, + token: ecs_token, + flag: "", + taskId: "", + }; + // https://wxapp.msmds.cn/h5/react_web/unicom/luckCardPage?ticket=nep4v4jza360c1dc9a946b8c51c892d7f3af8f02jadbs3o7&type=06&version=iphone_c@8.0102×tamp=20210214112354&desmobile=这是电话号码&num=0&postage=494bef815366a0e8007c66d19f38ec07&duanlianjieabc=tbkd2&userNumber=这是电话号码 + let request = new UnicomRequest(axios, options); + let timestamp = moment().format("YYYYMMDDHHmmss"); + let { data } = await request.postMsmds( + "https://wxapp.msmds.cn/jplus/api/scratchCardRecord/scratchCard", + body, + { + referer: `https://wxapp.msmds.cn/h5/react_web/unicom/luckCardPage?source=unicom&type=06&ticket=${searchParams.ticket}&version=android@8.0102×tamp=${timestamp}&desmobile=${options.user}&num=0&postage=${searchParams.postage}&duanlianjieabc=tbkd2&userNumber=${options.user}`, + } + ); + console.log( + "🎉 刮刮卡结果:", + data.data.msg, + data.data.giftNum ? `+${data.data.giftNum}积分` : "" + ); + if (data.data["canDouble"]) { + console.log("准备翻倍积分..."); + await sleep(30); + await dailyBaWangcard.lookVideoDouble(axios, options); + } + await sleep(15); + //对循环多跑一次 + } while (freeTimes >= 0 || advertTimes > 0); + }, + lookVideoDouble: gameEvents.lookVideoDouble( + { + arguments1: "AC20200716103629", + arguments2: "GGPD", + arguments3: "9e368d7f6c474cc8a1491d6a9fabad45", + arguments4: new Date().getTime(), + arguments6: "517050707", + netWay: "Wifi", + version: `android@8.0102`, + }, + { + arguments1: "AC20200716103629", // acid + arguments2: "GGPD", // yhChannel + arguments3: "9e368d7f6c474cc8a1491d6a9fabad45", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "517050707", + arguments7: "517050707", + arguments8: "123456", + arguments9: "4640b530b3f7481bb5821c6871854ce5", + orderId: crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"), + netWay: "Wifi", + remark: "签到小游戏翻倍得积分", + version: `android@8.0102`, + codeId: 945689604, + }, + "刮刮卡" + ), +}; + +module.exports = dailyBaWangcard; diff --git a/commands/tasks/unicom/unicom.js b/commands/tasks/unicom/unicom.js index 2a4fde5a6..c0c3aa700 100644 --- a/commands/tasks/unicom/unicom.js +++ b/commands/tasks/unicom/unicom.js @@ -12,7 +12,7 @@ * 首页-小说-读满10章赢好礼 * 首页-小说-阅读福利抽大奖 * 首页-签到有礼-免费领-浏览领积分 - * 首页-签到有礼-免费拿-看视频夺宝 TODO:易出现本次操作需要进行验证,暂时注释 + * 首页-签到有礼-免费拿-看视频夺宝 * 首页-签到有礼-免费抽-抓OPPO手机 * 首页-签到有礼-免费抽-拿666积分-豪礼大派送抽奖 * 首页-签到有礼-免费抽-拿苹果iPad Pro(摇一摇) @@ -24,6 +24,8 @@ * 首页-签到有礼-赚更多福利-看视频奖励5积分 * 首页-签到有礼-赚更多福利-天天抽好礼 * 首页-签到有礼-居家娱乐馆 + * 首页-签到有礼-免费抽霸王餐 + * 首页-签到有礼-聚宝盆 [广告图] * 首页-游戏-娱乐中心-每日打卡 * 首页-游戏-娱乐中心-天天领取3G流量包 * 首页-游戏-娱乐中心-每日打卡-完成今日任务(200m) @@ -412,6 +414,14 @@ var start = async (params) => { }, taskOption ); + //首页-签到有礼-免费抽霸王餐 + await scheduler.regTask( + "dailyBaWangcard", + async (request) => { + await require("./dailyBaWangcard.js").doTask(request, options); + }, + taskOption + ); }; module.exports = { start, From f6418d3e39a068417c185dcde11e538a6b8e4573 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Sun, 14 Feb 2021 16:46:04 +0800 Subject: [PATCH 078/128] =?UTF-8?q?=F0=9F=90=8D=20=20fixed=20bugs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/handlers/dailyEvent.js | 2 +- commands/tasks/unicom/handlers/gameUtils.js | 34 +++++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/commands/tasks/unicom/handlers/dailyEvent.js b/commands/tasks/unicom/handlers/dailyEvent.js index df7e822c0..bb8edd5f0 100644 --- a/commands/tasks/unicom/handlers/dailyEvent.js +++ b/commands/tasks/unicom/handlers/dailyEvent.js @@ -3,7 +3,7 @@ let AES = require("./PAES"); /** * * @param {*} url request url absolute path - * @param {*} cnf = {base 平台类别[msmds,]如果是自身平台无需参数绑定 } + * @param {*} cnf = {base 平台类别[msmds,]如果是自身平台无需参数绑定 */ let getOpenPlatLine = (url, cnf = { base: "" }) => { return async (axios, options) => { diff --git a/commands/tasks/unicom/handlers/gameUtils.js b/commands/tasks/unicom/handlers/gameUtils.js index 35bc590f5..99d6256d6 100644 --- a/commands/tasks/unicom/handlers/gameUtils.js +++ b/commands/tasks/unicom/handlers/gameUtils.js @@ -1,5 +1,6 @@ let AES = require("./PAES"); let { useragent } = require("./myPhone"); +let gameEvents = require("./dailyEvent"); let transParams = (data) => { let params = new URLSearchParams(); @@ -56,7 +57,7 @@ class UnicomRequest { headers = { referer: null, origin: null }, USER_AGENTS = null ) { - return await axios.request({ + return await this.axios.request({ // baseURL: "https://m.client.10010.com/", headers: { "user-agent": USER_AGENTS ? USER_AGENTS : useragent(this.options), @@ -69,6 +70,37 @@ class UnicomRequest { }); } } +/** + * 针对通用活动业务封装后得组件库 + */ +class UnicomComponent { + axios; + options; + UA; + phone; + task; + constructor(axios, options, taskname, platform = "") { + this.axios = axios; + this.options = options; + this.phone = encodePhone(options.user); + this.UA = useragent(options); + this.platform = platform; + this.taskname = taskname; + } + async do(title, callback = function () {}) { + return async () => { + task[title] = callback(); + }; + } + async login(url) { + return gameEvents.getOpenPlatLine( + url.indexOf("openPlatLine.htm") > -1 + ? url + : `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=${url}`, + { base: this.platform } + ); + } +} module.exports = { transParams, From 486d5be21f03baa0eadc0e7978bc597a7bebfcb8 Mon Sep 17 00:00:00 2001 From: cooip-jm <78735965+cooip-jm@users.noreply.github.com> Date: Mon, 15 Feb 2021 01:06:53 +0800 Subject: [PATCH 079/128] Create book5video.js --- commands/tasks/unicom/book5video.js | 98 +++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 commands/tasks/unicom/book5video.js diff --git a/commands/tasks/unicom/book5video.js b/commands/tasks/unicom/book5video.js new file mode 100644 index 000000000..7a0dcd347 --- /dev/null +++ b/commands/tasks/unicom/book5video.js @@ -0,0 +1,98 @@ +//看书里面的5个视频 +//活动入口:主页-小说标签-任意一本小说内页章节中间 +var crypto = require("crypto"); +var sign = (data) => { + let str = "integralofficial&"; + let params = []; + data.forEach((v, i) => { + if (v) { + params.push("arguments" + (i + 1) + v); + } + }); + return crypto + .createHash("md5") + .update(str + params.join("&")) + .digest("hex"); +}; +let account = { + yhTaskId: "5a6dd5106495402d9dcc5e801f3171b3", + yhChannel: "GGPD", + accountChannel: "517050707", + accountUserName: "517050707", + accountPassword: "123456", + accountToken: "4640b530b3f7481bb5821c6871854ce5", +}; +var book5video = { + query: async (request, options) => { + let params = { + arguments1: "AC20200624091508", // acid + arguments2: account.yhChannel, // yhChannel + arguments3: account.yhTaskId, // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: account.accountChannel, + netWay: "Wifi", + version: `android@8.0102`, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + return await require("./taskcallback").query(request, { + ...options, + params, + }); + }, + doTask: async (request, options) => { + console.log("🐀 看书看累了看看广告..."); + let { + num, + jar + } = await book5video.query(request, options); + console.log(num); + + if (!num) { + console.log("🐀 看书中广告得积分: 今日已完成"); + return; + } + do { + console.log("还有", num, "次"); + let params = { + arguments1: "AC20200521222721", // acid + arguments2: account.yhChannel, // yhChannel + arguments3: account.yhTaskId, // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "", + arguments7: "woyuedu", + arguments8: "a123456", + arguments9: "", + orderId: crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"), + netWay: "Wifi", + remark: "章节视频得积分", + version: `android@8.0102`, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + await require("./taskcallback").doTask(request, { + ...options, + params, + jar, + }); + + let s = Math.floor(Math.random() * 20); + console.log("☕ 等待%s秒再继续", s); + // eslint-disable-next-line no-unused-vars + await new Promise((resolve, reject) => setTimeout(resolve, s * 1000)); + } while (--num); + }, +}; + +module.exports = book5video; From 52a5e10fa01408914491d21f7b01512f1ad35765 Mon Sep 17 00:00:00 2001 From: cooip-jm <78735965+cooip-jm@users.noreply.github.com> Date: Mon, 15 Feb 2021 10:20:26 +0800 Subject: [PATCH 080/128] Update book5video.js fix bug --- commands/tasks/unicom/book5video.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/commands/tasks/unicom/book5video.js b/commands/tasks/unicom/book5video.js index 7a0dcd347..824ca41d2 100644 --- a/commands/tasks/unicom/book5video.js +++ b/commands/tasks/unicom/book5video.js @@ -19,17 +19,17 @@ let account = { yhChannel: "GGPD", accountChannel: "517050707", accountUserName: "517050707", - accountPassword: "123456", + accountPassword: "a123456", accountToken: "4640b530b3f7481bb5821c6871854ce5", }; var book5video = { query: async (request, options) => { let params = { - arguments1: "AC20200624091508", // acid + arguments1: "AC20200521222721", // acid arguments2: account.yhChannel, // yhChannel arguments3: account.yhTaskId, // yhTaskId menuId arguments4: new Date().getTime(), // time - arguments6: account.accountChannel, + arguments6: "", netWay: "Wifi", version: `android@8.0102`, }; @@ -50,14 +50,14 @@ var book5video = { num, jar } = await book5video.query(request, options); - console.log(num); +// console.log(num); if (!num) { console.log("🐀 看书中广告得积分: 今日已完成"); return; } do { - console.log("还有", num, "次"); +// console.log("还有", num, "次"); let params = { arguments1: "AC20200521222721", // acid arguments2: account.yhChannel, // yhChannel @@ -74,6 +74,7 @@ var book5video = { netWay: "Wifi", remark: "章节视频得积分", version: `android@8.0102`, + //orderId: "0923fca6d5ffb8ec017fc6b3cbc5c9c0", }; params["sign"] = sign([ params.arguments1, @@ -87,7 +88,7 @@ var book5video = { jar, }); - let s = Math.floor(Math.random() * 20); + let s = Math.floor(Math.random() * 30); console.log("☕ 等待%s秒再继续", s); // eslint-disable-next-line no-unused-vars await new Promise((resolve, reject) => setTimeout(resolve, s * 1000)); From 1b8590201609d5e779462376ef2531735e50a19f Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Tue, 16 Feb 2021 17:38:36 +0800 Subject: [PATCH 081/128] =?UTF-8?q?=F0=9F=8F=B3=E2=80=8D=F0=9F=8C=88=20upd?= =?UTF-8?q?ated=20tasks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/dailyFingerqd.js | 235 +++++++++++++++++++ commands/tasks/unicom/dailyVideoFreeGoods.js | 23 +- commands/tasks/unicom/freeDownFloorAd.js | 25 ++ commands/tasks/unicom/handlers/dailyEvent.js | 46 +++- commands/tasks/unicom/handlers/gameUtils.js | 165 +++++++++++-- commands/tasks/unicom/test.js | 44 ++++ commands/tasks/unicom/unicom.js | 21 ++ utils/scheduler.js | 5 + 8 files changed, 539 insertions(+), 25 deletions(-) create mode 100644 commands/tasks/unicom/dailyFingerqd.js create mode 100644 commands/tasks/unicom/test.js diff --git a/commands/tasks/unicom/dailyFingerqd.js b/commands/tasks/unicom/dailyFingerqd.js new file mode 100644 index 000000000..56afa814f --- /dev/null +++ b/commands/tasks/unicom/dailyFingerqd.js @@ -0,0 +1,235 @@ +const { + UnicomComponent, + generateOrderid, + sleep, +} = require("./handlers/gameUtils"); +let crypto = require("crypto"); +const gameEvents = require("./handlers/dailyEvent"); +const AES = require("./handlers/PAES"); +let dailyFingerqd = { + doTask: async (axios, options) => { + console.log("😒 猜拳拿奖...开始"); + let request = new UnicomComponent(axios, options, "猜拳拿奖"); + //登录平台 + let cookies = await request.login( + "https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://m.jf.10010.com/jf-order/avoidLogin/forActive/fingerSignq&duanlianjieabc=tbKFo" + ); + let times = await request.postFreeLoginGuess( + "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/fingerqd/index.html?jump=sign", + "Ac-yc0001,Ac-yc0002,Ac-yc0003", + cookies, + (data) => { + return { + //默认只和刘备猜拳 + freeTimes: + data.data.activityInfos.activityVOs[0].activityTimesInfo.freeTimes, + advertTimes: + data.data.activityInfos.activityVOs[0].activityTimesInfo + .advertTimes, + Authorization: data.data.token.access_token, + }; + } + ); + await dailyFingerqd.playGames(axios, options, cookies, times); + }, + playGames: async ( + axios, + options, + { ecs_token, searchParams, jar1 }, + { Authorization, freeTimes, advertTimes } + ) => { + let request = new UnicomComponent(axios, options, "猜拳拿奖"); + do { + console.log( + "已消耗机会", + 1 + 4 - (freeTimes + advertTimes), + "剩余免费机会", + freeTimes, + "看视频广告机会", + advertTimes + ); + let playParams; + //免费机会为0,需要看视频 + if (!freeTimes && advertTimes) { + console.log("视频补充"); + let params = { + arguments1: "AC20200611152252", // acid + arguments2: "GGPD", // yhChannel + arguments3: "627292f1243148159c58fd58917c3e67", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "517050707", + arguments7: "517050707", + arguments8: "123456", + arguments9: "4640b530b3f7481bb5821c6871854ce5", + netWay: "Wifi", + remark1: "签到小游戏猜拳拿奖", + remark: "签到页小游戏", + version: `android@8.0102`, + codeId: 945757409, + }; + params["sign"] = AES.sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + params["orderId"] = crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"); + params["arguments4"] = new Date().getTime(); + + let result = await require("./taskcallback").reward(axios, { + ...options, + params, + jar: jar1, + }); + console.log(result); + playParams = { + activityId: "Ac-yc0002", + currentTimes: advertTimes, + type: "广告", + integral: 50, + orderId: params["orderId"], + phoneType: "android", + version: "8.0102", + }; + await sleep(30); + advertTimes--; + // eslint-disable-next-line no-unused-vars + } else { + playParams = { + activityId: "Ac-yc0002", + currentTimes: freeTimes, + integral: 50, + type: "免费", + }; + freeTimes--; + } + + let body = gameEvents.encodeParams(playParams, true); + let config = { + url: `https://m.jf.10010.com/jf-yuech/api/gameResultV2/minusRondGames`, + body, + method: "POST", + headers: { + Authorization: `Bearer ${Authorization}`, + referer: + "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/fingerqd/index.html?jump=sign", + options: "https://m.jf.10010.com", + }, + }; + let { data } = await request.get(config); + // console.log(data); + if (data.code !== 0) { + throw new Error("something went wrong:", data.message); + } + //游戏要进行三轮,如果得不到积分就机会-1 正常情况是玩不到三轮的. + let roundId = data.data.roundGame.roundId; + let gamebits = { + activityId: "Ac-yc0002", + resultId: roundId, + }; + for (let i = 0; i < 2; i++) { + console.log(`第${i + 1}轮猜拳...`); + await sleep(10); + let body = gameEvents.encodeParams(gamebits, true); + let config = { + url: `https://m.jf.10010.com/jf-yuech/api/gameResultV2/roundGameForPrize`, + body: body, + method: "POST", + headers: { + Authorization: `Bearer ${Authorization}`, + referer: + "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/fingerqd/index.html?jump=sign", + options: "https://m.jf.10010.com", + }, + }; + let { data } = await request.get(config); + // console.log(data); + if (data.code !== 0) { + console.log("猜拳拿奖:", data.message); + } else { + console.log( + "猜拳拿奖:", + data.data.drawResultPO !== null + ? data.data.drawResultPO.prizeName + : "未中奖" + ); + if ( + data.data.drawResultPO !== null && + data.data.drawResultPO.doublingStatus + ) { + console.log("🌈 提交积分翻倍"); + await sleep(30); + await dailyFingerqd.lookVideoDouble(axios, { + ...options, + }); + await dailyFingerqd.lookVideoDoubleResult(axios, { + ...options, + Authorization, + activityId: `Ac-yc0002`, + winningRecordId: data.data.drawResultPO.winningRecordId, + }); + } + } + } + } while (freeTimes || advertTimes); + }, + lookVideoDouble: async (axios, options) => { + let params = { + arguments1: "AC20200611152252", + arguments2: "GGPD", + arguments3: "627292f1243148159c58fd58917c3e67", + arguments4: new Date().getTime(), + arguments6: "517050707", + netWay: "Wifi", + version: `android@8.0102`, + }; + params["sign"] = AES.sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + let { num, jar } = await require("./taskcallback").query(axios, { + ...options, + params, + }); + + if (!num) { + console.log("签到小游戏猜拳: 今日已完成"); + return; + } + + params = { + arguments1: "AC20200611152252", // acid + arguments2: "GGPD", // yhChannel + arguments3: "627292f1243148159c58fd58917c3e67", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "", + arguments7: "", + arguments8: "", + arguments9: "", + orderId: generateOrderid(), + netWay: "Wifi", + remark: "签到小游戏猜拳拿奖", + version: `android@8.0100`, + codeId: 945689604, + }; + params["sign"] = AES.sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + await require("./taskcallback").doTask(axios, { + ...options, + params, + jar, + }); + }, + lookVideoDoubleResult: gameEvents.lookVideoDoubleResult("猜拳拿奖"), +}; + +module.exports = dailyFingerqd; diff --git a/commands/tasks/unicom/dailyVideoFreeGoods.js b/commands/tasks/unicom/dailyVideoFreeGoods.js index 60caea3b5..63c18c0a8 100644 --- a/commands/tasks/unicom/dailyVideoFreeGoods.js +++ b/commands/tasks/unicom/dailyVideoFreeGoods.js @@ -98,7 +98,19 @@ var dailyVideoFreeGoods = { // 同一期商品最多3次机会,每4小时可获得5次机会 console.log("注意本接口只获取积分!"); console.log("抽奖时,可能会出现[不存在的奖品],此状态为无库存"); - for (let good of goods) { + let desc = (key) => { + return (m, n) => { + let a = m[key].replace("积分", ""); + let b = n[key].replace("积分", ""); + return b - a; + }; + }; + let items = goods.filter((item) => { + if (item.goodsName.indexOf("积分") > -1) { + return item; + } + }); + for (let good of items.sort(desc("goodsName"))) { if (good.id !== null && good.goodsName.indexOf("积分") > -1) { console.log("开始抽奖: ", good.goodsName); params["orderId"] = crypto @@ -107,13 +119,6 @@ var dailyVideoFreeGoods = { .digest("hex"); params["arguments4"] = new Date().getTime(); - let p = { - channelId: "LT_channel", - phone: phone, - token: cookies.ecs_token, - sourceCode: "lt_freeTake", - }; - //请求抽奖次数情况 console.log("查询抽奖时效"); let timestamp = moment().format("YYYYMMDDHHmmss"); @@ -141,7 +146,7 @@ var dailyVideoFreeGoods = { .format("YYYY-MM-DD HH:mm:ss") + " 后可再次尝试,跳过" ); - break; + continue; } await sleep(30); console.log("查询抽奖接口"); diff --git a/commands/tasks/unicom/freeDownFloorAd.js b/commands/tasks/unicom/freeDownFloorAd.js index 359bcd610..d3a710021 100644 --- a/commands/tasks/unicom/freeDownFloorAd.js +++ b/commands/tasks/unicom/freeDownFloorAd.js @@ -45,6 +45,7 @@ let freeDownFloorAd = { await freeDownFloorAd.onAdAppDownloadStart(axios, options, Data); await freeDownFloorAd.onAdAppDownloadSucceed(axios, options, Data); await freeDownFloorAd.onAdAppInstall(axios, options, Data); + await freeDownFloorAd.onAdAppInstalled(axios, options, Data); await freeDownFloorAd.onAdAppActive(axios, options, Data); await freeDownFloorAd.lookVideoDouble(axios, options); await freeDownFloorAd.getIntegralFree(axios, options, jar1); @@ -206,6 +207,30 @@ let freeDownFloorAd = { // eslint-disable-next-line no-unused-vars await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); }, + onAdAppInstalled: async (axios, options, appinfo) => { + let currentTime = moment().format("YYYYMMDDHHmmssSSS"); + let traceId = "100008" + currentTime + "215210247"; + appinfo.commonInfo.traceId = traceId; + appinfo.commonInfo.currentTime = currentTime; + appinfo.params.operator = "onAdAppInstall"; + let res = await axios + .request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": "okhttp/4.4.0", + origin: "https://m.client.10010.com", + "Content-Type": "application/json;charset=UTF-8", + }, + url: `/uniAdmsInterface/getFreeDownFloorAd`, + method: "post", + data: appinfo, + }) + .catch((err) => console.log(err)); + console.log(res.data); + console.log("等待15秒再继续"); + // eslint-disable-next-line no-unused-vars + await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); + }, onAdAppActive: async (axios, options, appinfo) => { let currentTime = moment().format("YYYYMMDDHHmmssSSS"); let traceId = "100008" + currentTime + "215210247"; diff --git a/commands/tasks/unicom/handlers/dailyEvent.js b/commands/tasks/unicom/handlers/dailyEvent.js index bb8edd5f0..138f6535e 100644 --- a/commands/tasks/unicom/handlers/dailyEvent.js +++ b/commands/tasks/unicom/handlers/dailyEvent.js @@ -5,7 +5,7 @@ let AES = require("./PAES"); * @param {*} url request url absolute path * @param {*} cnf = {base 平台类别[msmds,]如果是自身平台无需参数绑定 */ -let getOpenPlatLine = (url, cnf = { base: "" }) => { +let getOpenPlatLine = (url, cnf = { base: "" }, cb = function () {}) => { return async (axios, options) => { let searchParams = {}; let result = await axios @@ -45,6 +45,7 @@ let getOpenPlatLine = (url, cnf = { base: "" }) => { switch (cnf.base) { case "msmds": console.log("🐱‍🏍 msmds游戏调度"); + cb({ ecs_token, searchParams, jar1 }); return { ecs_token, searchParams, jar1 }; default: console.log("🐱‍🏍 平台游戏调度"); @@ -53,6 +54,7 @@ let getOpenPlatLine = (url, cnf = { base: "" }) => { throw new Error("jfid缺失"); } jfid = jfid.value; + cb({ ecs_token, searchParams, jar1 }); return { jfid, searchParams, jar1 }; } }; @@ -142,7 +144,46 @@ let postFreeLogin = (referer, freeLoginID) => { return { activity, Authorization, freeTimes, advertTimes }; }; }; - +let postFreeLoginGuessWithCallBack = ( + referer, + freeLoginID, + callback = null +) => { + return async (axios, options, { jfid, searchParams, jar1 }) => { + let params = { + activityId: freeLoginID, + userCookie: jfid, + userNumber: searchParams.userNumber, + time: new Date().getTime(), + }; + let reqdata = encodeParams(params, false); + let res = await axios + .request({ + baseURL: "https://m.jf.10010.com/", + headers: { + "user-agent": useragent(options), + Authorization: "Bearer null", + referer, + origin: "https://img.jf.10010.com", + "Content-Type": "application/json", + }, + jar: jar1, + url: `/jf-yuech/p/freeLoginGuess`, + method: "post", + data: reqdata, + }) + .catch((err) => console.log(err)); + let result = res.data; + if (result.code !== 0) { + throw new Error(result.message); + } + // let activity, Authorization, freeTimes, advertTimes; + if (typeof callback === "function") { + result = callback(result); + } + return result; + }; +}; let lookVideoDoubleResult = (title) => { return async (axios, options) => { let { Authorization, activityId, winningRecordId } = options; @@ -240,4 +281,5 @@ module.exports = { lookVideoDoubleResult, encodeParams, lookVideoDouble, + postFreeLoginGuessWithCallBack, }; diff --git a/commands/tasks/unicom/handlers/gameUtils.js b/commands/tasks/unicom/handlers/gameUtils.js index 99d6256d6..61c741577 100644 --- a/commands/tasks/unicom/handlers/gameUtils.js +++ b/commands/tasks/unicom/handlers/gameUtils.js @@ -1,6 +1,7 @@ let AES = require("./PAES"); let { useragent } = require("./myPhone"); let gameEvents = require("./dailyEvent"); +let crypto = require("crypto"); let transParams = (data) => { let params = new URLSearchParams(); @@ -15,6 +16,12 @@ let sleep = async (seconds) => { return new Promise((resolve) => setTimeout(resolve, seconds * 1000)); }; +let generateOrderid = () => { + return crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"); +}; /** * 加密用户电话号码 * @param {string} phone 明文电话号码 @@ -51,6 +58,24 @@ class UnicomRequest { data: transParams(data), }); } + async post( + url, + data, + headers = { referer: null, origin: null, Authorization: null }, + USER_AGENTS = null + ) { + return await this.axios.request({ + headers: { + "user-agent": USER_AGENTS ? USER_AGENTS : useragent(this.options), + referer: headers.referer ? headers.referer : Referer_msmds, + origin: headers.origin ? headers.origin : Origin_msmds, + Authorization: headers.Authorization, + }, + url, + method: "POST", + data: data, + }); + } async getMsmds( url, data, @@ -69,6 +94,24 @@ class UnicomRequest { params: transParams(data), }); } + async get( + url, + data, + headers = { referer: null, origin: null }, + USER_AGENTS = null + ) { + return await this.axios.request({ + // baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": USER_AGENTS ? USER_AGENTS : useragent(this.options), + referer: headers.referer ? headers.referer : Referer_msmds, + origin: headers.origin ? headers.origin : Origin_msmds, + }, + url, + method: "GET", + params: data, + }); + } } /** * 针对通用活动业务封装后得组件库 @@ -78,27 +121,119 @@ class UnicomComponent { options; UA; phone; - task; - constructor(axios, options, taskname, platform = "") { + task = {}; + taskname; + cookies; + channelId; + headers; + constructor(axios, options, taskname, platform = "", appversion = "8.0102") { this.axios = axios; this.options = options; - this.phone = encodePhone(options.user); - this.UA = useragent(options); + this.options.appversion = appversion; + this.phone = encodePhone(this.options.user); + this.UA = useragent(this.options); this.platform = platform; this.taskname = taskname; } - async do(title, callback = function () {}) { - return async () => { - task[title] = callback(); + /** + * 业务注册 + * @param {string}} title 业务项目 + * @param {*} callback 回调 + */ + do(title, callback) { + this.task[title] = callback; + return this.task[title]; + } + /** + * 平台登录入口 + * @param {string} url 登录请求URL + */ + login(url) { + this.cookies = gameEvents + .getOpenPlatLine( + url.indexOf("openPlatLine.htm") > -1 + ? url + : `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=${url}`, + { base: this.platform }, + (cookies) => { + this.cookies = cookies; + } + ) + .call(this, this.axios, this.options); + // this.do("login", cb); + return this.cookies; + } + postFreeLoginGuess(referer, freeLoginId, cookies = null, callback = null) { + return gameEvents + .postFreeLoginGuessWithCallBack(referer, freeLoginId, callback) + .call(this, this.axios, this.options, cookies); + } + // avoidLogin() + setChannelId(channelId) { + this.channelId = channelId; + } + async get(title) { + return await this.task[title].call(this, this.axios, this.options); + } + + async getinfo( + data = { url, body, method: "POST", headers: { referer: "", options: "" } }, + callback = null + ) { + let { url, body, method, headers } = data; + return this.do("getinfo", async (axios, options) => { + let request = new UnicomRequest(axios, options); + let result; + if (method === "POST") { + result = await request.postMsmds(url, body, headers, this.UA); + } else { + result = await request.getMsmds(url, body, headers, this.UA); + } + if (result.data.code !== 200) { + throw new Error("❌ something errors: ", result.data.msg); + } + if (typeof callback != "function") { + return result; + } else { + return callback(result); + } + }).call(this, this.axios, this.options); + } + + async get( + data = { url, body, method: "POST", headers: { referer: "", options: "" } }, + callback = null + ) { + let { url, body, method, headers } = data; + return this.do("getinfo", async (axios, options) => { + let request = new UnicomRequest(axios, options); + let result; + if (method === "POST") { + result = await request.post(url, body, headers, this.UA); + } else { + result = await request.get(url, body, headers, this.UA); + } + if (typeof callback == "function") { + result.data = callback(result.data); + } + return result; + }).call(this, this.axios, this.options); + } + getPhoneAsync(encodePhone = true) { + return () => { + encodePhone ? this.phone : this.options.user; }; } - async login(url) { - return gameEvents.getOpenPlatLine( - url.indexOf("openPlatLine.htm") > -1 - ? url - : `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=${url}`, - { base: this.platform } - ); + getPhone(encodePhone = true) { + return encodePhone ? this.phone : this.options.user; + } + setHeaders(headers) { + this.headers = headers; + return this; + } + getToken() { + let { ecs_token } = this.cookies; + return ecs_token; } } @@ -107,6 +242,8 @@ module.exports = { sleep, encodePhone, UnicomRequest, + UnicomComponent, + generateOrderid, }; //OLD=>NEW diff --git a/commands/tasks/unicom/test.js b/commands/tasks/unicom/test.js new file mode 100644 index 000000000..051b1e1be --- /dev/null +++ b/commands/tasks/unicom/test.js @@ -0,0 +1,44 @@ +const { UnicomComponent } = require("./handlers/gameUtils"); +// 霸王餐刮刮卡 +let testDemo = { + doTask: async (axios, options) => { + //配置平台信息参数axios, options必填,3:游戏活动名,4:平台种类 + let test = new UnicomComponent(axios, options, "测试游戏", "msmds"); + await testDemo.login(test); + let data = await testDemo.getinfo(test); + console.log(data); + }, + login: async (request) => { + return await request.login( + `https://wxapp.msmds.cn/h5/react_web/unicom/luckCardPage&duanlianjieabc=tbkd2` + ); + }, + getinfo: async (request) => { + //请求配置参数 + let requestConfig = { + url: + "https://wxapp.msmds.cn/jplus/api/scratchCardRecord/getScratchCardNum", + body: { + channelId: "unicom_scratch_card", + phone: request.getPhone(), + token: request.getToken(), + }, + method: "POST", + headers: { + referer: `https://wxapp.msmds.cn/`, + origin: "https://wxapp.msmds.cn", + }, + }; + return await request.getinfo(requestConfig, (result) => { + console.log(result.data); + return { + freeTimes: result.data.data.surplusNum, + advertTimes: result.data.data.canLookVideo + ? 4 - result.data.data.playNum + : 0, + }; + }); + }, +}; + +module.exports = testDemo; diff --git a/commands/tasks/unicom/unicom.js b/commands/tasks/unicom/unicom.js index c0c3aa700..6bf2afb5d 100644 --- a/commands/tasks/unicom/unicom.js +++ b/commands/tasks/unicom/unicom.js @@ -11,7 +11,9 @@ * 首页-小说-阅读越有礼打卡赢话费 * 首页-小说-读满10章赢好礼 * 首页-小说-阅读福利抽大奖 + * 首页-小说-任意一本小说内页章节中间 [看书里面的5个视频] * 首页-签到有礼-免费领-浏览领积分 + * 首页-签到有礼-免费领-猜拳拿话费 * 首页-签到有礼-免费拿-看视频夺宝 * 首页-签到有礼-免费抽-抓OPPO手机 * 首页-签到有礼-免费抽-拿666积分-豪礼大派送抽奖 @@ -422,6 +424,25 @@ var start = async (params) => { }, taskOption ); + +//首页-小说-任意一本小说内页章节中间 [看书里面的5个视频] + await scheduler.regTask( + "book5video", + async (request) => { + await require("./book5video.js").doTask(request, options); + }, + taskOption + ); + + // 首页-签到有礼-免费领-猜拳拿话费 + await scheduler.regTask( + "dailyFingerqd", + async (request) => { + await require("./dailyFingerqd.js").doTask(request, options); + }, + taskOption + ); + }; module.exports = { start, diff --git a/utils/scheduler.js b/utils/scheduler.js index e8f6f9cf0..32f32f5da 100644 --- a/utils/scheduler.js +++ b/utils/scheduler.js @@ -360,6 +360,11 @@ let scheduler = { } await queue.onIdle(); } else { + console.log( + `👇 获取总任务数${taskJson.queues.length},已完成任务数${ + queues.filter((q) => q.taskState === 1).length + },截至当前可执行任务数${will_tasks.length}` + ); console.log("⭕ 暂无需要执行的任务"); } }, From 16d027aa298b2f63df7541b59042a8fe36788dd5 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Tue, 16 Feb 2021 17:54:31 +0800 Subject: [PATCH 082/128] =?UTF-8?q?=F0=9F=90=8D=20fixed=20bugs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/dailyFingerqd.js | 2 +- commands/tasks/unicom/handlers/gameUtils.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/commands/tasks/unicom/dailyFingerqd.js b/commands/tasks/unicom/dailyFingerqd.js index 56afa814f..a27e352d5 100644 --- a/commands/tasks/unicom/dailyFingerqd.js +++ b/commands/tasks/unicom/dailyFingerqd.js @@ -121,7 +121,7 @@ let dailyFingerqd = { }; let { data } = await request.get(config); // console.log(data); - if (data.code !== 0) { + if (data.code !== 0 || data.data.code !== "0") { throw new Error("something went wrong:", data.message); } //游戏要进行三轮,如果得不到积分就机会-1 正常情况是玩不到三轮的. diff --git a/commands/tasks/unicom/handlers/gameUtils.js b/commands/tasks/unicom/handlers/gameUtils.js index 61c741577..9f126e9d0 100644 --- a/commands/tasks/unicom/handlers/gameUtils.js +++ b/commands/tasks/unicom/handlers/gameUtils.js @@ -172,9 +172,9 @@ class UnicomComponent { setChannelId(channelId) { this.channelId = channelId; } - async get(title) { - return await this.task[title].call(this, this.axios, this.options); - } + // async do(title) { + // return await this.task[title].call(this, this.axios, this.options); + // } async getinfo( data = { url, body, method: "POST", headers: { referer: "", options: "" } }, From 9184844e5b48350b98929baa4a77509d4c766792 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Tue, 16 Feb 2021 18:30:14 +0800 Subject: [PATCH 083/128] Update dailyFingerqd.js --- commands/tasks/unicom/dailyFingerqd.js | 60 ++++++++++++++++---------- 1 file changed, 37 insertions(+), 23 deletions(-) diff --git a/commands/tasks/unicom/dailyFingerqd.js b/commands/tasks/unicom/dailyFingerqd.js index a27e352d5..d64c67d23 100644 --- a/commands/tasks/unicom/dailyFingerqd.js +++ b/commands/tasks/unicom/dailyFingerqd.js @@ -6,6 +6,7 @@ const { let crypto = require("crypto"); const gameEvents = require("./handlers/dailyEvent"); const AES = require("./handlers/PAES"); +const { exit } = require("process"); let dailyFingerqd = { doTask: async (axios, options) => { console.log("😒 猜拳拿奖...开始"); @@ -19,6 +20,7 @@ let dailyFingerqd = { "Ac-yc0001,Ac-yc0002,Ac-yc0003", cookies, (data) => { + // console.log(data); return { //默认只和刘备猜拳 freeTimes: @@ -27,6 +29,11 @@ let dailyFingerqd = { data.data.activityInfos.activityVOs[0].activityTimesInfo .advertTimes, Authorization: data.data.token.access_token, + roundGame: data.data.roundGame, + activityId: + data.data.roundGame == null + ? "Ac-yc0002" + : data.data.roundGame.activityId, }; } ); @@ -36,7 +43,7 @@ let dailyFingerqd = { axios, options, { ecs_token, searchParams, jar1 }, - { Authorization, freeTimes, advertTimes } + { Authorization, freeTimes, advertTimes, roundGame, activityId } ) => { let request = new UnicomComponent(axios, options, "猜拳拿奖"); do { @@ -86,7 +93,7 @@ let dailyFingerqd = { }); console.log(result); playParams = { - activityId: "Ac-yc0002", + activityId: activityId, currentTimes: advertTimes, type: "广告", integral: 50, @@ -99,35 +106,42 @@ let dailyFingerqd = { // eslint-disable-next-line no-unused-vars } else { playParams = { - activityId: "Ac-yc0002", + activityId: activityId, currentTimes: freeTimes, integral: 50, type: "免费", }; freeTimes--; } - - let body = gameEvents.encodeParams(playParams, true); - let config = { - url: `https://m.jf.10010.com/jf-yuech/api/gameResultV2/minusRondGames`, - body, - method: "POST", - headers: { - Authorization: `Bearer ${Authorization}`, - referer: - "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/fingerqd/index.html?jump=sign", - options: "https://m.jf.10010.com", - }, - }; - let { data } = await request.get(config); - // console.log(data); - if (data.code !== 0 || data.data.code !== "0") { - throw new Error("something went wrong:", data.message); + // console.log(playParams); + let roundId; + if (roundGame == null) { + let body = gameEvents.encodeParams(playParams, true); + let config = { + url: `https://m.jf.10010.com/jf-yuech/api/gameResultV2/minusRondGames`, + body, + method: "POST", + headers: { + Authorization: `Bearer ${Authorization}`, + referer: + "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/fingerqd/index.html?jump=sign", + options: "https://m.jf.10010.com", + }, + }; + let { data } = await request.get(config); + // console.log(data); + if (data.code !== 0 || data.data.code !== "0") { + throw new Error("something went wrong:", data.message); + } + roundId = data.data.roundGame.roundId; + } else { + roundId = roundGame.roundId; } + //游戏要进行三轮,如果得不到积分就机会-1 正常情况是玩不到三轮的. - let roundId = data.data.roundGame.roundId; + let gamebits = { - activityId: "Ac-yc0002", + activityId: activityId, resultId: roundId, }; for (let i = 0; i < 2; i++) { @@ -168,7 +182,7 @@ let dailyFingerqd = { await dailyFingerqd.lookVideoDoubleResult(axios, { ...options, Authorization, - activityId: `Ac-yc0002`, + activityId: activityId, winningRecordId: data.data.drawResultPO.winningRecordId, }); } From 9f14732e1f33f9c24fd7e3524c9b8e9281870982 Mon Sep 17 00:00:00 2001 From: cooip-jm <78735965+cooip-jm@users.noreply.github.com> Date: Tue, 16 Feb 2021 23:57:19 +0800 Subject: [PATCH 084/128] Update unicom.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2月18日牛街活动结束 没什么水了,且有被手厅永久拉黑风险。 故取消任务启动。 --- commands/tasks/unicom/unicom.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/tasks/unicom/unicom.js b/commands/tasks/unicom/unicom.js index 6bf2afb5d..19f43b6dc 100644 --- a/commands/tasks/unicom/unicom.js +++ b/commands/tasks/unicom/unicom.js @@ -353,7 +353,7 @@ var start = async (params) => { // await require('./integral').getTxDetail(request, options) // await require('./integral').getDxDetail(request, options) // await require('./integral').getCoins(request, options) - +/*** // 首页-牛气-秒杀抢兑 await scheduler.regTask( "NiujieSpikePrize", @@ -389,7 +389,7 @@ var start = async (params) => { ...taskOption, } ); - +***/ //首页-签到有礼-聚宝盆 [广告图] await scheduler.regTask( "ingots", From e574085babe41c8dc12b4f506cf2c43dbce6c426 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Wed, 17 Feb 2021 20:38:49 +0800 Subject: [PATCH 085/128] =?UTF-8?q?=F0=9F=90=8D=20fixed=20bugs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/dailyFingerqd.js | 345 ++++++++++++++----------- 1 file changed, 197 insertions(+), 148 deletions(-) diff --git a/commands/tasks/unicom/dailyFingerqd.js b/commands/tasks/unicom/dailyFingerqd.js index d64c67d23..a3e388a27 100644 --- a/commands/tasks/unicom/dailyFingerqd.js +++ b/commands/tasks/unicom/dailyFingerqd.js @@ -20,20 +20,59 @@ let dailyFingerqd = { "Ac-yc0001,Ac-yc0002,Ac-yc0003", cookies, (data) => { + let temp = [ + { + activityId: "Ac-yc0002", + integral: 50, + roundGame: null, + activityName: "刘备", + }, // 刘备 + { + activityId: "Ac-yc0001", + integral: 50, + roundGame: null, + activityName: "关羽", + }, // 关羽 + { + activityId: "Ac-yc0003", + integral: 50, + roundGame: null, + activityName: "张飞", + }, // 张飞 + ]; + let activity = []; + if (data.data.roundGame !== null) { + temp.map((value, i) => { + if (value.activityId == data.data.roundGame.activityId) { + temp[i]["roundGame"] = data.data.roundGame; + } else { + temp[i]["roundGame"] = null; + } + }); + let currentIdx = temp.findIndex( + (v) => v.activityId == data.data.roundGame.activityId + ); + activity.push(temp[currentIdx]); + temp.splice(currentIdx, 1); + activity = activity.concat(temp); + } else { + activity = temp; + } + for (let game of data.data.activityInfos.activityVOs) { + for (let item of activity) { + if (item.activityId === game.activityId) { + item["freeTimes"] = game.activityTimesInfo.freeTimes; + item["advertTimes"] = game.activityTimesInfo.advertTimes; + } + } + } + console.log(activity); + // exit(0); // console.log(data); return { - //默认只和刘备猜拳 - freeTimes: - data.data.activityInfos.activityVOs[0].activityTimesInfo.freeTimes, - advertTimes: - data.data.activityInfos.activityVOs[0].activityTimesInfo - .advertTimes, Authorization: data.data.token.access_token, - roundGame: data.data.roundGame, - activityId: - data.data.roundGame == null - ? "Ac-yc0002" - : data.data.roundGame.activityId, + // roundGame: data.data.roundGame, + activity: activity, }; } ); @@ -43,152 +82,162 @@ let dailyFingerqd = { axios, options, { ecs_token, searchParams, jar1 }, - { Authorization, freeTimes, advertTimes, roundGame, activityId } + { Authorization, activity } ) => { let request = new UnicomComponent(axios, options, "猜拳拿奖"); - do { - console.log( - "已消耗机会", - 1 + 4 - (freeTimes + advertTimes), - "剩余免费机会", - freeTimes, - "看视频广告机会", - advertTimes - ); - let playParams; - //免费机会为0,需要看视频 - if (!freeTimes && advertTimes) { - console.log("视频补充"); - let params = { - arguments1: "AC20200611152252", // acid - arguments2: "GGPD", // yhChannel - arguments3: "627292f1243148159c58fd58917c3e67", // yhTaskId menuId - arguments4: new Date().getTime(), // time - arguments6: "517050707", - arguments7: "517050707", - arguments8: "123456", - arguments9: "4640b530b3f7481bb5821c6871854ce5", - netWay: "Wifi", - remark1: "签到小游戏猜拳拿奖", - remark: "签到页小游戏", - version: `android@8.0102`, - codeId: 945757409, - }; - params["sign"] = AES.sign([ - params.arguments1, - params.arguments2, - params.arguments3, - params.arguments4, - ]); - params["orderId"] = crypto - .createHash("md5") - .update(new Date().getTime() + "") - .digest("hex"); - params["arguments4"] = new Date().getTime(); - let result = await require("./taskcallback").reward(axios, { - ...options, - params, - jar: jar1, - }); - console.log(result); - playParams = { - activityId: activityId, - currentTimes: advertTimes, - type: "广告", - integral: 50, - orderId: params["orderId"], - phoneType: "android", - version: "8.0102", - }; - await sleep(30); - advertTimes--; - // eslint-disable-next-line no-unused-vars - } else { - playParams = { - activityId: activityId, - currentTimes: freeTimes, - integral: 50, - type: "免费", - }; - freeTimes--; - } - // console.log(playParams); - let roundId; - if (roundGame == null) { - let body = gameEvents.encodeParams(playParams, true); - let config = { - url: `https://m.jf.10010.com/jf-yuech/api/gameResultV2/minusRondGames`, - body, - method: "POST", - headers: { - Authorization: `Bearer ${Authorization}`, - referer: - "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/fingerqd/index.html?jump=sign", - options: "https://m.jf.10010.com", - }, - }; - let { data } = await request.get(config); - // console.log(data); - if (data.code !== 0 || data.data.code !== "0") { - throw new Error("something went wrong:", data.message); + for (let item of activity) { + console.log(`与${item.activityName}进行猜拳...`); + let { freeTimes, advertTimes, activityId, roundGame, integral } = item; + do { + console.log( + "已消耗机会", + 1 + 4 - (freeTimes + advertTimes), + "剩余免费机会", + freeTimes, + "看视频广告机会", + advertTimes + ); + let playParams; + //免费机会为0,需要看视频 + if (freeTimes == 0 && advertTimes == 0) { + console.log(`与${item.activityName}猜拳无机会!,进行下一轮`); + continue; + } + if (!freeTimes && advertTimes) { + console.log("视频补充"); + let params = { + arguments1: "AC20200611152252", // acid + arguments2: "GGPD", // yhChannel + arguments3: "627292f1243148159c58fd58917c3e67", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "517050707", + arguments7: "517050707", + arguments8: "123456", + arguments9: "4640b530b3f7481bb5821c6871854ce5", + netWay: "Wifi", + remark1: "签到小游戏猜拳拿奖", + remark: "签到页小游戏", + version: `android@8.0102`, + codeId: 945757409, + }; + params["sign"] = AES.sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + params["orderId"] = crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"); + params["arguments4"] = new Date().getTime(); + + let result = await require("./taskcallback").reward(axios, { + ...options, + params, + jar: jar1, + }); + console.log(result); + playParams = { + activityId: activityId, + currentTimes: advertTimes, + type: "广告", + integral: integral, + orderId: params["orderId"], + phoneType: "android", + version: "8.0102", + }; + await sleep(30); + advertTimes--; + // eslint-disable-next-line no-unused-vars + } else { + playParams = { + activityId: activityId, + currentTimes: freeTimes, + integral: integral, + type: "免费", + }; + freeTimes--; + } + // console.log(playParams); + let roundId; + if (roundGame == null) { + let body = gameEvents.encodeParams(playParams, true); + let config = { + url: `https://m.jf.10010.com/jf-yuech/api/gameResultV2/minusRondGames`, + body, + method: "POST", + headers: { + Authorization: `Bearer ${Authorization}`, + referer: + "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/fingerqd/index.html?jump=sign", + options: "https://m.jf.10010.com", + }, + }; + let { data } = await request.get(config); + // console.log(data); + if (data.code !== 0 || data.data.code !== "0") { + console.log("something went wrong:", data); + continue; + } + roundId = data.data.roundGame.roundId; + } else { + roundId = roundGame.roundId; } - roundId = data.data.roundGame.roundId; - } else { - roundId = roundGame.roundId; - } - //游戏要进行三轮,如果得不到积分就机会-1 正常情况是玩不到三轮的. + //游戏要进行三轮,如果得不到积分就机会-1 正常情况是玩不到三轮的. - let gamebits = { - activityId: activityId, - resultId: roundId, - }; - for (let i = 0; i < 2; i++) { - console.log(`第${i + 1}轮猜拳...`); - await sleep(10); - let body = gameEvents.encodeParams(gamebits, true); - let config = { - url: `https://m.jf.10010.com/jf-yuech/api/gameResultV2/roundGameForPrize`, - body: body, - method: "POST", - headers: { - Authorization: `Bearer ${Authorization}`, - referer: - "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/fingerqd/index.html?jump=sign", - options: "https://m.jf.10010.com", - }, + let gamebits = { + activityId: activityId, + resultId: roundId, }; - let { data } = await request.get(config); - // console.log(data); - if (data.code !== 0) { - console.log("猜拳拿奖:", data.message); - } else { - console.log( - "猜拳拿奖:", - data.data.drawResultPO !== null - ? data.data.drawResultPO.prizeName - : "未中奖" - ); - if ( - data.data.drawResultPO !== null && - data.data.drawResultPO.doublingStatus - ) { - console.log("🌈 提交积分翻倍"); - await sleep(30); - await dailyFingerqd.lookVideoDouble(axios, { - ...options, - }); - await dailyFingerqd.lookVideoDoubleResult(axios, { - ...options, - Authorization, - activityId: activityId, - winningRecordId: data.data.drawResultPO.winningRecordId, - }); + for (let i = 0; i < 2; i++) { + console.log(`第${i + 1}轮猜拳...`); + await sleep(10); + let body = gameEvents.encodeParams(gamebits, true); + let config = { + url: `https://m.jf.10010.com/jf-yuech/api/gameResultV2/roundGameForPrize`, + body: body, + method: "POST", + headers: { + Authorization: `Bearer ${Authorization}`, + referer: + "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/fingerqd/index.html?jump=sign", + options: "https://m.jf.10010.com", + }, + }; + let { data } = await request.get(config); + // console.log(data); + if (data.code !== 0) { + console.log("猜拳拿奖:", data.message); + } else { + console.log( + "猜拳拿奖:", + data.data.drawResultPO !== null + ? data.data.drawResultPO.prizeName + : "未中奖" + ); + if ( + data.data.drawResultPO !== null && + data.data.drawResultPO.doublingStatus + ) { + console.log("🌈 提交积分翻倍"); + await sleep(30); + await dailyFingerqd.lookVideoDouble(axios, { + ...options, + }); + await dailyFingerqd.lookVideoDoubleResult(axios, { + ...options, + Authorization, + activityId: activityId, + winningRecordId: data.data.drawResultPO.winningRecordId, + }); + } } } - } - } while (freeTimes || advertTimes); + } while (freeTimes || advertTimes); + } }, lookVideoDouble: async (axios, options) => { let params = { From 34666b35bb08b220b190932afe334ad924e04d18 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Wed, 17 Feb 2021 20:42:12 +0800 Subject: [PATCH 086/128] =?UTF-8?q?=F0=9F=90=8D=20fixed=20bugs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/dailyFingerqd.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/tasks/unicom/dailyFingerqd.js b/commands/tasks/unicom/dailyFingerqd.js index a3e388a27..d7abbd846 100644 --- a/commands/tasks/unicom/dailyFingerqd.js +++ b/commands/tasks/unicom/dailyFingerqd.js @@ -66,7 +66,7 @@ let dailyFingerqd = { } } } - console.log(activity); + // console.log(activity); // exit(0); // console.log(data); return { From 0a8d3dbf60136a2c08a4af27ae552977aaa1804c Mon Sep 17 00:00:00 2001 From: cooip-jm <78735965+cooip-jm@users.noreply.github.com> Date: Wed, 17 Feb 2021 21:39:14 +0800 Subject: [PATCH 087/128] Create dailyFingerqd2.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 猜拳二号 --- commands/tasks/unicom/dailyFingerqd2.js | 298 ++++++++++++++++++++++++ 1 file changed, 298 insertions(+) create mode 100644 commands/tasks/unicom/dailyFingerqd2.js diff --git a/commands/tasks/unicom/dailyFingerqd2.js b/commands/tasks/unicom/dailyFingerqd2.js new file mode 100644 index 000000000..d75be0cab --- /dev/null +++ b/commands/tasks/unicom/dailyFingerqd2.js @@ -0,0 +1,298 @@ +const { + UnicomComponent, + generateOrderid, + sleep, + } = require("./handlers/gameUtils"); + let crypto = require("crypto"); + const gameEvents = require("./handlers/dailyEvent"); + const AES = require("./handlers/PAES"); + const { exit } = require("process"); + let dailyFingerqd2 = { + doTask: async (axios, options) => { + console.log("😒 猜拳2号-拿奖...开始"); + let request = new UnicomComponent(axios, options, "猜拳2号拿奖"); + //登录平台 + let cookies = await request.login( + "https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://m.jf.10010.com/jf-order/avoidLogin/forActive/fingerSignq&duanlianjieabc=tbKFo" + ); + let times = await request.postFreeLoginGuess( + "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/fingerqd/index.html?jump=sign", + "Ac-5506bb9b994e4e7e9d6054b87968bc85,Ac-2398174ed6774534b8bd4e4556b7b6ee,Ac-9964c061692d417a993577795298b461", + cookies, + (data) => { + let temp = [ + { + activityId: "Ac-9964c061692d417a993577795298b461", + integral: 50, + roundGame: null, + activityName: "刘备", + }, // 刘备 + { + activityId: "Ac-2398174ed6774534b8bd4e4556b7b6ee", + integral: 50, + roundGame: null, + activityName: "关羽", + }, // 关羽 + { + activityId: "Ac-5506bb9b994e4e7e9d6054b87968bc85", + integral: 50, + roundGame: null, + activityName: "张飞", + }, // 张飞 + ]; + let activity = []; + if (data.data.roundGame !== null) { + temp.map((value, i) => { + if (value.activityId == data.data.roundGame.activityId) { + temp[i]["roundGame"] = data.data.roundGame; + } else { + temp[i]["roundGame"] = null; + } + }); + let currentIdx = temp.findIndex( + (v) => v.activityId == data.data.roundGame.activityId + ); + activity.push(temp[currentIdx]); + temp.splice(currentIdx, 1); + activity = activity.concat(temp); + } else { + activity = temp; + } + for (let game of data.data.activityInfos.activityVOs) { + for (let item of activity) { + if (item.activityId === game.activityId) { + item["freeTimes"] = game.activityTimesInfo.freeTimes; + item["advertTimes"] = game.activityTimesInfo.advertTimes; + } + } + } + // console.log(activity); + // exit(0); + // console.log(data); + return { + Authorization: data.data.token.access_token, + // roundGame: data.data.roundGame, + activity: activity, + }; + } + ); + await dailyFingerqd2.playGames(axios, options, cookies, times); + }, + playGames: async ( + axios, + options, + { ecs_token, searchParams, jar1 }, + { Authorization, activity } + ) => { + let request = new UnicomComponent(axios, options, "猜拳拿奖"); + + for (let item of activity) { + console.log(`与${item.activityName}进行猜拳...`); + let { freeTimes, advertTimes, activityId, roundGame, integral } = item; + do { + console.log( + "一共有猜拳机会", + (freeTimes + advertTimes), + "剩余免费机会", + freeTimes, + "看视频广告机会", + advertTimes + ); + let playParams; + //免费机会为0,需要看视频 + if (freeTimes == 0 && advertTimes == 0) { + console.log(`与${item.activityName}猜拳无机会!,进行下一轮`); + continue; + } + if (!freeTimes && advertTimes) { + console.log("视频补充"); + let params = { + arguments1: "AC20200611152252", // acid + arguments2: "GGPD", // yhChannel + arguments3: "627292f1243148159c58fd58917c3e67", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "517050707", + arguments7: "517050707", + arguments8: "123456", + arguments9: "4640b530b3f7481bb5821c6871854ce5", + netWay: "Wifi", + remark1: "签到小游戏猜拳拿奖", + remark: "签到页小游戏", + version: `android@8.0102`, + codeId: 945757409, + }; + params["sign"] = AES.sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + params["orderId"] = crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"); + params["arguments4"] = new Date().getTime(); + + let result = await require("./taskcallback").reward(axios, { + ...options, + params, + jar: jar1, + }); + console.log(result); + playParams = { + activityId: activityId, + currentTimes: advertTimes, + type: "广告", + integral: integral, + orderId: params["orderId"], + phoneType: "android", + version: "8.0102", + }; + await sleep(30); + advertTimes--; + // eslint-disable-next-line no-unused-vars + } else { + playParams = { + activityId: activityId, + currentTimes: freeTimes, + integral: integral, + type: "免费", + }; + freeTimes--; + } + // console.log(playParams); + let roundId; + if (roundGame == null) { + let body = gameEvents.encodeParams(playParams, true); + let config = { + url: `https://m.jf.10010.com/jf-yuech/api/gameResultV2/minusRondGames`, + body, + method: "POST", + headers: { + Authorization: `Bearer ${Authorization}`, + referer: + "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/fingerqd/index.html?jump=sign", + options: "https://m.jf.10010.com", + }, + }; + let { data } = await request.get(config); + // console.log(data); + if (data.code !== 0 || data.data.code !== "0") { + console.log("something went wrong:", data); + continue; + } + roundId = data.data.roundGame.roundId; + } else { + roundId = roundGame.roundId; + } + + //游戏要进行三轮,如果得不到积分就机会-1 正常情况是玩不到三轮的. + + let gamebits = { + activityId: activityId, + resultId: roundId, + }; + for (let i = 0; i < 2; i++) { + console.log(`第${i + 1}轮猜拳...`); + await sleep(10); + let body = gameEvents.encodeParams(gamebits, true); + let config = { + url: `https://m.jf.10010.com/jf-yuech/api/gameResultV2/roundGameForPrize`, + body: body, + method: "POST", + headers: { + Authorization: `Bearer ${Authorization}`, + referer: + "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/fingerqd/index.html?jump=sign", + options: "https://m.jf.10010.com", + }, + }; + let { data } = await request.get(config); + // console.log(data); + if (data.code !== 0) { + console.log("猜拳拿奖:", data.message); + } else { + console.log( + "猜拳拿奖:", + data.data.drawResultPO !== null + ? data.data.drawResultPO.prizeName + : "未中奖" + ); + if ( + data.data.drawResultPO !== null && + data.data.drawResultPO.doublingStatus + ) { + console.log("🌈 提交积分翻倍"); + await sleep(30); + await dailyFingerqd2.lookVideoDouble(axios, { + ...options, + }); + await dailyFingerqd2.lookVideoDoubleResult(axios, { + ...options, + Authorization, + activityId: activityId, + winningRecordId: data.data.drawResultPO.winningRecordId, + }); + } + } + } + } while (freeTimes || advertTimes); + } + }, + lookVideoDouble: async (axios, options) => { + let params = { + arguments1: "", + arguments2: "GGPD", + arguments3: "", + arguments4: new Date().getTime(), + arguments6: "517050707", + netWay: "Wifi", + version: `android@8.0102`, + }; + params["sign"] = AES.sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + let { num, jar } = await require("./taskcallback").query(axios, { + ...options, + params, + }); + + if (!num) { + console.log("签到小游戏猜拳: 今日已完成"); + return; + } + + params = { + arguments1: "", // acid + arguments2: "GGPD", // yhChannel + arguments3: "", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "", + arguments7: "", + arguments8: "", + arguments9: "", + orderId: generateOrderid(), + netWay: "Wifi", + remark: "签到小游戏猜拳拿奖", + version: `android@8.0100`, + codeId: 945689604, + }; + params["sign"] = AES.sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + await require("./taskcallback").doTask(axios, { + ...options, + params, + jar, + }); + }, + lookVideoDoubleResult: gameEvents.lookVideoDoubleResult("猜拳拿奖"), + }; + + module.exports = dailyFingerqd2; From fce910b39bcc5c01e2e8a2d6a825a169a06cf9e5 Mon Sep 17 00:00:00 2001 From: cooip-jm <78735965+cooip-jm@users.noreply.github.com> Date: Wed, 17 Feb 2021 21:40:52 +0800 Subject: [PATCH 088/128] Update unicom.js --- commands/tasks/unicom/unicom.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/commands/tasks/unicom/unicom.js b/commands/tasks/unicom/unicom.js index 19f43b6dc..913ea5477 100644 --- a/commands/tasks/unicom/unicom.js +++ b/commands/tasks/unicom/unicom.js @@ -442,6 +442,17 @@ var start = async (params) => { }, taskOption ); + + // 积分商城-积分猜拳-猜拳二号 + await scheduler.regTask( + "dailyFingerqd2", + async (request) => { + await require("./dailyFingerqd2.js").doTask(request, options); + }, + taskOption + ); + + }; module.exports = { From 2809f7f5f18e563ca72825f8b6a54d95873b34ba Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Wed, 17 Feb 2021 22:03:59 +0800 Subject: [PATCH 089/128] Update unicom.js --- commands/tasks/unicom/unicom.js | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/commands/tasks/unicom/unicom.js b/commands/tasks/unicom/unicom.js index 913ea5477..53fc33945 100644 --- a/commands/tasks/unicom/unicom.js +++ b/commands/tasks/unicom/unicom.js @@ -353,7 +353,7 @@ var start = async (params) => { // await require('./integral').getTxDetail(request, options) // await require('./integral').getDxDetail(request, options) // await require('./integral').getCoins(request, options) -/*** + /*** // 首页-牛气-秒杀抢兑 await scheduler.regTask( "NiujieSpikePrize", @@ -425,7 +425,7 @@ var start = async (params) => { taskOption ); -//首页-小说-任意一本小说内页章节中间 [看书里面的5个视频] + //首页-小说-任意一本小说内页章节中间 [看书里面的5个视频] await scheduler.regTask( "book5video", async (request) => { @@ -442,18 +442,15 @@ var start = async (params) => { }, taskOption ); - - // 积分商城-积分猜拳-猜拳二号 - await scheduler.regTask( - "dailyFingerqd2", - async (request) => { - await require("./dailyFingerqd2.js").doTask(request, options); - }, - taskOption - ); - - + // 积分商城-积分猜拳-猜拳二号 + await scheduler.regTask( + "dailyFingerqd2", + async (request) => { + await require("./dailyFingerqd2.js").doTask(request, options); + }, + taskOption + ); }; module.exports = { start, From ac1046f195e1def15e7121611837438a194552e2 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Wed, 17 Feb 2021 22:07:02 +0800 Subject: [PATCH 090/128] Update dailyFingerqd2.js --- commands/tasks/unicom/dailyFingerqd2.js | 576 ++++++++++++------------ 1 file changed, 288 insertions(+), 288 deletions(-) diff --git a/commands/tasks/unicom/dailyFingerqd2.js b/commands/tasks/unicom/dailyFingerqd2.js index d75be0cab..e0e7fa9fa 100644 --- a/commands/tasks/unicom/dailyFingerqd2.js +++ b/commands/tasks/unicom/dailyFingerqd2.js @@ -1,298 +1,298 @@ const { - UnicomComponent, - generateOrderid, - sleep, - } = require("./handlers/gameUtils"); - let crypto = require("crypto"); - const gameEvents = require("./handlers/dailyEvent"); - const AES = require("./handlers/PAES"); - const { exit } = require("process"); - let dailyFingerqd2 = { - doTask: async (axios, options) => { - console.log("😒 猜拳2号-拿奖...开始"); - let request = new UnicomComponent(axios, options, "猜拳2号拿奖"); - //登录平台 - let cookies = await request.login( - "https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://m.jf.10010.com/jf-order/avoidLogin/forActive/fingerSignq&duanlianjieabc=tbKFo" - ); - let times = await request.postFreeLoginGuess( - "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/fingerqd/index.html?jump=sign", - "Ac-5506bb9b994e4e7e9d6054b87968bc85,Ac-2398174ed6774534b8bd4e4556b7b6ee,Ac-9964c061692d417a993577795298b461", - cookies, - (data) => { - let temp = [ - { - activityId: "Ac-9964c061692d417a993577795298b461", - integral: 50, - roundGame: null, - activityName: "刘备", - }, // 刘备 - { - activityId: "Ac-2398174ed6774534b8bd4e4556b7b6ee", - integral: 50, - roundGame: null, - activityName: "关羽", - }, // 关羽 - { - activityId: "Ac-5506bb9b994e4e7e9d6054b87968bc85", - integral: 50, - roundGame: null, - activityName: "张飞", - }, // 张飞 - ]; - let activity = []; - if (data.data.roundGame !== null) { - temp.map((value, i) => { - if (value.activityId == data.data.roundGame.activityId) { - temp[i]["roundGame"] = data.data.roundGame; - } else { - temp[i]["roundGame"] = null; - } - }); - let currentIdx = temp.findIndex( - (v) => v.activityId == data.data.roundGame.activityId - ); - activity.push(temp[currentIdx]); - temp.splice(currentIdx, 1); - activity = activity.concat(temp); - } else { - activity = temp; - } - for (let game of data.data.activityInfos.activityVOs) { - for (let item of activity) { - if (item.activityId === game.activityId) { - item["freeTimes"] = game.activityTimesInfo.freeTimes; - item["advertTimes"] = game.activityTimesInfo.advertTimes; - } + UnicomComponent, + generateOrderid, + sleep, +} = require("./handlers/gameUtils"); +let crypto = require("crypto"); +const gameEvents = require("./handlers/dailyEvent"); +const AES = require("./handlers/PAES"); +const { exit } = require("process"); +let dailyFingerqd2 = { + doTask: async (axios, options) => { + console.log("😒 猜拳2号-拿奖...开始"); + let request = new UnicomComponent(axios, options, "猜拳2号拿奖"); + //登录平台 + let cookies = await request.login( + "https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://m.jf.10010.com/jf-order/avoidLogin/forActive/fingerSignq&duanlianjieabc=tbKFo" + ); + let times = await request.postFreeLoginGuess( + "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/fingerqd/index.html?jump=sign", + "Ac-5506bb9b994e4e7e9d6054b87968bc85,Ac-2398174ed6774534b8bd4e4556b7b6ee,Ac-9964c061692d417a993577795298b461", + cookies, + (data) => { + let temp = [ + { + activityId: "Ac-9964c061692d417a993577795298b461", + integral: 50, + roundGame: null, + activityName: "刘备", + }, // 刘备 + { + activityId: "Ac-2398174ed6774534b8bd4e4556b7b6ee", + integral: 50, + roundGame: null, + activityName: "关羽", + }, // 关羽 + { + activityId: "Ac-5506bb9b994e4e7e9d6054b87968bc85", + integral: 50, + roundGame: null, + activityName: "张飞", + }, // 张飞 + ]; + let activity = []; + if (data.data.roundGame !== null) { + temp.map((value, i) => { + if (value.activityId == data.data.roundGame.activityId) { + temp[i]["roundGame"] = data.data.roundGame; + } else { + temp[i]["roundGame"] = null; + } + }); + let currentIdx = temp.findIndex( + (v) => v.activityId == data.data.roundGame.activityId + ); + activity.push(temp[currentIdx]); + temp.splice(currentIdx, 1); + activity = activity.concat(temp); + } else { + activity = temp; + } + for (let game of data.data.activityInfos.activityVOs) { + for (let item of activity) { + if (item.activityId === game.activityId) { + item["freeTimes"] = game.activityTimesInfo.freeTimes; + item["advertTimes"] = game.activityTimesInfo.advertTimes; } } - // console.log(activity); - // exit(0); - // console.log(data); - return { - Authorization: data.data.token.access_token, - // roundGame: data.data.roundGame, - activity: activity, + } + // console.log(activity); + // exit(0); + // console.log(data); + return { + Authorization: data.data.token.access_token, + // roundGame: data.data.roundGame, + activity: activity, + }; + } + ); + await dailyFingerqd2.playGames(axios, options, cookies, times); + }, + playGames: async ( + axios, + options, + { ecs_token, searchParams, jar1 }, + { Authorization, activity } + ) => { + let request = new UnicomComponent(axios, options, "猜拳拿奖"); + + for (let item of activity) { + console.log(`与${item.activityName}进行猜拳...`); + let { freeTimes, advertTimes, activityId, roundGame, integral } = item; + do { + console.log( + "一共有猜拳机会", + freeTimes + advertTimes, + "剩余免费机会", + freeTimes, + "看视频广告机会", + advertTimes + ); + let playParams; + //免费机会为0,需要看视频 + if (freeTimes == 0 && advertTimes == 0) { + console.log(`与${item.activityName}猜拳无机会!,进行下一轮`); + continue; + } + if (!freeTimes && advertTimes) { + console.log("视频补充"); + let params = { + arguments1: "AC20200611152252", // acid + arguments2: "GGPD", // yhChannel + arguments3: "627292f1243148159c58fd58917c3e67", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "517050707", + arguments7: "517050707", + arguments8: "123456", + arguments9: "4640b530b3f7481bb5821c6871854ce5", + netWay: "Wifi", + remark1: "签到小游戏猜拳拿奖", + remark: "签到页小游戏", + version: `android@8.0102`, + codeId: 945757409, + }; + params["sign"] = AES.sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + params["orderId"] = crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"); + params["arguments4"] = new Date().getTime(); + + let result = await require("./taskcallback").reward(axios, { + ...options, + params, + jar: jar1, + }); + console.log(result); + playParams = { + activityId: activityId, + currentTimes: advertTimes, + type: "广告", + integral: integral, + orderId: params["orderId"], + phoneType: "android", + version: "8.0102", + }; + await sleep(30); + advertTimes--; + // eslint-disable-next-line no-unused-vars + } else { + playParams = { + activityId: activityId, + currentTimes: freeTimes, + integral: integral, + type: "免费", }; + freeTimes--; } - ); - await dailyFingerqd2.playGames(axios, options, cookies, times); - }, - playGames: async ( - axios, - options, - { ecs_token, searchParams, jar1 }, - { Authorization, activity } - ) => { - let request = new UnicomComponent(axios, options, "猜拳拿奖"); - - for (let item of activity) { - console.log(`与${item.activityName}进行猜拳...`); - let { freeTimes, advertTimes, activityId, roundGame, integral } = item; - do { - console.log( - "一共有猜拳机会", - (freeTimes + advertTimes), - "剩余免费机会", - freeTimes, - "看视频广告机会", - advertTimes - ); - let playParams; - //免费机会为0,需要看视频 - if (freeTimes == 0 && advertTimes == 0) { - console.log(`与${item.activityName}猜拳无机会!,进行下一轮`); + // console.log(playParams); + let roundId; + if (roundGame == null) { + let body = gameEvents.encodeParams(playParams, true); + let config = { + url: `https://m.jf.10010.com/jf-yuech/api/gameResultV2/minusRondGames`, + body, + method: "POST", + headers: { + Authorization: `Bearer ${Authorization}`, + referer: + "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/fingerqd/index.html?jump=sign", + options: "https://m.jf.10010.com", + }, + }; + let { data } = await request.get(config); + // console.log(data); + if (data.code !== 0 || data.data.code !== "0") { + console.log("something went wrong:", data); continue; } - if (!freeTimes && advertTimes) { - console.log("视频补充"); - let params = { - arguments1: "AC20200611152252", // acid - arguments2: "GGPD", // yhChannel - arguments3: "627292f1243148159c58fd58917c3e67", // yhTaskId menuId - arguments4: new Date().getTime(), // time - arguments6: "517050707", - arguments7: "517050707", - arguments8: "123456", - arguments9: "4640b530b3f7481bb5821c6871854ce5", - netWay: "Wifi", - remark1: "签到小游戏猜拳拿奖", - remark: "签到页小游戏", - version: `android@8.0102`, - codeId: 945757409, - }; - params["sign"] = AES.sign([ - params.arguments1, - params.arguments2, - params.arguments3, - params.arguments4, - ]); - params["orderId"] = crypto - .createHash("md5") - .update(new Date().getTime() + "") - .digest("hex"); - params["arguments4"] = new Date().getTime(); - - let result = await require("./taskcallback").reward(axios, { - ...options, - params, - jar: jar1, - }); - console.log(result); - playParams = { - activityId: activityId, - currentTimes: advertTimes, - type: "广告", - integral: integral, - orderId: params["orderId"], - phoneType: "android", - version: "8.0102", - }; - await sleep(30); - advertTimes--; - // eslint-disable-next-line no-unused-vars - } else { - playParams = { - activityId: activityId, - currentTimes: freeTimes, - integral: integral, - type: "免费", - }; - freeTimes--; - } - // console.log(playParams); - let roundId; - if (roundGame == null) { - let body = gameEvents.encodeParams(playParams, true); - let config = { - url: `https://m.jf.10010.com/jf-yuech/api/gameResultV2/minusRondGames`, - body, - method: "POST", - headers: { - Authorization: `Bearer ${Authorization}`, - referer: - "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/fingerqd/index.html?jump=sign", - options: "https://m.jf.10010.com", - }, - }; - let { data } = await request.get(config); - // console.log(data); - if (data.code !== 0 || data.data.code !== "0") { - console.log("something went wrong:", data); - continue; - } - roundId = data.data.roundGame.roundId; - } else { - roundId = roundGame.roundId; - } - - //游戏要进行三轮,如果得不到积分就机会-1 正常情况是玩不到三轮的. - - let gamebits = { - activityId: activityId, - resultId: roundId, + roundId = data.data.roundGame.roundId; + } else { + roundId = roundGame.roundId; + } + + //游戏要进行三轮,如果得不到积分就机会-1 正常情况是玩不到三轮的. + + let gamebits = { + activityId: activityId, + resultId: roundId, + }; + for (let i = 0; i < 2; i++) { + console.log(`第${i + 1}轮猜拳...`); + await sleep(10); + let body = gameEvents.encodeParams(gamebits, true); + let config = { + url: `https://m.jf.10010.com/jf-yuech/api/gameResultV2/roundGameForPrize`, + body: body, + method: "POST", + headers: { + Authorization: `Bearer ${Authorization}`, + referer: + "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/fingerqd/index.html?jump=sign", + options: "https://m.jf.10010.com", + }, }; - for (let i = 0; i < 2; i++) { - console.log(`第${i + 1}轮猜拳...`); - await sleep(10); - let body = gameEvents.encodeParams(gamebits, true); - let config = { - url: `https://m.jf.10010.com/jf-yuech/api/gameResultV2/roundGameForPrize`, - body: body, - method: "POST", - headers: { - Authorization: `Bearer ${Authorization}`, - referer: - "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/fingerqd/index.html?jump=sign", - options: "https://m.jf.10010.com", - }, - }; - let { data } = await request.get(config); - // console.log(data); - if (data.code !== 0) { - console.log("猜拳拿奖:", data.message); - } else { - console.log( - "猜拳拿奖:", - data.data.drawResultPO !== null - ? data.data.drawResultPO.prizeName - : "未中奖" - ); - if ( - data.data.drawResultPO !== null && - data.data.drawResultPO.doublingStatus - ) { - console.log("🌈 提交积分翻倍"); - await sleep(30); - await dailyFingerqd2.lookVideoDouble(axios, { - ...options, - }); - await dailyFingerqd2.lookVideoDoubleResult(axios, { - ...options, - Authorization, - activityId: activityId, - winningRecordId: data.data.drawResultPO.winningRecordId, - }); - } + let { data } = await request.get(config); + // console.log(data); + if (data.code !== 0) { + console.log("猜拳拿奖:", data.message); + } else { + console.log( + "猜拳拿奖:", + data.data.drawResultPO !== null + ? data.data.drawResultPO.prizeName + : "未中奖" + ); + if ( + data.data.drawResultPO !== null && + data.data.drawResultPO.doublingStatus + ) { + console.log("🌈 提交积分翻倍"); + await sleep(30); + await dailyFingerqd2.lookVideoDouble(axios, { + ...options, + }); + await dailyFingerqd2.lookVideoDoubleResult(axios, { + ...options, + Authorization, + activityId: activityId, + winningRecordId: data.data.drawResultPO.winningRecordId, + }); } } - } while (freeTimes || advertTimes); - } - }, - lookVideoDouble: async (axios, options) => { - let params = { - arguments1: "", - arguments2: "GGPD", - arguments3: "", - arguments4: new Date().getTime(), - arguments6: "517050707", - netWay: "Wifi", - version: `android@8.0102`, - }; - params["sign"] = AES.sign([ - params.arguments1, - params.arguments2, - params.arguments3, - params.arguments4, - ]); - let { num, jar } = await require("./taskcallback").query(axios, { - ...options, - params, - }); - - if (!num) { - console.log("签到小游戏猜拳: 今日已完成"); - return; - } - - params = { - arguments1: "", // acid - arguments2: "GGPD", // yhChannel - arguments3: "", // yhTaskId menuId - arguments4: new Date().getTime(), // time - arguments6: "", - arguments7: "", - arguments8: "", - arguments9: "", - orderId: generateOrderid(), - netWay: "Wifi", - remark: "签到小游戏猜拳拿奖", - version: `android@8.0100`, - codeId: 945689604, - }; - params["sign"] = AES.sign([ - params.arguments1, - params.arguments2, - params.arguments3, - params.arguments4, - ]); - await require("./taskcallback").doTask(axios, { - ...options, - params, - jar, - }); - }, - lookVideoDoubleResult: gameEvents.lookVideoDoubleResult("猜拳拿奖"), - }; - - module.exports = dailyFingerqd2; + } + } while (freeTimes || advertTimes); + } + }, + lookVideoDouble: async (axios, options) => { + let params = { + arguments1: "", + arguments2: "GGPD", + arguments3: "", + arguments4: new Date().getTime(), + arguments6: "517050707", + netWay: "Wifi", + version: `android@8.0102`, + }; + params["sign"] = AES.sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + let { num, jar } = await require("./taskcallback").query(axios, { + ...options, + params, + }); + + if (!num) { + console.log("签到小游戏猜拳: 今日已完成"); + return; + } + + params = { + arguments1: "", // acid + arguments2: "GGPD", // yhChannel + arguments3: "", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "", + arguments7: "", + arguments8: "", + arguments9: "", + orderId: generateOrderid(), + netWay: "Wifi", + remark: "签到小游戏猜拳拿奖", + version: `android@8.0100`, + codeId: 945689604, + }; + params["sign"] = AES.sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + await require("./taskcallback").doTask(axios, { + ...options, + params, + jar, + }); + }, + lookVideoDoubleResult: gameEvents.lookVideoDoubleResult("猜拳拿奖"), +}; + +module.exports = dailyFingerqd2; From deabaac6fbfec52479504f1b8a6923e956cd503e Mon Sep 17 00:00:00 2001 From: cooip-jm <78735965+cooip-jm@users.noreply.github.com> Date: Thu, 18 Feb 2021 11:17:45 +0800 Subject: [PATCH 091/128] Create taocan.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 看套餐广告-10积分-无翻倍 --- commands/tasks/unicom/taocan.js | 99 +++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 commands/tasks/unicom/taocan.js diff --git a/commands/tasks/unicom/taocan.js b/commands/tasks/unicom/taocan.js new file mode 100644 index 000000000..f19239a7c --- /dev/null +++ b/commands/tasks/unicom/taocan.js @@ -0,0 +1,99 @@ +//套餐看视频得积分 +//活动入口:主页-套餐页面-2个视频 +var crypto = require("crypto"); +var sign = (data) => { + let str = "integralofficial&"; + let params = []; + data.forEach((v, i) => { + if (v) { + params.push("arguments" + (i + 1) + v); + } + }); + return crypto + .createHash("md5") + .update(str + params.join("&")) + .digest("hex"); +}; +let account = { + yhTaskId: "8a6437e839494400b7ff34327759448f", + yhChannel: "GGPD", + accountChannel: "517050707", + accountUserName: "517050707", + accountPassword: "123456", + accountToken: "4640b530b3f7481bb5821c6871854ce5", +}; +var taocan = { + query: async (request, options) => { + let params = { + arguments1: "AC20201013153418", // acid + arguments2: account.yhChannel, // yhChannel + arguments3: account.yhTaskId, // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: account.accountChannel, + netWay: "Wifi", + version: `android@8.0102`, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + return await require("./taskcallback").query(request, { + ...options, + params, + }); + }, + doTask: async (request, options) => { + console.log("🐀 看视频广告中..."); + let { + num, + jar + } = await taocan.query(request, options); + // console.log(num); + + if (!num) { + console.log("🐀 看广告得积分: 今日已完成"); + return; + } + do { + // console.log("还有", num, "次"); + let params = { + arguments1: "AC20201013153418", // acid + arguments2: account.yhChannel, // yhChannel + arguments3: account.yhTaskId, // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: account.accountUserName, + arguments7: account.accountUserName, + arguments8: account.accountPassword, + arguments9: "4640b530b3f7481bb5821c6871854ce5", + orderId: crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"), + netWay: "Wifi", + remark: "套餐变更看视频得积分", + version: `android@8.0102`, + //orderId: "0923fca6d5ffb8ec017fc6b3cbc5c9c0", + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + await require("./taskcallback").doTask(request, { + ...options, + params, + jar, + }); + + let s = Math.floor(Math.random() * 30); + console.log("☕ 等待%s秒再继续", s); + // eslint-disable-next-line no-unused-vars + await new Promise((resolve, reject) => setTimeout(resolve, s * 1000)); + } while (--num); + }, +}; + +module.exports = taocan; From 3dbc0d06b66b00ea604ff9a7a9305b9e8155dd64 Mon Sep 17 00:00:00 2001 From: cooip-jm <78735965+cooip-jm@users.noreply.github.com> Date: Thu, 18 Feb 2021 11:18:55 +0800 Subject: [PATCH 092/128] Update unicom.js add taocan task --- commands/tasks/unicom/unicom.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/commands/tasks/unicom/unicom.js b/commands/tasks/unicom/unicom.js index 53fc33945..541c54caf 100644 --- a/commands/tasks/unicom/unicom.js +++ b/commands/tasks/unicom/unicom.js @@ -451,6 +451,19 @@ var start = async (params) => { }, taskOption ); + + //套餐看视频得积分 +//活动入口:主页-套餐页面-2个视频 + await scheduler.regTask( + "taocan", + async (request) => { + await require("./taocan.js").doTask(request, options); + }, + taskOption + ); + + + }; module.exports = { start, From 7bfed10199384f53734d6f0935cb4d62529cca40 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Thu, 18 Feb 2021 15:23:05 +0800 Subject: [PATCH 093/128] =?UTF-8?q?=F0=9F=90=8D=20fixed=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/dailyFingerqd.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/tasks/unicom/dailyFingerqd.js b/commands/tasks/unicom/dailyFingerqd.js index d7abbd846..f99386f1e 100644 --- a/commands/tasks/unicom/dailyFingerqd.js +++ b/commands/tasks/unicom/dailyFingerqd.js @@ -92,7 +92,7 @@ let dailyFingerqd = { do { console.log( "已消耗机会", - 1 + 4 - (freeTimes + advertTimes), + 1 + 3 - (freeTimes + advertTimes), "剩余免费机会", freeTimes, "看视频广告机会", From 92b58aafb2bae9a93e3ce42d98128424059c11db Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Thu, 18 Feb 2021 16:37:50 +0800 Subject: [PATCH 094/128] Update scheduler.js --- utils/scheduler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/scheduler.js b/utils/scheduler.js index 32f32f5da..9af2b481f 100644 --- a/utils/scheduler.js +++ b/utils/scheduler.js @@ -14,7 +14,7 @@ String.prototype.replaceWithMask = function (start, end) { const randomDate = (options) => { let startDate = moment(); - let endDate = moment().endOf("days").subtract(2, "hours"); + let endDate = moment().endOf("days").subtract(5, "hours"); if (options && options.startHours) { startDate = moment().startOf("days").add(options.startHours, "hours"); } From 1a3db877afb2c9aaa896c06236f773bb09488cc9 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Thu, 18 Feb 2021 18:36:26 +0800 Subject: [PATCH 095/128] Update unicom.js --- commands/tasks/unicom/unicom.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/commands/tasks/unicom/unicom.js b/commands/tasks/unicom/unicom.js index 541c54caf..40870905b 100644 --- a/commands/tasks/unicom/unicom.js +++ b/commands/tasks/unicom/unicom.js @@ -422,7 +422,11 @@ var start = async (params) => { async (request) => { await require("./dailyBaWangcard.js").doTask(request, options); }, - taskOption + { + isCircle: true, + intervalTime: 4 * 3600, + ...taskOption, + } ); //首页-小说-任意一本小说内页章节中间 [看书里面的5个视频] @@ -451,9 +455,9 @@ var start = async (params) => { }, taskOption ); - + //套餐看视频得积分 -//活动入口:主页-套餐页面-2个视频 + //活动入口:主页-套餐页面-2个视频 await scheduler.regTask( "taocan", async (request) => { @@ -461,9 +465,6 @@ var start = async (params) => { }, taskOption ); - - - }; module.exports = { start, From 656758cd0dc69d6ef8f3ca9394a09671af141466 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Thu, 18 Feb 2021 18:38:17 +0800 Subject: [PATCH 096/128] Update dailyBaWangcard.js --- commands/tasks/unicom/dailyBaWangcard.js | 1 - 1 file changed, 1 deletion(-) diff --git a/commands/tasks/unicom/dailyBaWangcard.js b/commands/tasks/unicom/dailyBaWangcard.js index 2073b0fbc..6466bbe69 100644 --- a/commands/tasks/unicom/dailyBaWangcard.js +++ b/commands/tasks/unicom/dailyBaWangcard.js @@ -103,7 +103,6 @@ let dailyBaWangcard = { jar: jar1, }); console.log(`广告ID:`, result["orderId"]); - // channelId=unicom_scratch_card&phone=J0c5lPxzAsbEhu4SB7h%2BDg%3D%3D&num=4&token=eyJkYXRhIjoiNWVjMzc1MzNjZDhiYmJhZTEwYWQ1NDMzYjIyNDJkODc2M2Q4ZWU2M2U4ZjAxYTk5OGEzNTQ2NDcwMDFmNzI3NDIyNDc0ZWNiNDM4MjJlOWI1Mjc4NjM3YjhkMzQ4ODJlZTZkMmJjZjk2OGRkNjIxMzI1ZWIwYzQ2NzMwOWVjYTFhYzVkYWQ4MjQwYWIzM2MxZTVhYTRhMDE3OWEyNWU0YWM0MzEwNGRkYTIyNzFhYzhmMTRjYTY2Mjc1MGQ2ODVlIiwidmVyc2lvbiI6IjAwIn0%3D let body = { channelId: "unicom_scratch_card", phone: phone, From 206316e9e62502fc6e851e2e41f85cf7b7ab9236 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Thu, 18 Feb 2021 18:40:13 +0800 Subject: [PATCH 097/128] Update unicom.js --- commands/tasks/unicom/unicom.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/commands/tasks/unicom/unicom.js b/commands/tasks/unicom/unicom.js index 40870905b..747030511 100644 --- a/commands/tasks/unicom/unicom.js +++ b/commands/tasks/unicom/unicom.js @@ -422,11 +422,7 @@ var start = async (params) => { async (request) => { await require("./dailyBaWangcard.js").doTask(request, options); }, - { - isCircle: true, - intervalTime: 4 * 3600, - ...taskOption, - } + taskOption ); //首页-小说-任意一本小说内页章节中间 [看书里面的5个视频] From c12774c4ac9714637c2db2f6e9bfaf5d9b4b32a1 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Fri, 19 Feb 2021 08:39:30 +0800 Subject: [PATCH 098/128] =?UTF-8?q?=F0=9F=90=8D=20fixed=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/producGame.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/commands/tasks/unicom/producGame.js b/commands/tasks/unicom/producGame.js index 37f4a1ddd..62e5facf2 100644 --- a/commands/tasks/unicom/producGame.js +++ b/commands/tasks/unicom/producGame.js @@ -62,7 +62,11 @@ var producGame = { if (result.respCode !== "0000") { console.log("娱乐中心每日签到失败", result.respDesc); } else { - console.log("娱乐中心每日签到获得+" + result.currentIntegral); + if (result.currentIntegral === undefined) { + console.log("娱乐中心每日签到:" + result.respDesc); + } else { + console.log("娱乐中心每日签到获得+" + result.currentIntegral); + } } } else { console.log("娱乐中心每日签到失败"); From 855a6cd8b8f82e654887b23b45207e6c9ae6ad65 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Fri, 19 Feb 2021 09:28:53 +0800 Subject: [PATCH 099/128] =?UTF-8?q?=F0=9F=90=8D=20fixed=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/ingotsPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/tasks/unicom/ingotsPage.js b/commands/tasks/unicom/ingotsPage.js index b5857140b..c91689882 100644 --- a/commands/tasks/unicom/ingotsPage.js +++ b/commands/tasks/unicom/ingotsPage.js @@ -220,7 +220,7 @@ let ingotsPage = { if (result.data.data.length > 0) { for (let i of result.data.data) { console.log("😒 聚宝盆游玩获得: ", i["prizeName"]); - if (i["recordId"] != null && i["double"]) { + if (i["recordId"] != null && i["doubleNum"] != null) { console.log("尝试翻倍"); console.log("😒 聚宝盆游玩翻倍 测试"); await ingotsPage.postGameDouble(axios, options); From 85b0c11c1700d0df51675db976765f093f4f00fb Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Fri, 19 Feb 2021 10:30:11 +0800 Subject: [PATCH 100/128] Update scheduler.js --- utils/scheduler.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/scheduler.js b/utils/scheduler.js index 9af2b481f..ec0b28688 100644 --- a/utils/scheduler.js +++ b/utils/scheduler.js @@ -250,6 +250,9 @@ let scheduler = { // await delCookiesFile([command, scheduler.taskKey].join("_")); // } // 初始化处理 + if (process.env.GITHUB_ACTIONS) { + return; + } let init_funcs = {}; let init_funcs_result = {}; for (let task of will_tasks) { From 4986a1493d591ccd71c91e451e5a0b1d6e101292 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Fri, 19 Feb 2021 17:58:03 +0800 Subject: [PATCH 101/128] updating file --- commands/tasks/unicom/dailyTurncards.js | 314 ++++++++++++++++++++++++ 1 file changed, 314 insertions(+) create mode 100644 commands/tasks/unicom/dailyTurncards.js diff --git a/commands/tasks/unicom/dailyTurncards.js b/commands/tasks/unicom/dailyTurncards.js new file mode 100644 index 000000000..bfca9b262 --- /dev/null +++ b/commands/tasks/unicom/dailyTurncards.js @@ -0,0 +1,314 @@ +const { + UnicomRequest, + UnicomComponent, + generateOrderid, + sleep, + encodePhone, +} = require("./handlers/gameUtils"); +let crypto = require("crypto"); +const gameEvents = require("./handlers/dailyEvent"); +const { sign } = require("./handlers/PAES"); +const { exit } = require("process"); + +let dailyTurncards = { + getOpenPlatLine: gameEvents.getOpenPlatLine( + `https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://wxapp.msmds.cn/h5/react_web/unicom/luckCardPage&duanlianjieabc=tbkd2`, + { base: "msmds" } + ), + doTask: async (axios, options) => { + console.log("🤔 美团饿了么外卖开始..."); + let phone = encodePhone(options.user); + let cookies = await dailyTurncards.getOpenPlatLine(axios, options); + await dailyTurncards.findUserTaskInfo(axios, options, { + ...cookies, + phone, + }); + }, + findUserTaskInfo: async ( + axios, + options, + // eslint-disable-next-line no-unused-vars + { ecs_token, searchParams, jar1, phone } + ) => { + let request = new UnicomRequest(axios, options); + let { data } = await request.postMsmds( + "https://wxapp.msmds.cn/jplus/h5/unicomTask/findUserTaskInfo", + { + type: 1, + phone: phone, + token: ecs_token, + }, + { + referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, + origin: "https://jxbwlsali.kuaizhan.com", + } + ); + if (data.code !== 200) { + throw new Error("❌ something errors: ", data.msg); + } + console.log(data); + let result = await request.postMsmds( + "https://wxapp.msmds.cn/jplus/api/elm/eventVenue", + { + phone: options.user, + code: "elm-ltqdzuanjifen", + }, + { + referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, + origin: "https://jxbwlsali.kuaizhan.com", + } + ); + if (result.data.code !== 200) { + throw new Error("❌ something errors: ", data.msg); + } + console.log(result.data); + result = await request.getMsmds( + `https://wxapp.msmds.cn/jplus/api/byn/getLifeCouponUrlByPhoneV2`, + { + type: 3, + phone: options.user, + }, + { + referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, + origin: "https://jxbwlsali.kuaizhan.com", + } + ); + if (result.data.code !== 200) { + throw new Error("❌ something errors: ", data.msg); + } + console.log(result.data); + result = await request.postMsmds( + "https://wxapp.msmds.cn/jplus/h5/unicomComm/getRecordOperation", + { + key: "welfare0", + phone: options.user, + value: 0, + }, + { + referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, + origin: "https://jxbwlsali.kuaizhan.com", + } + ); + if (result.data.code !== 200) { + throw new Error("❌ something errors: ", data.msg); + } + console.log(result.data); + result = await request.postMsmds( + "https://wxapp.msmds.cn/jplus/h5/unicomComm/updateRecordOperation", + { + key: "welfare0", + phone: options.user, + value: 1, + }, + { + referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, + origin: "https://jxbwlsali.kuaizhan.com", + } + ); + if (result.data.code !== 200) { + throw new Error("❌ something errors: ", data.msg); + } + console.log(result.data); + + result = await request.postMsmds( + "https://wxapp.msmds.cn/jplus/h5/unicomTask/doTask", + { + phone: phone, + type: 1, + token: ecs_token, + }, + { + referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, + origin: "https://jxbwlsali.kuaizhan.com", + } + ); + + console.log(result.data); + if (result.data.code !== 200) { + throw new Error("❌ something errors: ", data.msg); + } + result = await request.postMsmds( + "https://wxapp.msmds.cn/jplus/h5/unicomTask/findUserTaskInfo", + { + type: 1, + phone: phone, + token: ecs_token, + }, + { + referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, + origin: "https://jxbwlsali.kuaizhan.com", + } + ); + if (result.data.code !== 200) { + throw new Error("❌ something errors: ", result.data.msg); + } + console.log(result.data); + // return data; + let meituanParams = { + arguments1: "AC20200716103629", + arguments2: "GGPD", + arguments3: "034a70393ef246039264765216450d5d", + arguments4: new Date().getTime(), + arguments6: "", + netWay: "Wifi", + version: `android@8.0102`, + }; + let { num, jar } = await require("./taskcallback").query(axios, { + ...options, + params: meituanParams, + }); + console.log(num); + if (num) { + console.log("美团积分获取开始..."); + let params = { + arguments1: "AC20200716103629", // acid + arguments2: "GGPD", // yhChannel + arguments3: "034a70393ef246039264765216450d5d", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "517050707", + arguments7: "517050707", + arguments8: "123456", + arguments9: "4640b530b3f7481bb5821c6871854ce5", + netWay: "Wifi", + remark1: "领福利赚积分-翻倍得积分", + remark: "领福利赚积分-翻倍得积分", + version: `android@8.0102`, + codeId: 945535612, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + params["orderId"] = generateOrderid(); + params["arguments4"] = new Date().getTime(); + console.log("看视频广告中..."); + let result = await require("./taskcallback").reward(axios, { + ...options, + params, + jar: jar1, + }); + console.log(`广告ID:`, result["orderId"]); + await sleep(30); + params = { + arguments1: "AC20200716103629", // acid + arguments2: "GGPD", // yhChannel + arguments3: "034a70393ef246039264765216450d5d", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "", + arguments7: "", + arguments8: "", + arguments9: "", + orderId: params["orderId"], + netWay: "Wifi", + remark: "领福利赚积分-翻倍得积分", + version: `android@8.0102`, + codeId: 945689604, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + await sleep(30); + await require("./taskcallback").doTask(axios, { + ...options, + params, + jar, + }); + } + result = await request.getMsmds( + `https://wxapp.msmds.cn/jplus/api/byn/getLifeCouponUrlByPhoneV2`, + { + type: 3, + phone: options.user, + }, + { + referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, + origin: "https://jxbwlsali.kuaizhan.com", + } + ); + if (result.data.code !== 200) { + throw new Error("❌ something errors: ", data.msg); + } + console.log(result.data); + let eleParams = { + arguments1: "AC20200716103629", + arguments2: "GGPD", + arguments3: "90d46c26212649788ed1dd14134d35e5", + arguments4: new Date().getTime(), + arguments6: "517050707", + netWay: "Wifi", + version: `android@8.0102`, + }; + let { num2, jar2 } = await require("./taskcallback").query(axios, { + ...options, + params: eleParams, + }); + + if (num2) { + console.log("饿了么积分获取开始..."); + let params = { + arguments1: "AC20200716103629", // acid + arguments2: "GGPD", // yhChannel + arguments3: "90d46c26212649788ed1dd14134d35e5", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "517050707", + arguments7: "517050707", + arguments8: "123456", + arguments9: "4640b530b3f7481bb5821c6871854ce5", + netWay: "Wifi", + remark1: "领福利赚积分-翻倍得积分", + remark: "领福利赚积分-翻倍得积分", + version: `android@8.0102`, + codeId: 945535612, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + params["orderId"] = generateOrderid(); + params["arguments4"] = new Date().getTime(); + console.log("看视频广告中..."); + let result = await require("./taskcallback").reward(axios, { + ...options, + params, + jar: jar1, + }); + console.log(`广告ID:`, result["orderId"]); + await sleep(30); + params = { + arguments1: "AC20200716103629", // acid + arguments2: "GGPD", // yhChannel + arguments3: "90d46c26212649788ed1dd14134d35e5", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "", + arguments7: "", + arguments8: "", + arguments9: "", + orderId: params["orderId"], + netWay: "Wifi", + remark: "领福利赚积分-翻倍得积分", + version: `android@8.0102`, + codeId: 945689604, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + await sleep(30); + await require("./taskcallback").doTask(axios, { + ...options, + params, + jar, + }); + } + }, +}; +module.exports = dailyTurncards; From 4b229926a7cd0e9208b696ea984d5d634ee0c7a9 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Fri, 19 Feb 2021 18:25:05 +0800 Subject: [PATCH 102/128] Update freeDownFloorAd.js --- commands/tasks/unicom/freeDownFloorAd.js | 40 ++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/commands/tasks/unicom/freeDownFloorAd.js b/commands/tasks/unicom/freeDownFloorAd.js index d3a710021..e3c64ba1f 100644 --- a/commands/tasks/unicom/freeDownFloorAd.js +++ b/commands/tasks/unicom/freeDownFloorAd.js @@ -22,9 +22,8 @@ let Data = { params: { serialNumber: "", appList: [], - operator: "onAdClick", }, - methodType: "2", + methodType: "2", //1 游戏 2 app }; let freeDownFloorAd = { @@ -38,6 +37,7 @@ let freeDownFloorAd = { Data.commonInfo.currentTime = currentTime; Data.params.serialNumber = options.user; Data.params.appList.push(appList[0]); + await freeDownFloorAd.begin(axios, options, Data); let jar1 = await freeDownFloorAd.onAdDisplay(axios, options, Data); let { citycode } = await freeDownFloorAd.onAdClick(axios, options, Data); await freeDownFloorAd.getCoins(axios, options, citycode); @@ -51,6 +51,42 @@ let freeDownFloorAd = { await freeDownFloorAd.getIntegralFree(axios, options, jar1); await freeDownFloorAd.onAdDisplay(axios, options, Data); }, + begin: async (axios, options, appinfo) => { + let currentTime = moment().format("YYYYMMDDHHmmssSSS"); + let traceId = "100008" + currentTime + "215210247"; + appinfo.commonInfo.traceId = traceId; + appinfo.commonInfo.traceId = traceId; + appinfo.methodType = "1"; + let res = await axios + .request({ + baseURL: "https://m.client.10010.com/", + headers: { + "user-agent": "okhttp/4.4.0", + origin: "https://m.client.10010.com/", + "Content-Type": "application/json;charset=UTF-8", + }, + url: `/uniAdmsInterface/getFreeDownFloorAd`, + method: "post", + data: appinfo, + }) + .catch((err) => console.log(err)); + let jar1 = res.config.jar.toJSON(); + jar1.cookies.push({ + key: "req_wheel", + value: "ssss", + expires: "2021-02-13T09:43:35.000Z", + domain: "10010.com", + path: "/", + hostOnly: false, + creation: "2021-02-12T08:43:35.008Z", + lastAccessed: "2021-02-12T08:43:35.008Z", + }); + console.log(res.data); + console.log("等待15秒再继续"); + // eslint-disable-next-line no-unused-vars + await new Promise((resolve, reject) => setTimeout(resolve, 15 * 1000)); + return jar1; + }, onAdDisplay: async (axios, options, appinfo) => { let currentTime = moment().format("YYYYMMDDHHmmssSSS"); let traceId = "100008" + currentTime + "215210247"; From c095066a047f63ec950e5d7ab7f4b58e353515f4 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Sat, 20 Feb 2021 11:22:54 +0800 Subject: [PATCH 103/128] =?UTF-8?q?=F0=9F=8F=B3=E2=80=8D=F0=9F=8C=88=20upd?= =?UTF-8?q?ated=20task?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/dailyTurncards.js | 364 ++++++++++++++------ commands/tasks/unicom/handlers/gameUtils.js | 5 +- commands/tasks/unicom/unicom.js | 9 + 3 files changed, 273 insertions(+), 105 deletions(-) diff --git a/commands/tasks/unicom/dailyTurncards.js b/commands/tasks/unicom/dailyTurncards.js index bfca9b262..53001946b 100644 --- a/commands/tasks/unicom/dailyTurncards.js +++ b/commands/tasks/unicom/dailyTurncards.js @@ -23,80 +23,26 @@ let dailyTurncards = { ...cookies, phone, }); + await dailyTurncards.doElementTask(axios, options, { + ...cookies, + phone, + }); + await dailyTurncards.doMeituanTask(axios, options, { + ...cookies, + phone, + }); }, - findUserTaskInfo: async ( + doMeituanTask: async ( axios, options, - // eslint-disable-next-line no-unused-vars { ecs_token, searchParams, jar1, phone } ) => { let request = new UnicomRequest(axios, options); - let { data } = await request.postMsmds( - "https://wxapp.msmds.cn/jplus/h5/unicomTask/findUserTaskInfo", - { - type: 1, - phone: phone, - token: ecs_token, - }, - { - referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, - origin: "https://jxbwlsali.kuaizhan.com", - } - ); - if (data.code !== 200) { - throw new Error("❌ something errors: ", data.msg); - } - console.log(data); + console.log("美团积分开始..."); let result = await request.postMsmds( - "https://wxapp.msmds.cn/jplus/api/elm/eventVenue", - { - phone: options.user, - code: "elm-ltqdzuanjifen", - }, - { - referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, - origin: "https://jxbwlsali.kuaizhan.com", - } - ); - if (result.data.code !== 200) { - throw new Error("❌ something errors: ", data.msg); - } - console.log(result.data); - result = await request.getMsmds( - `https://wxapp.msmds.cn/jplus/api/byn/getLifeCouponUrlByPhoneV2`, - { - type: 3, - phone: options.user, - }, - { - referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, - origin: "https://jxbwlsali.kuaizhan.com", - } - ); - if (result.data.code !== 200) { - throw new Error("❌ something errors: ", data.msg); - } - console.log(result.data); - result = await request.postMsmds( - "https://wxapp.msmds.cn/jplus/h5/unicomComm/getRecordOperation", - { - key: "welfare0", - phone: options.user, - value: 0, - }, - { - referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, - origin: "https://jxbwlsali.kuaizhan.com", - } - ); - if (result.data.code !== 200) { - throw new Error("❌ something errors: ", data.msg); - } - console.log(result.data); - result = await request.postMsmds( "https://wxapp.msmds.cn/jplus/h5/unicomComm/updateRecordOperation", { - key: "welfare0", + key: "welfare1", phone: options.user, value: 1, }, @@ -106,64 +52,119 @@ let dailyTurncards = { } ); if (result.data.code !== 200) { - throw new Error("❌ something errors: ", data.msg); + throw new Error("❌ something errors: ", result.data.msg); } - console.log(result.data); + console.log("获取操作"); + // result = await request.postMsmds( + // "https://wxapp.msmds.cn/jplus/h5/unicomComm/getRecordOperation", + // { + // key: "welfare0", + // phone: options.user, + // value: 0, + // }, + // { + // referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, + // origin: "https://jxbwlsali.kuaizhan.com", + // } + // ); + // if (result.data.code !== 200) { + // throw new Error("❌ something errors: ", result.data.msg); + // } + // result = await request.postMsmds( + // "https://wxapp.msmds.cn/jplus/h5/unicomComm/getRecordOperation", + // { + // key: "welfare1", + // phone: options.user, + // value: 0, + // }, + // { + // referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, + // origin: "https://jxbwlsali.kuaizhan.com", + // } + // ); + // if (result.data.code !== 200) { + // throw new Error("❌ something errors: ", result.data.msg); + // } + // console.log("获取信息"); + // result = await request.postMsmds( + // "https://wxapp.msmds.cn/jplus/h5/unicomTask/findUserTaskInfo", + // { + // phone: phone, + // type: 1, + // token: ecs_token, + // }, + // { + // referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, + // origin: "https://jxbwlsali.kuaizhan.com", + // } + // ); + // console.log(result.data); + // if (result.data.code !== 200) { + // throw new Error("❌ something errors: ", result.data.msg); + // } + console.log("奖励开始"); result = await request.postMsmds( "https://wxapp.msmds.cn/jplus/h5/unicomTask/doTask", { phone: phone, - type: 1, + type: 6, token: ecs_token, }, { referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, origin: "https://jxbwlsali.kuaizhan.com", + "Content-Type": "application/x-www-form-urlencoded", } ); - console.log(result.data); - if (result.data.code !== 200) { - throw new Error("❌ something errors: ", data.msg); - } - result = await request.postMsmds( - "https://wxapp.msmds.cn/jplus/h5/unicomTask/findUserTaskInfo", - { - type: 1, - phone: phone, - token: ecs_token, - }, - { - referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, - origin: "https://jxbwlsali.kuaizhan.com", - } - ); + // console.log(result.data); if (result.data.code !== 200) { throw new Error("❌ something errors: ", result.data.msg); } - console.log(result.data); - // return data; + // console.log("获取信息"); + // result = await request.postMsmds( + // "https://wxapp.msmds.cn/jplus/h5/unicomTask/findUserTaskInfo", + // { + // type: 1, + // phone: phone, + // token: ecs_token, + // }, + // { + // referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, + // origin: "https://jxbwlsali.kuaizhan.com", + // } + // ); + // if (result.data.code !== 200) { + // throw new Error("❌ something errors: ", result.data.msg); + // } + // console.log(result.data); let meituanParams = { arguments1: "AC20200716103629", arguments2: "GGPD", - arguments3: "034a70393ef246039264765216450d5d", + arguments3: "90d46c26212649788ed1dd14134d35e5", arguments4: new Date().getTime(), - arguments6: "", + arguments6: "517050707", netWay: "Wifi", version: `android@8.0102`, }; + meituanParams["sign"] = sign([ + meituanParams.arguments1, + meituanParams.arguments2, + meituanParams.arguments3, + meituanParams.arguments4, + ]); let { num, jar } = await require("./taskcallback").query(axios, { ...options, params: meituanParams, }); - console.log(num); + if (num) { console.log("美团积分获取开始..."); let params = { arguments1: "AC20200716103629", // acid arguments2: "GGPD", // yhChannel - arguments3: "034a70393ef246039264765216450d5d", // yhTaskId menuId + arguments3: "90d46c26212649788ed1dd14134d35e5", // yhTaskId menuId arguments4: new Date().getTime(), // time arguments6: "517050707", arguments7: "517050707", @@ -194,7 +195,7 @@ let dailyTurncards = { params = { arguments1: "AC20200716103629", // acid arguments2: "GGPD", // yhChannel - arguments3: "034a70393ef246039264765216450d5d", // yhTaskId menuId + arguments3: "90d46c26212649788ed1dd14134d35e5", // yhTaskId menuId arguments4: new Date().getTime(), // time arguments6: "", arguments7: "", @@ -219,11 +220,21 @@ let dailyTurncards = { jar, }); } - result = await request.getMsmds( - `https://wxapp.msmds.cn/jplus/api/byn/getLifeCouponUrlByPhoneV2`, + }, + doElementTask: async ( + axios, + options, + // eslint-disable-next-line no-unused-vars + { ecs_token, searchParams, jar1, phone } + ) => { + let request = new UnicomRequest(axios, options); + console.log("饿了么积分开始..."); + let result = await request.postMsmds( + "https://wxapp.msmds.cn/jplus/h5/unicomComm/updateRecordOperation", { - type: 3, + key: "welfare0", phone: options.user, + value: 1, }, { referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, @@ -231,29 +242,121 @@ let dailyTurncards = { } ); if (result.data.code !== 200) { - throw new Error("❌ something errors: ", data.msg); + throw new Error("❌ something errors: ", result.data.msg); + } + console.log("获取操作"); + result = await request.postMsmds( + "https://wxapp.msmds.cn/jplus/h5/unicomComm/getRecordOperation", + { + key: "welfare0", + phone: options.user, + value: 0, + }, + { + referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, + origin: "https://jxbwlsali.kuaizhan.com", + } + ); + if (result.data.code !== 200) { + throw new Error("❌ something errors: ", result.data.msg); } - console.log(result.data); + result = await request.postMsmds( + "https://wxapp.msmds.cn/jplus/h5/unicomComm/getRecordOperation", + { + key: "welfare1", + phone: options.user, + value: 0, + }, + { + referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, + origin: "https://jxbwlsali.kuaizhan.com", + } + ); + if (result.data.code !== 200) { + throw new Error("❌ something errors: ", result.data.msg); + } + console.log("获取信息"); + result = await request.postMsmds( + "https://wxapp.msmds.cn/jplus/h5/unicomTask/findUserTaskInfo", + { + phone: phone, + type: 1, + token: ecs_token, + }, + { + referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, + origin: "https://jxbwlsali.kuaizhan.com", + } + ); + + // console.log(result.data); + if (result.data.code !== 200) { + throw new Error("❌ something errors: ", result.data.msg); + } + console.log("奖励开始"); + result = await request.postMsmds( + "https://wxapp.msmds.cn/jplus/h5/unicomTask/doTask", + { + phone: phone, + type: 1, + token: ecs_token, + }, + { + referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, + origin: "https://jxbwlsali.kuaizhan.com", + "Content-Type": "application/x-www-form-urlencoded", + } + ); + + // console.log(result.data); + if (result.data.code !== 200) { + throw new Error("❌ something errors: ", result.data.msg); + } + console.log("获取信息"); + result = await request.postMsmds( + "https://wxapp.msmds.cn/jplus/h5/unicomTask/findUserTaskInfo", + { + type: 1, + phone: phone, + token: ecs_token, + }, + { + referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, + origin: "https://jxbwlsali.kuaizhan.com", + } + ); + if (result.data.code !== 200) { + throw new Error("❌ something errors: ", result.data.msg); + } + // console.log(result.data); + // return data; let eleParams = { arguments1: "AC20200716103629", arguments2: "GGPD", - arguments3: "90d46c26212649788ed1dd14134d35e5", + arguments3: "034a70393ef246039264765216450d5d", arguments4: new Date().getTime(), - arguments6: "517050707", - netWay: "Wifi", + arguments6: "", version: `android@8.0102`, + netWay: "Wifi", }; - let { num2, jar2 } = await require("./taskcallback").query(axios, { + eleParams["sign"] = sign([ + eleParams.arguments1, + eleParams.arguments2, + eleParams.arguments3, + eleParams.arguments4, + ]); + console.log("查询奖励"); + let { num, jar } = await require("./taskcallback").query(axios, { ...options, params: eleParams, }); - - if (num2) { + // console.log(num); + if (num) { console.log("饿了么积分获取开始..."); let params = { arguments1: "AC20200716103629", // acid arguments2: "GGPD", // yhChannel - arguments3: "90d46c26212649788ed1dd14134d35e5", // yhTaskId menuId + arguments3: "034a70393ef246039264765216450d5d", // yhTaskId menuId arguments4: new Date().getTime(), // time arguments6: "517050707", arguments7: "517050707", @@ -284,7 +387,7 @@ let dailyTurncards = { params = { arguments1: "AC20200716103629", // acid arguments2: "GGPD", // yhChannel - arguments3: "90d46c26212649788ed1dd14134d35e5", // yhTaskId menuId + arguments3: "034a70393ef246039264765216450d5d", // yhTaskId menuId arguments4: new Date().getTime(), // time arguments6: "", arguments7: "", @@ -310,5 +413,58 @@ let dailyTurncards = { }); } }, + findUserTaskInfo: async ( + axios, + options, + // eslint-disable-next-line no-unused-vars + { ecs_token, searchParams, jar1, phone } + ) => { + let request = new UnicomRequest(axios, options); + console.log("查询接口"); + let { data } = await request.postMsmds( + "https://wxapp.msmds.cn/jplus/h5/unicomTask/findUserTaskInfo", + { + type: 1, + phone: phone, + token: ecs_token, + }, + { + referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, + origin: "https://jxbwlsali.kuaizhan.com", + } + ); + if (data.code !== 200) { + throw new Error("❌ something errors: ", data.msg); + } + console.log("获取优惠券"); + let result = await request.postMsmds( + "https://wxapp.msmds.cn/jplus/api/elm/eventVenue", + { + phone: options.user, + code: "elm-ltqdzuanjifen", + }, + { + referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, + origin: "https://jxbwlsali.kuaizhan.com", + } + ); + if (result.data.code !== 200) { + throw new Error("❌ something errors: ", data.msg); + } + result = await request.getMsmds( + `https://wxapp.msmds.cn/jplus/api/byn/getLifeCouponUrlByPhoneV2`, + { + type: 3, + phone: options.user, + }, + { + referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, + origin: "https://jxbwlsali.kuaizhan.com", + } + ); + if (result.data.code !== 200) { + throw new Error("❌ something errors: ", data.msg); + } + }, }; module.exports = dailyTurncards; diff --git a/commands/tasks/unicom/handlers/gameUtils.js b/commands/tasks/unicom/handlers/gameUtils.js index 9f126e9d0..2a1b897d9 100644 --- a/commands/tasks/unicom/handlers/gameUtils.js +++ b/commands/tasks/unicom/handlers/gameUtils.js @@ -44,7 +44,10 @@ class UnicomRequest { async postMsmds( url, data, - headers = { referer: null, origin: null }, + headers = { + referer: null, + origin: null, + }, USER_AGENTS = null ) { return await this.axios.request({ diff --git a/commands/tasks/unicom/unicom.js b/commands/tasks/unicom/unicom.js index 747030511..8217e2031 100644 --- a/commands/tasks/unicom/unicom.js +++ b/commands/tasks/unicom/unicom.js @@ -461,6 +461,15 @@ var start = async (params) => { }, taskOption ); + + // 首页-签到有礼-饿了么红包 + await scheduler.regTask( + "dailyTurncards", + async (request) => { + await require("./dailyTurncards.js").doTask(request, options); + }, + taskOption + ); }; module.exports = { start, From f56164176977d19817dea78b8336803b649d807e Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Sat, 20 Feb 2021 11:39:52 +0800 Subject: [PATCH 104/128] updating file --- commands/tasks/unicom/dailyTurncards.js | 124 ++++++++++++------------ 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/commands/tasks/unicom/dailyTurncards.js b/commands/tasks/unicom/dailyTurncards.js index 53001946b..25aef1b8a 100644 --- a/commands/tasks/unicom/dailyTurncards.js +++ b/commands/tasks/unicom/dailyTurncards.js @@ -55,54 +55,54 @@ let dailyTurncards = { throw new Error("❌ something errors: ", result.data.msg); } console.log("获取操作"); - // result = await request.postMsmds( - // "https://wxapp.msmds.cn/jplus/h5/unicomComm/getRecordOperation", - // { - // key: "welfare0", - // phone: options.user, - // value: 0, - // }, - // { - // referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, - // origin: "https://jxbwlsali.kuaizhan.com", - // } - // ); - // if (result.data.code !== 200) { - // throw new Error("❌ something errors: ", result.data.msg); - // } - // result = await request.postMsmds( - // "https://wxapp.msmds.cn/jplus/h5/unicomComm/getRecordOperation", - // { - // key: "welfare1", - // phone: options.user, - // value: 0, - // }, - // { - // referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, - // origin: "https://jxbwlsali.kuaizhan.com", - // } - // ); - // if (result.data.code !== 200) { - // throw new Error("❌ something errors: ", result.data.msg); - // } - // console.log("获取信息"); - // result = await request.postMsmds( - // "https://wxapp.msmds.cn/jplus/h5/unicomTask/findUserTaskInfo", - // { - // phone: phone, - // type: 1, - // token: ecs_token, - // }, - // { - // referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, - // origin: "https://jxbwlsali.kuaizhan.com", - // } - // ); + result = await request.postMsmds( + "https://wxapp.msmds.cn/jplus/h5/unicomComm/getRecordOperation", + { + key: "welfare0", + phone: options.user, + value: 0, + }, + { + referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, + origin: "https://jxbwlsali.kuaizhan.com", + } + ); + if (result.data.code !== 200) { + throw new Error("❌ something errors: ", result.data.msg); + } + result = await request.postMsmds( + "https://wxapp.msmds.cn/jplus/h5/unicomComm/getRecordOperation", + { + key: "welfare1", + phone: options.user, + value: 0, + }, + { + referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, + origin: "https://jxbwlsali.kuaizhan.com", + } + ); + if (result.data.code !== 200) { + throw new Error("❌ something errors: ", result.data.msg); + } + console.log("获取信息"); + result = await request.postMsmds( + "https://wxapp.msmds.cn/jplus/h5/unicomTask/findUserTaskInfo", + { + phone: phone, + type: 1, + token: ecs_token, + }, + { + referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, + origin: "https://jxbwlsali.kuaizhan.com", + } + ); // console.log(result.data); - // if (result.data.code !== 200) { - // throw new Error("❌ something errors: ", result.data.msg); - // } + if (result.data.code !== 200) { + throw new Error("❌ something errors: ", result.data.msg); + } console.log("奖励开始"); result = await request.postMsmds( "https://wxapp.msmds.cn/jplus/h5/unicomTask/doTask", @@ -122,22 +122,22 @@ let dailyTurncards = { if (result.data.code !== 200) { throw new Error("❌ something errors: ", result.data.msg); } - // console.log("获取信息"); - // result = await request.postMsmds( - // "https://wxapp.msmds.cn/jplus/h5/unicomTask/findUserTaskInfo", - // { - // type: 1, - // phone: phone, - // token: ecs_token, - // }, - // { - // referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, - // origin: "https://jxbwlsali.kuaizhan.com", - // } - // ); - // if (result.data.code !== 200) { - // throw new Error("❌ something errors: ", result.data.msg); - // } + console.log("获取信息"); + result = await request.postMsmds( + "https://wxapp.msmds.cn/jplus/h5/unicomTask/findUserTaskInfo", + { + type: 1, + phone: phone, + token: ecs_token, + }, + { + referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, + origin: "https://jxbwlsali.kuaizhan.com", + } + ); + if (result.data.code !== 200) { + throw new Error("❌ something errors: ", result.data.msg); + } // console.log(result.data); let meituanParams = { arguments1: "AC20200716103629", From 16c2a6d10dcaa07a9e075e06bee4af1f385fc3f1 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Sat, 20 Feb 2021 11:58:08 +0800 Subject: [PATCH 105/128] =?UTF-8?q?=F0=9F=90=8D=20fixed=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/dailyTurncards.js | 49 +++++++++++++++++++------ 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/commands/tasks/unicom/dailyTurncards.js b/commands/tasks/unicom/dailyTurncards.js index 25aef1b8a..a03f5b871 100644 --- a/commands/tasks/unicom/dailyTurncards.js +++ b/commands/tasks/unicom/dailyTurncards.js @@ -1,14 +1,11 @@ const { UnicomRequest, - UnicomComponent, generateOrderid, sleep, encodePhone, } = require("./handlers/gameUtils"); -let crypto = require("crypto"); const gameEvents = require("./handlers/dailyEvent"); const { sign } = require("./handlers/PAES"); -const { exit } = require("process"); let dailyTurncards = { getOpenPlatLine: gameEvents.getOpenPlatLine( @@ -32,11 +29,7 @@ let dailyTurncards = { phone, }); }, - doMeituanTask: async ( - axios, - options, - { ecs_token, searchParams, jar1, phone } - ) => { + doMeituanTask: async (axios, options, { ecs_token, jar1, phone }) => { let request = new UnicomRequest(axios, options); console.log("美团积分开始..."); let result = await request.postMsmds( @@ -122,11 +115,29 @@ let dailyTurncards = { if (result.data.code !== 200) { throw new Error("❌ something errors: ", result.data.msg); } - console.log("获取信息"); result = await request.postMsmds( - "https://wxapp.msmds.cn/jplus/h5/unicomTask/findUserTaskInfo", + "https://wxapp.msmds.cn/jplus/h5/unicomTask/doTask", { - type: 1, + phone: phone, + type: 6, + token: ecs_token, + }, + { + referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, + origin: "https://jxbwlsali.kuaizhan.com", + "Content-Type": "application/x-www-form-urlencoded", + } + ); + + // console.log(result.data); + if (result.data.code !== 200) { + throw new Error("❌ something errors: ", result.data.msg); + } + console.log("开优惠券"); + result = await request.postMsmds( + "https://wxapp.msmds.cn/jplus/h5/unicomTask/receiveDouling", + { + type: 6, phone: phone, token: ecs_token, }, @@ -312,6 +323,22 @@ let dailyTurncards = { if (result.data.code !== 200) { throw new Error("❌ something errors: ", result.data.msg); } + console.log("开优惠券"); + result = await request.postMsmds( + "https://wxapp.msmds.cn/jplus/h5/unicomTask/receiveDouling", + { + type: 6, + phone: phone, + token: ecs_token, + }, + { + referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, + origin: "https://jxbwlsali.kuaizhan.com", + } + ); + if (result.data.code !== 200) { + throw new Error("❌ something errors: ", result.data.msg); + } console.log("获取信息"); result = await request.postMsmds( "https://wxapp.msmds.cn/jplus/h5/unicomTask/findUserTaskInfo", From 016966865f81dbeb585a21282a4b4bb7dc8de718 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Sat, 20 Feb 2021 12:01:51 +0800 Subject: [PATCH 106/128] =?UTF-8?q?=F0=9F=90=8D=20fixed=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/dailyTurncards.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/commands/tasks/unicom/dailyTurncards.js b/commands/tasks/unicom/dailyTurncards.js index a03f5b871..2e00211a1 100644 --- a/commands/tasks/unicom/dailyTurncards.js +++ b/commands/tasks/unicom/dailyTurncards.js @@ -147,9 +147,9 @@ let dailyTurncards = { } ); if (result.data.code !== 200) { - throw new Error("❌ something errors: ", result.data.msg); + console.log("❌ something errors: ", result.data.msg); } - // console.log(result.data); + console.log(result.data); let meituanParams = { arguments1: "AC20200716103629", arguments2: "GGPD", @@ -327,7 +327,7 @@ let dailyTurncards = { result = await request.postMsmds( "https://wxapp.msmds.cn/jplus/h5/unicomTask/receiveDouling", { - type: 6, + type: 1, phone: phone, token: ecs_token, }, @@ -336,8 +336,9 @@ let dailyTurncards = { origin: "https://jxbwlsali.kuaizhan.com", } ); + // console.log(result.data); if (result.data.code !== 200) { - throw new Error("❌ something errors: ", result.data.msg); + console.log("❌ something errors: ", result.data.msg); } console.log("获取信息"); result = await request.postMsmds( From d51f38b5728f4ef92b96be633b417499b6094b68 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Sat, 20 Feb 2021 15:32:32 +0800 Subject: [PATCH 107/128] updated depends --- config/.env.sample | 2 ++ config/.gitignore | 4 ++++ package.json | 1 + 3 files changed, 7 insertions(+) create mode 100644 config/.env.sample create mode 100644 config/.gitignore diff --git a/config/.env.sample b/config/.env.sample new file mode 100644 index 000000000..a1f1e0b1c --- /dev/null +++ b/config/.env.sample @@ -0,0 +1,2 @@ +UNICOM_USERNAME = '' +UNICOM_PASSWORD = '' diff --git a/config/.gitignore b/config/.gitignore new file mode 100644 index 000000000..c61d63961 --- /dev/null +++ b/config/.gitignore @@ -0,0 +1,4 @@ +* +!.gitignore +!.env.sample + diff --git a/package.json b/package.json index 003cadb84..02b270225 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "crypto": "^1.0.1", "crypto-js": "^4.0.0", "dayjs": "^1.9.6", + "dotenv": "^8.2.0", "fs-extra": "^9.0.1", "iconv-lite": "^0.6.2", "moment": "^2.29.1", From 6ca99568c9366efcae775234ca09e9a2bb4f9d2a Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Sat, 20 Feb 2021 16:20:54 +0800 Subject: [PATCH 108/128] updated tasks and envs feature --- commands/unicom.js | 80 ++++++++++++++++++++-------------------------- config/.env.sample | 1 + 2 files changed, 35 insertions(+), 46 deletions(-) diff --git a/commands/unicom.js b/commands/unicom.js index 08071031c..86af41f9f 100644 --- a/commands/unicom.js +++ b/commands/unicom.js @@ -1,66 +1,54 @@ const path = require("path"); +const { exit } = require("yargs"); const { scheduler } = require("../utils/scheduler"); exports.command = "unicom"; exports.describe = "unicom任务"; - +const UNICOM_USERNAME = "UNICOM_USERNAME"; +const UNICOM_PASSWORD = "UNICOM_PASSWORD"; +const UNICOM_APPID = "UNICOM_APPID"; +let env = require("dotenv").config({ + path: path.resolve(process.cwd(), "config", ".env"), +}).parsed; +if (!env) { + throw new Error("missing env file,please check it as well"); +} exports.builder = function (yargs) { return yargs - .option("user", { - describe: "用于登录的手机号码", - default: "", - type: "string", - }) - .option("password", { - describe: "用于登录的账户密码", - default: "", - type: "string", - }) - .option("appid", { - describe: "appid", - default: "", - type: "string", - }) - .option("cookies", { - describe: "签到cookies", - default: "", - type: "string", - }) .help() .showHelpOnFail(true, "使用--help查看有效选项") .epilog("copyright 2020 LunnLew"); }; +let getAccount = (data, cb = null) => { + let account = []; + let users = data[UNICOM_USERNAME].split(",").map((i) => i.trim()); + let pwd = data[UNICOM_PASSWORD].split(",").map((i) => i.trim()); + let appid = data[UNICOM_APPID].split(",").map((i) => i.trim()); + if (!users.length || !pwd.length || users.length !== pwd.length) { + throw new Error("Please check your username and password"); + } + if ( + Object.prototype.toString.call(users) !== "[object Array]" && + Object.prototype.toString.call(pwd) !== "[object Array]" + ) { + throw new Error("username and password 非法"); + } + users.forEach((user, i) => { + account.push({ user: user, password: pwd[i], appid: appid[i] }); + }); + return typeof cb === "function" ? cb(account) : account; +}; exports.handler = async function (argv) { var command = argv._[0]; var accounts = []; - if ("accountSn" in argv && argv.accountSn) { - let accountSns = (argv.accountSn + "").split(","); - for (let sn of accountSns) { - if ("user-" + sn in argv) { - let account = { - cookies: argv["cookies-" + sn], - user: argv["user-" + sn] + "", - password: argv["password-" + sn] + "", - appid: argv["appid-" + sn], - tasks: argv["tasks-" + sn] || argv["tasks"], - }; - if ("tryrun-" + sn in argv) { - account["tryrun"] = true; - } - accounts.push(account); - } - } - } else { - accounts.push({ - cookies: argv["cookies"], - user: argv["user"] + "", - password: argv["password"] + "", - appid: argv["appid"], - tasks: argv["tasks"], + accounts = getAccount(env, (data) => { + data.map((i) => { + i.tasks = argv["tasks"]; }); - } + return data; + }); console.log("总账户数", accounts.length); for (let account of accounts) { await require(path.join(__dirname, "tasks", command, command)) diff --git a/config/.env.sample b/config/.env.sample index a1f1e0b1c..89b677ae6 100644 --- a/config/.env.sample +++ b/config/.env.sample @@ -1,2 +1,3 @@ UNICOM_USERNAME = '' UNICOM_PASSWORD = '' +UNICOM_UNICOM_APPID = '' From bebfc9fd46bc58abfa142fb110238297d3936d6e Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Sat, 20 Feb 2021 23:01:22 +0800 Subject: [PATCH 109/128] updated contents on console log --- commands/tasks/52pojie/sign.js | 66 +++++++++++++++++++--------------- commands/unicom.js | 7 ++-- config/.env.sample | 3 +- 3 files changed, 42 insertions(+), 34 deletions(-) diff --git a/commands/tasks/52pojie/sign.js b/commands/tasks/52pojie/sign.js index 34c03af75..a6913633b 100644 --- a/commands/tasks/52pojie/sign.js +++ b/commands/tasks/52pojie/sign.js @@ -1,38 +1,46 @@ -const iconv = require('iconv-lite'); -const cheerio = require('cheerio') +const iconv = require("iconv-lite"); +const cheerio = require("cheerio"); var loadSign = async (axios, url) => { let chunks = []; let str = await new Promise((resolve, reject) => { - axios.request({ - url: url, - responseType: 'stream' - }).then(res => { - res.data.on('data', chunk => { - chunks.push(chunk); - }); - res.data.on('end', () => { - let buffer = Buffer.concat(chunks); - let str = iconv.decode(buffer, 'gbk'); - resolve(str) + axios + .request({ + url: url, + responseType: "stream", }) - }) - }) - let $ = cheerio.load(str) - let msg = $('#messagetext').text() - return msg -} + .then((res) => { + res.data.on("data", (chunk) => { + chunks.push(chunk); + }); + res.data.on("end", () => { + let buffer = Buffer.concat(chunks); + let str = iconv.decode(buffer, "gbk"); + resolve(str); + }); + }); + }); + let $ = cheerio.load(str); + let msg = $("#messagetext").text(); + return msg; +}; module.exports = async (axios) => { - let msg = await loadSign(axios, 'https://www.52pojie.cn/home.php?mod=task&do=apply&id=2') - if (msg.indexOf('需要先登录才能继续本操作') !== -1) { - console.log("需要先登录才能继续本操作,跳过本期任务") - return + let msg = await loadSign( + axios, + "https://www.52pojie.cn/home.php?mod=task&do=apply&id=2" + ); + if (msg.indexOf("需要先登录才能继续本操作") !== -1) { + console.log("需要先登录才能继续本操作,跳过本期任务"); + return; } - if (msg.indexOf('本期您已申请过此任务') !== -1) { - console.log("本期您已申请过此任务,跳过本期任务") - return + if (msg.indexOf("本期您已申请过此任务") !== -1) { + console.log("本期您已申请过此任务,跳过本期任务"); + return; } - msg = await loadSign(axios, 'https://www.52pojie.cn/home.php?mod=task&do=draw&id=2') - console.log("52pojie签到:", msg) -} \ No newline at end of file + msg = await loadSign( + axios, + "https://www.52pojie.cn/home.php?mod=task&do=draw&id=2" + ); + console.log("52pojie签到:", msg); +}; diff --git a/commands/unicom.js b/commands/unicom.js index 86af41f9f..766291dbf 100644 --- a/commands/unicom.js +++ b/commands/unicom.js @@ -1,5 +1,4 @@ const path = require("path"); -const { exit } = require("yargs"); const { scheduler } = require("../utils/scheduler"); exports.command = "unicom"; @@ -27,13 +26,13 @@ let getAccount = (data, cb = null) => { let pwd = data[UNICOM_PASSWORD].split(",").map((i) => i.trim()); let appid = data[UNICOM_APPID].split(",").map((i) => i.trim()); if (!users.length || !pwd.length || users.length !== pwd.length) { - throw new Error("Please check your username and password"); + throw new Error("Please check your usernames and passwords in env file"); } if ( Object.prototype.toString.call(users) !== "[object Array]" && Object.prototype.toString.call(pwd) !== "[object Array]" ) { - throw new Error("username and password 非法"); + throw new Error("usernames and passwords are illegal"); } users.forEach((user, i) => { account.push({ user: user, password: pwd[i], appid: appid[i] }); @@ -45,7 +44,7 @@ exports.handler = async function (argv) { var accounts = []; accounts = getAccount(env, (data) => { data.map((i) => { - i.tasks = argv["tasks"]; + if ("tasks" in argv) i.tasks = argv["tasks"]; }); return data; }); diff --git a/config/.env.sample b/config/.env.sample index 89b677ae6..7cb9e761a 100644 --- a/config/.env.sample +++ b/config/.env.sample @@ -1,3 +1,4 @@ +# Unicom acounts UNICOM_USERNAME = '' UNICOM_PASSWORD = '' -UNICOM_UNICOM_APPID = '' +UNICOM_APPID = '' From 9f7085af103580c66dc5a199c59e0592d78f98f1 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Sun, 21 Feb 2021 16:09:25 +0800 Subject: [PATCH 110/128] =?UTF-8?q?=F0=9F=8F=B3=E2=80=8D=F0=9F=8C=88=20upd?= =?UTF-8?q?ated=20task=20feature?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/taocan.js | 169 ++++++------ utils/scheduler.js | 437 +++++++++++++++++++++----------- 2 files changed, 369 insertions(+), 237 deletions(-) diff --git a/commands/tasks/unicom/taocan.js b/commands/tasks/unicom/taocan.js index f19239a7c..14ba813cb 100644 --- a/commands/tasks/unicom/taocan.js +++ b/commands/tasks/unicom/taocan.js @@ -2,98 +2,95 @@ //活动入口:主页-套餐页面-2个视频 var crypto = require("crypto"); var sign = (data) => { - let str = "integralofficial&"; - let params = []; - data.forEach((v, i) => { - if (v) { - params.push("arguments" + (i + 1) + v); - } - }); - return crypto - .createHash("md5") - .update(str + params.join("&")) - .digest("hex"); + let str = "integralofficial&"; + let params = []; + data.forEach((v, i) => { + if (v) { + params.push("arguments" + (i + 1) + v); + } + }); + return crypto + .createHash("md5") + .update(str + params.join("&")) + .digest("hex"); }; let account = { - yhTaskId: "8a6437e839494400b7ff34327759448f", - yhChannel: "GGPD", - accountChannel: "517050707", - accountUserName: "517050707", - accountPassword: "123456", - accountToken: "4640b530b3f7481bb5821c6871854ce5", + yhTaskId: "8a6437e839494400b7ff34327759448f", + yhChannel: "GGPD", + accountChannel: "517050707", + accountUserName: "517050707", + accountPassword: "123456", + accountToken: "4640b530b3f7481bb5821c6871854ce5", }; var taocan = { - query: async (request, options) => { - let params = { - arguments1: "AC20201013153418", // acid - arguments2: account.yhChannel, // yhChannel - arguments3: account.yhTaskId, // yhTaskId menuId - arguments4: new Date().getTime(), // time - arguments6: account.accountChannel, - netWay: "Wifi", - version: `android@8.0102`, - }; - params["sign"] = sign([ - params.arguments1, - params.arguments2, - params.arguments3, - params.arguments4, - ]); - return await require("./taskcallback").query(request, { - ...options, - params, - }); - }, - doTask: async (request, options) => { - console.log("🐀 看视频广告中..."); - let { - num, - jar - } = await taocan.query(request, options); - // console.log(num); + query: async (request, options) => { + let params = { + arguments1: "AC20201013153418", // acid + arguments2: account.yhChannel, // yhChannel + arguments3: account.yhTaskId, // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: account.accountChannel, + netWay: "Wifi", + version: `android@8.0102`, + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + return await require("./taskcallback").query(request, { + ...options, + params, + }); + }, + doTask: async (request, options) => { + console.log("🐀 看视频广告中..."); + let { num, jar } = await taocan.query(request, options); + // console.log(num); - if (!num) { - console.log("🐀 看广告得积分: 今日已完成"); - return; - } - do { - // console.log("还有", num, "次"); - let params = { - arguments1: "AC20201013153418", // acid - arguments2: account.yhChannel, // yhChannel - arguments3: account.yhTaskId, // yhTaskId menuId - arguments4: new Date().getTime(), // time - arguments6: account.accountUserName, - arguments7: account.accountUserName, - arguments8: account.accountPassword, - arguments9: "4640b530b3f7481bb5821c6871854ce5", - orderId: crypto - .createHash("md5") - .update(new Date().getTime() + "") - .digest("hex"), - netWay: "Wifi", - remark: "套餐变更看视频得积分", - version: `android@8.0102`, - //orderId: "0923fca6d5ffb8ec017fc6b3cbc5c9c0", - }; - params["sign"] = sign([ - params.arguments1, - params.arguments2, - params.arguments3, - params.arguments4, - ]); - await require("./taskcallback").doTask(request, { - ...options, - params, - jar, - }); + if (!num) { + console.log("🐀 看广告得积分: 今日已完成"); + return; + } + do { + // console.log("还有", num, "次"); + let params = { + arguments1: "AC20201013153418", // acid + arguments2: account.yhChannel, // yhChannel + arguments3: account.yhTaskId, // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: account.accountUserName, + arguments7: account.accountUserName, + arguments8: account.accountPassword, + arguments9: "4640b530b3f7481bb5821c6871854ce5", + orderId: crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"), + netWay: "Wifi", + remark: "套餐变更看视频得积分", + version: `android@8.0102`, + //orderId: "0923fca6d5ffb8ec017fc6b3cbc5c9c0", + }; + params["sign"] = sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + await require("./taskcallback").doTask(request, { + ...options, + params, + jar, + }); - let s = Math.floor(Math.random() * 30); - console.log("☕ 等待%s秒再继续", s); - // eslint-disable-next-line no-unused-vars - await new Promise((resolve, reject) => setTimeout(resolve, s * 1000)); - } while (--num); - }, + let s = Math.floor(Math.random() * 30); + console.log("☕ 等待%s秒再继续", s); + // eslint-disable-next-line no-unused-vars + await new Promise((resolve, reject) => setTimeout(resolve, s * 1000)); + } while (--num); + }, }; module.exports = taocan; diff --git a/utils/scheduler.js b/utils/scheduler.js index ec0b28688..0a953eece 100644 --- a/utils/scheduler.js +++ b/utils/scheduler.js @@ -130,28 +130,32 @@ let scheduler = { scheduler.today = today; }, genFileName(command) { - let dir = path.join(os.homedir(), ".AutoSignMachine"); - if ( - "TENCENTCLOUD_RUNENV" in process.env && - process.env.TENCENTCLOUD_RUNENV === "SCF" - ) { - dir = path.join("/tmp", ".AutoSignMachine"); - // 暂不支持持久化配置,使用一次性执行机制,函数超时时间受functions.timeout影响 - scheduler.isTryRun = true; - } - if (!fs.existsSync(dir)) { - fs.mkdirpSync(dir); - } - scheduler.taskFile = path.join( - dir, - `taskFile_${command}_${scheduler.taskKey}.json` - ); - let maskFile = path.join( - dir, - `taskFile_${command}_${scheduler.taskKey.replaceWithMask(2, 3)}.json` - ); - scheduler.today = moment().format("YYYYMMDD"); - console.log("获得配置文件", maskFile, "当前日期", scheduler.today); + // eslint-disable-next-line no-unused-vars + return new Promise((resolve, reject) => { + let dir = path.join(os.homedir(), ".AutoSignMachine"); + if ( + "TENCENTCLOUD_RUNENV" in process.env && + process.env.TENCENTCLOUD_RUNENV === "SCF" + ) { + dir = path.join("/tmp", ".AutoSignMachine"); + // 暂不支持持久化配置,使用一次性执行机制,函数超时时间受functions.timeout影响 + scheduler.isTryRun = true; + } + if (!fs.existsSync(dir)) { + fs.mkdirpSync(dir); + } + scheduler.taskFile = path.join( + dir, + `taskFile_${command}_${scheduler.taskKey}.json` + ); + let maskFile = path.join( + dir, + `taskFile_${command}_${scheduler.taskKey.replaceWithMask(2, 3)}.json` + ); + scheduler.today = moment().format("YYYYMMDD"); + console.log("获得配置文件", maskFile, "当前日期", scheduler.today); + resolve(); + }); }, loadTasksQueue: async () => { let queues = []; @@ -198,28 +202,44 @@ let scheduler = { scheduler.clean(); scheduler.isTryRun = tryrun; scheduler.taskKey = taskKey || "default"; - if (scheduler.isTryRun) { - console.log("👉 当前运行在TryRun模式,仅建议在测试时运行!"); - await new Promise((resolve) => setTimeout(resolve, 3000)); - } console.log( "将使用", scheduler.taskKey.replaceWithMask(2, 3), "作为账户识别码" ); console.log("🤨 计算可执行任务..."); - scheduler.genFileName(command); - await scheduler.initTasksQueue(); - let { will_queues } = await scheduler.loadTasksQueue(); - scheduler.isRunning = true; - return will_queues.length; + if (scheduler.isTryRun) { + console.log("👉 当前运行在TryRun模式,仅建议在测试时运行!"); + await new Promise((resolve) => setTimeout(resolve, 1000)); + return 1; + // return 1; + } else { + await scheduler.genFileName(command); + await scheduler.initTasksQueue(); + let { will_queues } = await scheduler.loadTasksQueue(); + scheduler.isRunning = true; + return will_queues.length; + } }, - execTask: async (command, selectedTasks) => { - console.log("🤨 开始执行任务"); - if (!scheduler.isRunning) { + //生成任务队列文件并且初始化队列数据 + fetchTasks: async (command) => { + if (!scheduler.isRunning && !scheduler.isTryRun) { await scheduler.genFileName(command); await scheduler.initTasksQueue(); } + }, + //状态码 0x1 tryrun模式 0x2 队列模式 + // eslint-disable-next-line no-unused-vars + getTaskStatus: (command) => { + if (scheduler.isTryRun) return 0x1; + return 0x2; + }, + execTask: async (command, selectedTasks) => { + console.log("🤨 开始执行任务"); + if (process.env.GITHUB_ACTIONS) { + return; + } + await scheduler.fetchTasks(command); if (Object.prototype.toString.call(selectedTasks) == "[object String]") { selectedTasks = selectedTasks.split(",").filter((q) => q); } else { @@ -237,139 +257,254 @@ let scheduler = { (selectedTasks.length && selectedTasks.indexOf(task.taskName) !== -1)) ); - console.log( - `👇 获取总任务数${taskJson.queues.length},已完成任务数${ - queues.filter((q) => q.taskState === 1).length - },截至当前可执行任务数${will_tasks.length}` - ); - - if (will_tasks.length) { - //TODO: deprecated Cookies will be deleted on TryRun mode - // if (scheduler.isTryRun) { - // console.log("👉 TryRun模式将清除CK操作"); - // await delCookiesFile([command, scheduler.taskKey].join("_")); - // } - // 初始化处理 - if (process.env.GITHUB_ACTIONS) { - return; - } - let init_funcs = {}; - let init_funcs_result = {}; - for (let task of will_tasks) { - let ttt = tasks[task.taskName]; - let tttOptions = ttt.options || {}; - let savedCookies = - getCookies([command, scheduler.taskKey].join("_")) || - tttOptions.cookies; - let request = _request(savedCookies); + scheduler.isTryRun + ? console.log(`👇 获取总任务数: ${selectedTasks.length}`) + : console.log( + `👇 获取总任务数${taskJson.queues.length},已完成任务数${ + queues.filter((q) => q.taskState === 1).length + },截至当前可执行任务数${will_tasks.length}` + ); - if (tttOptions.init) { + switch (scheduler.getTaskStatus()) { + case 1: { + let currentTasks = []; + selectedTasks.forEach((v) => { if ( - Object.prototype.toString.call(tttOptions.init) === - "[object AsyncFunction]" + tasks[v] !== undefined && + Object.prototype.toString.call(tasks[v]) == "[object Object]" ) { - let hash = crypto - .createHash("md5") - .update(tttOptions.init.toString()) - .digest("hex"); - if (!(hash in init_funcs)) { - init_funcs_result[task.taskName + "_init"] = await tttOptions[ - "init" - ](request, savedCookies); - init_funcs[hash] = task.taskName + "_init"; - } else { - init_funcs_result[task.taskName + "_init"] = - init_funcs_result[init_funcs[hash]]; - } - } else { - console.log("not apply"); + currentTasks.push({ taskName: v, task: tasks[v] }); } - } else { - init_funcs_result[task.taskName + "_init"] = { request }; - } - } - - // 任务执行 - let queue = new PQueue({ concurrency: 2 }); - console.log("👉 调度任务中", "并发数", 2); - for (let task of will_tasks) { - queue.add(async () => { - try { - if (task.waitTime) { - console.log( - "☕ 延迟执行", - task.taskName, - task.waitTime, - "seconds" - ); - // eslint-disable-next-line no-unused-vars - await new Promise((resolve, reject) => - setTimeout(resolve, task.waitTime * 1000) - ); - } - - let ttt = tasks[task.taskName]; - if ( - Object.prototype.toString.call(ttt.callback) === - "[object AsyncFunction]" - ) { - await ttt.callback.apply( - this, - Object.values(init_funcs_result[task.taskName + "_init"]) - ); - } else { - console.log("❌ 任务执行内容空"); - } + }); + let { init_funcs_result } = await scheduler.pushTaskQueue( + command, + currentTasks + ); + console.log("tryrun 任务模式启动"); + if (!currentTasks.length) return console.log("无任务"); + let queue = new PQueue({ concurrency: 2 }); + console.log("👉 调度任务中", "并发数", 2); + for (let task of currentTasks) { + queue.add(async () => { + try { + let ttt = tasks[task.taskName]; + if ( + Object.prototype.toString.call(ttt.callback) === + "[object AsyncFunction]" + ) { + await ttt.callback.apply( + this, + Object.values(init_funcs_result[task.taskName + "_init"]) + ); + } else { + console.log("❌ 任务执行内容空"); + } - let isupdate = false; - let newTask = {}; - if (ttt.options) { - if (!ttt.options.isCircle) { + let isupdate = false; + let newTask = {}; + if (ttt.options) { + if (!ttt.options.isCircle) { + newTask.taskState = 1; + isupdate = true; + } + if (ttt.options.isCircle && ttt.options.intervalTime) { + newTask.willTime = moment() + .add(ttt.options.intervalTime, "seconds") + .format("YYYY-MM-DD HH:mm:ss"); + isupdate = true; + } + } else { newTask.taskState = 1; isupdate = true; } - if (ttt.options.isCircle && ttt.options.intervalTime) { - newTask.willTime = moment() - .add(ttt.options.intervalTime, "seconds") - .format("YYYY-MM-DD HH:mm:ss"); - isupdate = true; + + if (isupdate && !scheduler.isTryRun) { + let taskindex = queues.findIndex( + (q) => q.taskName === task.taskName + ); + if (taskindex !== -1) { + taskJson.queues[taskindex] = { + ...task, + ...newTask, + }; + } + console.log("📑 任务执行完毕 等待5秒再继续"); + // eslint-disable-next-line no-unused-vars + await new Promise((resolve, reject) => + setTimeout(resolve, 5 * 1000) + ); } - } else { - newTask.taskState = 1; - isupdate = true; + } catch (err) { + console.log("❌ 任务错误:", err); } + }); + } + await queue.onIdle(); + break; + } + case 2: + if (will_tasks.length) { + let init_funcs = {}; + let init_funcs_result = {}; + for (let task of will_tasks) { + let ttt = tasks[task.taskName]; + let tttOptions = ttt.options || {}; + let savedCookies = + getCookies([command, scheduler.taskKey].join("_")) || + tttOptions.cookies; + let request = _request(savedCookies); - if (isupdate) { - let taskindex = queues.findIndex( - (q) => q.taskName === task.taskName - ); - if (taskindex !== -1) { - taskJson.queues[taskindex] = { - ...task, - ...newTask, - }; + if (tttOptions.init) { + if ( + Object.prototype.toString.call(tttOptions.init) === + "[object AsyncFunction]" + ) { + let hash = crypto + .createHash("md5") + .update(tttOptions.init.toString()) + .digest("hex"); + if (!(hash in init_funcs)) { + init_funcs_result[task.taskName + "_init"] = await tttOptions[ + "init" + ](request, savedCookies); + init_funcs[hash] = task.taskName + "_init"; + } else { + init_funcs_result[task.taskName + "_init"] = + init_funcs_result[init_funcs[hash]]; + } + } else { + console.log("not apply"); } - fs.writeFileSync(scheduler.taskFile, JSON.stringify(taskJson)); - console.log("📑 任务配置文件更新完毕 等待5秒再继续"); - // eslint-disable-next-line no-unused-vars - await new Promise((resolve, reject) => - setTimeout(resolve, 5 * 1000) - ); + } else { + init_funcs_result[task.taskName + "_init"] = { request }; } - } catch (err) { - console.log("❌ 任务错误:", err); } - }); + + // 任务执行 + let queue = new PQueue({ concurrency: 2 }); + console.log("👉 调度任务中", "并发数", 2); + for (let task of will_tasks) { + queue.add(async () => { + try { + if (task.waitTime) { + console.log( + "☕ 延迟执行", + task.taskName, + task.waitTime, + "seconds" + ); + // eslint-disable-next-line no-unused-vars + await new Promise((resolve, reject) => + setTimeout(resolve, task.waitTime * 1000) + ); + } + + let ttt = tasks[task.taskName]; + if ( + Object.prototype.toString.call(ttt.callback) === + "[object AsyncFunction]" + ) { + await ttt.callback.apply( + this, + Object.values(init_funcs_result[task.taskName + "_init"]) + ); + } else { + console.log("❌ 任务执行内容空"); + } + + let isupdate = false; + let newTask = {}; + if (ttt.options) { + if (!ttt.options.isCircle) { + newTask.taskState = 1; + isupdate = true; + } + if (ttt.options.isCircle && ttt.options.intervalTime) { + newTask.willTime = moment() + .add(ttt.options.intervalTime, "seconds") + .format("YYYY-MM-DD HH:mm:ss"); + isupdate = true; + } + } else { + newTask.taskState = 1; + isupdate = true; + } + + if (isupdate && !scheduler.isTryRun) { + let taskindex = queues.findIndex( + (q) => q.taskName === task.taskName + ); + if (taskindex !== -1) { + taskJson.queues[taskindex] = { + ...task, + ...newTask, + }; + } + fs.writeFileSync( + scheduler.taskFile, + JSON.stringify(taskJson) + ); + console.log("📑 任务配置文件更新完毕 等待5秒再继续"); + // eslint-disable-next-line no-unused-vars + await new Promise((resolve, reject) => + setTimeout(resolve, 5 * 1000) + ); + } + } catch (err) { + console.log("❌ 任务错误:", err); + } + }); + } + await queue.onIdle(); + } else { + console.log( + `👇 获取总任务数${taskJson.queues.length},已完成任务数${ + queues.filter((q) => q.taskState === 1).length + },截至当前可执行任务数${will_tasks.length}` + ); + } + break; + default: + console.log("⭕ 暂无需要执行的任务"); + } + }, + pushTaskQueue: async (command, selectedTasks) => { + let init_funcs = {}; + let init_funcs_result = {}; + for (let task of selectedTasks) { + let ttt = tasks[task.taskName]; + let tttOptions = ttt.options || {}; + let savedCookies = + getCookies([command, scheduler.taskKey].join("_")) || + tttOptions.cookies; + let request = _request(savedCookies); + + if (tttOptions.init) { + if ( + Object.prototype.toString.call(tttOptions.init) === + "[object AsyncFunction]" + ) { + let hash = crypto + .createHash("md5") + .update(tttOptions.init.toString()) + .digest("hex"); + if (!(hash in init_funcs)) { + init_funcs_result[task.taskName + "_init"] = await tttOptions[ + "init" + ](request, savedCookies); + init_funcs[hash] = task.taskName + "_init"; + } else { + init_funcs_result[task.taskName + "_init"] = + init_funcs_result[init_funcs[hash]]; + } + } else { + console.log("not apply"); + } + } else { + init_funcs_result[task.taskName + "_init"] = { request }; } - await queue.onIdle(); - } else { - console.log( - `👇 获取总任务数${taskJson.queues.length},已完成任务数${ - queues.filter((q) => q.taskState === 1).length - },截至当前可执行任务数${will_tasks.length}` - ); - console.log("⭕ 暂无需要执行的任务"); } + return { init_funcs_result, init_funcs }; }, }; module.exports = { From 47d2422774fbdc73b824cbadc640de1a9f58c277 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Sun, 21 Feb 2021 22:12:07 +0800 Subject: [PATCH 111/128] =?UTF-8?q?=F0=9F=9A=A7=20updated=20tasks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/tasks/unicom/fetchCoins.js | 43 +++++++++++++++++++++ commands/tasks/unicom/handlers/gameUtils.js | 4 +- commands/tasks/unicom/unicom.js | 14 +++++++ commands/unicom.js | 4 ++ 4 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 commands/tasks/unicom/fetchCoins.js diff --git a/commands/tasks/unicom/fetchCoins.js b/commands/tasks/unicom/fetchCoins.js new file mode 100644 index 000000000..a6c90b898 --- /dev/null +++ b/commands/tasks/unicom/fetchCoins.js @@ -0,0 +1,43 @@ +const { UnicomComponent, transParams } = require("./handlers/gameUtils"); +const moment = require("moment"); +moment.locale("zh-cn"); +let fetchCoins = { + doTask: async (axios, options) => { + let request = new UnicomComponent(axios, options, "积分查询"); + let { data } = await request.get({ + url: + "https://m.client.10010.com/welfare-mall-front/mobile/show/flDetail/v1/0", + body: transParams({ + reqtime: new Date().getTime(), + cliver: "", + reqdata: "{}", + }), + method: "POST", + headers: { + origin: `https://img.client.10010.com`, + referer: `https://img.client.10010.com/jifenshangcheng/jifen?loginType=0&scopeType=fl`, + }, + }); + if (data.code !== "0") { + console.log("查询出错: ", data.msg); + return; + } + let availablescore = data.resdata.score.availablescore; + console.log(availablescore); + let startDate = moment().startOf("days"); + let consumeCoins = 0; + let awardCoins = 0; + data.resdata.detail.forEach((v) => { + if (startDate.isBefore(v.createTime)) + if (v.books_oper_type === "1") { + consumeCoins += v.books_number; + } else { + awardCoins += v.books_number; + } + }); + console.log("💰 今日积分获得:", awardCoins); + console.log("💰 今日积分消费:", consumeCoins); + console.log("💰 当前积分合计:", availablescore); + }, +}; +module.exports = fetchCoins; diff --git a/commands/tasks/unicom/handlers/gameUtils.js b/commands/tasks/unicom/handlers/gameUtils.js index 2a1b897d9..8bb82f77c 100644 --- a/commands/tasks/unicom/handlers/gameUtils.js +++ b/commands/tasks/unicom/handlers/gameUtils.js @@ -72,7 +72,7 @@ class UnicomRequest { "user-agent": USER_AGENTS ? USER_AGENTS : useragent(this.options), referer: headers.referer ? headers.referer : Referer_msmds, origin: headers.origin ? headers.origin : Origin_msmds, - Authorization: headers.Authorization, + Authorization: headers.Authorization ? headers.Authorization : "", }, url, method: "POST", @@ -204,7 +204,7 @@ class UnicomComponent { } async get( - data = { url, body, method: "POST", headers: { referer: "", options: "" } }, + data = { url, body, method: "POST", headers: { referer: "", origin: "" } }, callback = null ) { let { url, body, method, headers } = data; diff --git a/commands/tasks/unicom/unicom.js b/commands/tasks/unicom/unicom.js index 8217e2031..c4ffb6313 100644 --- a/commands/tasks/unicom/unicom.js +++ b/commands/tasks/unicom/unicom.js @@ -470,6 +470,20 @@ var start = async (params) => { }, taskOption ); + + //积分查询 + await scheduler.regTask( + "fetchCoins", + async (request) => { + await require("./fetchCoins.js").doTask(request, options); + }, + { + ...taskOption, + ...taskOption, + startTime: 21 * 3600, + ignoreRelay: true, + } + ); }; module.exports = { start, diff --git a/commands/unicom.js b/commands/unicom.js index 766291dbf..ebc184825 100644 --- a/commands/unicom.js +++ b/commands/unicom.js @@ -15,6 +15,10 @@ if (!env) { } exports.builder = function (yargs) { return yargs + .option("leftTasks", { + describe: "剩余任务统计", + type: "boolean", + }) .help() .showHelpOnFail(true, "使用--help查看有效选项") .epilog("copyright 2020 LunnLew"); From ca460d7c9cc38e8bf91e2a2da19436def0ea8b36 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Sun, 21 Feb 2021 22:23:37 +0800 Subject: [PATCH 112/128] Update scheduler.js --- utils/scheduler.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/utils/scheduler.js b/utils/scheduler.js index 0a953eece..bcc51b47e 100644 --- a/utils/scheduler.js +++ b/utils/scheduler.js @@ -257,16 +257,9 @@ let scheduler = { (selectedTasks.length && selectedTasks.indexOf(task.taskName) !== -1)) ); - scheduler.isTryRun - ? console.log(`👇 获取总任务数: ${selectedTasks.length}`) - : console.log( - `👇 获取总任务数${taskJson.queues.length},已完成任务数${ - queues.filter((q) => q.taskState === 1).length - },截至当前可执行任务数${will_tasks.length}` - ); - switch (scheduler.getTaskStatus()) { case 1: { + console.log(`👇 获取总任务数: ${selectedTasks.length}`); let currentTasks = []; selectedTasks.forEach((v) => { if ( @@ -343,6 +336,11 @@ let scheduler = { break; } case 2: + console.log( + `👇 获取总任务数${taskJson.queues.length},已完成任务数${ + queues.filter((q) => q.taskState === 1).length + },截至当前可执行任务数${will_tasks.length}` + ); if (will_tasks.length) { let init_funcs = {}; let init_funcs_result = {}; From 625d5373c90de3af2c9e4cd9945b428117d86ea2 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Sun, 21 Feb 2021 22:31:36 +0800 Subject: [PATCH 113/128] Update fetchCoins.js --- commands/tasks/unicom/fetchCoins.js | 1 - 1 file changed, 1 deletion(-) diff --git a/commands/tasks/unicom/fetchCoins.js b/commands/tasks/unicom/fetchCoins.js index a6c90b898..3c43345b3 100644 --- a/commands/tasks/unicom/fetchCoins.js +++ b/commands/tasks/unicom/fetchCoins.js @@ -23,7 +23,6 @@ let fetchCoins = { return; } let availablescore = data.resdata.score.availablescore; - console.log(availablescore); let startDate = moment().startOf("days"); let consumeCoins = 0; let awardCoins = 0; From d0b8672d2411d7bcc60dc336227454790b2a02a6 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Mon, 22 Feb 2021 11:56:04 +0800 Subject: [PATCH 114/128] updated task feature --- commands/unicom.js | 57 ++++++++++++++++++++++++++----------------- utils/observersion.js | 43 ++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+), 22 deletions(-) create mode 100644 utils/observersion.js diff --git a/commands/unicom.js b/commands/unicom.js index ebc184825..abcb62ff0 100644 --- a/commands/unicom.js +++ b/commands/unicom.js @@ -1,4 +1,5 @@ const path = require("path"); +const tasklist = require("../utils/observersion"); const { scheduler } = require("../utils/scheduler"); exports.command = "unicom"; @@ -7,6 +8,9 @@ exports.describe = "unicom任务"; const UNICOM_USERNAME = "UNICOM_USERNAME"; const UNICOM_PASSWORD = "UNICOM_PASSWORD"; const UNICOM_APPID = "UNICOM_APPID"; +String.prototype.replaceWithMask = function (start, end) { + return this.substr(0, start) + "******" + this.substr(-end, end); +}; let env = require("dotenv").config({ path: path.resolve(process.cwd(), "config", ".env"), }).parsed; @@ -54,29 +58,38 @@ exports.handler = async function (argv) { }); console.log("总账户数", accounts.length); for (let account of accounts) { - await require(path.join(__dirname, "tasks", command, command)) - .start({ - cookies: account.cookies, - options: { - appid: account.appid, - user: account.user, - password: account.password, - }, - }) - .catch((err) => console.log(" unicom任务:", err)); - let hasTasks = await scheduler.hasWillTask(command, { - tryrun: "tryrun" in argv, - taskKey: account.user, - }); - if (hasTasks) { - scheduler - .execTask(command, account.tasks) - .catch((err) => console.log("unicom任务:", err)) - .finally(() => { - console.log("当前任务执行完毕!"); - }); + if ("leftTasks" in argv) { + let tmp = tasklist + .getTasks({ command: command, taskKey: account.user }) + .unfinished() + .toString(); + console.log(`账号${account.user.replaceWithMask(2, 3)}未完成任务汇总: `); + console.log(tmp); } else { - console.log("暂无可执行任务!"); + await require(path.join(__dirname, "tasks", command, command)) + .start({ + cookies: account.cookies, + options: { + appid: account.appid, + user: account.user, + password: account.password, + }, + }) + .catch((err) => console.log(" unicom任务:", err)); + let hasTasks = await scheduler.hasWillTask(command, { + tryrun: "tryrun" in argv, + taskKey: account.user, + }); + if (hasTasks) { + scheduler + .execTask(command, account.tasks) + .catch((err) => console.log("unicom任务:", err)) + .finally(() => { + console.log("当前任务执行完毕!"); + }); + } else { + console.log("暂无可执行任务!"); + } } } }; diff --git a/utils/observersion.js b/utils/observersion.js new file mode 100644 index 000000000..9cd6acff3 --- /dev/null +++ b/utils/observersion.js @@ -0,0 +1,43 @@ +let path = require("path"); +const os = require("os"); +const fs = require("fs"); +let observersion = { + observable: true, + directory: path.join(os.homedir(), ".AutoSignMachine"), + tasks: null, + unfinishedTask: null, + getTasks: ({ taskKey, command }) => { + let taskFile = path.join( + observersion.directory, + `taskFile_${command}_${taskKey}.json` + ); + if (fs.existsSync(taskFile)) { + let tasks = fs.readFileSync(taskFile).toString("utf-8"); + observersion.tasks = JSON.parse(tasks); + } + return observersion; + }, + unfinished: () => { + if (!observersion.tasks) { + throw new Error("No tasks"); + } + observersion.tasks = observersion.tasks.queues.filter((v) => { + if (v.taskState === 0) { + return v; + } + }); + return observersion; + }, + toString: () => { + let tmpArray = []; + observersion.tasks.forEach((v) => { + tmpArray.push(v.taskName); + }); + return tmpArray.join(","); + }, + toJson: () => { + return observersion.tasks; + }, +}; + +module.exports = observersion; From b7d69bddaab52ab32463e9e86277d4bb0b1f88e9 Mon Sep 17 00:00:00 2001 From: cooip-jm <78735965+cooip-jm@users.noreply.github.com> Date: Mon, 22 Feb 2021 13:29:15 +0800 Subject: [PATCH 115/128] Create jflotteryad.js --- commands/tasks/unicom/jflotteryad.js | 289 +++++++++++++++++++++++++++ 1 file changed, 289 insertions(+) create mode 100644 commands/tasks/unicom/jflotteryad.js diff --git a/commands/tasks/unicom/jflotteryad.js b/commands/tasks/unicom/jflotteryad.js new file mode 100644 index 000000000..67df1c093 --- /dev/null +++ b/commands/tasks/unicom/jflotteryad.js @@ -0,0 +1,289 @@ +//666抽奖机器人-动作补全脚本。 +const { + UnicomComponent, + generateOrderid, + sleep, + } = require("./handlers/gameUtils"); + let crypto = require("crypto"); + const gameEvents = require("./handlers/dailyEvent"); + const AES = require("./handlers/PAES"); + const { exit } = require("process"); + let jflotteryad = { + doTask: async (axios, options) => { + console.log("😒 砸摇奖机补完动作-拿奖...开始"); + let request = new UnicomComponent(axios, options, "砸摇奖机器-动作不全开始。"); + //登录平台 + let cookies = await request.login( + "https://m.client.10010.com/mobileService/openPlatform/openPlatLine.htm?to_url=https://m.jf.10010.com/jf-order/avoidLogin/forActive/tigerarmqd&duanlianjieabc=tbkyH" + ); + let times = await request.postFreeLoginGuess( + "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/tigerarm/index.html?jump=sign", + "Ac-de644531df54410e875ba08ca2256b6a", + cookies, + (data) => { + let temp = [ + { + activityId: "Ac-de644531df54410e875ba08ca2256b6a", + integral: 10, + roundGame: null, + activityName: "", + }, + ]; + let activity = []; + if (data.data.roundGame !== null) { + temp.map((value, i) => { + if (value.activityId == data.data.roundGame.activityId) { + temp[i]["roundGame"] = data.data.roundGame; + } else { + temp[i]["roundGame"] = null; + } + }); + let currentIdx = temp.findIndex( + (v) => v.activityId == data.data.roundGame.activityId + ); + activity.push(temp[currentIdx]); + temp.splice(currentIdx, 1); + activity = activity.concat(temp); + } else { + activity = temp; + } + for (let game of data.data.activityInfos.activityVOs) { + for (let item of activity) { + if (item.activityId === game.activityId) { + item["freeTimes"] = game.activityTimesInfo.freeTimes; + item["advertTimes"] = game.activityTimesInfo.advertTimes; + } + } + } + return { + Authorization: data.data.token.access_token, + // roundGame: data.data.roundGame, + activity: activity, + }; + } + ); + await jflotteryad.playGames(axios, options, cookies, times); + }, + playGames: async ( + axios, + options, + { ecs_token, searchParams, jar1 }, + { Authorization, activity } + ) => { + let request = new UnicomComponent(axios, options, "666豪礼大放送"); + + for (let item of activity) { + console.log(`你油腻而光滑的大手手正狠狠的砸向抽奖机...`); + let { freeTimes, advertTimes, activityId, roundGame, integral } = item; + do { + console.log( + "一共有机会", + freeTimes + advertTimes, + "剩余免费机会", + freeTimes, + "看视频广告机会", + advertTimes + ); + let playParams; + //免费机会为0,需要看视频 + if (freeTimes == 0 && advertTimes == 0) { + console.log(`与${item.activityName}机器人插肩而过!,进行下一轮`); + continue; + } + if (!freeTimes && advertTimes) { + console.log("摇奖机器送你一个广告视频补充你的能量"); + let params = { + arguments1: "AC20200611152252", // acid + arguments2: "GGPD", // yhChannel + arguments3: "627292f1243148159c58fd58917c3e67", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "517050707", + arguments7: "517050707", + arguments8: "123456", + arguments9: "4640b530b3f7481bb5821c6871854ce5", + //netWay: "Wifi", + // remark1: "签到小游戏猜拳拿奖", + remark: "签到小游戏翻倍得积分", + version: `android@8.0102`, + // codeId: 945757409, + }; + params["sign"] = AES.sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + params["orderId"] = crypto + .createHash("md5") + .update(new Date().getTime() + "") + .digest("hex"); + params["arguments4"] = new Date().getTime(); + + let result = await require("./taskcallback").reward(axios, { + ...options, + params, + jar: jar1, + }); + console.log(result); + playParams = { + activityId: activityId, + currentTimes: advertTimes, + type: "广告", + integral: integral, + orderId: params["orderId"], + phoneType: "android", + version: "8.0102", + }; + await sleep(30); + advertTimes--; + // eslint-disable-next-line no-unused-vars + } else { + playParams = { + activityId: activityId, + currentTimes: freeTimes, + integral: integral, + type: "免费", + }; + freeTimes--; + } + // console.log(playParams); + let roundId; + if (roundGame == null) { + let body = gameEvents.encodeParams(playParams, true); + let config = { + url: `https://m.jf.10010.com/jf-yuech/api/gameResultV2/timesDrawForPrize`, + body, + method: "POST", + headers: { + Authorization: `Bearer ${Authorization}`, + referer: + "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/tigerarm/index.html?jump=sign", + options: "https://m.jf.10010.com", + }, + }; + let { data } = await request.get(config); + // console.log(data); + if (data.code !== 0 || data.data.code !== "0") { + //console.log("something went wrong:", data); + continue; + } + winningRecordId = data.drawResultPO.winningRecordId; + roundId = data.data.roundGame.roundId; + } else { + roundId = roundGame.roundId; + } + + //不知道是不是这里出了问题 + + let gamebits = { + activityId: activityId, + resultId: roundId, + }; + for (let i = 0; i < 2; i++) { + console.log(`第${i + 1}次砸拳...`); + await sleep(10); + let body = gameEvents.encodeParams(gamebits, true); + let config = { + url: `https://m.jf.10010.com/jf-yuech/api/gameResult/doublingIntegral?activityId=Ac-de644531df54410e875ba08ca2256b6a + winningRecordId=${winningRecordId}`, + body: body, + method: "GET", + headers: { + Authorization: `Bearer ${Authorization}`, + referer: + "https://m.jf.10010.com/cms/yuech/unicom-integral-ui/yuech-Blindbox/tigerarm/index.html?jump=sign", + //options: "https://m.jf.10010.com", + }, + }; + let { data } = await request.get(config); + // console.log(data); + if (data.code !== 0) { + console.log("猜拳拿奖:", data.message); + } else { + console.log( + "拿奖:", + data.data.drawResultPO !== null + ? data.data.drawResultPO.prizeName + : "未中奖" + ); + if ( + data.data.drawResultPO !== null && + data.data.drawResultPO.doublingStatus + ) { + console.log("🌈 提交积分翻倍"); + await sleep(30); + await jflotteryad.lookVideoDouble(axios, { + ...options, + }); + await jflotteryad.lookVideoDoubleResult(axios, { + ...options, + Authorization, + activityId: activityId, + winningRecordId: data.data.drawResultPO.winningRecordId, + }); + } + } + } + } while (freeTimes || advertTimes); + } + }, + lookVideoDouble: async (axios, options) => { + let params = { + arguments1: "AC20200611152252", + arguments2: "GGPD", + arguments3: "627292f1243148159c58fd58917c3e67", + arguments4: new Date().getTime(), + arguments6: "517050707", + arguments7: "517050707", + arguments8: "123456", + arguments9: "4640b530b3f7481bb5821c6871854ce5", + netWay: "Wifi", + version: `android@8.0102`, + }; + params["sign"] = AES.sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + let { num, jar } = await require("./taskcallback").query(axios, { + ...options, + params, + }); + + if (!num) { + console.log("签到小游戏猜拳: 今日已完成"); + return; + } + + params = { + arguments1: "AC20200611152252", // acid + arguments2: "GGPD", // yhChannel + arguments3: "627292f1243148159c58fd58917c3e67", // yhTaskId menuId + arguments4: new Date().getTime(), // time + arguments6: "517050707", + arguments7: "517050707", + arguments8: "123456", + arguments9: "4640b530b3f7481bb5821c6871854ce5", + orderId: generateOrderid(), + netWay: "Wifi", + remark: "签到小游戏翻倍得积分", + version: `android@8.0100`, + //codeId: 945689604, + }; + params["sign"] = AES.sign([ + params.arguments1, + params.arguments2, + params.arguments3, + params.arguments4, + ]); + await require("./taskcallback").doTask(axios, { + ...options, + params, + jar, + }); + }, + lookVideoDoubleResult: gameEvents.lookVideoDoubleResult("猜拳拿奖"), + }; + + module.exports = jflotteryad; From 5056b536118df57055bce2ba3853ed4b0d0ab330 Mon Sep 17 00:00:00 2001 From: cooip-jm <78735965+cooip-jm@users.noreply.github.com> Date: Mon, 22 Feb 2021 13:31:15 +0800 Subject: [PATCH 116/128] Update unicom.js --- commands/tasks/unicom/unicom.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/commands/tasks/unicom/unicom.js b/commands/tasks/unicom/unicom.js index c4ffb6313..4034d1d9a 100644 --- a/commands/tasks/unicom/unicom.js +++ b/commands/tasks/unicom/unicom.js @@ -203,6 +203,15 @@ var start = async (params) => { }, taskOption ); + + ///666积分补全。。。。 + await scheduler.regTask( + "jflotteryad", + async (request) => { + await require("./jflotteryad.js").doTask(request, options); + }, + taskOption + ); // 首页-签到有礼-免费抽-拿苹果iPad Pro(摇一摇) await scheduler.regTask( From 3d4374e13dadf49b097ed9f449d473ce8163760d Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Mon, 22 Feb 2021 14:38:43 +0800 Subject: [PATCH 117/128] Update dailyTurncards.js --- commands/tasks/unicom/dailyTurncards.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commands/tasks/unicom/dailyTurncards.js b/commands/tasks/unicom/dailyTurncards.js index 2e00211a1..cc1d7c28e 100644 --- a/commands/tasks/unicom/dailyTurncards.js +++ b/commands/tasks/unicom/dailyTurncards.js @@ -321,7 +321,8 @@ let dailyTurncards = { // console.log(result.data); if (result.data.code !== 200) { - throw new Error("❌ something errors: ", result.data.msg); + console.log(("❌ something errors: ", result.data.msg)); + return; } console.log("开优惠券"); result = await request.postMsmds( From 7bf6e02b756d000bfa0973a265b9dc850e144e35 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Mon, 22 Feb 2021 14:38:54 +0800 Subject: [PATCH 118/128] Update dailyTurncards.js --- commands/tasks/unicom/dailyTurncards.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/tasks/unicom/dailyTurncards.js b/commands/tasks/unicom/dailyTurncards.js index cc1d7c28e..a809d8fe2 100644 --- a/commands/tasks/unicom/dailyTurncards.js +++ b/commands/tasks/unicom/dailyTurncards.js @@ -321,7 +321,7 @@ let dailyTurncards = { // console.log(result.data); if (result.data.code !== 200) { - console.log(("❌ something errors: ", result.data.msg)); + console.log(("❌ something errors: ", result.data)); return; } console.log("开优惠券"); From 85183ffb5487e8931d1d0c2075778864bc7edfa4 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Mon, 22 Feb 2021 15:07:13 +0800 Subject: [PATCH 119/128] Update dailyTurncards.js --- commands/tasks/unicom/dailyTurncards.js | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/commands/tasks/unicom/dailyTurncards.js b/commands/tasks/unicom/dailyTurncards.js index a809d8fe2..cc648e46f 100644 --- a/commands/tasks/unicom/dailyTurncards.js +++ b/commands/tasks/unicom/dailyTurncards.js @@ -20,14 +20,19 @@ let dailyTurncards = { ...cookies, phone, }); - await dailyTurncards.doElementTask(axios, options, { - ...cookies, - phone, - }); - await dailyTurncards.doMeituanTask(axios, options, { - ...cookies, - phone, - }); + //todo:判定40积分? 没找到API + try { + await dailyTurncards.doElementTask(axios, options, { + ...cookies, + phone, + }); + await dailyTurncards.doMeituanTask(axios, options, { + ...cookies, + phone, + }); + } catch (err) { + console.log(err); + } }, doMeituanTask: async (axios, options, { ecs_token, jar1, phone }) => { let request = new UnicomRequest(axios, options); @@ -321,8 +326,7 @@ let dailyTurncards = { // console.log(result.data); if (result.data.code !== 200) { - console.log(("❌ something errors: ", result.data)); - return; + throw new Error("❌ something errors: ", result.data); } console.log("开优惠券"); result = await request.postMsmds( From f0e48826bb450a23263e5a98822d47a67ad0dda5 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Mon, 22 Feb 2021 15:24:23 +0800 Subject: [PATCH 120/128] Update unicom.js --- commands/unicom.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/commands/unicom.js b/commands/unicom.js index abcb62ff0..3ccc33952 100644 --- a/commands/unicom.js +++ b/commands/unicom.js @@ -23,6 +23,10 @@ exports.builder = function (yargs) { describe: "剩余任务统计", type: "boolean", }) + .option("tasks", { + describe: "任务执行项", + type: "string", + }) .help() .showHelpOnFail(true, "使用--help查看有效选项") .epilog("copyright 2020 LunnLew"); From f6a7cacbee654ed3aff8cd8dbe0e231cff01c823 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Mon, 22 Feb 2021 17:41:13 +0800 Subject: [PATCH 121/128] updated --- docker/Dockerfile | 18 ------------------ docker/entrypoint.sh | 20 -------------------- 2 files changed, 38 deletions(-) delete mode 100644 docker/Dockerfile delete mode 100644 docker/entrypoint.sh diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index a0eb6f5d9..000000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM alpine:latest - -WORKDIR /AutoSignMachine/ - -RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories -RUN apk add --no-cache tzdata nodejs npm -RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime - -# 复制代码 -COPY . /AutoSignMachine/ - -RUN npm install --registry https://registry.npm.taobao.org - -COPY docker/entrypoint.sh /entrypoint.sh - -RUN chmod +x /entrypoint.sh - -ENTRYPOINT /entrypoint.sh \ No newline at end of file diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh deleted file mode 100644 index 776e543ad..000000000 --- a/docker/entrypoint.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -crontab -r -if [ ${enable_52pojie} ];then - echo "10 13 * * * node /AutoSignMachine/index.js 52pojie --htVD_2132_auth=${htVD_2132_auth} --htVD_2132_saltkey=${htVD_2132_saltkey}" >> /var/spool/cron/crontabs/root -fi - -if [ ${enable_bilibili} ];then - echo "*/30 7-22 * * * node /AutoSignMachine/index.js bilibili --cookies ${cookies} --username ${username} --password ${password} ${othercfg}" >> /var/spool/cron/crontabs/root -fi - -if [ ${enable_iqiyi} ];then - echo "*/30 7-22 * * * node /AutoSignMachine/index.js iqiyi --P00001 ${P00001} --P00PRU ${P00PRU} --QC005 ${QC005} --dfp ${dfp}" >> /var/spool/cron/crontabs/root -fi - -if [ ${enable_unicom} ];then - echo "*/30 7-22 * * * node /AutoSignMachine/index.js unicom --cookies ${cookies} --user ${user} --password ${password} --appid ${appid}" >> /var/spool/cron/crontabs/root -fi - -/usr/sbin/crond -S -c /var/spool/cron/crontabs -f -L /dev/stdout \ No newline at end of file From cbf0559d839aea5d082e6ad8f838a5854aadc230 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Mon, 22 Feb 2021 22:31:14 +0800 Subject: [PATCH 122/128] Update dailyTurncards.js --- commands/tasks/unicom/dailyTurncards.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/commands/tasks/unicom/dailyTurncards.js b/commands/tasks/unicom/dailyTurncards.js index cc648e46f..776fd985b 100644 --- a/commands/tasks/unicom/dailyTurncards.js +++ b/commands/tasks/unicom/dailyTurncards.js @@ -136,8 +136,13 @@ let dailyTurncards = { // console.log(result.data); if (result.data.code !== 200) { + if (result.data.code === 502) { + console.log("后台检测到非法请求,需要验证码。"); + return; + } throw new Error("❌ something errors: ", result.data.msg); } + console.log("开优惠券"); result = await request.postMsmds( "https://wxapp.msmds.cn/jplus/h5/unicomTask/receiveDouling", @@ -326,7 +331,11 @@ let dailyTurncards = { // console.log(result.data); if (result.data.code !== 200) { - throw new Error("❌ something errors: ", result.data); + if (result.data.code === 502) { + console.log("后台检测到非法请求,需要验证码。"); + return; + } + throw new Error("❌ something errors: ", result.data.msg); } console.log("开优惠券"); result = await request.postMsmds( From ddd4b82957924e7f7e54251b73aa27b2269a63b8 Mon Sep 17 00:00:00 2001 From: clamp <15528374+DJ-clamp@users.noreply.github.com> Date: Mon, 22 Feb 2021 22:34:11 +0800 Subject: [PATCH 123/128] Update dailyTurncards.js --- commands/tasks/unicom/dailyTurncards.js | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/commands/tasks/unicom/dailyTurncards.js b/commands/tasks/unicom/dailyTurncards.js index 776fd985b..35f2f49cc 100644 --- a/commands/tasks/unicom/dailyTurncards.js +++ b/commands/tasks/unicom/dailyTurncards.js @@ -116,24 +116,6 @@ let dailyTurncards = { } ); - // console.log(result.data); - if (result.data.code !== 200) { - throw new Error("❌ something errors: ", result.data.msg); - } - result = await request.postMsmds( - "https://wxapp.msmds.cn/jplus/h5/unicomTask/doTask", - { - phone: phone, - type: 6, - token: ecs_token, - }, - { - referer: ` https://jxbwlsali.kuaizhan.com/0/51/p721841247bc5ac?phone=${options.user}`, - origin: "https://jxbwlsali.kuaizhan.com", - "Content-Type": "application/x-www-form-urlencoded", - } - ); - // console.log(result.data); if (result.data.code !== 200) { if (result.data.code === 502) { From 0bacde0cf39ab477a25ef622bd28775f557cc8fc Mon Sep 17 00:00:00 2001 From: meilfy <79211617+meilfy@users.noreply.github.com> Date: Mon, 22 Feb 2021 23:21:05 +0800 Subject: [PATCH 124/128] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dconfig/.env=E6=8C=87?= =?UTF-8?q?=E5=90=91=E6=89=A7=E8=A1=8C=E5=91=BD=E4=BB=A4=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E8=80=8C=E9=9D=9E=E7=A8=8B=E5=BA=8F=E6=89=80=E5=9C=A8=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=A4=B9=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RT --- commands/unicom.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/unicom.js b/commands/unicom.js index 3ccc33952..6d0c0536b 100644 --- a/commands/unicom.js +++ b/commands/unicom.js @@ -12,7 +12,7 @@ String.prototype.replaceWithMask = function (start, end) { return this.substr(0, start) + "******" + this.substr(-end, end); }; let env = require("dotenv").config({ - path: path.resolve(process.cwd(), "config", ".env"), + path: path.resolve(__dirname, "../config", ".env"), }).parsed; if (!env) { throw new Error("missing env file,please check it as well"); From 7351708bbf0d8f8ab8d0b1ca85a6da660b216d59 Mon Sep 17 00:00:00 2001 From: Xzhi Date: Thu, 4 Mar 2021 16:50:28 +0800 Subject: [PATCH 125/128] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9f20b2e85..b78838655 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +> 由于其他原因,该项目暂时停止维护 # AutoSignMachine **一个自动执行任务的工具,通过它可以实现账号自动签到,自动领取权益等功能,帮助我们轻松升级。** @@ -169,4 +170,4 @@ docker run \ ``` ### GitHub Actions 运行问题 -暂未处理GitHub Actions支持 \ No newline at end of file +暂未处理GitHub Actions支持 From 14995b4b0224596c7c7e5928a9d86714a4e4138a Mon Sep 17 00:00:00 2001 From: Xzhi Date: Thu, 4 Mar 2021 18:51:01 +0800 Subject: [PATCH 126/128] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index f0bc3e9f6..a2148691f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ > Due to a third-party risk dispute, this script stopped sharing +> > 由于第三方风险争议,此脚本停止分享 + > 由于其他原因,该项目暂时停止维护 # AutoSignMachine From abffe71f3bfcd562f3b845e9abd64ae72edefc6f Mon Sep 17 00:00:00 2001 From: Xzhi Date: Thu, 4 Mar 2021 18:56:36 +0800 Subject: [PATCH 127/128] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 02b270225..feac0d023 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "author": "lunnlew", "license": "MIT", "dependencies": { - "axios": "^0.21.0", + "axios": "^0.21.1", "axios-cookiejar-support": "^1.0.1", "cheerio": "^1.0.0-rc.3", "crypto": "^1.0.1", From df64ff5d177230b0644ba6ed65339050738bd7df Mon Sep 17 00:00:00 2001 From: Xzhi Date: Thu, 4 Mar 2021 19:03:43 +0800 Subject: [PATCH 128/128] Update package-lock.json --- package-lock.json | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8bd4e6987..a3a3af56a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -300,9 +300,9 @@ "dev": true }, "axios": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.0.tgz", - "integrity": "sha512-fmkJBknJKoZwem3/IKSSLpkdNXZeBu5Q7GA/aRsr2btgrptmSCxi2oFjZHqGdK9DoTil9PIHlPIZw2EcRJXRvw==", + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", + "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", "requires": { "follow-redirects": "^1.10.0" } @@ -817,6 +817,11 @@ "is-obj": "^2.0.0" } }, + "dotenv": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz", + "integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==" + }, "ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npm.taobao.org/ecc-jsbn/download/ecc-jsbn-0.1.2.tgz", @@ -1260,9 +1265,9 @@ "dev": true }, "follow-redirects": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.0.tgz", - "integrity": "sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA==" + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.3.tgz", + "integrity": "sha512-DUgl6+HDzB0iEptNQEXLx/KhTmDb8tZUHSeLqpnjpknR70H0nC2t9N73BK6fN4hOvJ84pKlIQVQ4k5FFlBedKA==" }, "foreach": { "version": "2.0.5",