├── README.md ├── bhxcy.js ├── bsly.js ├── dd_bucketWater.js ├── dd_cookie.js ├── dd_fruit.js ├── elm.js ├── flg.js ├── flhs.js ├── gqsl.js ├── gyj.js ├── jcCheck.js ├── jztt.js ├── jzyl.js ├── ks.js ├── ks_fruit.js ├── ksjsb.js ├── kyin.js ├── meituan.js ├── txspfl.js ├── txstockV2.js ├── xmsb.py └── ysy.js /README.md: -------------------------------------------------------------------------------- 1 | ## 更无柳絮因风起,惟有葵花向日倾 2 | 3 | 本库为集合库,脚本所有权归作者所有,请勿恶意传播或代挂! 4 | 5 | 注:不玩实名,不玩见光没,不玩低于0.3 6 | 7 | 8 | ## :world_map: 拉库 9 | 10 | ql repo https://github.com/Yiov/wool.git "" "COOKIE" 11 | 12 | 13 | ## :loudspeaker: 小号 14 | 15 | 建议:玩毛不要用自己常用手机,不然垃圾短信一堆 16 | 17 | * 移动:和多号app(5元/月) 18 | * 联通:沃小号app(5元/月) 19 | * 电信:天翼小号app(已下线) 20 | 21 | 22 | 23 | ## :gear: 在线请求头转JSON 24 | 25 | 我把我已知的都列举出来了,也欢迎投更好用的 26 | 27 | * ~[ToolTT](https://tooltt.com/header2json/)「好像不好用了」~ 28 | 29 | * [uutool](https://uutool.cn/header2json/) 30 | 31 | * [wejson](https://wejson.cn/header2json/) 32 | 33 | 34 | 35 | 36 | ## 脚本列表 37 | 38 | 先整理之前的,新的会抽空添加 39 | 40 | 41 | | 项目 | 应用端 | 作者 | 脚本加密 | 奖励 | 推荐指数 | 42 | | :-: | :-: | :-: | :-: | :-: | :-: | 43 | | **B** | 44 | | 渤海宣传员
bhxcy.js | 小程序 | @肥皂 | 否 | 京东E卡 | ★★ | 45 | | 百事乐元
bhxcy.js | 小程序 | @肥皂 | 否 | 实物 | ★★ | 46 | | **D** | 47 | | 滴滴果园
dd_fruit.js
dd_bucketWater.js | APP/小程序 | [@passerby-b](https://github.com/passerby-b/didi_fruit/) | 是 | 水果/打车券 | ★★★ | 48 | | **E** | 49 | | 饿了么
elm.js | APP/小程序 | [@leaf](https://github.com/leafTheFish/DeathNote) | 是 | 吃货豆 | ★★★ | 50 | | **F** | 51 | | 返利购更名:
利淘优选
flg.js | 安卓 | [@YaphetS0903](https://github.com/YaphetS0903/JStest) | 否 | 现金 | ★★★★ | 52 | | 返利好省
flhs.js | 安卓 | [@YaphetS0903](https://github.com/YaphetS0903/JStest) | 否 | 现金 | ★★★ | 53 | | **G** | 54 | | 广汽三菱
gqsl.js | 安卓/IOS | [@Tom](https://github.com/xl2101200/-/) | 是 | 实物 | ★★ | 55 | | 高佣金更名:
佣金帝
gyj.js | 安卓/IOS | [@liuqi6968](https://github.com/liuqi6968/-) | 否 | 现金 | ★★ | 56 | | **J** | 57 | | 九章头条
jztt.js | 安卓/IOS | [@leaf](https://github.com/leafTheFish/DeathNote) | 是 | 现金 | ★★★★ | 58 | | 机场签到
jcCheck.js | 网页 | QiFengg | 否 | 好家伙/ikuuu/几鸡 | ★★ | 59 | | 健走有礼
jzyl.js | 小程序 | [@leaf](https://github.com/leafTheFish/DeathNote) | 否 | 现金 | ★★ | 60 | | **K** | 61 | | 快手
ks.js | 安卓/IOS | [@leaf](https://github.com/leafTheFish/DeathNote) | 是 | 现金 | ★★★ | 62 | | 快手极速版
ksjsb.js | 安卓/IOS | [@leaf](https://github.com/leafTheFish/DeathNote) | 是 | 现金 | ★★★ | 63 | | 快手果园
ks_fruit.js | 安卓/IOS | [@passerby-b](https://github.com/passerby-b/didi_fruit/) | 是 | 实物 | ★★★ | 64 | | 快音
kyin.js | 安卓 | [@soy](https://github.com/soytool/script) | 是 | 现金 | ★★★ | 65 | | **M** | 66 | | 美团
meituan.js | 安卓/IOS | [@萝卜](http://gitlab.radish.today/root/script/tree/master) | 是 | 外卖红包 | ★★ | 67 | | **T** | 68 | | 腾讯自选股
txstockV2.js | 安卓/IOS | [@leaf](https://github.com/leafTheFish/DeathNote) | 是 | 现金 | ★★★★ | 69 | | 腾讯视频福利
txspfl.js | 安卓/IOS | [@leaf](https://github.com/leafTheFish/DeathNote) | 是 | 会员 | ★★ | 70 | | **X** | 71 | | 小米刷步
xmsb.py | APP | @佚名 | 否 | 步数 | ★★ | 72 | | **Y** | 73 | | 萤石云视频
ysy.js | 安卓/IOS | [@YaphetS0903](https://github.com/YaphetS0903/JStest) | 否 | 换服务券 | ★ | 74 | | | -------------------------------------------------------------------------------- /bhxcy.js: -------------------------------------------------------------------------------- 1 | /*渤海宣传员 @肥皂 2 | 3 | cron 0 12 * * * bhxcy.js 4 | 5 | 脚本库:无 6 | 7 | 8 | 9 | [脚本说明] 10 | 11 | 微信搜索小程序:渤海宣传员,电子账户随意,反正我不注册,重新打开小程序会掉登录 12 | 13 | 签到一个星期有1.5元左右的e卡,满10元自动兑换 14 | 15 | 16 | 17 | [更新说明] 18 | 19 | 3.24更新 加入用户信息和余额显示,自动兑换到绑定的手机号上 20 | 21 | 22 | 23 | [青龙变量] 24 | 25 | 抓POST包,有uid和token值即可 26 | 27 | https://api.yd.ihaoqu.com/?r=api2&apiAction=SignIn 28 | 29 | #渤海宣传员 30 | export bhxcytoken='uid=***&token=***' 31 | 32 | 33 | 34 | */ 35 | const $ = new Env('渤海宣传员'); 36 | let status; 37 | status = (status = ($.getval("bhxcystatus") || "1")) > 1 ? `${status}` : ""; // 账号扩展字符 38 | let bhxcytokenArr = [], bhxcycount = '',bhdh = "" 39 | let bhxcytoken = ($.isNode() ? process.env.bhxcytoken : $.getdata('bhxcytoken')) || ''; 40 | let sign = '',jm ='2021hqhd08bhyh04',uid = '',token = '' 41 | !(async () => { 42 | if (typeof $request !== "undefined") { 43 | await bhxcyck() 44 | 45 | } else { 46 | bhxcytokenArr = bhxcytoken.split('@') 47 | console.log(`------------- 共${bhxcytokenArr.length}个账号-------------\n`) 48 | for (let i = 0; i < bhxcytokenArr.length; i++) { 49 | bhxcytoken = bhxcytokenArr[i] 50 | $.index = i + 1; 51 | console.log(`\n开始【渤海宣传员${$.index}】`) 52 | uid = bhxcytoken.match(/uid=(\d+)/)[1] 53 | token = bhxcytoken.match(/token=(\w+)/)[1] 54 | //console.log(token); 55 | await bhxcyxx() 56 | await bhxcysign() 57 | //await bhxcydh() 58 | 59 | } 60 | } 61 | 62 | })() 63 | .catch((e) => $.logErr(e)) 64 | .finally(() => $.done()) 65 | //数据获取 66 | 67 | //签到 68 | function bhxcysign(timeout = 0) { 69 | return new Promise((resolve) => { 70 | sign = md5(`${token}${jm}${uid}SignIn`) 71 | let url = { 72 | url: 'https://api.yd.ihaoqu.com/?r=api2&apiAction=SignIn', 73 | headers: JSON.parse(`{"Host":"api.yd.ihaoqu.com","User-Agent":"Mozilla/5.0 (iPad; CPU OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.17(0x1800112e) NetType/WIFI Language/zh_CN","content-type":"application/x-www-form-urlencoded","Content-Length":"82"}`), 74 | body: `uid=${uid}&token=${token}&signure=${sign}` 75 | } 76 | $.post(url, async (err, resp, data) => { 77 | try { 78 | const result = JSON.parse(data) 79 | if (result.result == 0) { 80 | await $.wait(200) 81 | $.log(`\n渤海宣传员签到:${result.msg}`) 82 | 83 | } else { 84 | $.log(`\n渤海宣传员签到:${result.msg}`) 85 | 86 | } 87 | } catch (e) { 88 | //$.logErr(e, resp); 89 | } finally { 90 | resolve() 91 | } 92 | }, timeout) 93 | }) 94 | } 95 | 96 | //个人信息 97 | function bhxcyxx(timeout = 0) { 98 | return new Promise((resolve) => { 99 | sign = md5(`getUserInfo${uid}${jm}${token}`) 100 | let url = { 101 | url: 'https://api.yd.ihaoqu.com/?r=api2&apiAction=getUserInfo', 102 | headers: JSON.parse(`{"Host":"api.yd.ihaoqu.com","User-Agent":"Mozilla/5.0 (iPad; CPU OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.17(0x1800112e) NetType/WIFI Language/zh_CN","content-type":"application/x-www-form-urlencoded","Content-Length":"82"}`), 103 | body: `uid=${uid}&token=${token}&signure=${sign}` 104 | } 105 | $.post(url, async (err, resp, data) => { 106 | try { 107 | const result = JSON.parse(data) 108 | if (result.result == 1) { 109 | await $.wait(200) 110 | $.log(`\n渤海宣传员用户:【${result.MobilePhone}】 当前红包余额:【${result.PhoneBill}】`) 111 | if(result.PhoneBill >= 10){ 112 | $.log(`\n渤海宣传员用户:【${result.MobilePhone}】满足兑换条件,前往兑换`) 113 | await bhxcydh() 114 | } 115 | } else { 116 | $.log(`\n渤海宣传员用户:${result.msg}`) 117 | 118 | } 119 | } catch (e) { 120 | //$.logErr(e, resp); 121 | } finally { 122 | resolve() 123 | } 124 | }, timeout) 125 | }) 126 | } 127 | 128 | //兑换 129 | function bhxcydh(timeout = 0) { 130 | return new Promise((resolve) => { 131 | sign = md5(`Recharge${uid}${jm}2${token}1`) 132 | let url = { 133 | url: 'https://api.yd.ihaoqu.com/?r=api2&apiAction=Recharge', 134 | headers: JSON.parse(`{"Host":"api.yd.ihaoqu.com","User-Agent":"Mozilla/5.0 (iPad; CPU OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.17(0x1800112e) NetType/WIFI Language/zh_CN","content-type":"application/x-www-form-urlencoded","Content-Length":"82"}`), 135 | body: `uid=${uid}&token=${token}&Type=1&Category=2&signure=${sign}` 136 | } 137 | $.post(url, async (err, resp, data) => { 138 | try { 139 | const result = JSON.parse(data) 140 | if (result.result == 0) { 141 | await $.wait(200) 142 | $.log(`\n渤海宣传员兑换:${result.msg}`) 143 | 144 | } else { 145 | $.log(`\n渤海宣传员兑换:${result.msg}`) 146 | 147 | } 148 | } catch (e) { 149 | //$.logErr(e, resp); 150 | } finally { 151 | resolve() 152 | } 153 | }, timeout) 154 | }) 155 | } 156 | 157 | function md5(a) { 158 | function b(a, b) { 159 | return a << b | a >>> 32 - b 160 | } 161 | 162 | function c(a, b) { 163 | var c, d, e, f, g; 164 | return e = 2147483648 & a, 165 | f = 2147483648 & b, 166 | c = 1073741824 & a, 167 | d = 1073741824 & b, 168 | g = (1073741823 & a) + (1073741823 & b), 169 | c & d ? 2147483648 ^ g ^ e ^ f : c | d ? 1073741824 & g ? 3221225472 ^ g ^ e ^ f : 1073741824 ^ g ^ e ^ f : g ^ e ^ f 170 | } 171 | 172 | function d(a, b, c) { 173 | return a & b | ~a & c 174 | } 175 | 176 | function e(a, b, c) { 177 | return a & c | b & ~c 178 | } 179 | 180 | function f(a, b, c) { 181 | return a ^ b ^ c 182 | } 183 | 184 | function g(a, b, c) { 185 | return b ^ (a | ~c) 186 | } 187 | 188 | function h(a, e, f, g, h, i, j) { 189 | return a = c(a, c(c(d(e, f, g), h), j)), 190 | c(b(a, i), e) 191 | } 192 | 193 | function i(a, d, f, g, h, i, j) { 194 | return a = c(a, c(c(e(d, f, g), h), j)), 195 | c(b(a, i), d) 196 | } 197 | 198 | function j(a, d, e, g, h, i, j) { 199 | return a = c(a, c(c(f(d, e, g), h), j)), 200 | c(b(a, i), d) 201 | } 202 | 203 | function k(a, d, e, f, h, i, j) { 204 | return a = c(a, c(c(g(d, e, f), h), j)), 205 | c(b(a, i), d) 206 | } 207 | 208 | function l(a) { 209 | 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;) 210 | b = (i - i % 4) / 4, 211 | h = i % 4 * 8, 212 | g[b] = g[b] | a.charCodeAt(i) << h, 213 | i++; 214 | return b = (i - i % 4) / 4, 215 | h = i % 4 * 8, 216 | g[b] = g[b] | 128 << h, 217 | g[f - 2] = c << 3, 218 | g[f - 1] = c >>> 29, 219 | g 220 | } 221 | 222 | function m(a) { 223 | var b, c, d = "", e = ""; 224 | for (c = 0; 3 >= c; c++) 225 | b = a >>> 8 * c & 255, 226 | e = "0" + b.toString(16), 227 | d += e.substr(e.length - 2, 2); 228 | return d 229 | } 230 | 231 | function n(a) { 232 | a = a.replace(/\r\n/g, "\n"); 233 | for (var b = "", c = 0; c < a.length; c++) { 234 | var d = a.charCodeAt(c); 235 | 128 > d ? b += String.fromCharCode(d) : d > 127 && 2048 > d ? (b += String.fromCharCode(d >> 6 | 192), 236 | b += String.fromCharCode(63 & d | 128)) : (b += String.fromCharCode(d >> 12 | 224), 237 | b += String.fromCharCode(d >> 6 & 63 | 128), 238 | b += String.fromCharCode(63 & d | 128)) 239 | } 240 | return b 241 | } 242 | 243 | 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, 244 | I = 16, J = 23, K = 6, L = 10, M = 15, N = 21; 245 | for (a = n(a), 246 | x = l(a), 247 | t = 1732584193, 248 | u = 4023233417, 249 | v = 2562383102, 250 | w = 271733878, 251 | o = 0; o < x.length; o += 16) 252 | p = t, 253 | q = u, 254 | r = v, 255 | s = w, 256 | t = h(t, u, v, w, x[o + 0], y, 3614090360), 257 | w = h(w, t, u, v, x[o + 1], z, 3905402710), 258 | v = h(v, w, t, u, x[o + 2], A, 606105819), 259 | u = h(u, v, w, t, x[o + 3], B, 3250441966), 260 | t = h(t, u, v, w, x[o + 4], y, 4118548399), 261 | w = h(w, t, u, v, x[o + 5], z, 1200080426), 262 | v = h(v, w, t, u, x[o + 6], A, 2821735955), 263 | u = h(u, v, w, t, x[o + 7], B, 4249261313), 264 | t = h(t, u, v, w, x[o + 8], y, 1770035416), 265 | w = h(w, t, u, v, x[o + 9], z, 2336552879), 266 | v = h(v, w, t, u, x[o + 10], A, 4294925233), 267 | u = h(u, v, w, t, x[o + 11], B, 2304563134), 268 | t = h(t, u, v, w, x[o + 12], y, 1804603682), 269 | w = h(w, t, u, v, x[o + 13], z, 4254626195), 270 | v = h(v, w, t, u, x[o + 14], A, 2792965006), 271 | u = h(u, v, w, t, x[o + 15], B, 1236535329), 272 | t = i(t, u, v, w, x[o + 1], C, 4129170786), 273 | w = i(w, t, u, v, x[o + 6], D, 3225465664), 274 | v = i(v, w, t, u, x[o + 11], E, 643717713), 275 | u = i(u, v, w, t, x[o + 0], F, 3921069994), 276 | t = i(t, u, v, w, x[o + 5], C, 3593408605), 277 | w = i(w, t, u, v, x[o + 10], D, 38016083), 278 | v = i(v, w, t, u, x[o + 15], E, 3634488961), 279 | u = i(u, v, w, t, x[o + 4], F, 3889429448), 280 | t = i(t, u, v, w, x[o + 9], C, 568446438), 281 | w = i(w, t, u, v, x[o + 14], D, 3275163606), 282 | v = i(v, w, t, u, x[o + 3], E, 4107603335), 283 | u = i(u, v, w, t, x[o + 8], F, 1163531501), 284 | t = i(t, u, v, w, x[o + 13], C, 2850285829), 285 | w = i(w, t, u, v, x[o + 2], D, 4243563512), 286 | v = i(v, w, t, u, x[o + 7], E, 1735328473), 287 | u = i(u, v, w, t, x[o + 12], F, 2368359562), 288 | t = j(t, u, v, w, x[o + 5], G, 4294588738), 289 | w = j(w, t, u, v, x[o + 8], H, 2272392833), 290 | v = j(v, w, t, u, x[o + 11], I, 1839030562), 291 | u = j(u, v, w, t, x[o + 14], J, 4259657740), 292 | t = j(t, u, v, w, x[o + 1], G, 2763975236), 293 | w = j(w, t, u, v, x[o + 4], H, 1272893353), 294 | v = j(v, w, t, u, x[o + 7], I, 4139469664), 295 | u = j(u, v, w, t, x[o + 10], J, 3200236656), 296 | t = j(t, u, v, w, x[o + 13], G, 681279174), 297 | w = j(w, t, u, v, x[o + 0], H, 3936430074), 298 | v = j(v, w, t, u, x[o + 3], I, 3572445317), 299 | u = j(u, v, w, t, x[o + 6], J, 76029189), 300 | t = j(t, u, v, w, x[o + 9], G, 3654602809), 301 | w = j(w, t, u, v, x[o + 12], H, 3873151461), 302 | v = j(v, w, t, u, x[o + 15], I, 530742520), 303 | u = j(u, v, w, t, x[o + 2], J, 3299628645), 304 | t = k(t, u, v, w, x[o + 0], K, 4096336452), 305 | w = k(w, t, u, v, x[o + 7], L, 1126891415), 306 | v = k(v, w, t, u, x[o + 14], M, 2878612391), 307 | u = k(u, v, w, t, x[o + 5], N, 4237533241), 308 | t = k(t, u, v, w, x[o + 12], K, 1700485571), 309 | w = k(w, t, u, v, x[o + 3], L, 2399980690), 310 | v = k(v, w, t, u, x[o + 10], M, 4293915773), 311 | u = k(u, v, w, t, x[o + 1], N, 2240044497), 312 | t = k(t, u, v, w, x[o + 8], K, 1873313359), 313 | w = k(w, t, u, v, x[o + 15], L, 4264355552), 314 | v = k(v, w, t, u, x[o + 6], M, 2734768916), 315 | u = k(u, v, w, t, x[o + 13], N, 1309151649), 316 | t = k(t, u, v, w, x[o + 4], K, 4149444226), 317 | w = k(w, t, u, v, x[o + 11], L, 3174756917), 318 | v = k(v, w, t, u, x[o + 2], M, 718787259), 319 | u = k(u, v, w, t, x[o + 9], N, 3951481745), 320 | t = c(t, p), 321 | u = c(u, q), 322 | v = c(v, r), 323 | w = c(w, s); 324 | var O = m(t) + m(u) + m(v) + m(w); 325 | return O.toLowerCase() 326 | } 327 | 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) } -------------------------------------------------------------------------------- /bsly.js: -------------------------------------------------------------------------------- 1 | /*百事乐元 @yml 2 | 3 | cron 18 7 * * * bsly.js 4 | 5 | TG群:https://t.me/yml_tg 6 | 脚本库:https://github.com/yml2213/javascript 7 | 8 | 9 | 10 | [脚本说明] 11 | 12 | 百事乐元 微信小程序,只有积分,可以换购实物和快乐水 13 | 14 | 3-24 签到任务 token 有效期测试中 15 | 计划行双平台脚本测试,青龙完成 圈x自行测试,不行请@我修一下 16 | 感谢所有测试人员 17 | 18 | 19 | 20 | [青龙变量] 21 | 22 | 抓POST包,获取token值即可,作者说找doSignIn,我没找到用了下面链接的token 23 | 24 | https://pepcoin.pepcoinbypepsico.com.cn/api/wxapp/doGetUserInfo 25 | 26 | UA可选变量,填不填自己看着办 27 | 28 | export yml_bsly_data='token值' 29 | export yml_bsly_UA='Mozilla/5.0***android' 30 | 31 | 32 | 33 | */ 34 | 35 | 36 | const $ = new Env('百事乐元'); 37 | const notify = $.isNode() ? require('./sendNotify') : ''; 38 | let wx_yml_bsly_data = [], yml_bsly_UA = [], wx_yml_bsly_UA = []; 39 | 40 | 41 | // 圈x声明变量 42 | let status; 43 | status = (status = ($.getval("yml_bslystatus") || "1")) > 1 ? `${status}` : ""; 44 | const yml_bslyurlArr = [], yml_bslyhdArr = [], yml_bslybodyArr = [], yml_bslycount = '' 45 | let yml_bslyurl = $.getdata('yml_bslyurl') 46 | let yml_bslyhd = $.getdata('yml_bslyhd') 47 | let yml_bslybody = $.getdata('yml_bslybody') 48 | 49 | 50 | // 开始执行脚本 51 | !(async () => { 52 | if ($.isNode()) { 53 | if (!process.env.yml_bsly_data) { 54 | console.log(`\n【${$.name}】:未填写 必填 变量 yml_bsly_data`); 55 | return; 56 | } 57 | // UA判断部分 58 | if (!process.env.yml_bsly_UA) { 59 | console.log(`\n【${$.name}】:未填写 UA 变量 yml_bsly_UA ,将默认分配一个`); 60 | } else { 61 | if (process.env.yml_bsly_UA && process.env.yml_bsly_UA.indexOf('@') > -1) { 62 | yml_bsly_UA = process.env.yml_bsly_UA.split('@'); 63 | } else if (process.env.yml_bsly_UA && process.env.yml_bsly_UA.indexOf('\n') > -1) { 64 | yml_bsly_UA = process.env.yml_bsly_UA.split('\n'); 65 | } else { 66 | yml_bsly_UA = process.env.yml_bsly_UA.split(); 67 | } 68 | } 69 | 70 | Object.keys(yml_bsly_UA).forEach((item) => { 71 | if (yml_bsly_UA[item]) { 72 | wx_yml_bsly_UA.push(yml_bsly_UA[item]); 73 | } 74 | ; 75 | }); 76 | 77 | 78 | 79 | // 必要变量判断部分 80 | if (process.env.yml_bsly_data && process.env.yml_bsly_data.indexOf('@') > -1) { 81 | yml_bsly_data = process.env.yml_bsly_data.split('@'); 82 | } else if (process.env.yml_bsly_data && process.env.yml_bsly_data.indexOf('\n') > -1) { 83 | yml_bsly_data = process.env.yml_bsly_data.split('\n'); 84 | } else { 85 | yml_bsly_data = process.env.yml_bsly_data.split(); 86 | } 87 | 88 | Object.keys(yml_bsly_data).forEach((item) => { 89 | if (yml_bsly_data[item]) { 90 | wx_yml_bsly_data.push(yml_bsly_data[item]); 91 | } 92 | }); 93 | 94 | } else { 95 | if (typeof $request !== "undefined") { 96 | 97 | yml_bslyck() 98 | 99 | } else { 100 | yml_bslyurlArr.push($.getdata('yml_bslyurl')) 101 | yml_bslyhdArr.push($.getdata('yml_bslyhd')) 102 | yml_bslybodyArr.push($.getdata('yml_bslybody')) 103 | 104 | let yml_bslycount = ($.getval('yml_bslycount') || '1'); 105 | 106 | for (let i = 2; i <= yml_bslycount; i++) { 107 | 108 | yml_bslyurlArr.push($.getdata(`yml_bslyurl${i}`)) 109 | yml_bslyhdArr.push($.getdata(`yml_bslyhd${i}`)) 110 | yml_bslybodyArr.push($.getdata(`yml_bslybody${i}`)) 111 | 112 | } 113 | 114 | console.log( 115 | `\n\n=============================================== 脚本执行 - 北京时间(UTC+8):${new Date( 116 | new Date().getTime() + 117 | new Date().getTimezoneOffset() * 60 * 1000 + 118 | 8 * 60 * 60 * 1000 119 | ).toLocaleString()} ===============================================\n`); 120 | 121 | for (let i = 0; i < yml_bslyhdArr.length; i++) { 122 | 123 | if (yml_bslyhdArr[i]) { 124 | 125 | yml_bslyurl = yml_bslyurlArr[i]; 126 | yml_bslyhd = yml_bslyhdArr[i]; 127 | yml_bslybody = yml_bslybodyArr[i]; 128 | 129 | $.index = i + 1; 130 | console.log(`\n\n开始【百事乐元${$.index}】`) 131 | 132 | 133 | //循环运行 134 | for (let c = 0; c < 1; c++) { 135 | $.index = c + 1 136 | 137 | await bslyqd_qx()//你要执行的版块 138 | await $.wait(2 * 1000); //你要延迟的时间 1000=1秒 139 | return 140 | 141 | } 142 | } 143 | } 144 | } 145 | } 146 | 147 | // 脚本开始执行 148 | console.log(`\n=== 脚本执行 - 北京时间:${new Date(new Date().getTime() + new Date().getTimezoneOffset() 149 | * 60 * 1000 + 8 * 60 * 60 * 1000).toLocaleString()} ===\n`); 150 | 151 | await wyy(); 152 | 153 | console.log(`===【共 ${wx_yml_bsly_data.length} 个账号】===\n`); 154 | for (i = 0; i < wx_yml_bsly_data.length; i++) { 155 | 156 | yml_bsly_UA = wx_yml_bsly_UA[i] 157 | if (!yml_bsly_UA) { 158 | yml_bsly_UA = 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.18(0x1800123a) NetType/4G Language/zh_CN' 159 | } 160 | // console.log(yml_bsly_UA); 161 | 162 | yml_bsly_data = wx_yml_bsly_data[i].split('&'); 163 | 164 | // console.log(wx_yml_bsly_data); 165 | // console.log(yml_bsly_data[0]) 166 | // console.log(yml_bsly_data[1]) 167 | 168 | // console.log(userId[1]); 169 | 170 | $.index = i + 1; 171 | console.log(`\n开始【第 ${$.index} 个账号任务】`); 172 | 173 | //执行任务 174 | // 签到 175 | await yml_bsly_sign() 176 | await $.wait(2 * 1000); 177 | 178 | // // 获取文章列表 179 | // await yml_bsly_articles() 180 | // await $.wait(2 * 1000); 181 | 182 | // // 阅读文章 183 | // await yml_bsly_enterRead() 184 | // await $.wait(2 * 1000); 185 | 186 | // // 停止阅读文章 187 | // await yml_bsly_exitRead() 188 | // await $.wait(2 * 1000); 189 | 190 | 191 | } 192 | 193 | })() 194 | .catch((e) => $.logErr(e)) 195 | .finally(() => $.done()); 196 | 197 | 198 | //每日网抑云 199 | function wyy(timeout = 3 * 1000) { 200 | return new Promise((resolve) => { 201 | let url = { 202 | url: `https://keai.icu/apiwyy/api` 203 | } 204 | $.get(url, async (err, resp, data) => { 205 | try { 206 | data = JSON.parse(data) 207 | $.log(`\n【网抑云时间】: ${data.content} by--${data.music}`); 208 | 209 | } catch (e) { 210 | $.logErr(e, resp); 211 | } finally { 212 | resolve() 213 | } 214 | }, timeout) 215 | }) 216 | } 217 | 218 | // 圈x执行 219 | // https://pepcoin.pepsico.com.cn/api/wxapp/doSignIn 220 | function yml_bslyck() { 221 | if ($request.url.indexOf("doSignIn") > -1) { 222 | const yml_bslyurl = $request.url 223 | if (yml_bslyurl) $.setdata(yml_bslyurl, `yml_bslyurl${status}`) 224 | $.log(yml_bslyurl) 225 | 226 | const yml_bslyhd = JSON.stringify($request.headers) 227 | if (yml_bslyhd) $.setdata(yml_bslyhd, `yml_bslyhd${status}`) 228 | $.log(yml_bslyhd) 229 | 230 | const yml_bslybody = $request.body 231 | if (yml_bslybody) $.setdata(yml_bslybody, `yml_bslybody${status}`) 232 | $.log(yml_bslybody) 233 | 234 | $.msg($.name, "", `百事乐元${status}获取数据(headers body)成功`) 235 | 236 | } 237 | } 238 | // 签到 239 | function bslyqd_qx(timeout = 0) { 240 | return new Promise((resolve) => { 241 | 242 | let url = { 243 | url: 'https://pepcoin.pepsico.com.cn/api/wxapp/doSignIn', 244 | headers: JSON.parse(yml_bslyhd), 245 | body: yml_bslybody, 246 | } 247 | console.log(`=========圈x url=========`) 248 | console.log(url) 249 | $.get(url, async (err, resp, data) => { 250 | try { 251 | 252 | // data = JSON.parse(data) 253 | // console.log(data) 254 | 255 | 256 | let result = JSON.parse(data); 257 | if (result.code == 0) { 258 | console.log(`【🎉🎉🎉 签到状态 🎉🎉🎉】 ${result.message},快乐水更进一步!`) 259 | } else if (result.code === 3001) { 260 | $.log(`\n【🎉🎉🎉 签到状态 🎉🎉🎉】 未能成功签到 ,可能是:${result.message}! \n `) 261 | } else if (result.code === 1002) { 262 | $.log(`\n【🎉🎉🎉 签到状态 🎉🎉🎉】 未能成功签到 ,可能是:${result.message}!\n `) 263 | } else { 264 | $.log(`\n【🎉 恭喜个屁 🎉】执行签到:失败 ❌ 了呢,可能是被外星人偷走了!\n `) 265 | } 266 | 267 | 268 | } catch (e) { 269 | 270 | } finally { 271 | resolve() 272 | } 273 | }, timeout) 274 | }) 275 | } 276 | 277 | 278 | 279 | 280 | 281 | // 签到 ql执行 282 | // https://pepcoin.pepsico.com.cn/api/wxapp/doSignIn 283 | function yml_bsly_sign(timeout = 3 * 1000) { 284 | return new Promise((resolve, reject) => { 285 | let url = { 286 | url: `https://pepcoin.pepsico.com.cn/api/wxapp/doSignIn`, 287 | headers: { 288 | 289 | "User-Agent": yml_bsly_UA, 290 | "Content-Type": "application/json", 291 | "Referer": "https://servicewechat.com/wx1a72addb7ee74f67/58/page-frame.html", 292 | "Connection": "keep-alive", 293 | "Host": "pepcoin.pepsico.com.cn" 294 | }, 295 | body: JSON.stringify({ 296 | "token": yml_bsly_data[0] 297 | }), 298 | 299 | } 300 | 301 | // console.log(`===================这是请求url===================`); 302 | // console.log(url); 303 | 304 | $.post(url, async (error, response, data) => { 305 | try { 306 | // console.log(`===================这是返回data===================`) 307 | // console.log(data) 308 | let result = JSON.parse(data); 309 | if (result.code == 0) { 310 | console.log(`【🎉🎉🎉 签到状态 🎉🎉🎉】 ${result.message},快乐水更进一步!`) 311 | } else if (result.code === 3001) { 312 | $.log(`\n【🎉🎉🎉 签到状态 🎉🎉🎉】 未能成功签到 ,可能是:${result.message}!\n `) 313 | } else if (result.code === 1002) { 314 | $.log(`\n【🎉🎉🎉 签到状态 🎉🎉🎉】 未能成功签到 ,可能是:${result.message}!\n `) 315 | } else { 316 | $.log(`\n【🎉 恭喜个屁 🎉】执行签到:失败 ❌ 了呢,可能是被外星人偷走了!\n `) 317 | } 318 | 319 | } catch (e) { 320 | console.log(e) 321 | } finally { 322 | resolve(); 323 | } 324 | }, timeout) 325 | }) 326 | } 327 | 328 | /* 329 | // 阅读任务部分 330 | // 获取文章列表,随机选择一篇文章获取 articleId 331 | function yml_bsly_articles(timeout = 3 * 1000) { 332 | return new Promise((resolve, reject) => { 333 | 334 | let d = new Date(); 335 | let y = d.getFullYear(); 336 | let m = d.getMonth() + 1; 337 | m = m.toString(); 338 | if (m.length == 1) { 339 | m = `0${m}` 340 | } 341 | let time = `${y}-${m}`; 342 | // console.log(time); 343 | 344 | let url = { 345 | url: `https://qualcomm.growthideadata.com/qualcomm-app/api/home/articles?page=1&size=20&userId=${yml_bsly_data[1]}&labelId=&searchDate=${time}&showType=0`, 346 | headers: { 347 | 348 | "userId": yml_bsly_data[1], 349 | "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", 350 | "Host": "qualcomm.growthideadata.com", 351 | "User-Agent": yml_bsly_UA, 352 | "sessionKey": yml_bsly_data[0], 353 | "Referer": "https://servicewechat.com/wx026c06df6adc5d06/176/page-frame.html", 354 | "Connection": "keep-alive" 355 | }, 356 | 357 | } 358 | // console.log(`===================这是请求url===================`); 359 | // console.log(url); 360 | 361 | $.get(url, async (error, response, data) => { 362 | try { 363 | 364 | // console.log(`===================这是返回data===================`); 365 | // console.log(data) 366 | 367 | let result = JSON.parse(data); 368 | if (result.code == 200) { 369 | console.log(`【🎉🎉🎉 恭喜 🎉🎉🎉】\n 文章列表刷新成功了鸭!\n`) 370 | 371 | console.log(`\n 请耐心等待 5 s\n`) 372 | await $.wait(5 * 1000); 373 | 374 | // 随机1-10 数字 375 | let num = Math.floor(Math.random() * 10 + 1); 376 | // console.log(num); 377 | 378 | // 获取 articleId 379 | articleId = result.data.articleList[num].id; 380 | // console.log(articleId); 381 | // 获取 title 382 | title = result.data.articleList[num].title; 383 | // console.log(title); 384 | 385 | } 386 | 387 | } catch (e) { 388 | console.log(error) 389 | } finally { 390 | resolve(); 391 | } 392 | }, timeout) 393 | }) 394 | } 395 | 396 | 397 | // 开始阅读 398 | // https://qualcomm.growthideadata.com/qualcomm-app/api/article/enterRead?articleId=7626&userId=281687 399 | function yml_bsly_enterRead(timeout = 3 * 1000) { 400 | return new Promise((resolve, reject) => { 401 | let url = { 402 | url: `https://qualcomm.growthideadata.com/qualcomm-app/api/article/enterRead?articleId=${articleId}&userId=${yml_bsly_data[1]}`, 403 | headers: { 404 | 405 | "userId": yml_bsly_data[1], 406 | "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", 407 | "Host": "qualcomm.growthideadata.com", 408 | "User-Agent": yml_bsly_UA, 409 | "sessionKey": yml_bsly_data[0], 410 | "Referer": "https://servicewechat.com/wx026c06df6adc5d06/176/page-frame.html", 411 | "Connection": "keep-alive" 412 | }, 413 | 414 | } 415 | // console.log(`===================这是请求url===================`); 416 | // console.log(url); 417 | 418 | $.get(url, async (error, response, data) => { 419 | try { 420 | 421 | // console.log(`===================这是返回data===================`); 422 | // console.log(data) 423 | 424 | let result = JSON.parse(data); 425 | if (result.code == 200) { 426 | console.log(`【🎉🎉🎉 尝试阅读${result.message} 🎉🎉🎉】\n恭喜你,开始阅读文章${title}\n 请耐心等待16分钟,你可以去做别的事情了鸭!\n`) 427 | 428 | await $.wait(10 * 1000); 429 | console.log(`\n 请耐心等待16分钟,你可以去做别的事情了鸭!`) 430 | 431 | await $.wait(10 * 1000); 432 | console.log(`\n 请耐心等待16分钟,你可以去做别的事情了鸭!`) 433 | 434 | await $.wait(960 * 1000); 435 | 436 | 437 | } 438 | 439 | } catch (e) { 440 | console.log(error) 441 | } finally { 442 | resolve(); 443 | } 444 | }, timeout) 445 | }) 446 | } 447 | 448 | 449 | // 停止阅读 450 | // https://qualcomm.growthideadata.com/qualcomm-app/api/article/enterRead?articleId=7626&userId=281687 451 | // https://qualcomm.growthideadata.com/qualcomm-app/api/article/exitRead?articleId=7626&userId=281687 452 | function yml_bsly_exitRead(timeout = 3 * 1000) { 453 | return new Promise((resolve, reject) => { 454 | let url = { 455 | url: `https://qualcomm.growthideadata.com/qualcomm-app/api/article/exitRead?articleId=${articleId}&userId=${yml_bsly_data[1]}`, 456 | headers: { 457 | 458 | "userId": yml_bsly_data[1], 459 | "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", 460 | "Host": "qualcomm.growthideadata.com", 461 | "User-Agent": yml_bsly_UA, 462 | "sessionKey": yml_bsly_data[0], 463 | "Referer": "https://servicewechat.com/wx026c06df6adc5d06/176/page-frame.html", 464 | "Connection": "keep-alive" 465 | }, 466 | 467 | } 468 | // console.log(`===================这是请求url===================`); 469 | // console.log(url); 470 | 471 | $.get(url, async (error, response, data) => { 472 | try { 473 | 474 | // console.log(`===================这是返回data===================`); 475 | // console.log(data) 476 | 477 | let result = JSON.parse(data); 478 | if (result.code == 200) { 479 | console.log(`【🎉🎉🎉 停止阅读${result.message} 🎉🎉🎉】\n恭喜你,停止阅读文章${title}\n 快去看看你的任务完成了吗!\n`) 480 | 481 | await $.wait(2 * 1000); 482 | 483 | } 484 | 485 | } catch (e) { 486 | console.log(error) 487 | } finally { 488 | resolve(); 489 | } 490 | }, timeout) 491 | }) 492 | } 493 | 494 | */ 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | // 默认 不用管 503 | function Env(t, e) { 504 | class s { 505 | constructor(t) { 506 | this.env = t 507 | } 508 | 509 | send(t, e = "GET") { 510 | t = "string" == typeof t ? { 511 | url: t 512 | } : t; 513 | let s = this.get; 514 | return "POST" === e && (s = this.post), new Promise((e, i) => { 515 | s.call(this, t, (t, s, r) => { 516 | t ? i(t) : e(s) 517 | }) 518 | }) 519 | } 520 | 521 | get(t) { 522 | return this.send.call(this.env, t) 523 | } 524 | 525 | post(t) { 526 | return this.send.call(this.env, t, "POST") 527 | } 528 | } 529 | 530 | return new class { 531 | constructor(t, e) { 532 | 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!`) 533 | } 534 | 535 | isNode() { 536 | return "undefined" != typeof module && !!module.exports 537 | } 538 | 539 | isQuanX() { 540 | return "undefined" != typeof $task 541 | } 542 | 543 | isSurge() { 544 | return "undefined" != typeof $httpClient && "undefined" == typeof $loon 545 | } 546 | 547 | isLoon() { 548 | return "undefined" != typeof $loon 549 | } 550 | 551 | toObj(t, e = null) { 552 | try { 553 | return JSON.parse(t) 554 | } catch { 555 | return e 556 | } 557 | } 558 | 559 | toStr(t, e = null) { 560 | try { 561 | return JSON.stringify(t) 562 | } catch { 563 | return e 564 | } 565 | } 566 | 567 | getjson(t, e) { 568 | let s = e; 569 | const i = this.getdata(t); 570 | if (i) try { 571 | s = JSON.parse(this.getdata(t)) 572 | } catch { 573 | } 574 | return s 575 | } 576 | 577 | setjson(t, e) { 578 | try { 579 | return this.setdata(JSON.stringify(t), e) 580 | } catch { 581 | return !1 582 | } 583 | } 584 | 585 | getScript(t) { 586 | return new Promise(e => { 587 | this.get({ 588 | url: t 589 | }, (t, s, i) => e(i)) 590 | }) 591 | } 592 | 593 | runScript(t, e) { 594 | return new Promise(s => { 595 | let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); 596 | i = i ? i.replace(/\n/g, "").trim() : i; 597 | let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); 598 | r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; 599 | const [o, h] = i.split("@"), a = { 600 | url: `http://${h}/v1/scripting/evaluate`, 601 | body: { 602 | script_text: t, 603 | mock_type: "cron", 604 | timeout: r 605 | }, 606 | headers: { 607 | "X-Key": o, 608 | Accept: "*/*" 609 | } 610 | }; 611 | this.post(a, (t, e, i) => s(i)) 612 | }).catch(t => this.logErr(t)) 613 | } 614 | 615 | loaddata() { 616 | if (!this.isNode()) return {}; 617 | { 618 | this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); 619 | const t = this.path.resolve(this.dataFile), 620 | e = this.path.resolve(process.cwd(), this.dataFile), 621 | s = this.fs.existsSync(t), 622 | i = !s && this.fs.existsSync(e); 623 | if (!s && !i) return {}; 624 | { 625 | const i = s ? t : e; 626 | try { 627 | return JSON.parse(this.fs.readFileSync(i)) 628 | } catch (t) { 629 | return {} 630 | } 631 | } 632 | } 633 | } 634 | 635 | writedata() { 636 | if (this.isNode()) { 637 | this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); 638 | const t = this.path.resolve(this.dataFile), 639 | e = this.path.resolve(process.cwd(), this.dataFile), 640 | s = this.fs.existsSync(t), 641 | i = !s && this.fs.existsSync(e), 642 | r = JSON.stringify(this.data); 643 | s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) 644 | } 645 | } 646 | 647 | lodash_get(t, e, s) { 648 | const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); 649 | let r = t; 650 | for (const t of i) 651 | if (r = Object(r)[t], void 0 === r) return s; 652 | return r 653 | } 654 | 655 | lodash_set(t, e, s) { 656 | 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) 657 | } 658 | 659 | getdata(t) { 660 | let e = this.getval(t); 661 | if (/^@/.test(t)) { 662 | const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; 663 | if (r) try { 664 | const t = JSON.parse(r); 665 | e = t ? this.lodash_get(t, i, "") : e 666 | } catch (t) { 667 | e = "" 668 | } 669 | } 670 | return e 671 | } 672 | 673 | setdata(t, e) { 674 | let s = !1; 675 | if (/^@/.test(e)) { 676 | const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), 677 | h = i ? "null" === o ? null : o || "{}" : "{}"; 678 | try { 679 | const e = JSON.parse(h); 680 | this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) 681 | } catch (e) { 682 | const o = {}; 683 | this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) 684 | } 685 | } else s = this.setval(t, e); 686 | return s 687 | } 688 | 689 | getval(t) { 690 | 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 691 | } 692 | 693 | setval(t, e) { 694 | 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 695 | } 696 | 697 | initGotEnv(t) { 698 | 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)) 699 | } 700 | 701 | get(t, e = (() => { 702 | })) { 703 | 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, { 704 | "X-Surge-Skip-Scripting": !1 705 | })), $httpClient.get(t, (t, s, i) => { 706 | !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) 707 | })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { 708 | hints: !1 709 | })), $task.fetch(t).then(t => { 710 | const { 711 | statusCode: s, 712 | statusCode: i, 713 | headers: r, 714 | body: o 715 | } = t; 716 | e(null, { 717 | status: s, 718 | statusCode: i, 719 | headers: r, 720 | body: o 721 | }, o) 722 | }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { 723 | try { 724 | if (t.headers["set-cookie"]) { 725 | const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); 726 | this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar 727 | } 728 | } catch (t) { 729 | this.logErr(t) 730 | } 731 | }).then(t => { 732 | const { 733 | statusCode: s, 734 | statusCode: i, 735 | headers: r, 736 | body: o 737 | } = t; 738 | e(null, { 739 | status: s, 740 | statusCode: i, 741 | headers: r, 742 | body: o 743 | }, o) 744 | }, t => { 745 | const { 746 | message: s, 747 | response: i 748 | } = t; 749 | e(s, i, i && i.body) 750 | })) 751 | } 752 | 753 | post(t, e = (() => { 754 | })) { 755 | 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, { 756 | "X-Surge-Skip-Scripting": !1 757 | })), $httpClient.post(t, (t, s, i) => { 758 | !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) 759 | }); 760 | else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { 761 | hints: !1 762 | })), $task.fetch(t).then(t => { 763 | const { 764 | statusCode: s, 765 | statusCode: i, 766 | headers: r, 767 | body: o 768 | } = t; 769 | e(null, { 770 | status: s, 771 | statusCode: i, 772 | headers: r, 773 | body: o 774 | }, o) 775 | }, t => e(t)); 776 | else if (this.isNode()) { 777 | this.initGotEnv(t); 778 | const { 779 | url: s, 780 | ...i 781 | } = t; 782 | this.got.post(s, i).then(t => { 783 | const { 784 | statusCode: s, 785 | statusCode: i, 786 | headers: r, 787 | body: o 788 | } = t; 789 | e(null, { 790 | status: s, 791 | statusCode: i, 792 | headers: r, 793 | body: o 794 | }, o) 795 | }, t => { 796 | const { 797 | message: s, 798 | response: i 799 | } = t; 800 | e(s, i, i && i.body) 801 | }) 802 | } 803 | } 804 | 805 | time(t) { 806 | let e = { 807 | "M+": (new Date).getMonth() + 1, 808 | "d+": (new Date).getDate(), 809 | "H+": (new Date).getHours(), 810 | "m+": (new Date).getMinutes(), 811 | "s+": (new Date).getSeconds(), 812 | "q+": Math.floor(((new Date).getMonth() + 3) / 3), 813 | S: (new Date).getMilliseconds() 814 | }; 815 | /(y+)/.test(t) && (t = t.replace(RegExp.$1, ((new Date).getFullYear() + "").substr(4 - RegExp.$1.length))); 816 | 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))); 817 | return t 818 | } 819 | 820 | msg(e = t, s = "", i = "", r) { 821 | const o = t => { 822 | if (!t) return t; 823 | if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { 824 | "open-url": t 825 | } : this.isSurge() ? { 826 | url: t 827 | } : void 0; 828 | if ("object" == typeof t) { 829 | if (this.isLoon()) { 830 | let e = t.openUrl || t.url || t["open-url"], 831 | s = t.mediaUrl || t["media-url"]; 832 | return { 833 | openUrl: e, 834 | mediaUrl: s 835 | } 836 | } 837 | if (this.isQuanX()) { 838 | let e = t["open-url"] || t.url || t.openUrl, 839 | s = t["media-url"] || t.mediaUrl; 840 | return { 841 | "open-url": e, 842 | "media-url": s 843 | } 844 | } 845 | if (this.isSurge()) { 846 | let e = t.url || t.openUrl || t["open-url"]; 847 | return { 848 | url: e 849 | } 850 | } 851 | } 852 | }; 853 | this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))); 854 | let h = ["", "==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="]; 855 | h.push(e), s && h.push(s), i && h.push(i), console.log(h.join("\n")), this.logs = this.logs.concat(h) 856 | } 857 | 858 | log(...t) { 859 | t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) 860 | } 861 | 862 | logErr(t, e) { 863 | const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); 864 | s ? this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t.stack) : this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t) 865 | } 866 | 867 | wait(t) { 868 | return new Promise(e => setTimeout(e, t)) 869 | } 870 | 871 | done(t = {}) { 872 | const e = (new Date).getTime(), 873 | s = (e - this.startTime) / 1e3; 874 | this.log("", `\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) 875 | } 876 | }(t, e) 877 | } -------------------------------------------------------------------------------- /dd_cookie.js: -------------------------------------------------------------------------------- 1 | 2 | let tokens = [ 3 | 4 | //账号1,填在引号中 5 | '', 6 | 7 | //账号2,填在引号中 8 | '' 9 | 10 | ]; 11 | 12 | module.exports = tokens; -------------------------------------------------------------------------------- /flhs.js: -------------------------------------------------------------------------------- 1 | /*返利好省 @YaphetS0903 2 | 3 | cron 0 8-23 * * * https://raw.githubusercontent.com/YaphetS0903/JStest/main/flhs.js 4 | 5 | 脚本库:https://github.com/YaphetS0903/JStest/ 6 | boxjs地址 : https://raw.githubusercontent.com/YaphetS0903/JStest/main/YaphteS0903.boxjs.json 7 | 8 | 9 | 10 | [脚本说明] 11 | 12 | 收益一天3-4毛,注册后点现金福利,弹出一个弹窗看广告,看完后会有1元豆子兑换,去提现1元秒到 13 | 14 | 不需要绑定手机,微信登录即可,多账号上吧 15 | 16 | 17 | 18 | [青龙变量] 19 | 20 | 抓包,进APP-现金福利,即可获取 21 | 22 | https://api.uutequan.com/v1/welfare/page 23 | 24 | 随便哪一个Cookie应该都行,多账号@隔开,json格式 25 | 26 | export flhsCookie='Cookie1@Cookie2' 27 | 28 | 29 | 30 | [QX重写] 31 | [task_local] 32 | #返利好省 33 | 0 8-23 * * * https://raw.githubusercontent.com/YaphetS0903/JStest/main/flhs.js, tag=返利好省, enabled=true 34 | 35 | [MITM] 36 | hostname = api.uutequan.com 37 | [rewrite_local] 38 | #返利好省 39 | https://api.uutequan.com/v1/welfare/page url script-request-header https://raw.githubusercontent.com/YaphetS0903/JStest/main/flhs.js 40 | 41 | 42 | */ 43 | 44 | 45 | const $ = new Env('返利好省'); 46 | let status; 47 | 48 | status = (status = ($.getval("flhsstatus") || "1")) > 1 ? `${status}` : ""; 49 | let flhsCookieArr = [], flhscount = '' 50 | let flhsCookie = $.isNode() ? (process.env.flhsCookie ? process.env.flhsCookie : "") : ($.getdata('flhsCookie') ? $.getdata('flhsCookie') : "") 51 | // //13位时间戳 52 | // let times = new Date().getTime() 53 | let DD = RT(2000, 3500) 54 | let tz = ($.getval('tz') || '1'); 55 | let tx = ($.getval('tx') || '1'); 56 | let id = '', platform = '', flhsextra = '', boxid = '', boxdbid = '', boxdbtype = '' 57 | $.message = '' 58 | let flhsCookies = "" 59 | 60 | 61 | 62 | 63 | !(async () => { 64 | if (typeof $request !== "undefined") { 65 | await flhsck() 66 | } else { 67 | if (!$.isNode()) { 68 | flhsCookieArr.push($.getdata('flhsCookie')) 69 | 70 | 71 | 72 | let flhscount = ($.getval('flhscount') || '1'); 73 | for (let i = 2; i <= flhscount; i++) { 74 | flhsCookieArr.push($.getdata(`flhsCookie${i}`)) 75 | 76 | 77 | 78 | } 79 | console.log( 80 | `\n\n=============================================== 脚本执行 - 北京时间(UTC+8):${new Date( 81 | new Date().getTime() + 82 | new Date().getTimezoneOffset() * 60 * 1000 + 83 | 8 * 60 * 60 * 1000 84 | ).toLocaleString()} ===============================================\n`); 85 | for (let i = 0; i < flhsCookieArr.length; i++) { 86 | if (flhsCookieArr[i]) { 87 | 88 | flhsCookie = flhsCookieArr[i]; 89 | 90 | 91 | 92 | $.index = i + 1; 93 | console.log(`\n\n开始【返利好省${$.index}作者@YaphetS0903】`) 94 | await flhsvideoreceive() 95 | await $.wait(10000) 96 | await flhsboxid() 97 | // message() 98 | } 99 | } 100 | } else { 101 | 102 | if (process.env.flhsCookie && process.env.flhsCookie.indexOf('@') > -1) { 103 | flhsCookieArr = process.env.flhsCookie.split('@'); 104 | console.log(`您选择的是用"@"隔开\n`) 105 | } else { 106 | flhsCookies = [process.env.flhsCookie] 107 | }; 108 | Object.keys(flhsCookies).forEach((item) => { 109 | if (flhsCookies[item]) { 110 | flhsCookieArr.push(flhsCookies[item]) 111 | } 112 | }) 113 | 114 | console.log(`共${flhsCookieArr.length}个cookie`) 115 | for (let k = 0; k < flhsCookieArr.length; k++) { 116 | $.message = "" 117 | 118 | 119 | flhsCookie = flhsCookieArr[k]; 120 | 121 | $.index = k + 1; 122 | console.log(`\n开始【返利好省${$.index}作者@YaphetS0903】`) 123 | 124 | await flhsvideoreceive() 125 | await $.wait(10000) 126 | await flhsboxid() 127 | // message() 128 | } 129 | } 130 | 131 | } 132 | })() 133 | 134 | .catch((e) => $.logErr(e)) 135 | .finally(() => $.done()) 136 | 137 | 138 | //https://api.uutequan.com/v1/welfare/page 139 | function flhsck() { 140 | if ($request.url.indexOf("welfare/page") > -1) { 141 | const flhsCookie = $request.headers['Cookie'] 142 | if (flhsCookie) $.setdata(flhsCookie, `flhsCookie${status}`) 143 | $.log(flhsCookie) 144 | 145 | $.msg($.name, "", `返利好省${status}获取数据成功`) 146 | 147 | } 148 | } 149 | 150 | 151 | 152 | 153 | 154 | //接受看视频任务 155 | function flhsvideoreceive(timeout = 0) { 156 | return new Promise((resolve) => { 157 | 158 | let url = { 159 | url: `https://api.uutequan.com/v1/welfare/mission/watch_video`, 160 | headers: { 161 | "Cookie": flhsCookie, 162 | }, 163 | } 164 | $.get(url, async (err, resp, data) => { 165 | try { 166 | 167 | const result = JSON.parse(data) 168 | 169 | if (result.errcode == 0) { 170 | console.log(`【接受看视频任务成功】\n`) 171 | platform =result.data.ad_platform 172 | flhsextra=result.data.params.extra 173 | await $.wait(15000) 174 | await flhstaskcomplete() 175 | 176 | } else { 177 | console.log(`【接受看视频任务失败】\n`) 178 | 179 | } 180 | } catch (e) { 181 | 182 | } finally { 183 | 184 | resolve() 185 | } 186 | }, timeout) 187 | }) 188 | } 189 | 190 | 191 | //完成所有任务 192 | function flhstaskcomplete(timeout = 0) { 193 | return new Promise((resolve) => { 194 | 195 | let url = { 196 | url: `https://api.uutequan.com/v1/advertisement/client/notify`, 197 | headers: {"Accept-Encoding": "gzip, deflate, br", 198 | "Accept-Language": "zh-Hans-CN;q=1", 199 | "Connection": "keep-alive", 200 | "Content-Type": "application/json", 201 | "Cookie": flhsCookie, 202 | "Host": "api.uutequan.com", 203 | }, 204 | body: `{ 205 | "ad_platform": ${platform}, 206 | "platform_order_no": "12345", 207 | "params": { 208 | "pos_id": "123456", 209 | "secret": "12345", 210 | "extra": "${flhsextra}" 211 | } 212 | }` 213 | } 214 | $.post(url, async (err, resp, data) => { 215 | try { 216 | 217 | const result = JSON.parse(data) 218 | 219 | if (result.errcode == 0) { 220 | console.log(`【完成任务成功】\n`) 221 | await $.wait(15000) 222 | await flhsallreward() 223 | 224 | } else { 225 | console.log(`【完成任务失败】\n`) 226 | 227 | } 228 | } catch (e) { 229 | 230 | } finally { 231 | 232 | resolve() 233 | } 234 | }, timeout) 235 | }) 236 | } 237 | 238 | 239 | //领取所有奖励 240 | function flhsallreward(timeout = 0) { 241 | return new Promise((resolve) => { 242 | 243 | let url = { 244 | url: `https://api.uutequan.com/v1/welfare/award/all`, 245 | headers: {"Accept-Encoding": "gzip, deflate, br", 246 | "Accept-Language": "zh-Hans-CN;q=1", 247 | "Connection": "keep-alive", 248 | "Content-Type": "application/json", 249 | "Cookie": flhsCookie, 250 | "Host": "api.uutequan.com", 251 | }, 252 | body: `{}` 253 | } 254 | $.post(url, async (err, resp, data) => { 255 | try { 256 | 257 | const result = JSON.parse(data) 258 | 259 | if (result.errcode == 0) { 260 | console.log(`【1】${result.data[0].title}【获得金币】${result.data[0].award_amount}\n`) 261 | } else { 262 | console.log(`【领取奖励失败,请检查配置】\n`) 263 | } 264 | } catch (e) { 265 | 266 | } finally { 267 | 268 | resolve() 269 | } 270 | }, timeout) 271 | }) 272 | } 273 | 274 | 275 | 276 | //宝箱任务获取id 277 | function flhsboxid(timeout = 0) { 278 | return new Promise((resolve) => { 279 | 280 | let url = { 281 | url: `https://api.uutequan.com/v1/welfare/treasure_box`, 282 | headers: { 283 | "Cookie": flhsCookie, 284 | }, 285 | 286 | } 287 | $.get(url, async (err, resp, data) => { 288 | try { 289 | 290 | const result = JSON.parse(data) 291 | 292 | if (result.errcode == 0) { 293 | console.log(`【查询宝箱id为】${result.data.config_id}\n`) 294 | 295 | boxid=result.data.config_id 296 | await $.wait(15000) 297 | await flhsboxreceive() 298 | } else { 299 | console.log(`【查询宝箱id失败】\n`) 300 | } 301 | } catch (e) { 302 | 303 | } finally { 304 | 305 | resolve() 306 | } 307 | }, timeout) 308 | }) 309 | } 310 | 311 | 312 | //拆宝箱 313 | function flhsboxreceive(timeout = 0) { 314 | return new Promise((resolve) => { 315 | 316 | let url = { 317 | url: `https://api.uutequan.com/v1/welfare/treasure_box`, 318 | headers: {"Accept-Encoding": "gzip, deflate, br", 319 | "Accept-Language": "zh-Hans-CN;q=1", 320 | "Connection": "keep-alive", 321 | "Content-Type": "application/json", 322 | "Cookie": flhsCookie, 323 | "Host": "api.uutequan.com", 324 | }, 325 | body: `{ 326 | "config_id": ${boxid} 327 | }` 328 | 329 | } 330 | $.post(url, async (err, resp, data) => { 331 | try { 332 | 333 | const result = JSON.parse(data) 334 | 335 | if (result.errcode == 0) { 336 | console.log(`【拆宝箱】${result.data.title}\n`) 337 | 338 | boxdbid=result.data.welfare_record_id 339 | boxdbtype=result.data.welfare_type 340 | await $.wait(15000) 341 | await flhsboxdbreceive() 342 | } else { 343 | console.log(`【拆宝箱失败】\n`) 344 | } 345 | } catch (e) { 346 | 347 | } finally { 348 | 349 | resolve() 350 | } 351 | }, timeout) 352 | }) 353 | } 354 | 355 | //拆宝箱翻倍任务接受 356 | function flhsboxdbreceive(timeout = 0) { 357 | return new Promise((resolve) => { 358 | 359 | let url = { 360 | url: `https://api.uutequan.com/v1/welfare/award/multiple`, 361 | headers: {"Accept-Encoding": "gzip, deflate, br", 362 | "Accept-Language": "zh-Hans-CN;q=1", 363 | "Connection": "keep-alive", 364 | "Content-Type": "application/json", 365 | "Cookie": flhsCookie, 366 | "Host": "api.uutequan.com", 367 | }, 368 | body: `{ 369 | "welfare_record_id": ${boxdbid}, 370 | "welfare_type": ${boxdbtype} 371 | }` 372 | 373 | } 374 | $.post(url, async (err, resp, data) => { 375 | try { 376 | 377 | const result = JSON.parse(data) 378 | 379 | if (result.errcode == 0) { 380 | console.log(`【接受看拆宝箱翻倍任务成功】\n`) 381 | platform =result.data.ad_platform 382 | flhsextra=result.data.params.extra 383 | await $.wait(15000) 384 | await flhstaskcomplete() 385 | } else { 386 | console.log(`【接受看拆宝箱翻倍任务失败】\n`) 387 | } 388 | } catch (e) { 389 | 390 | } finally { 391 | 392 | resolve() 393 | } 394 | }, timeout) 395 | }) 396 | } 397 | 398 | 399 | 400 | 401 | function message() { 402 | if (tz == 1) { $.msg($.name, "", $.message) } 403 | } 404 | //时间 405 | nowTimes = new Date( 406 | new Date().getTime() + 407 | new Date().getTimezoneOffset() * 60 * 1000 + 408 | 8 * 60 * 60 * 1000 409 | ); 410 | 411 | function RT(X, Y) { 412 | do rt = Math.floor(Math.random() * Y); 413 | while (rt < X) 414 | return rt; 415 | } 416 | 417 | 418 | //console.log('\n'+getCurrentDate()); 419 | function getCurrentDate() { 420 | var date = new Date(); 421 | var seperator1 = "-"; 422 | var seperator2 = ":"; 423 | var month = date.getMonth() + 1; 424 | var strDate = date.getDate(); 425 | if (month >= 1 && month <= 9) { 426 | month = "0" + month; 427 | } 428 | if (strDate >= 0 && strDate <= 9) { 429 | strDate = "0" + strDate; 430 | } 431 | var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate 432 | + " " + date.getHours() + seperator2 + date.getMinutes() 433 | + seperator2 + date.getSeconds(); 434 | return currentdate; 435 | 436 | 437 | } 438 | 439 | 440 | 441 | 442 | 443 | 444 | function Env(name, opts) { 445 | class Http { 446 | constructor(env) { 447 | this.env = env 448 | } 449 | send(opts, method = 'GET') { 450 | opts = typeof opts === 'string' ? { 451 | url: opts 452 | } : opts 453 | let sender = this.get 454 | if (method === 'POST') { 455 | sender = this.post 456 | } 457 | return new Promise((resolve, reject) => { 458 | sender.call(this, opts, (err, resp, body) => { 459 | if (err) reject(err) 460 | else resolve(resp) 461 | }) 462 | }) 463 | } 464 | get(opts) { 465 | return this.send.call(this.env, opts) 466 | } 467 | post(opts) { 468 | return this.send.call(this.env, opts, 'POST') 469 | } 470 | } 471 | return new (class { 472 | constructor(name, opts) { 473 | this.name = name 474 | this.http = new Http(this) 475 | this.data = null 476 | this.dataFile = 'box.dat' 477 | this.logs = [] 478 | this.isMute = false 479 | this.isNeedRewrite = false 480 | this.logSeparator = '\n' 481 | this.startTime = new Date().getTime() 482 | Object.assign(this, opts) 483 | this.log('', `🔔${this.name 484 | }, 开始!`) 485 | } 486 | isNode() { 487 | return 'undefined' !== typeof module && !!module.exports 488 | } 489 | isQuanX() { 490 | return 'undefined' !== typeof $task 491 | } 492 | isSurge() { 493 | return 'undefined' !== typeof $httpClient && 'undefined' === typeof $loon 494 | } 495 | isLoon() { 496 | return 'undefined' !== typeof $loon 497 | } 498 | isShadowrocket() { 499 | return 'undefined' !== typeof $rocket 500 | } 501 | toObj(str, defaultValue = null) { 502 | try { 503 | return JSON.parse(str) 504 | } catch { 505 | return defaultValue 506 | } 507 | } 508 | toStr(obj, defaultValue = null) { 509 | try { 510 | return JSON.stringify(obj) 511 | } catch { 512 | return defaultValue 513 | } 514 | } 515 | getjson(key, defaultValue) { 516 | let json = defaultValue 517 | const val = this.getdata(key) 518 | if (val) { 519 | try { 520 | json = JSON.parse(this.getdata(key)) 521 | } catch { } 522 | } 523 | return json 524 | } 525 | setjson(val, key) { 526 | try { 527 | return this.setdata(JSON.stringify(val), key) 528 | } catch { 529 | return false 530 | } 531 | } 532 | getScript(url) { 533 | return new Promise((resolve) => { 534 | this.get({ 535 | url 536 | }, (err, resp, body) => resolve(body)) 537 | }) 538 | } 539 | runScript(script, runOpts) { 540 | return new Promise((resolve) => { 541 | let httpapi = this.getdata('@chavy_boxjs_userCfgs.httpapi') 542 | httpapi = httpapi ? httpapi.replace(/\n/g, '').trim() : httpapi 543 | let httpapi_timeout = this.getdata('@chavy_boxjs_userCfgs.httpapi_timeout') 544 | httpapi_timeout = httpapi_timeout ? httpapi_timeout * 1 : 20 545 | httpapi_timeout = runOpts && runOpts.timeout ? runOpts.timeout : httpapi_timeout 546 | const [key, addr] = httpapi.split('@') 547 | const opts = { 548 | url: `http: //${addr}/v1/scripting/evaluate`, 549 | body: { 550 | script_text: script, 551 | mock_type: 'cron', 552 | timeout: httpapi_timeout 553 | }, 554 | headers: { 555 | 'X-Key': key, 556 | 'Accept': '*/*' 557 | } 558 | } 559 | this.post(opts, (err, resp, body) => resolve(body)) 560 | }).catch((e) => this.logErr(e)) 561 | } 562 | loaddata() { 563 | if (this.isNode()) { 564 | this.fs = this.fs ? this.fs : require('fs') 565 | this.path = this.path ? this.path : require('path') 566 | const curDirDataFilePath = this.path.resolve(this.dataFile) 567 | const rootDirDataFilePath = this.path.resolve(process.cwd(), this.dataFile) 568 | const isCurDirDataFile = this.fs.existsSync(curDirDataFilePath) 569 | const isRootDirDataFile = !isCurDirDataFile && this.fs.existsSync(rootDirDataFilePath) 570 | if (isCurDirDataFile || isRootDirDataFile) { 571 | const datPath = isCurDirDataFile ? curDirDataFilePath : rootDirDataFilePath 572 | try { 573 | return JSON.parse(this.fs.readFileSync(datPath)) 574 | } catch (e) { 575 | return {} 576 | } 577 | } else return {} 578 | } else return {} 579 | } 580 | writedata() { 581 | if (this.isNode()) { 582 | this.fs = this.fs ? this.fs : require('fs') 583 | this.path = this.path ? this.path : require('path') 584 | const curDirDataFilePath = this.path.resolve(this.dataFile) 585 | const rootDirDataFilePath = this.path.resolve(process.cwd(), this.dataFile) 586 | const isCurDirDataFile = this.fs.existsSync(curDirDataFilePath) 587 | const isRootDirDataFile = !isCurDirDataFile && this.fs.existsSync(rootDirDataFilePath) 588 | const jsondata = JSON.stringify(this.data) 589 | if (isCurDirDataFile) { 590 | this.fs.writeFileSync(curDirDataFilePath, jsondata) 591 | } else if (isRootDirDataFile) { 592 | this.fs.writeFileSync(rootDirDataFilePath, jsondata) 593 | } else { 594 | this.fs.writeFileSync(curDirDataFilePath, jsondata) 595 | } 596 | } 597 | } 598 | lodash_get(source, path, defaultValue = undefined) { 599 | const paths = path.replace(/[(d+)]/g, '.$1').split('.') 600 | let result = source 601 | for (const p of paths) { 602 | result = Object(result)[p] 603 | if (result === undefined) { 604 | return defaultValue 605 | } 606 | } 607 | return result 608 | } 609 | lodash_set(obj, path, value) { 610 | if (Object(obj) !== obj) return obj 611 | if (!Array.isArray(path)) path = path.toString().match(/[^.[]]+/g) || [] 612 | path 613 | .slice(0, -1) 614 | .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[ 615 | path[path.length - 1] 616 | ] = value 617 | return obj 618 | } 619 | getdata(key) { 620 | let val = this.getval(key) 621 | // 如果以 @ 622 | if (/^@/.test(key)) { 623 | const [, objkey, paths] = /^@(.*?).(.*?)$/.exec(key) 624 | const objval = objkey ? this.getval(objkey) : '' 625 | if (objval) { 626 | try { 627 | const objedval = JSON.parse(objval) 628 | val = objedval ? this.lodash_get(objedval, paths, '') : val 629 | } catch (e) { 630 | val = '' 631 | } 632 | } 633 | } 634 | return val 635 | } 636 | setdata(val, key) { 637 | let issuc = false 638 | if (/^@/.test(key)) { 639 | const [, objkey, paths] = /^@(.*?).(.*?)$/.exec(key) 640 | const objdat = this.getval(objkey) 641 | const objval = objkey ? (objdat === 'null' ? null : objdat || '{}') : '{}' 642 | try { 643 | const objedval = JSON.parse(objval) 644 | this.lodash_set(objedval, paths, val) 645 | issuc = this.setval(JSON.stringify(objedval), objkey) 646 | } catch (e) { 647 | const objedval = {} 648 | this.lodash_set(objedval, paths, val) 649 | issuc = this.setval(JSON.stringify(objedval), objkey) 650 | } 651 | } else { 652 | issuc = this.setval(val, key) 653 | } 654 | return issuc 655 | } 656 | getval(key) { 657 | if (this.isSurge() || this.isLoon()) { 658 | return $persistentStore.read(key) 659 | } else if (this.isQuanX()) { 660 | return $prefs.valueForKey(key) 661 | } else if (this.isNode()) { 662 | this.data = this.loaddata() 663 | return this.data[key] 664 | } else { 665 | return (this.data && this.data[key]) || null 666 | } 667 | } 668 | setval(val, key) { 669 | if (this.isSurge() || this.isLoon()) { 670 | return $persistentStore.write(val, key) 671 | } else if (this.isQuanX()) { 672 | return $prefs.setValueForKey(val, key) 673 | } else if (this.isNode()) { 674 | this.data = this.loaddata() 675 | this.data[key] = val 676 | this.writedata() 677 | return true 678 | } else { 679 | return (this.data && this.data[key]) || null 680 | } 681 | } 682 | initGotEnv(opts) { 683 | this.got = this.got ? this.got : require('got') 684 | this.cktough = this.cktough ? this.cktough : require('tough-cookie') 685 | this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar() 686 | if (opts) { 687 | opts.headers = opts.headers ? opts.headers : {} 688 | if (undefined === opts.headers.Cookie && undefined === opts.cookieJar) { 689 | opts.cookieJar = this.ckjar 690 | } 691 | } 692 | } 693 | get(opts, callback = () => { }) { 694 | if (opts.headers) { 695 | delete opts.headers['Content-Type'] 696 | delete opts.headers['Content-Length'] 697 | } 698 | if (this.isSurge() || this.isLoon()) { 699 | if (this.isSurge() && this.isNeedRewrite) { 700 | opts.headers = opts.headers || {} 701 | Object.assign(opts.headers, { 702 | 'X-Surge-Skip-Scripting': false 703 | }) 704 | } 705 | $httpClient.get(opts, (err, resp, body) => { 706 | if (!err && resp) { 707 | resp.body = body 708 | resp.statusCode = resp.status 709 | } 710 | callback(err, resp, body) 711 | }) 712 | } else if (this.isQuanX()) { 713 | if (this.isNeedRewrite) { 714 | opts.opts = opts.opts || {} 715 | Object.assign(opts.opts, { 716 | hints: false 717 | }) 718 | } 719 | $task.fetch(opts).then( 720 | (resp) => { 721 | const { 722 | statusCode: status, 723 | statusCode, 724 | headers, 725 | body 726 | } = resp 727 | callback(null, { 728 | status, 729 | statusCode, 730 | headers, 731 | body 732 | }, body) 733 | }, 734 | (err) => callback(err) 735 | ) 736 | } else if (this.isNode()) { 737 | this.initGotEnv(opts) 738 | this.got(opts) 739 | .on('redirect', (resp, nextOpts) => { 740 | try { 741 | if (resp.headers['set-cookie']) { 742 | const ck = resp.headers['set-cookie'].map(this.cktough.Cookie.parse).toString() 743 | if (ck) { 744 | this.ckjar.setCookieSync(ck, null) 745 | } 746 | nextOpts.cookieJar = this.ckjar 747 | } 748 | } catch (e) { 749 | this.logErr(e) 750 | } 751 | // this.ckjar.setCookieSync(resp.headers['set-cookie'].map(Cookie.parse).toString()) 752 | }) 753 | .then( 754 | (resp) => { 755 | const { 756 | statusCode: status, 757 | statusCode, 758 | headers, 759 | body 760 | } = resp 761 | callback(null, { 762 | status, 763 | statusCode, 764 | headers, 765 | body 766 | }, body) 767 | }, 768 | (err) => { 769 | const { 770 | message: error, 771 | response: resp 772 | } = err 773 | callback(error, resp, resp && resp.body) 774 | } 775 | ) 776 | } 777 | } 778 | post(opts, callback = () => { }) { 779 | const method = opts.method ? opts.method.toLocaleLowerCase() : 'post' 780 | // 如果指定了请求体, 但没指定`Content-Type`, 则自动生成 781 | if (opts.body && opts.headers && !opts.headers['Content-Type']) { 782 | opts.headers['Content-Type'] = 'application/x-www-form-urlencoded' 783 | } 784 | if (opts.headers) delete opts.headers['Content-Length'] 785 | if (this.isSurge() || this.isLoon()) { 786 | if (this.isSurge() && this.isNeedRewrite) { 787 | opts.headers = opts.headers || {} 788 | Object.assign(opts.headers, { 789 | 'X-Surge-Skip-Scripting': false 790 | }) 791 | } 792 | $httpClient[method](opts, (err, resp, body) => { 793 | if (!err && resp) { 794 | resp.body = body 795 | resp.statusCode = resp.status 796 | } 797 | callback(err, resp, body) 798 | }) 799 | } else if (this.isQuanX()) { 800 | opts.method = method 801 | if (this.isNeedRewrite) { 802 | opts.opts = opts.opts || {} 803 | Object.assign(opts.opts, { 804 | hints: false 805 | }) 806 | } 807 | $task.fetch(opts).then( 808 | (resp) => { 809 | const { 810 | statusCode: status, 811 | statusCode, 812 | headers, 813 | body 814 | } = resp 815 | callback(null, { 816 | status, 817 | statusCode, 818 | headers, 819 | body 820 | }, body) 821 | }, 822 | (err) => callback(err) 823 | ) 824 | } else if (this.isNode()) { 825 | this.initGotEnv(opts) 826 | const { 827 | url, 828 | ..._opts 829 | } = opts 830 | this.got[method](url, _opts).then( 831 | (resp) => { 832 | const { 833 | statusCode: status, 834 | statusCode, 835 | headers, 836 | body 837 | } = resp 838 | callback(null, { 839 | status, 840 | statusCode, 841 | headers, 842 | body 843 | }, body) 844 | }, 845 | (err) => { 846 | const { 847 | message: error, 848 | response: resp 849 | } = err 850 | callback(error, resp, resp && resp.body) 851 | } 852 | ) 853 | } 854 | } 855 | /** 856 | * 857 | * 示例:$.time('yyyy-MM-dd qq HH:mm:ss.S') 858 | * :$.time('yyyyMMddHHmmssS') 859 | * y:年 M:月 d:日 q:季 H:时 m:分 s:秒 S:毫秒 860 | * 其中y可选0-4位占位符、S可选0-1位占位符,其余可选0-2位占位符 861 | * @param {string} fmt 格式化参数 862 | * @param {number} 可选: 根据指定时间戳返回格式化日期 863 | * 864 | */ 865 | time(fmt, ts = null) { 866 | const date = ts ? new Date(ts) : new Date() 867 | let o = { 868 | 'M+': date.getMonth() + 1, 869 | 'd+': date.getDate(), 870 | 'H+': date.getHours(), 871 | 'm+': date.getMinutes(), 872 | 's+': date.getSeconds(), 873 | 'q+': Math.floor((date.getMonth() + 3) / 3), 874 | 'S': date.getMilliseconds() 875 | } 876 | if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length)) 877 | for (let k in o) 878 | if (new RegExp('(' + k + ')').test(fmt)) 879 | fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length)) 880 | return fmt 881 | } 882 | /** 883 | * 系统通知 884 | * 885 | * > 通知参数: 同时支持 QuanX 和 Loon 两种格式, EnvJs根据运行环境自动转换, Surge 环境不支持多媒体通知 886 | * 887 | * 示例: 888 | * $.msg(title, subt, desc, 'twitter://') 889 | * $.msg(title, subt, desc, { 'open-url': 'twitter://', 'media-url': 'https://github.githubassets.com/images/modules/open_graph/github-mark.png' }) 890 | * $.msg(title, subt, desc, { 'open-url': 'https://bing.com', 'media-url': 'https://github.githubassets.com/images/modules/open_graph/github-mark.png' }) 891 | * 892 | * @param {*} title 标题 893 | * @param {*} subt 副标题 894 | * @param {*} desc 通知详情 895 | * @param {*} opts 通知参数 896 | * 897 | */ 898 | msg(title = name, subt = '', desc = '', opts) { 899 | const toEnvOpts = (rawopts) => { 900 | if (!rawopts) return rawopts 901 | if (typeof rawopts === 'string') { 902 | if (this.isLoon()) return rawopts 903 | else if (this.isQuanX()) return { 904 | 'open-url': rawopts 905 | } 906 | else if (this.isSurge()) return { 907 | url: rawopts 908 | } 909 | else return undefined 910 | } else if (typeof rawopts === 'object') { 911 | if (this.isLoon()) { 912 | let openUrl = rawopts.openUrl || rawopts.url || rawopts['open-url'] 913 | let mediaUrl = rawopts.mediaUrl || rawopts['media-url'] 914 | return { 915 | openUrl, 916 | mediaUrl 917 | } 918 | } else if (this.isQuanX()) { 919 | let openUrl = rawopts['open-url'] || rawopts.url || rawopts.openUrl 920 | let mediaUrl = rawopts['media-url'] || rawopts.mediaUrl 921 | return { 922 | 'open-url': openUrl, 923 | 'media-url': mediaUrl 924 | } 925 | } else if (this.isSurge()) { 926 | let openUrl = rawopts.url || rawopts.openUrl || rawopts['open-url'] 927 | return { 928 | url: openUrl 929 | } 930 | } 931 | } else { 932 | return undefined 933 | } 934 | } 935 | if (!this.isMute) { 936 | if (this.isSurge() || this.isLoon()) { 937 | $notification.post(title, subt, desc, toEnvOpts(opts)) 938 | } else if (this.isQuanX()) { 939 | $notify(title, subt, desc, toEnvOpts(opts)) 940 | } 941 | } 942 | if (!this.isMuteLog) { 943 | let logs = ['', '==============📣系统通知📣=============='] 944 | logs.push(title) 945 | subt ? logs.push(subt) : '' 946 | desc ? logs.push(desc) : '' 947 | console.log(logs.join('\n')) 948 | this.logs = this.logs.concat(logs) 949 | } 950 | } 951 | log(...logs) { 952 | if (logs.length > 0) { 953 | this.logs = [...this.logs, ...logs] 954 | } 955 | console.log(logs.join(this.logSeparator)) 956 | } 957 | logErr(err, msg) { 958 | const isPrintSack = !this.isSurge() && !this.isQuanX() && !this.isLoon() 959 | if (!isPrintSack) { 960 | this.log('', `❗️${this.name 961 | }, 错误!`, err) 962 | } else { 963 | this.log('', `❗️${this.name 964 | }, 错误!`, err.stack) 965 | } 966 | } 967 | wait(time) { 968 | return new Promise((resolve) => setTimeout(resolve, time)) 969 | } 970 | done(val = {}) { 971 | const endTime = new Date().getTime() 972 | const costTime = (endTime - this.startTime) / 1000 973 | this.log('', `🔔${this.name 974 | }, 结束!🕛${costTime}秒`) 975 | this.log() 976 | if (this.isSurge() || this.isQuanX() || this.isLoon()) { 977 | $done(val) 978 | } 979 | } 980 | })(name, opts) 981 | } 982 | 983 | 984 | -------------------------------------------------------------------------------- /gyj.js: -------------------------------------------------------------------------------- 1 | /*佣金帝 @liuqi6968 2 | 11.01 3 | 4 | cron 21 15 * * * gyj.js 5 | 6 | 脚本库:https://raw.githubusercontent.com/liuqi6968/-/main/gyj.js 7 | 作者已删 8 | 9 | 10 | [脚本说明] 11 | 12 | 安卓:佣金帝;ios:佣金帝 13 | 14 | 入口:首页-签到赚钱,提现在我的页面 15 | 16 | 目前只有每天视频任务可做,50金币≈0.05元,2000金币兑换2元,每月25号后10元起提 17 | 18 | 19 | 20 | [青龙变量] 21 | 22 | 抓包,进APP-签到赚钱,即可获取 23 | 24 | https://client.atomsh.com/e00-bee-client/client/act/getGoldCount 25 | 26 | 复制token值,添加到环境变量,多账号@隔开 27 | 28 | export gyjhd='token1@token2@token3' 29 | 30 | 31 | 32 | */ 33 | 34 | 35 | 36 | 37 | const $ = new Env('高佣金'); 38 | let status; 39 | 40 | status = (status = ($.getval("gyjstatus") || "1")) > 1 ? `${status}` : ""; 41 | let gyjurlArr = [], gyjhdArr = [], gyjcount = '' 42 | let gyjurl = $.getdata('gyjurl') 43 | let gyjhd = $.isNode() ? (process.env.gyjhd ? process.env.gyjhd : "") : ($.getdata('gyjhd') ? $.getdata('gyjhd') : "") 44 | let tz = ($.getval('tz') || '1'); 45 | $.message = '' 46 | let gyjhds = "" 47 | 48 | 49 | 50 | 51 | !(async () => { 52 | if (typeof $request !== "undefined") { 53 | await gyjck() 54 | } else { 55 | if (!$.isNode()) { 56 | gyjurlArr.push($.getdata('gyjurl')) 57 | gyjhdArr.push($.getdata('gyjhd')) 58 | 59 | let gyjcount = ($.getval('gyjcount') || '1'); 60 | for (let i = 2; i <= gyjcount; i++) { 61 | gyjurlArr.push($.getdata(`gyjurl${i}`)) 62 | gyjhdArr.push($.getdata(`gyjhd${i}`)) 63 | 64 | } 65 | console.log( 66 | `\n\n=============================================== 脚本执行 - 北京时间(UTC+8):${new Date( 67 | new Date().getTime() + 68 | new Date().getTimezoneOffset() * 60 * 1000 + 69 | 8 * 60 * 60 * 1000 70 | ).toLocaleString()} ===============================================\n`); 71 | for (let i = 0; i < gyjhdArr.length; i++) { 72 | if (gyjhdArr[i]) { 73 | 74 | gyjurl = gyjurlArr[i]; 75 | gyjhd = gyjhdArr[i]; 76 | 77 | 78 | $.index = i + 1; 79 | console.log(`\n\n开始【高佣金${$.index}】`) 80 | await grxx() 81 | await $.wait(3000) 82 | //循环运行 恶魔👿封印请勿增加 83 | for (let c = 0; c < 8; c++) { 84 | $.index = c + 1 85 | 86 | 87 | await gksp()//你要执行的版块 88 | await $.wait(20000)//你要延迟的时间 1000=1秒 89 | } 90 | 91 | await yhjb()//你要执行的版块 92 | await $.wait(1000) // 93 | 94 | message() 95 | } 96 | } 97 | } else { 98 | if (process.env.gyjhd && process.env.gyjhd.indexOf('@') > -1) { 99 | gyjhdArr = process.env.gyjhd.split('@'); 100 | console.log(`您选择的是用"@"隔开\n`) 101 | } else { 102 | gyjhds = [process.env.gyjhd] 103 | }; 104 | Object.keys(gyjhds).forEach((item) => { 105 | if (gyjhds[item]) { 106 | gyjhdArr.push(gyjhds[item]) 107 | } 108 | }) 109 | console.log(`共${gyjhdArr.length}个cookie`) 110 | for (let k = 0; k < gyjhdArr.length; k++) { 111 | $.message = "" 112 | gyjhd = gyjhdArr[k] 113 | $.index = k + 1; 114 | console.log(`\n开始【高佣金${$.index}】`) 115 | await grxx() 116 | await $.wait(3000) 117 | //循环运行 恶魔👿封印请勿增加 118 | for (let c = 0; c < 8; c++) { 119 | $.index = c + 1 120 | 121 | 122 | await gksp()//你要执行的版块 123 | await $.wait(20000)//你要延迟的时间 1000=1秒 124 | 125 | } 126 | await yhjb()//你要执行的版块 127 | await $.wait(1000) 128 | message() 129 | } 130 | 131 | } 132 | 133 | } 134 | })() 135 | 136 | .catch((e) => $.logErr(e)) 137 | .finally(() => $.done()) 138 | 139 | //https://client.atomsh.com:10012/e00-bee-client/client/act/getGoldCount 140 | //获取ck 141 | function gyjck() { 142 | if ($request.url.indexOf("client") > -1 && $request.url.indexOf("act") > -1 && $request.url.indexOf("getGoldCount") > -1) { 143 | const gyjurl = $request.url 144 | if (gyjurl) $.setdata(gyjurl, `gyjurl${status}`) 145 | 146 | const gyjhd = $request.headers.token 147 | if (gyjhd) $.setdata(gyjhd, `gyjhd${status}`) 148 | $.log(gyjhd) 149 | 150 | $.msg($.name, "", `高佣金${status}获取token成功`) 151 | 152 | } 153 | } 154 | 155 | //个人信息 156 | function grxx(timeout = 0) { 157 | return new Promise((resolve) => { 158 | 159 | let url = { 160 | url: `https://client.atomsh.com/e00-bee-client/client/user-mine/getUserInfo`, 161 | headers: //JSON.parse(gyjhd), 162 | { 163 | "Host": "client.atomsh.com:10012", 164 | "Connection": "keep-alive", 165 | "Accept": "application/json, text/plain, */*", 166 | "Origin": "https://h5.atomsh.com", 167 | "Sec-Fetch-Dest": "empty", 168 | "User-Agent": "Mozilla/5.0 (Linux; Android 9; Mi Note 3 Build/PKQ1.181007.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.99 Mobile Safari/537.36 AgentWeb/4.1.3 UCBrowser/11.6.4.950", 169 | "token": `${gyjhd}`, 170 | "client_id": "E00-BEE-CLIENT-WEB", 171 | "X-Requested-With": "com.atomsh", 172 | "Sec-Fetch-Site": "same-site", 173 | "Sec-Fetch-Mode": "cors", 174 | "Referer": "https://h5.atomsh.com/", 175 | "Accept-Encoding": "gzip, deflate", 176 | "Accept-Language": "zh-CN,zh;q\u003d0.9,en-US;q\u003d0.8,en;q\u003d0.7" 177 | }, 178 | } 179 | 180 | $.get(url, async (err, resp, data) => { 181 | try { 182 | 183 | data = JSON.parse(data) 184 | 185 | if (data.code == 1) { 186 | 187 | console.log(`【🐮🐮】:${data.data.nickname}\n`) 188 | $.message +=`【🐮🐮】:${data.data.nickname}\n` 189 | console.log(`【邀请码】:${data.data.invitationCode}\n`) 190 | $.message +=`【邀请码】:${data.data.invitationCode}\n` 191 | 192 | await qd()//你要执行的版块 193 | await $.wait(2000) 194 | 195 | } else { 196 | 197 | } 198 | } catch (e) { 199 | 200 | } finally { 201 | 202 | resolve() 203 | } 204 | }, timeout) 205 | }) 206 | } 207 | 208 | 209 | //签到 210 | function qd(timeout = 0) { 211 | return new Promise((resolve) => { 212 | 213 | let url = { 214 | url: `https://client.atomsh.com/e00-bee-client/client/act/doSign?actId=497`, 215 | headers: //JSON.parse(gyjhd), 216 | { 217 | "Host": "client.atomsh.com:10012", 218 | "Connection": "keep-alive", 219 | "Accept": "application/json, text/plain, */*", 220 | "Origin": "https://h5.atomsh.com", 221 | "Sec-Fetch-Dest": "empty", 222 | "User-Agent": "Mozilla/5.0 (Linux; Android 9; Mi Note 3 Build/PKQ1.181007.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.99 Mobile Safari/537.36 AgentWeb/4.1.3 UCBrowser/11.6.4.950", 223 | "token": `${gyjhd}`, 224 | "client_id": "E00-BEE-CLIENT-WEB", 225 | "X-Requested-With": "com.atomsh", 226 | "Sec-Fetch-Site": "same-site", 227 | "Sec-Fetch-Mode": "cors", 228 | "Referer": "https://h5.atomsh.com/", 229 | "Accept-Encoding": "gzip, deflate", 230 | "Accept-Language": "zh-CN,zh;q\u003d0.9,en-US;q\u003d0.8,en;q\u003d0.7" 231 | }, 232 | } 233 | 234 | $.get(url, async (err, resp, data) => { 235 | try { 236 | 237 | data = JSON.parse(data) 238 | 239 | if (data.code == 1) { 240 | 241 | console.log(`【📆】:${data.msg}\n`) 242 | $.message +=`【📆】:${data.msg}\n` 243 | 244 | 245 | 246 | 247 | } else { 248 | console.log(`【📆】:${data.msg}\n`) 249 | $.message +=`【📆】:${data.msg}\n` 250 | } 251 | } catch (e) { 252 | 253 | } finally { 254 | 255 | resolve() 256 | } 257 | }, timeout) 258 | }) 259 | } 260 | 261 | 262 | //观看视频 263 | function gksp(timeout = 0) { 264 | return new Promise((resolve) => { 265 | 266 | let url = { 267 | url: `https://client.atomsh.com/e00-bee-client/client/act/join?actId=499&actRuleId=792`, 268 | headers: //JSON.parse(gyjhd), 269 | { 270 | "Host": "client.atomsh.com:10012", 271 | "Connection": "keep-alive", 272 | "Accept": "application/json, text/plain, */*", 273 | "Origin": "https://h5.atomsh.com", 274 | "Sec-Fetch-Dest": "empty", 275 | "User-Agent": "Mozilla/5.0 (Linux; Android 9; Mi Note 3 Build/PKQ1.181007.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.99 Mobile Safari/537.36 AgentWeb/4.1.3 UCBrowser/11.6.4.950", 276 | "token": `${gyjhd}`, 277 | "client_id": "E00-BEE-CLIENT-WEB", 278 | "X-Requested-With": "com.atomsh", 279 | "Sec-Fetch-Site": "same-site", 280 | "Sec-Fetch-Mode": "cors", 281 | "Referer": "https://h5.atomsh.com/", 282 | "Accept-Encoding": "gzip, deflate", 283 | "Accept-Language": "zh-CN,zh;q\u003d0.9,en-US;q\u003d0.8,en;q\u003d0.7" 284 | }, 285 | } 286 | 287 | $.get(url, async (err, resp, data) => { 288 | try { 289 | 290 | data = JSON.parse(data) 291 | 292 | if (data.code == 1) { 293 | 294 | console.log(`【📺】:${data.data.actRuleName}\n`) 295 | $.message +=`【📺】:${data.data.actRuleName}\n` 296 | spid = data.data.actJoinId 297 | console.log(`【获取到spid】\n`) 298 | console.log(spid) 299 | await $.wait(5000) 300 | await sbsj() 301 | 302 | 303 | 304 | } else { 305 | 306 | 307 | } 308 | } catch (e) { 309 | 310 | } finally { 311 | 312 | resolve() 313 | } 314 | }, timeout) 315 | }) 316 | } 317 | //上报数据 318 | function sbsj(timeout = 0) { 319 | return new Promise((resolve) => { 320 | 321 | let url = { 322 | url: `https://client.atomsh.com/e00-bee-client/client/log/saveCommonLog?type=200`, 323 | headers: //JSON.parse(gyjhd), 324 | { 325 | "Host": "client.atomsh.com:10012", 326 | "Connection": "keep-alive", 327 | "Accept": "application/json, text/plain, */*", 328 | "Origin": "https://h5.atomsh.com", 329 | "Sec-Fetch-Dest": "empty", 330 | "User-Agent": "Mozilla/5.0 (Linux; Android 9; Mi Note 3 Build/PKQ1.181007.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.99 Mobile Safari/537.36 AgentWeb/4.1.3 UCBrowser/11.6.4.950", 331 | "token": `${gyjhd}`, 332 | "client_id": "E00-BEE-CLIENT-WEB", 333 | "X-Requested-With": "com.atomsh", 334 | "Sec-Fetch-Site": "same-site", 335 | "Sec-Fetch-Mode": "cors", 336 | "Referer": "https://h5.atomsh.com/", 337 | "Accept-Encoding": "gzip, deflate", 338 | "Accept-Language": "zh-CN,zh;q\u003d0.9,en-US;q\u003d0.8,en;q\u003d0.7" 339 | }, 340 | } 341 | 342 | $.get(url, async (err, resp, data) => { 343 | try { 344 | 345 | data = JSON.parse(data) 346 | 347 | if (data.code == 1) { 348 | 349 | console.log(`【🔍】:${data.msg}\n`) 350 | 351 | 352 | 353 | 354 | await $.wait(5000) 355 | await lqjl() 356 | 357 | 358 | } else { 359 | 360 | console.log(`【🔍】:${data.msg}\n`) 361 | 362 | } 363 | } catch (e) { 364 | 365 | } finally { 366 | 367 | resolve() 368 | } 369 | }, timeout) 370 | }) 371 | } 372 | 373 | 374 | //领取奖励 375 | function lqjl(timeout = 0) { 376 | return new Promise((resolve) => { 377 | 378 | let url = { 379 | url: `https://client.atomsh.com/e00-bee-client/client/act/activeTimely?joinId=${spid}`, 380 | headers: //JSON.parse(gyjhd), 381 | { 382 | "Host": "client.atomsh.com:10012", 383 | "Connection": "keep-alive", 384 | "Accept": "application/json, text/plain, */*", 385 | "Origin": "https://h5.atomsh.com", 386 | "Sec-Fetch-Dest": "empty", 387 | "User-Agent": "Mozilla/5.0 (Linux; Android 9; Mi Note 3 Build/PKQ1.181007.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.99 Mobile Safari/537.36 AgentWeb/4.1.3 UCBrowser/11.6.4.950", 388 | "token": `${gyjhd}`, 389 | "client_id": "E00-BEE-CLIENT-WEB", 390 | "X-Requested-With": "com.atomsh", 391 | "Sec-Fetch-Site": "same-site", 392 | "Sec-Fetch-Mode": "cors", 393 | "Referer": "https://h5.atomsh.com/", 394 | "Accept-Encoding": "gzip, deflate", 395 | "Accept-Language": "zh-CN,zh;q\u003d0.9,en-US;q\u003d0.8,en;q\u003d0.7" 396 | }, 397 | } 398 | 399 | $.get(url, async (err, resp, data) => { 400 | try { 401 | 402 | data = JSON.parse(data) 403 | 404 | if (data.code == 1) { 405 | 406 | console.log(`【领取💰💰】:${data.msg}\n`) 407 | 408 | $.message += `【领取💰💰】:${data.msg}\n` 409 | 410 | } else { 411 | console.log(`【领取失败】:${data.msg}\n`) 412 | $.message += `【领取失败】:${data.msg}\n` 413 | 414 | } 415 | } catch (e) { 416 | 417 | } finally { 418 | 419 | resolve() 420 | } 421 | }, timeout) 422 | }) 423 | } 424 | //用户金币 425 | function yhjb(timeout = 0) { 426 | return new Promise((resolve) => { 427 | 428 | let url = { 429 | url: `https://client.atomsh.com/e00-bee-client/client/act/getGoldCount`, 430 | headers: //JSON.parse(gyjhd), 431 | { 432 | "Host": "client.atomsh.com:10012", 433 | "Connection": "keep-alive", 434 | "Accept": "application/json, text/plain, */*", 435 | "Origin": "https://h5.atomsh.com", 436 | "Sec-Fetch-Dest": "empty", 437 | "User-Agent": "Mozilla/5.0 (Linux; Android 9; Mi Note 3 Build/PKQ1.181007.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.99 Mobile Safari/537.36 AgentWeb/4.1.3 UCBrowser/11.6.4.950", 438 | "token": `${gyjhd}`, 439 | "client_id": "E00-BEE-CLIENT-WEB", 440 | "X-Requested-With": "com.atomsh", 441 | "Sec-Fetch-Site": "same-site", 442 | "Sec-Fetch-Mode": "cors", 443 | "Referer": "https://h5.atomsh.com/", 444 | "Accept-Encoding": "gzip, deflate", 445 | "Accept-Language": "zh-CN,zh;q\u003d0.9,en-US;q\u003d0.8,en;q\u003d0.7" 446 | }, 447 | } 448 | 449 | $.get(url, async (err, resp, data) => { 450 | try { 451 | 452 | data = JSON.parse(data) 453 | 454 | if (data.code == 1) { 455 | 456 | console.log(`【总金币】:${data.data}\n💎`) 457 | 458 | $.message += `【总金币】:${data.data}\n💎` 459 | 460 | } else { 461 | 462 | } 463 | } catch (e) { 464 | 465 | } finally { 466 | 467 | resolve() 468 | } 469 | }, timeout) 470 | }) 471 | } 472 | 473 | 474 | 475 | function message() { 476 | if (tz == 1) { $.msg($.name, "", $.message) } 477 | } 478 | 479 | 480 | //env模块 不要动 481 | 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) } -------------------------------------------------------------------------------- /jcCheck.js: -------------------------------------------------------------------------------- 1 | /* 2 | 机场签到 需要在脚本里填写邮箱密码 3 | corn 0 0 8 * * ? 4 | https://raw.githubusercontent.com/QiFengg/QuantumultX_Conf/main/Scripts/jcCheck.js 5 | */ 6 | 7 | /* 8 | 1.好家伙机场 9 | 付费 便宜3.99 50g 流量每隔31天重置 签到每天1g-4g随机 可看NF 速度快 提供小火箭下载账号 10 | 注册地址:haojiahuo.live/auth/register?code=FErc 11 | */ 12 | let hjh = { 13 | email: "", 14 | pwd: "", 15 | }; 16 | 17 | /* 18 | 2.ikuuu机场 19 | 注册地址:https://ikuuu.co/auth/register?code=Hg2Y 20 | 白嫖版 注册送50g 签到每天1g以内 随机 速度还行 21 | 套餐10元300g 提供小火箭下载账号 22 | */ 23 | 24 | let iku = { 25 | email: "", 26 | pwd: "", 27 | }; 28 | 29 | /* 30 | 3.几鸡机场 31 | 注册地址:https://b.luxury/waf/GGWE9QhLsLE74X422 32 | 白嫖版 注册送10g 签到每天1g-4g随机 速度还行 33 | 付费很多套餐 5块钱一个月300G 流量每隔31天重置 控制套餐购买人数 34 | */ 35 | 36 | let jj = { 37 | email: "", 38 | pwd: "", 39 | }; 40 | 41 | const $ = new Env("机场签到"); 42 | const notify = $.isNode() ? require("./sendNotify") : ""; 43 | 44 | !(async () => { 45 | console.log( 46 | `\n\n=====脚本执行 - 北京时间(UTC+8):${new Date( 47 | new Date().getTime() + 48 | new Date().getTimezoneOffset() * 60 * 1000 + 49 | 8 * 60 * 60 * 1000 50 | ).toLocaleString()}=====\n` 51 | ); 52 | if (hjh.email == "" && hjh.pwd == "") { 53 | console.log("好家伙邮箱密码为空,跳过执行\n\n"); 54 | } else { 55 | await login("好家伙", "https://haojiahuo.live/auth/login", hjh); 56 | } 57 | 58 | if (iku.email == "" && iku.pwd == "") { 59 | console.log("ikuuu邮箱密码为空,跳过执行\n\n"); 60 | } else { 61 | await login("iku", "https://ikuuu.co/auth/login", iku); 62 | } 63 | 64 | if (jj.email == "" && jj.pwd == "") { 65 | console.log("几鸡邮箱密码为空,跳过执行\n\n"); 66 | } else { 67 | await login("几鸡", "https://a.luxury/signin", jj); 68 | } 69 | })() 70 | .catch((e) => { 71 | console.log("", `❌失败! 原因: ${e}!`, ""); 72 | }) 73 | .finally(() => { 74 | $.done(); 75 | }); 76 | 77 | function login(name, url, raw, timeout = 0) { 78 | return new Promise((resolve) => { 79 | var body = JSON.stringify({ 80 | email: `${raw.email}`, 81 | passwd: `${raw.pwd}`, 82 | }); 83 | 84 | let request = { 85 | url, 86 | headers: { 87 | "Content-Type": "application/json", 88 | }, 89 | body, 90 | }; 91 | 92 | $.post( 93 | request, 94 | async (err, resp, data) => { 95 | try { 96 | data = JSON.parse(data); 97 | 98 | if (resp.statusCode == 200) { 99 | console.log(`${name}登录成功`); 100 | let cookie = resp.headers["set-cookie"]; 101 | console.log(`${name}机场获取Cookie成功,正在运行签到...`); 102 | let checkurl; 103 | if (name == "好家伙") { 104 | checkurl = "https://haojiahuo.live/user/checkin"; 105 | } else if (name == "iku") { 106 | checkurl = "https://ikuuu.co/user/checkin"; 107 | } else if (name == "几鸡") { 108 | checkurl = "https://a.luxury/user/checkin"; 109 | } 110 | await check(name, checkurl, cookie); 111 | } else { 112 | let msg = "登录失败" + data.msg; 113 | console.log(`${name}机场 ${msg}\n\n`); 114 | await notify.sendNotify(`${$.name}`, `${name}机场 ${msg}`); 115 | return; 116 | } 117 | } catch (e) { 118 | console.log(e); 119 | console.log("\n\n==============================\n\n"); 120 | } finally { 121 | resolve(); 122 | } 123 | }, 124 | timeout 125 | ); 126 | }); 127 | } 128 | 129 | function check(name, checkurl, cookie) { 130 | return new Promise((resolve) => { 131 | var request = { 132 | url: checkurl, 133 | headers: { 134 | cookies: cookie, 135 | Cookie: cookie, 136 | }, 137 | }; 138 | 139 | $.post(request, async (err, resp, data) => { 140 | try { 141 | data = JSON.parse(data); 142 | var msg; 143 | if (data.ret == 1) { 144 | if (name == "好家伙") { 145 | msg = 146 | `${name}签到成功` + 147 | data.msg + 148 | "您的当前流量为" + 149 | data.trafficInfo["unUsedTraffic"]; 150 | } else if (name == "iku") { 151 | msg = `${name}签到成功` + data.msg; 152 | } else if (name == "几鸡") { 153 | msg = 154 | `${name}签到成功` + data.msg + "您的当前流量为" + data.traffic; 155 | } 156 | console.log(`${name}机场 ${msg}\n\n`); 157 | 158 | await notify.sendNotify(`${$.name}`, `${name}机场 ${msg}`); 159 | } else { 160 | console.log(`${name}机场${data.msg}\n\n`); 161 | await notify.sendNotify(`${$.name}`, `${name}机场 ${data.msg}`); 162 | } 163 | } catch (e) { 164 | console.log(e); 165 | console.log("\n\n==============================\n\n"); 166 | } finally { 167 | resolve(); 168 | } 169 | }); 170 | }); 171 | } 172 | 173 | //module.exports = start(); 174 | 175 | /*********************************** API *************************************/ 176 | function Env(t, e) { 177 | "undefined" != typeof process && 178 | JSON.stringify(process.env).indexOf("GITHUB") > -1 && 179 | process.exit(0); 180 | class s { 181 | constructor(t) { 182 | this.env = t; 183 | } 184 | send(t, e = "GET") { 185 | t = "string" == typeof t ? { url: t } : t; 186 | let s = this.get; 187 | return ( 188 | "POST" === e && (s = this.post), 189 | new Promise((e, i) => { 190 | s.call(this, t, (t, s, r) => { 191 | t ? i(t) : e(s); 192 | }); 193 | }) 194 | ); 195 | } 196 | get(t) { 197 | return this.send.call(this.env, t); 198 | } 199 | post(t) { 200 | return this.send.call(this.env, t, "POST"); 201 | } 202 | } 203 | return new (class { 204 | constructor(t, e) { 205 | (this.name = t), 206 | (this.http = new s(this)), 207 | (this.data = null), 208 | (this.dataFile = "box.dat"), 209 | (this.logs = []), 210 | (this.isMute = !1), 211 | (this.isNeedRewrite = !1), 212 | (this.logSeparator = "\n"), 213 | (this.startTime = new Date().getTime()), 214 | Object.assign(this, e), 215 | this.log("", `\ud83d\udd14${this.name}, \u5f00\u59cb!`); 216 | } 217 | isNode() { 218 | return "undefined" != typeof module && !!module.exports; 219 | } 220 | isQuanX() { 221 | return "undefined" != typeof $task; 222 | } 223 | isSurge() { 224 | return "undefined" != typeof $httpClient && "undefined" == typeof $loon; 225 | } 226 | isLoon() { 227 | return "undefined" != typeof $loon; 228 | } 229 | isShadowrocket() { 230 | return "undefined" != typeof $rocket; 231 | } 232 | toObj(t, e = null) { 233 | try { 234 | return JSON.parse(t); 235 | } catch { 236 | return e; 237 | } 238 | } 239 | toStr(t, e = null) { 240 | try { 241 | return JSON.stringify(t); 242 | } catch { 243 | return e; 244 | } 245 | } 246 | getjson(t, e) { 247 | let s = e; 248 | const i = this.getdata(t); 249 | if (i) 250 | try { 251 | s = JSON.parse(this.getdata(t)); 252 | } catch {} 253 | return s; 254 | } 255 | setjson(t, e) { 256 | try { 257 | return this.setdata(JSON.stringify(t), e); 258 | } catch { 259 | return !1; 260 | } 261 | } 262 | getScript(t) { 263 | return new Promise((e) => { 264 | this.get({ url: t }, (t, s, i) => e(i)); 265 | }); 266 | } 267 | runScript(t, e) { 268 | return new Promise((s) => { 269 | let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); 270 | i = i ? i.replace(/\n/g, "").trim() : i; 271 | let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); 272 | (r = r ? 1 * r : 20), (r = e && e.timeout ? e.timeout : r); 273 | const [o, h] = i.split("@"), 274 | a = { 275 | url: `http://${h}/v1/scripting/evaluate`, 276 | body: { script_text: t, mock_type: "cron", timeout: r }, 277 | headers: { "X-Key": o, Accept: "*/*" }, 278 | }; 279 | this.post(a, (t, e, i) => s(i)); 280 | }).catch((t) => this.logErr(t)); 281 | } 282 | loaddata() { 283 | if (!this.isNode()) return {}; 284 | { 285 | (this.fs = this.fs ? this.fs : require("fs")), 286 | (this.path = this.path ? this.path : require("path")); 287 | const t = this.path.resolve(this.dataFile), 288 | e = this.path.resolve(process.cwd(), this.dataFile), 289 | s = this.fs.existsSync(t), 290 | i = !s && this.fs.existsSync(e); 291 | if (!s && !i) return {}; 292 | { 293 | const i = s ? t : e; 294 | try { 295 | return JSON.parse(this.fs.readFileSync(i)); 296 | } catch (t) { 297 | return {}; 298 | } 299 | } 300 | } 301 | } 302 | writedata() { 303 | if (this.isNode()) { 304 | (this.fs = this.fs ? this.fs : require("fs")), 305 | (this.path = this.path ? this.path : require("path")); 306 | const t = this.path.resolve(this.dataFile), 307 | e = this.path.resolve(process.cwd(), this.dataFile), 308 | s = this.fs.existsSync(t), 309 | i = !s && this.fs.existsSync(e), 310 | r = JSON.stringify(this.data); 311 | s 312 | ? this.fs.writeFileSync(t, r) 313 | : i 314 | ? this.fs.writeFileSync(e, r) 315 | : this.fs.writeFileSync(t, r); 316 | } 317 | } 318 | lodash_get(t, e, s) { 319 | const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); 320 | let r = t; 321 | for (const t of i) if (((r = Object(r)[t]), void 0 === r)) return s; 322 | return r; 323 | } 324 | lodash_set(t, e, s) { 325 | return Object(t) !== t 326 | ? t 327 | : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), 328 | (e 329 | .slice(0, -1) 330 | .reduce( 331 | (t, s, i) => 332 | Object(t[s]) === t[s] 333 | ? t[s] 334 | : (t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}), 335 | t 336 | )[e[e.length - 1]] = s), 337 | t); 338 | } 339 | getdata(t) { 340 | let e = this.getval(t); 341 | if (/^@/.test(t)) { 342 | const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), 343 | r = s ? this.getval(s) : ""; 344 | if (r) 345 | try { 346 | const t = JSON.parse(r); 347 | e = t ? this.lodash_get(t, i, "") : e; 348 | } catch (t) { 349 | e = ""; 350 | } 351 | } 352 | return e; 353 | } 354 | setdata(t, e) { 355 | let s = !1; 356 | if (/^@/.test(e)) { 357 | const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), 358 | o = this.getval(i), 359 | h = i ? ("null" === o ? null : o || "{}") : "{}"; 360 | try { 361 | const e = JSON.parse(h); 362 | this.lodash_set(e, r, t), (s = this.setval(JSON.stringify(e), i)); 363 | } catch (e) { 364 | const o = {}; 365 | this.lodash_set(o, r, t), (s = this.setval(JSON.stringify(o), i)); 366 | } 367 | } else s = this.setval(t, e); 368 | return s; 369 | } 370 | getval(t) { 371 | return this.isSurge() || this.isLoon() 372 | ? $persistentStore.read(t) 373 | : this.isQuanX() 374 | ? $prefs.valueForKey(t) 375 | : this.isNode() 376 | ? ((this.data = this.loaddata()), this.data[t]) 377 | : (this.data && this.data[t]) || null; 378 | } 379 | setval(t, e) { 380 | return this.isSurge() || this.isLoon() 381 | ? $persistentStore.write(t, e) 382 | : this.isQuanX() 383 | ? $prefs.setValueForKey(t, e) 384 | : this.isNode() 385 | ? ((this.data = this.loaddata()), 386 | (this.data[e] = t), 387 | this.writedata(), 388 | !0) 389 | : (this.data && this.data[e]) || null; 390 | } 391 | initGotEnv(t) { 392 | (this.got = this.got ? this.got : require("got")), 393 | (this.cktough = this.cktough ? this.cktough : require("tough-cookie")), 394 | (this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar()), 395 | t && 396 | ((t.headers = t.headers ? t.headers : {}), 397 | void 0 === t.headers.Cookie && 398 | void 0 === t.cookieJar && 399 | (t.cookieJar = this.ckjar)); 400 | } 401 | get(t, e = () => {}) { 402 | t.headers && 403 | (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), 404 | this.isSurge() || this.isLoon() 405 | ? (this.isSurge() && 406 | this.isNeedRewrite && 407 | ((t.headers = t.headers || {}), 408 | Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), 409 | $httpClient.get(t, (t, s, i) => { 410 | !t && s && ((s.body = i), (s.statusCode = s.status)), e(t, s, i); 411 | })) 412 | : this.isQuanX() 413 | ? (this.isNeedRewrite && 414 | ((t.opts = t.opts || {}), Object.assign(t.opts, { hints: !1 })), 415 | $task.fetch(t).then( 416 | (t) => { 417 | const { statusCode: s, statusCode: i, headers: r, body: o } = t; 418 | e(null, { status: s, statusCode: i, headers: r, body: o }, o); 419 | }, 420 | (t) => e(t) 421 | )) 422 | : this.isNode() && 423 | (this.initGotEnv(t), 424 | this.got(t) 425 | .on("redirect", (t, e) => { 426 | try { 427 | if (t.headers["set-cookie"]) { 428 | const s = t.headers["set-cookie"] 429 | .map(this.cktough.Cookie.parse) 430 | .toString(); 431 | s && this.ckjar.setCookieSync(s, null), 432 | (e.cookieJar = this.ckjar); 433 | } 434 | } catch (t) { 435 | this.logErr(t); 436 | } 437 | }) 438 | .then( 439 | (t) => { 440 | const { 441 | statusCode: s, 442 | statusCode: i, 443 | headers: r, 444 | body: o, 445 | } = t; 446 | e(null, { status: s, statusCode: i, headers: r, body: o }, o); 447 | }, 448 | (t) => { 449 | const { message: s, response: i } = t; 450 | e(s, i, i && i.body); 451 | } 452 | )); 453 | } 454 | post(t, e = () => {}) { 455 | const s = t.method ? t.method.toLocaleLowerCase() : "post"; 456 | if ( 457 | (t.body && 458 | t.headers && 459 | !t.headers["Content-Type"] && 460 | (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), 461 | t.headers && delete t.headers["Content-Length"], 462 | this.isSurge() || this.isLoon()) 463 | ) 464 | this.isSurge() && 465 | this.isNeedRewrite && 466 | ((t.headers = t.headers || {}), 467 | Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), 468 | $httpClient[s](t, (t, s, i) => { 469 | !t && s && ((s.body = i), (s.statusCode = s.status)), e(t, s, i); 470 | }); 471 | else if (this.isQuanX()) 472 | (t.method = s), 473 | this.isNeedRewrite && 474 | ((t.opts = t.opts || {}), Object.assign(t.opts, { hints: !1 })), 475 | $task.fetch(t).then( 476 | (t) => { 477 | const { statusCode: s, statusCode: i, headers: r, body: o } = t; 478 | e(null, { status: s, statusCode: i, headers: r, body: o }, o); 479 | }, 480 | (t) => e(t) 481 | ); 482 | else if (this.isNode()) { 483 | this.initGotEnv(t); 484 | const { url: i, ...r } = t; 485 | this.got[s](i, r).then( 486 | (t) => { 487 | const { statusCode: s, statusCode: i, headers: r, body: o } = t; 488 | e(null, { status: s, statusCode: i, headers: r, body: o }, o); 489 | }, 490 | (t) => { 491 | const { message: s, response: i } = t; 492 | e(s, i, i && i.body); 493 | } 494 | ); 495 | } 496 | } 497 | put(t, e = () => {}) { 498 | const s = t.method ? t.method.toLocaleLowerCase() : "put"; 499 | if ( 500 | (t.body && 501 | t.headers && 502 | !t.headers["Content-Type"] && 503 | (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), 504 | t.headers && delete t.headers["Content-Length"], 505 | this.isSurge() || this.isLoon()) 506 | ) 507 | this.isSurge() && 508 | this.isNeedRewrite && 509 | ((t.headers = t.headers || {}), 510 | Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), 511 | $httpClient[s](t, (t, s, i) => { 512 | !t && s && ((s.body = i), (s.statusCode = s.status)), e(t, s, i); 513 | }); 514 | else if (this.isQuanX()) 515 | (t.method = s), 516 | this.isNeedRewrite && 517 | ((t.opts = t.opts || {}), Object.assign(t.opts, { hints: !1 })), 518 | $task.fetch(t).then( 519 | (t) => { 520 | const { statusCode: s, statusCode: i, headers: r, body: o } = t; 521 | e(null, { status: s, statusCode: i, headers: r, body: o }, o); 522 | }, 523 | (t) => e(t) 524 | ); 525 | else if (this.isNode()) { 526 | this.initGotEnv(t); 527 | const { url: i, ...r } = t; 528 | this.got[s](i, r).then( 529 | (t) => { 530 | const { statusCode: s, statusCode: i, headers: r, body: o } = t; 531 | e(null, { status: s, statusCode: i, headers: r, body: o }, o); 532 | }, 533 | (t) => { 534 | const { message: s, response: i } = t; 535 | e(s, i, i && i.body); 536 | } 537 | ); 538 | } 539 | } 540 | time(t, e = null) { 541 | const s = e ? new Date(e) : new Date(); 542 | let i = { 543 | "M+": s.getMonth() + 1, 544 | "d+": s.getDate(), 545 | "H+": s.getHours(), 546 | "m+": s.getMinutes(), 547 | "s+": s.getSeconds(), 548 | "q+": Math.floor((s.getMonth() + 3) / 3), 549 | S: s.getMilliseconds(), 550 | }; 551 | /(y+)/.test(t) && 552 | (t = t.replace( 553 | RegExp.$1, 554 | (s.getFullYear() + "").substr(4 - RegExp.$1.length) 555 | )); 556 | for (let e in i) 557 | new RegExp("(" + e + ")").test(t) && 558 | (t = t.replace( 559 | RegExp.$1, 560 | 1 == RegExp.$1.length 561 | ? i[e] 562 | : ("00" + i[e]).substr(("" + i[e]).length) 563 | )); 564 | return t; 565 | } 566 | msg(e = t, s = "", i = "", r) { 567 | const o = (t) => { 568 | if (!t) return t; 569 | if ("string" == typeof t) 570 | return this.isLoon() 571 | ? t 572 | : this.isQuanX() 573 | ? { "open-url": t } 574 | : this.isSurge() 575 | ? { url: t } 576 | : void 0; 577 | if ("object" == typeof t) { 578 | if (this.isLoon()) { 579 | let e = t.openUrl || t.url || t["open-url"], 580 | s = t.mediaUrl || t["media-url"]; 581 | return { openUrl: e, mediaUrl: s }; 582 | } 583 | if (this.isQuanX()) { 584 | let e = t["open-url"] || t.url || t.openUrl, 585 | s = t["media-url"] || t.mediaUrl; 586 | return { "open-url": e, "media-url": s }; 587 | } 588 | if (this.isSurge()) { 589 | let e = t.url || t.openUrl || t["open-url"]; 590 | return { url: e }; 591 | } 592 | } 593 | }; 594 | if ( 595 | (this.isMute || 596 | (this.isSurge() || this.isLoon() 597 | ? $notification.post(e, s, i, o(r)) 598 | : this.isQuanX() && $notify(e, s, i, o(r))), 599 | !this.isMuteLog) 600 | ) { 601 | let t = [ 602 | "", 603 | "==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3==============", 604 | ]; 605 | t.push(e), 606 | s && t.push(s), 607 | i && t.push(i), 608 | console.log(t.join("\n")), 609 | (this.logs = this.logs.concat(t)); 610 | } 611 | } 612 | log(...t) { 613 | t.length > 0 && (this.logs = [...this.logs, ...t]), 614 | console.log(t.join(this.logSeparator)); 615 | } 616 | logErr(t, e) { 617 | const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); 618 | s 619 | ? this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t.stack) 620 | : this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t); 621 | } 622 | wait(t) { 623 | return new Promise((e) => setTimeout(e, t)); 624 | } 625 | done(t = {}) { 626 | const e = new Date().getTime(), 627 | s = (e - this.startTime) / 1e3; 628 | this.log( 629 | "", 630 | `\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2` 631 | ), 632 | this.log(), 633 | (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t); 634 | } 635 | })(t, e); 636 | } 637 | /*****************************************************************************/ 638 | -------------------------------------------------------------------------------- /jzyl.js: -------------------------------------------------------------------------------- 1 | /*健走有礼 @leaf 2 | 3 | cron 59 10,20 * * * https://raw.githubusercontent.com/leafTheFish/DeathNote/main/jzyl.js 4 | 5 | 脚本库:https://github.com/leafTheFish/DeathNote/ 6 | 7 | 8 | 9 | [脚本说明] 10 | 微信小程序:健走有礼,存步数换现金提现,10W金币=1元 11 | 12 | 一天一两次即可,理论上跑一次就能完成任务 13 | 14 | 作者原本定时是 47 8,20 ;兑换的时候我发现是11点补货,那我们就10点59运行,正好可以卡11点 15 | 16 | 17 | [青龙变量] 18 | 19 | 先注册,再打开重写重新进入小程序抓包 20 | 21 | bwa.feierlaiedu.com的任意包,把header里的token值填到jzylCookie里,多账号换行或者@隔开 22 | 23 | #健走有礼 24 | export jzylCookie="token值" 25 | 26 | 27 | 28 | [圈X重写] 29 | 30 | [task_local] 31 | #健走有礼 32 | 59 10,20 * * * https://raw.githubusercontent.com/leafTheFish/DeathNote/main/jzyl.js, tag=健走有礼, enabled=true 33 | 34 | [MITM] 35 | hostname = bwa.feierlaiedu.com 36 | [rewrite_local] 37 | https://bwa.feierlaiedu.com/api/v1/bbg/taskRecord/queryUserInfo url script-request-header https://raw.githubusercontent.com/leafTheFish/DeathNote/main/jzyl.js 38 | 39 | 40 | */ 41 | const $ = new Env("健走有礼"); 42 | 43 | //var CryptoJS = require("crypto-js"); 44 | //var fs = require("fs"); 45 | //fs.unlinkSync(__filename); 46 | 47 | let envSplitor = ['\n','@'] 48 | let httpResult, httpReq, httpResp 49 | 50 | let userCookie = ($.isNode() ? process.env.jzylCookie : $.getdata('jzylCookie')) || ''; 51 | let userList = [] 52 | 53 | let userIdx = 0 54 | let userCount = 0 55 | 56 | let extraTask = [ 57 | //{taskType:0,name:"领取昨日步数"}, 58 | {taskType:1,name:"添加小程序"}, 59 | //{taskType:2,name:"完成微信授权"}, 60 | //{taskType:3,name:"完成登录(绑定手机)"}, 61 | 62 | //今天奖励:3次 63 | {taskType:10,name:"领取今日奖励"}, 64 | {taskType:10,name:"领取今日奖励"}, 65 | {taskType:10,name:"领取今日奖励"}, 66 | 67 | //分享:3次 68 | {taskType:14,name:"分享视频"}, 69 | {taskType:14,name:"分享视频"}, 70 | {taskType:14,name:"分享视频"}, 71 | ] 72 | let extraStepTask = [ 73 | //{taskType:4,name:"步数任务4"}, 74 | //{taskType:5,name:"步数任务5"}, 75 | {taskType:6,name:"邀请好友"}, 76 | //{taskType:13,name:"步数任务13"}, 77 | ] 78 | 79 | let salt = 'nx351xq5cmy6lclm3gg0zoowhfd9uf5eo6is' 80 | let UA = '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.20(0x18001435) NetType/WIFI Language/zh_CN' 81 | let miniAppVer = 'v2.4.5' 82 | let fromType = '402' 83 | /////////////////////////////////////////////////////////////////// 84 | class UserInfo { 85 | constructor(str) { 86 | this.index = ++userIdx 87 | this.name = this.index 88 | this.valid = false 89 | 90 | this.token = str 91 | this.hasFinishVideo = false 92 | } 93 | 94 | async getUserName() { 95 | try { 96 | let url = `https://bwa.feierlaiedu.com/api/v1/bbg/customer/get` 97 | let body = `` 98 | let urlObject = populateUrlObject(url,this.token,body) 99 | urlObject = genSign(urlObject) 100 | await httpRequest('post',urlObject) 101 | let result = httpResult; 102 | if(!result) return 103 | //console.log(result) 104 | if(result.code==0) { 105 | this.name = result.data.wechatName 106 | this.phone = result.data.phone 107 | this.valid = true 108 | console.log(`登录成功`) 109 | console.log(`昵称:${this.name}`) 110 | } else { 111 | console.log(`登录失败: ${result.message}`) 112 | } 113 | } catch(e) { 114 | console.log(e) 115 | } finally {} 116 | } 117 | 118 | async queryUserInfo(isNotify=false) { 119 | try { 120 | let url = `https://bwa.feierlaiedu.com/api/v1/bbg/taskRecord/queryUserInfo` 121 | let body = `` 122 | let urlObject = populateUrlObject(url,this.token,body) 123 | urlObject = genSign(urlObject) 124 | await httpRequest('get',urlObject) 125 | let result = httpResult; 126 | if(!result) return 127 | //console.log(result) 128 | if(result.code==0) { 129 | this.step = result.data.myStep 130 | if(isNotify) { 131 | $.logAndNotify(`--------------- 账号[${this.index}] ---------------`) 132 | $.logAndNotify(`昵称:${this.name}`) 133 | $.logAndNotify(`步数:${this.step}`) 134 | } else { 135 | console.log(`步数:${this.step}`) 136 | if(!result.data.hasPhoneAuth) { 137 | let task = {taskType:3,name:"完成登录(绑定手机)"} 138 | await this.triggerTask(task) 139 | } 140 | if(result.data.yesterdayStatus==1) { 141 | await this.getRewardKey() 142 | } 143 | /* 144 | for(let item of result.data.unTriggerTaskList) { 145 | if(item.status==0 || item.status) { 146 | let task = {taskType:item.taskType, name:item.taskTypeName} 147 | await this.triggerTask(task) 148 | } 149 | } 150 | */ 151 | } 152 | } else { 153 | console.log(`查询步数失败: ${result.message}`) 154 | } 155 | } catch(e) { 156 | console.log(e) 157 | } finally {} 158 | } 159 | 160 | async queryNowVideoInfo() { 161 | try { 162 | let url = `https://bwa.feierlaiedu.com/api/v1/bbg/videoInfo/queryNowVideoInfo` 163 | let body = `` 164 | let urlObject = populateUrlObject(url,this.token,body) 165 | urlObject = genSign(urlObject) 166 | await httpRequest('get',urlObject) 167 | let result = httpResult; 168 | if(!result) return 169 | //console.log(result) 170 | if(result.code==0) { 171 | for(let video of result.data) { 172 | if(video.isWatch == false) { 173 | await this.startWatchVideo2(video) 174 | } 175 | if(this.hasFinishVideo) break; 176 | } 177 | } else { 178 | console.log(`账号[${this.name}]获取视频失败: ${result.message}`) 179 | } 180 | } catch(e) { 181 | console.log(e) 182 | } finally { 183 | return new Promise((resolve) => {resolve(1)}); 184 | } 185 | } 186 | 187 | async startWatchVideo2(video) { 188 | try { 189 | let url = `https://bwa.feierlaiedu.com/api/v1/bbg/videoWatchRecord/startWatchVideo2` 190 | let body = `{"videoId":"${video.id}"}` 191 | let urlObject = populateUrlObject(url,this.token,body) 192 | urlObject = genSign(urlObject) 193 | await httpRequest('post',urlObject) 194 | let result = httpResult; 195 | if(!result) return 196 | //console.log(result) 197 | if(result.code==0) { 198 | console.log(`账号[${this.name}]开始看视频,需观看${video.watchDuration}秒: ${video.desc}`) 199 | await $.wait(video.watchDuration*1000+500) 200 | await this.rewardWatchVideo(video,result.data) 201 | } else { 202 | console.log(`账号[${this.name}]看视频失败: ${result.message}`) 203 | } 204 | } catch(e) { 205 | console.log(e) 206 | } finally {} 207 | } 208 | 209 | async rewardWatchVideo(video,watchId) { 210 | try { 211 | let url = `https://bwa.feierlaiedu.com/api/v1/bbg/videoRecord/trigger` 212 | let body = `{"taskType":12,"videoId":"${video.id}","watchId":"${watchId}"}` 213 | let urlObject = populateUrlObject(url,this.token,body) 214 | urlObject = genSign(urlObject) 215 | await httpRequest('post',urlObject) 216 | let result = httpResult; 217 | if(!result) return 218 | //console.log(result) 219 | if(result.code==0) { 220 | console.log(`账号[${this.name}]看视频获得${result.data}步`) 221 | if(result.data == 0) this.hasFinishVideo = true 222 | } else { 223 | console.log(`账号[${this.name}]领取看视频奖励失败: ${result.message}`) 224 | } 225 | } catch(e) { 226 | console.log(e) 227 | } finally {} 228 | } 229 | 230 | async getRewardKey() { 231 | try { 232 | let url = `https://bwa.feierlaiedu.com/api/v1/bbg/videoInfo/getRewardKey` 233 | let body = `{"adUnitId":"adunit-1fec859de2a1ce12"}` 234 | let urlObject = populateUrlObject(url,this.token,body) 235 | urlObject = genSign(urlObject) 236 | await httpRequest('post',urlObject) 237 | let result = httpResult; 238 | if(!result) return 239 | //console.log(result) 240 | if(result.code==0) { 241 | await this.triggerTask({taskType:0,name:"领取昨日步数"},result.data) 242 | } else { 243 | console.log(`获取视频rewardKey失败: ${result.message}`) 244 | } 245 | } catch(e) { 246 | console.log(e) 247 | } finally {} 248 | } 249 | 250 | async triggerTask(task,randomId='') { 251 | try { 252 | let url = `https://bwa.feierlaiedu.com/api/v1/bbg/taskRecord/triggerTask` 253 | let param = {"taskType":parseInt(task.taskType)} 254 | if(randomId) param.randomId = randomId 255 | let body = JSON.stringify(param) 256 | let urlObject = populateUrlObject(url,this.token,body) 257 | urlObject = genSign(urlObject) 258 | await httpRequest('post',urlObject) 259 | let result = httpResult; 260 | if(!result) return 261 | //console.log(result) 262 | if(result.code==0) { 263 | if(result.data>0) console.log(`领取任务[${task.name}]奖励获得${result.data}步`) 264 | } else { 265 | console.log(`领取任务[${task.name}]奖励失败: ${result.message}`) 266 | } 267 | } catch(e) { 268 | console.log(e) 269 | } finally {} 270 | } 271 | 272 | async receiveStepReward(task) { 273 | try { 274 | let url = `https://bwa.feierlaiedu.com/api/v1/bbg/taskRecord/receiveStepReward` 275 | let param = {"taskType":parseInt(task.taskType)} 276 | let body = JSON.stringify(param) 277 | let urlObject = populateUrlObject(url,this.token,body) 278 | urlObject = genSign(urlObject) 279 | await httpRequest('post',urlObject) 280 | let result = httpResult; 281 | if(!result) return 282 | //console.log(result) 283 | if(result.code==0) { 284 | if(result.data>0) console.log(`领取步数任务[${task.name}]奖励获得${result.data}步`) 285 | } else { 286 | console.log(`领取步数任务[${task.name}]奖励失败: ${result.message}`) 287 | } 288 | } catch(e) { 289 | console.log(e) 290 | } finally {} 291 | } 292 | 293 | async getInviteRecord(pageNo=1) { 294 | try { 295 | let url = `https://bwa.feierlaiedu.com/api/v1/bbg/redPacketRecord/record` 296 | let body = `{"pageNo":${pageNo},"pageSize":100}` 297 | let urlObject = populateUrlObject(url,this.token,body) 298 | urlObject = genSign(urlObject) 299 | await httpRequest('post',urlObject) 300 | let result = httpResult; 301 | if(!result) return 302 | //console.log(result) 303 | if(result.code==0) { 304 | for(let item of result.data.dataList.sort(function(a,b) {return b.amount-a.amount})) { 305 | if(item.status == 0) { 306 | item.amount = item.amount/100 307 | await this.withdraw(item) 308 | } 309 | } 310 | if(result.data.length >= 100) { 311 | await this.getInviteRecord(pageNo+1) 312 | } 313 | } else { 314 | console.log(`获取邀请提现列表失败: ${result.message}`) 315 | } 316 | } catch(e) { 317 | console.log(e) 318 | } finally {} 319 | } 320 | 321 | async getExchangeList() { 322 | try { 323 | let url = `https://bwa.feierlaiedu.com/api/v1/bbg/index/exchangeList` 324 | let body = `` 325 | let urlObject = populateUrlObject(url,this.token,body) 326 | urlObject = genSign(urlObject) 327 | await httpRequest('post',urlObject) 328 | let result = httpResult; 329 | if(!result) return 330 | //console.log(result) 331 | if(result.code==0) { 332 | for(let item of result.data) { 333 | if(item.status == false && this.step >= item.step) { 334 | await this.withdraw(item) 335 | } 336 | } 337 | } else { 338 | console.log(`获取提现列表失败: ${result.message}`) 339 | } 340 | } catch(e) { 341 | console.log(e) 342 | } finally {} 343 | } 344 | 345 | async withdraw(item) { 346 | try { 347 | let url = `https://bwa.feierlaiedu.com/api/v1/bbg/common/withdraw` 348 | let param = { 349 | "type": item.type, 350 | "amount": item.amount, 351 | "amountId": item.amountId, 352 | "watchVideoToken": "", 353 | "randomId": "", 354 | } 355 | if(item.type == 3) { 356 | param = { 357 | "type": item.type, 358 | "recordId": item.id, 359 | } 360 | } 361 | let body = JSON.stringify(param) 362 | let urlObject = populateUrlObject(url,this.token,body) 363 | urlObject = genSign(urlObject) 364 | await httpRequest('post',urlObject) 365 | let result = httpResult; 366 | if(!result) return 367 | //console.log(result) 368 | if(result.code==0) { 369 | $.logAndNotify(`账号[${this.name}]提现[${item.amount}元]成功`) 370 | } else { 371 | console.log(`提现[${item.amount}元]失败: ${result.message}`) 372 | } 373 | } catch(e) { 374 | console.log(e) 375 | } finally {} 376 | } 377 | 378 | async userTask() { 379 | console.log(`\n--------------- 账号[${this.index}] ---------------`) 380 | await this.getUserName(); 381 | if(!this.valid) return; 382 | await this.queryUserInfo(); 383 | for(let task of extraTask) { 384 | await this.triggerTask(task) 385 | } 386 | for(let task of extraStepTask) { 387 | await this.receiveStepReward(task) 388 | } 389 | } 390 | 391 | async userWithdrawTask() { 392 | await this.queryUserInfo(true); 393 | await this.getInviteRecord(); 394 | await this.getExchangeList(); 395 | } 396 | } 397 | 398 | !(async () => { 399 | if (typeof $request !== "undefined") { 400 | await GetRewrite() 401 | }else { 402 | //let nowtime = $.time('yyyy-MM-dd hh:mm:ss'); 403 | //console.log(nowtime); 404 | 405 | if(!(await checkEnv())) return; 406 | 407 | for(let user of userList) { 408 | await user.userTask(); 409 | } 410 | 411 | let validUserList = userList.filter(x => x.valid) 412 | if(validUserList.length == 0) return; 413 | 414 | console.log(`\n=============== 开始看视频 ===============`) 415 | let taskall = [] 416 | for(let user of validUserList) { 417 | taskall.push(user.queryNowVideoInfo()) 418 | } 419 | await Promise.all(taskall) 420 | console.log(`=============== 结束看视频 ===============`) 421 | 422 | console.log(`\n=============== 账户步数 ===============`) 423 | for(let user of validUserList) { 424 | await user.userWithdrawTask(); 425 | } 426 | 427 | await $.showmsg(); 428 | } 429 | })() 430 | .catch((e) => console.log(e)) 431 | .finally(() => $.done()) 432 | 433 | /////////////////////////////////////////////////////////////////// 434 | async function GetRewrite() { 435 | if($request.url.indexOf(`api/v1/bbg/taskRecord/queryUserInfo`) > -1) { 436 | let ck = $request.headers.token 437 | 438 | if(userCookie) { 439 | if(userCookie.indexOf(ck) == -1) { 440 | userCookie = userCookie + '\n' + ck 441 | $.setdata(userCookie, 'jzylCookie'); 442 | ckList = userCookie.split('\n') 443 | $.msg(`获取第${ckList.length}个ck成功: ${ck}`) 444 | } 445 | } else { 446 | $.setdata(ck, 'jzylCookie'); 447 | $.msg(`获取第1个ck成功: ${ck}`) 448 | } 449 | } 450 | } 451 | 452 | async function checkEnv() { 453 | if(userCookie) { 454 | let splitor = envSplitor[0]; 455 | for(let sp of envSplitor) { 456 | if(userCookie.indexOf(sp) > -1) { 457 | splitor = sp; 458 | break; 459 | } 460 | } 461 | for(let userCookies of userCookie.split(splitor)) { 462 | if(userCookies) userList.push(new UserInfo(userCookies)) 463 | } 464 | userCount = userList.length 465 | } else { 466 | console.log('未找到CK') 467 | return; 468 | } 469 | 470 | console.log(`共找到${userCount}个账号`) 471 | return true 472 | } 473 | 474 | //////////////////////////////////////////////////////////////////// 475 | function genSign(urlObject) { 476 | try { 477 | let timestamp = Math.floor(Date.now()/1000) 478 | let base64time = Base64.encode(timestamp.toString()) 479 | let token = urlObject.headers.token 480 | let dataStr = "" 481 | if(urlObject.body) { 482 | let param = JSON.parse(urlObject.body) 483 | for(let keys of Object.keys(param).sort()) { 484 | dataStr += (keys+param[keys]) 485 | } 486 | } 487 | let sign = MD5Encrypt(base64time+token+salt+dataStr) 488 | urlObject.headers.signature = sign 489 | urlObject.headers.timestamp = timestamp 490 | } catch(e) { 491 | console.log(e) 492 | } finally { 493 | return urlObject 494 | } 495 | } 496 | 497 | function populateUrlObject(url,token,body=''){ 498 | let host = url.replace('//','/').split('/')[1] 499 | let urlObject = { 500 | url: url, 501 | headers: { 502 | 'Host': host, 503 | 'Connection': 'keep-alive', 504 | 'token': token, 505 | 'miniAppVer': miniAppVer, 506 | 'fromType': fromType, 507 | 'User-Agent': UA, 508 | 'Referer': 'https://servicewechat.com/wx1d6a6ba2539f97cc/6/page-frame.html' 509 | }, 510 | timeout: 5000, 511 | } 512 | if(body) { 513 | urlObject.body = body 514 | urlObject.headers['Content-Type'] = 'application/json; charset=UTF-8' 515 | urlObject.headers['Content-Length'] = urlObject.body ? urlObject.body.length : 0 516 | } 517 | return urlObject; 518 | } 519 | 520 | async function httpRequest(method,url) { 521 | httpResult = null, httpReq = null, httpResp = null; 522 | return new Promise((resolve) => { 523 | $.send(method, url, async (err, req, resp) => { 524 | try { 525 | httpReq = req; 526 | httpResp = resp; 527 | if (err) { 528 | console.log(`${method}请求失败`); 529 | console.log(JSON.stringify(err)); 530 | } else { 531 | if(resp.body) { 532 | if(typeof resp.body == "object") { 533 | httpResult = resp.body; 534 | } else { 535 | try { 536 | httpResult = JSON.parse(resp.body); 537 | } catch (e) { 538 | httpResult = resp.body; 539 | } 540 | } 541 | } 542 | } 543 | } catch (e) { 544 | console.log(e); 545 | } finally { 546 | resolve(); 547 | } 548 | }); 549 | }); 550 | } 551 | 552 | //////////////////////////////////////////////////////////////////// 553 | //AES/DES加解密,CryptoJS 554 | function EncryptCrypto(method,mode,padding,message,key,iv) { 555 | return CryptoJS[method].encrypt( 556 | CryptoJS.enc.Utf8.parse(message), 557 | CryptoJS.enc.Utf8.parse(key), 558 | {mode:CryptoJS.mode[mode], padding:CryptoJS.pad[padding], iv:CryptoJS.enc.Utf8.parse(iv)} 559 | ).ciphertext.toString(CryptoJS.enc.Base64); 560 | } 561 | function DecryptCrypto(method,mode,padding,message,key,iv) { 562 | return CryptoJS[method].decrypt( 563 | {ciphertext: CryptoJS.enc.Base64.parse(message)}, 564 | CryptoJS.enc.Utf8.parse(key), 565 | {mode:CryptoJS.mode[mode], padding:CryptoJS.pad[padding], iv:CryptoJS.enc.Utf8.parse(iv)} 566 | ).toString(CryptoJS.enc.Utf8); 567 | } 568 | //Base64加解密 569 | var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){var t="";var n,r,i,s,o,u,a;var f=0;e=Base64._utf8_encode(e);while(f>2;o=(n&3)<<4|r>>4;u=(r&15)<<2|i>>6;a=i&63;if(isNaN(r)){u=a=64}else if(isNaN(i)){a=64}t=t+this._keyStr.charAt(s)+this._keyStr.charAt(o)+this._keyStr.charAt(u)+this._keyStr.charAt(a)}return t},decode:function(e){var t="";var n,r,i;var s,o,u,a;var f=0;e=e.replace(/[^A-Za-z0-9+/=]/g,"");while(f>4;r=(o&15)<<4|u>>2;i=(u&3)<<6|a;t=t+String.fromCharCode(n);if(u!=64){t=t+String.fromCharCode(r)}if(a!=64){t=t+String.fromCharCode(i)}}t=Base64._utf8_decode(t);return t},_utf8_encode:function(e){e=e.replace(/rn/g,"n");var t="";for(var n=0;n127&&r<2048){t+=String.fromCharCode(r>>6|192);t+=String.fromCharCode(r&63|128)}else{t+=String.fromCharCode(r>>12|224);t+=String.fromCharCode(r>>6&63|128);t+=String.fromCharCode(r&63|128)}}return t},_utf8_decode:function(e){var t="";var n=0;var r=c1=c2=0;while(n191&&r<224){c2=e.charCodeAt(n+1);t+=String.fromCharCode((r&31)<<6|c2&63);n+=2}else{c2=e.charCodeAt(n+1);c3=e.charCodeAt(n+2);t+=String.fromCharCode((r&15)<<12|(c2&63)<<6|c3&63);n+=3}}return t}} 570 | //MD5 571 | 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=0;j--)str+=sHEXChars.charAt((num>>(j*4))&0x0F);return str;}function AlignSHA1(sIn){var nblk=((sIn.length+8)>>6)+1,blks=new Array(nblk*16);for(var i=0;i>2]|=sIn.charCodeAt(i)<<(24-(i&3)*8);blks[i>>2]|=0x80<<(24-(i&3)*8);blks[nblk*16-1]=sIn.length*8;return blks;}function rol(num,cnt){return(num<>>(32-cnt));}function ft(t,b,c,d){if(t<20)return(b&c)|((~b)&d);if(t<40)return b^c^d;if(t<60)return(b&c)|(b&d)|(c&d);return b^c^d;}function kt(t){return(t<20)?1518500249:(t<40)?1859775393:(t<60)?-1894007588:-899497514;}var x=AlignSHA1(msg);var w=new Array(80);var a=1732584193;var b=-271733879;var c=-1732584194;var d=271733878;var e=-1009589776;for(var i=0;i -1 && process.exit(0); 577 | return new class { 578 | constructor(name,env) { 579 | this.name = name 580 | this.notifyStr = '' 581 | this.startTime = (new Date).getTime() 582 | Object.assign(this,env) 583 | console.log(`${this.name} 开始运行:\n`) 584 | } 585 | isNode() { 586 | return "undefined" != typeof module && !!module.exports 587 | } 588 | isQuanX() { 589 | return "undefined" != typeof $task 590 | } 591 | isSurge() { 592 | return "undefined" != typeof $httpClient && "undefined" == typeof $loon 593 | } 594 | isLoon() { 595 | return "undefined" != typeof $loon 596 | } 597 | getdata(t) { 598 | let e = this.getval(t); 599 | if (/^@/.test(t)) { 600 | const[, s, i] = /^@(.*?)\.(.*?)$/.exec(t), 601 | r = s ? this.getval(s) : ""; 602 | if (r) 603 | try { 604 | const t = JSON.parse(r); 605 | e = t ? this.lodash_get(t, i, "") : e 606 | } catch (t) { 607 | e = "" 608 | } 609 | } 610 | return e 611 | } 612 | setdata(t, e) { 613 | let s = !1; 614 | if (/^@/.test(e)) { 615 | const[, i, r] = /^@(.*?)\.(.*?)$/.exec(e), 616 | o = this.getval(i), 617 | h = i ? "null" === o ? null : o || "{}" : "{}"; 618 | try { 619 | const e = JSON.parse(h); 620 | this.lodash_set(e, r, t), 621 | s = this.setval(JSON.stringify(e), i) 622 | } catch (e) { 623 | const o = {}; 624 | this.lodash_set(o, r, t), 625 | s = this.setval(JSON.stringify(o), i) 626 | } 627 | } 628 | else 629 | s = this.setval(t, e); 630 | return s 631 | } 632 | getval(t) { 633 | 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 634 | } 635 | setval(t, e) { 636 | 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 637 | } 638 | send(m, t, e = (() => {})) { 639 | if(m != 'get' && m != 'post' && m != 'put' && m != 'delete') { 640 | console.log(`无效的http方法:${m}`); 641 | return; 642 | } 643 | if(m == 'get' && t.headers) { 644 | delete t.headers["Content-Type"]; 645 | delete t.headers["Content-Length"]; 646 | } else if(t.body && t.headers) { 647 | if(!t.headers["Content-Type"]) t.headers["Content-Type"] = "application/x-www-form-urlencoded"; 648 | } 649 | if(this.isSurge() || this.isLoon()) { 650 | if(this.isSurge() && this.isNeedRewrite) { 651 | t.headers = t.headers || {}; 652 | Object.assign(t.headers, {"X-Surge-Skip-Scripting": !1}); 653 | } 654 | let conf = { 655 | method: m, 656 | url: t.url, 657 | headers: t.headers, 658 | timeout: t.timeout, 659 | data: t.body 660 | }; 661 | if(m == 'get') delete conf.data 662 | $axios(conf).then(t => { 663 | const { 664 | status: i, 665 | request: q, 666 | headers: r, 667 | data: o 668 | } = t; 669 | e(null, q, { 670 | statusCode: i, 671 | headers: r, 672 | body: o 673 | }); 674 | }).catch(err => console.log(err)) 675 | } else if (this.isQuanX()) { 676 | t.method = m.toUpperCase(), this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { 677 | hints: !1 678 | })), 679 | $task.fetch(t).then(t => { 680 | const { 681 | statusCode: i, 682 | request: q, 683 | headers: r, 684 | body: o 685 | } = t; 686 | e(null, q, { 687 | statusCode: i, 688 | headers: r, 689 | body: o 690 | }) 691 | }, t => e(t)) 692 | } else if (this.isNode()) { 693 | this.got = this.got ? this.got : require("got"); 694 | const { 695 | url: s, 696 | ...i 697 | } = t; 698 | this.instance = this.got.extend({ 699 | followRedirect: false 700 | }); 701 | this.instance[m](s, i).then(t => { 702 | const { 703 | statusCode: i, 704 | request: q, 705 | headers: r, 706 | body: o 707 | } = t; 708 | e(null, q, { 709 | statusCode: i, 710 | headers: r, 711 | body: o 712 | }) 713 | }, t => { 714 | const { 715 | message: s, 716 | response: i 717 | } = t; 718 | e(s, i, i && i.body) 719 | }) 720 | } 721 | } 722 | time(t) { 723 | let e = { 724 | "M+": (new Date).getMonth() + 1, 725 | "d+": (new Date).getDate(), 726 | "h+": (new Date).getHours(), 727 | "m+": (new Date).getMinutes(), 728 | "s+": (new Date).getSeconds(), 729 | "q+": Math.floor(((new Date).getMonth() + 3) / 3), 730 | S: (new Date).getMilliseconds() 731 | }; 732 | /(y+)/.test(t) && (t = t.replace(RegExp.$1, ((new Date).getFullYear() + "").substr(4 - RegExp.$1.length))); 733 | for (let s in e) 734 | new RegExp("(" + s + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? e[s] : ("00" + e[s]).substr(("" + e[s]).length))); 735 | return t 736 | } 737 | async showmsg() { 738 | if(!this.notifyStr) return; 739 | let notifyBody = this.name + " 运行通知\n\n" + this.notifyStr 740 | if($.isNode()){ 741 | var notify = require('./sendNotify'); 742 | console.log('\n============== 推送 ==============') 743 | await notify.sendNotify(this.name, notifyBody); 744 | } else { 745 | this.msg(notifyBody); 746 | } 747 | } 748 | logAndNotify(str) { 749 | console.log(str) 750 | this.notifyStr += str 751 | this.notifyStr += '\n' 752 | } 753 | msg(e = t, s = "", i = "", r) { 754 | const o = t => { 755 | if (!t) 756 | return t; 757 | if ("string" == typeof t) 758 | return this.isLoon() ? t : this.isQuanX() ? { 759 | "open-url": t 760 | } 761 | : this.isSurge() ? { 762 | url: t 763 | } 764 | : void 0; 765 | if ("object" == typeof t) { 766 | if (this.isLoon()) { 767 | let e = t.openUrl || t.url || t["open-url"], 768 | s = t.mediaUrl || t["media-url"]; 769 | return { 770 | openUrl: e, 771 | mediaUrl: s 772 | } 773 | } 774 | if (this.isQuanX()) { 775 | let e = t["open-url"] || t.url || t.openUrl, 776 | s = t["media-url"] || t.mediaUrl; 777 | return { 778 | "open-url": e, 779 | "media-url": s 780 | } 781 | } 782 | if (this.isSurge()) { 783 | let e = t.url || t.openUrl || t["open-url"]; 784 | return { 785 | url: e 786 | } 787 | } 788 | } 789 | }; 790 | this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))); 791 | let h = ["", "============== 系统通知 =============="]; 792 | h.push(e), 793 | s && h.push(s), 794 | i && h.push(i), 795 | console.log(h.join("\n")) 796 | } 797 | getMin(a,b){ 798 | return ((anumStr.length) ? (length-numStr.length) : 0 806 | let retStr = '' 807 | for(let i=0; i setTimeout(e, t)) 844 | } 845 | done(t = {}) { 846 | const e = (new Date).getTime(), 847 | s = (e - this.startTime) / 1e3; 848 | console.log(`\n${this.name} 运行结束,共运行了 ${s} 秒!`) 849 | if(this.isSurge() || this.isQuanX() || this.isLoon()) $done(t) 850 | } 851 | }(name,env) 852 | } 853 | -------------------------------------------------------------------------------- /xmsb.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf8 -*- 2 | import requests 3 | import time 4 | import re 5 | import json 6 | import random 7 | 8 | now = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) 9 | headers = { 10 | 'User-Agent': 'Dalvik/2.1.0 (Linux; U; Android 9; MI 6 MIUI/20.6.18)' 11 | } 12 | 13 | # 获取登录code 14 | def get_code(location): 15 | code_pattern = re.compile("(?<=access=).*?(?=&)") 16 | code = code_pattern.findall(location)[0] 17 | return code 18 | 19 | 20 | # 登录 21 | def login(user, password): 22 | url1 = "https://api-user.huami.com/registrations/+86" + user + "/tokens" 23 | headers = { 24 | "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", 25 | "User-Agent": "MiFit/4.6.0 (iPhone; iOS 14.0.1; Scale/2.00)" 26 | } 27 | data1 = { 28 | "client_id": "HuaMi", 29 | "password": password, 30 | "redirect_uri": "https://s3-us-west-2.amazonaws.com/hm-registration/successsignin.html", 31 | "token": "access" 32 | } 33 | r1 = requests.post(url1, data=data1, headers=headers, allow_redirects=False) 34 | location = r1.headers["Location"] 35 | try: 36 | code = get_code(location) 37 | except: 38 | return 0, 0 39 | # print("access_code获取成功!") 40 | # print(code) 41 | 42 | url2 = "https://account.huami.com/v2/client/login" 43 | data2 = { 44 | "app_name": "com.xiaomi.hm.health", 45 | "app_version": "4.6.0", 46 | "code": code, 47 | "country_code": "CN", 48 | "device_id": "2C8B4939-0CCD-4E94-8CBA-CB8EA6E613A1", 49 | "device_model": "phone", 50 | "grant_type": "access_token", 51 | "third_name": "huami_phone", 52 | } 53 | r2 = requests.post(url2, data=data2, headers=headers).json() 54 | login_token = r2["token_info"]["login_token"] 55 | # print("login_token获取成功!") 56 | # print(login_token) 57 | userid = r2["token_info"]["user_id"] 58 | # print("us erid获取成功!") 59 | # print(userid) 60 | return login_token, userid 61 | 62 | # 主函数 63 | def main(user, passwd, step): 64 | user = str(user) 65 | password = str(passwd) 66 | step = str(step) 67 | if user == '' or password == '': 68 | print("用户名或密码填写有误!") 69 | return "用户名或密码填写有误!" 70 | 71 | if step == '': 72 | print("已设置为随机步数(20000-21000)") 73 | step = str(random.randint(20000, 21000)) 74 | login_token = 0 75 | login_token, userid = login(user, password) 76 | if login_token == 0: 77 | print("登陆失败!") 78 | return "login fail!" 79 | 80 | t = get_time() 81 | 82 | app_token = get_app_token(login_token) 83 | 84 | today = time.strftime("%F") 85 | 86 | data_json = '%5B%7B%22data_hr%22%3A%22%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F9L%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2FVv%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F0v%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F9e%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F0n%5C%2Fa%5C%2F%5C%2F%5C%2FS%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F0b%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F1FK%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2FR%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%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fgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAA%22%2C%22tz%22%3A32%2C%22did%22%3A%22DA932FFFFE8816E7%22%2C%22src%22%3A24%7D%5D%2C%22summary%22%3A%22%7B%5C%22v%5C%22%3A6%2C%5C%22slp%5C%22%3A%7B%5C%22st%5C%22%3A1628296479%2C%5C%22ed%5C%22%3A1628296479%2C%5C%22dp%5C%22%3A0%2C%5C%22lt%5C%22%3A0%2C%5C%22wk%5C%22%3A0%2C%5C%22usrSt%5C%22%3A-1440%2C%5C%22usrEd%5C%22%3A-1440%2C%5C%22wc%5C%22%3A0%2C%5C%22is%5C%22%3A0%2C%5C%22lb%5C%22%3A0%2C%5C%22to%5C%22%3A0%2C%5C%22dt%5C%22%3A0%2C%5C%22rhr%5C%22%3A0%2C%5C%22ss%5C%22%3A0%7D%2C%5C%22stp%5C%22%3A%7B%5C%22ttl%5C%22%3A18272%2C%5C%22dis%5C%22%3A10627%2C%5C%22cal%5C%22%3A510%2C%5C%22wk%5C%22%3A41%2C%5C%22rn%5C%22%3A50%2C%5C%22runDist%5C%22%3A7654%2C%5C%22runCal%5C%22%3A397%2C%5C%22stage%5C%22%3A%5B%7B%5C%22start%5C%22%3A327%2C%5C%22stop%5C%22%3A341%2C%5C%22mode%5C%22%3A1%2C%5C%22dis%5C%22%3A481%2C%5C%22cal%5C%22%3A13%2C%5C%22step%5C%22%3A680%7D%2C%7B%5C%22start%5C%22%3A342%2C%5C%22stop%5C%22%3A367%2C%5C%22mode%5C%22%3A3%2C%5C%22dis%5C%22%3A2295%2C%5C%22cal%5C%22%3A95%2C%5C%22step%5C%22%3A2874%7D%2C%7B%5C%22start%5C%22%3A368%2C%5C%22stop%5C%22%3A377%2C%5C%22mode%5C%22%3A4%2C%5C%22dis%5C%22%3A1592%2C%5C%22cal%5C%22%3A88%2C%5C%22step%5C%22%3A1664%7D%2C%7B%5C%22start%5C%22%3A378%2C%5C%22stop%5C%22%3A386%2C%5C%22mode%5C%22%3A3%2C%5C%22dis%5C%22%3A1072%2C%5C%22cal%5C%22%3A51%2C%5C%22step%5C%22%3A1245%7D%2C%7B%5C%22start%5C%22%3A387%2C%5C%22stop%5C%22%3A393%2C%5C%22mode%5C%22%3A4%2C%5C%22dis%5C%22%3A1036%2C%5C%22cal%5C%22%3A57%2C%5C%22step%5C%22%3A1124%7D%2C%7B%5C%22start%5C%22%3A394%2C%5C%22stop%5C%22%3A398%2C%5C%22mode%5C%22%3A3%2C%5C%22dis%5C%22%3A488%2C%5C%22cal%5C%22%3A19%2C%5C%22step%5C%22%3A607%7D%2C%7B%5C%22start%5C%22%3A399%2C%5C%22stop%5C%22%3A414%2C%5C%22mode%5C%22%3A4%2C%5C%22dis%5C%22%3A2220%2C%5C%22cal%5C%22%3A120%2C%5C%22step%5C%22%3A2371%7D%2C%7B%5C%22start%5C%22%3A415%2C%5C%22stop%5C%22%3A427%2C%5C%22mode%5C%22%3A3%2C%5C%22dis%5C%22%3A1268%2C%5C%22cal%5C%22%3A59%2C%5C%22step%5C%22%3A1489%7D%2C%7B%5C%22start%5C%22%3A428%2C%5C%22stop%5C%22%3A433%2C%5C%22mode%5C%22%3A1%2C%5C%22dis%5C%22%3A152%2C%5C%22cal%5C%22%3A4%2C%5C%22step%5C%22%3A238%7D%2C%7B%5C%22start%5C%22%3A434%2C%5C%22stop%5C%22%3A444%2C%5C%22mode%5C%22%3A3%2C%5C%22dis%5C%22%3A2295%2C%5C%22cal%5C%22%3A95%2C%5C%22step%5C%22%3A2874%7D%2C%7B%5C%22start%5C%22%3A445%2C%5C%22stop%5C%22%3A455%2C%5C%22mode%5C%22%3A4%2C%5C%22dis%5C%22%3A1592%2C%5C%22cal%5C%22%3A88%2C%5C%22step%5C%22%3A1664%7D%2C%7B%5C%22start%5C%22%3A456%2C%5C%22stop%5C%22%3A466%2C%5C%22mode%5C%22%3A3%2C%5C%22dis%5C%22%3A1072%2C%5C%22cal%5C%22%3A51%2C%5C%22step%5C%22%3A1245%7D%2C%7B%5C%22start%5C%22%3A467%2C%5C%22stop%5C%22%3A477%2C%5C%22mode%5C%22%3A4%2C%5C%22dis%5C%22%3A1036%2C%5C%22cal%5C%22%3A57%2C%5C%22step%5C%22%3A1124%7D%2C%7B%5C%22start%5C%22%3A478%2C%5C%22stop%5C%22%3A488%2C%5C%22mode%5C%22%3A3%2C%5C%22dis%5C%22%3A488%2C%5C%22cal%5C%22%3A19%2C%5C%22step%5C%22%3A607%7D%2C%7B%5C%22start%5C%22%3A489%2C%5C%22stop%5C%22%3A499%2C%5C%22mode%5C%22%3A4%2C%5C%22dis%5C%22%3A2220%2C%5C%22cal%5C%22%3A120%2C%5C%22step%5C%22%3A2371%7D%2C%7B%5C%22start%5C%22%3A500%2C%5C%22stop%5C%22%3A511%2C%5C%22mode%5C%22%3A3%2C%5C%22dis%5C%22%3A1268%2C%5C%22cal%5C%22%3A59%2C%5C%22step%5C%22%3A1489%7D%2C%7B%5C%22start%5C%22%3A512%2C%5C%22stop%5C%22%3A522%2C%5C%22mode%5C%22%3A1%2C%5C%22dis%5C%22%3A152%2C%5C%22cal%5C%22%3A4%2C%5C%22step%5C%22%3A238%7D%5D%7D%2C%5C%22goal%5C%22%3A8000%2C%5C%22tz%5C%22%3A%5C%2228800%5C%22%7D%22%2C%22source%22%3A24%2C%22type%22%3A0%7D%5D' 87 | 88 | finddate = re.compile(r'.*?date%22%3A%22(.*?)%22%2C%22data.*?') 89 | findstep = re.compile(r'.*?ttl%5C%22%3A(.*?)%2C%5C%22dis.*?') 90 | data_json = re.sub(finddate.findall(data_json)[0], today, str(data_json)) 91 | data_json = re.sub(findstep.findall(data_json)[0], step, str(data_json)) 92 | 93 | url = "https://api-mifit-cn.huami.com/v1/data/band_data.json?&t=" + t 94 | head = { 95 | "apptoken": app_token, 96 | "Content-Type": "application/x-www-form-urlencoded" 97 | } 98 | 99 | data = "userid={userid}&last_sync_data_time=1597306380&device_type=0&last_deviceid=DA932FFFFE8816E7&data_json=" + data_json 100 | 101 | response = requests.post(url, data=data, headers=head).json() 102 | # print(response) result = f"{user[:4]}****{user[-4:]}: [{now}] 修改步数({step})" + \ 103 | result = "微信刷步数\n" +"用户:"+user + "\n步数:" + step + "\n当前时间:" + now 104 | print(result) 105 | return result 106 | 107 | 108 | # 获取时间戳 109 | 110 | 111 | def get_time(): 112 | url = 'http://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp' 113 | response = requests.get(url, headers=headers).json() 114 | t = response['data']['t'] 115 | return t 116 | 117 | 118 | # 获取app_token 119 | def get_app_token(login_token): 120 | url = "https://account-cn.huami.com/v1/client/app_tokens?app_name=com.xiaomi.hm.health&dn=api-user.huami.com%2Capi-mifit.huami.com%2Capp-analytics.huami.com&login_token=" + login_token 121 | response = requests.get(url, headers=headers).json() 122 | app_token = response['token_info']['app_token'] 123 | # print("app_token获取成功!") 124 | # print(app_token) 125 | return app_token 126 | 127 | def push_qy(text): 128 | wex = { 129 | "id": "", # 企业id 130 | "secret": "", # 创建的应用secret 131 | "agentid": 1000002, # 创建的应用id 132 | } 133 | # 获得access_token 134 | url = 'https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=' + wex['id'] + '&corpsecret=' + wex['secret'] 135 | re = requests.get(url).json() 136 | access_token = re['access_token'] 137 | url1 = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token="+ access_token 138 | data = { 139 | "touser": "@all", 140 | "msgtype": "text", 141 | "agentid": wex["agentid"], 142 | "text": { 143 | "content": text 144 | }, 145 | } 146 | # 字符串格式 147 | re1 = requests.post(url=url1, data=json.dumps(data)).json() 148 | if re1['errcode'] == 0: 149 | print("推送成功") 150 | else: 151 | print("推送失败") 152 | 153 | def start(): 154 | 155 | # 这里输入用户名(格式为 13800138000) 156 | user = "" 157 | # 这里输入登录密码 158 | passwd = "" 159 | # 要修改的步数,直接输入想要修改的步数值,留空为随机步数 160 | step = "" 161 | 162 | user_list = user.split('#') 163 | passwd_list = passwd.split('#') 164 | setp_array = step.split('-') 165 | 166 | if len(user_list) == len(passwd_list): 167 | push = '' 168 | for line in range(0, len(user_list)): 169 | if len(setp_array) == 2: 170 | step = str(random.randint( 171 | int(setp_array[0]), int(setp_array[1]))) 172 | elif str(step) == '0': 173 | step = '' 174 | push += main(user_list[line], passwd_list[line], step) + '\n' 175 | try: 176 | push_qy(push) 177 | except: 178 | print('推送出错') 179 | 180 | else: 181 | print('用户名和密码数量不对') 182 | 183 | 184 | def main_handler(event, context): 185 | start() 186 | 187 | 188 | if __name__ == '__main__': 189 | start() -------------------------------------------------------------------------------- /ysy.js: -------------------------------------------------------------------------------- 1 | /*萤石云视频 @YaphetS0903 2 | 3 | 4 | cron 21 15 * * * https://raw.githubusercontent.com/YaphetS0903/JStest/main/ysy.js 5 | 6 | 脚本库:https://github.com/YaphetS0903/JStest/ 7 | boxjs地址 : https://raw.githubusercontent.com/YaphetS0903/JStest/main/YaphteS0903.boxjs.json 8 | 9 | 10 | 11 | [脚本说明] 12 | 13 | 目前只能做签到和开宝箱任务,也不可以提现了 14 | 15 | 16 | 17 | [青龙变量] 18 | 19 | 抓3个数据,重新登录!重新登录才可以抓到数据 20 | 21 | https://api.ys7.com/v3/users/login/v2 22 | 23 | 把header转成JSON格式;body查看表单即可获取 24 | 25 | CK获取 26 | https://api.ys7.com/v3/integral/yd/getUserOpenBoxCd 27 | 28 | 提现body 查看表单获取数据 29 | 30 | https://api.ys7.com/v3/integral/yd/pay 31 | 32 | #萤石云 33 | export ysyhd='' 34 | export ysybody='account=188********' 35 | export cookie='"ASG_DisplayName=***"' 36 | export txbody='payCode=101006&receiverType=2&receiverId=2********' 37 | 38 | 39 | 40 | */ 41 | const $ = new Env('萤石云视频'); 42 | let status; 43 | 44 | status = (status = ($.getval("ysystatus") || "1")) > 1 ? `${status}` : ""; 45 | let ysyurlArr = [], ysyhdArr = [],ysybodyArr = [], cookieArr = [],txbodyArr = [],ysycount = '' 46 | let ysyurl = $.getdata('ysyurl') 47 | let ysyhd = $.isNode() ? (process.env.ysyhd ? process.env.ysyhd : "") : ($.getdata('ysyhd') ? $.getdata('ysyhd') : "") 48 | let ysybody = $.isNode() ? (process.env.ysybody ? process.env.ysybody : "") : ($.getdata('ysybody ') ? $.getdata('ysybody ') : "") 49 | let cookie =$.isNode() ? (process.env.cookie ? process.env.cookie : "") : ($.getdata('cookie ') ? $.getdata('cookie ') : "") 50 | let txbody = $.isNode() ? (process.env.txbody ? process.env.txbody : "") : ($.getdata('txbody ') ? $.getdata('txbody ') : "") 51 | let b = Math.round(new Date().getTime() / 1000).toString(); 52 | let DD = RT(2000, 3500) 53 | let tz = ($.getval('tz') || '1'); 54 | let tx = ($.getval('tx') || '1'); 55 | let id = '', txid = '', aid = '', sessionId= '', featurecode= '' 56 | $.message = '' 57 | let ysyhds = "",ysybodys = "",cookies = "",txbodys = "" 58 | 59 | 60 | 61 | 62 | !(async () => { 63 | if (typeof $request !== "undefined") { 64 | await ysyck() 65 | } else { 66 | if (!$.isNode()) { 67 | ysyurlArr.push($.getdata('ysyurl')) 68 | ysyhdArr.push($.getdata('ysyhd')) 69 | ysybodyArr.push($.getdata('ysybody')) 70 | cookieArr.push($.getdata('cookie')) 71 | txbodyArr.push($.getdata('txbody')) 72 | let ysycount = ($.getval('ysycount') || '1'); 73 | for (let i = 2; i <= ysycount; i++) { 74 | ysyurlArr.push($.getdata(`ysyurl${i}`)) 75 | ysyhdArr.push($.getdata(`ysyhd${i}`)) 76 | ysybodyArr.push($.getdata(`ysybody${i}`)) 77 | cookieArr.push($.getdata(`cookie${i}`)) 78 | txbodyArr.push($.getdata(`txbody${i}`)) 79 | } 80 | console.log( 81 | `\n\n=============================================== 脚本执行 - 北京时间(UTC+8):${new Date( 82 | new Date().getTime() + 83 | new Date().getTimezoneOffset() * 60 * 1000 + 84 | 8 * 60 * 60 * 1000 85 | ).toLocaleString()} ===============================================\n`); 86 | for (let i = 0; i < ysyhdArr.length; i++) { 87 | if (ysyhdArr[i]) { 88 | 89 | ysyurl = ysyurlArr[i]; 90 | ysyhd = ysyhdArr[i]; 91 | ysybody = ysybodyArr[i]; 92 | cookie = cookieArr[i]; 93 | txbody = txbodyArr[i]; 94 | $.index = i + 1; 95 | console.log(`\n\n开始【萤石云${$.index}】`) 96 | await ysylogin() 97 | 98 | 99 | 100 | //message() 101 | } 102 | } 103 | } else { 104 | if (process.env.ysyhd && process.env.ysyhd.indexOf('@') > -1) { 105 | ysyhdArr = process.env.ysyhd.split('@'); 106 | console.log(`您选择的是用"@"隔开\n`) 107 | } else { 108 | ysyhds = [process.env.ysyhd] 109 | }; 110 | Object.keys(ysyhds).forEach((item) => { 111 | if (ysyhds[item]) { 112 | ysyhdArr.push(ysyhds[item]) 113 | } 114 | }) 115 | if (process.env.ysybody && process.env.ysybody.indexOf('@') > -1) { 116 | ysybodyArr = process.env.ysybody.split('@'); 117 | console.log(`您选择的是用"@"隔开\n`) 118 | } else { 119 | ysybodys = [process.env.ysybody] 120 | }; 121 | Object.keys(ysybodys).forEach((item) => { 122 | if (ysybodys[item]) { 123 | ysybodyArr.push(ysybodys[item]) 124 | } 125 | }) 126 | 127 | if (process.env.cookie && process.env.cookie.indexOf('@') > -1) { 128 | cookieArr = process.env.cookie.split('@'); 129 | console.log(`您选择的是用"@"隔开\n`) 130 | } else { 131 | cookies = [process.env.cookie] 132 | }; 133 | Object.keys(cookies).forEach((item) => { 134 | if (cookies[item]) { 135 | cookieArr.push(cookies[item]) 136 | } 137 | }) 138 | 139 | if (process.env.txbody && process.env.txbody.indexOf('@') > -1) { 140 | txbodyArr = process.env.txbody.split('@'); 141 | console.log(`您选择的是用"@"隔开\n`) 142 | } else { 143 | txbodys = [process.env.txbody] 144 | }; 145 | Object.keys(txbodys).forEach((item) => { 146 | if (txbodys[item]) { 147 | txbodyArr.push(txbodys[item]) 148 | } 149 | }) 150 | 151 | 152 | console.log(`共${ysyhdArr.length}个cookie`) 153 | for (let k = 0; k < ysyhdArr.length; k++) { 154 | $.message = "" 155 | ysyurl = ysyurlArr[k]; 156 | ysyhd = ysyhdArr[k]; 157 | ysybody = ysybodyArr[k]; 158 | cookie = cookieArr[k]; 159 | txbody = txbodyArr[k]; 160 | $.index = k + 1; 161 | console.log(`\n开始【萤石云${$.index}】`) 162 | // await ysytaskList() 163 | // await $.wait(1500) 164 | // await ysyboxcd() 165 | await ysylogin() 166 | //message() 167 | } 168 | } 169 | 170 | } 171 | })() 172 | 173 | .catch((e) => $.logErr(e)) 174 | .finally(() => $.done()) 175 | 176 | 177 | 178 | 179 | 180 | function ysyck() { 181 | if ($request.url.indexOf("login/v2") > -1) { 182 | const ysyurl = $request.url 183 | if (ysyurl) $.setdata(ysyurl, `ysyurl${status}`) 184 | $.log(ysyurl) 185 | 186 | const ysyhd = JSON.stringify($request.headers) 187 | if (ysyhd) $.setdata(ysyhd, `ysyhd${status}`) 188 | $.log(ysyhd) 189 | const ysybody = $request.body 190 | if (ysybody) $.setdata(ysybody, `ysybody${status}`) 191 | $.log(ysybody) 192 | 193 | 194 | $.msg($.name, "", `萤石云${status}获取登录数据成功`) 195 | 196 | }else if($request.url.indexOf("yd/getUserOpenBoxCd") > -1) { 197 | const cookie = JSON.stringify($request.headers.Cookie) 198 | if (cookie) $.setdata(cookie, `cookie${status}`) 199 | $.log(cookie) 200 | $.msg($.name, "", `萤石云${status}获取cookie数据成功`) 201 | }else if($request.url.indexOf("yd/pay") > -1) { 202 | const txbody = $request.body 203 | if (txbody) $.setdata(txbody, `txbody${status}`) 204 | $.log(txbody) 205 | $.msg($.name, "", `萤石云${status}获取提现数据成功`) 206 | } 207 | } 208 | 209 | //登录 210 | function ysylogin(timeout = 0) { 211 | return new Promise((resolve) => { 212 | 213 | let url = { 214 | url: `https://api.ys7.com/v3/users/login/v2`, 215 | headers: JSON.parse(ysyhd), 216 | body:ysybody, 217 | } 218 | $.post(url, async (err, resp, data) => { 219 | try { 220 | 221 | const result = JSON.parse(data) 222 | 223 | if (result.meta.code == 200) { 224 | console.log(`【登录】:${result.meta.message}\n`) 225 | sessionId =result.sessionInfo.sessionId 226 | await ysytaskList() 227 | await $.wait(1500) 228 | await ysyboxcd() 229 | await $.wait(1500) 230 | await ysyydinfo() 231 | 232 | }else{ 233 | console.log(`【登录】:${result.meta.message}\n`) 234 | } 235 | } catch (e) { 236 | 237 | } finally { 238 | 239 | resolve() 240 | } 241 | }, timeout) 242 | }) 243 | } 244 | 245 | 246 | //开宝箱冷却查询 247 | function ysyboxcd(timeout = 0) { 248 | return new Promise((resolve) => { 249 | featurecode = ysybody.match(/featureCode=(\w+)/)[1] 250 | 251 | const sphd ={ 252 | "Accept": "*/*", 253 | "Accept-Encoding": "gzip, deflate, br", 254 | "Accept-Language": "zh-cn", 255 | "Connection": "keep-alive", 256 | "Content-Length": "31", 257 | "Content-Type": "application/x-www-form-urlencoded", 258 | "Cookie": cookie, 259 | "Host": "api.ys7.com", 260 | "User-Agent": "VideoGo/1262766 CFNetwork/1220.1 Darwin/20.3.0", 261 | "appid": "ys", 262 | "clientno": "undefined", 263 | "clienttype": "1", 264 | "clientversion": "6.1.3.1262766", 265 | "featurecode": featurecode, 266 | "language": "undefined", 267 | "nettype": "WIFI", 268 | "sessionid": sessionId 269 | } 270 | let url = { 271 | url: `https://api.ys7.com/v3/integral/yd/getUserOpenBoxCd`, 272 | headers: sphd, 273 | 274 | } 275 | $.get(url, async (err, resp, data) => { 276 | try { 277 | 278 | const result = JSON.parse(data) 279 | 280 | if (result.meta.code == 200) { 281 | console.log(`【开宝箱冷却查询】:${result.meta.message}\n`) 282 | if(result.expireTime ==0){ 283 | console.log(`【开宝箱】\n`) 284 | await ysybox() 285 | await $.wait(3000) 286 | }else{ 287 | console.log(`【开宝箱冷却时间未到】\n`) 288 | 289 | await $.wait(1500) 290 | } 291 | 292 | 293 | } else { 294 | 295 | console.log(`【开宝箱冷却查询失败】:${result.message}\n`) 296 | 297 | 298 | } 299 | } catch (e) { 300 | 301 | } finally { 302 | 303 | resolve() 304 | } 305 | }, timeout) 306 | }) 307 | } 308 | 309 | //开宝箱 310 | function ysybox(timeout = 0) { 311 | return new Promise((resolve) => { 312 | featurecode = ysybody.match(/featureCode=(\w+)/)[1] 313 | 314 | const sphd ={ 315 | "Accept": "*/*", 316 | "Accept-Encoding": "gzip, deflate, br", 317 | "Accept-Language": "zh-cn", 318 | "Connection": "keep-alive", 319 | "Content-Length": "31", 320 | "Content-Type": "application/x-www-form-urlencoded", 321 | "Cookie": cookie, 322 | "Host": "api.ys7.com", 323 | "User-Agent": "VideoGo/1262766 CFNetwork/1220.1 Darwin/20.3.0", 324 | "appid": "ys", 325 | "clientno": "undefined", 326 | "clienttype": "1", 327 | "clientversion": "6.1.3.1262766", 328 | "featurecode": featurecode, 329 | "language": "undefined", 330 | "nettype": "WIFI", 331 | "sessionid": sessionId 332 | } 333 | let url = { 334 | url: `https://api.ys7.com/v3/integral/yd/openYdBox`, 335 | headers: sphd, 336 | 337 | } 338 | $.post(url, async (err, resp, data) => { 339 | try { 340 | 341 | const result = JSON.parse(data) 342 | 343 | if (result.meta.code == 200) { 344 | console.log(`【开宝箱获得莹豆】:${result.ydValue}\n`) 345 | 346 | 347 | 348 | } else if (result.meta.code == 10361){ 349 | 350 | console.log(`【开宝箱失败】:${result.meta.message}\n`) 351 | console.log(`【开始看视频开宝箱】\n`) 352 | await ysyspbox() 353 | await $.wait(3000) 354 | }else if (result.meta.code == 10362){ 355 | console.log(`${result.meta.message}\n`) 356 | console.log(`【开始看视频开宝箱】\n`) 357 | await ysyspbox() 358 | await $.wait(3000) 359 | }else{ 360 | console.log(`${result.meta.message}\n`) 361 | } 362 | } catch (e) { 363 | 364 | } finally { 365 | 366 | resolve() 367 | } 368 | }, timeout) 369 | }) 370 | } 371 | 372 | 373 | 374 | 375 | //视频开宝箱 376 | function ysyspbox(timeout = 0) { 377 | return new Promise((resolve) => { 378 | featurecode = ysybody.match(/featureCode=(\w+)/)[1] 379 | 380 | const sphd ={ 381 | "Accept": "*/*", 382 | "Accept-Encoding": "gzip, deflate, br", 383 | "Accept-Language": "zh-cn", 384 | "Connection": "keep-alive", 385 | "Content-Length": "31", 386 | "Content-Type": "application/x-www-form-urlencoded", 387 | "Cookie": cookie, 388 | "Host": "api.ys7.com", 389 | "User-Agent": "VideoGo/1262766 CFNetwork/1220.1 Darwin/20.3.0", 390 | "appid": "ys", 391 | "clientno": "undefined", 392 | "clienttype": "1", 393 | "clientversion": "6.1.3.1262766", 394 | "featurecode": featurecode, 395 | "language": "undefined", 396 | "nettype": "WIFI", 397 | "sessionid": sessionId 398 | } 399 | let url = { 400 | url: `https://api.ys7.com/v3/integral/task/complete`, 401 | headers: sphd, 402 | body:`eventkey=1013&filterParam=12345`, 403 | } 404 | $.post(url, async (err, resp, data) => { 405 | try { 406 | 407 | const result = JSON.parse(data) 408 | 409 | if (result.meta.code == 200) { 410 | console.log(`【看视频开宝箱获得莹豆】:${result.taskIntegral}\n`) 411 | 412 | 413 | 414 | }else{ 415 | console.log(`【看视频开宝箱获得莹豆失败】:${result.meta.message}\n`) 416 | } 417 | } catch (e) { 418 | 419 | } finally { 420 | 421 | resolve() 422 | } 423 | }, timeout) 424 | }) 425 | } 426 | 427 | //任务列表 428 | function ysytaskList(timeout = 0) { 429 | return new Promise((resolve) => { 430 | featurecode = ysybody.match(/featureCode=(\w+)/)[1] 431 | 432 | const sphd ={ 433 | "Accept": "*/*", 434 | "Accept-Encoding": "gzip, deflate, br", 435 | "Accept-Language": "zh-cn", 436 | "Connection": "keep-alive", 437 | "Content-Length": "31", 438 | "Content-Type": "application/x-www-form-urlencoded", 439 | "Cookie": cookie, 440 | "Host": "api.ys7.com", 441 | "User-Agent": "VideoGo/1262766 CFNetwork/1220.1 Darwin/20.3.0", 442 | "appid": "ys", 443 | "clientno": "undefined", 444 | "clienttype": "1", 445 | "clientversion": "6.1.3.1262766", 446 | "featurecode": featurecode, 447 | "language": "undefined", 448 | "nettype": "WIFI", 449 | "sessionid": sessionId 450 | } 451 | let url = { 452 | url: `https://api.ys7.com/v3/integral/task/list`, 453 | headers: sphd, 454 | body: `pageNum=0 455 | & 456 | pageSize=20 457 | & 458 | vipId=`, 459 | } 460 | $.post(url, async (err, resp, data) => { 461 | try { 462 | 463 | const result = JSON.parse(data) 464 | //result.taskList[0].taskCompleteNum 465 | if (result.meta.code == 200) { 466 | console.log(`【查询任务列表列表】:${result.meta.message}\n`) 467 | 468 | if (result.taskList[0].taskCompleteNum != result.taskList[0].taskNum) { 469 | console.log(`【开始签到任务】\n`) 470 | await ysysign() 471 | 472 | // //签到任务 473 | // return new Promise((resolve) => { 474 | 475 | // let url = { 476 | // url: `https://api.ys7.com/v3/videoclips/user/check_in`, 477 | // headers: JSON.parse(ysyhd), 478 | 479 | // } 480 | // $.post(url, async (err, resp, data) => { 481 | // try { 482 | 483 | // const result = JSON.parse(data) 484 | 485 | // if (result.meta.code == 200) { 486 | 487 | 488 | // console.log(`【签到】:${result.meta.message}\n`) 489 | // console.log(`【获得莹豆】:${result.data.score}\n`) 490 | 491 | // } else { 492 | 493 | // console.log(`【签到失败】:${result.meta.message}\n`) 494 | // } 495 | // } catch (e) { 496 | 497 | // } finally { 498 | 499 | // resolve() 500 | // } 501 | // }, timeout) 502 | // }) 503 | 504 | 505 | 506 | } else { 507 | console.log(`【今日签到任务已完成】\n`) 508 | } 509 | 510 | 511 | 512 | 513 | 514 | if (result.taskList[1].taskCompleteNum != result.taskList[1].taskNum) { 515 | await $.wait(1500) 516 | console.log(`【开始上传短视频任务】\n`) 517 | await ysyvideo() 518 | await $.wait(3000) 519 | 520 | 521 | 522 | } else { 523 | console.log(`【今日上传短视频任务已完成】\n`) 524 | } 525 | 526 | 527 | 528 | 529 | 530 | if (result.taskList[2].taskCompleteNum != result.taskList[2].taskNum) { 531 | console.log(`【开始评论短视频任务】\n`) 532 | await ysyplvideo() 533 | await $.wait(3000) 534 | } else { 535 | console.log(`【今日评论短视频任务已完成】\n`) 536 | } 537 | 538 | 539 | 540 | } else { 541 | 542 | console.log(`【查询任务列表失败】:${result.meta.message}\n`) 543 | 544 | } 545 | } catch (e) { 546 | 547 | } finally { 548 | 549 | resolve() 550 | } 551 | }, timeout) 552 | }) 553 | } 554 | 555 | 556 | 557 | 558 | //上传短视频任务 559 | function ysyvideo(timeout = 0) { 560 | return new Promise((resolve) => { 561 | featurecode = ysybody.match(/featureCode=(\w+)/)[1] 562 | 563 | const sphd ={ 564 | "Accept": "*/*", 565 | "Accept-Encoding": "gzip, deflate, br", 566 | "Accept-Language": "zh-cn", 567 | "Connection": "keep-alive", 568 | "Content-Length": "31", 569 | "Content-Type": "application/x-www-form-urlencoded", 570 | "Cookie": cookie, 571 | "Host": "api.ys7.com", 572 | "User-Agent": "VideoGo/1262766 CFNetwork/1220.1 Darwin/20.3.0", 573 | "appid": "ys", 574 | "clientno": "undefined", 575 | "clienttype": "1", 576 | "clientversion": "6.1.3.1262766", 577 | "featurecode": featurecode, 578 | "language": "undefined", 579 | "nettype": "WIFI", 580 | "sessionid": sessionId 581 | } 582 | let url = { 583 | url: `https://api.ys7.com/v3/integral/task/complete?eventkey=1007&filterParam=video`, 584 | headers: sphd, 585 | 586 | } 587 | $.post(url, async (err, resp, data) => { 588 | try { 589 | 590 | const result = JSON.parse(data) 591 | 592 | if (result.meta.code == 200) { 593 | 594 | console.log(`【上传短视频任务】:${result.meta.message}\n`) 595 | console.log(`【获得莹豆】:${result.taskIntegral}\n`) 596 | 597 | } else { 598 | 599 | console.log(`【上传短视频任务失败】:${result.meta.message}\n`) 600 | 601 | 602 | } 603 | } catch (e) { 604 | 605 | } finally { 606 | 607 | resolve() 608 | } 609 | }, timeout) 610 | }) 611 | } 612 | 613 | 614 | 615 | 616 | //评论短视频任务 617 | function ysyplvideo(timeout = 0) { 618 | return new Promise((resolve) => { 619 | featurecode = ysybody.match(/featureCode=(\w+)/)[1] 620 | 621 | const sphd ={ 622 | "Accept": "*/*", 623 | "Accept-Encoding": "gzip, deflate, br", 624 | "Accept-Language": "zh-cn", 625 | "Connection": "keep-alive", 626 | "Content-Length": "31", 627 | "Content-Type": "application/x-www-form-urlencoded", 628 | "Cookie": cookie, 629 | "Host": "api.ys7.com", 630 | "User-Agent": "VideoGo/1262766 CFNetwork/1220.1 Darwin/20.3.0", 631 | "appid": "ys", 632 | "clientno": "undefined", 633 | "clienttype": "1", 634 | "clientversion": "6.1.3.1262766", 635 | "featurecode": featurecode, 636 | "language": "undefined", 637 | "nettype": "WIFI", 638 | "sessionid": sessionId 639 | } 640 | let url = { 641 | url: `https://api.ys7.com/v3/integral/task/complete?eventkey=1008&filterParam=video`, 642 | headers: sphd, 643 | 644 | } 645 | $.post(url, async (err, resp, data) => { 646 | try { 647 | 648 | const result = JSON.parse(data) 649 | 650 | if (result.meta.code == 200) { 651 | 652 | 653 | console.log(`【评论短视频任务】:${result.meta.message}\n`) 654 | console.log(`【获得莹豆】:${result.taskIntegral}\n`) 655 | 656 | } else { 657 | 658 | console.log(`【评论短视频任务失败】:${result.meta.message}\n`) 659 | } 660 | } catch (e) { 661 | 662 | } finally { 663 | 664 | resolve() 665 | } 666 | }, timeout) 667 | }) 668 | } 669 | 670 | //签到任务 671 | function ysysign(timeout = 0) { 672 | return new Promise((resolve) => { 673 | featurecode = ysybody.match(/featureCode=(\w+)/)[1] 674 | 675 | const sphd ={ 676 | "Accept": "*/*", 677 | "Accept-Encoding": "gzip, deflate, br", 678 | "Accept-Language": "zh-cn", 679 | "Connection": "keep-alive", 680 | "Content-Length": "31", 681 | "Content-Type": "application/x-www-form-urlencoded", 682 | "Cookie": cookie, 683 | "Host": "api.ys7.com", 684 | "User-Agent": "VideoGo/1262766 CFNetwork/1220.1 Darwin/20.3.0", 685 | "appid": "ys", 686 | "clientno": "undefined", 687 | "clienttype": "1", 688 | "clientversion": "6.1.3.1262766", 689 | "featurecode": featurecode, 690 | "language": "undefined", 691 | "nettype": "WIFI", 692 | "sessionid": sessionId 693 | } 694 | let url = { 695 | url: `https://api.ys7.com/v3/videoclips/user/check_in`, 696 | headers: sphd, 697 | 698 | } 699 | $.post(url, async (err, resp, data) => { 700 | try { 701 | 702 | const result = JSON.parse(data) 703 | 704 | if (result.meta.code == 200) { 705 | 706 | 707 | console.log(`【签到】:${result.meta.message}\n`) 708 | console.log(`【获得莹豆】:${result.data.score}\n`) 709 | 710 | } else { 711 | 712 | console.log(`【签到失败】:${result.meta.message}\n`) 713 | } 714 | } catch (e) { 715 | 716 | } finally { 717 | 718 | resolve() 719 | } 720 | }, timeout) 721 | }) 722 | } 723 | 724 | 725 | //莹豆信息 726 | function ysyydinfo(timeout = 0) { 727 | return new Promise((resolve) => { 728 | featurecode = ysybody.match(/featureCode=(\w+)/)[1] 729 | 730 | const sphd ={ 731 | "Accept": "*/*", 732 | "Accept-Encoding": "gzip, deflate, br", 733 | "Accept-Language": "zh-cn", 734 | "Connection": "keep-alive", 735 | "Content-Length": "31", 736 | "Content-Type": "application/x-www-form-urlencoded", 737 | "Cookie": cookie, 738 | "Host": "api.ys7.com", 739 | "User-Agent": "VideoGo/1262766 CFNetwork/1220.1 Darwin/20.3.0", 740 | "appid": "ys", 741 | "clientno": "undefined", 742 | "clienttype": "1", 743 | "clientversion": "6.1.3.1262766", 744 | "featurecode": featurecode, 745 | "language": "undefined", 746 | "nettype": "WIFI", 747 | "sessionid": sessionId 748 | } 749 | let url = { 750 | url: `https://api.ys7.com/v3/integral/yd/queryMainPageInfo?`, 751 | headers: sphd, 752 | 753 | } 754 | $.get(url, async (err, resp, data) => { 755 | try { 756 | 757 | const result = JSON.parse(data) 758 | 759 | if (result.meta.code == 200) { 760 | 761 | 762 | console.log(`【累计获得莹豆】:${result.ydAccumulateValue}\n`) 763 | console.log(`【剩余莹豆】:${result.ydRemainValue}\n`) 764 | console.log(`【今日获得莹豆】:${result.ydCurrValue}\n`) 765 | console.log(`【累计提现】:${result.ydPayCashValue}\n`) 766 | if(result.ydRemainValue>=3000){ 767 | console.log(`【当前莹豆够3000,等待提现】\n`) 768 | await ysytx() 769 | }else{ 770 | console.log(`【莹豆不足提现要求,继续加油赚莹豆】\n`) 771 | } 772 | } else { 773 | 774 | console.log(`【查询莹豆信息失败】:${result.meta.message}\n`) 775 | } 776 | } catch (e) { 777 | 778 | } finally { 779 | 780 | resolve() 781 | } 782 | }, timeout) 783 | }) 784 | } 785 | 786 | 787 | //莹豆提现 788 | function ysytx(timeout = 0) { 789 | return new Promise((resolve) => { 790 | featurecode = ysybody.match(/featureCode=(\w+)/)[1] 791 | 792 | const sphd ={ 793 | "Accept": "*/*", 794 | "Accept-Encoding": "gzip, deflate, br", 795 | "Accept-Language": "zh-cn", 796 | "Connection": "keep-alive", 797 | "Content-Length": "31", 798 | "Content-Type": "application/x-www-form-urlencoded", 799 | "Cookie": cookie, 800 | "Host": "api.ys7.com", 801 | "User-Agent": "VideoGo/1262766 CFNetwork/1220.1 Darwin/20.3.0", 802 | "appid": "ys", 803 | "clientno": "undefined", 804 | "clienttype": "1", 805 | "clientversion": "6.1.3.1262766", 806 | "featurecode": featurecode, 807 | "language": "undefined", 808 | "nettype": "WIFI", 809 | "sessionid": sessionId 810 | } 811 | let url = { 812 | url: `https://api.ys7.com/v3/integral/yd/pay`, 813 | headers: sphd, 814 | body:txbody, 815 | 816 | } 817 | $.post(url, async (err, resp, data) => { 818 | try { 819 | 820 | const result = JSON.parse(data) 821 | 822 | if (result.meta.code == 200) { 823 | 824 | 825 | console.log(`【提现】:${result.meta.message}\n`) 826 | 827 | 828 | } else { 829 | 830 | console.log(`【提现失败】:${result.meta.message}\n`) 831 | } 832 | } catch (e) { 833 | 834 | } finally { 835 | 836 | resolve() 837 | } 838 | }, timeout) 839 | }) 840 | } 841 | 842 | 843 | 844 | 845 | 846 | 847 | 848 | function message() { 849 | if (tz == 1) { $.msg($.name, "", $.message) } 850 | } 851 | //时间 852 | nowTimes = new Date( 853 | new Date().getTime() + 854 | new Date().getTimezoneOffset() * 60 * 1000 + 855 | 8 * 60 * 60 * 1000 856 | ); 857 | 858 | function RT(X, Y) { 859 | do rt = Math.floor(Math.random() * Y); 860 | while (rt < X) 861 | return rt; 862 | } 863 | 864 | 865 | //console.log('\n'+getCurrentDate()); 866 | function getCurrentDate() { 867 | var date = new Date(); 868 | var seperator1 = "-"; 869 | var seperator2 = ":"; 870 | var month = date.getMonth() + 1; 871 | var strDate = date.getDate(); 872 | if (month >= 1 && month <= 9) { 873 | month = "0" + month; 874 | } 875 | if (strDate >= 0 && strDate <= 9) { 876 | strDate = "0" + strDate; 877 | } 878 | var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate 879 | + " " + date.getHours() + seperator2 + date.getMinutes() 880 | + seperator2 + date.getSeconds(); 881 | return currentdate; 882 | 883 | 884 | } 885 | 886 | 887 | 888 | 889 | 890 | 891 | 892 | 893 | 894 | 895 | 896 | 897 | 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) } 898 | --------------------------------------------------------------------------------