├── README.md ├── UnValid ├── bot.js ├── env.js ├── wifi万能钥匙.js ├── 中青看点rward.js ├── 中青看点分享.js ├── 中青看点看看赚.js ├── 中青看点阅读.js ├── 乐玩星球.js ├── 什么值得买任务.js ├── 什么值得买抽奖.js ├── 什么值得买签到.js ├── 众安健康小程序.js ├── 劲友家小程序.js ├── 口味王小程序.js ├── 和家亲.js ├── 多多果园.js ├── 好易购商城_Y.js ├── 广汽传祺-微信小程序.js ├── 广汽传祺.js ├── 抖音极速.js ├── 有道词典.js ├── 淘小说.js ├── 渤海宣传员.js ├── 滴滴打车果园.js ├── 滴滴果园.js ├── 牛咔视频.js ├── 电信抽奖.js ├── 电信营业厅.js ├── 番茄免费小说.js ├── 科技玩家.js ├── 美团.js ├── 芒果果园.js ├── 苏泊尔.js ├── 读特.js ├── 起飞线生活.js ├── 趣味阅读.js ├── 趣看365.js ├── 趣闲赚.js ├── 酷狗音乐.js ├── 钱题.js ├── 阿里云盘连续签到活动.js └── 顺义在线_Y.js ├── Valid ├── P_96编辑器.js ├── P_DDJZ.js ├── P_LSZBG.js ├── P_WTXQ.js ├── P_XYLC.js ├── P_ZKS.js ├── P_互阅助手.js ├── P_互阅魔盒.js ├── P_亦辅导.js ├── P_创作王.js ├── P_叮咚买菜.js ├── P_天下资讯.js ├── P_开卷有益.js ├── P_旧衣小二.js ├── P_星空代理.js ├── P_码狮助手.js ├── P_阅光宝盒.js ├── Y_nmbot.js ├── Y_sycc.js ├── Y_热度星客.js ├── Y_顺义创城.js └── sendNotify.js └── sendNotify.js /README.md: -------------------------------------------------------------------------------- 1 | # 说明 2 | 3 | 自用练习备份JS脚本(为了拉库方便) 4 | 5 | 6 | 拉库不要拉取UnValib里面的脚本,因为基本是过期的 7 | 8 | 9 | P_开头是我自己用的不用拉,O_开头是其他人写的,Y_开头是可以拉 10 | 11 | 12 | 13 | ## 拉库命令 14 | ''' 15 | ql repo https://github.com/Poppypy/ql.git "Y_*|O_*" 16 | ''' 17 | 18 | 19 | 20 | 21 | # 其他 22 | 23 | ![](https://github-readme-stats.vercel.app/api?username=Poppypy&show_icons=true&theme=transparent) 24 | 25 | ## Stargazers over time 26 | 27 | [![Stargazers over time](https://starchart.cc/Poppypy/ql.svg)](https://starchart.cc/Poppypy/ql) 28 | 29 | -------------------------------------------------------------------------------- /UnValid/bot.js: -------------------------------------------------------------------------------- 1 | const crypto = require('crypto'); 2 | const got = require('got'); 3 | 4 | // ------------------------------------ 5 | 6 | const APP_VERSION = '10.4.26'; 7 | const APP_VERSION_REV = '866'; 8 | 9 | const DEFAULT_USER_AGENT = `smzdm_android_V${APP_VERSION} rv:${APP_VERSION_REV} (Redmi Note 3;Android10.0;zh)smzdmapp`; 10 | const DEFAULT_WEB_USER_AGENT = `Mozilla/5.0 (Linux; Android 10.0; Redmi Build/Redmi Note 3; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/95.0.4638.74 Mobile Safari/537.36 smzdm_android_V${APP_VERSION} rv:${APP_VERSION_REV} (Redmi;Android10.0;zh) jsbv_1.0.0 webv_2.0 smzdmapp`; 11 | 12 | const SIGN_KEY = 'apr1$AwP!wRRT$gJ/q.X24poeBInlUJC'; 13 | 14 | // ------------------------------------ 15 | 16 | const randomStr = (len = 18) => { 17 | const char = '0123456789'; 18 | let str = ''; 19 | 20 | for (let i = 0; i < len; i++) { 21 | str += char.charAt(Math.floor(Math.random() * char.length)); 22 | } 23 | 24 | return str; 25 | }; 26 | 27 | const parseJSON = (str) => { 28 | try { 29 | return JSON.parse(str); 30 | } 31 | catch (e) { 32 | return {}; 33 | } 34 | }; 35 | 36 | const removeTags = (str) => str.replace(/<[^<]+?>/g, ''); 37 | 38 | // 添加公共参数并签名数据 39 | const signFormData = (data) => { 40 | const newData = { 41 | weixin: 1, 42 | basic_v: 0, 43 | f: 'android', 44 | v: APP_VERSION, 45 | time: `${Math.round(new Date().getTime() / 1000)}000`, 46 | ...data 47 | }; 48 | 49 | const keys = Object.keys(newData).filter(key => newData[key] !== '').sort(); 50 | const signData = keys.map(key => `${key}=${String(newData[key]).replace(/\s+/, '')}`).join('&'); 51 | const sign = crypto.createHash('md5').update(`${signData}&key=${SIGN_KEY}`).digest('hex').toUpperCase(); 52 | 53 | return { 54 | ...newData, 55 | sign 56 | }; 57 | }; 58 | 59 | // 公共请求函数 60 | const requestApi = async (url, inputOptions = {}) => { 61 | const options = { ...inputOptions }; 62 | 63 | if (!options.method) { 64 | options.method = 'get'; 65 | } 66 | 67 | if (!options.data) { 68 | options.data = {}; 69 | } 70 | 71 | Object.keys(options.data).forEach(key => options.data[key] === undefined && delete options.data[key]); 72 | 73 | if (options.sign !== false) { 74 | options.data = signFormData(options.data); 75 | } 76 | 77 | const gotOptions = { 78 | method: options.method.toUpperCase(), 79 | headers: options.headers, 80 | retry: { 81 | limit: 2, 82 | methods: [ 83 | 'GET', 84 | 'POST' 85 | ], 86 | statusCodes: [ 87 | ], 88 | errorCodes: [ 89 | 'ECONNRESET', 90 | 'EAI_AGAIN' 91 | ] 92 | } 93 | }; 94 | 95 | if (options.method === 'get') { 96 | gotOptions.searchParams = options.data; 97 | } 98 | else { 99 | gotOptions.form = options.data; 100 | } 101 | 102 | return got(url, gotOptions).then((response) => { 103 | const data = options.parseJSON === false ? response.body : parseJSON(response.body); 104 | 105 | if (options.debug) { 106 | console.log('------------------------'); 107 | console.log(url); 108 | console.log('------------------------'); 109 | console.log(JSON.stringify(gotOptions, null, 2)); 110 | console.log('------------------------'); 111 | console.log(options.parseJSON === false ? response.body : JSON.stringify(data, null, 2)); 112 | console.log('------------------------'); 113 | } 114 | 115 | return { 116 | isSuccess: options.parseJSON === false ? true : (data.error_code == '0'), 117 | response: options.parseJSON === false ? response.body : JSON.stringify(data, null, 2), 118 | data 119 | }; 120 | }).catch((error) => { 121 | if (options.debug) { 122 | console.log('------------------------'); 123 | console.log(url); 124 | console.log('------------------------'); 125 | console.log(JSON.stringify(gotOptions, null, 2)); 126 | console.log('------------------------'); 127 | console.log(error); 128 | console.log('------------------------'); 129 | } 130 | 131 | return { 132 | isSuccess: false, 133 | response: error, 134 | data: error 135 | }; 136 | }) 137 | }; 138 | 139 | const updateCookie = (cookie, name, value) => { 140 | const re = new RegExp(`(^|;)${name}=[^;]+;`, 'ig'); 141 | 142 | return cookie.replace(re, `$1${name}=${encodeURIComponent(value)};`); 143 | }; 144 | 145 | const getEnvCookies = () => { 146 | let cookies = []; 147 | 148 | // 判断环境变量里面是否有 cookie 149 | if (process.env.SMZDM_COOKIE) { 150 | if (process.env.SMZDM_COOKIE.indexOf('&') > -1) { 151 | cookies = process.env.SMZDM_COOKIE.split('&'); 152 | } 153 | else if (process.env.SMZDM_COOKIE.indexOf('\n') > -1) { 154 | cookies = process.env.SMZDM_COOKIE.split('\n'); 155 | } 156 | else { 157 | cookies = [process.env.SMZDM_COOKIE]; 158 | } 159 | } 160 | 161 | return cookies[0] ? cookies : false; 162 | }; 163 | 164 | // ------------------------------------ 165 | 166 | class SmzdmBot { 167 | constructor(cookie) { 168 | this.cookie = cookie.trim(); 169 | 170 | const match = this.cookie.match(/sess=(.*?);/); 171 | this.token = match ? match[1] : ''; 172 | 173 | // 处理 cookie 174 | this.androidCookie = this.cookie.replace('iphone', 'android').replace('iPhone', 'Android'); 175 | this.androidCookie = updateCookie(this.androidCookie, 'smzdm_version', APP_VERSION); 176 | this.androidCookie = updateCookie(this.androidCookie, 'device_smzdm_version', APP_VERSION); 177 | this.androidCookie = updateCookie(this.androidCookie, 'v', APP_VERSION); 178 | this.androidCookie = updateCookie(this.androidCookie, 'device_smzdm_version_code', APP_VERSION_REV); 179 | this.androidCookie = updateCookie(this.androidCookie, 'device_system_version', '10.0'); 180 | this.androidCookie = updateCookie(this.androidCookie, 'apk_partner_name', 'smzdm_download'); 181 | this.androidCookie = updateCookie(this.androidCookie, 'partner_name', 'smzdm_download'); 182 | this.androidCookie = updateCookie(this.androidCookie, 'device_type', 'Android'); 183 | this.androidCookie = updateCookie(this.androidCookie, 'device_smzdm', 'android'); 184 | this.androidCookie = updateCookie(this.androidCookie, 'device_name', 'Android'); 185 | } 186 | 187 | getHeaders() { 188 | return { 189 | Accept: '*/*', 190 | 'Accept-Language': 'zh-Hans-CN;q=1', 191 | 'Accept-Encoding': 'gzip', 192 | 'request_key': randomStr(18), 193 | 'User-Agent': DEFAULT_USER_AGENT, 194 | Cookie: this.androidCookie 195 | }; 196 | } 197 | 198 | getHeadersForWeb() { 199 | return { 200 | Accept: '*/*', 201 | 'Accept-Language': 'zh-CN,zh-Hans;q=0.9', 202 | 'Accept-Encoding': 'gzip', 203 | 'User-Agent': DEFAULT_WEB_USER_AGENT, 204 | Cookie: this.androidCookie 205 | }; 206 | } 207 | 208 | getOneByRandom(listing) { 209 | return listing[Math.floor(Math.random() * listing.length)]; 210 | } 211 | } 212 | 213 | module.exports = { 214 | SmzdmBot, 215 | requestApi, 216 | removeTags, 217 | parseJSON, 218 | getEnvCookies 219 | }; 220 | -------------------------------------------------------------------------------- /UnValid/env.js: -------------------------------------------------------------------------------- 1 | function Env(t, e) { 2 | "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); 3 | 4 | class s { 5 | constructor(t) { 6 | this.env = t 7 | } 8 | send(t, e = "GET") { 9 | t = "string" == typeof t ? { 10 | url: t 11 | } : 12 | t; 13 | let s = this.get; 14 | return "POST" === e && (s = this.post), 15 | new Promise((e, i) => { 16 | s.call(this, t, (t, s) => { 17 | t ? i(t) : e(s) 18 | }) 19 | }) 20 | } 21 | get(t) { 22 | return this.send.call(this.env, t) 23 | } 24 | post(t) { 25 | return this.send.call(this.env, t, "POST") 26 | } 27 | } 28 | 29 | return new class { 30 | constructor(t, e) { 31 | this.name = t, 32 | this.http = new s(this), 33 | this.data = null, 34 | this.dataFile = "box.dat", 35 | this.logs = [], 36 | this.isMute = !1, 37 | this.isNeedRewrite = !1, 38 | this.logSeparator = "\n", 39 | this.startTime = (new Date).getTime(), 40 | Object.assign(this, e), 41 | this.log("", `🔔${this.name}, 开始!`) 42 | } 43 | isNode() { 44 | return "undefined" != typeof module && !!module.exports 45 | } 46 | isQuanX() { 47 | return "undefined" != typeof $task 48 | } 49 | isSurge() { 50 | return "undefined" != typeof $httpClient && "undefined" == typeof $loon 51 | } 52 | isLoon() { 53 | return "undefined" != typeof $loon 54 | } 55 | toObj(t, e = null) { 56 | try { 57 | return JSON.parse(t) 58 | } 59 | catch { 60 | return e 61 | } 62 | } 63 | toStr(t, e = null) { 64 | try { 65 | return JSON.stringify(t) 66 | } 67 | catch { 68 | return e 69 | } 70 | } 71 | getjson(t, e) { 72 | let s = e; 73 | const i = this.getdata(t); 74 | if (i) { 75 | try { 76 | s = JSON.parse(this.getdata(t)) 77 | } 78 | catch {} 79 | } 80 | return s 81 | } 82 | setjson(t, e) { 83 | try { 84 | return this.setdata(JSON.stringify(t), e) 85 | } 86 | catch { 87 | return !1 88 | } 89 | } 90 | getScript(t) { 91 | return new Promise(e => { 92 | this.get({ 93 | url: t 94 | }, (t, s, i) => e(i)) 95 | }) 96 | } 97 | runScript(t, e) { 98 | return new Promise(s => { 99 | let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); 100 | i = i ? i.replace(/\n/g, "").trim() : i; 101 | let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); 102 | r = r ? 1 * r : 20, 103 | r = e && e.timeout ? e.timeout : r; 104 | const [o, h] = i.split("@"), 105 | n = { 106 | url: `http://${h}/v1/scripting/evaluate`, 107 | body: { 108 | script_text: t, 109 | mock_type: "cron", 110 | timeout: r 111 | }, 112 | headers: { 113 | "X-Key": o, 114 | Accept: "*/*" 115 | } 116 | }; 117 | this.post(n, (t, e, i) => s(i)) 118 | }).catch(t => this.logErr(t)) 119 | } 120 | loaddata() { 121 | if (!this.isNode()) {return {};} { 122 | this.fs = this.fs ? this.fs : require("fs"), 123 | this.path = this.path ? this.path : require("path"); 124 | const t = this.path.resolve(this.dataFile), 125 | e = this.path.resolve(process.cwd(), this.dataFile), 126 | s = this.fs.existsSync(t), 127 | i = !s && this.fs.existsSync(e); 128 | if (!s && !i) {return {};} { 129 | const i = s ? t : e; 130 | try { 131 | return JSON.parse(this.fs.readFileSync(i)) 132 | } 133 | catch (t) { 134 | return {} 135 | } 136 | } 137 | } 138 | } 139 | writedata() { 140 | if (this.isNode()) { 141 | this.fs = this.fs ? this.fs : require("fs"), 142 | this.path = this.path ? this.path : require("path"); 143 | const t = this.path.resolve(this.dataFile), 144 | e = this.path.resolve(process.cwd(), this.dataFile), 145 | s = this.fs.existsSync(t), 146 | i = !s && this.fs.existsSync(e), 147 | r = JSON.stringify(this.data); 148 | s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) 149 | } 150 | } 151 | lodash_get(t, e, s) { 152 | const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); 153 | let r = t; 154 | for (const t of i) { 155 | if (r = Object(r)[t], void 0 === r) {return s;} 156 | } 157 | return r 158 | } 159 | lodash_set(t, e, s) { 160 | return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) 161 | } 162 | getdata(t) { 163 | let e = this.getval(t); 164 | if (/^@/.test(t)) { 165 | const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), 166 | r = s ? this.getval(s) : ""; 167 | if (r) { 168 | try { 169 | const t = JSON.parse(r); 170 | e = t ? this.lodash_get(t, i, "") : e 171 | } 172 | catch (t) { 173 | e = "" 174 | } 175 | } 176 | } 177 | return e 178 | } 179 | setdata(t, e) { 180 | let s = !1; 181 | if (/^@/.test(e)) { 182 | const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), 183 | o = this.getval(i), 184 | h = i ? "null" === o ? null : o || "{}" : "{}"; 185 | try { 186 | const e = JSON.parse(h); 187 | this.lodash_set(e, r, t), 188 | s = this.setval(JSON.stringify(e), i) 189 | } 190 | catch (e) { 191 | const o = {}; 192 | this.lodash_set(o, r, t), 193 | s = this.setval(JSON.stringify(o), i) 194 | } 195 | } 196 | else {s = this.setval(t, e);} 197 | return s 198 | } 199 | getval(t) { 200 | return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null 201 | } 202 | setval(t, e) { 203 | return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null 204 | } 205 | initGotEnv(t) { 206 | this.got = this.got ? this.got : require("got"), 207 | this.cktough = this.cktough ? this.cktough : require("tough-cookie"), 208 | this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, 209 | t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) 210 | } 211 | get(t, e = (() => {})) { 212 | t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), 213 | this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { 214 | "X-Surge-Skip-Scripting": !1 215 | })), $httpClient.get(t, (t, s, i) => { 216 | !t && s && (s.body = i, s.statusCode = s.status), 217 | e(t, s, i) 218 | })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { 219 | hints: !1 220 | })), $task.fetch(t).then(t => { 221 | const { 222 | statusCode: s, 223 | statusCode: i, 224 | headers: r, 225 | body: o 226 | } = t; 227 | e(null, { 228 | status: s, 229 | statusCode: i, 230 | headers: r, 231 | body: o 232 | }, o) 233 | }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { 234 | try { 235 | if (t.headers["set-cookie"]) { 236 | const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); 237 | s && this.ckjar.setCookieSync(s, null), 238 | e.cookieJar = this.ckjar 239 | } 240 | } 241 | catch (t) { 242 | this.logErr(t) 243 | } 244 | }).then(t => { 245 | const { 246 | statusCode: s, 247 | statusCode: i, 248 | headers: r, 249 | body: o 250 | } = t; 251 | e(null, { 252 | status: s, 253 | statusCode: i, 254 | headers: r, 255 | body: o 256 | }, o) 257 | }, t => { 258 | const { 259 | message: s, 260 | response: i 261 | } = t; 262 | e(s, i, i && i.body) 263 | })) 264 | } 265 | post(t, e = (() => {})) { 266 | if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) { 267 | this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { 268 | "X-Surge-Skip-Scripting": !1 269 | })), $httpClient.post(t, (t, s, i) => { 270 | !t && s && (s.body = i, s.statusCode = s.status), 271 | e(t, s, i) 272 | }); 273 | } 274 | else if (this.isQuanX()) { 275 | t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { 276 | hints: !1 277 | })), $task.fetch(t).then(t => { 278 | const { 279 | statusCode: s, 280 | statusCode: i, 281 | headers: r, 282 | body: o 283 | } = t; 284 | e(null, { 285 | status: s, 286 | statusCode: i, 287 | headers: r, 288 | body: o 289 | }, o) 290 | }, t => e(t)); 291 | } 292 | else if (this.isNode()) { 293 | this.initGotEnv(t); 294 | const { 295 | url: s, 296 | ...i 297 | } = t; 298 | this.got.post(s, i).then(t => { 299 | const { 300 | statusCode: s, 301 | statusCode: i, 302 | headers: r, 303 | body: o 304 | } = t; 305 | e(null, { 306 | status: s, 307 | statusCode: i, 308 | headers: r, 309 | body: o 310 | }, o) 311 | }, t => { 312 | const { 313 | message: s, 314 | response: i 315 | } = t; 316 | e(s, i, i && i.body) 317 | }) 318 | } 319 | } 320 | time(t, e = null) { 321 | const s = e ? new Date(e) : new Date; 322 | const i = { 323 | "M+": s.getMonth() + 1, 324 | "d+": s.getDate(), 325 | "H+": s.getHours(), 326 | "m+": s.getMinutes(), 327 | "s+": s.getSeconds(), 328 | "q+": Math.floor((s.getMonth() + 3) / 3), 329 | S: s.getMilliseconds() 330 | }; 331 | /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length))); 332 | for (const e in i) {new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length)));} 333 | return t 334 | } 335 | msg(e = t, s = "", i = "", r) { 336 | const o = t => { 337 | if (!t) {return t;} 338 | if ("string" == typeof t) { 339 | return this.isLoon() ? t : this.isQuanX() ? { 340 | "open-url": t 341 | } : 342 | this.isSurge() ? { 343 | url: t 344 | } : 345 | void 0; 346 | } 347 | if ("object" == typeof t) { 348 | if (this.isLoon()) { 349 | const e = t.openUrl || t.url || t["open-url"], 350 | s = t.mediaUrl || t["media-url"]; 351 | return { 352 | openUrl: e, 353 | mediaUrl: s 354 | } 355 | } 356 | if (this.isQuanX()) { 357 | const e = t["open-url"] || t.url || t.openUrl, 358 | s = t["media-url"] || t.mediaUrl; 359 | return { 360 | "open-url": e, 361 | "media-url": s 362 | } 363 | } 364 | if (this.isSurge()) { 365 | const e = t.url || t.openUrl || t["open-url"]; 366 | return { 367 | url: e 368 | } 369 | } 370 | } 371 | }; 372 | if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) { 373 | const t = ["", "==============📣系统通知📣=============="]; 374 | t.push(e), 375 | s && t.push(s), 376 | i && t.push(i), 377 | console.log(t.join("\n")), 378 | this.logs = this.logs.concat(t) 379 | } 380 | } 381 | log(...t) { 382 | t.length > 0 && (this.logs = [...this.logs, ...t]), 383 | console.log(t.join(this.logSeparator)) 384 | } 385 | logErr(t) { 386 | const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); 387 | s ? this.log("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t) 388 | } 389 | wait(t) { 390 | return new Promise(e => setTimeout(e, t)) 391 | } 392 | done(t = {}) { 393 | const e = (new Date).getTime(), 394 | s = (e - this.startTime) / 1e3; 395 | this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`), 396 | this.log(), 397 | (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) 398 | } 399 | }(t, e); 400 | } 401 | 402 | module.exports = Env; 403 | -------------------------------------------------------------------------------- /UnValid/什么值得买任务.js: -------------------------------------------------------------------------------- 1 | /* 2 | 什么值得买任务脚本 3 | 项目地址: https://github.com/hex-ci/smzdm_script 4 | 5 | cron: 20 14 * * * 6 | */ 7 | 8 | const Env = require('./env'); 9 | const { SmzdmBot, requestApi, removeTags, getEnvCookies } = require('./bot'); 10 | const notify = require('./sendNotify'); 11 | 12 | // ------------------------------------ 13 | 14 | const $ = new Env('什么值得买任务'); 15 | 16 | class SmzdmTaskBot extends SmzdmBot { 17 | constructor(cookie) { 18 | super(cookie); 19 | } 20 | 21 | // 主函数 22 | async run() { 23 | const { tasks } = await this.getTaskList(); 24 | 25 | let notifyMsg = ''; 26 | 27 | for (let i = 0; i < tasks.length; i++) { 28 | const task = tasks[i]; 29 | 30 | // 待领取任务 31 | if (task.task_status == '3') { 32 | $.log(`领取[${task.task_name}]奖励:`); 33 | 34 | const { isSuccess } = await this.receiveReward(task.task_id); 35 | 36 | notifyMsg += `领取[${task.task_name}]奖励${isSuccess ? '成功' : '失败!请查看日志'}\n`; 37 | 38 | $.log('等候 5 秒'); 39 | await $.wait(5000); 40 | } 41 | // 未完成任务 42 | else if (task.task_status == '2') { 43 | // 浏览文章任务 44 | if (task.task_event_type == 'interactive.view.article') { 45 | const { isSuccess } = await this.doViewTask(task); 46 | 47 | notifyMsg += `完成[${task.task_name}]任务${isSuccess ? '成功' : '失败!请查看日志'}\n`; 48 | 49 | $.log('等候 5 秒'); 50 | await $.wait(5000); 51 | } 52 | // 分享任务 53 | else if (task.task_event_type == 'interactive.share') { 54 | let result; 55 | 56 | if (task.article_id == '0') { 57 | result = await this.doShareTaskMulti(task); 58 | } 59 | else { 60 | result = await this.doShareTaskSingle(task); 61 | } 62 | 63 | notifyMsg += `完成[${task.task_name}]任务${result.isSuccess ? '成功' : '失败!请查看日志'}\n`; 64 | 65 | $.log('等候 5 秒'); 66 | await $.wait(5000); 67 | } 68 | // 抽奖任务 69 | else if (task.task_event_type == 'guide.crowd') { 70 | const { isSuccess } = await this.doCrowdTask(task); 71 | 72 | notifyMsg += `完成[${task.task_name}]任务${isSuccess ? '成功' : '失败!请查看日志'}\n`; 73 | 74 | $.log('等候 5 秒'); 75 | await $.wait(5000); 76 | } 77 | // 关注用户任务 78 | else if (task.task_event_type == 'interactive.follow.user') { 79 | const { isSuccess } = await this.doFollowUserTask(task); 80 | 81 | notifyMsg += `完成[${task.task_name}]任务${isSuccess ? '成功' : '失败!请查看日志'}\n`; 82 | 83 | $.log('等候 5 秒'); 84 | await $.wait(5000); 85 | } 86 | // 关注栏目任务 87 | else if (task.task_event_type == 'interactive.follow.tag') { 88 | const { isSuccess } = await this.doFollowTagTask(task); 89 | 90 | notifyMsg += `完成[${task.task_name}]任务${isSuccess ? '成功' : '失败!请查看日志'}\n`; 91 | 92 | $.log('等候 5 秒'); 93 | await $.wait(5000); 94 | } 95 | } 96 | } 97 | 98 | $.log('等候 5 秒查询是否有限时累计活动阶段奖励'); 99 | await $.wait(5000); 100 | 101 | // 领取活动奖励 102 | const { detail } = await this.getTaskList(); 103 | 104 | if (detail.cell_data && detail.cell_data.activity_reward_status == '1') { 105 | $.log('有奖励,等候 3 秒领取奖励'); 106 | await $.wait(5000); 107 | 108 | const { isSuccess } = await this.receiveActivity(detail.cell_data); 109 | 110 | notifyMsg += `奖励领取${isSuccess ? '成功' : '失败!请查看日志'}\n`; 111 | } 112 | else { 113 | $.log('无奖励'); 114 | } 115 | 116 | return notifyMsg || '无可执行任务'; 117 | } 118 | 119 | // 执行关注用户任务 120 | async doFollowUserTask(task) { 121 | $.log(`开始任务: ${task.task_name}`); 122 | 123 | // 随机选一个用户 124 | const user = await this.getUserByRandom(); 125 | 126 | if (!user) { 127 | return { 128 | isSuccess: false 129 | }; 130 | } 131 | 132 | $.log('等候 3 秒'); 133 | await $.wait(3000); 134 | 135 | for (let i = 0; i < 3; i++) { 136 | if (user.is_follow == '1') { 137 | await this.follow({ 138 | method: 'destroy', 139 | type: 'user', 140 | keyword: user.keyword 141 | }); 142 | 143 | $.log('等候 5 秒'); 144 | await $.wait(3000); 145 | } 146 | 147 | await this.follow({ 148 | method: 'create', 149 | type: 'user', 150 | keyword: user.keyword 151 | }); 152 | 153 | $.log('等候 3 秒'); 154 | await $.wait(3000); 155 | 156 | if (user.is_follow == '0') { 157 | await this.follow({ 158 | method: 'destroy', 159 | type: 'user', 160 | keyword: user.keyword 161 | }); 162 | } 163 | 164 | $.log('等候 5 秒'); 165 | await $.wait(3000); 166 | } 167 | 168 | $.log('延迟 5 秒领取奖励'); 169 | await $.wait(5000); 170 | 171 | return await this.receiveReward(task.task_id); 172 | } 173 | 174 | // 执行关注栏目任务(先取关,再关注,最后取关) 175 | async doFollowTagTask(task) { 176 | $.log(`开始任务: ${task.task_name}`); 177 | 178 | // 获取栏目信息 179 | const tagDetail = await this.getTagDetail(task.task_redirect_url.link_val); 180 | 181 | if (!tagDetail.lanmu_id) { 182 | $.log('获取栏目信息失败!'); 183 | 184 | return { 185 | isSuccess: false 186 | }; 187 | } 188 | 189 | $.log('先尝试取关栏目,如果出错表示尚未关注此,忽略这个错误。'); 190 | await this.follow({ 191 | method: 'destroy', 192 | type: 'tag', 193 | keywordId: tagDetail.lanmu_id, 194 | keyword: tagDetail.lanmu_info.lanmu_name 195 | }); 196 | 197 | $.log('等候 3 秒'); 198 | await $.wait(3000); 199 | 200 | await this.follow({ 201 | method: 'create', 202 | type: 'tag', 203 | keywordId: tagDetail.lanmu_id, 204 | keyword: tagDetail.lanmu_info.lanmu_name 205 | }); 206 | 207 | $.log('等候 3 秒'); 208 | await $.wait(3000); 209 | 210 | await this.follow({ 211 | method: 'destroy', 212 | type: 'tag', 213 | keywordId: tagDetail.lanmu_id, 214 | keyword: tagDetail.lanmu_info.lanmu_name 215 | }); 216 | 217 | $.log('延迟 5 秒领取奖励'); 218 | await $.wait(5000); 219 | 220 | return await this.receiveReward(task.task_id); 221 | } 222 | 223 | // 执行抽奖任务 224 | async doCrowdTask(task) { 225 | $.log(`开始任务: ${task.task_name}`); 226 | 227 | const { isSuccess, data } = await this.getFreeCrowd(); 228 | 229 | if (!isSuccess) { 230 | return { 231 | isSuccess 232 | }; 233 | } 234 | 235 | $.log('等候 5 秒'); 236 | await $.wait(5000); 237 | 238 | const result = await this.joinCrowd(data); 239 | 240 | if (!result.isSuccess) { 241 | return { 242 | isSuccess: result.isSuccess 243 | }; 244 | } 245 | 246 | $.log('延迟 5 秒领取奖励'); 247 | await $.wait(5000); 248 | 249 | return await this.receiveReward(task.task_id); 250 | } 251 | 252 | // 执行一篇文章的分享任务 253 | async doShareTaskSingle(task) { 254 | $.log(`开始任务: ${task.task_name}`); 255 | 256 | $.log(`开始分享文章...`); 257 | 258 | $.log('等候 5 秒'); 259 | await $.wait(5000); 260 | 261 | await this.shareDailyReward(task.channel_id); 262 | await this.shareCallback(task.article_id, task.channel_id); 263 | 264 | $.log('等候 3 秒'); 265 | await $.wait(3000); 266 | 267 | await this.shareArticleDone(task.article_id, task.channel_id); 268 | 269 | $.log('延迟 5 秒领取奖励'); 270 | await $.wait(5000); 271 | 272 | return await this.receiveReward(task.task_id); 273 | } 274 | 275 | // 执行多篇文章的分享任务 276 | async doShareTaskMulti(task) { 277 | $.log(`开始任务: ${task.task_name}`); 278 | 279 | const articles = await this.getArticleList(); 280 | 281 | for (let i = 0; i < articles.length; i++) { 282 | $.log(`开始分享第 ${i + 1} 篇文章...`); 283 | 284 | const article = articles[i]; 285 | 286 | $.log('等候 5 秒'); 287 | await $.wait(3000); 288 | 289 | await this.shareDailyReward(article.channel_id); 290 | await this.shareCallback(article.article_id, article.channel_id); 291 | 292 | $.log('等候 3 秒'); 293 | await $.wait(3000); 294 | 295 | await this.shareArticleDone(article.article_id, article.channel_id); 296 | 297 | $.log('等候 5 秒'); 298 | await $.wait(5000); 299 | } 300 | 301 | $.log('延迟 3 秒领取奖励'); 302 | await $.wait(3000); 303 | 304 | return await this.receiveReward(task.task_id); 305 | } 306 | 307 | // 执行浏览任务 308 | async doViewTask(task) { 309 | $.log(`开始任务: ${task.task_name}`); 310 | 311 | $.log('延迟 11 秒模拟阅读文章'); 312 | await $.wait(11000); 313 | 314 | const { isSuccess, response } = await requestApi('https://user-api.smzdm.com/task/event_view_article', { 315 | method: 'post', 316 | headers: this.getHeaders(), 317 | data: { 318 | token: this.token, 319 | article_id: task.article_id, 320 | channel_id: task.channel_id 321 | } 322 | }); 323 | 324 | if (isSuccess) { 325 | $.log('延迟 3 秒领取奖励'); 326 | await $.wait(3000); 327 | 328 | return await this.receiveReward(task.task_id); 329 | } 330 | else { 331 | $.log(`任务异常!${response}`); 332 | 333 | return { 334 | isSuccess 335 | }; 336 | } 337 | } 338 | 339 | // 领取活动奖励 340 | async receiveActivity(activity) { 341 | $.log(`领取活动奖励: ${activity.activity_name}`); 342 | 343 | const { isSuccess, data, response } = await requestApi('https://user-api.smzdm.com/task/activity_receive', { 344 | method: 'post', 345 | headers: this.getHeaders(), 346 | data: { 347 | token: this.token, 348 | activity_id: activity.activity_id 349 | } 350 | }); 351 | 352 | if (isSuccess) { 353 | $.log(removeTags(data.data.reward_msg)); 354 | 355 | return { 356 | isSuccess 357 | }; 358 | } 359 | else { 360 | $.log(`领取活动奖励失败!${response}`); 361 | 362 | return { 363 | isSuccess 364 | }; 365 | } 366 | } 367 | 368 | // 关注/取关 369 | async follow({keywordId, keyword, type, method}) { 370 | const { isSuccess, response } = await requestApi(`https://dingyue-api.smzdm.com/dingyue/${method}`, { 371 | method: 'post', 372 | headers: this.getHeaders(), 373 | data: { 374 | touchstone_event: '{}', 375 | refer: '', 376 | keyword_id: keywordId, 377 | keyword, 378 | type 379 | } 380 | }); 381 | 382 | if (isSuccess) { 383 | $.log(`${method} 关注成功: ${keyword}`); 384 | } 385 | else { 386 | $.log(`${method} 关注失败!${response}`); 387 | } 388 | 389 | return { 390 | isSuccess, 391 | response 392 | }; 393 | } 394 | 395 | // 随机获取用户 396 | async getUserByRandom() { 397 | const { isSuccess, data, response } = await requestApi('https://dingyue-api.smzdm.com/tuijian/search_result', { 398 | method: 'post', 399 | headers: this.getHeaders(), 400 | data: { 401 | nav_id: 0, 402 | page: 1, 403 | type: 'user', 404 | time_code: '' 405 | } 406 | }); 407 | 408 | if (isSuccess) { 409 | return data.data.rows[Math.floor(Math.random() * data.data.rows.length)]; 410 | } 411 | else { 412 | $.log(`获取用户列表失败!${response}`); 413 | 414 | return false; 415 | } 416 | } 417 | 418 | // 参加抽奖 419 | async joinCrowd(id) { 420 | const { isSuccess, data, response } = await requestApi('https://zhiyou.m.smzdm.com/user/crowd/ajax_participate', { 421 | method: 'post', 422 | sign: false, 423 | headers: { 424 | ...this.getHeadersForWeb(), 425 | Origin: 'https://zhiyou.m.smzdm.com', 426 | Referer: `https://zhiyou.m.smzdm.com/user/crowd/p/${id}/` 427 | }, 428 | data: { 429 | crowd_id: id, 430 | sourcePage: `https://zhiyou.m.smzdm.com/user/crowd/p/${id}/`, 431 | client_type: 'android', 432 | sourceRoot: '个人中心', 433 | sourceMode: '幸运屋抽奖', 434 | price_id: 1 435 | } 436 | }); 437 | 438 | if (isSuccess) { 439 | $.log(removeTags(data.data.msg)); 440 | } 441 | else { 442 | $.log(`参加免费抽奖失败: ${response}`); 443 | } 444 | 445 | return { 446 | isSuccess, 447 | response 448 | }; 449 | } 450 | 451 | // 获取免费抽奖信息 452 | async getFreeCrowd() { 453 | const { isSuccess, data, response } = await requestApi('https://zhiyou.smzdm.com/user/crowd/', { 454 | sign: false, 455 | parseJSON: false, 456 | headers: this.getHeadersForWeb() 457 | }); 458 | 459 | if (isSuccess) { 460 | const match = data.match(/]+?)>\s+?]+?>\s*免费抽奖\s*<\/div>\s+-0<\/span>[\s\S]+?<\/button>/i); 461 | 462 | if (match) { 463 | const matchCrowd = match[1].match(/data-crowd_id="(\d+)"/i); 464 | 465 | if (matchCrowd) { 466 | $.log(`免费抽奖ID: ${matchCrowd[1]}`); 467 | 468 | return { 469 | isSuccess: true, 470 | data: matchCrowd[1] 471 | }; 472 | } 473 | else { 474 | $.log(`未找到免费抽奖ID`); 475 | 476 | return { 477 | isSuccess: false 478 | }; 479 | } 480 | } 481 | else { 482 | $.log(`未找到免费抽奖`); 483 | 484 | return { 485 | isSuccess: false 486 | }; 487 | } 488 | } 489 | else { 490 | $.log(`获取免费抽奖失败: ${response}`); 491 | 492 | return { 493 | isSuccess: false 494 | }; 495 | } 496 | } 497 | 498 | // 分享完成,可以领取奖励了 499 | async shareArticleDone(articleId, channelId) { 500 | const { isSuccess, response } = await requestApi('https://user-api.smzdm.com/share/article_reward', { 501 | method: 'post', 502 | headers: this.getHeaders(), 503 | data: { 504 | token: this.token, 505 | article_id: articleId, 506 | channel_id: channelId 507 | } 508 | }); 509 | 510 | if (isSuccess) { 511 | $.log('完成分享成功。'); 512 | 513 | return { 514 | isSuccess, 515 | msg: '完成分享成功。' 516 | }; 517 | } 518 | else { 519 | $.log(`完成分享失败!${response}`); 520 | 521 | return { 522 | isSuccess: false, 523 | msg: '完成分享失败!' 524 | }; 525 | } 526 | } 527 | 528 | // 分享完成后回调接口 529 | async shareCallback(articleId, channelId) { 530 | const { isSuccess, response } = await requestApi('https://user-api.smzdm.com/share/callback', { 531 | method: 'post', 532 | headers: this.getHeaders(), 533 | data: { 534 | token: this.token, 535 | article_id: articleId, 536 | channel_id: channelId 537 | } 538 | }); 539 | 540 | if (isSuccess) { 541 | $.log('分享回调完成。'); 542 | 543 | return { 544 | isSuccess, 545 | msg: '' 546 | }; 547 | } 548 | else { 549 | $.log(`分享回调失败!${response}`); 550 | 551 | return { 552 | isSuccess, 553 | msg: '分享回调失败!' 554 | }; 555 | } 556 | } 557 | 558 | // 分享的每日奖励(貌似没啥用) 559 | async shareDailyReward(channelId) { 560 | const { isSuccess, data, response } = await requestApi('https://user-api.smzdm.com/share/daily_reward', { 561 | method: 'post', 562 | headers: this.getHeaders(), 563 | data: { 564 | token: this.token, 565 | channel_id: channelId 566 | } 567 | }); 568 | 569 | if (isSuccess) { 570 | $.log(data.data.reward_desc); 571 | 572 | return { 573 | isSuccess, 574 | msg: data.data.reward_desc 575 | }; 576 | } 577 | else { 578 | if (data) { 579 | $.log(data.error_msg); 580 | 581 | return { 582 | isSuccess, 583 | msg: data.error_msg 584 | }; 585 | } 586 | else { 587 | $.log(`分享每日奖励请求失败!${response}`); 588 | 589 | return { 590 | isSuccess, 591 | msg: '分享每日奖励请求失败!' 592 | }; 593 | } 594 | } 595 | } 596 | 597 | // 获取 Web 文章列表 598 | async getArticleList() { 599 | const { isSuccess, data, response } = await requestApi('https://post.smzdm.com/json_more/?tab_id=tuijian&filterUrl=tuijian', { 600 | sign: false, 601 | headers: { 602 | ...this.getHeadersForWeb(), 603 | Referer: 'https://post.smzdm.com/' 604 | } 605 | }); 606 | 607 | if (isSuccess) { 608 | // 目前只取前两个做任务 609 | return data.data.slice(0, 2); 610 | } 611 | else { 612 | $.log(`获取文章列表失败: ${response}`); 613 | return []; 614 | } 615 | } 616 | 617 | // 领取任务奖励 618 | async receiveReward(taskId) { 619 | const { isSuccess, data, response } = await requestApi('https://user-api.smzdm.com/task/activity_task_receive', { 620 | method: 'post', 621 | headers: this.getHeaders(), 622 | data: { 623 | token: this.token, 624 | task_id: taskId 625 | } 626 | }); 627 | 628 | if (isSuccess) { 629 | const msg = removeTags(data.data.reward_msg); 630 | 631 | $.log(msg); 632 | 633 | return { 634 | isSuccess, 635 | msg 636 | }; 637 | } 638 | else { 639 | $.log(`领取任务奖励失败!${response}`); 640 | 641 | return { 642 | isSuccess, 643 | msg: '领取任务奖励失败!' 644 | }; 645 | } 646 | } 647 | 648 | // 获取任务列表 649 | async getTaskList() { 650 | const { isSuccess, data } = await requestApi('https://user-api.smzdm.com/task/list_v2', { 651 | method: 'post', 652 | headers: this.getHeaders() 653 | }); 654 | 655 | if (isSuccess) { 656 | let tasks = []; 657 | 658 | data.data.rows[0].cell_data.activity_task.accumulate_list.task_list_v2.forEach(item => { 659 | tasks = tasks.concat(item.task_list); 660 | }); 661 | 662 | return { 663 | tasks: tasks, 664 | detail: data.data.rows[0] 665 | }; 666 | } 667 | else { 668 | return { 669 | tasks: [], 670 | detail: {} 671 | }; 672 | } 673 | } 674 | 675 | // 获取栏目信息 676 | async getTagDetail(id) { 677 | const { isSuccess, data, response } = await requestApi('https://common-api.smzdm.com/lanmu/config_data', { 678 | headers: this.getHeaders(), 679 | data: { 680 | middle_page: '', 681 | tab_selects: '', 682 | redirect_params: id 683 | } 684 | }); 685 | 686 | if (isSuccess) { 687 | return data.data; 688 | } 689 | else { 690 | $.log(`获取栏目信息失败!${response}`); 691 | return {}; 692 | } 693 | } 694 | } 695 | 696 | !(async () => { 697 | const cookies = getEnvCookies(); 698 | 699 | if (cookies === false) { 700 | $.log('\n请先设置 SMZDM_COOKIE 环境变量'); 701 | 702 | return; 703 | } 704 | 705 | let notifyContent = ''; 706 | 707 | for (let i = 0; i < cookies.length; i++) { 708 | const cookie = cookies[i]; 709 | 710 | if (!cookie) { 711 | continue; 712 | } 713 | 714 | if (i > 0) { 715 | $.log('\n延迟 5 秒执行\n'); 716 | await $.wait(5000); 717 | } 718 | 719 | const sep = `\n****** 账号${i + 1} ******\n`; 720 | 721 | $.log(sep); 722 | 723 | const bot = new SmzdmTaskBot(cookie); 724 | const msg = await bot.run(); 725 | 726 | notifyContent += `${sep}${msg}\n`; 727 | } 728 | 729 | await notify.sendNotify($.name, notifyContent); 730 | })().catch((e) => { 731 | $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') 732 | }).finally(() => { 733 | $.done(); 734 | }); 735 | -------------------------------------------------------------------------------- /UnValid/什么值得买抽奖.js: -------------------------------------------------------------------------------- 1 | /* 2 | 什么值得买抽奖脚本 3 | 项目地址: https://github.com/hex-ci/smzdm_script 4 | 5 | cron: 20 8 * * * 6 | */ 7 | 8 | const Env = require('./env'); 9 | const { SmzdmBot, requestApi, parseJSON, getEnvCookies } = require('./bot'); 10 | const notify = require('./sendNotify'); 11 | 12 | // ------------------------------------ 13 | 14 | const $ = new Env('什么值得买抽奖'); 15 | 16 | class SmzdmLotteryBot extends SmzdmBot { 17 | constructor(cookie) { 18 | super(cookie); 19 | } 20 | 21 | async run() { 22 | const activityId = await this.getActivityId(); 23 | 24 | if (!activityId) { 25 | return { 26 | isSuccess: false 27 | }; 28 | } 29 | 30 | const { isSuccess, data, response } = await requestApi('https://zhiyou.smzdm.com/user/lottery/jsonp_draw', { 31 | sign: false, 32 | parseJSON: false, 33 | headers: { 34 | ...this.getHeadersForWeb(), 35 | 'x-requested-with': 'com.smzdm.client.android', 36 | Referer: 'https://m.smzdm.com/' 37 | }, 38 | data: { 39 | active_id: activityId, 40 | callback: `jQuery34107538452897131465_${new Date().getTime()}` 41 | } 42 | }); 43 | 44 | if (isSuccess) { 45 | const match = data.match(/\((.*)\)/); 46 | 47 | if (match) { 48 | const result = parseJSON(match[1]); 49 | 50 | if (result.error_code == 0 || result.error_code == 1 || result.error_code == 4) { 51 | return result.error_msg; 52 | } 53 | else { 54 | $.log(`每日抽奖失败,接口响应异常:${response}`); 55 | 56 | return '每日抽奖失败,接口响应异常'; 57 | } 58 | } 59 | else { 60 | $.log(`每日抽奖失败,接口响应异常: ${response}`); 61 | 62 | return '每日抽奖失败,接口响应异常'; 63 | } 64 | } 65 | else { 66 | $.log(`每日抽奖失败,接口响应异常: ${response}`); 67 | 68 | return '每日抽奖失败,接口响应异常'; 69 | } 70 | } 71 | 72 | async getActivityId() { 73 | const { isSuccess, data, response } = await requestApi('https://m.smzdm.com/zhuanti/life/choujiang/', { 74 | sign: false, 75 | parseJSON: false, 76 | headers: this.getHeadersForWeb() 77 | }); 78 | 79 | if (isSuccess) { 80 | const match = data.match(/name\s?=\s?"lottery_activity_id"\s+value\s?=\s?"([a-zA-Z0-9]*)"/i); 81 | 82 | if (match) { 83 | $.log(`转盘抽奖ID: ${match[1]}`); 84 | 85 | return match[1]; 86 | } 87 | else { 88 | $.log(`未找到转盘抽奖ID`); 89 | 90 | return false; 91 | } 92 | } 93 | else { 94 | $.log(`获取转盘抽奖失败: ${response}`); 95 | 96 | return false; 97 | } 98 | } 99 | } 100 | 101 | !(async () => { 102 | const cookies = getEnvCookies(); 103 | 104 | if (cookies === false) { 105 | $.log('\n请先设置 SMZDM_COOKIE 环境变量'); 106 | 107 | return; 108 | } 109 | 110 | let notifyContent = ''; 111 | 112 | for (let i = 0; i < cookies.length; i++) { 113 | const cookie = cookies[i]; 114 | 115 | if (!cookie) { 116 | continue; 117 | } 118 | 119 | if (i > 0) { 120 | $.log('\n延迟 5 秒执行\n'); 121 | await $.wait(5000); 122 | } 123 | 124 | const sep = `\n****** 账号${i + 1} ******\n`; 125 | 126 | $.log(sep); 127 | 128 | const bot = new SmzdmLotteryBot(cookie); 129 | const msg = await bot.run(); 130 | 131 | $.log(msg + '\n'); 132 | 133 | notifyContent += sep + msg + '\n'; 134 | } 135 | 136 | await notify.sendNotify($.name, notifyContent); 137 | })().catch((e) => { 138 | $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') 139 | }).finally(() => { 140 | $.done(); 141 | }); 142 | -------------------------------------------------------------------------------- /UnValid/什么值得买签到.js: -------------------------------------------------------------------------------- 1 | /* 2 | 什么值得买签到脚本 3 | 项目地址: https://github.com/hex-ci/smzdm_script 4 | 5 | cron: 10 8 * * * 6 | */ 7 | 8 | const Env = require('./env'); 9 | const { SmzdmBot, requestApi, removeTags, getEnvCookies } = require('./bot'); 10 | const notify = require('./sendNotify'); 11 | 12 | // ------------------------------------ 13 | 14 | const $ = new Env('什么值得买签到'); 15 | 16 | class SmzdmCheckinBot extends SmzdmBot { 17 | constructor(cookie) { 18 | super(cookie); 19 | } 20 | 21 | async run() { 22 | const { msg } = await this.checkin(); 23 | 24 | await this.allReward(); 25 | 26 | await this.extraReward(); 27 | 28 | return msg; 29 | } 30 | 31 | async checkin() { 32 | const { isSuccess, data, response } = await requestApi('https://user-api.smzdm.com/checkin', { 33 | method: 'post', 34 | headers: this.getHeaders(), 35 | data: { 36 | touchstone_event: '', 37 | sk: '1', 38 | token: this.token, 39 | captcha: '' 40 | } 41 | }); 42 | 43 | if (isSuccess) { 44 | const msg = `⭐签到成功${data.data.daily_num}天 45 | 🏅金币: ${data.data.cgold} 46 | 🏅碎银: ${data.data.pre_re_silver} 47 | 🏅积分: ${data.data.cpoints} 48 | 🏅经验: ${data.data.cexperience} 49 | 🏅等级: ${data.data.rank} 50 | 🏅补签卡: ${data.data.cards}`; 51 | 52 | $.log(`${msg}\n`); 53 | 54 | return { 55 | isSuccess, 56 | msg 57 | }; 58 | } 59 | else { 60 | $.log(`签到失败!${response}`); 61 | 62 | return { 63 | isSuccess, 64 | msg: '签到失败!' 65 | }; 66 | } 67 | } 68 | 69 | async allReward() { 70 | const { isSuccess, data, response } = await requestApi('https://user-api.smzdm.com/checkin/all_reward', { 71 | method: 'post', 72 | headers: this.getHeaders() 73 | }); 74 | 75 | if (isSuccess) { 76 | $.log(`${data.data.normal_reward.reward_add.title}: ${data.data.normal_reward.reward_add.content}`); 77 | $.log(`${data.data.normal_reward.gift.title}: ${data.data.normal_reward.gift.content_str}\n`); 78 | } 79 | else { 80 | if (data.error_code != '4') { 81 | $.log(`查询奖励失败!${response}`); 82 | } 83 | } 84 | 85 | return { 86 | isSuccess 87 | }; 88 | } 89 | 90 | async extraReward() { 91 | const isContinue = await this.isContinueCheckin(); 92 | 93 | if (!isContinue) { 94 | $.log('今天没有额外奖励\n'); 95 | 96 | return false; 97 | } 98 | 99 | const { isSuccess, data, response } = await requestApi('https://user-api.smzdm.com/checkin/extra_reward', { 100 | method: 'post', 101 | headers: this.getHeaders() 102 | }); 103 | 104 | if (isSuccess) { 105 | $.log(`${data.data.title}: ${removeTags(data.data.gift.content)}`); 106 | 107 | return true; 108 | } 109 | else { 110 | $.log(`领取额外奖励失败!${response}`); 111 | 112 | return false; 113 | } 114 | } 115 | 116 | async isContinueCheckin() { 117 | const { isSuccess, data, response } = await requestApi('https://user-api.smzdm.com/checkin/show_view_v2', { 118 | method: 'post', 119 | headers: this.getHeaders() 120 | }); 121 | 122 | if (isSuccess) { 123 | const result = data.data.rows.find(item => item.cell_type == '18001'); 124 | 125 | return result.cell_data.checkin_continue.continue_checkin_reward_show; 126 | } 127 | else { 128 | $.log(`查询是否有额外奖励失败!${response}`); 129 | 130 | return false; 131 | } 132 | } 133 | } 134 | 135 | !(async () => { 136 | const cookies = getEnvCookies(); 137 | 138 | if (cookies === false) { 139 | $.log('\n请先设置 SMZDM_COOKIE 环境变量'); 140 | 141 | return; 142 | } 143 | 144 | let notifyContent = ''; 145 | 146 | for (let i = 0; i < cookies.length; i++) { 147 | const cookie = cookies[i]; 148 | 149 | if (!cookie) { 150 | continue; 151 | } 152 | 153 | if (i > 0) { 154 | $.log('\n延迟 5 秒执行\n'); 155 | await $.wait(5000); 156 | } 157 | 158 | const sep = `\n****** 账号${i + 1} ******\n`; 159 | 160 | $.log(sep); 161 | 162 | const bot = new SmzdmCheckinBot(cookie); 163 | const msg = await bot.run(); 164 | 165 | notifyContent += sep + msg + '\n'; 166 | } 167 | 168 | await notify.sendNotify($.name, notifyContent); 169 | })().catch((e) => { 170 | $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') 171 | }).finally(() => { 172 | $.done(); 173 | }); 174 | -------------------------------------------------------------------------------- /UnValid/众安健康小程序.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | 2022.7.8 4 | 5 | * 7-8 修改为Y 大佬代码 ,清自行修改变量 6 | 7 | 一天一次 8 | 微信小程序 众安健康 9 | 域名 https://ihealth.zhongan.com/ 10 | 手动抓hd里的Access-Token和下面任务里面域名https://ihealth.zhongan.com/api/lemon/v1/applet/mgm/activity/add/award里面的Cookie 11 | 青龙变量格式: export ZAJK_token = 'Access-Token&Cookie'多账号直接换行即可 12 | 13 | */ 14 | 15 | const $ = new Env("众安健康"); 16 | const notify = $.isNode() ? require("./sendNotify") : ""; 17 | const Notify = 0; //0为关闭通知,1为打开通知,默认为1 18 | const debug = 0; //0为关闭调试,1为打开调试,默认为0 19 | ////////////////////// 20 | 21 | let ckStr = ($.isNode() ? process.env.ZAJK_token : $.getdata(`ZAJK_token`)) || ''; 22 | 23 | let msg = ""; 24 | let ck = ""; 25 | let G = ' 修改为Y 大佬代码 ,清自行修改变量' 26 | ///////////////////////////////////////////////////////// 27 | console.log(`${G}\n`); 28 | msg += `${G}\n`; 29 | ///////////////////////////////////////////////////////// 30 | 31 | 32 | 33 | async function tips(ckArr) { 34 | console.log( 35 | `\n脚本执行 - 北京时间(UTC+8): ${new Date( 36 | new Date().getTime() + 37 | new Date().getTimezoneOffset() * 60 * 1000 + 38 | 8 * 60 * 60 * 1000 39 | ).toLocaleString()} \n` 40 | ); 41 | 42 | console.log( 43 | `\n=================== 共找到 ${ckArr.length} 个账号 ===================` 44 | ); 45 | debugLog(`【debug】 这是你的账号数组:\n ${ckArr}`); 46 | } 47 | 48 | !(async () => { 49 | if (typeof $request !== "undefined") { 50 | await GetRewrite() 51 | } else { 52 | let ckArr = await getCks(ckStr, "ZAJK_token"); 53 | 54 | await tips(ckArr); 55 | 56 | for (let index = 0; index < ckArr.length; index++) { 57 | let num = index + 1; 58 | console.log(`\n========= 开始【第 ${num} 个账号】=========\n`); 59 | // if (ckArr[index].match(/&/g)) { 60 | ck = ckArr[index].split("&"); 61 | await all(); 62 | // } 63 | 64 | debugLog(`【debug】 这是你第 ${num} 账号信息:\n ${ck}`); 65 | 66 | } 67 | 68 | 69 | } 70 | })() 71 | .catch((e) => $.logErr(e)) 72 | .finally(() => $.done()); 73 | 74 | 75 | async function all() { 76 | 77 | 78 | header = { 79 | "Host": "ihealth.zhongan.com", 80 | "Connection": "keep-alive", 81 | "Content-Length": "65", 82 | "Access-Token": `${ck[0]}`, 83 | "Content-Type": "application/json", 84 | "Accept": "application/json", 85 | "Accept-Encoding": "gzip,compress,br,deflate", 86 | "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.23(0x1800172f) NetType/WIFI Language/zh_CN", 87 | "Referer": "https://servicewechat.com/wxbac45cc1588a5a75/210/page-frame.html" 88 | } 89 | 90 | S = `众安健康签到` 91 | if (S == `众安健康签到`) { 92 | await task(`post`, `https://ihealth.zhongan.com/api/lemon/v1/common/activity/signIn`, header, `{"activityCode":"ONA20220411001","channelCode":"c20195660470001"}`) 93 | console.log(`众安健康签到`) 94 | console.log(DATA) 95 | DD = RT(6000, 8000) 96 | console.log(`等待${DD}`); 97 | await $.wait(DD) 98 | 99 | } 100 | 101 | S = `众安健康任务单1` 102 | if (S == `众安健康任务单1`) { 103 | await task(`post`, `https://ihealth.zhongan.com/api/lemon/v1/common/activity/homePage`, header, `{"activityCode":"ONA20220411001","channelCode":"c20195660470001"}`) 104 | 105 | S = `任务1` 106 | if (S == `任务1`) { 107 | let gid1 = Object.keys(DATA.result.productRecommend)[0] 108 | header1 = { 109 | "Host": "ihealth.zhongan.com", 110 | "Content-Type": "application/json", 111 | "Origin": "https://ihealth.zhongan.com", 112 | "Accept-Encoding": "gzip, deflate, br", 113 | "Cookie": `${ck[1]}`, 114 | "Connection": "keep-alive", 115 | "Accept": "application/json", 116 | "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.23(0x1800172f) NetType/WIFI Language/zh_CN miniProgram/wxbac45cc1588a5a75", 117 | "Referer": "https://ihealth.zhongan.com/insure/gt?channelCode=1000000004&channelSource=T202203150201070094&goodsCode=G202202070005&iseeTap=Y&sign=dCoB-REYo5yOkcTKT632WA&version=V1&taskId=110&activityCode=ONA20220411001&&xflow_d_t_wv%3D%7B%22uid%22%3A%221654134428126-3515802-03f7ac8d0e12ac-76902524%22%2C%22trace_id%22%3A%221657177070748-5547940-033ce4500c92e78-11730460%22%2C%22session_id%22%3A%221657177070748-6532276-0eafe6476c23d4-16508133%22%2C%22session_time%22%3A%222022-07-07%2014%3A57%3A50%22%2C%22open_id%22%3A%22oPE7_0OZ10J-bQad06GflOPhiGR0%22%2C%22union_id%22%3A%22oDE5puPykR1Ql7uOZWGx3lqnVx5I%22%7D", 118 | "Content-Length": "103", 119 | "Accept-Language": "zh-cn" 120 | } 121 | console.log(`开始任务${gid1}`) 122 | await task(`post`, `https://ihealth.zhongan.com/api/lemon/v1/applet/mgm/activity/add/award`, header1, `{"activityCode":"ONA20220411001","channelCode":"1000000004","goodsCode":"${gid1}","taskId":"110"}`) 123 | console.log(DATA) 124 | DD = RT(6000, 8000) 125 | console.log(`等待${DD}`); 126 | await $.wait(DD) 127 | } 128 | 129 | } 130 | S = `众安健康任务单2` 131 | if (S == `众安健康任务单2`) { 132 | await task(`post`, `https://ihealth.zhongan.com/api/lemon/v1/common/activity/homePage`, header, `{"activityCode":"ONA20220411001","channelCode":"c20195660470001"}`) 133 | S = `任务2` 134 | if (S == `任务2`) { 135 | let gid1 = Object.keys(DATA.result.productRecommend)[1] 136 | console.log(`开始任务${gid1}`) 137 | await task(`post`, `https://ihealth.zhongan.com/api/lemon/v1/applet/mgm/activity/add/award`, header1, `{"activityCode":"ONA20220411001","channelCode":"1000000004","goodsCode":"${gid1}","taskId":"110"}`) 138 | console.log(DATA) 139 | DD = RT(6000, 8000) 140 | console.log(`等待${DD}`); 141 | await $.wait(DD) 142 | } 143 | 144 | S = `众安健康任务单3` 145 | if (S == `众安健康任务单3`) { 146 | await task(`post`, `https://ihealth.zhongan.com/api/lemon/v1/common/activity/homePage`, header, `{"activityCode":"ONA20220411001","channelCode":"c20195660470001"}`) 147 | S = `任务3` 148 | if (S == `任务3`) { 149 | let gid1 = Object.keys(DATA.result.productRecommend)[2] 150 | console.log(`开始任务${gid1}`) 151 | await task(`post`, `https://ihealth.zhongan.com/api/lemon/v1/applet/mgm/activity/add/award`, header1, `{"activityCode":"ONA20220411001","channelCode":"1000000004","goodsCode":"${gid1}","taskId":"110"}`) 152 | console.log(DATA) 153 | DD = RT(6000, 8000) 154 | console.log(`等待${DD}`); 155 | await $.wait(DD) 156 | } 157 | } 158 | } 159 | S = `众安健康领取奖励` 160 | if (S == `众安健康领取奖励`) { 161 | await task(`post`, `https://ihealth.zhongan.com/api/lemon/v1/common/activity/homePage`, header, `{"activityCode":"ONA20220411001","channelCode":"c20195660470001"}`) 162 | let rw1 = DATA.result.valuableRewardList[0] 163 | if (rw1 != undefined) { 164 | taskarr = DATA.result.valuableRewardList 165 | for (let i = 0; i < taskarr.length; i++) { 166 | let idnum = taskarr[i].awardDetailId 167 | console.log(`开始任务${idnum}`) 168 | await task(`post`, `https://ihealth.zhongan.com/api/lemon/v1/common/activity/lottery`, header, `{"channelCode":"c20195660470001","activityCode":"ONA20220411001","id":${idnum}}`) 169 | console.log(DATA) 170 | } 171 | } 172 | } 173 | 174 | } 175 | 176 | 177 | 178 | 179 | //#region 固定代码 180 | // ============================================变量检查============================================ \\ 181 | 182 | async function getCks(ck, str) { 183 | return new Promise((resolve, reject) => { 184 | let ckArr = [] 185 | if (ck) { 186 | if (ck.indexOf("\n") != -1) { 187 | ck.split("\n").forEach((item) => { 188 | ckArr.push(item); 189 | }); 190 | } else { 191 | ckArr.push(ck); 192 | } 193 | resolve(ckArr) 194 | } else { 195 | console.log(`\n 【${$.name}】:未填写变量 ${str}`) 196 | } 197 | 198 | }) 199 | } 200 | 201 | async function GetRewrite() { //member/userInfo/getLoginInfoSpecial 202 | 203 | if ($request.url.indexOf("member") > -1 && $request.url.indexOf("userInfo") > -1 && $request.url.indexOf("getLoginInfoSpecial") > -1) { 204 | cks = $request.body 205 | const ck = cks.split(`"ticket":"`)[1].split(`"`)[0] 206 | 207 | if (ckStr) { 208 | if (ckStr.indexOf(ck) == -1) { 209 | ckStr = ckStr + '\n' + ck 210 | $.setdata(ckStr, 'ZAJK_token'); 211 | ckList = ckStr.split('\n') 212 | $.msg($.name + ` 获取第${ckList.length}个ck成功: ${ck}`) 213 | } 214 | } else { 215 | $.setdata(ck, 'ZAJK_token'); 216 | $.msg($.name + ` 获取第1个ck成功: ${ck}`) 217 | } 218 | } 219 | } 220 | 221 | // ============================================发送消息============================================ \\ 222 | 223 | async function SendMsg(message) { 224 | if (!message) return; 225 | 226 | if (Notify > 0) { 227 | if ($.isNode()) { 228 | var notify = require("./sendNotify"); 229 | await notify.sendNotify($.name, message); 230 | } else { 231 | $.msg(message); 232 | } 233 | } else { 234 | console.log(message); 235 | } 236 | 237 | } 238 | 239 | /** 240 | * 随机数生成 241 | */ 242 | 243 | function randomString(e) { 244 | e = e || 32; 245 | var t = "QWERTYUIOPASDFGHJKLZXCVBNM1234567890", 246 | a = t.length, 247 | n = ""; 248 | 249 | for (i = 0; i < e; i++) n += t.charAt(Math.floor(Math.random() * a)); 250 | return n; 251 | } 252 | 253 | /** 254 | * 随机整数生成 255 | */ 256 | 257 | function RT(X, Y) { 258 | do rt = Math.round(Math.random() * Y); 259 | while (rt < X) 260 | return rt; 261 | } 262 | 263 | //时间 264 | nowTimes = new Date( 265 | new Date().getTime() + 266 | new Date().getTimezoneOffset() * 60 * 1000 + 267 | 8 * 60 * 60 * 1000 268 | ); 269 | 270 | 271 | //当前日期年月日+时间 272 | //console.log('\n'+getCurrentDate()); 273 | function getCurrentDate() { 274 | var date = new Date(); 275 | var seperator1 = "-"; 276 | var seperator2 = ":"; 277 | var month = date.getMonth() + 1; 278 | var strDate = date.getDate(); 279 | if (month >= 1 && month <= 9) { 280 | month = "0" + month; 281 | } 282 | if (strDate >= 0 && strDate <= 9) { 283 | strDate = "0" + strDate; 284 | } 285 | var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate + 286 | " " + date.getHours() + seperator2 + date.getMinutes() + 287 | seperator2 + date.getSeconds(); 288 | return currentdate; 289 | 290 | 291 | } 292 | 293 | //当前10位时间戳 294 | function ts() { 295 | TS = Math.round((new Date().getTime() + 296 | new Date().getTimezoneOffset() * 60 * 1000 + 297 | 8 * 60 * 60 * 1000) / 1000).toString(); 298 | 299 | return TS; 300 | }; 301 | 302 | function tss() { 303 | TS = Math.round(new Date().getTime() + 304 | new Date().getTimezoneOffset() * 60 * 1000 + 305 | 8 * 60 * 60 * 1000).toString(); 306 | return TS; 307 | }; 308 | 309 | function task(method, taskurl, taskheader, taskbody) { 310 | return new Promise(async resolve => { 311 | let url = { 312 | url: taskurl, 313 | headers: taskheader, 314 | body: taskbody, 315 | timeout: 5000, 316 | } 317 | if (debug) { 318 | console.log( 319 | `\n 【debug】=============== 这是 ${S} 请求 url ===============` 320 | ); 321 | console.log(url); 322 | } 323 | 324 | $[method](url, (err, resp, data) => { 325 | try { 326 | if (debug) { 327 | console.log( 328 | `\n\n 【debug】===============这是 ${S} 返回data==============` 329 | ); 330 | console.log(data); 331 | console.log(`======`); 332 | console.log(JSON.parse(data)); 333 | } 334 | if (err) { 335 | console.log(`${JSON.stringify(err)}`) 336 | } else { 337 | if (data) { 338 | if (data.indexOf(``) >= 0) { 339 | DATA = data 340 | } else { 341 | DATA = JSON.parse(data); 342 | } 343 | } else { 344 | console.log(`服务器返回数据为空`) 345 | } 346 | } 347 | } catch (e) { 348 | $.logErr(e, resp) 349 | } finally { 350 | resolve(); 351 | } 352 | }, 353 | 354 | ) 355 | }) 356 | } 357 | function debugLog(...args) { 358 | if (debug) { 359 | console.log(...args); 360 | } 361 | } 362 | 363 | /** 364 | * 当前年月日 365 | */ 366 | function nyr() { 367 | let date = new Date(); 368 | Y = date.getFullYear() + '-'; 369 | M = date.getMonth() + 1 + '-'; 370 | D = date.getDate(); 371 | let nyr = Y + M + D; 372 | return nyr; 373 | } 374 | 375 | 376 | function rrr() { 377 | var d = new Date().getTime(); 378 | var uuid = 'xxxxxxxxxxxxyxxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function (c) { 379 | var r = (d + Math.random() * 16) % 16 | 0; 380 | d = Math.floor(d / 16); 381 | return (c == 'x' ? r : r & 0x3 | 0x8).toString(16); 382 | }); 383 | return uuid; 384 | }; 385 | 386 | 387 | 388 | function Env(t, e) { 389 | "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); 390 | class s { 391 | constructor(t) { 392 | this.env = t 393 | } 394 | send(t, e = "GET") { 395 | t = "string" == typeof t ? { 396 | url: t 397 | } : t; 398 | let s = this.get; 399 | return "POST" === e && (s = this.post), new Promise((e, i) => { 400 | s.call(this, t, (t, s, r) => { 401 | t ? i(t) : e(s) 402 | }) 403 | }) 404 | } 405 | get(t) { 406 | return this.send.call(this.env, t) 407 | } 408 | post(t) { 409 | return this.send.call(this.env, t, "POST") 410 | } 411 | } 412 | return new class { 413 | constructor(t, e) { 414 | this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) 415 | } 416 | isNode() { 417 | return "undefined" != typeof module && !!module.exports 418 | } 419 | isQuanX() { 420 | return "undefined" != typeof $task 421 | } 422 | isSurge() { 423 | return "undefined" != typeof $httpClient && "undefined" == typeof $loon 424 | } 425 | isLoon() { 426 | return "undefined" != typeof $loon 427 | } 428 | toObj(t, e = null) { 429 | try { 430 | return JSON.parse(t) 431 | } catch { 432 | return e 433 | } 434 | } 435 | toStr(t, e = null) { 436 | try { 437 | return JSON.stringify(t) 438 | } catch { 439 | return e 440 | } 441 | } 442 | getjson(t, e) { 443 | let s = e; 444 | const i = this.getdata(t); 445 | if (i) try { 446 | s = JSON.parse(this.getdata(t)) 447 | } catch { } 448 | return s 449 | } 450 | setjson(t, e) { 451 | try { 452 | return this.setdata(JSON.stringify(t), e) 453 | } catch { 454 | return !1 455 | } 456 | } 457 | getScript(t) { 458 | return new Promise(e => { 459 | this.get({ 460 | url: t 461 | }, (t, s, i) => e(i)) 462 | }) 463 | } 464 | runScript(t, e) { 465 | return new Promise(s => { 466 | let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); 467 | i = i ? i.replace(/\n/g, "").trim() : i; 468 | let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); 469 | r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; 470 | const [o, h] = i.split("@"), n = { 471 | url: `http://${h}/v1/scripting/evaluate`, 472 | body: { 473 | script_text: t, 474 | mock_type: "cron", 475 | timeout: r 476 | }, 477 | headers: { 478 | "X-Key": o, 479 | Accept: "*/*" 480 | } 481 | }; 482 | this.post(n, (t, e, i) => s(i)) 483 | }).catch(t => this.logErr(t)) 484 | } 485 | loaddata() { 486 | if (!this.isNode()) return {}; { 487 | this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); 488 | const t = this.path.resolve(this.dataFile), 489 | e = this.path.resolve(process.cwd(), this.dataFile), 490 | s = this.fs.existsSync(t), 491 | i = !s && this.fs.existsSync(e); 492 | if (!s && !i) return {}; { 493 | const i = s ? t : e; 494 | try { 495 | return JSON.parse(this.fs.readFileSync(i)) 496 | } catch (t) { 497 | return {} 498 | } 499 | } 500 | } 501 | } 502 | writedata() { 503 | if (this.isNode()) { 504 | this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); 505 | const t = this.path.resolve(this.dataFile), 506 | e = this.path.resolve(process.cwd(), this.dataFile), 507 | s = this.fs.existsSync(t), 508 | i = !s && this.fs.existsSync(e), 509 | r = JSON.stringify(this.data); 510 | s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) 511 | } 512 | } 513 | lodash_get(t, e, s) { 514 | const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); 515 | let r = t; 516 | for (const t of i) 517 | if (r = Object(r)[t], void 0 === r) return s; 518 | return r 519 | } 520 | lodash_set(t, e, s) { 521 | return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) 522 | } 523 | getdata(t) { 524 | let e = this.getval(t); 525 | if (/^@/.test(t)) { 526 | const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; 527 | if (r) try { 528 | const t = JSON.parse(r); 529 | e = t ? this.lodash_get(t, i, "") : e 530 | } catch (t) { 531 | e = "" 532 | } 533 | } 534 | return e 535 | } 536 | setdata(t, e) { 537 | let s = !1; 538 | if (/^@/.test(e)) { 539 | const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; 540 | try { 541 | const e = JSON.parse(h); 542 | this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) 543 | } catch (e) { 544 | const o = {}; 545 | this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) 546 | } 547 | } else s = this.setval(t, e); 548 | return s 549 | } 550 | getval(t) { 551 | return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null 552 | } 553 | setval(t, e) { 554 | return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null 555 | } 556 | initGotEnv(t) { 557 | this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) 558 | } 559 | get(t, e = (() => { })) { 560 | t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { 561 | "X-Surge-Skip-Scripting": !1 562 | })), $httpClient.get(t, (t, s, i) => { 563 | !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) 564 | })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { 565 | hints: !1 566 | })), $task.fetch(t).then(t => { 567 | const { 568 | statusCode: s, 569 | statusCode: i, 570 | headers: r, 571 | body: o 572 | } = t; 573 | e(null, { 574 | status: s, 575 | statusCode: i, 576 | headers: r, 577 | body: o 578 | }, o) 579 | }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { 580 | try { 581 | if (t.headers["set-cookie"]) { 582 | const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); 583 | s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar 584 | } 585 | } catch (t) { 586 | this.logErr(t) 587 | } 588 | }).then(t => { 589 | const { 590 | statusCode: s, 591 | statusCode: i, 592 | headers: r, 593 | body: o 594 | } = t; 595 | e(null, { 596 | status: s, 597 | statusCode: i, 598 | headers: r, 599 | body: o 600 | }, o) 601 | }, t => { 602 | const { 603 | message: s, 604 | response: i 605 | } = t; 606 | e(s, i, i && i.body) 607 | })) 608 | } 609 | post(t, e = (() => { })) { 610 | if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { 611 | "X-Surge-Skip-Scripting": !1 612 | })), $httpClient.post(t, (t, s, i) => { 613 | !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) 614 | }); 615 | else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { 616 | hints: !1 617 | })), $task.fetch(t).then(t => { 618 | const { 619 | statusCode: s, 620 | statusCode: i, 621 | headers: r, 622 | body: o 623 | } = t; 624 | e(null, { 625 | status: s, 626 | statusCode: i, 627 | headers: r, 628 | body: o 629 | }, o) 630 | }, t => e(t)); 631 | else if (this.isNode()) { 632 | this.initGotEnv(t); 633 | const { 634 | url: s, 635 | ...i 636 | } = t; 637 | this.got.post(s, i).then(t => { 638 | const { 639 | statusCode: s, 640 | statusCode: i, 641 | headers: r, 642 | body: o 643 | } = t; 644 | e(null, { 645 | status: s, 646 | statusCode: i, 647 | headers: r, 648 | body: o 649 | }, o) 650 | }, t => { 651 | const { 652 | message: s, 653 | response: i 654 | } = t; 655 | e(s, i, i && i.body) 656 | }) 657 | } 658 | } 659 | time(t, e = null) { 660 | const s = e ? new Date(e) : new Date; 661 | let i = { 662 | "M+": s.getMonth() + 1, 663 | "d+": s.getDate(), 664 | "H+": s.getHours(), 665 | "m+": s.getMinutes(), 666 | "s+": s.getSeconds(), 667 | "q+": Math.floor((s.getMonth() + 3) / 3), 668 | S: s.getMilliseconds() 669 | }; 670 | /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length))); 671 | for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length))); 672 | return t 673 | } 674 | msg(e = t, s = "", i = "", r) { 675 | const o = t => { 676 | if (!t) return t; 677 | if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { 678 | "open-url": t 679 | } : this.isSurge() ? { 680 | url: t 681 | } : void 0; 682 | if ("object" == typeof t) { 683 | if (this.isLoon()) { 684 | let e = t.openUrl || t.url || t["open-url"], 685 | s = t.mediaUrl || t["media-url"]; 686 | return { 687 | openUrl: e, 688 | mediaUrl: s 689 | } 690 | } 691 | if (this.isQuanX()) { 692 | let e = t["open-url"] || t.url || t.openUrl, 693 | s = t["media-url"] || t.mediaUrl; 694 | return { 695 | "open-url": e, 696 | "media-url": s 697 | } 698 | } 699 | if (this.isSurge()) { 700 | let e = t.url || t.openUrl || t["open-url"]; 701 | return { 702 | url: e 703 | } 704 | } 705 | } 706 | }; 707 | if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) { 708 | let t = ["", "==============📣系统通知📣=============="]; 709 | t.push(e), s && t.push(s), i && t.push(i), console.log(t.join("\n")), this.logs = this.logs.concat(t) 710 | } 711 | } 712 | log(...t) { 713 | t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) 714 | } 715 | logErr(t, e) { 716 | const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); 717 | s ? this.log("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t) 718 | } 719 | wait(t) { 720 | return new Promise(e => setTimeout(e, t)) 721 | } 722 | done(t = {}) { 723 | const e = (new Date).getTime(), 724 | s = (e - this.startTime) / 1e3; 725 | this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) 726 | } 727 | }(t, e) 728 | } 729 | -------------------------------------------------------------------------------- /UnValid/广汽传祺-微信小程序.js: -------------------------------------------------------------------------------- 1 | /* 2 | 广汽传祺-微信小程序 3 | 4 | 捉包这个域名: mall.gacmotor.com 5 | 登录微信小程序后,捉header里的token,填到gqcqWxCookie里,多账号换行或@或&隔开 6 | 7 | 定时每天一次 8 | cron: 33 9 * * * 9 | */ 10 | const $ = new Env("广汽传祺-微信小程序"); 11 | 12 | const envSplitor = ['\n','@','&'] 13 | const ckName = 'gqcqWxCookie' 14 | let userCookie = ($.isNode() ? process.env[ckName] : $.getdata(ckName)) || ''; 15 | 16 | let userList = [] 17 | let userIdx = 0 18 | let userCount = 0 19 | 20 | const ver = '3.1.2' 21 | const defaultContentType = 'application/json' 22 | const defaultUA = 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.28(0x18001c2c) NetType/WIFI Language/zh_CN' 23 | const Referer = 'https://servicewechat.com/wx86a1eb5a53a6973b/210/page-frame.html' 24 | /////////////////////////////////////////////////////////////////// 25 | class UserInfo { 26 | constructor(str) { 27 | this.index = ++userIdx 28 | this.name = this.index 29 | this.valid = false 30 | 31 | this.token = str 32 | } 33 | 34 | async taskApi(paramIn={}) { 35 | let paramOut = {} 36 | try { 37 | let host = paramIn.url.replace('//','/').split('/')[1] 38 | let url = paramIn.url 39 | if(paramIn.queryParam) url += '?' + $.json2str(paramIn.queryParam,'&',true) 40 | let urlObject = { 41 | url: url, 42 | headers: { 43 | 'Host': host, 44 | 'Connection': 'keep-alive', 45 | 'token': this.token, 46 | 'User-Agent': defaultUA, 47 | 'Referer': Referer, 48 | 'version': ver, 49 | }, 50 | timeout: 5000, 51 | } 52 | if(paramIn.body) { 53 | urlObject.headers['Content-Type'] = paramIn['Content-Type'] || defaultContentType 54 | if(typeof paramIn.body === 'object') { 55 | if(urlObject.headers['Content-Type'].includes('json')) { 56 | urlObject.body = JSON.stringify(paramIn.body) 57 | } else { 58 | for(let key in paramIn.body) { 59 | if(typeof paramIn.body[key] === 'object') { 60 | paramIn.body[key] = JSON.stringify(paramIn.body[key]) 61 | } 62 | } 63 | urlObject.body = $.json2str(paramIn.body,'&') 64 | } 65 | } else { 66 | urlObject.body = paramIn.body 67 | } 68 | if($.isNode()) { 69 | urlObject.headers['Content-Length'] = urlObject.body ? Buffer.byteLength(urlObject.body, 'utf8') : 0 70 | } else { 71 | urlObject.headers['Content-Length'] = urlObject.body ? urlObject.body.length : 0 72 | } 73 | } 74 | if(paramIn.urlObjectParam) Object.assign(urlObject,paramIn.urlObjectParam); 75 | if(paramIn.headerParam) Object.assign(urlObject.headers,paramIn.headerParam); 76 | //console.log(urlObject); 77 | paramOut = Object.assign({},await httpRequest(paramIn.method,urlObject)) 78 | paramOut.statusCode = paramOut?.err?.response?.statusCode || paramOut?.resp?.statusCode 79 | if(paramOut.statusCode != 200) { 80 | console.log(`[${paramIn.fn}]返回[${paramOut.statusCode}]`) 81 | } 82 | if(paramOut?.resp?.body) { 83 | if(typeof paramOut.resp.body === 'object') { 84 | paramOut.result = paramOut.resp.body 85 | } else { 86 | try { 87 | paramOut.result = JSON.parse(paramOut.resp.body) 88 | } catch (e) { 89 | //console.log(`[${paramIn.fn}]没有返回json数据`) 90 | paramOut.result = paramOut.resp.body 91 | } 92 | } 93 | } 94 | } catch(e) { 95 | console.log(e) 96 | } finally { 97 | return Promise.resolve(paramOut); 98 | } 99 | } 100 | 101 | async checkLoginSendGdou() { 102 | let paramOut = {} 103 | try { 104 | let urlParam = { 105 | fn: 'checkLoginSendGdou', 106 | method: 'post', 107 | url: `https://mall.gacmotor.com/center-current-app/fronted/myHomePage/checkLoginSendGdou`, 108 | body: {} 109 | } 110 | paramOut = Object.assign({},await this.taskApi(urlParam)) 111 | let result = paramOut.result 112 | //console.log(result) 113 | if(result.success==true) { 114 | if(result.data.flag) { 115 | $.logAndNotify(`[${this.name}]登录成功,获得${result.data.gdouNum}金币`) 116 | } else { 117 | $.logAndNotify(`[${this.name}]今日已经领取过登录奖励`) 118 | } 119 | } else { 120 | $.logAndNotify(`[${this.name}]小程序登录失败: ${result.msg}`) 121 | } 122 | } catch(e) { 123 | console.log(e) 124 | } finally { 125 | return Promise.resolve(paramOut); 126 | } 127 | } 128 | } 129 | 130 | !(async () => { 131 | if (typeof $request !== "undefined") { 132 | await GetRewrite() 133 | }else { 134 | //if(!(await isValidCode())) return; 135 | //await getTaskUrl(); 136 | if(!checkEnv()) return; 137 | 138 | for(let user of userList) { 139 | await user.checkLoginSendGdou(); 140 | } 141 | } 142 | })() 143 | .catch((e) => console.log(e)) 144 | .finally(() => $.done()) 145 | 146 | /////////////////////////////////////////////////////////////////// 147 | async function GetRewrite() { 148 | } 149 | 150 | function checkEnv() { 151 | if(userCookie) { 152 | let splitor = envSplitor[0]; 153 | for(let sp of envSplitor) { 154 | if(userCookie.indexOf(sp) > -1) { 155 | splitor = sp; 156 | break; 157 | } 158 | } 159 | for(let userCookies of userCookie.split(splitor)) { 160 | if(userCookies) userList.push(new UserInfo(userCookies)) 161 | } 162 | userCount = userList.length 163 | } else { 164 | console.log(`未找到CK: ${ckName}`) 165 | return false; 166 | } 167 | 168 | console.log(`共找到${userCount}个账号`) 169 | return true 170 | } 171 | 172 | async function isValidCode(retry=0) { 173 | let flag = false 174 | try { 175 | let urlObject = { 176 | url: codeUrl, 177 | timeout: 5000, 178 | } 179 | let result = null 180 | let paramOut = await httpRequest('get',urlObject) 181 | //console.log(paramOut) 182 | if(paramOut.err) { 183 | console.log(`服务器错误[${paramOut?.resp?.statusCode}],重试...`) 184 | } else { 185 | try { 186 | result = JSON.parse(paramOut.resp.body) 187 | result = JSON.parse(result.data.file.data) 188 | } catch (e) { 189 | console.log(e) 190 | } 191 | } 192 | 193 | if(!result) { 194 | if(retry < NUM_MAX_RETRY) { 195 | let waittime = Math.floor(Math.random()*WAIT_TIME_RANDOM) + WAIT_TIME_BASE 196 | flag = await isValidCode(++retry) 197 | } 198 | } else { 199 | if(result?.commonNotify && result.commonNotify.length > 0) { 200 | $.logAndNotify(result.commonNotify.join('\n')+'\n',false) 201 | } 202 | 203 | if(result?.commonMsg && result.commonMsg.length > 0) { 204 | console.log(result.commonMsg.join('\n')+'\n') 205 | } 206 | 207 | if(result[codeName]) { 208 | let codeResult = result[codeName] 209 | if(codeResult.status == 0) { 210 | if(version >= codeResult.version) { 211 | flag = true 212 | console.log(codeResult.msg[codeResult.status]) 213 | console.log(codeResult.updateMsg) 214 | console.log(`现在运行的脚本版本是:${version},最新脚本版本:${codeResult.latestVersion}`) 215 | } else { 216 | console.log(codeResult.versionMsg) 217 | } 218 | } else { 219 | console.log(codeResult.msg[codeResult.status]) 220 | } 221 | } else { 222 | console.log(result.errorMsg) 223 | } 224 | } 225 | } catch (e) { 226 | console.log(e) 227 | } finally { 228 | return Promise.resolve(flag) 229 | } 230 | } 231 | 232 | async function getTaskUrl(retry=0) { 233 | let flag = false 234 | try { 235 | let urlObject = { 236 | url: taskUrl, 237 | timeout: 5000, 238 | } 239 | let result = null 240 | let paramOut = await httpRequest('get',urlObject) 241 | //console.log(paramOut) 242 | if(paramOut.err) { 243 | console.log(`服务器错误[${paramOut?.resp?.statusCode}],重试...`) 244 | } else { 245 | try { 246 | result = JSON.parse(paramOut.resp.body) 247 | result = JSON.parse(result.data.file.data) 248 | } catch (e) { 249 | console.log(e) 250 | } 251 | } 252 | 253 | if(!result) { 254 | if(retry < NUM_MAX_RETRY) { 255 | let waittime = Math.floor(Math.random()*WAIT_TIME_RANDOM) + WAIT_TIME_BASE 256 | flag = await isValidCode(++retry) 257 | } 258 | } else { 259 | // 260 | } 261 | } catch (e) { 262 | console.log(e) 263 | } finally { 264 | return Promise.resolve(flag) 265 | } 266 | 267 | return; 268 | } 269 | //////////////////////////////////////////////////////////////////// 270 | async function httpRequest(method,url) { 271 | return new Promise((resolve) => { 272 | $.send(method, url, async (err, req, resp) => { 273 | resolve({err,req,resp}) 274 | }) 275 | }); 276 | } 277 | //////////////////////////////////////////////////////////////////// 278 | //MD5 279 | function MD5Encrypt(a){function b(a,b){return a<>>32-b}function c(a,b){var c,d,e,f,g;return e=2147483648&a,f=2147483648&b,c=1073741824&a,d=1073741824&b,g=(1073741823&a)+(1073741823&b),c&d?2147483648^g^e^f:c|d?1073741824&g?3221225472^g^e^f:1073741824^g^e^f:g^e^f}function d(a,b,c){return a&b|~a&c}function e(a,b,c){return a&c|b&~c}function f(a,b,c){return a^b^c}function g(a,b,c){return b^(a|~c)}function h(a,e,f,g,h,i,j){return a=c(a,c(c(d(e,f,g),h),j)),c(b(a,i),e)}function i(a,d,f,g,h,i,j){return a=c(a,c(c(e(d,f,g),h),j)),c(b(a,i),d)}function j(a,d,e,g,h,i,j){return a=c(a,c(c(f(d,e,g),h),j)),c(b(a,i),d)}function k(a,d,e,f,h,i,j){return a=c(a,c(c(g(d,e,f),h),j)),c(b(a,i),d)}function l(a){for(var b,c=a.length,d=c+8,e=(d-d%64)/64,f=16*(e+1),g=new Array(f-1),h=0,i=0;c>i;)b=(i-i%4)/4,h=i%4*8,g[b]=g[b]|a.charCodeAt(i)<>>29,g}function m(a){var b,c,d="",e="";for(c=0;3>=c;c++)b=a>>>8*c&255,e="0"+b.toString(16),d+=e.substr(e.length-2,2);return d}function n(a){a=a.replace(/\r\n/g,"\n");for(var b="",c=0;cd?b+=String.fromCharCode(d):d>127&&2048>d?(b+=String.fromCharCode(d>>6|192),b+=String.fromCharCode(63&d|128)):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128),b+=String.fromCharCode(63&d|128))}return b}var o,p,q,r,s,t,u,v,w,x=[],y=7,z=12,A=17,B=22,C=5,D=9,E=14,F=20,G=4,H=11,I=16,J=23,K=6,L=10,M=15,N=21;for(a=n(a),x=l(a),t=1732584193,u=4023233417,v=2562383102,w=271733878,o=0;o -1 && process.exit(0); 283 | return new class { 284 | constructor(name,env) { 285 | this.name = name 286 | this.notifyStr = '' 287 | this.notifyFlag = false 288 | this.startTime = (new Date).getTime() 289 | Object.assign(this,env) 290 | console.log(`${this.name} 开始运行:\n`) 291 | } 292 | isNode() { 293 | return "undefined" != typeof module && !!module.exports 294 | } 295 | isQuanX() { 296 | return "undefined" != typeof $task 297 | } 298 | isSurge() { 299 | return "undefined" != typeof $httpClient && "undefined" == typeof $loon 300 | } 301 | isLoon() { 302 | return "undefined" != typeof $loon 303 | } 304 | getdata(t) { 305 | let e = this.getval(t); 306 | if (/^@/.test(t)) { 307 | const[, s, i] = /^@(.*?)\.(.*?)$/.exec(t), 308 | r = s ? this.getval(s) : ""; 309 | if (r) 310 | try { 311 | const t = JSON.parse(r); 312 | e = t ? this.lodash_get(t, i, "") : e 313 | } catch (t) { 314 | e = "" 315 | } 316 | } 317 | return e 318 | } 319 | setdata(t, e) { 320 | let s = !1; 321 | if (/^@/.test(e)) { 322 | const[, i, r] = /^@(.*?)\.(.*?)$/.exec(e), 323 | o = this.getval(i), 324 | h = i ? "null" === o ? null : o || "{}" : "{}"; 325 | try { 326 | const e = JSON.parse(h); 327 | this.lodash_set(e, r, t), 328 | s = this.setval(JSON.stringify(e), i) 329 | } catch (e) { 330 | const o = {}; 331 | this.lodash_set(o, r, t), 332 | s = this.setval(JSON.stringify(o), i) 333 | } 334 | } 335 | else { 336 | s = this.setval(t, e); 337 | } 338 | return s 339 | } 340 | getval(t) { 341 | return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null 342 | } 343 | setval(t, e) { 344 | return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null 345 | } 346 | send(m, t, e = (() => {})) { 347 | if(m != 'get' && m != 'post' && m != 'put' && m != 'delete') { 348 | console.log(`无效的http方法:${m}`); 349 | return; 350 | } 351 | if(m == 'get' && t.headers) { 352 | delete t.headers["Content-Type"]; 353 | delete t.headers["Content-Length"]; 354 | } else if(t.body && t.headers) { 355 | if(!t.headers["Content-Type"]) t.headers["Content-Type"] = "application/x-www-form-urlencoded"; 356 | } 357 | if(this.isSurge() || this.isLoon()) { 358 | if(this.isSurge() && this.isNeedRewrite) { 359 | t.headers = t.headers || {}; 360 | Object.assign(t.headers, {"X-Surge-Skip-Scripting": !1}); 361 | } 362 | let conf = { 363 | method: m, 364 | url: t.url, 365 | headers: t.headers, 366 | timeout: t.timeout, 367 | data: t.body 368 | }; 369 | if(m == 'get') delete conf.data 370 | $axios(conf).then(t => { 371 | const { 372 | status: i, 373 | request: q, 374 | headers: r, 375 | data: o 376 | } = t; 377 | e(null, q, { 378 | statusCode: i, 379 | headers: r, 380 | body: o 381 | }); 382 | }).catch(err => console.log(err)) 383 | } else if (this.isQuanX()) { 384 | t.method = m.toUpperCase(), this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { 385 | hints: !1 386 | })), 387 | $task.fetch(t).then(t => { 388 | const { 389 | statusCode: i, 390 | request: q, 391 | headers: r, 392 | body: o 393 | } = t; 394 | e(null, q, { 395 | statusCode: i, 396 | headers: r, 397 | body: o 398 | }) 399 | }, t => e(t)) 400 | } else if (this.isNode()) { 401 | this.got = this.got ? this.got : require("got"); 402 | const { 403 | url: s, 404 | ...i 405 | } = t; 406 | this.instance = this.got.extend({ 407 | followRedirect: false 408 | }); 409 | this.instance[m](s, i).then(t => { 410 | const { 411 | statusCode: i, 412 | request: q, 413 | headers: r, 414 | body: o 415 | } = t; 416 | e(null, q, { 417 | statusCode: i, 418 | headers: r, 419 | body: o 420 | }) 421 | }, t => { 422 | const { 423 | message: s, 424 | request: q, 425 | response: i 426 | } = t; 427 | e(s, q, i) 428 | }) 429 | } 430 | } 431 | time(t,x=null) { 432 | let xt = x ? new Date(x) : new Date 433 | let e = { 434 | "M+": xt.getMonth() + 1, 435 | "d+": xt.getDate(), 436 | "h+": xt.getHours(), 437 | "m+": xt.getMinutes(), 438 | "s+": xt.getSeconds(), 439 | "q+": Math.floor((xt.getMonth() + 3) / 3), 440 | S: this.padStr(xt.getMilliseconds(),3) 441 | }; 442 | /(y+)/.test(t) && (t = t.replace(RegExp.$1, (xt.getFullYear() + "").substr(4 - RegExp.$1.length))); 443 | for (let s in e) 444 | new RegExp("(" + s + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? e[s] : ("00" + e[s]).substr(("" + e[s]).length))); 445 | return t 446 | } 447 | async showmsg() { 448 | if(!this.notifyFlag) return; 449 | if(!this.notifyStr) return; 450 | let notifyBody = this.name + " 运行通知\n\n" + this.notifyStr 451 | if($.isNode()){ 452 | var notify = require('./sendNotify'); 453 | console.log('\n============== 推送 ==============') 454 | await notify.sendNotify(this.name, notifyBody); 455 | } else { 456 | this.msg(notifyBody); 457 | } 458 | } 459 | logAndNotify(str,flag=true) { 460 | if(flag) this.notifyFlag = true 461 | console.log(str) 462 | this.notifyStr += str 463 | this.notifyStr += '\n' 464 | } 465 | logAndNotifyWithTime(str,flag=true) { 466 | if(flag) this.notifyFlag = true 467 | let t = '['+this.time('hh:mm:ss.S')+']'+str 468 | console.log(t) 469 | this.notifyStr += t 470 | this.notifyStr += '\n' 471 | } 472 | logWithTime(str) { 473 | console.log('['+this.time('hh:mm:ss.S')+']'+str) 474 | } 475 | msg(e = t, s = "", i = "", r) { 476 | const o = t => { 477 | if (!t) 478 | return t; 479 | if ("string" == typeof t) 480 | return this.isLoon() ? t : this.isQuanX() ? { 481 | "open-url": t 482 | } 483 | : this.isSurge() ? { 484 | url: t 485 | } 486 | : void 0; 487 | if ("object" == typeof t) { 488 | if (this.isLoon()) { 489 | let e = t.openUrl || t.url || t["open-url"], 490 | s = t.mediaUrl || t["media-url"]; 491 | return { 492 | openUrl: e, 493 | mediaUrl: s 494 | } 495 | } 496 | if (this.isQuanX()) { 497 | let e = t["open-url"] || t.url || t.openUrl, 498 | s = t["media-url"] || t.mediaUrl; 499 | return { 500 | "open-url": e, 501 | "media-url": s 502 | } 503 | } 504 | if (this.isSurge()) { 505 | let e = t.url || t.openUrl || t["open-url"]; 506 | return { 507 | url: e 508 | } 509 | } 510 | } 511 | }; 512 | this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))); 513 | let h = ["", "============== 系统通知 =============="]; 514 | h.push(e), 515 | s && h.push(s), 516 | i && h.push(i), 517 | console.log(h.join("\n")) 518 | } 519 | getMin(a,b){ 520 | return ((anumStr.length) ? (length-numStr.length) : 0 528 | let retStr = '' 529 | for(let i=0; i setTimeout(e, t)) 583 | } 584 | async done(t = {}) { 585 | await this.showmsg(); 586 | const e = (new Date).getTime(), 587 | s = (e - this.startTime) / 1e3; 588 | console.log(`\n${this.name} 运行结束,共运行了 ${s} 秒!`) 589 | if(this.isSurge() || this.isQuanX() || this.isLoon()) $done(t) 590 | } 591 | }(name,env) 592 | } 593 | -------------------------------------------------------------------------------- /UnValid/广汽传祺.js: -------------------------------------------------------------------------------- 1 | /* 2 | 广汽传祺 app cron 22 8,12 * * * gqcq.js 3 | 4 | 4-13 完成签到 抽奖 分享 发帖 评论 任务 有bug及时反馈 5 | 4-14 修复已知bug 恢复正常使用 6 | 5-21 更新通知,优化代码 7 | 6-10 更新模板,修改部分逻辑! 8 | 9-12 修复抽奖,增加签到宝箱开启 9 | 9-21 增加用户信息输出 10 | 9-22 修复开宝箱错误 11 | 9-28 修复删除帖子错误 12 | 9-29 增加了快递信息查询,不用来回看了 13 | 10-10 感谢 banxiaya 大佬修复 14 | 12.14 查询增加手机号 15 | 23/1/3 更换模版 16 | 17 | ------------------- 青龙-配置文件-复制区域 ------------------- 18 | # 广汽传祺 19 | export gqcq=" token @ token " 20 | 21 | 抓 gsp.gacmotor.com 的 token 22 | 23 | 多账号用 换行 或 @ 分割 24 | tg频道: https://t.me/yml2213_tg 25 | */ 26 | const $ = Env('广汽传祺') 27 | const { MD5 } = require('crypto-js') 28 | const notify = require('./sendNotify') 29 | 30 | const envSplitor = ['\n', '&', '@'] //支持多种分割,但要保证变量里不存在这个字符 31 | const ckNames = ['gqcq'] //支持多变量 32 | //==================================================================================================== 33 | let DEFAULT_RETRY = 2 // 默认重试次数 34 | //==================================================================================================== 35 | 36 | 37 | async function userTasks() { 38 | 39 | $.log('用户信息', { sp: true, console: false }) // 带分割的打印 40 | list = [] 41 | for (let user of $.userList) { 42 | list.push(user.userInfo()) 43 | } await Promise.all(list) 44 | 45 | $.log('任务列表', { sp: true, console: false }) 46 | list = [] 47 | // console.log(user.ckFlog) 48 | for (let user of $.userList) { 49 | if (user.ckFlog) { 50 | list.push(user.taskList()) 51 | list.push(user.boxList()) 52 | } 53 | } await Promise.all(list) 54 | 55 | $.log('积分查询', { sp: true, console: false }) 56 | list = [] 57 | for (let user of $.userList) { 58 | if (user.ckFlog) { 59 | list.push(user.points()) 60 | } 61 | } await Promise.all(list) 62 | 63 | 64 | } 65 | 66 | 67 | 68 | class UserClass { 69 | constructor(ck) { 70 | this.idx = `账号[${++$.userIdx}]` 71 | this.ckFlog = true 72 | this.token = ck 73 | this.ts = $.ts(13) 74 | this.reqNonc = $.randomInt(100000, 999999) 75 | 76 | this.cq_headers = { 77 | 'token': this.token, 78 | 'reqTs': this.ts, 79 | 'reqSign': this.getSign(this.ts, this.reqNonc), 80 | 'reqNonc': this.reqNonc, 81 | 'channel': 'unknown', 82 | 'platformNo': 'Android', 83 | 'osVersion': '10', 84 | 'version': '3.8.0', 85 | 'imei': 'a4dad7a1b1f865bc', 86 | 'imsi': 'unknown', 87 | 'deviceModel': 'MI 8', 88 | 'deviceType': 'Android', 89 | 'registrationID': '100d855909bb3584777', 90 | 'verification': 'signature', 91 | 'Host': 'gsp.gacmotor.com', 92 | 'User-Agent': 'okhttp/3.10.0', 93 | } 94 | this.cq_headers2 = { 95 | "token": this.token, 96 | "Host": "gsp.gacmotor.com", 97 | "Origin": "https://gsp.gacmotor.com", 98 | "Accept": "application/json, text/plain, */*", 99 | "Cache-Control": "no-cache", 100 | "Sec-Fetch-Dest": "empty", 101 | "X-Requested-With": "com.cloudy.component", 102 | "Sec-Fetch-Site": "same-origin", 103 | "Sec-Fetch-Mode": "cors", 104 | "Referer": "https://gsp.gacmotor.com/h5/html/draw/index.html", 105 | "Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7", 106 | "Content-Type": "application/x-www-form-urlencoded", 107 | } 108 | } 109 | 110 | 111 | 112 | async userInfo() { 113 | let options = { 114 | fn: 'userInfo', 115 | method: 'get', 116 | url: 'https://gsp.gacmotor.com/gateway/webapi/account/getUserInfoV2', 117 | headers: this.cq_headers, 118 | } 119 | // console.log(options) 120 | let resp = await $.request(options) 121 | // console.log(resp) 122 | if (resp.errorCode == 200) { 123 | $.log(`${this.idx}: 欢迎用户: ${resp.data.nickname}, 手机号:${$.phoneNum(resp.data.mobile)}`) 124 | this.nickname = resp.data.nickname 125 | this.ckFlog = true 126 | } else if (resp.errorCode == 40100) { 127 | $.log(`${this.idx}: ${resp.errorMessage}`, { notify: true }) 128 | this.ckFlog = false 129 | } else console.log(`${options.fn}: 失败, ${resp}`), this.ckFlog = false 130 | 131 | } 132 | 133 | async taskList() { 134 | let options = { 135 | fn: 'taskList', 136 | method: 'post', 137 | url: 'https://gsp.gacmotor.com/gw/app/community/api/mission/getlistv1?place=1', 138 | headers: this.cq_headers, 139 | json: 'https://gsp.gacmotor.com/gw/app/community/api/mission/getlistv1?place=1' 140 | 141 | } 142 | // console.log(options) 143 | let resp = await $.request(options) 144 | // console.log(resp) 145 | if (resp.errorCode == 20000) { 146 | let tasks = resp.data 147 | for (let index = 0; index < tasks.length; index++) { 148 | const element = tasks[index] 149 | 150 | let itemType = element.itemType 151 | switch (itemType) { 152 | case 0: 153 | if (element.finishedNum == 0) { 154 | $.log(`${this.idx}: ${this.nickname}, 未签到,去执行签到 ,顺便抽个奖`) 155 | await this.signIn() 156 | await this.doLottery() 157 | } else if (element.finishedNum == 1) { 158 | $.log(`${this.idx}: ${this.nickname}, 今天已经签到过了鸭,明天再来吧!`) 159 | } 160 | break 161 | 162 | case 1: 163 | if (element.finishedNum < element.total) { 164 | let num = element.total - element.finishedNum 165 | for (let index = 0; index < num; index++) { 166 | await this.postTopic() 167 | } 168 | } else if (element.finishedNum == 2) { 169 | $.log(`${this.idx}: ${this.nickname}, 今天已经发帖了,明天再来吧!`) 170 | } 171 | break 172 | 173 | case 3: 174 | if (element.finishedNum < element.total) { 175 | let num = element.total - element.finishedNum 176 | for (let index = 0; index < num; index++) { 177 | await this.share() 178 | } 179 | } else if (element.finishedNum == 2) { 180 | $.log(`${this.idx}: ${this.nickname}, 今天已经分享过了鸭,明天再来吧!`) 181 | } 182 | break 183 | 184 | 185 | default: 186 | break 187 | } 188 | } 189 | 190 | } else console.log(`${options.fn}: 失败, ${resp}`) 191 | 192 | } 193 | 194 | // 签到 195 | async signIn() { 196 | let options = { 197 | fn: 'signIn', 198 | method: 'get', 199 | url: 'https://gsp.gacmotor.com/gateway/app-api/sign/submit', 200 | headers: this.cq_headers, 201 | } 202 | // console.log(options) 203 | let resp = await $.request(options) 204 | // console.log(resp) 205 | if (resp.errorCode == 200) { 206 | $.log(`${this.idx}: ${this.nickname}, ${resp.errorMessage} ,你已经连续签到 ${resp.data.dayCount} 天 ,签到获得G豆 ${resp.data.operationValue} 个`) 207 | } else if (resp.errorCode == 200015) { 208 | $.log(`${this.idx}: ${this.nickname}, ${resp.errorMessage}`) 209 | } else console.log(`${options.fn}: 失败, ${resp}`) 210 | } 211 | 212 | // 积分查询 213 | async points() { 214 | let options = { 215 | fn: 'points', 216 | method: 'get', 217 | url: 'https://gsp.gacmotor.com/gateway/app-api/my/statsV3', 218 | headers: this.cq_headers, 219 | } 220 | // console.log(options) 221 | let resp = await $.request(options) 222 | // console.log(resp) 223 | if (resp.errorCode == 200) { 224 | $.log(`${this.idx}: ${this.nickname}, 积分查询:您当前有 ${resp.data.pointCount} 积分`, { notify: true }) 225 | } else console.log(`${options.fn}: 失败, ${resp}`) 226 | } 227 | 228 | 229 | // 签到宝箱列表 230 | async boxList() { 231 | let options = { 232 | fn: 'boxList', 233 | method: 'post', 234 | url: 'https://gsp.gacmotor.com/gw/app/activity/api/winrecord/unopenlist', 235 | headers: this.cq_headers2, 236 | form: { 'activityCode': 'SIGN-BOX' } 237 | } 238 | // console.log(options) 239 | let resp = await $.request(options) 240 | // console.log(resp) 241 | if (resp.errorCode == 20000) { 242 | this.box = resp.data 243 | $.log(`${this.idx}: ${this.nickname}, 共有宝箱:${this.box.length}个!`) 244 | 245 | if (this.box.length > 0) { 246 | for (let i = 0; i < this.box.length; i++) { 247 | this.boxid = this.box[i].recordId 248 | await this.openBox() 249 | await $.wait(2) 250 | } 251 | } 252 | } else console.log(`${options.fn}: 失败, ${resp}`) 253 | } 254 | 255 | 256 | async openBox() { 257 | let options = { 258 | fn: 'openBox', 259 | method: 'post', 260 | url: 'https://gsp.gacmotor.com/gw/app/activity/api/medal/openbox', 261 | headers: this.cq_headers2, 262 | form: { 263 | 'activityCode': 'OPEN-BOX', 264 | 'recordId': this.boxid, 265 | } 266 | } 267 | // console.log(options) 268 | let resp = await $.request(options) 269 | // console.(resp) 270 | if (resp.errorCode == 20000) { 271 | $.log(`${this.idx}: ${this.nickname}, 开宝箱:${resp.errorMessage} ,恭喜你获得 ${resp.data.medalName} 奖品为 ${resp.data.medalDescription}`) 272 | } else console.log(`${options.fn}: 失败, ${resp}`) 273 | 274 | } 275 | 276 | async doLottery() { 277 | let options = { 278 | fn: 'doLottery', 279 | method: 'post', 280 | url: 'https://gsp.gacmotor.com/gw/app/activity/shopDraw/luckyDraw', 281 | headers: this.cq_headers2, 282 | form: { 283 | 'activityCode': 'shop-draw' 284 | } 285 | } 286 | // console.log(options) 287 | let resp = await $.request(options) 288 | // console.(resp) 289 | if (resp.errorCode == 20000) { 290 | $.log(`${this.idx}: ${this.nickname}, 抽奖:${resp.errorMessage} ,恭喜你获得 ${resp.data.medalName} 奖品为 ${resp.data.medalDescription}`) 291 | } else console.log(`${options.fn}: 失败, ${resp}`) 292 | 293 | } 294 | 295 | // 发布帖子 296 | async postTopic() { 297 | let options = { 298 | fn: 'postTopic', 299 | method: 'post', 300 | url: 'https://gsp.gacmotor.com/gw/app/community/api/topic/appsavepost', 301 | headers: this.cq_headers, 302 | form: { 303 | 'postId': '', 304 | 'postType': '2', 305 | 'channelInfoId': '116', 306 | 'columnId': '', 307 | 'postContent': `[{"text":"${this.getText()}"}]`, 308 | 'coverImg': 'https://pic-gsp.gacmotor.com/app/712e2529-7b85-4d70-8c71-22b994b445b5.jpg', 309 | 'publishedTime': '', 310 | 'contentWords': `${this.getText()}`, 311 | 'contentImgNums': '1', 312 | 'lng': '', 313 | 'lat': '', 314 | 'address': '', 315 | 'cityId': '' 316 | } 317 | } 318 | // console.log(options) 319 | let resp = await $.request(options) 320 | // console.(resp) 321 | if (resp.errorCode == 20000) { 322 | $.log(`${this.idx}: ${this.nickname},发布帖子:${resp.errorMessage} ,帖子ID: ${resp.data.postId}`) 323 | this.topic_id = resp.data.postId 324 | await $.wait(10) 325 | await this.addComment() 326 | } else console.log(`${options.fn}: 失败, ${resp}`) 327 | 328 | } 329 | 330 | // 评论帖子 331 | async addComment() { 332 | let options = { 333 | fn: 'addComment', 334 | method: 'post', 335 | url: 'https://gsp.gacmotor.com/gw/app/community/api/comment/add', 336 | headers: this.cq_headers, 337 | form: { 338 | 'commentType': '0', 339 | 'postId': `${this.topic_id}`, 340 | 'commentContent': `${this.getCommentText()}`, 341 | 'commentId': '0', 342 | 'commentatorId': 'NDc3ODY1MA==', 343 | 'isReplyComment': '1' 344 | } 345 | } 346 | // console.log(options) 347 | let resp = await $.request(options) 348 | // console.(resp) 349 | if (resp.errorCode == 20000) { 350 | $.log(`${this.idx}: ${this.nickname}, 评论帖子: 评论 ${this.topic_id} 帖子 ${resp.errorMessage}`) 351 | await $.wait(2) 352 | await this.deleteTopic('删除帖子') 353 | } else console.log(`${options.fn}: 失败, ${resp}`) 354 | 355 | } 356 | 357 | // 删除帖子 358 | async deleteTopic() { 359 | let options = { 360 | fn: 'deleteTopic', 361 | method: 'post', 362 | url: `https://gsp.gacmotor.com/gw/app/community/api/post/delete?postId=${this.topic_id}`, 363 | headers: this.cq_headers, 364 | form: { 365 | 'postId': `${this.topic_id}`, 366 | } 367 | } 368 | // console.log(options) 369 | let resp = await $.request(options) 370 | // console.(resp) 371 | if (resp.errorCode == 20000) { 372 | $.log(`${this.idx}: ${this.nickname}, 删除帖子: 帖子ID: ${this.topic_id} , 执行删除 ${resp.errorMessage}`) 373 | await $.wait(2) 374 | } else console.log(`${options.fn}: 失败, ${resp}`) 375 | 376 | } 377 | 378 | // 分享文章 379 | async share() { 380 | this.postId = '' 381 | await this.ArticleList() 382 | let options = { 383 | fn: 'deleteTopic', 384 | method: 'post', 385 | url: `https://gsp.gacmotor.com/gw/app/community/api/post/forward`, 386 | headers: this.cq_headers, 387 | form: { 388 | 'postId': this.postId, 389 | 'userId': '' 390 | } 391 | } 392 | // console.log(options) 393 | let resp = await $.request(options) 394 | // console.(resp) 395 | if (resp.errorCode == 20000) { 396 | $.log(`${this.idx}: ${this.nickname}, 分享文章:${resp.errorMessage}`) 397 | await $.wait(2) 398 | } else console.log(`${options.fn}: 失败, ${resp}`) 399 | 400 | } 401 | 402 | // 文章列表 403 | async ArticleList() { 404 | let options = { 405 | fn: 'ArticleList', 406 | method: 'get', 407 | url: `https://gsp.gacmotor.com/gw/app/community/api/post/channelPostList?current=1&size=20&channelId=&sortType=1`, 408 | headers: this.cq_headers, 409 | 410 | } 411 | // console.log(options) 412 | let resp = await $.request(options) 413 | // console.(resp) 414 | if (resp.errorCode == 20000) { 415 | let num = $.randomInt(1, 19) 416 | 417 | $.log(`${this.idx}: ${this.nickname}, 分享的文章: ${resp.data.records[num].topicNames} 文章ID:${resp.data.records[num].postId}`) 418 | this.postId = resp.data.records[num].postId 419 | 420 | } else console.log(`${options.fn}: 失败, ${resp}`) 421 | 422 | } 423 | 424 | getSign(ts, reqNonc) { 425 | let salt = '17aaf8118ffb270b766c6d6774317a133.8.0' 426 | let sign = MD5(`signature${reqNonc}${ts}${salt}`).toString() 427 | return sign 428 | } 429 | 430 | getText() { 431 | let textarr = ['最简单的提高观赏性的办法就是把地球故事的部分剪辑掉半小时, emo的部分剪辑掉半小时。这样剩下的90分钟我们就看看外星人,看看月球,看看灾难片大场面就不错。', '顶着叛国罪的风险无比坚信前妻,这种还会离婚?', '你以为它是灾难片,其实它是科幻片;你以为它是科幻片,其实它是恐怖片;你以为它是恐怖片,其实它是科教片', '我的天,剧情真的好阴谋论,但是还算是能自圆其说', '大杂烩啊……我能理解这电影为什么在海外卖的不好了,因为核心创意真的已经太老套了', '一开始我以为这就是外国人看《流浪地球》时的感受啊,后来发现这不是我当初看《胜利号》的感受么'] 432 | let ranNum = $.randomInt(1, textarr.length) 433 | let text = textarr[ranNum] 434 | return text 435 | } 436 | getCommentText() { 437 | let add_comment_text_arr = ['感谢推荐的电影呢', '有时间一定看看这个电影怎么样', '晚上就去看', '66666666666', '这部电影我看过,非常好看'] 438 | let ranNum = $.randomInt(1, add_comment_text_arr.length) 439 | let text = add_comment_text_arr[ranNum] 440 | return text 441 | } 442 | 443 | 444 | } 445 | 446 | 447 | !(async () => { 448 | console.log(await $.yiyan()) 449 | $.read_env(UserClass) 450 | 451 | await userTasks() 452 | 453 | })() 454 | .catch((e) => $.log(e)) 455 | .finally(() => $.exitNow()) 456 | 457 | 458 | 459 | //=============================================================== 460 | function Env(name) { 461 | return new class { 462 | constructor(name) { 463 | this.name = name 464 | this.startTime = Date.now() 465 | this.log(`[${this.name}]开始运行`, { time: true }) 466 | 467 | this.notifyStr = [] 468 | this.notifyFlag = true 469 | 470 | this.userIdx = 0 471 | this.userList = [] 472 | this.userCount = 0 473 | } 474 | async request(opt) { 475 | const got = require('got') 476 | let DEFAULT_TIMEOUT = 8000 // 默认超时时间 477 | let resp = null, count = 0 478 | let fn = opt.fn || opt.url 479 | let resp_opt = opt.resp_opt || 'body' 480 | opt.timeout = opt.timeout || DEFAULT_TIMEOUT 481 | opt.retry = opt.retry || { limit: 0 } 482 | opt.method = opt?.method?.toUpperCase() || 'GET' 483 | while (count++ < DEFAULT_RETRY) { 484 | try { 485 | resp = await got(opt) 486 | break 487 | } catch (e) { 488 | if (e.name == 'TimeoutError') { 489 | this.log(`[${fn}]请求超时,重试第${count}次`) 490 | } else { 491 | this.log(`[${fn}]请求错误(${e.message}),重试第${count}次`) 492 | } 493 | } 494 | } 495 | if (resp == null) return Promise.resolve({ statusCode: 'timeout', headers: null, body: null }) 496 | let { statusCode, headers, body } = resp 497 | if (body) try { body = JSON.parse(body) } catch { } 498 | if (resp_opt == 'body') { 499 | return Promise.resolve(body) 500 | } else if (resp_opt == 'hd') { 501 | return Promise.resolve(headers) 502 | } else if (resp_opt == 'statusCode') { 503 | return Promise.resolve(statusCode) 504 | } 505 | 506 | } 507 | 508 | log(msg, options = {}) { 509 | let opt = { console: true } 510 | Object.assign(opt, options) 511 | 512 | if (opt.time) { 513 | let fmt = opt.fmt || 'hh:mm:ss' 514 | msg = `[${this.time(fmt)}]` + msg 515 | } 516 | if (opt.notify) { 517 | this.notifyStr.push(msg) 518 | } 519 | if (opt.console) { 520 | console.log(msg) 521 | } 522 | if (opt.sp) { 523 | console.log(`\n-------------- ${msg} --------------`) 524 | } 525 | } 526 | read_env(Class) { 527 | let envStrList = ckNames.map(x => process.env[x]) 528 | for (let env_str of envStrList.filter(x => !!x)) { 529 | let sp = envSplitor.filter(x => env_str.includes(x)) 530 | let splitor = sp.length > 0 ? sp[0] : envSplitor[0] 531 | for (let ck of env_str.split(splitor).filter(x => !!x)) { 532 | this.userList.push(new Class(ck)) 533 | } 534 | } 535 | this.userCount = this.userList.length 536 | if (!this.userCount) { 537 | this.log(`未找到变量,请检查变量${ckNames.map(x => '[' + x + ']').join('或')}`, { notify: true }) 538 | return false 539 | } 540 | this.log(`共找到${this.userCount}个账号`) 541 | return true 542 | } 543 | async taskThread(taskName, conf, opt = {}) { 544 | while (conf.idx < $.userList.length) { 545 | let user = $.userList[conf.idx++] 546 | await user[taskName](opt) 547 | } 548 | } 549 | async threadManager(taskName, thread) { 550 | let taskAll = [] 551 | let taskConf = { idx: 0 } 552 | while (thread--) { 553 | taskAll.push(this.taskThread(taskName, taskConf)) 554 | } 555 | await Promise.all(taskAll) 556 | } 557 | time(t, x = null) { 558 | let xt = x ? new Date(x) : new Date 559 | let e = { 560 | "M+": xt.getMonth() + 1, 561 | "d+": xt.getDate(), 562 | "h+": xt.getHours(), 563 | "m+": xt.getMinutes(), 564 | "s+": xt.getSeconds(), 565 | "q+": Math.floor((xt.getMonth() + 3) / 3), 566 | S: this.padStr(xt.getMilliseconds(), 3) 567 | }; 568 | /(y+)/.test(t) && (t = t.replace(RegExp.$1, (xt.getFullYear() + "").substr(4 - RegExp.$1.length))) 569 | for (let s in e) 570 | new RegExp("(" + s + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? e[s] : ("00" + e[s]).substr(("" + e[s]).length))) 571 | return t 572 | } 573 | async showmsg() { 574 | if (!this.notifyFlag) return 575 | if (!this.notifyStr) return 576 | let notify = require('./sendNotify') 577 | this.log('\n============== 推送 ==============') 578 | await notify.sendNotify(this.name, this.notifyStr.join('\n')) 579 | } 580 | padStr(num, length, opt = {}) { 581 | let padding = opt.padding || '0' 582 | let mode = opt.mode || 'l' 583 | let numStr = String(num) 584 | let numPad = (length > numStr.length) ? (length - numStr.length) : 0 585 | let pads = '' 586 | for (let i = 0; i < numPad; i++) { 587 | pads += padding 588 | } 589 | if (mode == 'r') { 590 | numStr = numStr + pads 591 | } else { 592 | numStr = pads + numStr 593 | } 594 | return numStr 595 | } 596 | json2str(obj, c, encode = false) { 597 | let ret = [] 598 | for (let keys of Object.keys(obj).sort()) { 599 | let v = obj[keys] 600 | if (v && encode) v = encodeURIComponent(v) 601 | ret.push(keys + '=' + v) 602 | } 603 | return ret.join(c) 604 | } 605 | str2json(str, decode = false) { 606 | let ret = {} 607 | for (let item of str.split('&')) { 608 | if (!item) continue 609 | let idx = item.indexOf('=') 610 | if (idx == -1) continue 611 | let k = item.substr(0, idx) 612 | let v = item.substr(idx + 1) 613 | if (decode) v = decodeURIComponent(v) 614 | ret[k] = v 615 | } 616 | return ret 617 | } 618 | phoneNum(phone_num) { 619 | if (phone_num.length == 11) { 620 | let data = phone_num.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") 621 | return data 622 | } else { 623 | return phone_num 624 | } 625 | } 626 | randomInt(min, max) { 627 | return Math.round(Math.random() * (max - min) + min) 628 | } 629 | async yiyan() { 630 | const got = require('got') 631 | return new Promise((resolve) => { 632 | (async () => { 633 | try { 634 | const response = await got('https://v1.hitokoto.cn') 635 | // console.log(response.body) 636 | let data = JSON.parse(response.body) 637 | let data_ = `[一言]: ${data.hitokoto} by--${data.from}` 638 | // console.log(data_) 639 | resolve(data_) 640 | } catch (error) { 641 | console.log(error.response.body) 642 | } 643 | })() 644 | }) 645 | } 646 | ts(type = false, _data = "") { 647 | let myDate = new Date() 648 | let a = "" 649 | switch (type) { 650 | case 10: 651 | a = Math.round(new Date().getTime() / 1000).toString() 652 | break 653 | case 13: 654 | a = Math.round(new Date().getTime()).toString() 655 | break 656 | case "h": 657 | a = myDate.getHours() 658 | break 659 | case "m": 660 | a = myDate.getMinutes() 661 | break 662 | case "y": 663 | a = myDate.getFullYear() 664 | break 665 | case "h": 666 | a = myDate.getHours() 667 | break 668 | case "mo": 669 | a = myDate.getMonth() 670 | break 671 | case "d": 672 | a = myDate.getDate() 673 | break 674 | case "ts2Data": 675 | if (_data != "") { 676 | time = _data 677 | if (time.toString().length == 13) { 678 | let date = new Date(time + 8 * 3600 * 1000) 679 | a = date.toJSON().substr(0, 19).replace("T", " ") 680 | } else if (time.toString().length == 10) { 681 | time = time * 1000 682 | let date = new Date(time + 8 * 3600 * 1000) 683 | a = date.toJSON().substr(0, 19).replace("T", " ") 684 | } 685 | } 686 | break 687 | default: 688 | a = "未知错误,请检查" 689 | break 690 | } 691 | return a 692 | } 693 | randomPattern(pattern, charset = 'abcdef0123456789') { 694 | let str = '' 695 | for (let chars of pattern) { 696 | if (chars == 'x') { 697 | str += charset.charAt(Math.floor(Math.random() * charset.length)) 698 | } else if (chars == 'X') { 699 | str += charset.charAt(Math.floor(Math.random() * charset.length)).toUpperCase() 700 | } else { 701 | str += chars 702 | } 703 | } 704 | return str 705 | } 706 | randomString(len, charset = 'abcdef0123456789') { 707 | let str = '' 708 | for (let i = 0; i < len; i++) { 709 | str += charset.charAt(Math.floor(Math.random() * charset.length)) 710 | } 711 | return str 712 | } 713 | randomList(a) { 714 | let idx = Math.floor(Math.random() * a.length) 715 | return a[idx] 716 | } 717 | wait(t) { 718 | return new Promise(e => setTimeout(e, t * 1000)) 719 | } 720 | async exitNow() { 721 | await this.showmsg() 722 | let e = Date.now() 723 | let s = (e - this.startTime) / 1000 724 | this.log(`[${this.name}]运行结束,共运行了${s}秒`) 725 | process.exit(0) 726 | } 727 | }(name) 728 | } 729 | -------------------------------------------------------------------------------- /UnValid/科技玩家.js: -------------------------------------------------------------------------------- 1 | /** 2 | 作者:临渊 3 | 日期:6-15 4 | 网站:科技玩家 5 | 功能:签到、关注 6 | 变量:kjwj='账号&密码' 多个账号用换行分割 7 | 定时:一天一次 8 | cron:10 10 * * * 9 | 因为用Leaf大佬的会莫名其妙报错,所以就用Leaf大佬的源码改了一下,感谢Leaf大佬的源码(大佬的代码真优雅) 10 | 11 | 6-29 增加了关注,但可能会被风控取消 12 | */ 13 | 14 | const $ = new Env('科技玩家'); 15 | const notify = $.isNode() ? require('./sendNotify') : ''; 16 | const {log} = console; 17 | const Notify = 1; //0为关闭通知,1为打开通知,默认为1 18 | const debug = 0; //0为关闭调试,1为打开调试,默认为0 19 | ////////////////////// 20 | let kjwj = process.env.kjwj; 21 | let kjwjArr = []; 22 | let data = ''; 23 | let msg = ''; 24 | let loginBack = 0; 25 | let token = ''; 26 | let name = ''; 27 | 28 | 29 | !(async () => { 30 | 31 | if (!(await Envs())) 32 | return; 33 | else { 34 | 35 | 36 | 37 | log(`\n\n============================================= \n脚本执行 - 北京时间(UTC+8):${new Date( 38 | new Date().getTime() + new Date().getTimezoneOffset() * 60 * 1000 + 39 | 8 * 60 * 60 * 1000).toLocaleString()} \n=============================================\n`); 40 | 41 | await poem(); 42 | 43 | log(`\n=================== 共找到 ${kjwjArr.length} 个账号 ===================`) 44 | 45 | if (debug) { 46 | log(`【debug】 这是你的全部账号数组:\n ${kjwjArr}`); 47 | } 48 | 49 | 50 | for (let index = 0; index < kjwjArr.length; index++) { 51 | 52 | 53 | let num = index + 1 54 | log(`\n========= 开始【第 ${num} 个账号】=========\n`) 55 | 56 | kjwj = kjwjArr[index].split('&'); 57 | 58 | if (debug) { 59 | log(`\n 【debug】 这是你第 ${num} 账号信息:\n ${data}\n`); 60 | } 61 | 62 | msg += `\n第${num}个账号运行结果:` 63 | 64 | log('【开始登录】'); 65 | await login(); 66 | await $.wait(2 * 1000); 67 | 68 | if (loginBack != 1){ 69 | 70 | log('【开始查询签到状态】'); 71 | await getSign(); 72 | await $.wait(2 * 1000); 73 | 74 | for (let i = 0; i < 5; i++) { 75 | log(`【开始第${i+1}次关注】`); 76 | await doFollow(); 77 | await $.wait(randomInt(15000,25000)); 78 | } 79 | } 80 | 81 | } 82 | await SendMsg(msg); 83 | } 84 | 85 | })() 86 | .catch((e) => log(e)) 87 | .finally(() => $.done()) 88 | 89 | /** 90 | * 登录 91 | */ 92 | function login(timeout = 3 * 1000) { 93 | return new Promise((resolve) => { 94 | let url = { 95 | url: `https://www.kejiwanjia.com/wp-json/jwt-auth/v1/token`, 96 | headers: { 97 | "Host": "www.kejiwanjia.com", 98 | "Connection": "keep-alive", 99 | "Accept": "application/json, text/plain, */*", 100 | "User-Agent": "Mozilla/5.0 (Linux; Android 10; MI 8 Build/QKQ1.190828.002;) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/83.0.4103.101 Mobile Safari/537.36", 101 | "Content-Type": "application/x-www-form-urlencoded" 102 | }, 103 | body: `nickname=&username=${kjwj[0]}&password=${kjwj[1]}&code=&img_code=&invitation_code=&token=&smsToken=&luoToken=&confirmPassword=&loginType=`, 104 | } 105 | 106 | if (debug) { 107 | log(`\n【debug】=============== 这是 登录 请求 url ===============`); 108 | log(JSON.stringify(url)); 109 | } 110 | 111 | $.post(url, async (error, response, data) => { 112 | try { 113 | if (debug) { 114 | log(`\n\n【debug】===============这是 登录 返回data==============`); 115 | log(data) 116 | } 117 | 118 | let result = JSON.parse(data); 119 | if (result.code == 1) { 120 | 121 | loginBack = 1; 122 | log(`【登录失败】${result.message} `) 123 | msg += `\n【登陆失败】${result.message}` 124 | 125 | } else { 126 | 127 | log(`\n账号[${result.name}]登录成功,现有积分:${result.credit}`) 128 | token = result.token; 129 | name = result.name; 130 | 131 | } 132 | 133 | } catch (e) { 134 | log(e) 135 | } finally { 136 | resolve(); 137 | } 138 | }, timeout) 139 | }) 140 | } 141 | 142 | /** 143 | * 查询签到状态 144 | */ 145 | function getSign(timeout = 3 * 1000) { 146 | return new Promise((resolve) => { 147 | let url = { 148 | url: `https://www.kejiwanjia.com/wp-json/b2/v1/getUserMission`, 149 | headers: { 150 | "Host": "www.kejiwanjia.com", 151 | "Connection": "keep-alive", 152 | "Accept": "application/json, text/plain, */*", 153 | "User-Agent": "Mozilla/5.0 (Linux; Android 10; MI 8 Build/QKQ1.190828.002;) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/83.0.4103.101 Mobile Safari/537.36", 154 | "Content-Type": "application/x-www-form-urlencoded", 155 | "Authorization": `Bearer ${token}`, 156 | "Cookie": `b2_token=${token};` 157 | }, 158 | body: 'count=5&paged=1', 159 | } 160 | 161 | if (debug) { 162 | log(`\n【debug】=============== 这是 查询签到状态 请求 url ===============`); 163 | log(JSON.stringify(url)); 164 | } 165 | 166 | $.post(url, async (error, response, data) => { 167 | try { 168 | if (debug) { 169 | log(`\n\n【debug】===============这是 查询签到状态 返回data==============`); 170 | log(data) 171 | } 172 | 173 | let result = JSON.parse(data); 174 | if (result.code == 1) { 175 | 176 | log(`查询签到状态失败`) 177 | 178 | } else { 179 | 180 | if(result.mission.credit == 0) { 181 | await $.wait(1000); 182 | await signin(); 183 | } else { 184 | log(`账号[${name}]今天已签到,获得了${result.mission.credit}积分`) 185 | msg += `账号[${name}]今天已签到,获得了${result.mission.credit}积分` 186 | } 187 | 188 | } 189 | 190 | } catch (e) { 191 | log(e) 192 | } finally { 193 | resolve(); 194 | } 195 | }, timeout) 196 | }) 197 | } 198 | 199 | /** 200 | * 签到 201 | */ 202 | function signin(timeout = 3 * 1000) { 203 | return new Promise((resolve) => { 204 | let url = { 205 | url: `https://www.kejiwanjia.com/wp-json/b2/v1/userMission`, 206 | headers: { 207 | "Host": "www.kejiwanjia.com", 208 | "Connection": "keep-alive", 209 | "Accept": "application/json, text/plain, */*", 210 | "User-Agent": "Mozilla/5.0 (Linux; Android 10; MI 8 Build/QKQ1.190828.002;) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/83.0.4103.101 Mobile Safari/537.36", 211 | "Content-Type": "application/x-www-form-urlencoded", 212 | "Authorization": `Bearer ${token}`, 213 | "Cookie": `b2_token=${token};` 214 | }, 215 | body: ``, 216 | } 217 | 218 | if (debug) { 219 | log(`\n【debug】=============== 这是 签到 请求 url ===============`); 220 | log(JSON.stringify(url)); 221 | } 222 | 223 | $.post(url, async (error, response, data) => { 224 | try { 225 | if (debug) { 226 | log(`\n\n【debug】===============这是 签到 返回data==============`); 227 | log(data) 228 | } 229 | 230 | let result = JSON.parse(data); 231 | if (result.code == 1) { 232 | 233 | log(`账号[${name}]签到失败:${result}`) 234 | msg += `账号[${name}]签到失败:${result}` 235 | 236 | } else { 237 | 238 | if(result.credit) { 239 | log(`账号[${name}]签到成功,获得${result.credit}积分,现有积分:${result.mission.my_credit}`) 240 | msg += `\n账号[${name}]签到成功,获得${result.credit}积分,现有积分:${result.mission.my_credit}` 241 | } 242 | 243 | } 244 | 245 | } catch (e) { 246 | log(e) 247 | } finally { 248 | resolve(); 249 | } 250 | }, timeout) 251 | }) 252 | } 253 | 254 | /** 255 | * 关注 256 | */ 257 | function doFollow(timeout = 3 * 1000) { 258 | return new Promise((resolve) => { 259 | let user_id = randomInt(0,1000) 260 | let url = { 261 | url: `https://www.kejiwanjia.com/wp-json/b2/v1/AuthorFollow`, 262 | headers: { 263 | "Host": "www.kejiwanjia.com", 264 | "Connection": "keep-alive", 265 | "Accept": "application/json, text/plain, */*", 266 | "User-Agent": "Mozilla/5.0 (Linux; Android 10; MI 8 Build/QKQ1.190828.002;) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/83.0.4103.101 Mobile Safari/537.36", 267 | "Content-Type": "application/x-www-form-urlencoded", 268 | "Authorization": `Bearer ${token}`, 269 | "Cookie": `b2_token=${token};` 270 | }, 271 | body: `user_id=${user_id}`, 272 | } 273 | 274 | if (debug) { 275 | log(`\n【debug】=============== 这是 关注 请求 url ===============`); 276 | log(JSON.stringify(url)); 277 | } 278 | 279 | $.post(url, async (error, response, data) => { 280 | try { 281 | if (debug) { 282 | log(`\n\n【debug】===============这是 关注 返回data==============`); 283 | log(data) 284 | } 285 | 286 | if (data == "true") { 287 | 288 | log(`账号[${name}]关注id[${user_id}]用户成功`) 289 | msg += `\n账号[${name}]关注id[${user_id}]用户成功` 290 | 291 | } else { 292 | 293 | log(`账号[${name}]关注id[${user_id}]用户失败`) 294 | msg += `\n账号[${name}]关注id[${user_id}]用户失败` 295 | 296 | } 297 | 298 | } catch (e) { 299 | log(e) 300 | } finally { 301 | resolve(); 302 | } 303 | }, timeout) 304 | }) 305 | } 306 | // ============================================变量检查============================================ \\ 307 | async function Envs() { 308 | if (kjwj) { 309 | if (kjwj.indexOf("\n") != -1) { 310 | kjwj.split("\n").forEach((item) => { 311 | kjwjArr.push(item); 312 | }); 313 | } else { 314 | kjwjArr.push(kjwj); 315 | } 316 | } else { 317 | log(`\n 【${$.name}】:未填写变量 kjwj`) 318 | return; 319 | } 320 | 321 | return true; 322 | } 323 | 324 | // ============================================发送消息============================================ \\ 325 | async function SendMsg(message) { 326 | if (!message) 327 | return; 328 | 329 | if (Notify > 0) { 330 | if ($.isNode()) { 331 | var notify = require('./sendNotify'); 332 | await notify.sendNotify($.name, message); 333 | } else { 334 | $.msg(message); 335 | } 336 | } else { 337 | log(message); 338 | } 339 | } 340 | 341 | /** 342 | * 随机数生成 343 | */ 344 | function randomString(e) { 345 | e = e || 32; 346 | var t = "QWERTYUIOPASDFGHJKLZXCVBNM1234567890", 347 | a = t.length, 348 | n = ""; 349 | for (i = 0; i < e; i++) 350 | n += t.charAt(Math.floor(Math.random() * a)); 351 | return n 352 | } 353 | 354 | /** 355 | * 随机整数生成 356 | */ 357 | function randomInt(min, max) { 358 | return Math.round(Math.random() * (max - min) + min) 359 | } 360 | 361 | /** 362 | * 获取毫秒时间戳 363 | */ 364 | function timestampMs(){ 365 | return new Date().getTime(); 366 | } 367 | 368 | /** 369 | * 获取秒时间戳 370 | */ 371 | function timestampS(){ 372 | return Date.parse(new Date())/1000; 373 | } 374 | 375 | /** 376 | * 获取随机诗词 377 | */ 378 | function poem(timeout = 3 * 1000) { 379 | return new Promise((resolve) => { 380 | let url = { 381 | url: `https://v1.jinrishici.com/all.json` 382 | } 383 | $.get(url, async (err, resp, data) => { 384 | try { 385 | data = JSON.parse(data) 386 | log(`${data.content} \n————《${data.origin}》${data.author}`); 387 | } catch (e) { 388 | log(e, resp); 389 | } finally { 390 | resolve() 391 | } 392 | }, timeout) 393 | }) 394 | } 395 | 396 | /** 397 | * 修改配置文件 398 | */ 399 | function modify() { 400 | 401 | fs.readFile('/ql/data/config/config.sh','utf8',function(err,dataStr){ 402 | if(err){ 403 | return log('读取文件失败!'+err) 404 | } 405 | else { 406 | var result = dataStr.replace(/regular/g,string); 407 | fs.writeFile('/ql/data/config/config.sh', result, 'utf8', function (err) { 408 | if (err) {return log(err);} 409 | }); 410 | } 411 | }) 412 | } 413 | 414 | function Env(t, e) { "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); class s { constructor(t) { this.env = t } send(t, e = "GET") { t = "string" == typeof t ? { url: t } : t; let s = this.get; return "POST" === e && (s = this.post), new Promise((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } get(t) { return this.send.call(this.env, t) } post(t) { return this.send.call(this.env, t, "POST") } } return new class { constructor(t, e) { this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } isSurge() { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon() { return "undefined" != typeof $loon } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson(t, e) { let s = e; const i = this.getdata(t); if (i) try { s = JSON.parse(this.getdata(t)) } catch { } return s } setjson(t, e) { try { return this.setdata(JSON.stringify(t), e) } catch { return !1 } } getScript(t) { return new Promise(e => { this.get({ url: t }, (t, s, i) => e(i)) }) } runScript(t, e) { return new Promise(s => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; const [o, h] = i.split("@"), n = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(n, (t, e, i) => s(i)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e); if (!s && !i) return {}; { const i = s ? t : e; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of i) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, e, s) { return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; try { const e = JSON.parse(h); this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const o = {}; this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) } } else s = this.setval(t, e); return s } getval(t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null } setval(t, e) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null } initGotEnv(t) { this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) } get(t, e = (() => { })) { t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date; let i = { "M+": s.getMonth() + 1, "d+": s.getDate(), "H+": s.getHours(), "m+": s.getMinutes(), "s+": s.getSeconds(), "q+": Math.floor((s.getMonth() + 3) / 3), S: s.getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length))); for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) { let t = ["", "==============📣系统通知📣=============="]; t.push(e), s && t.push(s), i && t.push(i), console.log(t.join("\n")), this.logs = this.logs.concat(t) } } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) } 415 | -------------------------------------------------------------------------------- /UnValid/芒果果园.js: -------------------------------------------------------------------------------- 1 | import urllib.request 2 | import urllib.parse 3 | import json 4 | import time 5 | #import sys 6 | 7 | #抓取login那个包 https://api-farm.game.mgtv.com/api/login 8 | 9 | openid = 'afc5be9410fb582dbe69753f0dc97019' 10 | ticket = '6ECB8C9C360C37AFBF4E9BD322FB22D7' 11 | nickName = 'mg5747192958' 12 | did = '6747eaa5037c6c87df6a966bd6dd4833' 13 | pbid = 'android' 14 | 15 | 16 | # def printf(text): 17 | # print(text) 18 | # sys.stdout.flush() 19 | # def load_send(): 20 | # global send 21 | # cur_path = os.path.abspath(os.path.dirname(__file__)) 22 | # sys.path.append(cur_path) 23 | # if os.path.exists(cur_path + "/sendNotify.py"): 24 | # try: 25 | # from sendNotify import send 26 | # except: 27 | # send = False 28 | # printf("加载通知服务失败~") 29 | # else: 30 | # send = False 31 | # printf("加载通知服务失败~") 32 | # load_send() 33 | 34 | #url 访问 返回响应体 35 | def wangye_fangwen(fangfa,cr_url,cr_data,cr_headers): 36 | tijiao_url = cr_url 37 | data = cr_data 38 | data = urllib.parse.urlencode(data).encode('utf-8') 39 | headers = cr_headers 40 | if fangfa == 'post' : 41 | # 执行 42 | request = urllib.request.Request(url=tijiao_url, headers=headers, data=data) 43 | response = urllib.request.urlopen(request) 44 | content = response.read().decode('utf-8') 45 | elif fangfa == 'get' : 46 | data = urllib.parse.urlencode(data) 47 | url = cr_url + data 48 | request = urllib.request.Request(url=url, headers=headers) 49 | response = urllib.request.urlopen(request) 50 | content = response.read().decode('utf‐8') 51 | else: 52 | content = "先输入请求方式" 53 | return content 54 | 55 | 56 | #任务函数 57 | def renwu_hs(taskid): 58 | cr_url = 'https://api-farm.game.mgtv.com/api/gainTaskAward' 59 | cr_data = { 60 | 'taskid': taskid 61 | } 62 | fangfa = 'post' 63 | cr_headers = z_headers 64 | fanhui = wangye_fangwen(fangfa, cr_url, cr_data, cr_headers) 65 | fanhui_josn = json.loads(fanhui ) 66 | try: 67 | jieguo = fanhui_josn.get('data').get('errmsg','任务id:' + str(taskid) + '成功') 68 | print('******' + jieguo + '******') 69 | except: 70 | print('出错啦,在任务这里\n\n') 71 | 72 | #浇水 73 | def jiaoshui_hs(): 74 | cr_url = 'https://api-farm.game.mgtv.com/api/watering' 75 | cr_data = { 76 | 'wateringtype': 1, 77 | } 78 | jsfhz = wangye_fangwen('post',cr_url, cr_data, z_headers) 79 | jsfhz_josn = json.loads(jsfhz) 80 | jg = jsfhz_josn.get('data').get('errmsg','') 81 | if jg : 82 | if jg == 'the drips is not enough!' : 83 | print('******没有水滴了!*****') 84 | drips = 0 85 | else: 86 | try: 87 | taskProgress = jsfhz_josn['data']['taskProgress'] 88 | for i in taskProgress: 89 | if i['gained'] == 1: 90 | time.sleep(1) 91 | taskid = i['taskid'] 92 | renwu_hs(taskid) 93 | drips = jsfhz_josn['data']['drips'] 94 | except: 95 | print('叫谁这里,其他错误') 96 | drips = 0 97 | return drips 98 | 99 | def jiaoshui_hszx(): 100 | #执行浇水 101 | drips = 11 102 | jscs = 0 103 | while drips > 10 : 104 | time.sleep(2) 105 | jscs = jscs +1 106 | print('*****执行浇水第' + str(jscs) + '次******') 107 | drips = jiaoshui_hs() 108 | if drips < 10 : 109 | print('*****水滴数量不够了!退出浇水******') 110 | 111 | #收集礼盒 112 | def lihe_hs(): 113 | cr_url = 'https://api-farm.game.mgtv.com/api/openbox?' 114 | cr_data = {} 115 | lhfhz = wangye_fangwen('post',cr_url, cr_data, z_headers) 116 | lhfhz_josn = json.loads(lhfhz) 117 | jg = lhfhz_josn.get('data').get('errmsg','成功') 118 | #print(jg) # 调试输出 119 | if jg == "the daydrip is can't open box!'" : 120 | print('******没有礼盒了!*****') 121 | lhqk = 0 122 | elif jg == "成功" : 123 | try: 124 | lhvalue = lhfhz_josn.get('data').get('gainaward').get('value', 0) 125 | print('******收集礼盒获得:' + str(lhvalue) + '*****') 126 | lhqk = 1 127 | except: 128 | print('******收集错误礼盒,其他原因*****') 129 | lhqk = 0 130 | else: 131 | lhqk = 0 132 | return lhqk 133 | 134 | if __name__ == '__main__': 135 | #登入 136 | cr_url = 'https://api-farm.game.mgtv.com/api/login' 137 | cr_data = { 138 | 'openid' : openid, 139 | 'ticket' : ticket, 140 | 'nickName' : nickName, 141 | 'did' : did, 142 | 'pbid' : pbid 143 | } 144 | cr_headers = { 145 | 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 ImgoTV-iphone/7.1.2.2206302110' 146 | } 147 | fanhuizhi = wangye_fangwen('post',cr_url,cr_data,cr_headers) 148 | 149 | fanhuizhi_josn = json.loads(fanhuizhi ) 150 | if fanhuizhi_josn['code'] == 200 : 151 | #print('******URL访问成功******') 152 | token = fanhuizhi_josn.get('data').get('token','未获取到') 153 | 154 | if token == '未获取到' : 155 | print('!!!!!!未获取到token!!!!!') 156 | else: 157 | print('******获取到token******') 158 | else: 159 | print('******URL登陆失败******') 160 | token = '访问失败' 161 | #获取信息 162 | sg_sfcs = fanhuizhi_josn['data']['userdata']['hasSeed'] #是否成熟 163 | sg_level = fanhuizhi_josn['data']['userdata']['level'] #等级 164 | 165 | #设置表头 166 | z_headers = { 167 | 'Usere; -Agent': 'Mozilla/5.0 (iPhonCPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 ImgoTV-iphone/7.1.2.2206302110', 168 | 'autohrization':token 169 | } 170 | 171 | #下雨 172 | time.sleep(1) 173 | cr_url ='https://api-farm.game.mgtv.com/api/uploadSunlightRain' 174 | cr_data = { 175 | 'sunlight': 20 176 | } 177 | xiayu = wangye_fangwen('post', cr_url, cr_data, z_headers) 178 | xiayu_josn = json.loads(xiayu) 179 | if xiayu_josn.get('data').get('sunlight',0) > 0 : 180 | print('******领取下雨成功*****') 181 | else: 182 | sbyy = xiayu_josn.get('data').get('errmsg','其他原因') 183 | print('******领取下雨失败,失败原因:' + sbyy + '*****') 184 | 185 | #签到 186 | time.sleep(1) 187 | cr_url = 'https://api-farm.game.mgtv.com/api/sign' 188 | cr_data = {} 189 | qiandao = wangye_fangwen('post', cr_url, cr_data, z_headers) 190 | qiandao_josn = json.loads(qiandao) 191 | qdjg = qiandao_josn.get('data').get('errmsg','成功') 192 | if qdjg == "It's already sign!" : 193 | print('******重复签到!*****') 194 | elif qdjg == "成功" : 195 | print('******签到成功!*****') 196 | else: 197 | print('↓↓↓↓↓签到其他情况↓↓↓↓↓') 198 | print(qdjg) 199 | #领取水桶 200 | time.sleep(1) 201 | cr_url = 'https://api-farm.game.mgtv.com/api/collectBottle?' 202 | cr_data = {} 203 | shoujishuit = wangye_fangwen('post', cr_url, cr_data, z_headers) 204 | shoujishuit_josn = json.loads(shoujishuit) 205 | stjg = shoujishuit_josn.get('data').get('errmsg','成功') 206 | if stjg == "成功" : 207 | sdsl = shoujishuit_josn.get('data').get('gainaward').get('value') 208 | print(f'******领取到隔夜水滴:{sdsl}个*****') 209 | elif stjg == "too least drips to collect" : 210 | print('******滴水太少而无法收集*****') 211 | elif stjg == "重复请求" : 212 | print('******重复请求!*****') 213 | elif stjg == "time is no up" : 214 | print('******时间还没有到!*****') 215 | else: 216 | print('↓↓↓↓↓水桶其他情况↓↓↓↓↓') 217 | print(stjg) 218 | #执行浇水 219 | jiaoshui_hszx() 220 | #收集礼盒 浇水有礼盒收集礼盒 221 | lhqk = 1 222 | lhcs = 0 223 | while lhqk > 0 : 224 | time.sleep(2) 225 | lhcs = lhcs +1 226 | print('*****领取礼盒第' + str(lhcs) + '次******') 227 | lhqk = lihe_hs() 228 | if lhqk == 0 : 229 | print('*****礼盒没了!退出礼盒领取******') 230 | if lhcs > 1 : 231 | print('*****领取到礼盒再次去浇水******') 232 | jiaoshui_hszx() # 去浇水 233 | lhqk = lihe_hs() 234 | -------------------------------------------------------------------------------- /UnValid/苏泊尔.js: -------------------------------------------------------------------------------- 1 | /* 2 | 苏泊尔会员中心 小程序 3 | cron 10 7 * * * sbr.js 4 | 5 | 7.13 完成 签到, 偷大米, 浏览菜谱 任务 6 | 10.11 更新抽奖 7 | 12.24 改用 yml2213-utils 依赖 8 | 9 | ------------------------ 青龙--配置文件-贴心复制区域 ---------------------- 10 | token 抓 https://growrice.supor.com/rice/backend/public/index.php/api/login/auto-login 的包 , url 后面就是token 11 | cookie 抓 https://growrice.supor.com/rice/backend/public/index.php/api/users/get-user-info 的包 , header 中有cookie 12 | 13 | # 苏泊尔 14 | export sbr=" token & cookie @ token & cookie " 15 | 16 | 抓 api/login/auto-login 中的参数 token 跟cookie 17 | 多账号用 换行 或 @ 分割 18 | 19 | 报错的自己下载 utils.js 放在脚本同级目录下 20 | 报错的自己下载 utils.js 放在脚本同级目录下 21 | 报错的自己下载 utils.js 放在脚本同级目录下 22 | 23 | tg频道: https://t.me/yml2213_tg 24 | 25 | */ 26 | 27 | const $ = new Env("苏泊尔"); 28 | const alias_name = "sbr"; 29 | const utils = require("yml2213-utils"); 30 | 31 | const notify = $.isNode() ? require("./sendNotify") : ""; 32 | const Notify = 1; //0为关闭通知,1为打开通知,默认为1 33 | //--------------------------------------------------------------------------------------------------------- 34 | let ckStr = process.env[alias_name]; 35 | let msg, ck; 36 | let ck_status = 1; 37 | //--------------------------------------------------------------------------------------------------------- 38 | let VersionCheck = "0.4"; 39 | let Change = "\n报错的自己下载 yml2213-utils 依赖"; 40 | let thank = `\n感谢 心雨大佬脚本\n`; 41 | //--------------------------------------------------------------------------------------------------------- 42 | 43 | async function tips(ckArr) { 44 | // let Version_latest = await Version_Check(alias_name, '1'); 45 | let Version = `\n📌 本地脚本: V ${VersionCheck}`; 46 | DoubleLog(`${Version}\n📌 🆙 更新内容: ${Change}`); 47 | // DoubleLog(`${thank}`); 48 | await utils.yiyan() 49 | DoubleLog(`\n========== 共找到 ${ckArr.length} 个账号 ==========`); 50 | } 51 | 52 | async function start() { 53 | const sbr = new Sbr(ck[0], ck[1]); 54 | await sbr.init("初始化"); 55 | await sbr.login("登录刷新"); 56 | await sbr.user_info("用户信息"); 57 | if (ck_status) { 58 | await sbr.sign_info("签到查询"); 59 | await sbr.task_list("任务列表"); 60 | await sbr.prize_Info("抽奖信息"); 61 | await sbr.get_index_info("获取可收取大米信息"); 62 | await sbr.rice_num("查询大米数量"); 63 | } 64 | } 65 | 66 | let host, hostname, apiname, sbr_hd, _id, _list, _id_list, num, collect_name; 67 | class Sbr { 68 | constructor(token, cookie) { 69 | this.token = token; 70 | this.cookie = cookie; 71 | } 72 | // 初始化 73 | async init(name) { 74 | if (!name) { 75 | name = /function\s*(\w*)/i.exec(arguments.callee.toString())[1]; 76 | } 77 | DoubleLog(`\n开始 ${name}`); 78 | host = "growrice.supor.com"; 79 | hostname = "https://" + host; 80 | apiname = `${hostname}/rice/backend/public/index.php/api` 81 | sbr_hd = { 82 | "Content-Type": "application/x-www-form-urlencoded", 83 | 'Host': this.host, 84 | 'Cookie': this.cookie, 85 | } 86 | } 87 | 88 | // 登录 post 89 | async login(name) { 90 | let options = { 91 | method: "get", 92 | url: `${apiname}/login/auto-login?token=${this.token}`, 93 | headers: sbr_hd, 94 | }; 95 | let result = await httpResult(name, options); 96 | } 97 | 98 | // 用户信息 httpGet 99 | async user_info(name) { 100 | 101 | let options = { 102 | method: "get", 103 | url: `${apiname}/users/get-user-info`, 104 | headers: sbr_hd, 105 | }; 106 | let result = await httpResult(name, options); 107 | 108 | if (result.code == 1) { 109 | DoubleLog(`${name}: ${result.msg} , 欢迎 ${result.data.nickname}`); 110 | await utils.wait(2); 111 | } else if (result.code == 0) { 112 | DoubleLog(`${name}: ${result.msg}`); 113 | ck_status = 0 114 | } else { 115 | DoubleLog(`${name}: 失败 ❌ 了呢,原因未知!`); 116 | console.log(result); 117 | ck_status = 0 118 | } 119 | } 120 | 121 | // 签到信息 get 122 | async sign_info(name) { 123 | let options = { 124 | method: "get", 125 | url: `${apiname}/signIn/sign-list`, 126 | headers: sbr_hd, 127 | }; 128 | let result = await httpResult(name, options); 129 | 130 | if (result.data.is_sign == false) { 131 | DoubleLog(`${name}: 未签到 ,去签到喽!`); 132 | await this.do_sign("签到") 133 | } else if (result.data.is_sign == true) { 134 | DoubleLog(`${name}: 已签到, 明天再来吧!`); 135 | } else { 136 | DoubleLog(`${name}: 失败 ❌ 了呢,原因未知!`); 137 | console.log(result); 138 | } 139 | } 140 | 141 | 142 | 143 | // 签到 post 144 | async do_sign(name) { 145 | let options = { 146 | method: "post", 147 | url: `${apiname}/signIn/sign`, 148 | headers: sbr_hd, 149 | body: `https://growrice.supor.com/rice/backend/public/index.php/api/signIn/sign`, 150 | }; 151 | let result = await httpResult(name, options); 152 | 153 | if (result.code == 1) { 154 | DoubleLog(`${name}:${result.msg} ,获得 ${result.data.get_rice_num} 大米`); 155 | await utils.wait(3); 156 | 157 | } else if (result.code == 0) { 158 | DoubleLog(`${name}:${result.msg}`); 159 | } else { 160 | DoubleLog(`${name}: 失败❌了呢`); 161 | console.log(result); 162 | } 163 | } 164 | 165 | 166 | // 任务列表 get 167 | async task_list(name) { 168 | let options = { 169 | method: "get", 170 | url: `${apiname}/task/index`, 171 | headers: sbr_hd, 172 | }; 173 | let result = await httpResult(name, options); 174 | 175 | 176 | // console.log(result); 177 | if (result.code == 1) { 178 | DoubleLog(`${name}:${result.msg}`); 179 | let tasks = result.data 180 | for (let index = 0; index < tasks.length; index++) { 181 | let _id, name, is_finish 182 | [_id, name, is_finish] = [tasks[index].id, tasks[index].name, tasks[index].is_finish] 183 | 184 | if (_id == 6 && is_finish == false) { 185 | await this.get_rice("偷大米") 186 | } else if (_id == 6 && is_finish == true) { 187 | DoubleLog(`今天无法偷大米了, 明天再来吧!`) 188 | } 189 | if (_id == 8 && tasks[index].list[0].is_finish == false) { 190 | await this.browse_recipes("浏览菜谱") 191 | } else if (_id == 8 && tasks[index].list[0].is_finish == true) { 192 | DoubleLog(`今天完成 浏览菜谱 了, 明天再来吧!`) 193 | } 194 | 195 | 196 | } 197 | } else if (result.code == 0) { 198 | DoubleLog(`${name}:${result.msg}`); 199 | } else { 200 | DoubleLog(`${name}: 失败❌了呢`); 201 | console.log(result); 202 | } 203 | } 204 | 205 | // 偷好友大米 206 | async get_rice(name) { 207 | await this.get_id("获取好友大米id") 208 | for (let index = 0; index < _id_list.length; index++) { 209 | let _id = _id_list[index] 210 | let options = { 211 | method: "post", 212 | url: `${apiname}/users/get-rice`, 213 | headers: sbr_hd, 214 | body: `&friend_id=${_id}`, 215 | }; 216 | let result = await httpResult(name, options); 217 | 218 | if (result.code == 1) { 219 | DoubleLog(`${name}:${result.msg} , 当前已有 ${result.data.sign_rice_num} 大米`); 220 | await utils.wait(5); 221 | } else if (result.code == 0) { 222 | DoubleLog(`${name}:${result.msg}`); 223 | } else { 224 | DoubleLog(`${name}: 失败❌了呢`); 225 | console.log(result); 226 | } 227 | 228 | } 229 | 230 | } 231 | 232 | 233 | // 获取好友大米id 234 | async get_id(name) { 235 | let options = { 236 | method: "get", 237 | url: `${apiname}/users/same-city-list`, 238 | headers: sbr_hd, 239 | }; 240 | let result = await httpResult(name, options); 241 | 242 | // console.log(result); 243 | if (result.code == 1) { 244 | _list = result.data 245 | // console.log(_list); 246 | 247 | let arr1 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; 248 | let out = []; 249 | for (let i = 0; i < 3; i++) { 250 | var index = parseInt(Math.random() * arr1.length); 251 | out = out.concat(arr1.splice(index, 1)); 252 | } 253 | // console.log(out); 254 | _id_list = [] 255 | for (let index = 0; index < out.length; index++) { 256 | let _id = _list[out[index]].id 257 | _id_list.push(_id) 258 | } 259 | // console.log(_id_list); 260 | 261 | return _id_list; 262 | } else { 263 | DoubleLog(`${name}: 失败❌了呢`); 264 | console.log(result); 265 | } 266 | } 267 | 268 | // 浏览菜谱 https://growrice.supor.com/rice/backend/public/index.php/api/task/link-task 269 | async browse_recipes(name) { 270 | let options = { 271 | method: "post", 272 | url: `${apiname}/task/link-task`, 273 | headers: sbr_hd, 274 | body: `&id=8&other_id=3`, 275 | }; 276 | let result = await httpResult(name, options); 277 | 278 | // console.log(result); 279 | if (result.code == 1) { 280 | DoubleLog(`${name}:${result.msg}`); 281 | await utils.wait(3) 282 | } else { 283 | DoubleLog(`${name}: 失败❌了呢`); 284 | console.log(result); 285 | } 286 | } 287 | 288 | // 获取可收取大米信息 get 289 | async get_index_info(name) { 290 | let options = { 291 | method: "get", 292 | url: `${apiname}/index/index`, 293 | headers: sbr_hd, 294 | }; 295 | let result = await httpResult(name, options); 296 | 297 | // console.log(result); 298 | let rice_list = result.data.rice_list 299 | if (result.code == 1 && rice_list.length > 0) { 300 | for (let index = 0; index < rice_list.length; index++) { 301 | [_id, num, collect_name] = [rice_list[index].id, rice_list[index].num, rice_list[index].name] 302 | await this.collect_rice("收大米", _id, num, collect_name) 303 | } 304 | } else if (result.code == 1 && rice_list.length == 0) { 305 | DoubleLog(`${name}, 没有可以收获的大米`) 306 | 307 | } else if (result.code == 2) { 308 | DoubleLog(`${result['msg']}, 请自己先打开一次小程序,种大米后在执行脚本!`) 309 | } else { 310 | DoubleLog(`${name}: 失败❌了呢`); 311 | console.log(result); 312 | } 313 | } 314 | 315 | // 收大米 316 | async collect_rice(name, _id, num, collect_name) { 317 | let options = { 318 | method: "post", 319 | url: `${apiname}/index/collect-rice`, 320 | headers: sbr_hd, 321 | body: `&id=${_id}`, 322 | }; 323 | let result = await httpResult(name, options); 324 | 325 | // console.log(result); 326 | if (result.code == 1) { 327 | DoubleLog(`${name}: 收取 ${collect_name} ${num} 大米, ${result.msg}`); 328 | await utils.wait(5) 329 | } else if (result.code == 0) { 330 | DoubleLog(`${name}: ${result.msg}`); 331 | } else { 332 | DoubleLog(`${name}: 失败❌了呢`); 333 | console.log(result); 334 | } 335 | } 336 | 337 | // 抽奖信息 get 338 | async prize_Info(name) { 339 | let options = { 340 | method: "get", 341 | url: `${apiname}/prize/index`, 342 | headers: sbr_hd, 343 | }; 344 | let result = await httpResult(name, options); 345 | 346 | // console.log(result); 347 | if (result.code == 1) { 348 | DoubleLog(`${name}, 抽奖券${result.data.draw_num_1}张, 高级抽奖券${result.data.draw_num_2}张`) 349 | if (result.data.draw_num_1 > 0) { 350 | await this.prize('普通抽奖', '1') 351 | } 352 | if (result.data.draw_num_2 > 0) { 353 | await this.prize('高级抽奖', '2') 354 | } 355 | if (result.data.draw_num_1 == 0 && result.data.draw_num_2 == 0) { 356 | DoubleLog(`${name}:暂时无抽奖次数!`) 357 | } 358 | 359 | } else { 360 | DoubleLog(`${name}: 失败❌了呢`); 361 | console.log(result); 362 | } 363 | } 364 | 365 | // 抽奖 https://growrice.supor.com/rice/backend/public/index.php/api/prize/draw 366 | async prize(name, type) { 367 | let options = { 368 | method: "post", 369 | url: `${apiname}/prize/draw`, 370 | headers: sbr_hd, 371 | body: `cate=${type}`, 372 | }; 373 | let result = await httpResult(name, options); 374 | 375 | // console.log(result); 376 | if (result.code == 1) { 377 | let prize_info = result.data.prize_info 378 | DoubleLog(`${name}: 获得 ${prize_info.prize_name} , 奖品id: ${prize_info.prize_id}, 奖品类型: ${prize_info.prize_type}, 奖品数量: ${prize_info.prize_value}`); 379 | await utils.wait(5) 380 | await this.prize_Info('抽奖信息') 381 | } else if (result.code == 0) { 382 | DoubleLog(`${name}: ${result.msg}`); 383 | await this.prize_Info('抽奖信息') 384 | } else { 385 | DoubleLog(`${name}: 失败❌了呢`); 386 | console.log(result); 387 | } 388 | } 389 | 390 | 391 | // 查询大米数量 get https://growrice.supor.com/rice/backend/public/index.php/api/index/granary?&page=1&pagesize=10 392 | async rice_num(name) { 393 | let options = { 394 | method: "get", 395 | url: `${apiname}/index/granary?&page=1&pagesize=10`, 396 | headers: sbr_hd, 397 | }; 398 | let result = await httpResult(name, options); 399 | 400 | // console.log(result); 401 | if (result.code == 1) { 402 | DoubleLog(`${name}, 现在有${result.data.rice_num} 大米 , 累计获取 ${result.data.total_num} 大米`) 403 | } else { 404 | DoubleLog(`${name}: 失败❌了呢`); 405 | console.log(result); 406 | } 407 | } 408 | 409 | 410 | } 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | // #region ******************************************************** 固定代码 ******************************************************** 427 | 428 | /** 429 | * 账号处理 430 | */ 431 | !(async () => { 432 | let ckArr = await utils.checkEnv(ckStr, alias_name); 433 | await tips(ckArr); 434 | for (let index = 0; index < ckArr.length; index++) { 435 | let num = index + 1; 436 | DoubleLog(`\n-------- 开始【第 ${num} 个账号】--------`); 437 | ck = ckArr[index].split("&"); 438 | await start(); 439 | } 440 | await SendMsg(msg); 441 | })() 442 | .catch((e) => console.log(e)) 443 | .finally(() => $.done()); 444 | 445 | 446 | function Env(name, e) { class s { constructor(name) { this.env = name; } } return new (class { constructor(name) { (this.name = name), (this.logs = []), (this.startTime = new Date().getTime()), this.log(`\n🔔${this.name}, 开始!`); } isNode() { return "undefined" != typeof module && !!module.exports; } log(...name) { name.length > 0 && (this.logs = [...this.logs, ...name]), console.log(name.join(this.logSeparator)); } done() { const e = new Date().getTime(), s = (e - this.startTime) / 1e3; this.log(`\n🔔${this.name}, 结束! 🕛 ${s} 秒`); } })(name, e); } async function httpResult(name, options) { if (!name) { name = /function\s*(\w*)/i.exec(arguments.callee.toString())[1]; } try { let result = await utils.httpRequest(name, options); if (result) { return result; } { DoubleLog(`未知错误(1)`); } } catch (error) { console.log(error); } } async function SendMsg(message) { if (!message) return; if (Notify > 0) { if ($.isNode()) { var notify = require("./sendNotify"); await notify.sendNotify($.name, message); } else { console.log($.name, "", message); } } else { console.log(message); } } function wait(n) { return new Promise(function (resolve) { setTimeout(resolve, n * 1000); }); } function DoubleLog(data) { console.log(` ${data}`); msg += `\n ${data}`; } 447 | //#endregion 448 | -------------------------------------------------------------------------------- /UnValid/趣闲赚.js: -------------------------------------------------------------------------------- 1 | /* 2 | @肥皂 3.22 闲趣赚 一天0.1-0.4或者更高(根据用户等级增加任务次数) 3 | 3.24 更新加入用户余额和信息。。。。 4 | 苹果&安卓下载地址:复制链接到微信打开 https://a.jrpub.cn/3345249 5 | 新人进去直接秒到账两个0.3.。。。(微信登录)花两分钟再完成下新人任务,大概秒到微信3元左右 6 | 感觉看账号等级,我的小号进去只能做五个任务,大号可以做十个。 7 | 建议做一下里面的任务,单价还是不错的,做完等级升上来了挂脚本收益也多一点。 8 | 抓取域名 wap.quxianzhuan.com 抓取cookie的全部数据。。 9 | 青龙变量 xqzck 多账户@隔开 10 | 更新加入用户余额和信息。。。。 11 | 12 | const $ = new Env("闲趣赚"); 13 | */ 14 | var _0xodm='jsjiami.com.v6',_0xodm_=['‮_0xodm'],_0x47f7=[_0xodm,'IsOGIMKifQ==','PMOQw4A=','w4c3f8O7wrQ=','ZemVnOi3vei3rOS4jeWLp++9mQ==','WBDCuiI=','wpDCpicUwr8=','wqjplb7otprotZrkua7liKjvvbo=','w5/DocKtEwc=','eDHCiUIhHwVmw7DCvMK4axzDjsOiwqLCjy/Dp8KrDsOww68wwoJbwrQ6w48aUDkJ','acKCVMOEBQ==','F1rDqsKSwowJw5XDgsOrw5XDg0NzS8Kdw4FGwrrCpQvDgsK6Bg3CsWDDg8KUcMKFwrLDuC8nwoE3MMKmwrczw5jCu8KJwrdEw6LCqMOdU8ORw6p3woLCihjDmsKrSFrDjlNGQ8KmQBHCkgYxCsOQwr8Ow4bCo19uwp7DvcOaV8KnRcKNKMOPUUg1w5HDtcKTAMOSw6LDtAs2RsOJw7xNOHzClcKEw7sywo7CgsODBk/Dr3EOdcKjD8Ktwrhpw7gLwpwNJcKMwopDw6QNdSbCvXjCjEMlwo5Jdj1RwopQQwHDtH3DtsOLwrksw6ltNg7CshZfK2p+w5IywoNDXsOHwrDCtgXDhMOqwrLCrsKLw4oIw5HDlMOOwqsOw4vCoMKVZsOYw7Ehw5TDqsOpwpLCksKPcC3CjMKgFg7CkS1pFMOzRH8oMcKxfcOLw4sIw7jCjDjCgsK6XsOSw6PDkjTDvcOUb8O8WMKMw5R9HsKmwrjDgsKrw5chwq9DaFYfwpDDtDrDo3JiDDNbw7/Cg8Kiw4FSw7vDg8OfJiI+N8OwZTzDsMKUw7rCsgoAworCozjDvMKqCsKow4XCjcK+wp4lwr/DhSkmw7x0wo7Cj8OOfBIRwoVywoJOw49lZQnDt2RGQMKIEsK5PHBdWcKJIsKqwqY8L8O5w5VdKsKsSX9OwpdDw6rCvsO9wooBGMK8aMO5FRdOwoEjJMKUwrsjdCPCpMKdRMO4wopQbsOxw6zCl8KVwq/CuTwbf8KTwpF1FWxgIHklwqIQcMKFwo0UwoBxw7lqwqjDtcK5QsKzw7PCpcOqRsOGw7BbLiXDqMOwQj3CqExPwqocKyjDncKLw6LCpsOkwqEJwp9HworCrcOAwo/DusKAEsOHwrJ3w7fCllUPTMONw6HCjgXCpiLDjcOhwqPCgA3DusOrwrgDw7bChsK7wqlPw5lzw6PDmsKUw5cew4HCjDbCmx/CmMONwqB9U0UcwpvDg3zDqwkOw5cZw40/GMO5w47DvnbCvRNEwosMPSdPw6B5w4ouw6oPwp7Dj0lWBMOKw7lsbx7ClsK6wqdAwr9bF8KUfw3DksKQJj4NwqR3wqnDpjZFw5vDsgTCjTbCggLCpRoAw6zCmBw8w60Sw6vClRDCsMKAw7TDsVTDlmE9w6bCicKmw519VVHCs1IKwqrClk/DmMOYOGzCuyNZwqBdVMKOw47CnsKswprDhkbCtDTCghQbTsK6UsOWw7nCtlkXwqNpAAzDlg7Cun3Ct8OFwpw9woIPCMKhwownwoVPQ8KTQDHCgz/DoXcyL2ZBwqhXw5bDrMOvFmnDncKow4XCk8OCwojCjF3CjCB7w6/CqyfClGsfw7F4IQ9FwoNFw7dhbMKON3QOLMKIwpDClTIHa8OAwrjDmV3Cv2oaIMOxw4LClygnE1x2MDjDlUNFwrAdw7zDlSPDusKXKmFXw4VHRMOUAEwOwpfDjDcabnLDiMK2C2gcwq/DrgBEw63Dm8OBwpoEwoBFTMOwwojCnWDDiWDCmMK1AMOoTjhBw4hHw7/CgHRYwrw0HcKbwpM5wrQbBhJcYcKjwrkqQcOEw7cAw6Irw4XDn05kwoBuw7p6HA3CuMOVMQ==','w7Y0Cw==','Uh5uD8KS','W+mVs+i0qui2oOmesuS4t+eUp+aIt++/j+ODhQ==','a8OiVcK4Og==','TR50CMKVw4g=','6Zej6La76LeZA8KIwr1A','wozCnsKAw6hmMQ==','w4M9VmF5wr54IyM=','w5I9ZQ==','w5TDp8KOPyA=','wp7DmcK2w7TCk8KzwpzDmEo=','w5HDgD8rwp4=','HyjChcOHJQ==','QT7CuhjCoQ==','dTNXIcKc','w5QCSmYm','w68eZsOew5E=','w7AMaw==','wo/CoRQtwrjCpE10w5Vawoshwr4o5Yee','w7AGYkkiwpc=','5Lme6Lac5YyVejfCogJmIsK8FgXCmFtsBsKt','w7YgeGRc','F8Ouw6bCi8KO','wo3ClC4Aw6Q=','GcO3BcKFew==','HcOPMMOSwpkr','w5rDni3DqMO8','Az7DrA==','fuW+uuWkqeOBh+mXqOi0rOi1tQ==','wrPCthITw48=','PsOww45ww5k=','w4fDtinDiTA=','PcOdJg==','wp3plK7oto7otrbpnabkuIXnlrzmioTvv6XjgY0=','44K5wrhGwrDljYbmjaPnjKPkv5rpoa7jgI0=','cyTCiVE6','w4TDtwzDlcObw4E=','w4bDo1dl','wrrCiMKiw7dw','aCLDtcOhWA==','w7nDh8KM','YOmUrOi3gei3ieS4tuWKh++9kg==','wrLCrAIGw4TCvXrDm8KwwqwKw7PDvcKqVMOHTMO9I3otIcOow6hrG0xhwpHDu8OJwpUtMijDkA7DhEDCi18hWy1ZwoEAb8KLw5DCgnDCkcO7F8Kfw6pQw7vCjMKTDB5Mbj8=','HzDDuRAM','wrjCsMKZ','elDDkl9n','XlAwBcKa','PgzCocOLDw==','w4DDl1srYQ==','w6/DqVREQg==','PMObw5wUKQ==','EMKcwp1ybg==','56+75bybA0jnp5fnubXnu4Hku7/kuoHku7bliq0=','w47DuEFpSw==','wqPDrsKhw7PCsw==','eA7Cp8OJFA==','w5nDpXBJWw==','w6fDgcKbNB8=','dyDChMOUJFk4bnY7wq4fBULCksKFw4ROw708wp/DksK7bHA9C8O0RsKyHcO9wr7Cun1RwrTCsgrDo14XFHPCm8OQQMOKw5M=','e8OEw6/DgE5hwoDDk8O3woE=','wroFY1w7wpdUwoHCtcKP','w7zChg80wod0w7BUwrQ=','wq/CusKeTA==','EMOGw47CkMKT','BUZabMK3','GcObwpY0cg==','44C+UcO+duWMguaMu+eMo+S+j+mhuOOCig==','ejFsjigbbaCUmiuU.coDSKm.WGtWv6=='];if(function(_0x2d158c,_0x5267c3,_0x228c42){function _0x247644(_0x3a135d,_0x2a2af7,_0x49ff78,_0x19dbdb,_0x48e387,_0x1d2c4f){_0x2a2af7=_0x2a2af7>>0x8,_0x48e387='po';var _0x2c4df0='shift',_0x4548da='push',_0x1d2c4f='‮';if(_0x2a2af7<_0x3a135d){while(--_0x3a135d){_0x19dbdb=_0x2d158c[_0x2c4df0]();if(_0x2a2af7===_0x3a135d&&_0x1d2c4f==='‮'&&_0x1d2c4f['length']===0x1){_0x2a2af7=_0x19dbdb,_0x49ff78=_0x2d158c[_0x48e387+'p']();}else if(_0x2a2af7&&_0x49ff78['replace'](/[eFgbbCUuUDSKWGtW=]/g,'')===_0x2a2af7){_0x2d158c[_0x4548da](_0x19dbdb);}}_0x2d158c[_0x4548da](_0x2d158c[_0x2c4df0]());}return 0xd98cb;};return _0x247644(++_0x5267c3,_0x228c42)>>_0x5267c3^_0x228c42;}(_0x47f7,0xfa,0xfa00),_0x47f7){_0xodm_=_0x47f7['length']^0xfa;};function _0x39d2(_0x14a187,_0x2c8b59){_0x14a187=~~'0x'['concat'](_0x14a187['slice'](0x1));var _0x1dcceb=_0x47f7[_0x14a187];if(_0x39d2['cyBWSE']===undefined){(function(){var _0x5620f1=typeof window!=='undefined'?window:typeof process==='object'&&typeof require==='function'&&typeof global==='object'?global:this;var _0x28fd2d='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';_0x5620f1['atob']||(_0x5620f1['atob']=function(_0x36d503){var _0x27a8c2=String(_0x36d503)['replace'](/=+$/,'');for(var _0x14c4b5=0x0,_0x398741,_0x2e0bac,_0x341908=0x0,_0x13699b='';_0x2e0bac=_0x27a8c2['charAt'](_0x341908++);~_0x2e0bac&&(_0x398741=_0x14c4b5%0x4?_0x398741*0x40+_0x2e0bac:_0x2e0bac,_0x14c4b5++%0x4)?_0x13699b+=String['fromCharCode'](0xff&_0x398741>>(-0x2*_0x14c4b5&0x6)):0x0){_0x2e0bac=_0x28fd2d['indexOf'](_0x2e0bac);}return _0x13699b;});}());function _0x145597(_0x433724,_0x2c8b59){var _0x5de13e=[],_0x205ea1=0x0,_0x52aed6,_0x39de4b='',_0x63fd89='';_0x433724=atob(_0x433724);for(var _0x385398=0x0,_0x532dd4=_0x433724['length'];_0x385398<_0x532dd4;_0x385398++){_0x63fd89+='%'+('00'+_0x433724['charCodeAt'](_0x385398)['toString'](0x10))['slice'](-0x2);}_0x433724=decodeURIComponent(_0x63fd89);for(var _0x2218a7=0x0;_0x2218a7<0x100;_0x2218a7++){_0x5de13e[_0x2218a7]=_0x2218a7;}for(_0x2218a7=0x0;_0x2218a7<0x100;_0x2218a7++){_0x205ea1=(_0x205ea1+_0x5de13e[_0x2218a7]+_0x2c8b59['charCodeAt'](_0x2218a7%_0x2c8b59['length']))%0x100;_0x52aed6=_0x5de13e[_0x2218a7];_0x5de13e[_0x2218a7]=_0x5de13e[_0x205ea1];_0x5de13e[_0x205ea1]=_0x52aed6;}_0x2218a7=0x0;_0x205ea1=0x0;for(var _0x3915c7=0x0;_0x3915c7<_0x433724['length'];_0x3915c7++){_0x2218a7=(_0x2218a7+0x1)%0x100;_0x205ea1=(_0x205ea1+_0x5de13e[_0x2218a7])%0x100;_0x52aed6=_0x5de13e[_0x2218a7];_0x5de13e[_0x2218a7]=_0x5de13e[_0x205ea1];_0x5de13e[_0x205ea1]=_0x52aed6;_0x39de4b+=String['fromCharCode'](_0x433724['charCodeAt'](_0x3915c7)^_0x5de13e[(_0x5de13e[_0x2218a7]+_0x5de13e[_0x205ea1])%0x100]);}return _0x39de4b;}_0x39d2['weUfxi']=_0x145597;_0x39d2['eNnPgT']={};_0x39d2['cyBWSE']=!![];}var _0x36f452=_0x39d2['eNnPgT'][_0x14a187];if(_0x36f452===undefined){if(_0x39d2['zGiWHB']===undefined){_0x39d2['zGiWHB']=!![];}_0x1dcceb=_0x39d2['weUfxi'](_0x1dcceb,_0x2c8b59);_0x39d2['eNnPgT'][_0x14a187]=_0x1dcceb;}else{_0x1dcceb=_0x36f452;}return _0x1dcceb;};const $=new Env(_0x39d2('‮0','XzrC'));let status;status=(status=$[_0x39d2('‮1','#4H(')](_0x39d2('‮2','uIh3'))||'1')>0x1?''+status:'';let xqzckArr=[],xqzcount='';let xqzck=($['isNode']()?process[_0x39d2('‫3','weK&')]['xqzck']:$['getdata']('xqzck'))||'';let xqzid='',xqztk='';!(async()=>{var _0x55a7c1={'orBje':function(_0x3d9df1){return _0x3d9df1();},'WLXvS':function(_0x59adb7,_0x5f06d4,_0x142623){return _0x59adb7(_0x5f06d4,_0x142623);},'mCwUH':function(_0x1c7e11,_0x16d57c){return _0x1c7e11+_0x16d57c;},'HEDSc':function(_0x1f5d99,_0x5cba52){return _0x1f5d99*_0x5cba52;},'rFFxU':function(_0x6159b8,_0x5668d1){return _0x6159b8-_0x5668d1;},'FFWmu':function(_0xcefed9,_0x245794){return _0xcefed9!==_0x245794;},'MyPAY':'VkgaL','nOiNL':function(_0x33e25c){return _0x33e25c();},'JLMMf':'LcqgK','MlTvQ':function(_0x16c644,_0xb3e2de){return _0x16c644!==_0xb3e2de;},'Fooqo':_0x39d2('‫4','EUbI'),'JpigR':function(_0x52bc02){return _0x52bc02();}};if(typeof $request!==_0x39d2('‫5','KA3y')){if(_0x55a7c1[_0x39d2('‫6','%iIs')](_0x55a7c1['MyPAY'],'VkgaL')){_0x55a7c1[_0x39d2('‮7','v0Nn')](resolve);}else{await _0x55a7c1[_0x39d2('‫8','GV6i')](xqzck);}}else{if(_0x55a7c1[_0x39d2('‮9','JUv5')]!==_0x39d2('‮a','qAxn')){xqzckArr=xqzck[_0x39d2('‮b','RHFD')]('@');console[_0x39d2('‮c','qAxn')](_0x39d2('‮d','z[7J')+xqzckArr[_0x39d2('‫e','qAxn')]+_0x39d2('‫f',']!Q4'));for(let _0x2c0f0c=0x0;_0x2c0f0c/)[0x1];console[_0x39d2('‮1b','lZuR')](_0x39d2('‮1c','*ScD')+_0x5497b6+_0x39d2('‮1d','F)D0')+_0x5e3e9e+'】');}}})()[_0x39d2('‫1e','K94p')](_0x848d15=>$[_0x39d2('‮1f','F)D0')](_0x848d15))['finally'](()=>$[_0x39d2('‫20','z[7J')]());function xqzlb(_0x8d8167=0x0){var _0x3bf983={'NVffO':function(_0x434d83,_0x1d93f5){return _0x434d83+_0x1d93f5;},'bCdXO':function(_0x54e068){return _0x54e068();},'rIiSd':function(_0x47304e,_0x49bb07){return _0x47304e===_0x49bb07;},'XytsM':'lDtXA','QsViw':function(_0x14a394,_0x4e71ae){return _0x14a394===_0x4e71ae;},'FAXle':'wGNFK'};return new Promise(_0x28fe4c=>{if(_0x3bf983[_0x39d2('‫21','#4H(')](_0x3bf983[_0x39d2('‮22','a)uq')],'NHhEC')){console[_0x39d2('‮23','EUbI')](_0x39d2('‮24','fwM@')+result['msg']);}else{let _0x3df897={'url':_0x39d2('‫25','A#B#'),'headers':JSON[_0x39d2('‫26','nY6I')]('{\x22Host\x22:\x22wap.quxianzhuan.com\x22,\x22Connection\x22:\x22keep-alive\x22,\x22Upgrade-Insecure-Requests\x22:\x221\x22,\x22User-Agent\x22:\x22Mozilla/5.0\x20(Linux;\x20Android\x2010;\x2016s\x20Pro\x20Build/QKQ1.191222.002;\x20wv)\x20AppleWebKit/537.36\x20(KHTML,\x20like\x20Gecko)\x20Version/4.0\x20Chrome/83.0.4103.106\x20Mobile\x20Safari/537.36\x20\x20XiaoMi/MiuiBrowser/10.8.1\x20LT-APP/44/200\x22,\x22Accept\x22:\x22text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9\x22,\x22x-app\x22:\x2296c1ea5a-9a52-44c9-8ac4-8dceafa065c8\x22,\x22X-Requested-With\x22:\x22com.quxianzhuan.wap\x22,\x22Sec-Fetch-Site\x22:\x22none\x22,\x22Sec-Fetch-Mode\x22:\x22navigate\x22,\x22Sec-Fetch-User\x22:\x22?1\x22,\x22Sec-Fetch-Dest\x22:\x22document\x22,\x22Referer\x22:\x22https://wap.quxianzhuan.com/reward/list/?xapp-target=blank\x22,\x22Accept-Encoding\x22:\x22gzip,\x20deflate\x22,\x22Accept-Language\x22:\x22zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7\x22,\x22Cookie\x22:\x22'+xqzck+'\x22}')};$[_0x39d2('‫27','D[2Z')](_0x3df897,async(_0x190220,_0x3af933,_0x409111)=>{var _0x1d5449={'khrUf':function(_0x56d23f){return _0x56d23f();}};try{xqzid=_0x409111[_0x39d2('‫28','vIQK')](/reward_id":"(\d+)",/)[0x1];xqztk=xqzck[_0x39d2('‮29','MJIk')](/tzb_formhash_cookie=(\w+);/)[0x1];console[_0x39d2('‮c','qAxn')](_0x3bf983[_0x39d2('‮2a','v0Nn')]('\x0a闲趣赚匹配任务ID:',xqzid));await _0x3bf983['bCdXO'](xqzrw);}catch(_0x32f4e6){}finally{if(_0x3bf983[_0x39d2('‮2b','IKE$')](_0x39d2('‮2c','6#ww'),_0x3bf983[_0x39d2('‫2d','wh%A')])){_0x28fe4c();}else{_0x1d5449[_0x39d2('‫2e','Lb&R')](_0x28fe4c);}}},_0x8d8167);}});}function xqzrw(_0x2888ee=0x0){var _0x5ea225={'gZWmC':function(_0x53beb3,_0x918b3c){return _0x53beb3+_0x918b3c;},'ZHPUX':_0x39d2('‮2f','IKE$'),'tqjiW':function(_0x1277a6){return _0x1277a6();},'ripfJ':_0x39d2('‫30','6#ww')};return new Promise(_0x41ce33=>{var _0x4b087c={'ZLCPS':_0x39d2('‮31','KA3y'),'NjTne':function(_0x1bf7c4,_0x3e6c23){return _0x1bf7c4==_0x3e6c23;},'sSGZa':function(_0x1e0e2f,_0x32be6d){return _0x1e0e2f+_0x32be6d;},'pdleX':function(_0x1b23d9,_0x23a9f1){return _0x5ea225[_0x39d2('‮32','Ve8i')](_0x1b23d9,_0x23a9f1);},'coVjE':_0x5ea225[_0x39d2('‫33','6#ww')],'JIFAR':function(_0x32f184){return _0x5ea225['tqjiW'](_0x32f184);},'MARWE':_0x5ea225[_0x39d2('‮34','EUbI')]};let _0x579dd9={'url':_0x39d2('‮35','Ve8i'),'headers':JSON['parse']('{\x22Host\x22:\x22wap.quxianzhuan.com\x22,\x22Connection\x22:\x22keep-alive\x22,\x22Upgrade-Insecure-Requests\x22:\x221\x22,\x22User-Agent\x22:\x22Mozilla/5.0\x20(Linux;\x20Android\x2010;\x2016s\x20Pro\x20Build/QKQ1.191222.002;\x20wv)\x20AppleWebKit/537.36\x20(KHTML,\x20like\x20Gecko)\x20Version/4.0\x20Chrome/83.0.4103.106\x20Mobile\x20Safari/537.36\x20\x20XiaoMi/MiuiBrowser/10.8.1\x20LT-APP/44/200\x22,\x22Accept\x22:\x22text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9\x22,\x22x-app\x22:\x2296c1ea5a-9a52-44c9-8ac4-8dceafa065c8\x22,\x22X-Requested-With\x22:\x22com.quxianzhuan.wap\x22,\x22Sec-Fetch-Site\x22:\x22none\x22,\x22Sec-Fetch-Mode\x22:\x22navigate\x22,\x22Sec-Fetch-User\x22:\x22?1\x22,\x22Sec-Fetch-Dest\x22:\x22document\x22,\x22Referer\x22:\x22https://wap.quxianzhuan.com/reward/list/?xapp-target=blank\x22,\x22Accept-Encoding\x22:\x22gzip,\x20deflate\x22,\x22Accept-Language\x22:\x22zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7\x22,\x22Cookie\x22:\x22'+xqzck+'\x22}'),'body':_0x39d2('‫36','MPxS')+xqzid+_0x39d2('‫37','qAxn')+xqztk+_0x39d2('‫38','mVvS')};$[_0x39d2('‮39','D[2Z')](_0x579dd9,async(_0x216874,_0x50e484,_0x53fa76)=>{if(_0x39d2('‫3a','NiW#')===_0x4b087c['ZLCPS']){try{let _0x4dbc7e=_0x53fa76[_0x39d2('‫3b','YLkM')](/available_money":(.+?),"/)[0x1];let _0x6e63b2=_0x53fa76[_0x39d2('‮3c',']!Q4')](/UID:(.+?)\<\/span\>/)[0x1];console['log']('\x0a闲趣赚靓仔用户:【'+_0x6e63b2+_0x39d2('‫3d','GV6i')+_0x4dbc7e+'】');}catch(_0x20e178){}finally{_0x41ce33();}}else{try{const _0x35ebda=JSON['parse'](_0x53fa76);if(_0x4b087c['NjTne'](_0x35ebda[_0x39d2('‫3e','lZuR')],0x1)){console[_0x39d2('‮3f','GlR)')](_0x4b087c['sSGZa'](_0x4b087c[_0x39d2('‮40','weK&')](_0x39d2('‫41','K@)D'),_0x35ebda['msg']),_0x4b087c['coVjE']));await $[_0x39d2('‮42','GV6i')](0x2af8);await _0x4b087c[_0x39d2('‮43','mVvS')](xqzlb);}else{console['log'](_0x39d2('‫44','z[7J')+_0x35ebda['msg']);}}catch(_0x1ec8c9){}finally{if('xdnrf'!==_0x4b087c['MARWE']){_0x4b087c[_0x39d2('‫45','EUbI')](_0x41ce33);}else{_0x41ce33();}}}},_0x2888ee);});}function xqzxx(_0x330473=0x0){return new Promise(_0x51f24f=>{let _0x54f1fa={'url':_0x39d2('‫46','K94p'),'headers':JSON[_0x39d2('‫47','GPfi')](_0x39d2('‫48','s[%2')+xqzck+'\x22}')};$[_0x39d2('‫49','PP[x')](_0x54f1fa,async(_0x3bfce3,_0x1a61ad,_0x4ac891)=>{try{let _0x31cd8c=_0x4ac891['match'](/available_money":(.+?),"/)[0x1];let _0x318a42=_0x4ac891[_0x39d2('‫4a','JUv5')](/UID:(.+?)\<\/span\>/)[0x1];console['log'](_0x39d2('‮4b','NiW#')+_0x318a42+'】\x20-\x20可提现余额【'+_0x31cd8c+'】');}catch(_0x147b1e){}finally{_0x51f24f();}},_0x330473);});}function rand(_0x55047e,_0x5f4ee9){var _0x253226={'ggzfO':function(_0x217605,_0x739a8,_0x25f69f){return _0x217605(_0x739a8,_0x25f69f);},'fwQfS':function(_0x52c6b1,_0x59640f){return _0x52c6b1+_0x59640f;},'SwwXA':function(_0x3efd66,_0x4d12ef){return _0x3efd66-_0x4d12ef;}};return _0x253226[_0x39d2('‮4c','bV^@')](parseInt,_0x253226['fwQfS'](Math[_0x39d2('‫4d','JUv5')]()*(_0x253226['SwwXA'](_0x5f4ee9,_0x55047e)+0x1),_0x55047e),0xa);};_0xodm='jsjiami.com.v6'; 15 | function Env(t, e) { class s { constructor(t) { this.env = t } send(t, e = "GET") { t = "string" == typeof t ? { url: t } : t; let s = this.get; return "POST" === e && (s = this.post), new Promise((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } get(t) { return this.send.call(this.env, t) } post(t) { return this.send.call(this.env, t, "POST") } } return new class { constructor(t, e) { this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `\ud83d\udd14${this.name}, \u5f00\u59cb!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } isSurge() { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon() { return "undefined" != typeof $loon } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson(t, e) { let s = e; const i = this.getdata(t); if (i) try { s = JSON.parse(this.getdata(t)) } catch { } return s } setjson(t, e) { try { return this.setdata(JSON.stringify(t), e) } catch { return !1 } } getScript(t) { return new Promise(e => { this.get({ url: t }, (t, s, i) => e(i)) }) } runScript(t, e) { return new Promise(s => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; const [o, h] = i.split("@"), a = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(a, (t, e, i) => s(i)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e); if (!s && !i) return {}; { const i = s ? t : e; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of i) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, e, s) { return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; try { const e = JSON.parse(h); this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const o = {}; this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) } } else s = this.setval(t, e); return s } getval(t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null } setval(t, e) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null } initGotEnv(t) { this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) } get(t, e = (() => { })) { t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t) { let e = { "M+": (new Date).getMonth() + 1, "d+": (new Date).getDate(), "H+": (new Date).getHours(), "m+": (new Date).getMinutes(), "s+": (new Date).getSeconds(), "q+": Math.floor(((new Date).getMonth() + 3) / 3), S: (new Date).getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, ((new Date).getFullYear() + "").substr(4 - RegExp.$1.length))); for (let s in e) new RegExp("(" + s + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? e[s] : ("00" + e[s]).substr(("" + e[s]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))); let h = ["", "==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="]; h.push(e), s && h.push(s), i && h.push(i), console.log(h.join("\n")), this.logs = this.logs.concat(h) } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t.stack) : this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) } 16 | -------------------------------------------------------------------------------- /UnValid/阿里云盘连续签到活动.js: -------------------------------------------------------------------------------- 1 | //阿里云盘连续签到活动 2 | //https://alist.nn.ci/zh/guide/drivers/aliyundrive.html 打开页面扫码获取refresh_token 3 | //环境变量:ALI_TOKEN,多账号用换行或@或&分隔 4 | const $ = API(); 5 | let refresh_token = []; 6 | refresh_token='eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiI1OTJjYjBjN2NkNWY0NzQzYWFhY2IwZjNlZDUxMTZhNyIsImF1ZCI6Ijc2OTE3Y2NjY2Q0NDQxYzM5NDU3YTA0ZjYwODRmYjJmIiwiZXhwIjoxNzM2NTk3NDQ4LCJpYXQiOjE3Mjg4MjE0NDgsImp0aSI6ImM0Y2Y1NjRkMjY4NzQ3NGNhYmUwMTJmN2I5NjA4MmNhIn0.jQtJKjfF_hZzcabLBt4Vfor_cdJe1GuwIFWFdBhFotgjEsFTMyhf8sJfIK-GYCX2-2Mx3I208dzQNmTGLBjpFw' 7 | 8 | let msg = []; 9 | !(async () => { 10 | 11 | if ($.env.isNode) { 12 | if (process.env.ALI_TOKEN) { 13 | if (process.env.ALI_TOKEN.indexOf('&') > -1) { 14 | refresh_token = process.env.ALI_TOKEN.split('&'); 15 | } else if (process.env.ALI_TOKEN.indexOf('\n') > -1) { 16 | refresh_token = process.env.ALI_TOKEN.split('\n'); 17 | } else if (process.env.ALI_TOKEN.indexOf('@') > -1) { 18 | refresh_token = process.env.ALI_TOKEN.split('@'); 19 | } else { 20 | refresh_token = [process.env.ALI_TOKEN]; 21 | } 22 | } 23 | } 24 | 25 | if (!refresh_token || refresh_token.length == 0) { 26 | console.log('先填写refresh_token!'); 27 | return; 28 | } 29 | for (const tk of refresh_token) { 30 | msg = []; 31 | await main(tk); 32 | await $.wait(1000); 33 | } 34 | 35 | })().catch(async (e) => { 36 | console.log('', '❌失败! 原因:' + e + '!', ''); 37 | }).finally(() => { 38 | $.done(); 39 | }); 40 | 41 | async function main(tk) { 42 | try { 43 | const url = `https://auth.aliyundrive.com/v2/account/token`; 44 | const method = `POST`; 45 | const headers = { 46 | 'Connection': `keep-alive`, 47 | 'Content-Type': `application/json; charset=UTF-8`, 48 | 'X-Canary': `client=iOS,app=adrive,version=v4.1.3`, 49 | 'User-Agent': `AliApp(AYSD/4.1.3) com.alicloud.smartdrive/4.1.3 Version/16.3 Channel/201200 Language/zh-Hans-CN /iOS Mobile/iPhone15,2`, 50 | 'Host': `auth.aliyundrive.com`, 51 | 'Accept-Language': `zh-CN,zh-Hans;q=0.9`, 52 | 'Accept': `*/*` 53 | }; 54 | const body = `{"grant_type":"refresh_token","app_id":"pJZInNHN2dZWk8qg","refresh_token":"${tk}"}`; 55 | 56 | const myRequest = { 57 | url: url, 58 | method: method, 59 | headers: headers, 60 | body: body 61 | }; 62 | 63 | let a = await $.http.post(myRequest); 64 | let data = JSON.parse(a.body); 65 | if (data.code == 'InvalidParameter.RefreshToken') { 66 | //{"code":"InvalidParameter.RefreshToken","message":"The input parameter refresh_token is not valid. ","requestId":null} 67 | console.log(`token刷新失败,${data.message}`); 68 | msg.push(`token刷新失败,${data.message}`); 69 | } 70 | else { 71 | console.log(data.nick_name); 72 | let token = data.access_token; 73 | msg.push(data.nick_name); 74 | await sign(token); 75 | } 76 | 77 | } catch (error) { 78 | console.log('error:' + error); 79 | } 80 | } 81 | 82 | async function sign(token) { 83 | try { 84 | const url = `https://member.aliyundrive.com/v1/activity/sign_in_list`; 85 | const method = `POST`; 86 | const headers = { 87 | 'Connection': `keep-alive`, 88 | 'Content-Type': `application/json`, 89 | 'Origin': `https://pages.aliyundrive.com`, 90 | 'X-Canary': `client=web,app=other,version=v0.1.0`, 91 | 'User-Agent': `Mozilla/5.0 (iPhone; CPU iPhone OS 16_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/20D5024e iOS16.3 (iPhone15,2;zh-Hans-CN) App/4.1.3 AliApp(yunpan/4.1.3) com.alicloud.smartdrive/28278449 Channel/201200 AliApp(AYSD/4.1.3) com.alicloud.smartdrive/4.1.3 Version/16.3 Channel/201200 Language/zh-Hans-CN /iOS Mobile/iPhone15,2 language/zh-Hans-CN`, 92 | 'Authorization': `Bearer ${token}`, 93 | 'Host': `member.aliyundrive.com`, 94 | 'Referer': `https://pages.aliyundrive.com/`, 95 | 'Accept-Language': `zh-CN,zh-Hans;q=0.9`, 96 | 'Accept': `application/json, text/plain, */*` 97 | }; 98 | const body = `{"isReward":false}`; 99 | 100 | const myRequest = { 101 | url: url, 102 | method: method, 103 | headers: headers, 104 | body: body 105 | }; 106 | let a = await $.http.post(myRequest); 107 | let data = JSON.parse(a.body); 108 | if (data.success) { 109 | console.log(`已连续签到${data.result.signInCount}天!`); 110 | msg.push(`已连续签到${data.result.signInCount}天!`); 111 | await sign_in_reward(token, data.result.signInCount); 112 | } 113 | else { 114 | console.log(`签到失败,${data.message}!`); 115 | msg.push(`签到失败,${data.message}!`); 116 | } 117 | 118 | } catch (error) { 119 | console.log(error); 120 | } 121 | } 122 | 123 | async function sign_in_reward(token, day) { 124 | try { 125 | const url = `https://member.aliyundrive.com/v1/activity/sign_in_reward`; 126 | const method = `POST`; 127 | const headers = { 128 | 'Connection': `keep-alive`, 129 | 'Content-Type': `application/json`, 130 | 'Origin': `https://pages.aliyundrive.com`, 131 | 'X-Canary': `client=web,app=other,version=v0.1.0`, 132 | 'User-Agent': `Mozilla/5.0 (iPhone; CPU iPhone OS 16_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/20D5024e iOS16.3 (iPhone15,2;zh-Hans-CN) App/4.1.3 AliApp(yunpan/4.1.3) com.alicloud.smartdrive/28278449 Channel/201200 AliApp(AYSD/4.1.3) com.alicloud.smartdrive/4.1.3 Version/16.3 Channel/201200 Language/zh-Hans-CN /iOS Mobile/iPhone15,2 language/zh-Hans-CN`, 133 | 'Authorization': `Bearer ${token}`, 134 | 'Host': `member.aliyundrive.com`, 135 | 'Referer': `https://pages.aliyundrive.com/`, 136 | 'Accept-Language': `zh-CN,zh-Hans;q=0.9`, 137 | 'Accept': `application/json, text/plain, */*` 138 | }; 139 | const body = `{"signInDay":${day}}`; 140 | 141 | const myRequest = { 142 | url: url, 143 | method: method, 144 | headers: headers, 145 | body: body 146 | }; 147 | 148 | let a = await $.http.post(myRequest); 149 | let data = JSON.parse(a.body); 150 | if (data.success) { 151 | if (data?.result?.name) { 152 | console.log(`🎁奖励:${data?.result?.name},${data?.result?.description},${data?.result?.notice}!`); 153 | msg.push(`🎁奖励:${data?.result?.name},${data?.result?.description},${data?.result?.notice}!`); 154 | } 155 | else { 156 | console.log(`🎁奖励:领了个寂寞!`); 157 | msg.push(`🎁奖励:领了个寂寞!`); 158 | } 159 | } 160 | else { 161 | console.log(`🎁奖励获取失败:${data.message}!`); 162 | msg.push(`🎁奖励获取失败:${data.message}!`); 163 | } 164 | 165 | try { 166 | if ($.env.isNode) { 167 | const notify = require('./sendNotify'); 168 | notify.sendNotify('【阿里云盘】' + msg[0], msg[1] + ',' + msg[2]); 169 | } 170 | else { 171 | $.notify('【阿里云盘】' + msg[0], msg[1] + ',' + msg[2]); 172 | } 173 | } catch (error) { 174 | console.log('通知发送失败', +error); 175 | } 176 | 177 | } catch (error) { 178 | console.log(error); 179 | } 180 | } 181 | 182 | 183 | /*********************************** API *************************************/ 184 | function ENV() { const e = "undefined" != typeof $task, t = "undefined" != typeof $loon, s = "undefined" != typeof $httpClient && !t, i = "function" == typeof require && "undefined" != typeof $jsbox; return { isQX: e, isLoon: t, isSurge: s, isNode: "function" == typeof require && !i, isJSBox: i, isRequest: "undefined" != typeof $request, isScriptable: "undefined" != typeof importModule } } function HTTP(e = { baseURL: "" }) { const { isQX: t, isLoon: s, isSurge: i, isScriptable: n, isNode: o } = ENV(), r = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&\/\/=]*)/; const u = {}; return ["GET", "POST", "PUT", "DELETE", "HEAD", "OPTIONS", "PATCH"].forEach(l => u[l.toLowerCase()] = (u => (function (u, l) { l = "string" == typeof l ? { url: l } : l; const h = e.baseURL; h && !r.test(l.url || "") && (l.url = h ? h + l.url : l.url); const a = (l = { ...e, ...l }).timeout, c = { onRequest: () => { }, onResponse: e => e, onTimeout: () => { }, ...l.events }; let f, d; if (c.onRequest(u, l), t) f = $task.fetch({ method: u, ...l }); else if (s || i || o) f = new Promise((e, t) => { (o ? require("request") : $httpClient)[u.toLowerCase()](l, (s, i, n) => { s ? t(s) : e({ statusCode: i.status || i.statusCode, headers: i.headers, body: n }) }) }); else if (n) { const e = new Request(l.url); e.method = u, e.headers = l.headers, e.body = l.body, f = new Promise((t, s) => { e.loadString().then(s => { t({ statusCode: e.response.statusCode, headers: e.response.headers, body: s }) }).catch(e => s(e)) }) } const p = a ? new Promise((e, t) => { d = setTimeout(() => (c.onTimeout(), t(`${u} URL: ${l.url} exceeds the timeout ${a} ms`)), a) }) : null; return (p ? Promise.race([p, f]).then(e => (clearTimeout(d), e)) : f).then(e => c.onResponse(e)) })(l, u))), u } function API(e = "untitled", t = !1) { const { isQX: s, isLoon: i, isSurge: n, isNode: o, isJSBox: r, isScriptable: u } = ENV(); return new class { constructor(e, t) { this.name = e, this.debug = t, this.http = HTTP(), this.env = ENV(), this.node = (() => { if (o) { return { fs: require("fs") } } return null })(), this.initCache(); Promise.prototype.delay = function (e) { return this.then(function (t) { return ((e, t) => new Promise(function (s) { setTimeout(s.bind(null, t), e) }))(e, t) }) } } initCache() { if (s && (this.cache = JSON.parse($prefs.valueForKey(this.name) || "{}")), (i || n) && (this.cache = JSON.parse($persistentStore.read(this.name) || "{}")), o) { let e = "root.json"; this.node.fs.existsSync(e) || this.node.fs.writeFileSync(e, JSON.stringify({}), { flag: "wx" }, e => console.log(e)), this.root = {}, e = `${this.name}.json`, this.node.fs.existsSync(e) ? this.cache = JSON.parse(this.node.fs.readFileSync(`${this.name}.json`)) : (this.node.fs.writeFileSync(e, JSON.stringify({}), { flag: "wx" }, e => console.log(e)), this.cache = {}) } } persistCache() { const e = JSON.stringify(this.cache, null, 2); s && $prefs.setValueForKey(e, this.name), (i || n) && $persistentStore.write(e, this.name), o && (this.node.fs.writeFileSync(`${this.name}.json`, e, { flag: "w" }, e => console.log(e)), this.node.fs.writeFileSync("root.json", JSON.stringify(this.root, null, 2), { flag: "w" }, e => console.log(e))) } write(e, t) { if (this.log(`SET ${t}`), -1 !== t.indexOf("#")) { if (t = t.substr(1), n || i) return $persistentStore.write(e, t); if (s) return $prefs.setValueForKey(e, t); o && (this.root[t] = e) } else this.cache[t] = e; this.persistCache() } read(e) { return this.log(`READ ${e}`), -1 === e.indexOf("#") ? this.cache[e] : (e = e.substr(1), n || i ? $persistentStore.read(e) : s ? $prefs.valueForKey(e) : o ? this.root[e] : void 0) } delete(e) { if (this.log(`DELETE ${e}`), -1 !== e.indexOf("#")) { if (e = e.substr(1), n || i) return $persistentStore.write(null, e); if (s) return $prefs.removeValueForKey(e); o && delete this.root[e] } else delete this.cache[e]; this.persistCache() } notify(e, t = "", l = "", h = {}) { const a = h["open-url"], c = h["media-url"]; if (s && $notify(e, t, l, h), n && $notification.post(e, t, l + `${c ? "\n多媒体:" + c : ""}`, { url: a }), i) { let s = {}; a && (s.openUrl = a), c && (s.mediaUrl = c), "{}" === JSON.stringify(s) ? $notification.post(e, t, l) : $notification.post(e, t, l, s) } if (o || u) { const s = l + (a ? `\n点击跳转: ${a}` : "") + (c ? `\n多媒体: ${c}` : ""); if (r) { require("push").schedule({ title: e, body: (t ? t + "\n" : "") + s }) } else console.log(`${e}\n${t}\n${s}\n\n`) } } log(e) { this.debug && console.log(`[${this.name}] LOG: ${this.stringify(e)}`) } info(e) { console.log(`[${this.name}] INFO: ${this.stringify(e)}`) } error(e) { console.log(`[${this.name}] ERROR: ${this.stringify(e)}`) } wait(e) { return new Promise(t => setTimeout(t, e)) } done(e = {}) { s || i || n ? $done(e) : o && !r && "undefined" != typeof $context && ($context.headers = e.headers, $context.statusCode = e.statusCode, $context.body = e.body) } stringify(e) { if ("string" == typeof e || e instanceof String) return e; try { return JSON.stringify(e, null, 2) } catch (e) { return "[object Object]" } } }(e, t) } 185 | /*****************************************************************************/ 186 | --------------------------------------------------------------------------------