├── Notice.json ├── README.md ├── babycare.js ├── emsyhzx.js ├── fsdlb.js ├── fsinstax.js ├── fxkhd.js ├── gjjj.js ├── glg.js ├── gljj.js ├── hqcsh.js ├── htmwg.js ├── jdfls.js ├── lslyg.js ├── mpcbh.js ├── mswefls.js ├── qchyjlb.js ├── rqtyg.js ├── sendNotify.js ├── vx东方棘市.py ├── xpnc.js ├── ydxq.js ├── yshyjlb.js ├── ywxspc.js ├── yybpc.js ├── zippo.js ├── zjxsy.js ├── zwxq.js ├── 东方棘市.py ├── 中国联通.js ├── 北京现代.js ├── 古茗奶茶抢券.js ├── 太平通.js ├── 库迪咖啡.js ├── 废弃仓库 ├── Ljgy.js ├── astc.js ├── bmyx.js ├── cbly.js ├── jddsc.js ├── mist.js └── tcbjtxq.js ├── 朴朴超市.js ├── 永辉生活.js ├── 泰康在线.js ├── 第一电动.py ├── 长虹美菱.py └── 顺丰速运.js /Notice.json: -------------------------------------------------------------------------------- 1 | { 2 | "notice": " \n @auth:Mist\n@date:2024-05-29\n注: 本脚本仅用于个人学习和交流请勿用于非法用途。用户应当遵守所有适用的法律和规定。在任何情况下,脚本的开发者或贡献者均不对任何直接或间接使用本脚本而产生的结果负责。 " 3 | } 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### Script Overview 喜欢请点个🌟 2 | | Application | Script name | Available | Maintenance | 3 | |:----------------------:|:----------------------------------------------------------------------------------------:|:-------------:|:-----------:| 4 | |zippo签到| [Zippo](https://github.com/yang7758258/ohhh154/blob/main/zippo.js) | ✅(2024/05/30) | ✅| 5 | |好奇车生活| [Hqcsh](https://github.com/yang7758258/ohhh154/blob/main/hqcsh.js) | ✅(2024/06/02) |✅| 6 | | 海天美味馆|[Htmwg](https://github.com/yang7758258/ohhh154/blob/main/htmwg.js)|✅(2024/06/03)|✅| 7 | |仰韶会员俱乐部|[Yshyjlb](https://github.com/yang7758258/ohhh154/blob/main/yshyjlb.js)|✅(2024/06/08)|✅| 8 | |健达福利社|[Jdfls](https://github.com/yang7758258/ohhh154/blob/main/jdfls.js)|✅(2024/06/09)|✅| 9 | |富士instax|[Fsinstax](https://github.com/yang7758258/ohhh154/blob/main/fsinstax.js)|✅(2024/06/12)|✅| 10 | |麦斯威尔福利社|[Mswefls](https://github.com/yang7758258/ohhh154/blob/main/mswefls.js)|✅(2024/06/20)|✅| 11 | |日清体验馆|[Rqtyg](https://github.com/yang7758258/ohhh154/blob/main/rqtyg.js)|✅(2024/06/21)|✅| 12 | |Babycare|[Babycare](https://github.com/yang7758258/ohhh154/blob/main/babycare.js)|✅(2024/06/21)|✅| 13 | |兴攀农场|[Xpnc](https://github.com/yang7758258/ohhh154/blob/main/xpnc.js)|✅(2024/06/25)|✅| 14 | |植物星球|[Zwxq](https://github.com/yang7758258/ohhh154/blob/main/zwxq.js)|✅(2024/06/25)|✅| 15 | |诸暨西施眼|[Zjxsy](https://github.com/yang7758258/ohhh154/blob/main/zjxsy.js)|✅(2024/06/28)|✅| 16 | |爷爷不泡茶|[Yybpc](https://github.com/yang7758258/ohhh_QL-Script/blob/main/yybpc.js)|✅(2024/07/02)|✅| 17 | |毛铺草本荟|[Mpcbh](https://github.com/yang7758258/ohhh_QL-Script/blob/main/mpcbh.js)|✅(2024/07/03)|✅| 18 | |逢三得利吧|[Fsdlb](https://github.com/yang7758258/ohhh_QL-Script/blob/main/fsdlb.js)|✅(2024/07/05)|✅| 19 | |雅迪星球|[Ydxq](https://github.com/yang7758258/ohhh_QL-Script/blob/main/ydxq.js)|✅(2024/07/07)|✅| 20 | |国乐酱酒|[Gljj](https://github.com/yang7758258/ohhh_QL-Script/blob/main/gljj.js)|✅(2024/07/07)|✅| 21 | |库迪咖啡|[Kdcoffer](https://github.com/yang7758258/ohhh_QL-Script/blob/main/%E5%BA%93%E8%BF%AA%E5%92%96%E5%95%A1.js)|✅(2024/07/08)|✅| 22 | |雀巢会员俱乐部|[Qchyjlb](https://github.com/yang7758258/ohhh_QL-Script/blob/main/qchyjlb.js)|✅(2024/07/08)|✅| 23 | |丰信客户端|[Fxkhd](https://github.com/yang7758258/ohhh_QL-Script/blob/main/fxkhd.js)|✅(2024/07/09)|✅| 24 | |顾家家居|[Gjjj](https://github.com/yang7758258/ohhh_QL-Script/blob/main/gjjj.js)|❌(2024/07/14)|❌| 25 | |EMS邮惠中心|[Emsyhzx](https://github.com/yang7758258/ohhh_QL-Script/blob/main/emsyhzx.js)|✅(2024/07/16)|✅| 26 | |冷酸灵牙膏|[Lslyg](https://github.com/yang7758258/ohhh_QL-Script/blob/main/lslyg.js)|✅(2024/08/31)|✅| 27 | 28 | 29 | 30 | 31 | ------ 32 | ### [群组直达| 我与我周旋久,宁做我](https://t.me/Mist154) 33 | ### [频道直达| 夜色四合,平安喜樂](https://t.me/Mist153) 34 | ### 我们2025再见..... 35 | ### 声明: 36 | - 这里的脚本只是自己学习 js 的一个实践. 37 | - 仅用于测试和学习研究,禁止用于商业用途,不能保证其合法性,准确性,完整性和有效性,请根据情况自行判断. 38 | - 仓库内所有资源文件,禁止任何公众号、自媒体进行任何形式的转载、发布。 39 | - `Mist` 对任何脚本问题概不负责,包括但不限于由任何脚本错误导致的任何损失或损害. 40 | - 间接使用脚本的任何用户,包括但不限于建立 VPS 或在某些行为违反国家/地区法律或相关法规的情况下进行传播, `Mist` 对于由此引起的任何隐私泄漏或其他后果概不负责. 41 | - 如果任何单位或个人认为该项目的脚本可能涉嫌侵犯其权利,则应及时通知并提供身份证明,所有权证明,我们将在收到认证文件后删除相关脚本. 42 | - 任何以任何方式查看此项目的人或直接或间接使用该 Script 项目的任何脚本的使用者都应仔细阅读此声明。 `Mist` 保留随时更改或补充此免责声明的权利。一旦使用并复制了任何相关脚本或 Script 项目的规则,则视为您已接受此免责声明. 43 | - 您必须在下载后的 24 小时内从计算机或手机中完全删除以上内容. 44 | -------------------------------------------------------------------------------- /babycare.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Babaycare旗舰店、超级门店通用 3 | * Author: Mist 4 | * Date: 2024-06-21 5 | * cron "30 7 * * *" babaycare.js 6 | * export babaycare= authorization 多账号换行或者#分隔 7 | */ 8 | // ============================================================================================================ 9 | const $ = new Env('Babaycare') 10 | const axios = require('axios') 11 | const md5 = require('md5') 12 | const env_name = 'babaycare' //环境变量名字 13 | const env = process.env[env_name] || '' //获取环境变量 14 | const Notify = 1//是否通知, 1通知, 0不通知. 默认通知 15 | const debug = 0//是否调试, 1调试, 0不调试. 默认不调试 16 | let scriptVersionNow = "1.0.0";//脚本版本号 17 | let msg = ""; 18 | // ==================================异步顺序============================================================================== 19 | !(async () => { 20 | await getNotice(); //远程通知 21 | await getVersion("yang7758258/ohhh154@main/babaycare.js"); 22 | await main();//主函数 23 | await SendMsg(msg); //发送通知 24 | 25 | })() 26 | .catch((e) => $.logErr(e)) 27 | .finally(() => $.done()); 28 | //==================================脚本入口函数main()============================================================== 29 | async function main() { 30 | if (env == '') { 31 | //没有设置变量,直接退出 32 | console.log(`没有填写变量,请查看脚本说明: ${env_name}`) 33 | return 34 | } 35 | let user_ck = env.split('\n') 36 | DoubleLog(`\n========== 共找到 ${user_ck.length} 个账号 ==========`); 37 | let index = 1 //用来给账号标记序号, 从1开始 38 | for (let ck of user_ck) { 39 | if (!ck) continue //跳过空行 40 | let ck_info = ck.split('&') 41 | let authorization = ck_info[0] 42 | let user = { 43 | index: index, 44 | authorization, 45 | } 46 | index = index + 1 //每次用完序号+1 47 | //开始账号任务 48 | await userTask(user) 49 | //每个账号之间等1~5秒随机时间 50 | let rnd_time = Math.floor(Math.random() * 4000) + 1000 51 | console.log(`账号[${user.index}]随机等待${rnd_time / 1000}秒...`) 52 | await $.wait(rnd_time) 53 | } 54 | } 55 | // ======================================开始任务========================================= 56 | async function userTask(user) { 57 | console.log(`\n============= 账号[${user.index}]开始任务 =============`) 58 | await SignInDailyScore(user) 59 | await wait (1) 60 | await GetUserPoint(user) 61 | } 62 | // ============================================================================================================================= 63 | //签到 64 | async function SignInDailyScore(user) { 65 | try { 66 | let urlObject = { 67 | method: 'post', 68 | url: `https://api.bckid.com.cn/operation/front/bonus/userSign/v3/sign`, 69 | headers: { 70 | 'Host': 'api.bckid.com.cn', 71 | 'authorization': user.authorization, 72 | 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090b11) XWEB/9129', 73 | }, 74 | data: { 75 | 76 | } 77 | }; 78 | //console.log(urlObject); 79 | let { data: result} = await axios.request(urlObject) 80 | if (result?.code == '200') { 81 | //打印签到结果 82 | DoubleLog(`🌸账号[${user.index}]` + `🕊当前已签到${result.body.signDaysCountMod}天🎉`); 83 | }else{ 84 | DoubleLog(`🌸账号[${user.index}]签到-失败:${result.message}❌`) 85 | } 86 | 87 | } catch (e) { 88 | //打印错误信息 89 | console.log('以下是报错输出:'); 90 | console.log(e); 91 | } 92 | } 93 | 94 | //积分查询 95 | async function GetUserPoint(user) { 96 | try { 97 | let urlObject = { 98 | method: 'post', 99 | url: `https://api.bckid.com.cn/operation/front/bonus/userBonus/getUserBonus`, 100 | headers: { 101 | 'Host': 'api.bckid.com.cn', 102 | 'authorization': user.authorization, 103 | 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090b11) XWEB/9129', 104 | }, 105 | data: { 106 | 107 | } 108 | }; 109 | //console.log(urlObject); 110 | let { data: result} = await axios.request(urlObject) 111 | if (result?.code == '200') { 112 | //打印签到结果 113 | DoubleLog(`🌸账号[${user.index}]` + `🕊账户当前积分[${result.body.userBonus}],历史积分[${result.body.sumBonus}]💰`); 114 | }else{ 115 | DoubleLog(`🌸账号[${user.index}]积分查询失败:${result.message}❌`) 116 | } 117 | 118 | } catch (e) { 119 | //打印错误信息 120 | console.log('以下是报错输出:'); 121 | console.log(e.response.data); 122 | } 123 | } 124 | /** 125 | * =========================================================发送消息============================================= 126 | */ 127 | async function SendMsg(message) { 128 | if (!message) return; 129 | if (Notify > 0) { 130 | if ($.isNode()) { 131 | var notify = require("./sendNotify"); 132 | await notify.sendNotify($.name, message); 133 | } else { 134 | // $.msg(message); 135 | $.msg($.name, '', message) 136 | } 137 | } else { 138 | console.log(message); 139 | } 140 | } 141 | /** 142 | * =====================================================双平台log输出========================================== 143 | */ 144 | function DoubleLog(data) { 145 | if ($.isNode()) { 146 | if (data) { 147 | console.log(`${data}`); 148 | msg += `\n${data}`; 149 | } 150 | } else { 151 | console.log(`${data}`); 152 | msg += `\n${data}`; 153 | } 154 | 155 | } 156 | /** 157 | * ======================================================等待 X 秒============================================ 158 | */ 159 | function wait(n) { 160 | return new Promise(function (resolve) { 161 | setTimeout(resolve, n * 1000); 162 | }); 163 | } 164 | /** 165 | * ======================================================随机等待 1-5 秒============================================ 166 | */ 167 | function sjwait() { 168 | return new Promise(function (resolve) { 169 | let waitTime = Math.floor(Math.random() * 4000 + 1000); 170 | setTimeout(resolve, waitTime); 171 | }); 172 | } 173 | // ==========================================================13位时间戳===================================================== 174 | function getTimestamp() { 175 | return new Date().getTime(); 176 | } 177 | //===============================================网络请求httpRequest========================================= 178 | function httpRequest(options, timeout = 1 * 1000) { 179 | method = options.method ? options.method.toLowerCase() : options.body ? "post" : "get"; 180 | return new Promise(resolve => { 181 | setTimeout(() => { 182 | $[method](options, (err, resp, data) => { 183 | try { 184 | if (err) { 185 | console.log(JSON.stringify(err)); 186 | $.logErr(err); 187 | } else { 188 | try { data = JSON.parse(data); } catch (error) { } 189 | } 190 | } catch (e) { 191 | console.log(e); 192 | $.logErr(e, resp); 193 | } finally { 194 | resolve(data); 195 | } 196 | }) 197 | }, timeout) 198 | }) 199 | } 200 | //==============================================Debug模式=============================================== 201 | function debugLog(...args) { 202 | if (debug) { 203 | console.log(...args); 204 | } 205 | } 206 | //===============================================获取远程通知======================================== 207 | async function getNotice() { 208 | try { 209 | const urls = [ 210 | "https://gitee.com/ohhhooh/jd_haoyangmao/raw/master/Notice.json", 211 | 212 | ]; 213 | let notice = null; 214 | for (const url of urls) { 215 | const options = { url, headers: { "User-Agent": "" }, }; 216 | const result = await httpRequest(options); 217 | if (result && "notice" in result) { 218 | notice = result.notice.replace(/\\n/g, "\n"); 219 | break; 220 | } 221 | } 222 | if (notice) { $.DoubleLog(notice); } 223 | } catch (e) { 224 | console.log(e); 225 | } 226 | } 227 | //==============================================获取远程版本================================================= 228 | function getVersion(scriptUrl, timeout = 3 * 1000) { 229 | return new Promise((resolve) => { 230 | const options = { url: `https://fastly.jsdelivr.net/gh/${scriptUrl}` }; 231 | $.get(options, (err, resp, data) => { 232 | try { 233 | const regex = /scriptVersionNow\s*=\s*(["'`])([\d.]+)\1/; 234 | const match = data.match(regex); 235 | const scriptVersionLatest = match ? match[2] : ""; 236 | console.log(`\n============= 当前版本:${scriptVersionNow} 🌟 最新版本:${scriptVersionLatest} =============`); 237 | } catch (e) { 238 | $.logErr(e, resp); 239 | } 240 | resolve(); 241 | }, timeout); 242 | }); 243 | } 244 | 245 | //=============================================================================================================================================== 246 | //================================================固定API=============================================================================================== 247 | 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, a) => { s.call(this, t, (t, s, r) => { t ? a(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.userList = []; this.userIdx = 0; (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},开始!`) } getEnv() { return "undefined" != typeof $environment && $environment["surge-version"] ? "Surge" : "undefined" != typeof $environment && $environment["stash-version"] ? "Stash" : "undefined" != typeof module && module.exports ? "Node.js" : "undefined" != typeof $task ? "Quantumult X" : "undefined" != typeof $loon ? "Loon" : "undefined" != typeof $rocket ? "Shadowrocket" : void 0 } isNode() { return "Node.js" === this.getEnv() } isQuanX() { return "Quantumult X" === this.getEnv() } isSurge() { return "Surge" === this.getEnv() } isLoon() { return "Loon" === this.getEnv() } isShadowrocket() { return "Shadowrocket" === this.getEnv() } isStash() { return "Stash" === this.getEnv() } 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 a = this.getdata(t); if (a) 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, a) => e(a)) }) } runScript(t, e) { return new Promise((s) => { let a = this.getdata("@chavy_boxjs_userCfgs.httpapi"); a = a ? a.replace(/\n/g, "").trim() : a; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); (r = r ? 1 * r : 20), (r = e && e.timeout ? e.timeout : r); const [i, o] = a.split("@"), n = { url: `http://${o}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": i, Accept: "*/*" }, timeout: r, }; this.post(n, (t, e, a) => s(a)) }).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), a = !s && this.fs.existsSync(e); if (!s && !a) return {}; { const a = s ? t : e; try { return JSON.parse(this.fs.readFileSync(a)) } 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), a = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : a ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const a = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of a) 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, a) => Object(t[s]) === t[s] ? t[s] : (t[s] = Math.abs(e[a + 1]) >> 0 == +e[a + 1] ? [] : {}), t)[e[e.length - 1]] = s), t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, a] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, a, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, a, r] = /^@(.*?)\.(.*?)$/.exec(e), i = this.getval(a), o = a ? ("null" === i ? null : i || "{}") : "{}"; try { const e = JSON.parse(o); this.lodash_set(e, r, t), (s = this.setval(JSON.stringify(e), a)) } catch (e) { const i = {}; this.lodash_set(i, r, t), (s = this.setval(JSON.stringify(i), a)) } } else s = this.setval(t, e); return s } getval(t) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": return $persistentStore.read(t); case "Quantumult X": return $prefs.valueForKey(t); case "Node.js": return (this.data = this.loaddata()), this.data[t]; default: return (this.data && this.data[t]) || null } } setval(t, e) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": return $persistentStore.write(t, e); case "Quantumult X": return $prefs.setValueForKey(t, e); case "Node.js": return ((this.data = this.loaddata()), (this.data[e] = t), this.writedata(), !0); default: return (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 = () => { }) { switch ((t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"], delete t.headers["content-type"], delete t.headers["content-length"]), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: this.isSurge() && this.isNeedRewrite && ((t.headers = t.headers || {}), Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, a) => { !t && s && ((s.body = a), (s.statusCode = s.status ? s.status : s.statusCode), (s.status = s.statusCode)), e(t, s, a) }); break; case "Quantumult X": this.isNeedRewrite && ((t.opts = t.opts || {}), Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then((t) => { const { statusCode: s, statusCode: a, headers: r, body: i, bodyBytes: o, } = t; e(null, { status: s, statusCode: a, headers: r, body: i, bodyBytes: o, }, i, o) }, (t) => e((t && t.error) || "UndefinedError")); break; case "Node.js": let s = require("iconv-lite"); 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: a, statusCode: r, headers: i, rawBody: o, } = t, n = s.decode(o, this.encoding); e(null, { status: a, statusCode: r, headers: i, rawBody: o, body: n, }, n) }, (t) => { const { message: a, response: r } = t; e(a, r, r && s.decode(r.rawBody, this.encoding)) }) } } post(t, e = () => { }) { const s = t.method ? t.method.toLocaleLowerCase() : "post"; switch ((t.body && t.headers && !t.headers["Content-Type"] && !t.headers["content-type"] && (t.headers["content-type"] = "application/x-www-form-urlencoded"), t.headers && (delete t.headers["Content-Length"], delete t.headers["content-length"]), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: this.isSurge() && this.isNeedRewrite && ((t.headers = t.headers || {}), Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient[s](t, (t, s, a) => { !t && s && ((s.body = a), (s.statusCode = s.status ? s.status : s.statusCode), (s.status = s.statusCode)), e(t, s, a) }); break; case "Quantumult X": (t.method = s), this.isNeedRewrite && ((t.opts = t.opts || {}), Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then((t) => { const { statusCode: s, statusCode: a, headers: r, body: i, bodyBytes: o, } = t; e(null, { status: s, statusCode: a, headers: r, body: i, bodyBytes: o, }, i, o) }, (t) => e((t && t.error) || "UndefinedError")); break; case "Node.js": let a = require("iconv-lite"); this.initGotEnv(t); const { url: r, ...i } = t; this.got[s](r, i).then((t) => { const { statusCode: s, statusCode: r, headers: i, rawBody: o, } = t, n = a.decode(o, this.encoding); e(null, { status: s, statusCode: r, headers: i, rawBody: o, body: n }, n) }, (t) => { const { message: s, response: r } = t; e(s, r, r && a.decode(r.rawBody, this.encoding)) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date(); let a = { "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 a) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? a[e] : ("00" + a[e]).substr(("" + a[e]).length))); return t } queryStr(t) { let e = ""; for (const s in t) { let a = t[s]; null != a && "" !== a && ("object" == typeof a && (a = JSON.stringify(a)), (e += `${s}=${a}&`)) } return (e = e.substring(0, e.length - 1)), e } msg(e = t, s = "", a = "", r) { const i = (t) => { switch (typeof t) { case void 0: return t; case "string": switch (this.getEnv()) { case "Surge": case "Stash": default: return { url: t }; case "Loon": case "Shadowrocket": return t; case "Quantumult X": return { "open-url": t }; case "Node.js": return }case "object": switch (this.getEnv()) { case "Surge": case "Stash": case "Shadowrocket": default: { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } case "Loon": { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } case "Quantumult X": { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl, a = t["update-pasteboard"] || t.updatePasteboard; return { "open-url": e, "media-url": s, "update-pasteboard": a, } } case "Node.js": return }default: return } }; if (!this.isMute) switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: $notification.post(e, s, a, i(r)); break; case "Quantumult X": $notify(e, s, a, i(r)); break; case "Node.js": }if (!this.isMuteLog) { let t = ["", "==============📣系统通知📣==============",]; t.push(e), s && t.push(s), a && t.push(a), 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) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": case "Quantumult X": default: this.log("", `❗️${this.name},错误!`, t); break; case "Node.js": this.log("", `❗️${this.name},错误!`, t.stack) } } wait(t) { return new Promise((e) => setTimeout(e, t)) } DoubleLog(d) { if (this.isNode()) { if (d) { console.log(`${d}`); msg += `\n ${d}` } } else { console.log(`${d}`); msg += `\n ${d}` } } async SendMsg(m) { if (!m) return; if (Notify > 0) { if (this.isNode()) { var notify = require("./sendNotify"); await notify.sendNotify(this.name, m) } else { this.msg(this.name, "", m) } } else { console.log(m) } } done(t = {}) { const e = new Date().getTime(), s = (e - this.startTime) / 1e3; switch ((this.log("", `🔔${this.name},结束!🕛${s}秒`), this.log(), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": case "Quantumult X": default: $done(t); break; case "Node.js": process.exit(1) } } })(t, e) } 248 | //Env rewrite:smallfawn Update-time:23-6-30 newAdd:DoubleLog & SendMsg -------------------------------------------------------------------------------- /fsdlb.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 逢三得利吧 3 | * Fsdlb 4 | * Author: Mist 5 | * Date: 2024-07-05 6 | * cron "58 59 1 * * *" fsdlb.js 7 | * export fsdlb= Authorization 多账号换行或者#分隔 8 | */ 9 | // ============================================================================================================ 10 | const $ = new Env('逢三得利吧') 11 | const axios = require('axios') 12 | const env_name = 'fsdlb' //环境变量名字 13 | const env = process.env[env_name] || '' 14 | const Notify = 1 15 | const debug = 0 16 | let scriptVersionNow = "1.0.0"; 17 | let msg = ""; 18 | // ==================================异步顺序============================================================================== 19 | !(async () => { 20 | await getNotice(); 21 | await getVersion("yang7758258/ohhh154@main/fsdlb.js"); 22 | await main(); 23 | await SendMsg(msg); 24 | 25 | })() 26 | .catch((e) => $.logErr(e)) 27 | .finally(() => $.done()); 28 | //==================================脚本入口函数main()============================================================== 29 | 30 | async function main() { 31 | if (env == '') { 32 | //没有设置变量,直接退出 33 | console.log(`没有填写变量,请查看脚本说明: ${env_name}`) 34 | return 35 | } 36 | let user_ck = env.split('\n') 37 | DoubleLog(`\n========= 共找到 ${user_ck.length} 个账号 =========`); 38 | let index = 1 //用来给账号标记序号, 从1开始 39 | for (let ck of user_ck) { 40 | if (!ck) continue //跳过空行 41 | let ck_info = ck.split('&') 42 | let Authorization = ck_info[0] 43 | //let ticket = ck_info[1] 44 | //let deviceCode = ck_info[2] 45 | let user = { 46 | index: index, 47 | Authorization, 48 | //ticket, 49 | //deviceCode, 50 | } 51 | index = index + 1 //每次用完序号+1 52 | //开始账号任务 53 | let Run = new run(user); 54 | await Run.userTask(user) 55 | //每个账号之间等1~5秒随机时间 56 | let rnd_time = Math.floor(Math.random() * 4000) + 1000 57 | console.log(`随机等待${rnd_time / 1000}秒...`) 58 | await $.wait(rnd_time) 59 | } 60 | } 61 | // ======================================开始任务========================================= 62 | class run { 63 | constructor(user) { 64 | let timestamp = Date.now() 65 | this.headers = { 66 | "X-VERSION": "2.1.3", 67 | "Authorization": `${user.Authorization}`, 68 | "HH-VERSION": "0.2.8", 69 | "HH-FROM": "20230130307725", 70 | "HH-APP": "wxb33ed03c6c715482", 71 | "HH-CI": "saas-wechat-app", 72 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36", 73 | } 74 | } 75 | async userTask(user) { 76 | console.log(`\n========= 账号[${user.index}]开始任务 =========`) 77 | await this.sign(user) 78 | await this.account(user) 79 | 80 | } 81 | // ============================================================================================================================= 82 | // 83 | async sign(user) { 84 | try { 85 | DoubleLog(`🕊账号[${user.index}] 开始签到...`); 86 | 87 | //console.log(formattedDate); 88 | let urlObject = { 89 | method: 'post', 90 | url: `https://xiaodian.miyatech.com/api/coupon/auth/signIn`, 91 | headers: this.headers, 92 | data: { 93 | "miniappId": 159 94 | } 95 | } 96 | //console.log(urlObject); 97 | let { data: result} = await axios.request(urlObject) 98 | //console.log(result); 99 | if (result?.code == 200) { 100 | //打印签到结果 101 | DoubleLog(`🕊账号[${user.index}] 签到成功:[${result.data.integralToastText}]🎉`); 102 | }else{ 103 | DoubleLog(`🕊账号[${user.index}] 签到失败:${result.msg}🚫`) 104 | } 105 | } catch (e) { 106 | console.log(e); 107 | } 108 | } 109 | 110 | // 111 | async account(user) { 112 | try { 113 | DoubleLog(`🕊账号[${user.index}] 开始查询...`); 114 | let urlObject = { 115 | method: 'get', 116 | url: `https://xiaodian.miyatech.com/api/user/auth/member/integral/union/flow/list?pageNo=1&pageSize=10&dataType=SCORE`, 117 | headers: this.headers, 118 | 119 | } 120 | //console.log(urlObject); 121 | let { data: result} = await axios.request(urlObject) 122 | //console.log(result); 123 | if (result?.code == 200) { 124 | //打印签到结果 125 | DoubleLog(`🕊账号[${user.index}] 查询成功:总积分[${result.data.totalScore}]🎉`); 126 | 127 | }else { 128 | DoubleLog(`🕊账号[${user.index}] 查询失败:${result.msg}🚫`) 129 | } 130 | } catch (e) { 131 | console.log(e); 132 | } 133 | } 134 | 135 | } 136 | /** 137 | * =========================================================发送消息============================================= 138 | */ 139 | async function SendMsg(message) { 140 | if (!message) return; 141 | if (Notify > 0) { 142 | if ($.isNode()) { 143 | var notify = require("./sendNotify"); 144 | await notify.sendNotify($.name, message); 145 | } else { 146 | // $.msg(message); 147 | $.msg($.name, '', message) 148 | } 149 | } else { 150 | console.log(message); 151 | } 152 | } 153 | /** 154 | * =====================================================双平台log输出========================================== 155 | */ 156 | function DoubleLog(data) { 157 | if ($.isNode()) { 158 | if (data) { 159 | console.log(`${data}`); 160 | msg += `\n${data}`; 161 | } 162 | } else { 163 | console.log(`${data}`); 164 | msg += `\n${data}`; 165 | } 166 | 167 | } 168 | /** 169 | * ======================================================等待 X 秒============================================ 170 | */ 171 | function wait(n) { 172 | return new Promise(function (resolve) { 173 | setTimeout(resolve, n * 1000); 174 | }); 175 | } 176 | /** 177 | * ======================================================随机等待 1-5 秒============================================ 178 | */ 179 | function sjwait() { 180 | return new Promise(function (resolve) { 181 | let waitTime = Math.floor(Math.random() * 4000 + 1000); 182 | setTimeout(resolve, waitTime); 183 | }); 184 | } 185 | // ==========================================================13位时间戳===================================================== 186 | function getTimestamp() { 187 | return new Date().getTime(); 188 | } 189 | //===============================================网络请求httpRequest========================================= 190 | function httpRequest(options, timeout = 1 * 1000) { 191 | method = options.method ? options.method.toLowerCase() : options.body ? "post" : "get"; 192 | return new Promise(resolve => { 193 | setTimeout(() => { 194 | $[method](options, (err, resp, data) => { 195 | try { 196 | if (err) { 197 | console.log(JSON.stringify(err)); 198 | $.logErr(err); 199 | } else { 200 | try { data = JSON.parse(data); } catch (error) { } 201 | } 202 | } catch (e) { 203 | console.log(e); 204 | $.logErr(e, resp); 205 | } finally { 206 | resolve(data); 207 | } 208 | }) 209 | }, timeout) 210 | }) 211 | } 212 | //==============================================Debug模式=============================================== 213 | function debugLog(...args) { 214 | if (debug) { 215 | console.log(...args); 216 | } 217 | } 218 | //===============================================获取远程通知======================================== 219 | async function getNotice() { 220 | try { 221 | const urls = [ 222 | "https://gitee.com/ohhhooh/jd_haoyangmao/raw/master/Notice.json", 223 | 224 | ]; 225 | let notice = null; 226 | for (const url of urls) { 227 | const options = { url, headers: { "User-Agent": "" }, }; 228 | const result = await httpRequest(options); 229 | if (result && "notice" in result) { 230 | notice = result.notice.replace(/\\n/g, "\n"); 231 | break; 232 | } 233 | } 234 | if (notice) { $.DoubleLog(notice); } 235 | } catch (e) { 236 | console.log(e); 237 | } 238 | } 239 | //==============================================获取远程版本================================================= 240 | function getVersion(scriptUrl, timeout = 3 * 1000) { 241 | return new Promise((resolve) => { 242 | const options = { url: `https://fastly.jsdelivr.net/gh/${scriptUrl}` }; 243 | $.get(options, (err, resp, data) => { 244 | try { 245 | const regex = /scriptVersionNow\s*=\s*(["'`])([\d.]+)\1/; 246 | const match = data.match(regex); 247 | const scriptVersionLatest = match ? match[2] : ""; 248 | DoubleLog(`\n当前版本:[${scriptVersionNow}]>>>云端☁️版本:[${scriptVersionLatest}]`); 249 | } catch (e) { 250 | $.logErr(e, resp); 251 | } 252 | resolve(); 253 | }, timeout); 254 | }); 255 | } 256 | 257 | //=============================================================================================================================================== 258 | //================================================固定API=============================================================================================== 259 | 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, a) => { s.call(this, t, (t, s, r) => { t ? a(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.userList = []; this.userIdx = 0; (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},开始!`) } getEnv() { return "undefined" != typeof $environment && $environment["surge-version"] ? "Surge" : "undefined" != typeof $environment && $environment["stash-version"] ? "Stash" : "undefined" != typeof module && module.exports ? "Node.js" : "undefined" != typeof $task ? "Quantumult X" : "undefined" != typeof $loon ? "Loon" : "undefined" != typeof $rocket ? "Shadowrocket" : void 0 } isNode() { return "Node.js" === this.getEnv() } isQuanX() { return "Quantumult X" === this.getEnv() } isSurge() { return "Surge" === this.getEnv() } isLoon() { return "Loon" === this.getEnv() } isShadowrocket() { return "Shadowrocket" === this.getEnv() } isStash() { return "Stash" === this.getEnv() } 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 a = this.getdata(t); if (a) 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, a) => e(a)) }) } runScript(t, e) { return new Promise((s) => { let a = this.getdata("@chavy_boxjs_userCfgs.httpapi"); a = a ? a.replace(/\n/g, "").trim() : a; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); (r = r ? 1 * r : 20), (r = e && e.timeout ? e.timeout : r); const [i, o] = a.split("@"), n = { url: `http://${o}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": i, Accept: "*/*" }, timeout: r, }; this.post(n, (t, e, a) => s(a)) }).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), a = !s && this.fs.existsSync(e); if (!s && !a) return {}; { const a = s ? t : e; try { return JSON.parse(this.fs.readFileSync(a)) } 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), a = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : a ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const a = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of a) 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, a) => Object(t[s]) === t[s] ? t[s] : (t[s] = Math.abs(e[a + 1]) >> 0 == +e[a + 1] ? [] : {}), t)[e[e.length - 1]] = s), t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, a] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, a, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, a, r] = /^@(.*?)\.(.*?)$/.exec(e), i = this.getval(a), o = a ? ("null" === i ? null : i || "{}") : "{}"; try { const e = JSON.parse(o); this.lodash_set(e, r, t), (s = this.setval(JSON.stringify(e), a)) } catch (e) { const i = {}; this.lodash_set(i, r, t), (s = this.setval(JSON.stringify(i), a)) } } else s = this.setval(t, e); return s } getval(t) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": return $persistentStore.read(t); case "Quantumult X": return $prefs.valueForKey(t); case "Node.js": return (this.data = this.loaddata()), this.data[t]; default: return (this.data && this.data[t]) || null } } setval(t, e) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": return $persistentStore.write(t, e); case "Quantumult X": return $prefs.setValueForKey(t, e); case "Node.js": return ((this.data = this.loaddata()), (this.data[e] = t), this.writedata(), !0); default: return (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 = () => { }) { switch ((t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"], delete t.headers["content-type"], delete t.headers["content-length"]), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: this.isSurge() && this.isNeedRewrite && ((t.headers = t.headers || {}), Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, a) => { !t && s && ((s.body = a), (s.statusCode = s.status ? s.status : s.statusCode), (s.status = s.statusCode)), e(t, s, a) }); break; case "Quantumult X": this.isNeedRewrite && ((t.opts = t.opts || {}), Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then((t) => { const { statusCode: s, statusCode: a, headers: r, body: i, bodyBytes: o, } = t; e(null, { status: s, statusCode: a, headers: r, body: i, bodyBytes: o, }, i, o) }, (t) => e((t && t.error) || "UndefinedError")); break; case "Node.js": let s = require("iconv-lite"); 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: a, statusCode: r, headers: i, rawBody: o, } = t, n = s.decode(o, this.encoding); e(null, { status: a, statusCode: r, headers: i, rawBody: o, body: n, }, n) }, (t) => { const { message: a, response: r } = t; e(a, r, r && s.decode(r.rawBody, this.encoding)) }) } } post(t, e = () => { }) { const s = t.method ? t.method.toLocaleLowerCase() : "post"; switch ((t.body && t.headers && !t.headers["Content-Type"] && !t.headers["content-type"] && (t.headers["content-type"] = "application/x-www-form-urlencoded"), t.headers && (delete t.headers["Content-Length"], delete t.headers["content-length"]), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: this.isSurge() && this.isNeedRewrite && ((t.headers = t.headers || {}), Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient[s](t, (t, s, a) => { !t && s && ((s.body = a), (s.statusCode = s.status ? s.status : s.statusCode), (s.status = s.statusCode)), e(t, s, a) }); break; case "Quantumult X": (t.method = s), this.isNeedRewrite && ((t.opts = t.opts || {}), Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then((t) => { const { statusCode: s, statusCode: a, headers: r, body: i, bodyBytes: o, } = t; e(null, { status: s, statusCode: a, headers: r, body: i, bodyBytes: o, }, i, o) }, (t) => e((t && t.error) || "UndefinedError")); break; case "Node.js": let a = require("iconv-lite"); this.initGotEnv(t); const { url: r, ...i } = t; this.got[s](r, i).then((t) => { const { statusCode: s, statusCode: r, headers: i, rawBody: o, } = t, n = a.decode(o, this.encoding); e(null, { status: s, statusCode: r, headers: i, rawBody: o, body: n }, n) }, (t) => { const { message: s, response: r } = t; e(s, r, r && a.decode(r.rawBody, this.encoding)) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date(); let a = { "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 a) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? a[e] : ("00" + a[e]).substr(("" + a[e]).length))); return t } queryStr(t) { let e = ""; for (const s in t) { let a = t[s]; null != a && "" !== a && ("object" == typeof a && (a = JSON.stringify(a)), (e += `${s}=${a}&`)) } return (e = e.substring(0, e.length - 1)), e } msg(e = t, s = "", a = "", r) { const i = (t) => { switch (typeof t) { case void 0: return t; case "string": switch (this.getEnv()) { case "Surge": case "Stash": default: return { url: t }; case "Loon": case "Shadowrocket": return t; case "Quantumult X": return { "open-url": t }; case "Node.js": return }case "object": switch (this.getEnv()) { case "Surge": case "Stash": case "Shadowrocket": default: { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } case "Loon": { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } case "Quantumult X": { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl, a = t["update-pasteboard"] || t.updatePasteboard; return { "open-url": e, "media-url": s, "update-pasteboard": a, } } case "Node.js": return }default: return } }; if (!this.isMute) switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: $notification.post(e, s, a, i(r)); break; case "Quantumult X": $notify(e, s, a, i(r)); break; case "Node.js": }if (!this.isMuteLog) { let t = ["", "==============📣系统通知📣==============",]; t.push(e), s && t.push(s), a && t.push(a), 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) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": case "Quantumult X": default: this.log("", `❗️${this.name},错误!`, t); break; case "Node.js": this.log("", `❗️${this.name},错误!`, t.stack) } } wait(t) { return new Promise((e) => setTimeout(e, t)) } DoubleLog(d) { if (this.isNode()) { if (d) { console.log(`${d}`); msg += `\n ${d}` } } else { console.log(`${d}`); msg += `\n ${d}` } } async SendMsg(m) { if (!m) return; if (Notify > 0) { if (this.isNode()) { var notify = require("../sendNotify"); await notify.sendNotify(this.name, m) } else { this.msg(this.name, "", m) } } else { console.log(m) } } done(t = {}) { const e = new Date().getTime(), s = (e - this.startTime) / 1e3; switch ((this.log("", `🔔${this.name},结束!🕛${s}秒`), this.log(), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": case "Quantumult X": default: $done(t); break; case "Node.js": process.exit(1) } } })(t, e) } 260 | //Env rewrite:smallfawn Update-time:23-6-30 newAdd:DoubleLog & SendMsg -------------------------------------------------------------------------------- /glg.js: -------------------------------------------------------------------------------- 1 | /** 2 | * vx格力高 3 | * glg 4 | * Author: Mist 5 | * Date: 2024-06-25 6 | * cron "30 7 * * *" zwxq.js 7 | * export glg= 'X-Auth-Token' 多账号换行或者#分隔 8 | */ 9 | // ============================================================================================================ 10 | const $ = new Env('vx格力高') 11 | const axios = require('axios') 12 | //const md5 = require('md5') 13 | const env_name = 'glg' //环境变量名字 14 | const env = process.env[env_name] || '' //获取环境变量 15 | const Notify = 1//是否通知, 1通知, 0不通知. 默认通知 16 | const debug = 0//是否调试, 1调试, 0不调试. 默认不调试 17 | let scriptVersionNow = "1.0.0";//脚本版本号 18 | let msg = ""; 19 | // ==================================异步顺序============================================================================== 20 | !(async () => { 21 | await getNotice(); //远程通知 22 | await getVersion("yang7758258/ohhh154@main/glg.js"); 23 | await main();//主函数 24 | await SendMsg(msg); //发送通知 25 | 26 | })() 27 | .catch((e) => $.logErr(e)) 28 | .finally(() => $.done()); 29 | //==================================脚本入口函数main()============================================================== 30 | async function main() { 31 | if (env == '') { 32 | //没有设置变量,直接退出 33 | console.log(`没有填写变量,请查看脚本说明: ${env_name}`) 34 | return 35 | } 36 | let user_ck = env.split('\n') 37 | DoubleLog(`\n========== 共找到 ${user_ck.length} 个账号 ==========`); 38 | let index = 1 //用来给账号标记序号, 从1开始 39 | for (let ck of user_ck) { 40 | if (!ck) continue //跳过空行 41 | let ck_info = ck.split('&') 42 | let Token = ck_info[0] 43 | let user = { 44 | index: index, 45 | Token, 46 | 47 | } 48 | index = index + 1 //每次用完序号+1 49 | //开始账号任务 50 | await userTask(user) 51 | //每个账号之间等1~5秒随机时间 52 | let rnd_time = Math.floor(Math.random() * 4000) + 1000 53 | console.log(`账号[${user.index}]随机等待${rnd_time / 1000}秒...`) 54 | await $.wait(rnd_time) 55 | } 56 | } 57 | // ======================================开始任务========================================= 58 | async function userTask(user) { 59 | console.log(`\n============= 账号[${user.index}]开始任务 =============`) 60 | await Sign(user) 61 | await wait (1) 62 | await Draw(user) 63 | } 64 | // ============================================================================================================================= 65 | //登入 66 | async function Sign(user) { 67 | try { 68 | let urlObject = { 69 | method: 'put', 70 | url: `https://crm.glico.cn/miniapp/member/checkin`, 71 | headers: { 72 | 'Host': 'crm.glico.cn', 73 | 'X-Auth-Token': user.Token, 74 | 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090b11) XWEB/9129', 75 | }, 76 | data:{ 77 | 78 | } 79 | }; 80 | //console.log(urlObject); 81 | let { data: result} = await axios.request(urlObject) 82 | //let Token = result.Data.MemberInfo.Token; 83 | //console.log(result); 84 | if (result?.code == 0 ) { 85 | //打印签到结果 86 | DoubleLog(`🌸账号[${user.index}]` + `🕊签到成功-[${result}]🎉`); 87 | }else{ 88 | DoubleLog(`🌸账号[${user.index}]签到-失败:${result.msg}❌`) 89 | } 90 | return result.Data.MemberInfo.Token; 91 | } catch (e) { 92 | //打印错误信息 93 | console.log('以下是报错输出:'); 94 | DoubleLog(e.response.data); 95 | } 96 | } 97 | //抽奖 98 | async function Draw(user) { 99 | try { 100 | let urlObject = { 101 | method: 'post', 102 | url: `https://crm.glico.cn/miniapp/member/lotteries/submit/7309645?addressId`, 103 | headers: { 104 | 'Host': 'crm.glico.cn', 105 | 'X-Auth-Token': user.Token, 106 | 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090b11) XWEB/9129', 107 | }, 108 | data:{ 109 | 110 | } 111 | } 112 | // 113 | let { data: result} = await axios.request(urlObject) 114 | //console.log(urlObject); 115 | //console.log(result); 116 | if (result.code == 0) { 117 | //打印签到结果 118 | DoubleLog(`🌸账号[${user.index}]🕊抽奖成功-获得${result}🎉`); 119 | }else { 120 | DoubleLog(`🌸账号[${user.index}]🕊抽奖:${result.msg}❌`) 121 | } 122 | } catch (e) { 123 | //打印错误信息 124 | DoubleLog(e.response.data); 125 | } 126 | } 127 | 128 | /** 129 | * =========================================================发送消息============================================= 130 | */ 131 | async function SendMsg(message) { 132 | if (!message) return; 133 | if (Notify > 0) { 134 | if ($.isNode()) { 135 | var notify = require("./sendNotify"); 136 | await notify.sendNotify($.name, message); 137 | } else { 138 | // $.msg(message); 139 | $.msg($.name, '', message) 140 | } 141 | } else { 142 | console.log(message); 143 | } 144 | } 145 | /** 146 | * =====================================================双平台log输出========================================== 147 | */ 148 | function DoubleLog(data) { 149 | if ($.isNode()) { 150 | if (data) { 151 | console.log(`${data}`); 152 | msg += `\n${data}`; 153 | } 154 | } else { 155 | console.log(`${data}`); 156 | msg += `\n${data}`; 157 | } 158 | 159 | } 160 | /** 161 | * ======================================================等待 X 秒============================================ 162 | */ 163 | function wait(n) { 164 | return new Promise(function (resolve) { 165 | setTimeout(resolve, n * 1000); 166 | }); 167 | } 168 | /** 169 | * ======================================================随机等待 1-5 秒============================================ 170 | */ 171 | function sjwait() { 172 | return new Promise(function (resolve) { 173 | let waitTime = Math.floor(Math.random() * 4000 + 1000); 174 | setTimeout(resolve, waitTime); 175 | }); 176 | } 177 | // ==========================================================13位时间戳===================================================== 178 | function getTimestamp() { 179 | return new Date().getTime(); 180 | } 181 | //===============================================网络请求httpRequest========================================= 182 | function httpRequest(options, timeout = 1 * 1000) { 183 | method = options.method ? options.method.toLowerCase() : options.body ? "post" : "get"; 184 | return new Promise(resolve => { 185 | setTimeout(() => { 186 | $[method](options, (err, resp, data) => { 187 | try { 188 | if (err) { 189 | console.log(JSON.stringify(err)); 190 | $.logErr(err); 191 | } else { 192 | try { data = JSON.parse(data); } catch (error) { } 193 | } 194 | } catch (e) { 195 | console.log(e); 196 | $.logErr(e, resp); 197 | } finally { 198 | resolve(data); 199 | } 200 | }) 201 | }, timeout) 202 | }) 203 | } 204 | //==============================================Debug模式=============================================== 205 | function debugLog(...args) { 206 | if (debug) { 207 | console.log(...args); 208 | } 209 | } 210 | //===============================================获取远程通知======================================== 211 | async function getNotice() { 212 | try { 213 | const urls = [ 214 | "https://gitee.com/ohhhooh/jd_haoyangmao/raw/master/Notice.json", 215 | 216 | ]; 217 | let notice = null; 218 | for (const url of urls) { 219 | const options = { url, headers: { "User-Agent": "" }, }; 220 | const result = await httpRequest(options); 221 | if (result && "notice" in result) { 222 | notice = result.notice.replace(/\\n/g, "\n"); 223 | break; 224 | } 225 | } 226 | if (notice) { $.DoubleLog(notice); } 227 | } catch (e) { 228 | console.log(e); 229 | } 230 | } 231 | //==============================================获取远程版本================================================= 232 | function getVersion(scriptUrl, timeout = 3 * 1000) { 233 | return new Promise((resolve) => { 234 | const options = { url: `https://fastly.jsdelivr.net/gh/${scriptUrl}` }; 235 | $.get(options, (err, resp, data) => { 236 | try { 237 | const regex = /scriptVersionNow\s*=\s*(["'`])([\d.]+)\1/; 238 | const match = data.match(regex); 239 | const scriptVersionLatest = match ? match[2] : ""; 240 | console.log(`\n============= 当前版本:${scriptVersionNow} 🌟 最新版本:${scriptVersionLatest} =============`); 241 | } catch (e) { 242 | $.logErr(e, resp); 243 | } 244 | resolve(); 245 | }, timeout); 246 | }); 247 | } 248 | 249 | //=============================================================================================================================================== 250 | //================================================固定API=============================================================================================== 251 | 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, a) => { s.call(this, t, (t, s, r) => { t ? a(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.userList = []; this.userIdx = 0; (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},开始!`) } getEnv() { return "undefined" != typeof $environment && $environment["surge-version"] ? "Surge" : "undefined" != typeof $environment && $environment["stash-version"] ? "Stash" : "undefined" != typeof module && module.exports ? "Node.js" : "undefined" != typeof $task ? "Quantumult X" : "undefined" != typeof $loon ? "Loon" : "undefined" != typeof $rocket ? "Shadowrocket" : void 0 } isNode() { return "Node.js" === this.getEnv() } isQuanX() { return "Quantumult X" === this.getEnv() } isSurge() { return "Surge" === this.getEnv() } isLoon() { return "Loon" === this.getEnv() } isShadowrocket() { return "Shadowrocket" === this.getEnv() } isStash() { return "Stash" === this.getEnv() } 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 a = this.getdata(t); if (a) 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, a) => e(a)) }) } runScript(t, e) { return new Promise((s) => { let a = this.getdata("@chavy_boxjs_userCfgs.httpapi"); a = a ? a.replace(/\n/g, "").trim() : a; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); (r = r ? 1 * r : 20), (r = e && e.timeout ? e.timeout : r); const [i, o] = a.split("@"), n = { url: `http://${o}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": i, Accept: "*/*" }, timeout: r, }; this.post(n, (t, e, a) => s(a)) }).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), a = !s && this.fs.existsSync(e); if (!s && !a) return {}; { const a = s ? t : e; try { return JSON.parse(this.fs.readFileSync(a)) } 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), a = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : a ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const a = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of a) 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, a) => Object(t[s]) === t[s] ? t[s] : (t[s] = Math.abs(e[a + 1]) >> 0 == +e[a + 1] ? [] : {}), t)[e[e.length - 1]] = s), t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, a] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, a, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, a, r] = /^@(.*?)\.(.*?)$/.exec(e), i = this.getval(a), o = a ? ("null" === i ? null : i || "{}") : "{}"; try { const e = JSON.parse(o); this.lodash_set(e, r, t), (s = this.setval(JSON.stringify(e), a)) } catch (e) { const i = {}; this.lodash_set(i, r, t), (s = this.setval(JSON.stringify(i), a)) } } else s = this.setval(t, e); return s } getval(t) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": return $persistentStore.read(t); case "Quantumult X": return $prefs.valueForKey(t); case "Node.js": return (this.data = this.loaddata()), this.data[t]; default: return (this.data && this.data[t]) || null } } setval(t, e) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": return $persistentStore.write(t, e); case "Quantumult X": return $prefs.setValueForKey(t, e); case "Node.js": return ((this.data = this.loaddata()), (this.data[e] = t), this.writedata(), !0); default: return (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 = () => { }) { switch ((t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"], delete t.headers["content-type"], delete t.headers["content-length"]), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: this.isSurge() && this.isNeedRewrite && ((t.headers = t.headers || {}), Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, a) => { !t && s && ((s.body = a), (s.statusCode = s.status ? s.status : s.statusCode), (s.status = s.statusCode)), e(t, s, a) }); break; case "Quantumult X": this.isNeedRewrite && ((t.opts = t.opts || {}), Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then((t) => { const { statusCode: s, statusCode: a, headers: r, body: i, bodyBytes: o, } = t; e(null, { status: s, statusCode: a, headers: r, body: i, bodyBytes: o, }, i, o) }, (t) => e((t && t.error) || "UndefinedError")); break; case "Node.js": let s = require("iconv-lite"); 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: a, statusCode: r, headers: i, rawBody: o, } = t, n = s.decode(o, this.encoding); e(null, { status: a, statusCode: r, headers: i, rawBody: o, body: n, }, n) }, (t) => { const { message: a, response: r } = t; e(a, r, r && s.decode(r.rawBody, this.encoding)) }) } } post(t, e = () => { }) { const s = t.method ? t.method.toLocaleLowerCase() : "post"; switch ((t.body && t.headers && !t.headers["Content-Type"] && !t.headers["content-type"] && (t.headers["content-type"] = "application/x-www-form-urlencoded"), t.headers && (delete t.headers["Content-Length"], delete t.headers["content-length"]), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: this.isSurge() && this.isNeedRewrite && ((t.headers = t.headers || {}), Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient[s](t, (t, s, a) => { !t && s && ((s.body = a), (s.statusCode = s.status ? s.status : s.statusCode), (s.status = s.statusCode)), e(t, s, a) }); break; case "Quantumult X": (t.method = s), this.isNeedRewrite && ((t.opts = t.opts || {}), Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then((t) => { const { statusCode: s, statusCode: a, headers: r, body: i, bodyBytes: o, } = t; e(null, { status: s, statusCode: a, headers: r, body: i, bodyBytes: o, }, i, o) }, (t) => e((t && t.error) || "UndefinedError")); break; case "Node.js": let a = require("iconv-lite"); this.initGotEnv(t); const { url: r, ...i } = t; this.got[s](r, i).then((t) => { const { statusCode: s, statusCode: r, headers: i, rawBody: o, } = t, n = a.decode(o, this.encoding); e(null, { status: s, statusCode: r, headers: i, rawBody: o, body: n }, n) }, (t) => { const { message: s, response: r } = t; e(s, r, r && a.decode(r.rawBody, this.encoding)) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date(); let a = { "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 a) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? a[e] : ("00" + a[e]).substr(("" + a[e]).length))); return t } queryStr(t) { let e = ""; for (const s in t) { let a = t[s]; null != a && "" !== a && ("object" == typeof a && (a = JSON.stringify(a)), (e += `${s}=${a}&`)) } return (e = e.substring(0, e.length - 1)), e } msg(e = t, s = "", a = "", r) { const i = (t) => { switch (typeof t) { case void 0: return t; case "string": switch (this.getEnv()) { case "Surge": case "Stash": default: return { url: t }; case "Loon": case "Shadowrocket": return t; case "Quantumult X": return { "open-url": t }; case "Node.js": return }case "object": switch (this.getEnv()) { case "Surge": case "Stash": case "Shadowrocket": default: { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } case "Loon": { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } case "Quantumult X": { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl, a = t["update-pasteboard"] || t.updatePasteboard; return { "open-url": e, "media-url": s, "update-pasteboard": a, } } case "Node.js": return }default: return } }; if (!this.isMute) switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: $notification.post(e, s, a, i(r)); break; case "Quantumult X": $notify(e, s, a, i(r)); break; case "Node.js": }if (!this.isMuteLog) { let t = ["", "==============📣系统通知📣==============",]; t.push(e), s && t.push(s), a && t.push(a), 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) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": case "Quantumult X": default: this.log("", `❗️${this.name},错误!`, t); break; case "Node.js": this.log("", `❗️${this.name},错误!`, t.stack) } } wait(t) { return new Promise((e) => setTimeout(e, t)) } DoubleLog(d) { if (this.isNode()) { if (d) { console.log(`${d}`); msg += `\n ${d}` } } else { console.log(`${d}`); msg += `\n ${d}` } } async SendMsg(m) { if (!m) return; if (Notify > 0) { if (this.isNode()) { var notify = require("./sendNotify"); await notify.sendNotify(this.name, m) } else { this.msg(this.name, "", m) } } else { console.log(m) } } done(t = {}) { const e = new Date().getTime(), s = (e - this.startTime) / 1e3; switch ((this.log("", `🔔${this.name},结束!🕛${s}秒`), this.log(), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": case "Quantumult X": default: $done(t); break; case "Node.js": process.exit(1) } } })(t, e) } 252 | //Env rewrite:smallfawn Update-time:23-6-30 newAdd:DoubleLog & SendMsg 253 | -------------------------------------------------------------------------------- /gljj.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 国乐酱酒 签到得酒 3 | * Gljj 4 | * Author: Mist 5 | * Date: 2024-07-05 6 | * cron "0 7 * * *" gljj.js 7 | * export gljj= Authorization 多账号换行或者#分隔 8 | */ 9 | // ============================================================================================================ 10 | const $ = new Env('国乐酱酒') 11 | const axios = require('axios') 12 | const env_name = 'gljj' //环境变量名字 13 | const env = process.env[env_name] || '' 14 | const Notify = 1 15 | const debug = 0 16 | let scriptVersionNow = "1.0.0"; 17 | let msg = ""; 18 | // ==================================异步顺序============================================================================== 19 | !(async () => { 20 | await getNotice(); 21 | await getVersion("yang7758258/ohhh154@main/gljj.js"); 22 | await main(); 23 | await SendMsg(msg); 24 | 25 | })() 26 | .catch((e) => $.logErr(e)) 27 | .finally(() => $.done()); 28 | //==================================脚本入口函数main()============================================================== 29 | 30 | async function main() { 31 | if (env == '') { 32 | //没有设置变量,直接退出 33 | console.log(`没有填写变量,请查看脚本说明: ${env_name}🚳`) 34 | return 35 | } 36 | let user_ck = env.split('\n') 37 | DoubleLog(`\n========= 共找到 ${user_ck.length} 个账号 =========`); 38 | let index = 1 //用来给账号标记序号, 从1开始 39 | for (let ck of user_ck) { 40 | if (!ck) continue //跳过空行 41 | let ck_info = ck.split('&') 42 | let Authorization = ck_info[0] 43 | //let unionid = ck_info[1] 44 | //let deviceCode = ck_info[2] 45 | let user = { 46 | index: index, 47 | Authorization, 48 | //unionid, 49 | //deviceCode, 50 | } 51 | index = index + 1 //每次用完序号+1 52 | //开始账号任务 53 | let Run = new run(user); 54 | await Run.userTask(user) 55 | //每个账号之间等1~5秒随机时间 56 | let rnd_time = Math.floor(Math.random() * 4000) + 1000 57 | console.log(`随机等待${rnd_time / 1000}秒...`) 58 | await $.wait(rnd_time) 59 | } 60 | } 61 | // ======================================开始任务========================================= 62 | class run { 63 | constructor(user) { 64 | this.headers = { 65 | "Authorization": user.Authorization, 66 | "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.48(0x18003030) NetType/WIFI Language/zh_CN", 67 | } 68 | 69 | } 70 | async userTask(user) { 71 | console.log(`\n========= 账号[${user.index}]开始任务 =========`) 72 | await this.sign(user) 73 | if (this.mist >= 7) { 74 | DoubleLog(`账号[${user.index}] 签到天数大于等于7天,快去领酒🍺`); 75 | } 76 | } 77 | // ============================================================================================================================= 78 | // 79 | async sign(user) { 80 | try { 81 | DoubleLog(`🕊账号[${user.index}] 开始签到任务...`); 82 | 83 | //console.log(formattedDate); 84 | let urlObject = { 85 | method: 'get', 86 | url: `https://member.guoyuejiu.com/api/sign/daily/sign`, 87 | headers: this.headers, 88 | 89 | } 90 | //console.log(urlObject); 91 | let { data: result} = await axios.request(urlObject) 92 | //console.log(result); 93 | if (result?.code == 0) { 94 | //打印签到结果 95 | DoubleLog(`🕊账号[${user.index}] 签到成功:签到[${result.data.spanSumDays}]天🎉`); 96 | this.mist = result.data.spanSumDays 97 | }else{ 98 | DoubleLog(`🕊账号[${user.index}] 签到失败:${result.message}⛔`) 99 | } 100 | } catch (e) { 101 | console.log(e); 102 | } 103 | } 104 | 105 | // 106 | async account(user) { 107 | try { 108 | DoubleLog(`🕊账号[${user.index}] 开始查询任务...`); 109 | let urlObject = { 110 | method: 'get', 111 | url: `https://apiserver.chinagoods.com/growth/score/record/page?pageNo=1&pageSize=10&month=7&year=2024&userType=BUYER`, 112 | headers: this.headers, 113 | 114 | } 115 | //console.log(urlObject); 116 | let { data: result} = await axios.request(urlObject) 117 | //console.log(result); 118 | if (result?.code == '20000') { 119 | //打印签到结果 120 | DoubleLog(`🕊账号[${user.index}] 查询成功:总积分[${result.data.current}]🎉`); 121 | 122 | }else { 123 | DoubleLog(`🕊账号[${user.index}] 查询失败:${result.msg}🚫`) 124 | } 125 | } catch (e) { 126 | console.log(e); 127 | } 128 | } 129 | 130 | } 131 | /** 132 | * =========================================================发送消息============================================= 133 | */ 134 | async function SendMsg(message) { 135 | if (!message) return; 136 | if (Notify > 0) { 137 | if ($.isNode()) { 138 | var notify = require("./sendNotify"); 139 | await notify.sendNotify($.name, message); 140 | } else { 141 | // $.msg(message); 142 | $.msg($.name, '', message) 143 | } 144 | } else { 145 | console.log(message); 146 | } 147 | } 148 | /** 149 | * =====================================================双平台log输出========================================== 150 | */ 151 | function DoubleLog(data) { 152 | if ($.isNode()) { 153 | if (data) { 154 | console.log(`${data}`); 155 | msg += `\n${data}`; 156 | } 157 | } else { 158 | console.log(`${data}`); 159 | msg += `\n${data}`; 160 | } 161 | 162 | } 163 | /** 164 | * ======================================================等待 X 秒============================================ 165 | */ 166 | function wait(n) { 167 | return new Promise(function (resolve) { 168 | setTimeout(resolve, n * 1000); 169 | }); 170 | } 171 | /** 172 | * ======================================================随机等待 1-5 秒============================================ 173 | */ 174 | function sjwait() { 175 | return new Promise(function (resolve) { 176 | let waitTime = Math.floor(Math.random() * 4000 + 1000); 177 | setTimeout(resolve, waitTime); 178 | }); 179 | } 180 | // ==========================================================13位时间戳===================================================== 181 | function getTimestamp() { 182 | return new Date().getTime(); 183 | } 184 | //===============================================网络请求httpRequest========================================= 185 | function httpRequest(options, timeout = 1 * 1000) { 186 | method = options.method ? options.method.toLowerCase() : options.body ? "post" : "get"; 187 | return new Promise(resolve => { 188 | setTimeout(() => { 189 | $[method](options, (err, resp, data) => { 190 | try { 191 | if (err) { 192 | console.log(JSON.stringify(err)); 193 | $.logErr(err); 194 | } else { 195 | try { data = JSON.parse(data); } catch (error) { } 196 | } 197 | } catch (e) { 198 | console.log(e); 199 | $.logErr(e, resp); 200 | } finally { 201 | resolve(data); 202 | } 203 | }) 204 | }, timeout) 205 | }) 206 | } 207 | //==============================================Debug模式=============================================== 208 | function debugLog(...args) { 209 | if (debug) { 210 | console.log(...args); 211 | } 212 | } 213 | //===============================================获取远程通知======================================== 214 | async function getNotice() { 215 | try { 216 | const urls = [ 217 | "https://gitee.com/ohhhooh/jd_haoyangmao/raw/master/Notice.json", 218 | 219 | ]; 220 | let notice = null; 221 | for (const url of urls) { 222 | const options = { url, headers: { "User-Agent": "" }, }; 223 | const result = await httpRequest(options); 224 | if (result && "notice" in result) { 225 | notice = result.notice.replace(/\\n/g, "\n"); 226 | break; 227 | } 228 | } 229 | if (notice) { $.DoubleLog(notice); } 230 | } catch (e) { 231 | console.log(e); 232 | } 233 | } 234 | //==============================================获取远程版本================================================= 235 | function getVersion(scriptUrl, timeout = 3 * 1000) { 236 | return new Promise((resolve) => { 237 | const options = { url: `https://fastly.jsdelivr.net/gh/${scriptUrl}` }; 238 | $.get(options, (err, resp, data) => { 239 | try { 240 | const regex = /scriptVersionNow\s*=\s*(["'`])([\d.]+)\1/; 241 | const match = data.match(regex); 242 | const scriptVersionLatest = match ? match[2] : ""; 243 | DoubleLog(`\n当前版本:[${scriptVersionNow}]>>>>>云端☁️版本:[${scriptVersionLatest}]`); 244 | } catch (e) { 245 | $.logErr(e, resp); 246 | } 247 | resolve(); 248 | }, timeout); 249 | }); 250 | } 251 | 252 | //=============================================================================================================================================== 253 | //================================================固定API=============================================================================================== 254 | 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, a) => { s.call(this, t, (t, s, r) => { t ? a(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.userList = []; this.userIdx = 0; (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},开始!`) } getEnv() { return "undefined" != typeof $environment && $environment["surge-version"] ? "Surge" : "undefined" != typeof $environment && $environment["stash-version"] ? "Stash" : "undefined" != typeof module && module.exports ? "Node.js" : "undefined" != typeof $task ? "Quantumult X" : "undefined" != typeof $loon ? "Loon" : "undefined" != typeof $rocket ? "Shadowrocket" : void 0 } isNode() { return "Node.js" === this.getEnv() } isQuanX() { return "Quantumult X" === this.getEnv() } isSurge() { return "Surge" === this.getEnv() } isLoon() { return "Loon" === this.getEnv() } isShadowrocket() { return "Shadowrocket" === this.getEnv() } isStash() { return "Stash" === this.getEnv() } 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 a = this.getdata(t); if (a) 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, a) => e(a)) }) } runScript(t, e) { return new Promise((s) => { let a = this.getdata("@chavy_boxjs_userCfgs.httpapi"); a = a ? a.replace(/\n/g, "").trim() : a; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); (r = r ? 1 * r : 20), (r = e && e.timeout ? e.timeout : r); const [i, o] = a.split("@"), n = { url: `http://${o}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": i, Accept: "*/*" }, timeout: r, }; this.post(n, (t, e, a) => s(a)) }).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), a = !s && this.fs.existsSync(e); if (!s && !a) return {}; { const a = s ? t : e; try { return JSON.parse(this.fs.readFileSync(a)) } 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), a = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : a ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const a = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of a) 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, a) => Object(t[s]) === t[s] ? t[s] : (t[s] = Math.abs(e[a + 1]) >> 0 == +e[a + 1] ? [] : {}), t)[e[e.length - 1]] = s), t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, a] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, a, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, a, r] = /^@(.*?)\.(.*?)$/.exec(e), i = this.getval(a), o = a ? ("null" === i ? null : i || "{}") : "{}"; try { const e = JSON.parse(o); this.lodash_set(e, r, t), (s = this.setval(JSON.stringify(e), a)) } catch (e) { const i = {}; this.lodash_set(i, r, t), (s = this.setval(JSON.stringify(i), a)) } } else s = this.setval(t, e); return s } getval(t) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": return $persistentStore.read(t); case "Quantumult X": return $prefs.valueForKey(t); case "Node.js": return (this.data = this.loaddata()), this.data[t]; default: return (this.data && this.data[t]) || null } } setval(t, e) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": return $persistentStore.write(t, e); case "Quantumult X": return $prefs.setValueForKey(t, e); case "Node.js": return ((this.data = this.loaddata()), (this.data[e] = t), this.writedata(), !0); default: return (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 = () => { }) { switch ((t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"], delete t.headers["content-type"], delete t.headers["content-length"]), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: this.isSurge() && this.isNeedRewrite && ((t.headers = t.headers || {}), Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, a) => { !t && s && ((s.body = a), (s.statusCode = s.status ? s.status : s.statusCode), (s.status = s.statusCode)), e(t, s, a) }); break; case "Quantumult X": this.isNeedRewrite && ((t.opts = t.opts || {}), Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then((t) => { const { statusCode: s, statusCode: a, headers: r, body: i, bodyBytes: o, } = t; e(null, { status: s, statusCode: a, headers: r, body: i, bodyBytes: o, }, i, o) }, (t) => e((t && t.error) || "UndefinedError")); break; case "Node.js": let s = require("iconv-lite"); 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: a, statusCode: r, headers: i, rawBody: o, } = t, n = s.decode(o, this.encoding); e(null, { status: a, statusCode: r, headers: i, rawBody: o, body: n, }, n) }, (t) => { const { message: a, response: r } = t; e(a, r, r && s.decode(r.rawBody, this.encoding)) }) } } post(t, e = () => { }) { const s = t.method ? t.method.toLocaleLowerCase() : "post"; switch ((t.body && t.headers && !t.headers["Content-Type"] && !t.headers["content-type"] && (t.headers["content-type"] = "application/x-www-form-urlencoded"), t.headers && (delete t.headers["Content-Length"], delete t.headers["content-length"]), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: this.isSurge() && this.isNeedRewrite && ((t.headers = t.headers || {}), Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient[s](t, (t, s, a) => { !t && s && ((s.body = a), (s.statusCode = s.status ? s.status : s.statusCode), (s.status = s.statusCode)), e(t, s, a) }); break; case "Quantumult X": (t.method = s), this.isNeedRewrite && ((t.opts = t.opts || {}), Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then((t) => { const { statusCode: s, statusCode: a, headers: r, body: i, bodyBytes: o, } = t; e(null, { status: s, statusCode: a, headers: r, body: i, bodyBytes: o, }, i, o) }, (t) => e((t && t.error) || "UndefinedError")); break; case "Node.js": let a = require("iconv-lite"); this.initGotEnv(t); const { url: r, ...i } = t; this.got[s](r, i).then((t) => { const { statusCode: s, statusCode: r, headers: i, rawBody: o, } = t, n = a.decode(o, this.encoding); e(null, { status: s, statusCode: r, headers: i, rawBody: o, body: n }, n) }, (t) => { const { message: s, response: r } = t; e(s, r, r && a.decode(r.rawBody, this.encoding)) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date(); let a = { "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 a) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? a[e] : ("00" + a[e]).substr(("" + a[e]).length))); return t } queryStr(t) { let e = ""; for (const s in t) { let a = t[s]; null != a && "" !== a && ("object" == typeof a && (a = JSON.stringify(a)), (e += `${s}=${a}&`)) } return (e = e.substring(0, e.length - 1)), e } msg(e = t, s = "", a = "", r) { const i = (t) => { switch (typeof t) { case void 0: return t; case "string": switch (this.getEnv()) { case "Surge": case "Stash": default: return { url: t }; case "Loon": case "Shadowrocket": return t; case "Quantumult X": return { "open-url": t }; case "Node.js": return }case "object": switch (this.getEnv()) { case "Surge": case "Stash": case "Shadowrocket": default: { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } case "Loon": { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } case "Quantumult X": { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl, a = t["update-pasteboard"] || t.updatePasteboard; return { "open-url": e, "media-url": s, "update-pasteboard": a, } } case "Node.js": return }default: return } }; if (!this.isMute) switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: $notification.post(e, s, a, i(r)); break; case "Quantumult X": $notify(e, s, a, i(r)); break; case "Node.js": }if (!this.isMuteLog) { let t = ["", "==============📣系统通知📣==============",]; t.push(e), s && t.push(s), a && t.push(a), 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) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": case "Quantumult X": default: this.log("", `❗️${this.name},错误!`, t); break; case "Node.js": this.log("", `❗️${this.name},错误!`, t.stack) } } wait(t) { return new Promise((e) => setTimeout(e, t)) } DoubleLog(d) { if (this.isNode()) { if (d) { console.log(`${d}`); msg += `\n ${d}` } } else { console.log(`${d}`); msg += `\n ${d}` } } async SendMsg(m) { if (!m) return; if (Notify > 0) { if (this.isNode()) { var notify = require("../sendNotify"); await notify.sendNotify(this.name, m) } else { this.msg(this.name, "", m) } } else { console.log(m) } } done(t = {}) { const e = new Date().getTime(), s = (e - this.startTime) / 1e3; switch ((this.log("", `🔔${this.name},结束!🕛${s}秒`), this.log(), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": case "Quantumult X": default: $done(t); break; case "Node.js": process.exit(1) } } })(t, e) } 255 | //Env rewrite:smallfawn Update-time:23-6-30 newAdd:DoubleLog & SendMsg 256 | -------------------------------------------------------------------------------- /qchyjlb.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 雀巢会员俱乐部 签到 3 | * Qchyjlb 4 | * Author: Mist 5 | * 群组:https://t.me/Mist154 6 | * 频道:https://t.me/Mist153 7 | * Date: 2024-07-05 8 | * cron "0 9 * * *" qchyjlb.js 9 | * export qchyjlb= Authorization 多账号换行或者#分隔 10 | */ 11 | // ============================================================================================================ 12 | const $ = new Env('雀巢会员俱乐部') 13 | const axios = require('axios') 14 | const env_name = 'qchyjlb' //环境变量名字 15 | const env = process.env[env_name] || '' 16 | const Notify = 1 17 | const debug = 0 18 | let scriptVersionNow = "1.0.0"; 19 | let msg = ""; 20 | // ==================================异步顺序============================================================================== 21 | !(async () => { 22 | await getNotice(); 23 | await getVersion("yang7758258/ohhh154@main/qchyjlb.js"); 24 | await main(); 25 | await SendMsg(msg); 26 | 27 | })() 28 | .catch((e) => $.logErr(e)) 29 | .finally(() => $.done()); 30 | //==================================脚本入口函数main()============================================================== 31 | 32 | async function main() { 33 | if (env == '') { 34 | //没有设置变量,直接退出 35 | console.log(`没有填写变量,请查看脚本说明: ${env_name}🚳`) 36 | return 37 | } 38 | let user_ck = env.split('\n') 39 | DoubleLog(`\n========= 共找到 ${user_ck.length} 个账号 =========`); 40 | let index = 1 //用来给账号标记序号, 从1开始 41 | for (let ck of user_ck) { 42 | if (!ck) continue //跳过空行 43 | let ck_info = ck.split('&') 44 | let Authorization = ck_info[0] 45 | //let unionid = ck_info[1] 46 | //let deviceCode = ck_info[2] 47 | let user = { 48 | index: index, 49 | Authorization, 50 | //unionid, 51 | //deviceCode, 52 | } 53 | index = index + 1 //每次用完序号+1 54 | //开始账号任务 55 | let Run = new run(user); 56 | await Run.userTask(user) 57 | //每个账号之间等1~5秒随机时间 58 | let rnd_time = Math.floor(Math.random() * 4000) + 1000 59 | console.log(`随机等待${rnd_time / 1000}秒...`) 60 | await $.wait(rnd_time) 61 | } 62 | } 63 | // ======================================开始任务========================================= 64 | class run { 65 | constructor(user) { 66 | this.headers = { 67 | 'Content-Type': 'application/json', 68 | "authorization": user.Authorization, 69 | "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.48(0x18003030) NetType/WIFI Language/zh_CN", 70 | "Referer": "https://servicewechat.com/wxcb681732a25815c7/173/page-frame.html" 71 | } 72 | 73 | } 74 | async userTask(user) { 75 | console.log(`\n========= 账号[${user.index}]开始任务 =========`) 76 | await this.sign(user) 77 | await this.account(user) 78 | } 79 | // ============================================================================================================================= 80 | // 81 | async sign(user) { 82 | try { 83 | DoubleLog(`🕊账号[${user.index}] 开始签到...`); 84 | 85 | //console.log(formattedDate); 86 | let urlObject = { 87 | method: 'post', 88 | url: `https://crm.nestlechinese.com/openapi/activityservice/api/task/add`, 89 | headers: this.headers, 90 | data: { 91 | "task_id": 17 92 | } 93 | } 94 | //console.log(urlObject); 95 | let { data: result} = await axios.request(urlObject) 96 | //console.log(result); 97 | if (result?.errcode == '200') { 98 | //打印签到结果 99 | DoubleLog(`🕊账号[${user.index}] 签到成功:获得[2]雀巢币🎉`); 100 | }else{ 101 | DoubleLog(`🕊账号[${user.index}] 签到失败:失效或重复签到⛔`) 102 | } 103 | } catch (e) { 104 | console.log(e); 105 | } 106 | } 107 | 108 | // 109 | async account(user) { 110 | try { 111 | DoubleLog(`🕊账号[${user.index}] 资产查询...`); 112 | let urlObject = { 113 | method: 'post', 114 | url: `https://crm.nestlechinese.com/openapi/pointsservice/api/Points/getuserbalance`, 115 | headers: this.headers, 116 | data: { 117 | 118 | } 119 | 120 | } 121 | //console.log(urlObject); 122 | let { data: result} = await axios.request(urlObject) 123 | //console.log(result); 124 | if (result?.errcode == '200') { 125 | //打印签到结果 126 | DoubleLog(`🕊账号[${user.index}] 当前:雀巢币[${result.data}]🎉`); 127 | 128 | }else { 129 | DoubleLog(`🕊账号[${user.index}] 查询失败:${result.errmsg}⛔`) 130 | } 131 | } catch (e) { 132 | console.log(e); 133 | } 134 | } 135 | 136 | } 137 | /** 138 | * =========================================================发送消息============================================= 139 | */ 140 | async function SendMsg(message) { 141 | if (!message) return; 142 | if (Notify > 0) { 143 | if ($.isNode()) { 144 | var notify = require("./sendNotify"); 145 | await notify.sendNotify($.name, message); 146 | } else { 147 | // $.msg(message); 148 | $.msg($.name, '', message) 149 | } 150 | } else { 151 | console.log(message); 152 | } 153 | } 154 | /** 155 | * =====================================================双平台log输出========================================== 156 | */ 157 | function DoubleLog(data) { 158 | if ($.isNode()) { 159 | if (data) { 160 | console.log(`${data}`); 161 | msg += `\n${data}`; 162 | } 163 | } else { 164 | console.log(`${data}`); 165 | msg += `\n${data}`; 166 | } 167 | 168 | } 169 | /** 170 | * ======================================================等待 X 秒============================================ 171 | */ 172 | function wait(n) { 173 | return new Promise(function (resolve) { 174 | setTimeout(resolve, n * 1000); 175 | }); 176 | } 177 | /** 178 | * ======================================================随机等待 1-5 秒============================================ 179 | */ 180 | function sjwait() { 181 | return new Promise(function (resolve) { 182 | let waitTime = Math.floor(Math.random() * 4000 + 1000); 183 | setTimeout(resolve, waitTime); 184 | }); 185 | } 186 | // ==========================================================13位时间戳===================================================== 187 | function getTimestamp() { 188 | return new Date().getTime(); 189 | } 190 | //===============================================网络请求httpRequest========================================= 191 | function httpRequest(options, timeout = 1 * 1000) { 192 | method = options.method ? options.method.toLowerCase() : options.body ? "post" : "get"; 193 | return new Promise(resolve => { 194 | setTimeout(() => { 195 | $[method](options, (err, resp, data) => { 196 | try { 197 | if (err) { 198 | console.log(JSON.stringify(err)); 199 | $.logErr(err); 200 | } else { 201 | try { data = JSON.parse(data); } catch (error) { } 202 | } 203 | } catch (e) { 204 | console.log(e); 205 | $.logErr(e, resp); 206 | } finally { 207 | resolve(data); 208 | } 209 | }) 210 | }, timeout) 211 | }) 212 | } 213 | //==============================================Debug模式=============================================== 214 | function debugLog(...args) { 215 | if (debug) { 216 | console.log(...args); 217 | } 218 | } 219 | //===============================================获取远程通知======================================== 220 | async function getNotice() { 221 | try { 222 | const urls = [ 223 | "https://gitee.com/ohhhooh/jd_haoyangmao/raw/master/Notice.json", 224 | 225 | ]; 226 | let notice = null; 227 | for (const url of urls) { 228 | const options = { url, headers: { "User-Agent": "" }, }; 229 | const result = await httpRequest(options); 230 | if (result && "notice" in result) { 231 | notice = result.notice.replace(/\\n/g, "\n"); 232 | break; 233 | } 234 | } 235 | if (notice) { $.DoubleLog(notice); } 236 | } catch (e) { 237 | console.log(e); 238 | } 239 | } 240 | //==============================================获取远程版本================================================= 241 | function getVersion(scriptUrl, timeout = 3 * 1000) { 242 | return new Promise((resolve) => { 243 | const options = { url: `https://fastly.jsdelivr.net/gh/${scriptUrl}` }; 244 | $.get(options, (err, resp, data) => { 245 | try { 246 | const regex = /scriptVersionNow\s*=\s*(["'`])([\d.]+)\1/; 247 | const match = data.match(regex); 248 | const scriptVersionLatest = match ? match[2] : ""; 249 | DoubleLog(`\n当前版本:[${scriptVersionNow}]>>>>>云端☁️版本:[${scriptVersionLatest}]`); 250 | } catch (e) { 251 | $.logErr(e, resp); 252 | } 253 | resolve(); 254 | }, timeout); 255 | }); 256 | } 257 | 258 | //=============================================================================================================================================== 259 | //================================================固定API=============================================================================================== 260 | 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, a) => { s.call(this, t, (t, s, r) => { t ? a(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.userList = []; this.userIdx = 0; (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},开始!`) } getEnv() { return "undefined" != typeof $environment && $environment["surge-version"] ? "Surge" : "undefined" != typeof $environment && $environment["stash-version"] ? "Stash" : "undefined" != typeof module && module.exports ? "Node.js" : "undefined" != typeof $task ? "Quantumult X" : "undefined" != typeof $loon ? "Loon" : "undefined" != typeof $rocket ? "Shadowrocket" : void 0 } isNode() { return "Node.js" === this.getEnv() } isQuanX() { return "Quantumult X" === this.getEnv() } isSurge() { return "Surge" === this.getEnv() } isLoon() { return "Loon" === this.getEnv() } isShadowrocket() { return "Shadowrocket" === this.getEnv() } isStash() { return "Stash" === this.getEnv() } 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 a = this.getdata(t); if (a) 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, a) => e(a)) }) } runScript(t, e) { return new Promise((s) => { let a = this.getdata("@chavy_boxjs_userCfgs.httpapi"); a = a ? a.replace(/\n/g, "").trim() : a; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); (r = r ? 1 * r : 20), (r = e && e.timeout ? e.timeout : r); const [i, o] = a.split("@"), n = { url: `http://${o}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": i, Accept: "*/*" }, timeout: r, }; this.post(n, (t, e, a) => s(a)) }).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), a = !s && this.fs.existsSync(e); if (!s && !a) return {}; { const a = s ? t : e; try { return JSON.parse(this.fs.readFileSync(a)) } 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), a = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : a ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const a = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of a) 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, a) => Object(t[s]) === t[s] ? t[s] : (t[s] = Math.abs(e[a + 1]) >> 0 == +e[a + 1] ? [] : {}), t)[e[e.length - 1]] = s), t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, a] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, a, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, a, r] = /^@(.*?)\.(.*?)$/.exec(e), i = this.getval(a), o = a ? ("null" === i ? null : i || "{}") : "{}"; try { const e = JSON.parse(o); this.lodash_set(e, r, t), (s = this.setval(JSON.stringify(e), a)) } catch (e) { const i = {}; this.lodash_set(i, r, t), (s = this.setval(JSON.stringify(i), a)) } } else s = this.setval(t, e); return s } getval(t) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": return $persistentStore.read(t); case "Quantumult X": return $prefs.valueForKey(t); case "Node.js": return (this.data = this.loaddata()), this.data[t]; default: return (this.data && this.data[t]) || null } } setval(t, e) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": return $persistentStore.write(t, e); case "Quantumult X": return $prefs.setValueForKey(t, e); case "Node.js": return ((this.data = this.loaddata()), (this.data[e] = t), this.writedata(), !0); default: return (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 = () => { }) { switch ((t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"], delete t.headers["content-type"], delete t.headers["content-length"]), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: this.isSurge() && this.isNeedRewrite && ((t.headers = t.headers || {}), Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, a) => { !t && s && ((s.body = a), (s.statusCode = s.status ? s.status : s.statusCode), (s.status = s.statusCode)), e(t, s, a) }); break; case "Quantumult X": this.isNeedRewrite && ((t.opts = t.opts || {}), Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then((t) => { const { statusCode: s, statusCode: a, headers: r, body: i, bodyBytes: o, } = t; e(null, { status: s, statusCode: a, headers: r, body: i, bodyBytes: o, }, i, o) }, (t) => e((t && t.error) || "UndefinedError")); break; case "Node.js": let s = require("iconv-lite"); 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: a, statusCode: r, headers: i, rawBody: o, } = t, n = s.decode(o, this.encoding); e(null, { status: a, statusCode: r, headers: i, rawBody: o, body: n, }, n) }, (t) => { const { message: a, response: r } = t; e(a, r, r && s.decode(r.rawBody, this.encoding)) }) } } post(t, e = () => { }) { const s = t.method ? t.method.toLocaleLowerCase() : "post"; switch ((t.body && t.headers && !t.headers["Content-Type"] && !t.headers["content-type"] && (t.headers["content-type"] = "application/x-www-form-urlencoded"), t.headers && (delete t.headers["Content-Length"], delete t.headers["content-length"]), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: this.isSurge() && this.isNeedRewrite && ((t.headers = t.headers || {}), Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient[s](t, (t, s, a) => { !t && s && ((s.body = a), (s.statusCode = s.status ? s.status : s.statusCode), (s.status = s.statusCode)), e(t, s, a) }); break; case "Quantumult X": (t.method = s), this.isNeedRewrite && ((t.opts = t.opts || {}), Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then((t) => { const { statusCode: s, statusCode: a, headers: r, body: i, bodyBytes: o, } = t; e(null, { status: s, statusCode: a, headers: r, body: i, bodyBytes: o, }, i, o) }, (t) => e((t && t.error) || "UndefinedError")); break; case "Node.js": let a = require("iconv-lite"); this.initGotEnv(t); const { url: r, ...i } = t; this.got[s](r, i).then((t) => { const { statusCode: s, statusCode: r, headers: i, rawBody: o, } = t, n = a.decode(o, this.encoding); e(null, { status: s, statusCode: r, headers: i, rawBody: o, body: n }, n) }, (t) => { const { message: s, response: r } = t; e(s, r, r && a.decode(r.rawBody, this.encoding)) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date(); let a = { "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 a) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? a[e] : ("00" + a[e]).substr(("" + a[e]).length))); return t } queryStr(t) { let e = ""; for (const s in t) { let a = t[s]; null != a && "" !== a && ("object" == typeof a && (a = JSON.stringify(a)), (e += `${s}=${a}&`)) } return (e = e.substring(0, e.length - 1)), e } msg(e = t, s = "", a = "", r) { const i = (t) => { switch (typeof t) { case void 0: return t; case "string": switch (this.getEnv()) { case "Surge": case "Stash": default: return { url: t }; case "Loon": case "Shadowrocket": return t; case "Quantumult X": return { "open-url": t }; case "Node.js": return }case "object": switch (this.getEnv()) { case "Surge": case "Stash": case "Shadowrocket": default: { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } case "Loon": { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } case "Quantumult X": { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl, a = t["update-pasteboard"] || t.updatePasteboard; return { "open-url": e, "media-url": s, "update-pasteboard": a, } } case "Node.js": return }default: return } }; if (!this.isMute) switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: $notification.post(e, s, a, i(r)); break; case "Quantumult X": $notify(e, s, a, i(r)); break; case "Node.js": }if (!this.isMuteLog) { let t = ["", "==============📣系统通知📣==============",]; t.push(e), s && t.push(s), a && t.push(a), 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) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": case "Quantumult X": default: this.log("", `❗️${this.name},错误!`, t); break; case "Node.js": this.log("", `❗️${this.name},错误!`, t.stack) } } wait(t) { return new Promise((e) => setTimeout(e, t)) } DoubleLog(d) { if (this.isNode()) { if (d) { console.log(`${d}`); msg += `\n ${d}` } } else { console.log(`${d}`); msg += `\n ${d}` } } async SendMsg(m) { if (!m) return; if (Notify > 0) { if (this.isNode()) { var notify = require("../sendNotify"); await notify.sendNotify(this.name, m) } else { this.msg(this.name, "", m) } } else { console.log(m) } } done(t = {}) { const e = new Date().getTime(), s = (e - this.startTime) / 1e3; switch ((this.log("", `🔔${this.name},结束!🕛${s}秒`), this.log(), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": case "Quantumult X": default: $done(t); break; case "Node.js": process.exit(1) } } })(t, e) } 261 | //Env rewrite:smallfawn Update-time:23-6-30 newAdd:DoubleLog & SendMsg -------------------------------------------------------------------------------- /vx东方棘市.py: -------------------------------------------------------------------------------- 1 | import os 2 | import requests 3 | import json 4 | import time 5 | 6 | #抓包域名https://ys.shajixueyuan.com/api/user_sign/sign 7 | #取url请求中的token,变量名:dfjsck 8 | #变量格式 token#备注,多账号换行或者用@连接 9 | 10 | def get_accounts_from_env(var_name): 11 | """从环境变量中获取账户列表""" 12 | env_value = os.getenv(var_name) 13 | if not env_value: 14 | print(f"没有找到环境变量 '{var_name}'") 15 | return [] 16 | 17 | # 将环境变量的值按照换行或者 "@" 分割,并过滤空白行 18 | accounts = [line.strip() for line in env_value.strip().replace('@', '\n').split("\n") if line.strip()] 19 | return accounts 20 | 21 | def perform_sign_in(index, account, headers): 22 | """使用账号信息进行签到""" 23 | # 如果账号包含 "#" 分隔符,则分割为 token 和备注 24 | token, remark = account.split("#") if "#" in account else (account, "") 25 | headers['token'] = token 26 | 27 | url = "https://ys.shajixueyuan.com/api/user_sign/sign" 28 | try: 29 | response = requests.post(url, headers=headers, timeout=10) 30 | response.raise_for_status() # 如果状态码不是 200, 抛出异常 31 | return response.json(), remark 32 | except requests.RequestException as e: 33 | print(f"❌ 账号{index}. {remark} 签到请求异常: {e}") 34 | return {"error": f"请求异常: {e}"}, remark 35 | except ValueError: 36 | print(f"❌ 账号{index}. {remark} 签到响应解析失败,无法解析JSON") 37 | return {"error": "响应解析失败,无法解析JSON"}, remark 38 | 39 | def handle_sign_in_response(index, response, remark): 40 | """处理签到响应""" 41 | if 'error' in response: 42 | print(f"❌ 账号{index}. {remark} 签到失败:{response['error']}") 43 | elif response.get('code') == 0: 44 | msg = response.get('msg', '') 45 | if "已经签到" in msg: 46 | print(f"⚠️ 账号{index}. {remark} 签到失败:{msg}") 47 | else: 48 | print(f"✅ 账号{index}. {remark} 签到成功:{msg}") 49 | else: 50 | error_message = response.get('msg', '未知错误') 51 | print(f"❌ 账号{index}. {remark} 签到失败:{error_message}") 52 | 53 | def perform_withdrawal(index, account, remark, headers): 54 | """提现申请""" 55 | url = "https://ys.shajixueyuan.com/api/user.user_withdraw/apply" 56 | payload = { 57 | "fruit_withdraw_amount": "0.3", 58 | "pay_gateway": "wechat" 59 | } 60 | headers['Content-Type'] = "application/json" 61 | 62 | try: 63 | response = requests.post(url, data=json.dumps(payload), headers=headers) 64 | response.raise_for_status() # 如果状态码不是 200, 抛出异常 65 | response_json = response.json() 66 | if response_json.get('code') == 0: 67 | print(f"✅ 账号{index}. {remark} 提现申请状态:{response_json['msg']}") 68 | else: 69 | error_msg = response_json.get('msg', '未知错误') 70 | print(f"❌ 账号{index}. {remark} 提现申请状态失败:{error_msg}") 71 | except requests.RequestException as e: 72 | print(f"❌ 账号{index}. {remark} 提现申请异常: {e}") 73 | 74 | # 主程序逻辑 75 | if __name__ == "__main__": 76 | accounts = get_accounts_from_env('dfjsck') 77 | 78 | headers = { 79 | 'User-Agent': ("Mozilla/5.0 (Linux; Android 10; Mi 10 Pro Build/TKQ1.221114.001; wv) " 80 | "AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/122.0.6261.120 " 81 | "Mobile Safari/537.36 XWEB/1220099 MMWEBSDK/20240301 MMWEBID/1663 MicroMessenger/8.0.48.2580" 82 | "(0x28003052) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android"), 83 | 'Accept': "application/json", 84 | 'Accept-Encoding': "gzip,compress,br,deflate", 85 | 'charset': "utf-8", 86 | 'version': "1.0.13.2", 87 | 'Referer': "https://servicewechat.com/wxebdf2c44a2a714c2/69/page-frame.html" 88 | } 89 | 90 | print("=== 东方棘市签到 ===") 91 | 92 | for index, account in enumerate(accounts, start=1): 93 | response, remark = perform_sign_in(index, account, headers) 94 | handle_sign_in_response(index, response, remark) 95 | time.sleep(5) # Add a 5-second delay 96 | perform_withdrawal(index, account, remark, headers) 97 | time.sleep(5) # Add another 5-second delay after withdrawal 98 | 99 | print("=== 所有账户签到和提现申请完成 ===") -------------------------------------------------------------------------------- /ydxq.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 雅迪星球 签到 3 | * Ydxq 4 | * Author: Mist 5 | * Date: 2024-07-07 6 | * cron "59 7 * * *" ydxq.js 7 | * export ydxq= Authorization 多账号换行或者#分隔 8 | */ 9 | // ============================================================================================================ 10 | const $ = new Env('雅迪星球') 11 | const axios = require('axios') 12 | const env_name = 'ydxq' //环境变量名字 13 | const env = process.env[env_name] || '' 14 | const Notify = 1 15 | const debug = 0 16 | let scriptVersionNow = "1.0.0"; 17 | let msg = ""; 18 | // ==================================异步顺序============================================================================== 19 | !(async () => { 20 | await getNotice(); 21 | await getVersion("yang7758258/ohhh154@main/ydxq.js"); 22 | await main(); 23 | await SendMsg(msg); 24 | 25 | })() 26 | .catch((e) => $.logErr(e)) 27 | .finally(() => $.done()); 28 | //==================================脚本入口函数main()============================================================== 29 | 30 | async function main() { 31 | if (env == '') { 32 | //没有设置变量,直接退出 33 | console.log(`没有填写变量,请查看脚本说明: ${env_name}🚳`) 34 | return 35 | } 36 | let user_ck = env.split('\n') 37 | DoubleLog(`\n========= 共找到 ${user_ck.length} 个账号 =========`); 38 | let index = 1 //用来给账号标记序号, 从1开始 39 | for (let ck of user_ck) { 40 | if (!ck) continue //跳过空行 41 | let ck_info = ck.split('&') 42 | let Authorization = ck_info[0] 43 | //let unionid = ck_info[1] 44 | //let deviceCode = ck_info[2] 45 | let user = { 46 | index: index, 47 | Authorization, 48 | //unionid, 49 | //deviceCode, 50 | } 51 | index = index + 1 //每次用完序号+1 52 | //开始账号任务 53 | let Run = new run(user); 54 | await Run.userTask(user) 55 | //每个账号之间等1~5秒随机时间 56 | let rnd_time = Math.floor(Math.random() * 4000) + 1000 57 | console.log(`随机等待${rnd_time / 1000}秒...`) 58 | await $.wait(rnd_time) 59 | } 60 | } 61 | // ======================================开始任务========================================= 62 | class run { 63 | constructor(user) { 64 | this.headers = { 65 | "Host": "opmd.yadea.com.cn", 66 | "Connection": "keep-alive", 67 | "content-type": "application/json;charset=UTF-8", 68 | "Authorization": user.Authorization, 69 | "Accept-Encoding": "gzip,compress,br,deflate", 70 | "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.48(0x18003030) NetType/WIFI Language/zh_CN", 71 | "Referer": "https://servicewechat.com/wxcb681732a25815c7/173/page-frame.html" 72 | } 73 | 74 | } 75 | async userTask(user) { 76 | console.log(`\n========= 账号[${user.index}]开始任务 =========`) 77 | await this.sign(user) 78 | } 79 | // ============================================================================================================================= 80 | // 81 | async sign(user) { 82 | try { 83 | DoubleLog(`🕊账号[${user.index}] 开始签到任务...`); 84 | 85 | //console.log(formattedDate); 86 | let urlObject = { 87 | method: 'post', 88 | url: `https://opmd.yadea.com.cn/api/miniprogram/custom-promotion/memberSign`, 89 | headers: this.headers, 90 | data: { 91 | 92 | } 93 | } 94 | //console.log(urlObject); 95 | let { data: result} = await axios.request(urlObject) 96 | //console.log(result); 97 | if (result?.code == '200') { 98 | //打印签到结果 99 | DoubleLog(`🕊账号[${user.index}] 签到成功:获得[${result.data}]积分🎉`); 100 | }else{ 101 | DoubleLog(`🕊账号[${user.index}] 签到失败:${result.msg}⛔`) 102 | } 103 | } catch (e) { 104 | console.log(e); 105 | } 106 | } 107 | 108 | // 109 | async account(user) { 110 | try { 111 | DoubleLog(`🕊账号[${user.index}] 开始查询任务...`); 112 | let urlObject = { 113 | method: 'get', 114 | url: `https://apiserver.chinagoods.com/growth/score/record/page?pageNo=1&pageSize=10&month=7&year=2024&userType=BUYER`, 115 | headers: this.headers, 116 | 117 | } 118 | //console.log(urlObject); 119 | let { data: result} = await axios.request(urlObject) 120 | //console.log(result); 121 | if (result?.code == '20000') { 122 | //打印签到结果 123 | DoubleLog(`🕊账号[${user.index}] 查询成功:总积分[${result.data.current}]🎉`); 124 | 125 | }else { 126 | DoubleLog(`🕊账号[${user.index}] 查询失败:${result.msg}🚫`) 127 | } 128 | } catch (e) { 129 | console.log(e); 130 | } 131 | } 132 | 133 | } 134 | /** 135 | * =========================================================发送消息============================================= 136 | */ 137 | async function SendMsg(message) { 138 | if (!message) return; 139 | if (Notify > 0) { 140 | if ($.isNode()) { 141 | var notify = require("./sendNotify"); 142 | await notify.sendNotify($.name, message); 143 | } else { 144 | // $.msg(message); 145 | $.msg($.name, '', message) 146 | } 147 | } else { 148 | console.log(message); 149 | } 150 | } 151 | /** 152 | * =====================================================双平台log输出========================================== 153 | */ 154 | function DoubleLog(data) { 155 | if ($.isNode()) { 156 | if (data) { 157 | console.log(`${data}`); 158 | msg += `\n${data}`; 159 | } 160 | } else { 161 | console.log(`${data}`); 162 | msg += `\n${data}`; 163 | } 164 | 165 | } 166 | /** 167 | * ======================================================等待 X 秒============================================ 168 | */ 169 | function wait(n) { 170 | return new Promise(function (resolve) { 171 | setTimeout(resolve, n * 1000); 172 | }); 173 | } 174 | /** 175 | * ======================================================随机等待 1-5 秒============================================ 176 | */ 177 | function sjwait() { 178 | return new Promise(function (resolve) { 179 | let waitTime = Math.floor(Math.random() * 4000 + 1000); 180 | setTimeout(resolve, waitTime); 181 | }); 182 | } 183 | // ==========================================================13位时间戳===================================================== 184 | function getTimestamp() { 185 | return new Date().getTime(); 186 | } 187 | //===============================================网络请求httpRequest========================================= 188 | function httpRequest(options, timeout = 1 * 1000) { 189 | method = options.method ? options.method.toLowerCase() : options.body ? "post" : "get"; 190 | return new Promise(resolve => { 191 | setTimeout(() => { 192 | $[method](options, (err, resp, data) => { 193 | try { 194 | if (err) { 195 | console.log(JSON.stringify(err)); 196 | $.logErr(err); 197 | } else { 198 | try { data = JSON.parse(data); } catch (error) { } 199 | } 200 | } catch (e) { 201 | console.log(e); 202 | $.logErr(e, resp); 203 | } finally { 204 | resolve(data); 205 | } 206 | }) 207 | }, timeout) 208 | }) 209 | } 210 | //==============================================Debug模式=============================================== 211 | function debugLog(...args) { 212 | if (debug) { 213 | console.log(...args); 214 | } 215 | } 216 | //===============================================获取远程通知======================================== 217 | async function getNotice() { 218 | try { 219 | const urls = [ 220 | "https://gitee.com/ohhhooh/jd_haoyangmao/raw/master/Notice.json", 221 | 222 | ]; 223 | let notice = null; 224 | for (const url of urls) { 225 | const options = { url, headers: { "User-Agent": "" }, }; 226 | const result = await httpRequest(options); 227 | if (result && "notice" in result) { 228 | notice = result.notice.replace(/\\n/g, "\n"); 229 | break; 230 | } 231 | } 232 | if (notice) { $.DoubleLog(notice); } 233 | } catch (e) { 234 | console.log(e); 235 | } 236 | } 237 | //==============================================获取远程版本================================================= 238 | function getVersion(scriptUrl, timeout = 3 * 1000) { 239 | return new Promise((resolve) => { 240 | const options = { url: `https://fastly.jsdelivr.net/gh/${scriptUrl}` }; 241 | $.get(options, (err, resp, data) => { 242 | try { 243 | const regex = /scriptVersionNow\s*=\s*(["'`])([\d.]+)\1/; 244 | const match = data.match(regex); 245 | const scriptVersionLatest = match ? match[2] : ""; 246 | DoubleLog(`\n当前版本:[${scriptVersionNow}]>>>>>云端☁️版本:[${scriptVersionLatest}]`); 247 | } catch (e) { 248 | $.logErr(e, resp); 249 | } 250 | resolve(); 251 | }, timeout); 252 | }); 253 | } 254 | 255 | //=============================================================================================================================================== 256 | //================================================固定API=============================================================================================== 257 | 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, a) => { s.call(this, t, (t, s, r) => { t ? a(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.userList = []; this.userIdx = 0; (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},开始!`) } getEnv() { return "undefined" != typeof $environment && $environment["surge-version"] ? "Surge" : "undefined" != typeof $environment && $environment["stash-version"] ? "Stash" : "undefined" != typeof module && module.exports ? "Node.js" : "undefined" != typeof $task ? "Quantumult X" : "undefined" != typeof $loon ? "Loon" : "undefined" != typeof $rocket ? "Shadowrocket" : void 0 } isNode() { return "Node.js" === this.getEnv() } isQuanX() { return "Quantumult X" === this.getEnv() } isSurge() { return "Surge" === this.getEnv() } isLoon() { return "Loon" === this.getEnv() } isShadowrocket() { return "Shadowrocket" === this.getEnv() } isStash() { return "Stash" === this.getEnv() } 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 a = this.getdata(t); if (a) 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, a) => e(a)) }) } runScript(t, e) { return new Promise((s) => { let a = this.getdata("@chavy_boxjs_userCfgs.httpapi"); a = a ? a.replace(/\n/g, "").trim() : a; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); (r = r ? 1 * r : 20), (r = e && e.timeout ? e.timeout : r); const [i, o] = a.split("@"), n = { url: `http://${o}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": i, Accept: "*/*" }, timeout: r, }; this.post(n, (t, e, a) => s(a)) }).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), a = !s && this.fs.existsSync(e); if (!s && !a) return {}; { const a = s ? t : e; try { return JSON.parse(this.fs.readFileSync(a)) } 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), a = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : a ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const a = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of a) 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, a) => Object(t[s]) === t[s] ? t[s] : (t[s] = Math.abs(e[a + 1]) >> 0 == +e[a + 1] ? [] : {}), t)[e[e.length - 1]] = s), t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, a] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, a, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, a, r] = /^@(.*?)\.(.*?)$/.exec(e), i = this.getval(a), o = a ? ("null" === i ? null : i || "{}") : "{}"; try { const e = JSON.parse(o); this.lodash_set(e, r, t), (s = this.setval(JSON.stringify(e), a)) } catch (e) { const i = {}; this.lodash_set(i, r, t), (s = this.setval(JSON.stringify(i), a)) } } else s = this.setval(t, e); return s } getval(t) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": return $persistentStore.read(t); case "Quantumult X": return $prefs.valueForKey(t); case "Node.js": return (this.data = this.loaddata()), this.data[t]; default: return (this.data && this.data[t]) || null } } setval(t, e) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": return $persistentStore.write(t, e); case "Quantumult X": return $prefs.setValueForKey(t, e); case "Node.js": return ((this.data = this.loaddata()), (this.data[e] = t), this.writedata(), !0); default: return (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 = () => { }) { switch ((t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"], delete t.headers["content-type"], delete t.headers["content-length"]), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: this.isSurge() && this.isNeedRewrite && ((t.headers = t.headers || {}), Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, a) => { !t && s && ((s.body = a), (s.statusCode = s.status ? s.status : s.statusCode), (s.status = s.statusCode)), e(t, s, a) }); break; case "Quantumult X": this.isNeedRewrite && ((t.opts = t.opts || {}), Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then((t) => { const { statusCode: s, statusCode: a, headers: r, body: i, bodyBytes: o, } = t; e(null, { status: s, statusCode: a, headers: r, body: i, bodyBytes: o, }, i, o) }, (t) => e((t && t.error) || "UndefinedError")); break; case "Node.js": let s = require("iconv-lite"); 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: a, statusCode: r, headers: i, rawBody: o, } = t, n = s.decode(o, this.encoding); e(null, { status: a, statusCode: r, headers: i, rawBody: o, body: n, }, n) }, (t) => { const { message: a, response: r } = t; e(a, r, r && s.decode(r.rawBody, this.encoding)) }) } } post(t, e = () => { }) { const s = t.method ? t.method.toLocaleLowerCase() : "post"; switch ((t.body && t.headers && !t.headers["Content-Type"] && !t.headers["content-type"] && (t.headers["content-type"] = "application/x-www-form-urlencoded"), t.headers && (delete t.headers["Content-Length"], delete t.headers["content-length"]), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: this.isSurge() && this.isNeedRewrite && ((t.headers = t.headers || {}), Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient[s](t, (t, s, a) => { !t && s && ((s.body = a), (s.statusCode = s.status ? s.status : s.statusCode), (s.status = s.statusCode)), e(t, s, a) }); break; case "Quantumult X": (t.method = s), this.isNeedRewrite && ((t.opts = t.opts || {}), Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then((t) => { const { statusCode: s, statusCode: a, headers: r, body: i, bodyBytes: o, } = t; e(null, { status: s, statusCode: a, headers: r, body: i, bodyBytes: o, }, i, o) }, (t) => e((t && t.error) || "UndefinedError")); break; case "Node.js": let a = require("iconv-lite"); this.initGotEnv(t); const { url: r, ...i } = t; this.got[s](r, i).then((t) => { const { statusCode: s, statusCode: r, headers: i, rawBody: o, } = t, n = a.decode(o, this.encoding); e(null, { status: s, statusCode: r, headers: i, rawBody: o, body: n }, n) }, (t) => { const { message: s, response: r } = t; e(s, r, r && a.decode(r.rawBody, this.encoding)) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date(); let a = { "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 a) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? a[e] : ("00" + a[e]).substr(("" + a[e]).length))); return t } queryStr(t) { let e = ""; for (const s in t) { let a = t[s]; null != a && "" !== a && ("object" == typeof a && (a = JSON.stringify(a)), (e += `${s}=${a}&`)) } return (e = e.substring(0, e.length - 1)), e } msg(e = t, s = "", a = "", r) { const i = (t) => { switch (typeof t) { case void 0: return t; case "string": switch (this.getEnv()) { case "Surge": case "Stash": default: return { url: t }; case "Loon": case "Shadowrocket": return t; case "Quantumult X": return { "open-url": t }; case "Node.js": return }case "object": switch (this.getEnv()) { case "Surge": case "Stash": case "Shadowrocket": default: { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } case "Loon": { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } case "Quantumult X": { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl, a = t["update-pasteboard"] || t.updatePasteboard; return { "open-url": e, "media-url": s, "update-pasteboard": a, } } case "Node.js": return }default: return } }; if (!this.isMute) switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: $notification.post(e, s, a, i(r)); break; case "Quantumult X": $notify(e, s, a, i(r)); break; case "Node.js": }if (!this.isMuteLog) { let t = ["", "==============📣系统通知📣==============",]; t.push(e), s && t.push(s), a && t.push(a), 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) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": case "Quantumult X": default: this.log("", `❗️${this.name},错误!`, t); break; case "Node.js": this.log("", `❗️${this.name},错误!`, t.stack) } } wait(t) { return new Promise((e) => setTimeout(e, t)) } DoubleLog(d) { if (this.isNode()) { if (d) { console.log(`${d}`); msg += `\n ${d}` } } else { console.log(`${d}`); msg += `\n ${d}` } } async SendMsg(m) { if (!m) return; if (Notify > 0) { if (this.isNode()) { var notify = require("../sendNotify"); await notify.sendNotify(this.name, m) } else { this.msg(this.name, "", m) } } else { console.log(m) } } done(t = {}) { const e = new Date().getTime(), s = (e - this.startTime) / 1e3; switch ((this.log("", `🔔${this.name},结束!🕛${s}秒`), this.log(), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": case "Quantumult X": default: $done(t); break; case "Node.js": process.exit(1) } } })(t, e) } 258 | //Env rewrite:smallfawn Update-time:23-6-30 newAdd:DoubleLog & SendMsg 259 | -------------------------------------------------------------------------------- /ywxspc.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 义务小商品城 3 | * Ywxspc 4 | * Author: Mist 5 | * Date: 2024-07-05 6 | * cron "59 7 * * *" ywxspc.js 7 | * export ywxspc= x-auth-token 多账号换行或者#分隔 8 | */ 9 | // ============================================================================================================ 10 | const $ = new Env('义务小商品城') 11 | const axios = require('axios') 12 | const env_name = 'ywxspc' //环境变量名字 13 | const env = process.env[env_name] || '' 14 | const Notify = 1 15 | const debug = 0 16 | let scriptVersionNow = "1.0.0"; 17 | let msg = ""; 18 | // ==================================异步顺序============================================================================== 19 | !(async () => { 20 | await getNotice(); 21 | await getVersion("yang7758258/ohhh154@main/ywxspc.js"); 22 | await main(); 23 | await SendMsg(msg); 24 | 25 | })() 26 | .catch((e) => $.logErr(e)) 27 | .finally(() => $.done()); 28 | //==================================脚本入口函数main()============================================================== 29 | 30 | async function main() { 31 | if (env == '') { 32 | //没有设置变量,直接退出 33 | console.log(`没有填写变量,请查看脚本说明: ${env_name}🚳`) 34 | return 35 | } 36 | let user_ck = env.split('\n') 37 | DoubleLog(`\n========= 共找到 ${user_ck.length} 个账号 =========`); 38 | let index = 1 //用来给账号标记序号, 从1开始 39 | for (let ck of user_ck) { 40 | if (!ck) continue //跳过空行 41 | let ck_info = ck.split('&') 42 | let authorization = ck_info[0] 43 | //let ticket = ck_info[1] 44 | //let deviceCode = ck_info[2] 45 | let user = { 46 | index: index, 47 | authorization, 48 | //ticket, 49 | //deviceCode, 50 | } 51 | index = index + 1 //每次用完序号+1 52 | //开始账号任务 53 | let Run = new run(user); 54 | await Run.userTask(user) 55 | //每个账号之间等1~5秒随机时间 56 | let rnd_time = Math.floor(Math.random() * 4000) + 1000 57 | console.log(`随机等待${rnd_time / 1000}秒...`) 58 | await $.wait(rnd_time) 59 | } 60 | } 61 | // ======================================开始任务========================================= 62 | class run { 63 | constructor(user) { 64 | let timestamp = Date.now() 65 | this.id = ['1076315','1075605','1075751'] 66 | this.headers = { 67 | 'Content-Type': 'application/json', 68 | "authorization": user.authorization, 69 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36", 70 | } 71 | } 72 | async userTask(user) { 73 | console.log(`\n========= 账号[${user.index}]开始任务 =========`) 74 | await this.sign(user) 75 | await this.account(user) 76 | 77 | } 78 | // ============================================================================================================================= 79 | // 80 | async sign(user) { 81 | try { 82 | DoubleLog(`🕊账号[${user.index}] 开始签到任务...`); 83 | 84 | //console.log(formattedDate); 85 | let urlObject = { 86 | method: 'post', 87 | url: `https://apiserver.chinagoods.com/bpmms/sign/seller/signup`, 88 | headers: this.headers, 89 | data: { 90 | 91 | } 92 | } 93 | //console.log(urlObject); 94 | let { data: result} = await axios.request(urlObject) 95 | //console.log(result); 96 | if (result?.code == '20000') { 97 | //打印签到结果 98 | DoubleLog(`🕊账号[${user.index}] 签到:[${result.message}] 第[${result.data.totalDays}]天🎉`); 99 | }else{ 100 | DoubleLog(`🕊账号[${user.index}] 签到失败:${result.message}⛔`) 101 | } 102 | } catch (e) { 103 | console.log(e); 104 | } 105 | } 106 | 107 | // 108 | async account(user) { 109 | try { 110 | DoubleLog(`🕊账号[${user.index}] 开始查询任务...`); 111 | let urlObject = { 112 | method: 'get', 113 | url: `https://apiserver.chinagoods.com/growth/score/record/page?pageNo=1&pageSize=10&month=7&year=2024&userType=BUYER`, 114 | headers: this.headers, 115 | 116 | } 117 | //console.log(urlObject); 118 | let { data: result} = await axios.request(urlObject) 119 | //console.log(result); 120 | if (result?.code == '20000') { 121 | //打印签到结果 122 | DoubleLog(`🕊账号[${user.index}] 查询成功:总积分[${result.data.current}]🎉`); 123 | 124 | }else { 125 | DoubleLog(`🕊账号[${user.index}] 查询失败:${result.msg}🚫`) 126 | } 127 | } catch (e) { 128 | console.log(e); 129 | } 130 | } 131 | 132 | } 133 | /** 134 | * =========================================================发送消息============================================= 135 | */ 136 | async function SendMsg(message) { 137 | if (!message) return; 138 | if (Notify > 0) { 139 | if ($.isNode()) { 140 | var notify = require("./sendNotify"); 141 | await notify.sendNotify($.name, message); 142 | } else { 143 | // $.msg(message); 144 | $.msg($.name, '', message) 145 | } 146 | } else { 147 | console.log(message); 148 | } 149 | } 150 | /** 151 | * =====================================================双平台log输出========================================== 152 | */ 153 | function DoubleLog(data) { 154 | if ($.isNode()) { 155 | if (data) { 156 | console.log(`${data}`); 157 | msg += `\n${data}`; 158 | } 159 | } else { 160 | console.log(`${data}`); 161 | msg += `\n${data}`; 162 | } 163 | 164 | } 165 | /** 166 | * ======================================================等待 X 秒============================================ 167 | */ 168 | function wait(n) { 169 | return new Promise(function (resolve) { 170 | setTimeout(resolve, n * 1000); 171 | }); 172 | } 173 | /** 174 | * ======================================================随机等待 1-5 秒============================================ 175 | */ 176 | function sjwait() { 177 | return new Promise(function (resolve) { 178 | let waitTime = Math.floor(Math.random() * 4000 + 1000); 179 | setTimeout(resolve, waitTime); 180 | }); 181 | } 182 | // ==========================================================13位时间戳===================================================== 183 | function getTimestamp() { 184 | return new Date().getTime(); 185 | } 186 | //===============================================网络请求httpRequest========================================= 187 | function httpRequest(options, timeout = 1 * 1000) { 188 | method = options.method ? options.method.toLowerCase() : options.body ? "post" : "get"; 189 | return new Promise(resolve => { 190 | setTimeout(() => { 191 | $[method](options, (err, resp, data) => { 192 | try { 193 | if (err) { 194 | console.log(JSON.stringify(err)); 195 | $.logErr(err); 196 | } else { 197 | try { data = JSON.parse(data); } catch (error) { } 198 | } 199 | } catch (e) { 200 | console.log(e); 201 | $.logErr(e, resp); 202 | } finally { 203 | resolve(data); 204 | } 205 | }) 206 | }, timeout) 207 | }) 208 | } 209 | //==============================================Debug模式=============================================== 210 | function debugLog(...args) { 211 | if (debug) { 212 | console.log(...args); 213 | } 214 | } 215 | //===============================================获取远程通知======================================== 216 | async function getNotice() { 217 | try { 218 | const urls = [ 219 | "https://gitee.com/ohhhooh/jd_haoyangmao/raw/master/Notice.json", 220 | 221 | ]; 222 | let notice = null; 223 | for (const url of urls) { 224 | const options = { url, headers: { "User-Agent": "" }, }; 225 | const result = await httpRequest(options); 226 | if (result && "notice" in result) { 227 | notice = result.notice.replace(/\\n/g, "\n"); 228 | break; 229 | } 230 | } 231 | if (notice) { $.DoubleLog(notice); } 232 | } catch (e) { 233 | console.log(e); 234 | } 235 | } 236 | //==============================================获取远程版本================================================= 237 | function getVersion(scriptUrl, timeout = 3 * 1000) { 238 | return new Promise((resolve) => { 239 | const options = { url: `https://fastly.jsdelivr.net/gh/${scriptUrl}` }; 240 | $.get(options, (err, resp, data) => { 241 | try { 242 | const regex = /scriptVersionNow\s*=\s*(["'`])([\d.]+)\1/; 243 | const match = data.match(regex); 244 | const scriptVersionLatest = match ? match[2] : ""; 245 | DoubleLog(`\n当前版本:[${scriptVersionNow}]>>>>>云端☁️版本:[${scriptVersionLatest}]`); 246 | } catch (e) { 247 | $.logErr(e, resp); 248 | } 249 | resolve(); 250 | }, timeout); 251 | }); 252 | } 253 | 254 | //=============================================================================================================================================== 255 | //================================================固定API=============================================================================================== 256 | 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, a) => { s.call(this, t, (t, s, r) => { t ? a(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.userList = []; this.userIdx = 0; (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},开始!`) } getEnv() { return "undefined" != typeof $environment && $environment["surge-version"] ? "Surge" : "undefined" != typeof $environment && $environment["stash-version"] ? "Stash" : "undefined" != typeof module && module.exports ? "Node.js" : "undefined" != typeof $task ? "Quantumult X" : "undefined" != typeof $loon ? "Loon" : "undefined" != typeof $rocket ? "Shadowrocket" : void 0 } isNode() { return "Node.js" === this.getEnv() } isQuanX() { return "Quantumult X" === this.getEnv() } isSurge() { return "Surge" === this.getEnv() } isLoon() { return "Loon" === this.getEnv() } isShadowrocket() { return "Shadowrocket" === this.getEnv() } isStash() { return "Stash" === this.getEnv() } 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 a = this.getdata(t); if (a) 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, a) => e(a)) }) } runScript(t, e) { return new Promise((s) => { let a = this.getdata("@chavy_boxjs_userCfgs.httpapi"); a = a ? a.replace(/\n/g, "").trim() : a; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); (r = r ? 1 * r : 20), (r = e && e.timeout ? e.timeout : r); const [i, o] = a.split("@"), n = { url: `http://${o}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": i, Accept: "*/*" }, timeout: r, }; this.post(n, (t, e, a) => s(a)) }).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), a = !s && this.fs.existsSync(e); if (!s && !a) return {}; { const a = s ? t : e; try { return JSON.parse(this.fs.readFileSync(a)) } 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), a = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : a ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const a = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of a) 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, a) => Object(t[s]) === t[s] ? t[s] : (t[s] = Math.abs(e[a + 1]) >> 0 == +e[a + 1] ? [] : {}), t)[e[e.length - 1]] = s), t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, a] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, a, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, a, r] = /^@(.*?)\.(.*?)$/.exec(e), i = this.getval(a), o = a ? ("null" === i ? null : i || "{}") : "{}"; try { const e = JSON.parse(o); this.lodash_set(e, r, t), (s = this.setval(JSON.stringify(e), a)) } catch (e) { const i = {}; this.lodash_set(i, r, t), (s = this.setval(JSON.stringify(i), a)) } } else s = this.setval(t, e); return s } getval(t) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": return $persistentStore.read(t); case "Quantumult X": return $prefs.valueForKey(t); case "Node.js": return (this.data = this.loaddata()), this.data[t]; default: return (this.data && this.data[t]) || null } } setval(t, e) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": return $persistentStore.write(t, e); case "Quantumult X": return $prefs.setValueForKey(t, e); case "Node.js": return ((this.data = this.loaddata()), (this.data[e] = t), this.writedata(), !0); default: return (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 = () => { }) { switch ((t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"], delete t.headers["content-type"], delete t.headers["content-length"]), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: this.isSurge() && this.isNeedRewrite && ((t.headers = t.headers || {}), Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, a) => { !t && s && ((s.body = a), (s.statusCode = s.status ? s.status : s.statusCode), (s.status = s.statusCode)), e(t, s, a) }); break; case "Quantumult X": this.isNeedRewrite && ((t.opts = t.opts || {}), Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then((t) => { const { statusCode: s, statusCode: a, headers: r, body: i, bodyBytes: o, } = t; e(null, { status: s, statusCode: a, headers: r, body: i, bodyBytes: o, }, i, o) }, (t) => e((t && t.error) || "UndefinedError")); break; case "Node.js": let s = require("iconv-lite"); 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: a, statusCode: r, headers: i, rawBody: o, } = t, n = s.decode(o, this.encoding); e(null, { status: a, statusCode: r, headers: i, rawBody: o, body: n, }, n) }, (t) => { const { message: a, response: r } = t; e(a, r, r && s.decode(r.rawBody, this.encoding)) }) } } post(t, e = () => { }) { const s = t.method ? t.method.toLocaleLowerCase() : "post"; switch ((t.body && t.headers && !t.headers["Content-Type"] && !t.headers["content-type"] && (t.headers["content-type"] = "application/x-www-form-urlencoded"), t.headers && (delete t.headers["Content-Length"], delete t.headers["content-length"]), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: this.isSurge() && this.isNeedRewrite && ((t.headers = t.headers || {}), Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient[s](t, (t, s, a) => { !t && s && ((s.body = a), (s.statusCode = s.status ? s.status : s.statusCode), (s.status = s.statusCode)), e(t, s, a) }); break; case "Quantumult X": (t.method = s), this.isNeedRewrite && ((t.opts = t.opts || {}), Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then((t) => { const { statusCode: s, statusCode: a, headers: r, body: i, bodyBytes: o, } = t; e(null, { status: s, statusCode: a, headers: r, body: i, bodyBytes: o, }, i, o) }, (t) => e((t && t.error) || "UndefinedError")); break; case "Node.js": let a = require("iconv-lite"); this.initGotEnv(t); const { url: r, ...i } = t; this.got[s](r, i).then((t) => { const { statusCode: s, statusCode: r, headers: i, rawBody: o, } = t, n = a.decode(o, this.encoding); e(null, { status: s, statusCode: r, headers: i, rawBody: o, body: n }, n) }, (t) => { const { message: s, response: r } = t; e(s, r, r && a.decode(r.rawBody, this.encoding)) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date(); let a = { "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 a) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? a[e] : ("00" + a[e]).substr(("" + a[e]).length))); return t } queryStr(t) { let e = ""; for (const s in t) { let a = t[s]; null != a && "" !== a && ("object" == typeof a && (a = JSON.stringify(a)), (e += `${s}=${a}&`)) } return (e = e.substring(0, e.length - 1)), e } msg(e = t, s = "", a = "", r) { const i = (t) => { switch (typeof t) { case void 0: return t; case "string": switch (this.getEnv()) { case "Surge": case "Stash": default: return { url: t }; case "Loon": case "Shadowrocket": return t; case "Quantumult X": return { "open-url": t }; case "Node.js": return }case "object": switch (this.getEnv()) { case "Surge": case "Stash": case "Shadowrocket": default: { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } case "Loon": { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } case "Quantumult X": { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl, a = t["update-pasteboard"] || t.updatePasteboard; return { "open-url": e, "media-url": s, "update-pasteboard": a, } } case "Node.js": return }default: return } }; if (!this.isMute) switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: $notification.post(e, s, a, i(r)); break; case "Quantumult X": $notify(e, s, a, i(r)); break; case "Node.js": }if (!this.isMuteLog) { let t = ["", "==============📣系统通知📣==============",]; t.push(e), s && t.push(s), a && t.push(a), 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) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": case "Quantumult X": default: this.log("", `❗️${this.name},错误!`, t); break; case "Node.js": this.log("", `❗️${this.name},错误!`, t.stack) } } wait(t) { return new Promise((e) => setTimeout(e, t)) } DoubleLog(d) { if (this.isNode()) { if (d) { console.log(`${d}`); msg += `\n ${d}` } } else { console.log(`${d}`); msg += `\n ${d}` } } async SendMsg(m) { if (!m) return; if (Notify > 0) { if (this.isNode()) { var notify = require("../sendNotify"); await notify.sendNotify(this.name, m) } else { this.msg(this.name, "", m) } } else { console.log(m) } } done(t = {}) { const e = new Date().getTime(), s = (e - this.startTime) / 1e3; switch ((this.log("", `🔔${this.name},结束!🕛${s}秒`), this.log(), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": case "Quantumult X": default: $done(t); break; case "Node.js": process.exit(1) } } })(t, e) } 257 | //Env rewrite:smallfawn Update-time:23-6-30 newAdd:DoubleLog & SendMsg -------------------------------------------------------------------------------- /东方棘市.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import os 3 | 4 | #抓包域名https://ys.shajixueyuan.com/api/user_sign/sign 5 | #取url请求中的token,变量名:dfjsck 6 | #变量格式 token#备注,多账号换行或者用@连接 7 | 8 | 9 | def sign(token, remark): 10 | url = "https://ys.shajixueyuan.com/api/user_sign/sign" 11 | headers = { 12 | 'User-Agent': "Mozilla/5.0 (Linux; Android 12; RMX3562 Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/122.0.6261.120 Mobile Safari/537.36 XWEB/1220099 MMWEBSDK/20240404 MMWEBID/2307 MicroMessenger/8.0.49.2600(0x28003133) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android", 13 | 'token': token 14 | } 15 | response = requests.post(url, headers=headers) 16 | data = response.json() 17 | if data['code'] == 1: 18 | msg = data['data']['msg'] 19 | energy_release = data["data"]["rewards_info"]["energy_release"] 20 | print(f"[{remark}] 签到结果: {msg}, 释放 {energy_release} 能量果子") 21 | else: 22 | msg = data["msg"] 23 | print(f"[{remark}] 签到失败原因: {msg}") 24 | 25 | def issueRewards(token, remark): 26 | url = "https://ys.shajixueyuan.com/api/quest.quest/issueRewards" 27 | headers = { 28 | 'User-Agent': "Mozilla/5.0 (Linux; Android 12; RMX3562 Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/122.0.6261.120 Mobile Safari/537.36 XWEB/1220099 MMWEBSDK/20240404 MMWEBID/2307 MicroMessenger/8.0.49.2600(0x28003133) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android", 29 | 'token': token 30 | } 31 | data = { 32 | "quest_id": 4 33 | } 34 | response = requests.post(url, json=data, headers=headers) 35 | data = response.json() 36 | msg = data['msg'] 37 | print(f"[{remark}] 分享结果: {msg}") 38 | 39 | def info(token, remark): 40 | url = "https://ys.shajixueyuan.com/api/user/info" 41 | headers = { 42 | 'User-Agent': "Mozilla/5.0 (Linux; Android 12; RMX3562 Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/122.0.6261.120 Mobile Safari/537.36 XWEB/1220099 MMWEBSDK/20240404 MMWEBID/2307 MicroMessenger/8.0.49.2600(0x28003133) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android", 43 | 'token': token 44 | } 45 | response = requests.get(url, headers=headers) 46 | data = response.json() 47 | if data['code'] == 1: 48 | accumulated_fruits = float(data["data"]["accumulated_fruits"]) 49 | nickname = data["data"]["nickname"] 50 | print(f"[{remark}]:当前余额: {accumulated_fruits}") 51 | if accumulated_fruits >= 1: 52 | apply(token, remark) 53 | else: 54 | print(f"[{remark}] 余额不足,无法进行提现") 55 | else: 56 | msg = data["msg"] 57 | print(f"[{remark}] 查询失败: {msg}") 58 | 59 | def apply(token, remark): 60 | url = "https://ys.shajixueyuan.com/api/user.user_withdraw/apply" 61 | headers = { 62 | 'User-Agent': "Mozilla/5.0 (Linux; Android 12; RMX3562 Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/122.0.6261.120 Mobile Safari/537.36 XWEB/1220099 MMWEBSDK/20240404 MMWEBID/2307 MicroMessenger/8.0.49.2600(0x28003133) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android", 63 | 'token': token 64 | } 65 | data = { 66 | "fruit_withdraw_amount": "1", 67 | "pay_gateway": "wechat" 68 | } 69 | response = requests.post(url, json=data, headers=headers) 70 | data = response.json() 71 | msg = data['msg'] 72 | print(f"[{remark}] 提现结果: {msg}") 73 | 74 | if __name__ == "__main__": 75 | tokens = os.environ.get('dfjsck') 76 | if not tokens: 77 | print("获取账号失败,请检查配置是否正确") 78 | else: 79 | # 将换行符替换为 @ 号,分割每个账号 80 | tokens_list = [token.strip() for token in tokens.replace('@', '\n').split('\n') if token.strip()] 81 | for index, item in enumerate(tokens_list, start=1): 82 | parts = item.split('#') 83 | token = parts[0].strip() # 提取 token 84 | remark = parts[1].strip() if len(parts) > 1 else f"账号{index}" # 提取备注,如果没有则用“账号X”代替 85 | 86 | print(f"===== 开始执行第 {index} 个账号任务 =====") 87 | print(f"账号: {remark}") 88 | print(f"===== 开始执行签到任务 =====") 89 | sign(token, remark) 90 | print(f"===== 开始执行分享任务 =====") 91 | issueRewards(token, remark) 92 | print(f"===== 开始执行查询和提现任务 =====") 93 | info(token, remark) 94 | print("==============================") -------------------------------------------------------------------------------- /废弃仓库/Ljgy.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 丽瑾国韵 3 | * Ljgy 4 | * Author: Mist 5 | * Date: 2024-06-18 6 | * 扫码进入 7 | * cron "10 8 * * *" Ljgy.js 8 | * export Ljgy= 账号&密码 多账号换行或者#分隔 9 | */ 10 | // ============================================================================================================ 11 | const $ = new Env('丽瑾国韵') 12 | const axios = require('axios') 13 | const env_name = 'Ljgy' //环境变量名字 14 | const env = process.env[env_name] || '' //获取环境变量 15 | const Notify = 1//是否通知, 1通知, 0不通知. 默认通知 16 | const debug = 0//是否调试, 1调试, 0不调试. 默认不调试 17 | let scriptVersionNow = "1.0.1";//脚本版本号 18 | let msg = ""; 19 | // ==================================异步顺序============================================================================== 20 | !(async () => { 21 | await getNotice(); //远程通知 22 | await getVersion("yang7758258/ohhh154@main/Ljgy.js"); 23 | await main();//主函数 24 | await SendMsg(msg); //发送通知 25 | 26 | })() 27 | .catch((e) => $.logErr(e)) 28 | .finally(() => $.done()); 29 | //==================================脚本入口函数main()============================================================== 30 | async function main() { 31 | if (env == '') { 32 | //没有设置变量,直接退出 33 | console.log(`没有填写变量,请查看脚本说明: ${env_name}`) 34 | return 35 | } 36 | let user_ck = env.split('\n') 37 | DoubleLog(`\n========= 共找到 ${user_ck.length} 个账号 =========`); 38 | let index = 1 //用来给账号标记序号, 从1开始 39 | for (let ck of user_ck) { 40 | if (!ck) continue //跳过空行 41 | let ck_info = ck.split('&') 42 | let username = ck_info[0] 43 | let password = ck_info[1] 44 | //let uid = ck_info[0] 45 | //let deviceCode = ck_info[2] 46 | let user = { 47 | index: index, 48 | username, 49 | password, 50 | //deviceCode, 51 | } 52 | index = index + 1 //每次用完序号+1 53 | //开始账号任务 54 | await userTask(user) 55 | //每个账号之间等1~5秒随机时间 56 | let rnd_time = Math.floor(Math.random() * 4000) + 1000 57 | console.log(`账号[${user.index}]随机等待${rnd_time / 1000}秒...`) 58 | await $.wait(rnd_time) 59 | } 60 | } 61 | // ======================================开始任务========================================= 62 | async function userTask(user) { 63 | console.log(`\n============= 账号[${user.index}]开始任务 =============`) 64 | await SignTask(user,'https://wep.qzlcis.com/api/user/sign') 65 | await wait (1) 66 | await SignTask(user,'http://wep.qzlcis.com/api/user/clock') 67 | } 68 | // ============================================================================================================================= 69 | //签到、打卡 70 | async function SignTask(user,url) { 71 | try { 72 | let token = await LoginTask(user); 73 | let urlObject = { 74 | method: 'post', 75 | url: url, 76 | headers: { 77 | 'Host': 'wep.qzlcis.com', 78 | 'Accept': 'application/json, text/plain, */*', 79 | 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.48(0x18003030) NetType/WIFI Language/zh_CN', 80 | }, 81 | data: { 82 | 'token': token, 83 | } 84 | } 85 | // 86 | let { data: result} = await axios.request(urlObject) 87 | //console.log(urlObject); 88 | //console.log(result); 89 | if (result?.code == '1') { 90 | //打印签到结果 91 | DoubleLog(`🌸账号[${user.index}]` + `🕊签到成功,获得现金[${result.data.reward_num}]元🎉`); 92 | }if(result?.code == "0") { 93 | DoubleLog(`🌸账号[${user.index}]失败:${result.info}❌`) 94 | }if (result?.code == "1") { 95 | DoubleLog(`🌸账号[${user.index}]今日打卡:${result.info}🎉`) 96 | } 97 | 98 | 99 | } catch (e) { 100 | //打印错误信息 101 | console.log(e.response.data); 102 | } 103 | } 104 | async function LoginTask(user) { 105 | try { 106 | let urlObject = { 107 | method: 'post', 108 | url: 'http://wep.qzlcis.com/api/index/login', 109 | headers: { 110 | 'Host': 'wep.qzlcis.com', 111 | 'Accept': 'application/json, text/plain, */*', 112 | 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.48(0x18003030) NetType/WIFI Language/zh_CN', 113 | }, 114 | data: { 115 | "username": user.username, 116 | "password": user.password, 117 | "token": "", 118 | } 119 | } 120 | // 121 | let { data: result} = await axios.request(urlObject) 122 | let token = result.data.token 123 | //console.log(urlObject); 124 | //console.log(result); 125 | if (result?.code == '1') { 126 | //打印签到结果 127 | DoubleLog(`🌸账号[${user.index}]` + `🕊登陆${result.info}🎉`); 128 | 129 | }if(result?.code == "0") { 130 | DoubleLog(`🌸账号[${user.index}]失败:${result.info}❌`) 131 | } 132 | 133 | return token 134 | } catch (e) { 135 | //打印错误信息 136 | console.log(e.response.data); 137 | } 138 | } 139 | /** 140 | * =========================================================发送消息============================================= 141 | */ 142 | async function SendMsg(message) { 143 | if (!message) return; 144 | if (Notify > 0) { 145 | if ($.isNode()) { 146 | var notify = require("./sendNotify"); 147 | await notify.sendNotify($.name, message); 148 | } else { 149 | // $.msg(message); 150 | $.msg($.name, '', message) 151 | } 152 | } else { 153 | console.log(message); 154 | } 155 | } 156 | /** 157 | * =====================================================双平台log输出========================================== 158 | */ 159 | function DoubleLog(data) { 160 | if ($.isNode()) { 161 | if (data) { 162 | console.log(`${data}`); 163 | msg += `\n${data}`; 164 | } 165 | } else { 166 | console.log(`${data}`); 167 | msg += `\n${data}`; 168 | } 169 | 170 | } 171 | /** 172 | * ======================================================等待 X 秒============================================ 173 | */ 174 | function wait(n) { 175 | return new Promise(function (resolve) { 176 | setTimeout(resolve, n * 1000); 177 | }); 178 | } 179 | /** 180 | * ======================================================随机等待 1-5 秒============================================ 181 | */ 182 | function sjwait() { 183 | return new Promise(function (resolve) { 184 | let waitTime = Math.floor(Math.random() * 4000 + 1000); 185 | setTimeout(resolve, waitTime); 186 | }); 187 | } 188 | // ==========================================================13位时间戳===================================================== 189 | function getTimestamp() { 190 | return new Date().getTime(); 191 | } 192 | //===============================================网络请求httpRequest========================================= 193 | function httpRequest(options, timeout = 1 * 1000) { 194 | method = options.method ? options.method.toLowerCase() : options.body ? "post" : "get"; 195 | return new Promise(resolve => { 196 | setTimeout(() => { 197 | $[method](options, (err, resp, data) => { 198 | try { 199 | if (err) { 200 | console.log(JSON.stringify(err)); 201 | $.logErr(err); 202 | } else { 203 | try { data = JSON.parse(data); } catch (error) { } 204 | } 205 | } catch (e) { 206 | console.log(e); 207 | $.logErr(e, resp); 208 | } finally { 209 | resolve(data); 210 | } 211 | }) 212 | }, timeout) 213 | }) 214 | } 215 | //==============================================Debug模式=============================================== 216 | function debugLog(...args) { 217 | if (debug) { 218 | console.log(...args); 219 | } 220 | } 221 | //===============================================获取远程通知======================================== 222 | async function getNotice() { 223 | try { 224 | const urls = [ 225 | "https://gitee.com/ohhhooh/jd_haoyangmao/raw/master/Notice.json", 226 | 227 | ]; 228 | let notice = null; 229 | for (const url of urls) { 230 | const options = { url, headers: { "User-Agent": "" }, }; 231 | const result = await httpRequest(options); 232 | if (result && "notice" in result) { 233 | notice = result.notice.replace(/\\n/g, "\n"); 234 | break; 235 | } 236 | } 237 | if (notice) { $.DoubleLog(notice); } 238 | } catch (e) { 239 | console.log(e); 240 | } 241 | } 242 | //==============================================获取远程版本================================================= 243 | function getVersion(scriptUrl, timeout = 3 * 1000) { 244 | return new Promise((resolve) => { 245 | const options = { url: `https://fastly.jsdelivr.net/gh/${scriptUrl}` }; 246 | $.get(options, (err, resp, data) => { 247 | try { 248 | const regex = /scriptVersionNow\s*=\s*(["'`])([\d.]+)\1/; 249 | const match = data.match(regex); 250 | const scriptVersionLatest = match ? match[2] : ""; 251 | console.log(`\n============= 当前版本:${scriptVersionNow} 🌟 最新版本:${scriptVersionLatest} =============`); 252 | } catch (e) { 253 | $.logErr(e, resp); 254 | } 255 | resolve(); 256 | }, timeout); 257 | }); 258 | } 259 | 260 | //=============================================================================================================================================== 261 | //================================================固定API=============================================================================================== 262 | 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, a) => { s.call(this, t, (t, s, r) => { t ? a(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.userList = []; this.userIdx = 0; (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},开始!`) } getEnv() { return "undefined" != typeof $environment && $environment["surge-version"] ? "Surge" : "undefined" != typeof $environment && $environment["stash-version"] ? "Stash" : "undefined" != typeof module && module.exports ? "Node.js" : "undefined" != typeof $task ? "Quantumult X" : "undefined" != typeof $loon ? "Loon" : "undefined" != typeof $rocket ? "Shadowrocket" : void 0 } isNode() { return "Node.js" === this.getEnv() } isQuanX() { return "Quantumult X" === this.getEnv() } isSurge() { return "Surge" === this.getEnv() } isLoon() { return "Loon" === this.getEnv() } isShadowrocket() { return "Shadowrocket" === this.getEnv() } isStash() { return "Stash" === this.getEnv() } 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 a = this.getdata(t); if (a) 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, a) => e(a)) }) } runScript(t, e) { return new Promise((s) => { let a = this.getdata("@chavy_boxjs_userCfgs.httpapi"); a = a ? a.replace(/\n/g, "").trim() : a; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); (r = r ? 1 * r : 20), (r = e && e.timeout ? e.timeout : r); const [i, o] = a.split("@"), n = { url: `http://${o}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": i, Accept: "*/*" }, timeout: r, }; this.post(n, (t, e, a) => s(a)) }).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), a = !s && this.fs.existsSync(e); if (!s && !a) return {}; { const a = s ? t : e; try { return JSON.parse(this.fs.readFileSync(a)) } 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), a = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : a ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const a = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of a) 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, a) => Object(t[s]) === t[s] ? t[s] : (t[s] = Math.abs(e[a + 1]) >> 0 == +e[a + 1] ? [] : {}), t)[e[e.length - 1]] = s), t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, a] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, a, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, a, r] = /^@(.*?)\.(.*?)$/.exec(e), i = this.getval(a), o = a ? ("null" === i ? null : i || "{}") : "{}"; try { const e = JSON.parse(o); this.lodash_set(e, r, t), (s = this.setval(JSON.stringify(e), a)) } catch (e) { const i = {}; this.lodash_set(i, r, t), (s = this.setval(JSON.stringify(i), a)) } } else s = this.setval(t, e); return s } getval(t) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": return $persistentStore.read(t); case "Quantumult X": return $prefs.valueForKey(t); case "Node.js": return (this.data = this.loaddata()), this.data[t]; default: return (this.data && this.data[t]) || null } } setval(t, e) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": return $persistentStore.write(t, e); case "Quantumult X": return $prefs.setValueForKey(t, e); case "Node.js": return ((this.data = this.loaddata()), (this.data[e] = t), this.writedata(), !0); default: return (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 = () => { }) { switch ((t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"], delete t.headers["content-type"], delete t.headers["content-length"]), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: this.isSurge() && this.isNeedRewrite && ((t.headers = t.headers || {}), Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, a) => { !t && s && ((s.body = a), (s.statusCode = s.status ? s.status : s.statusCode), (s.status = s.statusCode)), e(t, s, a) }); break; case "Quantumult X": this.isNeedRewrite && ((t.opts = t.opts || {}), Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then((t) => { const { statusCode: s, statusCode: a, headers: r, body: i, bodyBytes: o, } = t; e(null, { status: s, statusCode: a, headers: r, body: i, bodyBytes: o, }, i, o) }, (t) => e((t && t.error) || "UndefinedError")); break; case "Node.js": let s = require("iconv-lite"); 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: a, statusCode: r, headers: i, rawBody: o, } = t, n = s.decode(o, this.encoding); e(null, { status: a, statusCode: r, headers: i, rawBody: o, body: n, }, n) }, (t) => { const { message: a, response: r } = t; e(a, r, r && s.decode(r.rawBody, this.encoding)) }) } } post(t, e = () => { }) { const s = t.method ? t.method.toLocaleLowerCase() : "post"; switch ((t.body && t.headers && !t.headers["Content-Type"] && !t.headers["content-type"] && (t.headers["content-type"] = "application/x-www-form-urlencoded"), t.headers && (delete t.headers["Content-Length"], delete t.headers["content-length"]), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: this.isSurge() && this.isNeedRewrite && ((t.headers = t.headers || {}), Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient[s](t, (t, s, a) => { !t && s && ((s.body = a), (s.statusCode = s.status ? s.status : s.statusCode), (s.status = s.statusCode)), e(t, s, a) }); break; case "Quantumult X": (t.method = s), this.isNeedRewrite && ((t.opts = t.opts || {}), Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then((t) => { const { statusCode: s, statusCode: a, headers: r, body: i, bodyBytes: o, } = t; e(null, { status: s, statusCode: a, headers: r, body: i, bodyBytes: o, }, i, o) }, (t) => e((t && t.error) || "UndefinedError")); break; case "Node.js": let a = require("iconv-lite"); this.initGotEnv(t); const { url: r, ...i } = t; this.got[s](r, i).then((t) => { const { statusCode: s, statusCode: r, headers: i, rawBody: o, } = t, n = a.decode(o, this.encoding); e(null, { status: s, statusCode: r, headers: i, rawBody: o, body: n }, n) }, (t) => { const { message: s, response: r } = t; e(s, r, r && a.decode(r.rawBody, this.encoding)) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date(); let a = { "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 a) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? a[e] : ("00" + a[e]).substr(("" + a[e]).length))); return t } queryStr(t) { let e = ""; for (const s in t) { let a = t[s]; null != a && "" !== a && ("object" == typeof a && (a = JSON.stringify(a)), (e += `${s}=${a}&`)) } return (e = e.substring(0, e.length - 1)), e } msg(e = t, s = "", a = "", r) { const i = (t) => { switch (typeof t) { case void 0: return t; case "string": switch (this.getEnv()) { case "Surge": case "Stash": default: return { url: t }; case "Loon": case "Shadowrocket": return t; case "Quantumult X": return { "open-url": t }; case "Node.js": return }case "object": switch (this.getEnv()) { case "Surge": case "Stash": case "Shadowrocket": default: { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } case "Loon": { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } case "Quantumult X": { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl, a = t["update-pasteboard"] || t.updatePasteboard; return { "open-url": e, "media-url": s, "update-pasteboard": a, } } case "Node.js": return }default: return } }; if (!this.isMute) switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: $notification.post(e, s, a, i(r)); break; case "Quantumult X": $notify(e, s, a, i(r)); break; case "Node.js": }if (!this.isMuteLog) { let t = ["", "==============📣系统通知📣==============",]; t.push(e), s && t.push(s), a && t.push(a), 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) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": case "Quantumult X": default: this.log("", `❗️${this.name},错误!`, t); break; case "Node.js": this.log("", `❗️${this.name},错误!`, t.stack) } } wait(t) { return new Promise((e) => setTimeout(e, t)) } DoubleLog(d) { if (this.isNode()) { if (d) { console.log(`${d}`); msg += `\n ${d}` } } else { console.log(`${d}`); msg += `\n ${d}` } } async SendMsg(m) { if (!m) return; if (Notify > 0) { if (this.isNode()) { var notify = require("./sendNotify"); await notify.sendNotify(this.name, m) } else { this.msg(this.name, "", m) } } else { console.log(m) } } done(t = {}) { const e = new Date().getTime(), s = (e - this.startTime) / 1e3; switch ((this.log("", `🔔${this.name},结束!🕛${s}秒`), this.log(), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": case "Quantumult X": default: $done(t); break; case "Node.js": process.exit(1) } } })(t, e) } 263 | //Env rewrite:smallfawn Update-time:23-6-30 newAdd:DoubleLog & SendMsg 264 | -------------------------------------------------------------------------------- /废弃仓库/bmyx.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | *bmyx 4 | *Author: Mist 5 | *Date: 2024-06-11 6 | * 抓 vx小程序白马严选相册 积分换实物 7 | * cron "10 10 * * *" bmyx.js 8 | * export bmyx= token 多账号换行或者#分隔 9 | */ 10 | // ============================================================================================================ 11 | const $ = new Env('vx白马严选') 12 | const axios = require('axios') 13 | const env_name = 'bmyx' //环境变量名字 14 | const env = process.env[env_name] || '' //获取环境变量 15 | const Notify = 1//是否通知, 1通知, 0不通知. 默认通知 16 | const debug = 0//是否调试, 1调试, 0不调试. 默认不调试 17 | let scriptVersionNow = "1.0.0";//脚本版本号 18 | let msg = ""; 19 | // ==================================异步顺序============================================================================== 20 | !(async () => { 21 | await getNotice(); //远程通知 22 | await getVersion("yang7758258/ohhh154@main/bmyx.js"); 23 | await main();//主函数 24 | await SendMsg(msg); //发送通知 25 | 26 | })() 27 | .catch((e) => $.logErr(e)) 28 | .finally(() => $.done()); 29 | //==================================脚本入口函数main()============================================================== 30 | async function main() { 31 | if (env == '') { 32 | //没有设置变量,直接退出 33 | console.log(`没有填写变量,请查看脚本说明: ${env_name}`) 34 | return 35 | } 36 | let user_ck = env.split('\n') 37 | DoubleLog(`\n========= 共找到 ${user_ck.length} 个账号 =========`); 38 | let index = 1 //用来给账号标记序号, 从1开始 39 | for (let ck of user_ck) { 40 | if (!ck) continue //跳过空行 41 | let ck_info = ck.split('&') 42 | let token = ck_info[0] 43 | //let accessToken = ck_info[1] 44 | //let deviceCode = ck_info[2] 45 | let user = { 46 | index: index, 47 | token, 48 | //accessToken, 49 | //deviceCode, 50 | } 51 | index = index + 1 //每次用完序号+1 52 | //开始账号任务 53 | await userTask(user) 54 | //每个账号之间等1~5秒随机时间 55 | let rnd_time = Math.floor(Math.random() * 4000) + 1000 56 | console.log(`账号[${user.index}]随机等待${rnd_time / 1000}秒...`) 57 | await $.wait(rnd_time) 58 | } 59 | } 60 | // ======================================开始任务========================================= 61 | async function userTask(user) { 62 | console.log(`\n============= 账号[${user.index}]开始任务 =============`) 63 | await SignTask(user) 64 | await wait (2) 65 | await account(user) 66 | } 67 | // ============================================================================================================================= 68 | //签到 69 | async function SignTask(user) { 70 | try { 71 | let urlObject = { 72 | method: 'post', 73 | url: 'https://min.51afa.com/module/integralApi/sign.html', 74 | headers: { 75 | 'Host': 'min.51afa.com', 76 | 'Content-Type': 'application/x-www-form-urlencoded', 77 | 'act': 'do_sign', 78 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090a13) XWEB/9129', 79 | }, 80 | data: { 81 | "token": user.token, 82 | "company_id": '1', 83 | } 84 | } 85 | // 86 | let { data: result} = await axios.request(urlObject) 87 | //console.log(result); 88 | if (result?.status == "200") { 89 | //打印签到结果 90 | DoubleLog(`🌸账号[${user.index}]` + `🕊签到${result.msg},获得[${result.data.coin}]积分🎉`); 91 | }if(result?.status == "500") { 92 | DoubleLog(`🌸账号[${user.index}]签到失败:[${result.msg}]❌`) 93 | }if (result?.status == "404") { 94 | DoubleLog(`🌸账号[${user.index}]签到失败:${result.msg}❌`) 95 | } 96 | 97 | 98 | } catch (e) { 99 | //打印错误信息 100 | console.log(e) 101 | } 102 | } 103 | //账户积分 104 | async function account(user) { 105 | try { 106 | let urlObject = { 107 | method: 'post', 108 | url: 'https://min.51afa.com/module/integralApi/member_center_info.html', 109 | headers: { 110 | 'Host': 'min.51afa.com', 111 | 'Content-Type': 'application/x-www-form-urlencoded', 112 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090a13) XWEB/9129', 113 | }, 114 | data: { 115 | "token": user.token, 116 | "from": "member_center", 117 | "company_id": '1', 118 | } 119 | }; 120 | let { data: result } = await axios.request(urlObject) 121 | //console.log(result); 122 | if (result?.status == "200") { 123 | DoubleLog(`🌸账号[${user.index}]🕊账户当前积分${result.data.memberInfo.all_points}💰`) 124 | }if (result?.status == "404"){ 125 | DoubleLog(`🌸账号[${user.index}]🕊查询当前积分失败:${result.msg}❌`) 126 | } 127 | } catch (e) { 128 | //打印错误信息 129 | console.log(e) 130 | } 131 | } 132 | /** 133 | * =========================================================发送消息============================================= 134 | */ 135 | async function SendMsg(message) { 136 | if (!message) return; 137 | if (Notify > 0) { 138 | if ($.isNode()) { 139 | var notify = require("./sendNotify"); 140 | await notify.sendNotify($.name, message); 141 | } else { 142 | // $.msg(message); 143 | $.msg($.name, '', message) 144 | } 145 | } else { 146 | console.log(message); 147 | } 148 | } 149 | /** 150 | * =====================================================双平台log输出========================================== 151 | */ 152 | function DoubleLog(data) { 153 | if ($.isNode()) { 154 | if (data) { 155 | console.log(`${data}`); 156 | msg += `\n${data}`; 157 | } 158 | } else { 159 | console.log(`${data}`); 160 | msg += `\n${data}`; 161 | } 162 | 163 | } 164 | /** 165 | * ======================================================等待 X 秒============================================ 166 | */ 167 | function wait(n) { 168 | return new Promise(function (resolve) { 169 | setTimeout(resolve, n * 1000); 170 | }); 171 | } 172 | /** 173 | * ======================================================随机等待 1-5 秒============================================ 174 | */ 175 | function sjwait() { 176 | return new Promise(function (resolve) { 177 | let waitTime = Math.floor(Math.random() * 4000 + 1000); 178 | setTimeout(resolve, waitTime); 179 | }); 180 | } 181 | // ==========================================================13位时间戳===================================================== 182 | function getTimestamp() { 183 | return new Date().getTime(); 184 | } 185 | //===============================================网络请求httpRequest========================================= 186 | function httpRequest(options, timeout = 1 * 1000) { 187 | method = options.method ? options.method.toLowerCase() : options.body ? "post" : "get"; 188 | return new Promise(resolve => { 189 | setTimeout(() => { 190 | $[method](options, (err, resp, data) => { 191 | try { 192 | if (err) { 193 | console.log(JSON.stringify(err)); 194 | $.logErr(err); 195 | } else { 196 | try { data = JSON.parse(data); } catch (error) { } 197 | } 198 | } catch (e) { 199 | console.log(e); 200 | $.logErr(e, resp); 201 | } finally { 202 | resolve(data); 203 | } 204 | }) 205 | }, timeout) 206 | }) 207 | } 208 | //==============================================Debug模式=============================================== 209 | function debugLog(...args) { 210 | if (debug) { 211 | console.log(...args); 212 | } 213 | } 214 | //===============================================获取远程通知======================================== 215 | async function getNotice() { 216 | try { 217 | const urls = [ 218 | "https://gitee.com/ohhhooh/jd_haoyangmao/raw/master/Notice.json", 219 | 220 | ]; 221 | let notice = null; 222 | for (const url of urls) { 223 | const options = { url, headers: { "User-Agent": "" }, }; 224 | const result = await httpRequest(options); 225 | if (result && "notice" in result) { 226 | notice = result.notice.replace(/\\n/g, "\n"); 227 | break; 228 | } 229 | } 230 | if (notice) { $.DoubleLog(notice); } 231 | } catch (e) { 232 | console.log(e); 233 | } 234 | } 235 | //==============================================获取远程版本================================================= 236 | function getVersion(scriptUrl, timeout = 3 * 1000) { 237 | return new Promise((resolve) => { 238 | const options = { url: `https://fastly.jsdelivr.net/gh/${scriptUrl}` }; 239 | $.get(options, (err, resp, data) => { 240 | try { 241 | const regex = /scriptVersionNow\s*=\s*(["'`])([\d.]+)\1/; 242 | const match = data.match(regex); 243 | const scriptVersionLatest = match ? match[2] : ""; 244 | console.log(`\n============= 当前版本:${scriptVersionNow} 🌟 最新版本:${scriptVersionLatest} =============`); 245 | } catch (e) { 246 | $.logErr(e, resp); 247 | } 248 | resolve(); 249 | }, timeout); 250 | }); 251 | } 252 | 253 | //=============================================================================================================================================== 254 | //================================================固定API=============================================================================================== 255 | 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, a) => { s.call(this, t, (t, s, r) => { t ? a(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.userList = []; this.userIdx = 0; (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},开始!`) } getEnv() { return "undefined" != typeof $environment && $environment["surge-version"] ? "Surge" : "undefined" != typeof $environment && $environment["stash-version"] ? "Stash" : "undefined" != typeof module && module.exports ? "Node.js" : "undefined" != typeof $task ? "Quantumult X" : "undefined" != typeof $loon ? "Loon" : "undefined" != typeof $rocket ? "Shadowrocket" : void 0 } isNode() { return "Node.js" === this.getEnv() } isQuanX() { return "Quantumult X" === this.getEnv() } isSurge() { return "Surge" === this.getEnv() } isLoon() { return "Loon" === this.getEnv() } isShadowrocket() { return "Shadowrocket" === this.getEnv() } isStash() { return "Stash" === this.getEnv() } 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 a = this.getdata(t); if (a) 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, a) => e(a)) }) } runScript(t, e) { return new Promise((s) => { let a = this.getdata("@chavy_boxjs_userCfgs.httpapi"); a = a ? a.replace(/\n/g, "").trim() : a; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); (r = r ? 1 * r : 20), (r = e && e.timeout ? e.timeout : r); const [i, o] = a.split("@"), n = { url: `http://${o}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": i, Accept: "*/*" }, timeout: r, }; this.post(n, (t, e, a) => s(a)) }).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), a = !s && this.fs.existsSync(e); if (!s && !a) return {}; { const a = s ? t : e; try { return JSON.parse(this.fs.readFileSync(a)) } 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), a = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : a ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const a = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of a) 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, a) => Object(t[s]) === t[s] ? t[s] : (t[s] = Math.abs(e[a + 1]) >> 0 == +e[a + 1] ? [] : {}), t)[e[e.length - 1]] = s), t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, a] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, a, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, a, r] = /^@(.*?)\.(.*?)$/.exec(e), i = this.getval(a), o = a ? ("null" === i ? null : i || "{}") : "{}"; try { const e = JSON.parse(o); this.lodash_set(e, r, t), (s = this.setval(JSON.stringify(e), a)) } catch (e) { const i = {}; this.lodash_set(i, r, t), (s = this.setval(JSON.stringify(i), a)) } } else s = this.setval(t, e); return s } getval(t) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": return $persistentStore.read(t); case "Quantumult X": return $prefs.valueForKey(t); case "Node.js": return (this.data = this.loaddata()), this.data[t]; default: return (this.data && this.data[t]) || null } } setval(t, e) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": return $persistentStore.write(t, e); case "Quantumult X": return $prefs.setValueForKey(t, e); case "Node.js": return ((this.data = this.loaddata()), (this.data[e] = t), this.writedata(), !0); default: return (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 = () => { }) { switch ((t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"], delete t.headers["content-type"], delete t.headers["content-length"]), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: this.isSurge() && this.isNeedRewrite && ((t.headers = t.headers || {}), Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, a) => { !t && s && ((s.body = a), (s.statusCode = s.status ? s.status : s.statusCode), (s.status = s.statusCode)), e(t, s, a) }); break; case "Quantumult X": this.isNeedRewrite && ((t.opts = t.opts || {}), Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then((t) => { const { statusCode: s, statusCode: a, headers: r, body: i, bodyBytes: o, } = t; e(null, { status: s, statusCode: a, headers: r, body: i, bodyBytes: o, }, i, o) }, (t) => e((t && t.error) || "UndefinedError")); break; case "Node.js": let s = require("iconv-lite"); 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: a, statusCode: r, headers: i, rawBody: o, } = t, n = s.decode(o, this.encoding); e(null, { status: a, statusCode: r, headers: i, rawBody: o, body: n, }, n) }, (t) => { const { message: a, response: r } = t; e(a, r, r && s.decode(r.rawBody, this.encoding)) }) } } post(t, e = () => { }) { const s = t.method ? t.method.toLocaleLowerCase() : "post"; switch ((t.body && t.headers && !t.headers["Content-Type"] && !t.headers["content-type"] && (t.headers["content-type"] = "application/x-www-form-urlencoded"), t.headers && (delete t.headers["Content-Length"], delete t.headers["content-length"]), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: this.isSurge() && this.isNeedRewrite && ((t.headers = t.headers || {}), Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient[s](t, (t, s, a) => { !t && s && ((s.body = a), (s.statusCode = s.status ? s.status : s.statusCode), (s.status = s.statusCode)), e(t, s, a) }); break; case "Quantumult X": (t.method = s), this.isNeedRewrite && ((t.opts = t.opts || {}), Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then((t) => { const { statusCode: s, statusCode: a, headers: r, body: i, bodyBytes: o, } = t; e(null, { status: s, statusCode: a, headers: r, body: i, bodyBytes: o, }, i, o) }, (t) => e((t && t.error) || "UndefinedError")); break; case "Node.js": let a = require("iconv-lite"); this.initGotEnv(t); const { url: r, ...i } = t; this.got[s](r, i).then((t) => { const { statusCode: s, statusCode: r, headers: i, rawBody: o, } = t, n = a.decode(o, this.encoding); e(null, { status: s, statusCode: r, headers: i, rawBody: o, body: n }, n) }, (t) => { const { message: s, response: r } = t; e(s, r, r && a.decode(r.rawBody, this.encoding)) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date(); let a = { "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 a) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? a[e] : ("00" + a[e]).substr(("" + a[e]).length))); return t } queryStr(t) { let e = ""; for (const s in t) { let a = t[s]; null != a && "" !== a && ("object" == typeof a && (a = JSON.stringify(a)), (e += `${s}=${a}&`)) } return (e = e.substring(0, e.length - 1)), e } msg(e = t, s = "", a = "", r) { const i = (t) => { switch (typeof t) { case void 0: return t; case "string": switch (this.getEnv()) { case "Surge": case "Stash": default: return { url: t }; case "Loon": case "Shadowrocket": return t; case "Quantumult X": return { "open-url": t }; case "Node.js": return }case "object": switch (this.getEnv()) { case "Surge": case "Stash": case "Shadowrocket": default: { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } case "Loon": { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } case "Quantumult X": { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl, a = t["update-pasteboard"] || t.updatePasteboard; return { "open-url": e, "media-url": s, "update-pasteboard": a, } } case "Node.js": return }default: return } }; if (!this.isMute) switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: $notification.post(e, s, a, i(r)); break; case "Quantumult X": $notify(e, s, a, i(r)); break; case "Node.js": }if (!this.isMuteLog) { let t = ["", "==============📣系统通知📣==============",]; t.push(e), s && t.push(s), a && t.push(a), 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) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": case "Quantumult X": default: this.log("", `❗️${this.name},错误!`, t); break; case "Node.js": this.log("", `❗️${this.name},错误!`, t.stack) } } wait(t) { return new Promise((e) => setTimeout(e, t)) } DoubleLog(d) { if (this.isNode()) { if (d) { console.log(`${d}`); msg += `\n ${d}` } } else { console.log(`${d}`); msg += `\n ${d}` } } async SendMsg(m) { if (!m) return; if (Notify > 0) { if (this.isNode()) { var notify = require("./sendNotify"); await notify.sendNotify(this.name, m) } else { this.msg(this.name, "", m) } } else { console.log(m) } } done(t = {}) { const e = new Date().getTime(), s = (e - this.startTime) / 1e3; switch ((this.log("", `🔔${this.name},结束!🕛${s}秒`), this.log(), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": case "Quantumult X": default: $done(t); break; case "Node.js": process.exit(1) } } })(t, e) } 256 | //Env rewrite:smallfawn Update-time:23-6-30 newAdd:DoubleLog & SendMsg 257 | -------------------------------------------------------------------------------- /废弃仓库/mist.js: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /废弃仓库/tcbjtxq.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * tcbjtxq 4 | * Author: Mist 5 | * Date: 2024-06-14 6 | * vx汤臣倍健汤星球 Authorization 积分换实物 7 | * cron "0 10 * * *" tcbjtxq.js 8 | * export tcbjtxq= Authorization 多账号换行或者#分隔 9 | */ 10 | // ============================================================================================================ 11 | const $ = new Env('vx汤臣倍健汤星球') 12 | const axios = require('axios') 13 | const env_name = 'tcbjtxq' //环境变量名字 14 | const env = process.env[env_name] || '' //获取环境变量 15 | const Notify = 1//是否通知, 1通知, 0不通知. 默认通知 16 | const debug = 0//是否调试, 1调试, 0不调试. 默认不调试 17 | let scriptVersionNow = "1.0.0";//脚本版本号 18 | let msg = ""; 19 | // ==================================异步顺序============================================================================== 20 | !(async () => { 21 | await getNotice(); //远程通知 22 | await getVersion("yang7758258/ohhh154@main/tcbjtxq.js"); 23 | await main();//主函数 24 | await SendMsg(msg); //发送通知 25 | 26 | })() 27 | .catch((e) => $.logErr(e)) 28 | .finally(() => $.done()); 29 | //==================================脚本入口函数main()============================================================== 30 | async function main() { 31 | if (env == '') { 32 | //没有设置变量,直接退出 33 | console.log(`没有填写变量,请查看脚本说明: ${env_name}`) 34 | return 35 | } 36 | let user_ck = env.split('\n') 37 | DoubleLog(`\n=========== 共找到 ${user_ck.length} 个账号 ===========`); 38 | let index = 1 //用来给账号标记序号, 从1开始 39 | for (let ck of user_ck) { 40 | if (!ck) continue //跳过空行 41 | let ck_info = ck.split('&') 42 | let Authorization = ck_info[0] 43 | //let uid = ck_info[0] 44 | //let deviceCode = ck_info[2] 45 | let user = { 46 | index: index, 47 | Authorization, 48 | //uid, 49 | //deviceCode, 50 | } 51 | index = index + 1 //每次用完序号+1 52 | //开始账号任务 53 | await userTask(user) 54 | //每个账号之间等1~5秒随机时间 55 | let rnd_time = Math.floor(Math.random() * 4000) + 1000 56 | console.log(`账号[${user.index}]随机等待${rnd_time / 1000}秒...`) 57 | await $.wait(rnd_time) 58 | } 59 | } 60 | // ======================================开始任务========================================= 61 | async function userTask(user) { 62 | console.log(`\n============= 账号[${user.index}]开始任务 =============`) 63 | await SignTask(user) 64 | await wait (1) 65 | await account(user) 66 | } 67 | // ============================================================================================================================= 68 | //签到 69 | async function SignTask(user) { 70 | try { 71 | let urlObject = { 72 | method: 'post', 73 | url: 'https://vip.by-health.com/vip-api/sign/daily/create', 74 | headers: { 75 | 'Host': 'vip.by-health.com', 76 | 'Content-Type': 'application/json', 77 | 'authorization': user.Authorization, 78 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090a13) XWEB/9129', 79 | }, 80 | data: { 81 | "activityId": 4 82 | } 83 | } 84 | // 85 | let { data: result} = await axios.request(urlObject) 86 | //console.log(result); 87 | if (result?.data.rspCode == '00') { 88 | DoubleLog(`🌸账号[${user.index}]` + `🕊签到成功,获得${result.data.result.dailyPointReward}积分🎉`); 89 | }if(result?.data.rspCode == "SIGN_TODAY_ALREADY_DONE") { 90 | DoubleLog(`🌸账号[${user.index}]签到失败:${result.data.rspMsg}❌`) 91 | }if (result?.code == "500") { 92 | DoubleLog(`🌸账号[${user.index}]可能已签到:${result.msg}❌`) 93 | } 94 | 95 | 96 | } catch (e) { 97 | //打印错误信息 98 | console.log(e.response.data); 99 | // if (e.response.data.code == "422") { 100 | // DoubleLog(`🌸账号[${user.index}]签到失败:${e.response.data.tips}❌`) 101 | // } 102 | 103 | } 104 | } 105 | //账户积分 106 | async function account(user) { 107 | try { 108 | let urlObject = { 109 | method: 'get', 110 | url: 'https://vip.by-health.com/vip-api/member/point/page?page=1&rows=15', 111 | headers: { 112 | 'Host': 'vip.by-health.com', 113 | 'Content-Type': 'application/json', 114 | 'authorization': user.Authorization, 115 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090a13) XWEB/9129', 116 | }, 117 | }; 118 | let { data: result } = await axios.request(urlObject) 119 | //console.log(result); 120 | if (result?.data.rspCode == '00') { 121 | DoubleLog(`🌸账号[${user.index}]🕊今日获得[${result.data.result.results[0].point}]积分,总积分:[${result.data.result.results[0].totalPoint}]💰`) 122 | }else { 123 | DoubleLog(`🌸账号[${user.index}]🕊查询当前积分失败❌`) 124 | } 125 | } catch (e) { 126 | //打印错误信息 127 | console.log(e) 128 | } 129 | } 130 | /** 131 | * =========================================================发送消息============================================= 132 | */ 133 | async function SendMsg(message) { 134 | if (!message) return; 135 | if (Notify > 0) { 136 | if ($.isNode()) { 137 | var notify = require("./sendNotify"); 138 | await notify.sendNotify($.name, message); 139 | } else { 140 | // $.msg(message); 141 | $.msg($.name, '', message) 142 | } 143 | } else { 144 | console.log(message); 145 | } 146 | } 147 | /** 148 | * =====================================================双平台log输出========================================== 149 | */ 150 | function DoubleLog(data) { 151 | if ($.isNode()) { 152 | if (data) { 153 | console.log(`${data}`); 154 | msg += `\n${data}`; 155 | } 156 | } else { 157 | console.log(`${data}`); 158 | msg += `\n${data}`; 159 | } 160 | 161 | } 162 | /** 163 | * ======================================================等待 X 秒============================================ 164 | */ 165 | function wait(n) { 166 | return new Promise(function (resolve) { 167 | setTimeout(resolve, n * 1000); 168 | }); 169 | } 170 | /** 171 | * ======================================================随机等待 1-5 秒============================================ 172 | */ 173 | function sjwait() { 174 | return new Promise(function (resolve) { 175 | let waitTime = Math.floor(Math.random() * 4000 + 1000); 176 | setTimeout(resolve, waitTime); 177 | }); 178 | } 179 | // ==========================================================13位时间戳===================================================== 180 | function getTimestamp() { 181 | return new Date().getTime(); 182 | } 183 | //===============================================网络请求httpRequest========================================= 184 | function httpRequest(options, timeout = 1 * 1000) { 185 | method = options.method ? options.method.toLowerCase() : options.body ? "post" : "get"; 186 | return new Promise(resolve => { 187 | setTimeout(() => { 188 | $[method](options, (err, resp, data) => { 189 | try { 190 | if (err) { 191 | console.log(JSON.stringify(err)); 192 | $.logErr(err); 193 | } else { 194 | try { data = JSON.parse(data); } catch (error) { } 195 | } 196 | } catch (e) { 197 | console.log(e); 198 | $.logErr(e, resp); 199 | } finally { 200 | resolve(data); 201 | } 202 | }) 203 | }, timeout) 204 | }) 205 | } 206 | //==============================================Debug模式=============================================== 207 | function debugLog(...args) { 208 | if (debug) { 209 | console.log(...args); 210 | } 211 | } 212 | //===============================================获取远程通知======================================== 213 | async function getNotice() { 214 | try { 215 | const urls = [ 216 | "https://gitee.com/ohhhooh/jd_haoyangmao/raw/master/Notice.json", 217 | 218 | ]; 219 | let notice = null; 220 | for (const url of urls) { 221 | const options = { url, headers: { "User-Agent": "" }, }; 222 | const result = await httpRequest(options); 223 | if (result && "notice" in result) { 224 | notice = result.notice.replace(/\\n/g, "\n"); 225 | break; 226 | } 227 | } 228 | if (notice) { $.DoubleLog(notice); } 229 | } catch (e) { 230 | console.log(e); 231 | } 232 | } 233 | //==============================================获取远程版本================================================= 234 | function getVersion(scriptUrl, timeout = 3 * 1000) { 235 | return new Promise((resolve) => { 236 | const options = { url: `https://fastly.jsdelivr.net/gh/${scriptUrl}` }; 237 | $.get(options, (err, resp, data) => { 238 | try { 239 | const regex = /scriptVersionNow\s*=\s*(["'`])([\d.]+)\1/; 240 | const match = data.match(regex); 241 | const scriptVersionLatest = match ? match[2] : ""; 242 | console.log(`\n============= 当前版本:${scriptVersionNow} 🌟 最新版本:${scriptVersionLatest} =============`); 243 | } catch (e) { 244 | $.logErr(e, resp); 245 | } 246 | resolve(); 247 | }, timeout); 248 | }); 249 | } 250 | 251 | //=============================================================================================================================================== 252 | //================================================固定API=============================================================================================== 253 | 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, a) => { s.call(this, t, (t, s, r) => { t ? a(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.userList = []; this.userIdx = 0; (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},开始!`) } getEnv() { return "undefined" != typeof $environment && $environment["surge-version"] ? "Surge" : "undefined" != typeof $environment && $environment["stash-version"] ? "Stash" : "undefined" != typeof module && module.exports ? "Node.js" : "undefined" != typeof $task ? "Quantumult X" : "undefined" != typeof $loon ? "Loon" : "undefined" != typeof $rocket ? "Shadowrocket" : void 0 } isNode() { return "Node.js" === this.getEnv() } isQuanX() { return "Quantumult X" === this.getEnv() } isSurge() { return "Surge" === this.getEnv() } isLoon() { return "Loon" === this.getEnv() } isShadowrocket() { return "Shadowrocket" === this.getEnv() } isStash() { return "Stash" === this.getEnv() } 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 a = this.getdata(t); if (a) 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, a) => e(a)) }) } runScript(t, e) { return new Promise((s) => { let a = this.getdata("@chavy_boxjs_userCfgs.httpapi"); a = a ? a.replace(/\n/g, "").trim() : a; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); (r = r ? 1 * r : 20), (r = e && e.timeout ? e.timeout : r); const [i, o] = a.split("@"), n = { url: `http://${o}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": i, Accept: "*/*" }, timeout: r, }; this.post(n, (t, e, a) => s(a)) }).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), a = !s && this.fs.existsSync(e); if (!s && !a) return {}; { const a = s ? t : e; try { return JSON.parse(this.fs.readFileSync(a)) } 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), a = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : a ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const a = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of a) 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, a) => Object(t[s]) === t[s] ? t[s] : (t[s] = Math.abs(e[a + 1]) >> 0 == +e[a + 1] ? [] : {}), t)[e[e.length - 1]] = s), t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, a] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, a, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, a, r] = /^@(.*?)\.(.*?)$/.exec(e), i = this.getval(a), o = a ? ("null" === i ? null : i || "{}") : "{}"; try { const e = JSON.parse(o); this.lodash_set(e, r, t), (s = this.setval(JSON.stringify(e), a)) } catch (e) { const i = {}; this.lodash_set(i, r, t), (s = this.setval(JSON.stringify(i), a)) } } else s = this.setval(t, e); return s } getval(t) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": return $persistentStore.read(t); case "Quantumult X": return $prefs.valueForKey(t); case "Node.js": return (this.data = this.loaddata()), this.data[t]; default: return (this.data && this.data[t]) || null } } setval(t, e) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": return $persistentStore.write(t, e); case "Quantumult X": return $prefs.setValueForKey(t, e); case "Node.js": return ((this.data = this.loaddata()), (this.data[e] = t), this.writedata(), !0); default: return (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 = () => { }) { switch ((t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"], delete t.headers["content-type"], delete t.headers["content-length"]), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: this.isSurge() && this.isNeedRewrite && ((t.headers = t.headers || {}), Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, a) => { !t && s && ((s.body = a), (s.statusCode = s.status ? s.status : s.statusCode), (s.status = s.statusCode)), e(t, s, a) }); break; case "Quantumult X": this.isNeedRewrite && ((t.opts = t.opts || {}), Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then((t) => { const { statusCode: s, statusCode: a, headers: r, body: i, bodyBytes: o, } = t; e(null, { status: s, statusCode: a, headers: r, body: i, bodyBytes: o, }, i, o) }, (t) => e((t && t.error) || "UndefinedError")); break; case "Node.js": let s = require("iconv-lite"); 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: a, statusCode: r, headers: i, rawBody: o, } = t, n = s.decode(o, this.encoding); e(null, { status: a, statusCode: r, headers: i, rawBody: o, body: n, }, n) }, (t) => { const { message: a, response: r } = t; e(a, r, r && s.decode(r.rawBody, this.encoding)) }) } } post(t, e = () => { }) { const s = t.method ? t.method.toLocaleLowerCase() : "post"; switch ((t.body && t.headers && !t.headers["Content-Type"] && !t.headers["content-type"] && (t.headers["content-type"] = "application/x-www-form-urlencoded"), t.headers && (delete t.headers["Content-Length"], delete t.headers["content-length"]), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: this.isSurge() && this.isNeedRewrite && ((t.headers = t.headers || {}), Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient[s](t, (t, s, a) => { !t && s && ((s.body = a), (s.statusCode = s.status ? s.status : s.statusCode), (s.status = s.statusCode)), e(t, s, a) }); break; case "Quantumult X": (t.method = s), this.isNeedRewrite && ((t.opts = t.opts || {}), Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then((t) => { const { statusCode: s, statusCode: a, headers: r, body: i, bodyBytes: o, } = t; e(null, { status: s, statusCode: a, headers: r, body: i, bodyBytes: o, }, i, o) }, (t) => e((t && t.error) || "UndefinedError")); break; case "Node.js": let a = require("iconv-lite"); this.initGotEnv(t); const { url: r, ...i } = t; this.got[s](r, i).then((t) => { const { statusCode: s, statusCode: r, headers: i, rawBody: o, } = t, n = a.decode(o, this.encoding); e(null, { status: s, statusCode: r, headers: i, rawBody: o, body: n }, n) }, (t) => { const { message: s, response: r } = t; e(s, r, r && a.decode(r.rawBody, this.encoding)) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date(); let a = { "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 a) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? a[e] : ("00" + a[e]).substr(("" + a[e]).length))); return t } queryStr(t) { let e = ""; for (const s in t) { let a = t[s]; null != a && "" !== a && ("object" == typeof a && (a = JSON.stringify(a)), (e += `${s}=${a}&`)) } return (e = e.substring(0, e.length - 1)), e } msg(e = t, s = "", a = "", r) { const i = (t) => { switch (typeof t) { case void 0: return t; case "string": switch (this.getEnv()) { case "Surge": case "Stash": default: return { url: t }; case "Loon": case "Shadowrocket": return t; case "Quantumult X": return { "open-url": t }; case "Node.js": return }case "object": switch (this.getEnv()) { case "Surge": case "Stash": case "Shadowrocket": default: { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } case "Loon": { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } case "Quantumult X": { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl, a = t["update-pasteboard"] || t.updatePasteboard; return { "open-url": e, "media-url": s, "update-pasteboard": a, } } case "Node.js": return }default: return } }; if (!this.isMute) switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: $notification.post(e, s, a, i(r)); break; case "Quantumult X": $notify(e, s, a, i(r)); break; case "Node.js": }if (!this.isMuteLog) { let t = ["", "==============📣系统通知📣==============",]; t.push(e), s && t.push(s), a && t.push(a), 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) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": case "Quantumult X": default: this.log("", `❗️${this.name},错误!`, t); break; case "Node.js": this.log("", `❗️${this.name},错误!`, t.stack) } } wait(t) { return new Promise((e) => setTimeout(e, t)) } DoubleLog(d) { if (this.isNode()) { if (d) { console.log(`${d}`); msg += `\n ${d}` } } else { console.log(`${d}`); msg += `\n ${d}` } } async SendMsg(m) { if (!m) return; if (Notify > 0) { if (this.isNode()) { var notify = require("./sendNotify"); await notify.sendNotify(this.name, m) } else { this.msg(this.name, "", m) } } else { console.log(m) } } done(t = {}) { const e = new Date().getTime(), s = (e - this.startTime) / 1e3; switch ((this.log("", `🔔${this.name},结束!🕛${s}秒`), this.log(), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": case "Quantumult X": default: $done(t); break; case "Node.js": process.exit(1) } } })(t, e) } 254 | //Env rewrite:smallfawn Update-time:23-6-30 newAdd:DoubleLog & SendMsg 255 | -------------------------------------------------------------------------------- /第一电动.py: -------------------------------------------------------------------------------- 1 | import os 2 | import requests 3 | import time 4 | import hashlib 5 | import random 6 | 7 | # 获取青龙面板环境变量 dydd 8 | dydd = os.environ.get('dydd', '') 9 | 10 | # 按换行符分割账号,并过滤空行 11 | accounts = [line.strip() for line in dydd.strip().split('\n') if line.strip()] 12 | 13 | url = "https://app2.d1ev.com/api/user/add-integral" 14 | 15 | # 公共参数 16 | params_base = { 17 | 'app_id': "d1ev_app", 18 | 'appName': "第一电动", 19 | 'os': "android", 20 | 'osVer': "9", 21 | 'vName': "2.5.6", 22 | 'vCode': "20506" 23 | } 24 | 25 | headers = { 26 | 'User-Agent': "Dalvik/2.1.0 (Linux; U; Android 9; PCRT00 Build/PQ3A.190605.06201646)", 27 | 'Connection': "Keep-Alive", 28 | 'Accept-Encoding': "gzip", 29 | 'TE': "gzip, deflate; q=0.5" 30 | } 31 | 32 | # 定义任务列表,每个任务包括任务类型和执行次数 33 | tasks = [ 34 | {'type': 11, 'name': '签到', 'count': 1}, 35 | {'type': 3, 'name': '分享', 'count': 3}, 36 | {'type': 5, 'name': '点赞', 'count': 5}, 37 | {'type': 2, 'name': '阅读', 'count': 1} 38 | ] 39 | 40 | for account in accounts: 41 | # 分割账号为 uid 和 token 42 | parts = account.split('#') 43 | if len(parts) != 2: 44 | print(f"跳过无效格式账号: {account}") 45 | continue 46 | 47 | uid, token = parts 48 | 49 | # 生成当前时间戳 50 | current_timestamp = str(int(time.time())) 51 | 52 | for task in tasks: 53 | task_type = task['type'] 54 | task_name = task['name'] 55 | task_count = task['count'] 56 | 57 | for _ in range(task_count): 58 | if task_type == 3 or task_type == 5 or task_type == 2: # 分享、点赞和阅读任务 59 | # 生成随机的 targetId 和 targetType 60 | target_id = f"2{random.randint(100000, 999999)}" 61 | target_type = f"{random.randint(10, 99)}" 62 | 63 | # 签到签名 64 | sign_str = f"OMKCy2UxZwn8e4Ak{params_base['appName']}{params_base['app_id']}{params_base['os']}{params_base['osVer']}{target_id}{target_type}{current_timestamp}{token}{task_type}{uid}{params_base['vCode']}{params_base['vName']}" 65 | else: 66 | # 其他任务签名 67 | sign_str = f"OMKCy2UxZwn8e4Ak{params_base['appName']}{params_base['app_id']}{params_base['os']}{params_base['osVer']}{current_timestamp}{token}{task_type}{uid}{params_base['vCode']}{params_base['vName']}" 68 | 69 | # 计算 MD5 签名 70 | sign = hashlib.md5(sign_str.encode('utf-8')).hexdigest() 71 | 72 | # 定义带有动态值的参数 73 | params = { 74 | 'timestamp': current_timestamp, 75 | 'token': token, 76 | 'uid': uid, 77 | 'type': task_type, 78 | 'sign': sign.upper(), 79 | **params_base 80 | } 81 | 82 | if task_type == 3 or task_type == 5 or task_type == 2: 83 | params['targetId'] = target_id 84 | params['targetType'] = target_type 85 | 86 | try: 87 | # 发送 GET 请求 88 | response = requests.get(url, params=params, headers=headers) 89 | response.raise_for_status() # 如果请求失败,则抛出异常 90 | 91 | # 打印任务执行结果 92 | print(f"账号: {uid}, 任务: {task_name}, 响应: {response.text}") 93 | except requests.exceptions.RequestException as e: 94 | print(f"账号: {uid}, 任务: {task_name}, 请求失败: {e}") 95 | 96 | # 任务间隔5秒 97 | time.sleep(5) 98 | 99 | # 任务类型间隔10秒 100 | time.sleep(10) -------------------------------------------------------------------------------- /长虹美菱.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | import requests 4 | 5 | 6 | 7 | # 环境变量 chmlck 取url请求头中的token, 8 | 9 | #变量格式 token#备注,多账号换行 10 | 11 | 12 | 13 | accounts = os.getenv("chmlck", "").splitlines() 14 | 15 | print("☞☞☞ 长虹美菱每日签到 ☜☜☜\n") 16 | 17 | 18 | 19 | if not accounts: 20 | 21 | print("未找到任何账号信息。") 22 | 23 | else: 24 | 25 | for account in accounts: 26 | 27 | if not account.strip(): 28 | 29 | continue 30 | 31 | try: 32 | 33 | token, note = account.split("#") 34 | 35 | except ValueError: 36 | 37 | print(f"格式错误: {account}") 38 | 39 | continue 40 | 41 | 42 | 43 | url = "https://hongke.changhong.com/gw/applet/aggr/signin" 44 | 45 | params = {'aggrId': "608"} 46 | 47 | headers = { 48 | 49 | 'User-Agent': "Mozilla/5.0 (Linux; Android 10; Mobile Safari/537.36)", 50 | 51 | 'Accept-Encoding': "gzip, deflate", 52 | 53 | 'Content-Type': "application/json", 54 | 55 | 'Token': token.strip() 56 | 57 | } 58 | 59 | 60 | 61 | try: 62 | 63 | response = requests.post(url, params=params, headers=headers) 64 | 65 | if response.status_code == 200: 66 | 67 | print(f"{note.strip()}:签到成功") 68 | 69 | elif response.status_code == 400: 70 | 71 | print(f"{note.strip()}:请勿重复签到") 72 | 73 | else: 74 | 75 | print(f"{note.strip()}:响应状态码 {response.status_code} - {response.text}") 76 | 77 | except requests.RequestException as e: 78 | 79 | print(f"{note.strip()}:请求失败 - {e}") 80 | --------------------------------------------------------------------------------