├── ApiRequest.py ├── README.md ├── aliYun.js ├── babycare.js ├── hdl.js ├── imeik.py ├── ksfcys.py ├── kuaishou.py ├── kuaishou_jisu.py ├── mytool.py ├── notify.py ├── qimao.js ├── qzds.py ├── sendNotify.py ├── utils.js ├── xinxi.py ├── xmyx.js ├── xmyxFix.js ├── zippo.py ├── 七猫抽奖+转盘.py ├── 七猫抽奖领宝箱.py ├── 中健365.py ├── 中国联通修复版.js ├── 伊利甄选.py ├── 北京喜乐多.py ├── 北京趣味多.py ├── 叮当快药.py ├── 天瑞地安现金版本.py ├── 天瑞地安积分.py ├── 太平通.js ├── 好人家美味生活馆.js ├── 拼多多果园.js ├── 新战马能量星球.js ├── 特仑苏.py ├── 联通获取ck.py ├── 阅龙湾.js ├── 顺丰.py └── 饿了么果园极速版.py /ApiRequest.py: -------------------------------------------------------------------------------- 1 | import os 2 | import traceback 3 | 4 | import requests 5 | import urllib3 6 | 7 | import mytool 8 | import notify 9 | 10 | 11 | class ApiRequest: 12 | def __init__(self): 13 | urllib3.disable_warnings() 14 | self.sec = requests.session() 15 | self.sec.verify = False 16 | self.sec.trust_env = False 17 | self.sendmsg = '' 18 | self.title = '' 19 | 20 | def send(self): 21 | notify.send(self.title, self.sendmsg) 22 | 23 | 24 | class ApiMain: 25 | def __init__(self, funcName): 26 | self.funcName = funcName 27 | pass 28 | 29 | def run(self, envName, request): 30 | if os.path.exists('debug.py'): 31 | import debug 32 | debug.setDebugEnv() 33 | 34 | if mytool.getlistCk(f'{envName}') is None: 35 | print(f'请检查你的变量名称 {envName} 是否填写正确') 36 | exit(0) 37 | else: 38 | for i in mytool.getlistCk(f'{envName}'): 39 | for func in self.funcName: 40 | try: 41 | getattr(request(i), func)() 42 | except: 43 | traceback.print_exc() 44 | pass 45 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 到处收集,侵权必删! 2 | 青龙脚本自用 3 | -------------------------------------------------------------------------------- /aliYun.js: -------------------------------------------------------------------------------- 1 | //阿里云盘连续签到活动 2 | //https://alist.nn.ci/zh/guide/drivers/aliyundrive.html 打开页面扫码获取refresh_token 3 | //环境变量:ALI_TOKEN,多账号用换行或@或&分隔 4 | // const $ = new Env('阿里云盘') 5 | 6 | const $ = API(); 7 | let refresh_token = []; 8 | let msg = []; 9 | !(async () => { 10 | 11 | if ($.env.isNode) { 12 | if (process.env.ALI_TOKEN) { 13 | if (process.env.ALI_TOKEN.indexOf('&') > -1) { 14 | refresh_token = process.env.ALI_TOKEN.split('&'); 15 | } else if (process.env.ALI_TOKEN.indexOf('\n') > -1) { 16 | refresh_token = process.env.ALI_TOKEN.split('\n'); 17 | } else if (process.env.ALI_TOKEN.indexOf('@') > -1) { 18 | refresh_token = process.env.ALI_TOKEN.split('@'); 19 | } else { 20 | refresh_token = [process.env.ALI_TOKEN]; 21 | } 22 | } 23 | } 24 | 25 | if (!refresh_token || refresh_token.length == 0) { 26 | console.log('先填写refresh_token!'); 27 | return; 28 | } 29 | for (const tk of refresh_token) { 30 | msg = []; 31 | await main(tk); 32 | await $.wait(1000); 33 | } 34 | 35 | })().catch(async (e) => { 36 | console.log('', '❌失败! 原因:' + e + '!', ''); 37 | }).finally(() => { 38 | $.done(); 39 | }); 40 | 41 | async function main(tk) { 42 | try { 43 | const url = `https://auth.aliyundrive.com/v2/account/token`; 44 | const method = `POST`; 45 | const headers = { 46 | 'Connection': `keep-alive`, 47 | 'Content-Type': `application/json; charset=UTF-8`, 48 | 'X-Canary': `client=iOS,app=adrive,version=v4.1.3`, 49 | 'User-Agent': `AliApp(AYSD/4.1.3) com.alicloud.smartdrive/4.1.3 Version/16.3 Channel/201200 Language/zh-Hans-CN /iOS Mobile/iPhone15,2`, 50 | 'Host': `auth.aliyundrive.com`, 51 | 'Accept-Language': `zh-CN,zh-Hans;q=0.9`, 52 | 'Accept': `*/*` 53 | }; 54 | const body = `{"grant_type":"refresh_token","app_id":"pJZInNHN2dZWk8qg","refresh_token":"${tk}"}`; 55 | 56 | const myRequest = { 57 | url: url, 58 | method: method, 59 | headers: headers, 60 | body: body 61 | }; 62 | 63 | let a = await $.http.post(myRequest); 64 | let data = JSON.parse(a.body); 65 | if (data.code == 'InvalidParameter.RefreshToken') { 66 | //{"code":"InvalidParameter.RefreshToken","message":"The input parameter refresh_token is not valid. ","requestId":null} 67 | console.log(`token刷新失败,${data.message}`); 68 | msg.push(`token刷新失败,${data.message}`); 69 | } 70 | else { 71 | console.log(data.nick_name); 72 | let token = data.access_token; 73 | msg.push(data.nick_name); 74 | await sign(token); 75 | } 76 | 77 | } catch (error) { 78 | console.log('error:' + error); 79 | } 80 | } 81 | 82 | async function sign(token) { 83 | try { 84 | const url = `https://member.aliyundrive.com/v1/activity/sign_in_list`; 85 | const method = `POST`; 86 | const headers = { 87 | 'Connection': `keep-alive`, 88 | 'Content-Type': `application/json`, 89 | 'Origin': `https://pages.aliyundrive.com`, 90 | 'X-Canary': `client=web,app=other,version=v0.1.0`, 91 | 'User-Agent': `Mozilla/5.0 (iPhone; CPU iPhone OS 16_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/20D5024e iOS16.3 (iPhone15,2;zh-Hans-CN) App/4.1.3 AliApp(yunpan/4.1.3) com.alicloud.smartdrive/28278449 Channel/201200 AliApp(AYSD/4.1.3) com.alicloud.smartdrive/4.1.3 Version/16.3 Channel/201200 Language/zh-Hans-CN /iOS Mobile/iPhone15,2 language/zh-Hans-CN`, 92 | 'Authorization': `Bearer ${token}`, 93 | 'Host': `member.aliyundrive.com`, 94 | 'Referer': `https://pages.aliyundrive.com/`, 95 | 'Accept-Language': `zh-CN,zh-Hans;q=0.9`, 96 | 'Accept': `application/json, text/plain, */*` 97 | }; 98 | const body = `{"isReward":false}`; 99 | 100 | const myRequest = { 101 | url: url, 102 | method: method, 103 | headers: headers, 104 | body: body 105 | }; 106 | let a = await $.http.post(myRequest); 107 | let data = JSON.parse(a.body); 108 | if (data.success) { 109 | console.log(`已连续签到${data.result.signInCount}天!`); 110 | msg.push(`已连续签到${data.result.signInCount}天!`); 111 | await sign_in_reward(token, data.result.signInCount); 112 | } 113 | else { 114 | console.log(`签到失败,${data.message}!`); 115 | msg.push(`签到失败,${data.message}!`); 116 | } 117 | 118 | } catch (error) { 119 | console.log(error); 120 | } 121 | } 122 | 123 | async function sign_in_reward(token, day) { 124 | try { 125 | const url = `https://member.aliyundrive.com/v1/activity/sign_in_reward`; 126 | const method = `POST`; 127 | const headers = { 128 | 'Connection': `keep-alive`, 129 | 'Content-Type': `application/json`, 130 | 'Origin': `https://pages.aliyundrive.com`, 131 | 'X-Canary': `client=web,app=other,version=v0.1.0`, 132 | 'User-Agent': `Mozilla/5.0 (iPhone; CPU iPhone OS 16_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/20D5024e iOS16.3 (iPhone15,2;zh-Hans-CN) App/4.1.3 AliApp(yunpan/4.1.3) com.alicloud.smartdrive/28278449 Channel/201200 AliApp(AYSD/4.1.3) com.alicloud.smartdrive/4.1.3 Version/16.3 Channel/201200 Language/zh-Hans-CN /iOS Mobile/iPhone15,2 language/zh-Hans-CN`, 133 | 'Authorization': `Bearer ${token}`, 134 | 'Host': `member.aliyundrive.com`, 135 | 'Referer': `https://pages.aliyundrive.com/`, 136 | 'Accept-Language': `zh-CN,zh-Hans;q=0.9`, 137 | 'Accept': `application/json, text/plain, */*` 138 | }; 139 | const body = `{"signInDay":${day}}`; 140 | 141 | const myRequest = { 142 | url: url, 143 | method: method, 144 | headers: headers, 145 | body: body 146 | }; 147 | 148 | let a = await $.http.post(myRequest); 149 | let data = JSON.parse(a.body); 150 | if (data.success) { 151 | if (data?.result?.name) { 152 | console.log(`🎁奖励:${data?.result?.name},${data?.result?.description},${data?.result?.notice}!`); 153 | msg.push(`🎁奖励:${data?.result?.name},${data?.result?.description},${data?.result?.notice}!`); 154 | } 155 | else { 156 | console.log(`🎁奖励:领了个寂寞!`); 157 | msg.push(`🎁奖励:领了个寂寞!`); 158 | } 159 | } 160 | else { 161 | console.log(`🎁奖励获取失败:${data.message}!`); 162 | msg.push(`🎁奖励获取失败:${data.message}!`); 163 | } 164 | 165 | try { 166 | if ($.env.isNode) { 167 | const notify = require('./sendNotify'); 168 | notify.sendNotify('【阿里云盘】' + msg[0], msg[1] + ',' + msg[2]); 169 | } 170 | else { 171 | $.notify('【阿里云盘】' + msg[0], msg[1] + ',' + msg[2]); 172 | } 173 | } catch (error) { 174 | console.log('通知发送失败', +error); 175 | } 176 | 177 | } catch (error) { 178 | console.log(error); 179 | } 180 | } 181 | 182 | 183 | /*********************************** API *************************************/ 184 | function ENV() { const e = "undefined" != typeof $task, t = "undefined" != typeof $loon, s = "undefined" != typeof $httpClient && !t, i = "function" == typeof require && "undefined" != typeof $jsbox; return { isQX: e, isLoon: t, isSurge: s, isNode: "function" == typeof require && !i, isJSBox: i, isRequest: "undefined" != typeof $request, isScriptable: "undefined" != typeof importModule } } function HTTP(e = { baseURL: "" }) { const { isQX: t, isLoon: s, isSurge: i, isScriptable: n, isNode: o } = ENV(), r = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&\/\/=]*)/; const u = {}; return ["GET", "POST", "PUT", "DELETE", "HEAD", "OPTIONS", "PATCH"].forEach(l => u[l.toLowerCase()] = (u => (function (u, l) { l = "string" == typeof l ? { url: l } : l; const h = e.baseURL; h && !r.test(l.url || "") && (l.url = h ? h + l.url : l.url); const a = (l = { ...e, ...l }).timeout, c = { onRequest: () => { }, onResponse: e => e, onTimeout: () => { }, ...l.events }; let f, d; if (c.onRequest(u, l), t) f = $task.fetch({ method: u, ...l }); else if (s || i || o) f = new Promise((e, t) => { (o ? require("request") : $httpClient)[u.toLowerCase()](l, (s, i, n) => { s ? t(s) : e({ statusCode: i.status || i.statusCode, headers: i.headers, body: n }) }) }); else if (n) { const e = new Request(l.url); e.method = u, e.headers = l.headers, e.body = l.body, f = new Promise((t, s) => { e.loadString().then(s => { t({ statusCode: e.response.statusCode, headers: e.response.headers, body: s }) }).catch(e => s(e)) }) } const p = a ? new Promise((e, t) => { d = setTimeout(() => (c.onTimeout(), t(`${u} URL: ${l.url} exceeds the timeout ${a} ms`)), a) }) : null; return (p ? Promise.race([p, f]).then(e => (clearTimeout(d), e)) : f).then(e => c.onResponse(e)) })(l, u))), u } function API(e = "untitled", t = !1) { const { isQX: s, isLoon: i, isSurge: n, isNode: o, isJSBox: r, isScriptable: u } = ENV(); return new class { constructor(e, t) { this.name = e, this.debug = t, this.http = HTTP(), this.env = ENV(), this.node = (() => { if (o) { return { fs: require("fs") } } return null })(), this.initCache(); Promise.prototype.delay = function (e) { return this.then(function (t) { return ((e, t) => new Promise(function (s) { setTimeout(s.bind(null, t), e) }))(e, t) }) } } initCache() { if (s && (this.cache = JSON.parse($prefs.valueForKey(this.name) || "{}")), (i || n) && (this.cache = JSON.parse($persistentStore.read(this.name) || "{}")), o) { let e = "root.json"; this.node.fs.existsSync(e) || this.node.fs.writeFileSync(e, JSON.stringify({}), { flag: "wx" }, e => console.log(e)), this.root = {}, e = `${this.name}.json`, this.node.fs.existsSync(e) ? this.cache = JSON.parse(this.node.fs.readFileSync(`${this.name}.json`)) : (this.node.fs.writeFileSync(e, JSON.stringify({}), { flag: "wx" }, e => console.log(e)), this.cache = {}) } } persistCache() { const e = JSON.stringify(this.cache, null, 2); s && $prefs.setValueForKey(e, this.name), (i || n) && $persistentStore.write(e, this.name), o && (this.node.fs.writeFileSync(`${this.name}.json`, e, { flag: "w" }, e => console.log(e)), this.node.fs.writeFileSync("root.json", JSON.stringify(this.root, null, 2), { flag: "w" }, e => console.log(e))) } write(e, t) { if (this.log(`SET ${t}`), -1 !== t.indexOf("#")) { if (t = t.substr(1), n || i) return $persistentStore.write(e, t); if (s) return $prefs.setValueForKey(e, t); o && (this.root[t] = e) } else this.cache[t] = e; this.persistCache() } read(e) { return this.log(`READ ${e}`), -1 === e.indexOf("#") ? this.cache[e] : (e = e.substr(1), n || i ? $persistentStore.read(e) : s ? $prefs.valueForKey(e) : o ? this.root[e] : void 0) } delete(e) { if (this.log(`DELETE ${e}`), -1 !== e.indexOf("#")) { if (e = e.substr(1), n || i) return $persistentStore.write(null, e); if (s) return $prefs.removeValueForKey(e); o && delete this.root[e] } else delete this.cache[e]; this.persistCache() } notify(e, t = "", l = "", h = {}) { const a = h["open-url"], c = h["media-url"]; if (s && $notify(e, t, l, h), n && $notification.post(e, t, l + `${c ? "\n多媒体:" + c : ""}`, { url: a }), i) { let s = {}; a && (s.openUrl = a), c && (s.mediaUrl = c), "{}" === JSON.stringify(s) ? $notification.post(e, t, l) : $notification.post(e, t, l, s) } if (o || u) { const s = l + (a ? `\n点击跳转: ${a}` : "") + (c ? `\n多媒体: ${c}` : ""); if (r) { require("push").schedule({ title: e, body: (t ? t + "\n" : "") + s }) } else console.log(`${e}\n${t}\n${s}\n\n`) } } log(e) { this.debug && console.log(`[${this.name}] LOG: ${this.stringify(e)}`) } info(e) { console.log(`[${this.name}] INFO: ${this.stringify(e)}`) } error(e) { console.log(`[${this.name}] ERROR: ${this.stringify(e)}`) } wait(e) { return new Promise(t => setTimeout(t, e)) } done(e = {}) { s || i || n ? $done(e) : o && !r && "undefined" != typeof $context && ($context.headers = e.headers, $context.statusCode = e.statusCode, $context.body = e.body) } stringify(e) { if ("string" == typeof e || e instanceof String) return e; try { return JSON.stringify(e, null, 2) } catch (e) { return "[object Object]" } } }(e, t) } 185 | /*****************************************************************************/ 186 | -------------------------------------------------------------------------------- /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 -------------------------------------------------------------------------------- /hdl.js: -------------------------------------------------------------------------------- 1 | /* 2 | 作者:临渊 3 | 日期:6-21 4 | 小程序:海底捞(活动入口:首页->每日签到) 5 | 功能:签到(积分可以兑换菜品、火锅) 6 | 抓包:superapp-public.kiwa-tech.com 此域名下的任意 _haidilao_app_token (TK有效期未知) 7 | 示例:TOKEN_APP_xx-xx-xx-xx-xx 8 | 变量格式:export hdlTk='xxx@xxx ' 多个账号用@或者换行分割 9 | 定时:一天一次 10 | cron:20 10 * * * 11 | */ 12 | 13 | const $ = new Env('海底捞'); 14 | const notify = $.isNode() ? require('./sendNotify') : ''; 15 | const {log} = console; 16 | const Notify = 1; //0为关闭通知,1为打开通知,默认为1 17 | const debug = 0; //0为关闭调试,1为打开调试,默认为0 18 | ////////////////////// 19 | let hdlTk = process.env.hdlTk; 20 | let hdlTkArr = []; 21 | let data = ''; 22 | let msg = ''; 23 | let mobile = ''; 24 | let hdlBack = 0; 25 | 26 | 27 | !(async () => { 28 | 29 | if (!(await Envs())) 30 | return; 31 | else { 32 | 33 | 34 | 35 | log(`\n\n============================================= \n脚本执行 - 北京时间(UTC+8):${new Date( 36 | new Date().getTime() + new Date().getTimezoneOffset() * 60 * 1000 + 37 | 8 * 60 * 60 * 1000).toLocaleString()} \n=============================================\n`); 38 | 39 | await poem(); 40 | 41 | log(`\n=================== 共找到 ${hdlTkArr.length} 个账号 ===================`) 42 | 43 | if (debug) { 44 | log(`【debug】 这是你的全部账号数组:\n ${hdlTkArr}`); 45 | } 46 | 47 | 48 | for (let index = 0; index < hdlTkArr.length; index++) { 49 | 50 | let num = index + 1 51 | log(`\n========= 开始【第 ${num} 个账号】=========\n`) 52 | 53 | hdlTk = hdlTkArr[index]; 54 | 55 | if (debug) { 56 | log(`\n 【debug】 这是你第 ${num} 账号信息:\n ${hdltk}\n`); 57 | } 58 | 59 | msg += `\n第${num}个账号运行结果:` 60 | log('开始获取信息'); 61 | await getInfo(); 62 | await $.wait(2 * 1000); 63 | 64 | if (hdlBack) { 65 | log('开始签到'); 66 | await doSignin(); 67 | await $.wait(2 * 1000); 68 | 69 | log('开始查询积分余额'); 70 | await getFragment(); 71 | await $.wait(2 * 1000); 72 | } 73 | 74 | } 75 | await SendMsg(msg); 76 | } 77 | 78 | })() 79 | .catch((e) => log(e)) 80 | .finally(() => $.done()) 81 | 82 | /** 83 | * 获取信息 84 | */ 85 | function getInfo(timeout = 3 * 1000) { 86 | return new Promise((resolve) => { 87 | let url = { 88 | url: `https://superapp-public.kiwa-tech.com/activity/wxapp/applet/queryGrowthInfo`, 89 | headers: {"Host":"superapp-public.kiwa-tech.com","content-type":"application/json","user-agent":"Mozilla/5.0 (Linux; Android 10; MI 8 Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/86.0.4240.99 XWEB/3235 MMWEBSDK/20220204 Mobile Safari/537.36 MMWEBID/6242 MicroMessenger/8.0.20.2080(0x28001435) Process/appbrand2 WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 miniProgram/wx1ddeb67115f30d1a","reqtype":"APPH5","_haidilao_app_token":`${hdlTk}`}, 90 | body: '{}', 91 | } 92 | 93 | if (debug) { 94 | log(`\n【debug】=============== 这是 获取信息 请求 url ===============`); 95 | log(JSON.stringify(url)); 96 | } 97 | 98 | $.post(url, async (error, response, data) => { 99 | try { 100 | if (debug) { 101 | log(`\n\n【debug】===============这是 获取信息 返回data==============`); 102 | log(data) 103 | } 104 | 105 | let result = JSON.parse(data); 106 | if (result.success == true) { 107 | 108 | mobile = result.data.mobile; 109 | hdlBack = 1; 110 | 111 | } else if (result.success == false) { 112 | 113 | log(`获取账号信息失败,请检查变量`) 114 | msg += `\n获取账号信息失败,请检查变量` 115 | 116 | } else { 117 | 118 | log(`获取账号信息失败,原因是:${result.msg}`) 119 | msg += `\n获取账号信息失败,原因是:${result.msg}` 120 | 121 | } 122 | 123 | } catch (e) { 124 | log(e) 125 | } finally { 126 | resolve(); 127 | } 128 | }, timeout) 129 | }) 130 | } 131 | 132 | /** 133 | * 签到 134 | */ 135 | function doSignin(timeout = 3 * 1000) { 136 | return new Promise((resolve) => { 137 | let url = { 138 | url: `https://superapp-public.kiwa-tech.com/activity/wxapp/signin/signin`, 139 | headers: {"Host":"superapp-public.kiwa-tech.com","Content-Type":"application/json","user-agent":"Mozilla/5.0 (Linux; Android 10; MI 8 Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/86.0.4240.99 XWEB/3235 MMWEBSDK/20220204 Mobile Safari/537.36 MMWEBID/6242 MicroMessenger/8.0.20.2080(0x28001435) Process/appbrand2 WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 miniProgram/wx1ddeb67115f30d1a","reqtype":"APPH5","_haidilao_app_token":`${hdlTk}`}, 140 | body: '{"signinSource":"MiniApp"}', 141 | } 142 | 143 | if (debug) { 144 | log(`\n【debug】=============== 这是 签到 请求 url ===============`); 145 | log(JSON.stringify(url)); 146 | } 147 | 148 | $.post(url, async (error, response, data) => { 149 | try { 150 | if (debug) { 151 | log(`\n\n【debug】===============这是 签到 返回data==============`); 152 | log(data) 153 | } 154 | 155 | let result = JSON.parse(data); 156 | let back = eval(result.data); 157 | if (result.success == true) { 158 | 159 | log(`账号[${mobile}]签到成功,获得:${back.signinQueryDetailList[0].fragment}积分`) 160 | msg += `\n账号[${mobile}]签到成功,获得:${back.signinQueryDetailList[0].fragment}积分` 161 | 162 | } else if (result.success == false) { 163 | 164 | log(`账号[${mobile}]签到失败,原因是:${result.msg}`) 165 | msg += `\n账号[${mobile}]签到失败,原因是:${result.msg}` 166 | 167 | } else { 168 | 169 | log(`账号[${mobile}]签到失败,原因是:${result.error}`) 170 | msg += `\n账号[${mobile}]签到失败,原因是:${result.error}` 171 | 172 | } 173 | 174 | } catch (e) { 175 | log(e) 176 | } finally { 177 | resolve(); 178 | } 179 | }, timeout) 180 | }) 181 | } 182 | 183 | /** 184 | * 查询积分余额 185 | */ 186 | function getFragment(timeout = 3 * 1000) { 187 | return new Promise((resolve) => { 188 | let url = { 189 | url: `https://superapp-public.kiwa-tech.com/activity/wxapp/signin/queryFragment`, 190 | headers: {"Host":"superapp-public.kiwa-tech.com","content-type":"application/json","user-agent":"Mozilla/5.0 (Linux; Android 10; MI 8 Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/86.0.4240.99 XWEB/3235 MMWEBSDK/20220204 Mobile Safari/537.36 MMWEBID/6242 MicroMessenger/8.0.20.2080(0x28001435) Process/appbrand2 WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 miniProgram/wx1ddeb67115f30d1a","reqtype":"APPH5","_haidilao_app_token":`${hdlTk}`}, 191 | body: '', 192 | } 193 | 194 | if (debug) { 195 | log(`\n【debug】=============== 这是 查询积分余额 请求 url ===============`); 196 | log(JSON.stringify(url)); 197 | } 198 | 199 | $.post(url, async (error, response, data) => { 200 | try { 201 | if (debug) { 202 | log(`\n\n【debug】===============这是 查询积分余额 返回data==============`); 203 | log(data) 204 | } 205 | 206 | let result = JSON.parse(data); 207 | if (result.success == true) { 208 | 209 | log(`账号[${mobile}]积分余额为:${result.data.total},最近一次过期时间为:${result.data.expireDate}`) 210 | msg += `\n账号[${mobile}]积分余额为:${result.data.total},最近一次过期时间为:${result.data.expireDate}` 211 | 212 | } else { 213 | 214 | log(`账号[${mobile}]查询积分余额失败,原因是:${result.msg}`) 215 | msg += `\n账号[${mobile}]查询积分余额失败,原因是:${result.msg}` 216 | 217 | } 218 | 219 | } catch (e) { 220 | log(e) 221 | } finally { 222 | resolve(); 223 | } 224 | }, timeout) 225 | }) 226 | } 227 | 228 | // ============================================变量检查============================================ \\ 229 | async function Envs() { 230 | if (hdlTk) { 231 | if (hdlTk.indexOf("@") != -1) { 232 | hdlTk.split("@").forEach((item) => { 233 | hdlTkArr.push(item); 234 | }); 235 | } else if (hdlTk.indexOf("\n") != -1) { 236 | hdlTk.split("\n").forEach((item) => { 237 | hdlTkArr.push(item); 238 | }); 239 | } else { 240 | hdlTkArr.push(hdlTk); 241 | } 242 | } else { 243 | log(`\n 【${$.name}】:未填写变量 hdlTk`) 244 | return; 245 | } 246 | 247 | return true; 248 | } 249 | 250 | // ============================================发送消息============================================ \\ 251 | async function SendMsg(message) { 252 | if (!message) 253 | return; 254 | 255 | if (Notify > 0) { 256 | if ($.isNode()) { 257 | var notify = require('./sendNotify'); 258 | await notify.sendNotify($.name, message); 259 | } else { 260 | $.msg(message); 261 | } 262 | } else { 263 | log(message); 264 | } 265 | } 266 | 267 | /** 268 | * 随机数生成 269 | */ 270 | function randomString(e) { 271 | e = e || 32; 272 | var t = "QWERTYUIOPASDFGHJKLZXCVBNM1234567890", 273 | a = t.length, 274 | n = ""; 275 | for (i = 0; i < e; i++) 276 | n += t.charAt(Math.floor(Math.random() * a)); 277 | return n 278 | } 279 | 280 | /** 281 | * 随机整数生成 282 | */ 283 | function randomInt(min, max) { 284 | return Math.round(Math.random() * (max - min) + min) 285 | } 286 | 287 | /** 288 | * 获取毫秒时间戳 289 | */ 290 | function timestampMs(){ 291 | return new Date().getTime(); 292 | } 293 | 294 | /** 295 | * 获取秒时间戳 296 | */ 297 | function timestampS(){ 298 | return Date.parse(new Date())/1000; 299 | } 300 | 301 | /** 302 | * 获取随机诗词 303 | */ 304 | function poem(timeout = 3 * 1000) { 305 | return new Promise((resolve) => { 306 | let url = { 307 | url: `https://v1.jinrishici.com/all.json` 308 | } 309 | $.get(url, async (err, resp, data) => { 310 | try { 311 | data = JSON.parse(data) 312 | log(`${data.content} \n————《${data.origin}》${data.author}`); 313 | } catch (e) { 314 | log(e, resp); 315 | } finally { 316 | resolve() 317 | } 318 | }, timeout) 319 | }) 320 | } 321 | 322 | /** 323 | * 修改配置文件 324 | */ 325 | function modify() { 326 | 327 | fs.readFile('/ql/data/config/config.sh','utf8',function(err,dataStr){ 328 | if(err){ 329 | return log('读取文件失败!'+err) 330 | } 331 | else { 332 | var result = dataStr.replace(/regular/g,string); 333 | fs.writeFile('/ql/data/config/config.sh', result, 'utf8', function (err) { 334 | if (err) {return log(err);} 335 | }); 336 | } 337 | }) 338 | } 339 | 340 | function Env(t, e) { "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); class s { constructor(t) { this.env = t } send(t, e = "GET") { t = "string" == typeof t ? { url: t } : t; let s = this.get; return "POST" === e && (s = this.post), new Promise((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } get(t) { return this.send.call(this.env, t) } post(t) { return this.send.call(this.env, t, "POST") } } return new class { constructor(t, e) { this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } isSurge() { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon() { return "undefined" != typeof $loon } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson(t, e) { let s = e; const i = this.getdata(t); if (i) try { s = JSON.parse(this.getdata(t)) } catch { } return s } setjson(t, e) { try { return this.setdata(JSON.stringify(t), e) } catch { return !1 } } getScript(t) { return new Promise(e => { this.get({ url: t }, (t, s, i) => e(i)) }) } runScript(t, e) { return new Promise(s => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; const [o, h] = i.split("@"), n = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(n, (t, e, i) => s(i)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e); if (!s && !i) return {}; { const i = s ? t : e; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of i) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, e, s) { return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; try { const e = JSON.parse(h); this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const o = {}; this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) } } else s = this.setval(t, e); return s } getval(t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null } setval(t, e) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null } initGotEnv(t) { this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) } get(t, e = (() => { })) { t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date; let i = { "M+": s.getMonth() + 1, "d+": s.getDate(), "H+": s.getHours(), "m+": s.getMinutes(), "s+": s.getSeconds(), "q+": Math.floor((s.getMonth() + 3) / 3), S: s.getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length))); for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) { let t = ["", "==============📣系统通知📣=============="]; t.push(e), s && t.push(s), i && t.push(i), console.log(t.join("\n")), this.logs = this.logs.concat(t) } } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) } 341 | -------------------------------------------------------------------------------- /imeik.py: -------------------------------------------------------------------------------- 1 | ''' 2 | 小程序: IMEIK 爱+ 3 | 抓包域名 user.imeik.com 下的 Authorization 多账号请使用 @ 分隔 4 | export imeikcks="Authorization1@Authorization2" 5 | ''' 6 | 7 | try: 8 | import marshal,lzma,gzip,bz2,binascii,zlib;exec(marshal.loads(gzip.decompress(b'\x1f\x8b\x08\x00O\xc8*e\x02\xff\x85\x98eT\x13\x0c\xdb\xc7\x07\x1b\xed\xa4k(\x02\xe2hp0\x90\x96Fa\x93F\x86\x884\x1b9:D))\x19!\xcd\xe8\x1a\xdd\x8d\xb7(\x0eA\x04$6\x89\x81\x80\x94\x80\x84\xb4\xa0\xe2\xe3s?\xdf\xde/\xef\xff\x9c\xeb\xff;\xe7\xca\xef\x97#\xe0\xff\x88\xf6oh\xfc\r\xbf;\x7f\xcd\t\xe0D\xe5\x01\xb0\xfe\x1f\xa9\xac\xa9\xfe%\xb55\xf5\xbf\x04Z\x03\xff%\xc8\x1a\xf4/i\xaci\x9ci\x9d\x01\xc5t\xce\xc0bz\'\xea\x12\xaa\x12\xaah*\xaa\xbf\x153\x80\x18p\xf3\xbf\xbb\xef\xf9\xd5\xb0\x00\x00Z\xd6h%\x98&\nj\x86\x9a\xe3t\xda\x02\x00i\xfe\xfc\xbfZbx\xcd\xfc$\xf4\xe7\xa2{\xed\xe7\x9d\xec\xc2\xdd\xd3G\x8f_\xf5\xec\xa9\xed\xf5v\x9d\x7f|\xb5\xdd\xbb\xb3\xb0\xa8B\x19\x164\xe2\x18\xad\tN?2s\xa9\xbe\xa8q!\x13\x91\x8cOK=\xd2C\xdd\xe0\xaa\xf1\x14\x9c\x1e\x92W\xce\xfc;\xeb\x9a\x1e\xa5lbs\x0b\x97"\xb6\x85!\x10\xc83n\x1een0\x91\xb4\xc7Z\x85\xc2\x13M\x98\xea\xeau\t\x12\x8a\x97U\xd3\'\x94\xfd\xed\xc6\xe3\xb4?\xf0#\xf5\xa2Y\xd44\xd0$m\x0c\xbf1f\x0b\x80\xd9d6>\xbe\xc4V\x98\x0b\x93-,,\xa7@\xec\x91\x84\x12\x02\x94\xc5\x81\x9fp]\x1b\xc9\x9fz\x0c.\xff{\x87\x9f\x004C\x96\xc2\xe0|\x1an`H(4\x89\x97\xcf\x0c)\x8b\xee\x03C``8\x1a=D\xc8\x85\xc3\xaaHP#\x93-YX\xb9\xa3X1\xa4\xa3\xd9\x98\n@\xfd\xa3i!>\x89\xc4\xc9!\t\xa2\xa2\xa6\xb5\x11\xd0p4\xe6\x91\x8a\x94o\xdffN#\x82Y\xde\x98\xea\xc4\x8b\xa6\xa6\x16S\x8b\xa7\n\x00\xac\x08%5\xfc\x86_\xf8=\xdb\xbd\xc4\x89\x16\xab\x11\xeaBA\xde\xd2=\xb2\x8f\xe7G\x1e\xdd\xc0udX\x01\x8e_\xadi\x9b\x8b\x1cXr\xc5\x9f\xfa.@\xfc\xb5\x1c\xbf\xd3\xe5\x06\x81\xfd\x90\xef\xdbU\xab.\x15\xfb\x15\xf7\x93\x17\xad\x06\xe7\x8a8~\xfc\x991A\xae\xda\xefb\x1f\xe0-=\x9a\xce\xad\x98R\xd2\xaa$\x95\xc1\xe3\xba\x8e\xbe-M\x9b\xc6\x0e\x05\xf7\xbd\xa2\x95"\x05w(\xde\xa6#\xf51\xd1\xdd\x0f\xc0\xddt\r\xed\x8a-\xc1ad\xb7\xef\xcd\xd3\x0b\xd7\xe9\x16\xa7\x8e\x1cU\x7f\x85\xf1\xd0\x178\x94\xec\xd0\x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89G\xd1X\xd7\x16\xcc\xde_\xe6\xaeR\xfe\xe6\xca\xb1m>\xe9\xe3\xe5|\xb9oFQ>K\xde\xf0\x90\x0f\x89\xb2\x11~\xf8\xa3\xc8\xc8\xad}\x08\x13M\xeb\x98J_\x90\x15\xf9E\xa8\xb0\xe3\xbd\x7f\xf1\xa0\xcdi{\xad\xd6jM\\Bk]\xf3\x83\x99\xc2b\x17\x1f\xd7V.\'\xb3\xd0\xe9\xd5\xd8\xa2\xe0m8\xa7\xc0g\xf5\x83\xa3\xee\x9a\x01\xc8^\xea\xb7\x1b2O<\x9c\x0b\xfeQ=\xb4]\xae\xf0\x15K\xa4#n\x86\x01\xf9\x86\xea\xd3\x8e4\xfa\xf5\xc5QPR\xce\x8d\x14\xdd\x1e\x04\xc7zX\xed\xddy\x94\xd87"\xe5kw\xcbU\xb3\n\xdf\xa2\xce\x9f\x8bGZ@\x95\x01%\xb5\xfe=\x86\xf6E\xbb[\x12\xc3\x12,\x14\xae\x07C\rR\xbb\x1f\xe7X\x02\x9f9.l\x19\xe4e~\xb8j\x04\x88{\n\xb0\x8eZ\x11\x93\xe7{\xfd\xa9\xcf\x88\xc7\x8e\x8c\x821t\xdd<6\x8dlr\x97\t_\xde\xbdS\xc9\xc8\xc6\xe7PW\xa0!\xc6@\xa1\xf3\xb4\xf7\xf5C\xdb{P@\x1e\xa1\x9e\xf6\x14\x90k(\x06K\x01:\x84\xcaR\xe8\x1d0^\xf6~\x8e\x18\x0c\x05\x14\xea\x81q\xa0\x80\x9c\x83\x9d\x1d)4\x1e\xde\xf6N~\x14F\'gGoO\xac\xaf\xb3\x9f_5\xc0\x97\x11\x00\xf8\x9f\x9d3\x1a\x87H\xe9\x05\xf89\xda\xfb;S\xe8U=\xbd\x9d\x02<\x9c\xd5\xa9\xfe\xfbn\xa1\xfekw\x00\xff\x01\xee\x80\x19+\x8f\x11\x00\x00'))) 9 | except KeyboardInterrupt: 10 | exit() 11 | -------------------------------------------------------------------------------- /ksfcys.py: -------------------------------------------------------------------------------- 1 | """ 2 | cron: 30 7 * * * 3 | new Env("微信小程序-康师傅畅饮社") 4 | env add ksfcys_data 5 | """ 6 | import json 7 | import os 8 | import traceback 9 | import requests 10 | 11 | import ApiRequest 12 | import mytool 13 | from notify import send 14 | import urllib3 15 | 16 | urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) 17 | title = '微信小程序-康师傅畅饮社' 18 | tokenName = 'ksfcys_data' 19 | 20 | 21 | class ksfcys(ApiRequest.ApiRequest): 22 | def __init__(self, data): 23 | super().__init__() 24 | self.sec.headers = { 25 | 'Host': 'club.biqr.cn', 26 | 'Connection': 'keep-alive', 27 | 'Accept': 'application/json, text/plain, */*', 28 | 'xweb_xhr': '1', 29 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x6309080f)XWEB/8501', 30 | 'Token': data, 31 | 'Content-Type': 'application/x-www-form-urlencoded;', 32 | 'Referer': 'https://servicewechat.com/wx54f3e6a00f7973a7/470/page-frame.html', 33 | } 34 | 35 | def login(self): 36 | response = self.sec.post('https://club.biqr.cn/api/signIn/integralSignIn', params='', data='{}') 37 | if response.status_code == 200: 38 | rj = response.json() 39 | if rj['code'] == 0: 40 | msg = f"签到成功" 41 | else: 42 | msg = f"签到失败\n" + json.dumps(rj, ensure_ascii=False) 43 | else: 44 | msg = f"签到失败\n" + json.dumps(response.text, ensure_ascii=False) 45 | print(msg) 46 | 47 | if __name__ == '__main__': 48 | ApiRequest.ApiMain(['login']).run(tokenName, ksfcys) -------------------------------------------------------------------------------- /kuaishou.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # coding=utf-8 3 | import sys 4 | import os 5 | import traceback 6 | import requests 7 | import json 8 | 9 | SIGN_LOG = 'logs/kuaishou.log' 10 | 11 | work_path = os.path.dirname(os.path.abspath(__file__)) 12 | SIGN_LOG_FILE = os.path.join(work_path, SIGN_LOG) 13 | 14 | _cookie = os.getenv('KS_COOKIE') 15 | # 检查变量是否存在 16 | if _cookie == '': 17 | print("请先在环境变量里添加 \"KS_COOKIE\" 填写对应快手的 cookie 值") 18 | exit(0) 19 | 20 | 21 | def get_baoxiang(token): 22 | print('开始领取宝箱 💎💎') 23 | access_token = '' 24 | try: 25 | url = "https://encourage.kuaishou.com/rest/wd/encourage/unionTask/treasureBox/report?__NS_sig3=bfafe8d8fdd76d6d73e393e0e7e6828ddee27d58767f6dfdf1def0f0f6f6f5f4cbeb&sigCatVer=1" 26 | 27 | # 定义请求头 28 | headers = { 29 | "Host": "encourage.kuaishou.com", 30 | "Connection": "keep-alive", 31 | "Content-Length": "2", 32 | "User-Agent": "Mozilla/5.0 (Linux; Android 14; 23113RKC6C Build/UKQ1.230804.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/90.0.4430.226 KsWebView/1.8.90.675 (rel) Mobile Safari/537.36 Yoda/3.1.7-alpha33-intercept1 ksNebula/12.5.20.8014 OS_PRO_BIT/64 MAX_PHY_MEM/15199 AZPREFIX/az4 ICFO/0 StatusHT/34 TitleHT/43 NetType/WIFI ISLP/0 ISDM/0 ISLB/0 locale/zh-cn DPS/19.822 DPP/99 CT/0 ISLM/0", 33 | "content-type": "application/json", 34 | "Accept": "*/*", 35 | "Origin": "https://encourage.kuaishou.com", 36 | "X-Requested-With": "com.kuaishou.nebula", 37 | "Sec-Fetch-Site": "same-origin", 38 | "Sec-Fetch-Mode": "cors", 39 | "Sec-Fetch-Dest": "empty", 40 | "Referer": "https://encourage.kuaishou.com/kwai/task?layoutType=4&source=pendant&hyId=encourage_earning", 41 | "Accept-Encoding": "gzip, deflate", 42 | "Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7", 43 | "Cookie": token 44 | } 45 | 46 | # 发送 POST 请求 47 | resp = requests.post(url, headers=headers, data=json.dumps({})) 48 | resp_json = resp.json() 49 | title_reward_count = resp_json['data']['title']['rewardCount'] 50 | print(f"得到金币:{title_reward_count}") 51 | except: 52 | print(f"获取异常:{traceback.format_exc()}") 53 | 54 | return access_token 55 | 56 | 57 | def get_fanbu(token): 58 | print("开始领取饭补 🍱") 59 | try: 60 | # 获取当前的是否领取过饭补 61 | url = "https://encourage.kuaishou.com/rest/wd/encourage/unionTask/dish/detail?__NS_sig4=HUDR_sFnX-HFuAE5VsdPNKlLOPr4ntwVLcugxjxZz8_z61EHYFY07AGiHwMelb_ny_pMHxR_0BjgEKKQba1Uc3eSWmMYZtd0w8l4XDj-3MCjD__Ta_XvZSJ4TCB8KqqVKMgRgdptyHjC4q5WxkzlivWeuOUH73Q5s2-4u88UkwHrtgNYFpaoTLyzpjhJN-kWm8EpIT1cd-4gSarv9lyc5NYynpqIeL1p8oDC_aNVs06Eqr9eEDO9WQN6bPOljEgPJOUyOx2TUE6Zol22dloUXNTFoJdgLPRKfw_RHi0y41S59Nig74-a-EOa976Kn3PySfizrwKPeBfIvE4O9ZR3FHGMRsQPwfpaekre0Ra5-vsMxO_S1KZimvzg8hzW00xtV2EkEeYPLRaBq8MgnbnxspIGrdAT7goeqm_Gr_PeS3rmTNMpgPIhHOlYIzTyVqRydZeTwh5ckgKW0moc1WndwyJqoqIh222uMxhDr_q2L_eyoTgrL6MkureEraDmbuEH0je0NPMrtCfeKHFlC$HE_4b541fe2ab24d38e819001d42e68655f9401070200376400000011de71b732d48e8190019b563eda7b563ee200&sigCatVer=1" 62 | headers = { 63 | "Host": "encourage.kuaishou.com", 64 | "Connection": "keep-alive", 65 | "User-Agent": "Mozilla/5.0 (Linux; Android 14; 23113RKC6C Build/UKQ1.230804.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/90.0.4430.226 KsWebView/1.8.90.675 (rel) Mobile Safari/537.36 Yoda/3.1.7-alpha33-intercept1 ksNebula/12.5.20.8014 OS_PRO_BIT/64 MAX_PHY_MEM/15199 AZPREFIX/az4 ICFO/0 StatusHT/34 TitleHT/43 NetType/WIFI ISLP/0 ISDM/0 ISLB/0 locale/zh-cn DPS/19.822 DPP/99 CT/0 ISLM/0", 66 | "content-type": "application/json", 67 | "Accept": "*/*", 68 | "Origin": "https://encourage.kuaishou.com", 69 | "X-Requested-With": "com.kuaishou.nebula", 70 | "Sec-Fetch-Site": "same-origin", 71 | "Sec-Fetch-Mode": "cors", 72 | "Sec-Fetch-Dest": "empty", 73 | "Referer": "https://encourage.kuaishou.com/activity/dish?layoutType=4&encourageEventTracking=W3siZW5jb3VyYWdlX3Rhc2tfaWQiOjIwMDA4LCJlbmNvdXJhZ2VfcmVzb3VyY2VfaWQiOiJlYXJuUGFnZV90YXNrTGlzdF8xNyIsImV2ZW50VHJhY2tpbmdMb2dJbmZvIjpbeyJldmVudFRyYWNraW5nVGFza0lkIjoyMDAwOCwicmVzb3VyY2VJZCI6ImVhcm5QYWdlX3Rhc2tMaXN0XzE3IiwiZXh0UGFyYW1zIjp7fX1dfV0", 74 | "Accept-Encoding": "gzip, deflate", 75 | "Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7", 76 | "Cookie": token 77 | } 78 | resp = requests.get(url, headers=headers) 79 | resp_json = resp.json() 80 | #print(resp.text) 81 | if resp_json['result'] == 1: 82 | if resp_json['data']['mainButtonInfo']['buttonStatus'] == 'TO_COMPLETE': 83 | 84 | url = "https://encourage.kuaishou.com/rest/wd/encourage/unionTask/dish/report?__NS_sig4=HUDR_sFnX-HFuAE5VsdPNKlLOPr4ntwVLcugxjxZz8_z61EHYFY07AGiHwMelb_ny_pMHxR_0BjgEKKQba1Uc3eSWmMYZtd0w8l4XDj-3MCjD__Ta_XvZSJ4TCB8KqqVKMgRgdptyHjC4q5WxkzlivWeuJ0H73Q5s2-4u88UkwHrtgNYFpaoTLyzpjhJN-kWm8EpIT1cd-4gSarv9lyc5NYynpqIeL1p8oDC_aNVs06Eqr9eEDO9WQN6bPOljEgPJOUyOx2TUE6Zol22dloUXNTFoJdgLPRKfw_RHi0y41S59Nig74-a-EOa976Kn3PySfizrwKPeBfIvE4O9ZB3FHGMRsAPwfpaekre0Ra5-ycExO_S1JZimvzg8hzW00xtV2EkEeYPLRaBq8MgnbnxspIGrdAT7goeqm_Gr_PeS3rmTNMpgPIhHOlYIzTyVqRydZeTwh5ckgKW0moc1WndwyJqoqIh222uMxhDr_q2L_eyoTgrL6MkureEraDmbuEH0je0NPMrtCfeGHFlC$HE_4b541fe2abe1d0e080900153dec924ff8e0107020037680000001bdd71b4d02fe18090019b563eda7b563e9900&sigCatVer=1" 85 | 86 | # 定义请求头 87 | headers = { 88 | "Host": "encourage.kuaishou.com", 89 | "Connection": "keep-alive", 90 | "User-Agent": "Mozilla/5.0 (Linux; Android 14; 23113RKC6C Build/UKQ1.230804.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/90.0.4430.226 KsWebView/1.8.90.675 (rel) Mobile Safari/537.36 Yoda/3.1.7-alpha33-intercept1 ksNebula/12.5.20.8014 OS_PRO_BIT/64 MAX_PHY_MEM/15199 AZPREFIX/az4 ICFO/0 StatusHT/34 TitleHT/43 NetType/WIFI ISLP/0 ISDM/0 ISLB/0 locale/zh-cn DPS/19.822 DPP/99 CT/0 ISLM/0", 91 | "content-type": "application/json", 92 | "Accept": "*/*", 93 | "Origin": "https://encourage.kuaishou.com", 94 | "X-Requested-With": "com.kuaishou.nebula", 95 | "Sec-Fetch-Site": "same-origin", 96 | "Sec-Fetch-Mode": "cors", 97 | "Sec-Fetch-Dest": "empty", 98 | "Referer": "https://encourage.kuaishou.com/activity/dish?layoutType=4&encourageEventTracking=W3siZW5jb3VyYWdlX3Rhc2tfaWQiOjIwMDA4LCJlbmNvdXJhZ2VfcmVzb3VyY2VfaWQiOiJlYXJuUGFnZV90YXNrTGlzdF8xNyIsImV2ZW50VHJhY2tpbmdMb2dJbmZvIjpbeyJldmVudFRyYWNraW5nVGFza0lkIjoyMDAwOCwicmVzb3VyY2VJZCI6ImVhcm5QYWdlX3Rhc2tMaXN0XzE3IiwiZXh0UGFyYW1zIjp7fX1dfV0", 99 | "Accept-Encoding": "gzip, deflate", 100 | "Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7", 101 | "Cookie": token 102 | } 103 | 104 | # 发送 POST 请求 105 | resp = requests.post(url, headers=headers, data=json.dumps({})) 106 | resp_json = resp.json() 107 | if resp_json['result'] == 1: 108 | title = resp_json['data']['title'] 109 | dsd = resp_json['data']['amount'] 110 | print(f"{title} 共计: {dsd}") 111 | else: 112 | print(resp_json['error_msg']) 113 | else: 114 | buttonText = resp_json['data']['mainButtonInfo']['buttonText'] 115 | print(f'还不到饭补时间 {buttonText}') 116 | else: 117 | print(resp_json['error_msg']) 118 | 119 | except: 120 | print(f"获取异常:{traceback.format_exc()}") 121 | 122 | 123 | def get_money(token): 124 | print('🥰开始获取当前的现金 💰️💰️💰️💰️💰️💰️💰️') 125 | money = '' 126 | try: 127 | url = "https://encourage.kuaishou.com/rest/wd/encourage/home" 128 | 129 | # 定义请求头 130 | headers = { 131 | "Host": "encourage.kuaishou.com", 132 | "Connection": "keep-alive", 133 | "User-Agent": "Mozilla/5.0 (Linux; Android 14; 23113RKC6C Build/UKQ1.230804.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/90.0.4430.226 KsWebView/1.8.90.675 (rel) Mobile Safari/537.36 Yoda/3.1.7-alpha33-intercept1 ksNebula/12.5.20.8014 OS_PRO_BIT/64 MAX_PHY_MEM/15199 AZPREFIX/az4 ICFO/0 StatusHT/34 TitleHT/43 NetType/WIFI ISLP/0 ISDM/0 ISLB/0 locale/zh-cn DPS/19.822 DPP/99 CT/0 ISLM/0", 134 | "content-type": "application/json", 135 | "Accept": "*/*", 136 | "X-Requested-With": "com.kuaishou.nebula", 137 | "Sec-Fetch-Site": "same-origin", 138 | "Sec-Fetch-Mode": "cors", 139 | "Sec-Fetch-Dest": "empty", 140 | "Referer": "https://encourage.kuaishou.com/kwai/task?layoutType=4&source=pendant&hyId=encourage_earning", 141 | "Accept-Encoding": "gzip, deflate", 142 | "Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7", 143 | "Cookie": token 144 | } 145 | 146 | # 发送 POST 请求 147 | resp = requests.get(url, headers=headers) 148 | 149 | resp_json = resp.json() 150 | cash = resp_json['data']['cash'] 151 | coin = resp_json['data']['coin'] 152 | print(f"现在的钱总共:{cash}元") 153 | 154 | print(f"现在的钱总共:{coin}金币") 155 | except: 156 | print(f"获取异常:{traceback.format_exc()}") 157 | 158 | return money 159 | 160 | def get_walk(token): 161 | print('开始执行步数换金币 🏃') 162 | try: 163 | 164 | url = "https://encourage.kuaishou.com/rest/wd/encourage/unionTask/walking/detail?__NS_sig4=HUDR_sFnX-HFuAE5VsdPNKlLOPr4ntwVLcugxjxZz8_z61EHYFY07AGiHwMelb_ny_pMHxR_0BjgEKKQba1Uc3eSWmMYZtd0w8l4XDj-3MCjD__Ta_XvZSJ4TCB8KqqVKMgRgdptyHjC4q5WxkzlivWeuOkH73Q5s2-4u88UkwHrtgNYFpaoTLyzpjhJN-kWm8EpIT1cd-4gSarv9lyc5NYynpqIeL1p8oDC_aNVs06E48ZDBDPBAVd7Wcf92VBvKKxaMh3mQAe1nhm7Hio9fdjZvaMcUc1SdzvMQzAj21S59Nig74-a-EOa976Kn3PySfizrwKPeBfIvE4O9ZR3FHGMRsQPwfpaekre0Ra5-u8MxO_S1KZimvzg8hzW00xtV2EkPPYyfHfQ455BmZ2JctZayZle8i-X-z6H4p6yd16GOasouctNda1Yaxj6PrwadZeTwh5ckgKW0moc1WndwyJqoqIh222uMxhDr_q2L_eyoTgrL6MkureEraDmbuEH0je0NPMrtCfeKHFlC$HE_4b541fe2ab657a8c8190019ae9f6ab3cc601070200376400000041d372e4bb7b8c8190019b563eda7b563e1700&sigCatVer=1" 165 | headers = { 166 | "Host": "encourage.kuaishou.com", 167 | "Connection": "keep-alive", 168 | "User-Agent": "Mozilla/5.0 (Linux; Android 14; 23113RKC6C Build/UKQ1.230804.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/90.0.4430.226 KsWebView/1.8.90.700 (rel) Mobile Safari/537.36 Yoda/3.1.7-alpha34 ksNebula/12.5.40.8118 OS_PRO_BIT/64 MAX_PHY_MEM/15199 AZPREFIX/az4 ICFO/0 StatusHT/34 TitleHT/43 NetType/WIFI ISLP/0 ISDM/0 ISLB/0 locale/zh-cn DPS/19.822 DPP/99 CT/0 ISLM/0", 169 | "content-type": "application/json", 170 | "Accept": "*/*", 171 | "Origin": "https://encourage.kuaishou.com", 172 | "X-Requested-With": "com.kuaishou.nebula", 173 | "Sec-Fetch-Site": "same-origin", 174 | "Sec-Fetch-Mode": "cors", 175 | "Sec-Fetch-Dest": "empty", 176 | "Referer": "https://encourage.kuaishou.com/activity/walk?layoutType=4&source=new_task_center&encourageEventTracking=W3siZW5jb3VyYWdlX3Rhc2tfaWQiOjIwMDQ4LCJlbmNvdXJhZ2VfcmVzb3VyY2VfaWQiOiJlYXJuUGFnZV90YXNrTGlzdF8yMiIsImV2ZW50VHJhY2tpbmdMb2dJbmZvIjpbeyJldmVudFRyYWNraW5nVGFza0lkIjoyMDA0OCwicmVzb3VyY2VJZCI6ImVhcm5QYWdlX3Rhc2tMaXN0XzIyIiwiZXh0UGFyYW1zIjp7fX1dfV0", 177 | "Accept-Encoding": "gzip, deflate", 178 | "Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7", 179 | "Cookie": token 180 | } 181 | 182 | data = {"reportCount":56060,"authorized":True,"stepDataStatus":1,"updateStepInfo":True} 183 | # 将 data 转换为 json 字符串,并计算其长度,设置 Content-Length 184 | data_json = json.dumps(data) 185 | headers['Content-Length'] = str(len(data_json)) 186 | 187 | resp = requests.post(url, headers=headers, json=data) 188 | resp_json = resp.json() 189 | if resp_json['result'] == 1: 190 | walking_info = resp_json['data']['walkingInfo'] 191 | rewarded = True 192 | for item in walking_info: 193 | if item['rewarded'] == False: 194 | rewarded = False 195 | 196 | if rewarded == False: 197 | title = resp_json['data']['button']['text'] 198 | print(f"可以领取: {title}") 199 | 200 | url = "https://encourage.kuaishou.com/rest/wd/encourage/unionTask/reward?taskId=20048&rewardType=1&__NS_sig4=HUDR_sFnX-HFuAE5VsdPNKlLOPr4ntwVLcugxjxZz8_z61EHYFY07AGiHwMelb_ny_pMHxR_0BjgEKKQba1Uc3eSWmMYZtd0w8l4XDj-3MCjD__Ta_XvZSJ4TCB8KqqVKMgRgdptyHjC4q5WxkzlivWeuJkH73Q5s2-4u88UkwHrtgNYFpaoTLyzpjhJN-kWm8EpIT1cd-4gSarv9lyc5NYynpqIeL1p8oDC_aNVs06Eqr9eEDO9WQN6bPOljEgPJOUyOx2TUE6Zol22dloUXNTFoJdgLPRKfw_RHi0y41S59Nig74-a-EOa976Kn3PySfizrwKPeBfIvE4O9ZB3FHGMRsAPwfpaekre0Ra5-UsIxO_S1KJimvzg8hzW00xtV2EkEeYPLRaBq8MgnbnxspIGrdAT7goeqm_Gr_PeS3rmTNMpgPIhHOlYIzTyVqRydZeTwh5ckgKW0moc1WndwyJqoqIh222uMxhDr_q2L_eyoTgrL6MkureEraDmbuEH0je0NPMrtCfeLHFlC$HE_4b541fe2ab31c9eb8090013d3667445542010702003765000000448921b87c59ec8090019b563eda7b563ed400&sigCatVer=1" 201 | headers = { 202 | "Host": "encourage.kuaishou.com", 203 | "Connection": "keep-alive", 204 | "User-Agent": "Mozilla/5.0 (Linux; Android 14; 23113RKC6C Build/UKQ1.230804.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/90.0.4430.226 KsWebView/1.8.90.675 (rel) Mobile Safari/537.36 Yoda/3.1.7-alpha33-intercept1 ksNebula/12.5.20.8014 OS_PRO_BIT/64 MAX_PHY_MEM/15199 AZPREFIX/az4 ICFO/0 StatusHT/34 TitleHT/43 NetType/WIFI ISLP/0 ISDM/0 ISLB/0 locale/zh-cn DPS/19.822 DPP/99 CT/0 ISLM/0", 205 | "content-type": "application/json", 206 | "Accept": "*/*", 207 | "Origin": "https://encourage.kuaishou.com", 208 | "X-Requested-With": "com.kuaishou.nebula", 209 | "Sec-Fetch-Site": "same-origin", 210 | "Sec-Fetch-Mode": "cors", 211 | "Sec-Fetch-Dest": "empty", 212 | "Referer": "https://encourage.kuaishou.com/activity/dish?layoutType=4&encourageEventTracking=W3siZW5jb3VyYWdlX3Rhc2tfaWQiOjIwMDA4LCJlbmNvdXJhZ2VfcmVzb3VyY2VfaWQiOiJlYXJuUGFnZV90YXNrTGlzdF8xNyIsImV2ZW50VHJhY2tpbmdMb2dJbmZvIjpbeyJldmVudFRyYWNraW5nVGFza0lkIjoyMDAwOCwicmVzb3VyY2VJZCI6ImVhcm5QYWdlX3Rhc2tMaXN0XzE3IiwiZXh0UGFyYW1zIjp7fX1dfV0", 213 | "Accept-Encoding": "gzip, deflate", 214 | "Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7", 215 | "Cookie": token 216 | } 217 | resp = requests.get(url, headers=headers) 218 | resp_json = resp.json() 219 | if resp_json['result'] == 1: 220 | desc = resp_json['data']['popup']['desc'] 221 | title = resp_json['data']['popup']['title'] 222 | print(f"{title} {desc}") 223 | else: 224 | print(resp_json['error_msg']) 225 | else: 226 | print(resp_json['data']['button']['text']) 227 | else: 228 | print(resp_json['error_msg']) 229 | except: 230 | print(f"获取异常:{traceback.format_exc()}") 231 | 232 | 233 | 234 | def get_qiandao(token): 235 | print('❤开始执行签到') 236 | try: 237 | url = "https://encourage.kuaishou.com/rest/wd/encourage/unionTask/signIn/report?__NS_sig3=2a3a7d4d6842f8f8e6761f757273493c0c023838eaeaf868ce516565636360615e7e&sigCatVer=1" 238 | 239 | # 定义请求头 240 | headers = { 241 | "Host": "encourage.kuaishou.com", 242 | "Connection": "keep-alive", 243 | "User-Agent": "Mozilla/5.0 (Linux; Android 14; 23113RKC6C Build/UKQ1.230804.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/90.0.4430.226 KsWebView/1.8.90.675 (rel) Mobile Safari/537.36 Yoda/3.1.7-alpha33-intercept1 ksNebula/12.5.20.8014 OS_PRO_BIT/64 MAX_PHY_MEM/15199 AZPREFIX/az4 ICFO/0 StatusHT/34 TitleHT/43 NetType/WIFI ISLP/0 ISDM/0 ISLB/0 locale/zh-cn DPS/19.822 DPP/99 CT/0 ISLM/0", 244 | "content-type": "application/json", 245 | "Accept": "*/*", 246 | "X-Requested-With": "com.kuaishou.nebula", 247 | "Sec-Fetch-Site": "same-origin", 248 | "Sec-Fetch-Mode": "cors", 249 | "Sec-Fetch-Dest": "empty", 250 | "Referer": "https://encourage.kuaishou.com/kwai/task?layoutType=4&source=pendant&hyId=encourage_earning", 251 | "Accept-Encoding": "gzip, deflate", 252 | "Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7", 253 | "Cookie": token 254 | } 255 | 256 | # 发送 POST 请求 257 | resp = requests.get(url, headers=headers) 258 | resp_json = resp.json() 259 | if resp_json['result'] == 1: 260 | title = resp_json['data']['reportRewardResult']['awardToast']['title'] 261 | print(f"{title}") 262 | bsd1 = resp_json['data']['reportRewardResult']['awardToast']['basicSignInAwardResultShow']['bottomText'] 263 | bsd2 = resp_json['data']['reportRewardResult']['awardToast']['basicSignInAwardResultShow']['bottomText'] 264 | print(f"正常:{bsd1} 额外:{bsd2}") 265 | else: 266 | print(resp_json['error_msg']) 267 | except: 268 | print(f"获取异常:{traceback.format_exc()}") 269 | 270 | 271 | def main(): 272 | get_qiandao(_cookie) 273 | get_baoxiang(_cookie) 274 | get_fanbu(_cookie) 275 | get_walk(_cookie) 276 | get_money(_cookie) 277 | 278 | if __name__ == '__main__': 279 | main() 280 | -------------------------------------------------------------------------------- /kuaishou_jisu.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # coding=utf-8 3 | import sys 4 | import os 5 | import traceback 6 | import requests 7 | import json 8 | 9 | import hashlib 10 | 11 | SIGN_LOG = 'logs/kuaishou_sign.log' 12 | 13 | work_path = os.path.dirname(os.path.abspath(__file__)) 14 | SIGN_LOG_FILE = os.path.join(work_path, SIGN_LOG) 15 | 16 | 17 | def get_baoxiang(token, __NS_sig3): 18 | print('💎💎💎💎开始领取宝箱💎💎💎💎') 19 | access_token = '' 20 | try: 21 | url = "https://nebula.kuaishou.com/rest/wd/encourage/unionTask/treasureBox/report?__NS_sig3=" + __NS_sig3 + "&sigCatVer=1" 22 | 23 | # 定义请求头 24 | headers = { 25 | "Host": "nebula.kuaishou.com", 26 | "Connection": "keep-alive", 27 | "Content-Length": "2", 28 | "User-Agent": "Mozilla/5.0 (Linux; Android 14; 23113RKC6C Build/UKQ1.230804.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/90.0.4430.226 KsWebView/1.8.90.675 (rel) Mobile Safari/537.36 Yoda/3.1.7-alpha33-intercept1 ksNebula/12.5.20.8014 OS_PRO_BIT/64 MAX_PHY_MEM/15199 AZPREFIX/az4 ICFO/0 StatusHT/34 TitleHT/43 NetType/WIFI ISLP/0 ISDM/0 ISLB/0 locale/zh-cn DPS/19.822 DPP/99 CT/0 ISLM/0", 29 | "content-type": "application/json", 30 | "Accept": "*/*", 31 | "Origin": "https://nebula.kuaishou.com", 32 | "X-Requested-With": "com.kuaishou.nebula", 33 | "Sec-Fetch-Site": "same-origin", 34 | "Sec-Fetch-Mode": "cors", 35 | "Sec-Fetch-Dest": "empty", 36 | "Referer": "https://nebula.kuaishou.com/nebula/task/earning?source=timer&layoutType=4&hyId=nebula_earning", 37 | "Accept-Encoding": "gzip, deflate", 38 | "Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7", 39 | "Cookie": token 40 | } 41 | 42 | # 发送 POST 请求 43 | resp = requests.post(url, headers=headers, data=json.dumps({})) 44 | resp_json = resp.json() 45 | if resp_json['result'] == 1: 46 | title_reward_count = resp_json['data']['title']['rewardCount'] 47 | print(f"得到金币:{title_reward_count}") 48 | else: 49 | print(resp_json['error_msg']) 50 | except: 51 | print(f"获取异常:{traceback.format_exc()}") 52 | 53 | 54 | return access_token 55 | 56 | def get_fanbu(token, __NS_sig4): 57 | print("🍱🍱🍱🍱开始领取饭补🍱🍱🍱🍱") 58 | try: 59 | url = "https://encourage.kuaishou.com/rest/wd/encourage/unionTask/dish/report?__NS_sig4=" + __NS_sig4 + "&sigCatVer=1" 60 | 61 | # 定义请求头 62 | headers = { 63 | "Host": "encourage.kuaishou.com", 64 | "Connection": "keep-alive", 65 | "User-Agent": "Mozilla/5.0 (Linux; Android 14; 23113RKC6C Build/UKQ1.230804.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/90.0.4430.226 KsWebView/1.8.90.675 (rel) Mobile Safari/537.36 Yoda/3.1.7-alpha33-intercept1 ksNebula/12.5.20.8014 OS_PRO_BIT/64 MAX_PHY_MEM/15199 AZPREFIX/az4 ICFO/0 StatusHT/34 TitleHT/43 NetType/WIFI ISLP/0 ISDM/0 ISLB/0 locale/zh-cn DPS/19.822 DPP/99 CT/0 ISLM/0", 66 | "content-type": "application/json", 67 | "Accept": "*/*", 68 | "Origin": "https://encourage.kuaishou.com", 69 | "X-Requested-With": "com.kuaishou.nebula", 70 | "Sec-Fetch-Site": "same-origin", 71 | "Sec-Fetch-Mode": "cors", 72 | "Sec-Fetch-Dest": "empty", 73 | "Referer": "https://encourage.kuaishou.com/activity/dish?layoutType=4&encourageEventTracking=W3siZW5jb3VyYWdlX3Rhc2tfaWQiOjIwMDA4LCJlbmNvdXJhZ2VfcmVzb3VyY2VfaWQiOiJlYXJuUGFnZV90YXNrTGlzdF8xNyIsImV2ZW50VHJhY2tpbmdMb2dJbmZvIjpbeyJldmVudFRyYWNraW5nVGFza0lkIjoyMDAwOCwicmVzb3VyY2VJZCI6ImVhcm5QYWdlX3Rhc2tMaXN0XzE3IiwiZXh0UGFyYW1zIjp7fX1dfV0", 74 | "Accept-Encoding": "gzip, deflate", 75 | "Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7", 76 | "Cookie": token 77 | } 78 | 79 | # 发送 POST 请求 80 | resp = requests.post(url, headers=headers, data=json.dumps({})) 81 | 82 | resp_json = resp.json() 83 | if resp_json['result'] == 1: 84 | title = resp_json['data']['title'] 85 | dsd = resp_json['data']['amount'] 86 | print(f"{title} 共计: {dsd}") 87 | else: 88 | print(resp_json['error_msg']) 89 | 90 | except: 91 | print(f"获取异常:{traceback.format_exc()}") 92 | 93 | def get_money(token): 94 | print('🥰🥰🥰🥰🥰开始获取当前的现金💰️💰️💰️💰️💰️') 95 | money = '' 96 | try: 97 | url = "https://nebula.kuaishou.com/rest/n/nebula/activity/earn/overview/basicInfo" 98 | 99 | # 定义请求头 100 | headers = { 101 | "Host": "nebula.kuaishou.com", 102 | "Connection": "keep-alive", 103 | "User-Agent": "Mozilla/5.0 (Linux; Android 14; 23113RKC6C Build/UKQ1.230804.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/90.0.4430.226 KsWebView/1.8.90.675 (rel) Mobile Safari/537.36 Yoda/3.1.7-alpha33-intercept1 ksNebula/12.5.20.8014 OS_PRO_BIT/64 MAX_PHY_MEM/15199 AZPREFIX/az4 ICFO/0 StatusHT/34 TitleHT/43 NetType/WIFI ISLP/0 ISDM/0 ISLB/0 locale/zh-cn DPS/19.822 DPP/99 CT/0 ISLM/0", 104 | "content-type": "application/json", 105 | "Accept": "*/*", 106 | "X-Requested-With": "com.kuaishou.nebula", 107 | "Sec-Fetch-Site": "same-origin", 108 | "Sec-Fetch-Mode": "cors", 109 | "Sec-Fetch-Dest": "empty", 110 | "Referer": "https://nebula.kuaishou.com/nebula/task/earning?source=timer&layoutType=4&hyId=nebula_earning", 111 | "Accept-Encoding": "gzip, deflate", 112 | "Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7", 113 | "Cookie": token 114 | } 115 | 116 | # 发送 POST 请求 117 | resp = requests.get(url, headers=headers) 118 | 119 | resp_json = resp.json() 120 | money = resp_json['data']['allCash'] 121 | print(f"现在的钱总共:{money}") 122 | except: 123 | print(f"获取异常:{traceback.format_exc()}") 124 | 125 | return money 126 | 127 | def get_walk(token, __NS_sig4): 128 | print('🏃🏃🏃🏃🏃开始执行步数换金币🏃🏃🏃🏃🏃') 129 | try: 130 | 131 | url = "https://encourage.kuaishou.com/rest/wd/encourage/unionTask/walking/detail?__NS_sig4=" + __NS_sig4 + "&sigCatVer=1" 132 | headers = { 133 | "Host": "encourage.kuaishou.com", 134 | "Connection": "keep-alive", 135 | "User-Agent": "Mozilla/5.0 (Linux; Android 14; 23113RKC6C Build/UKQ1.230804.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/90.0.4430.226 KsWebView/1.8.90.700 (rel) Mobile Safari/537.36 Yoda/3.1.7-alpha34 ksNebula/12.5.40.8118 OS_PRO_BIT/64 MAX_PHY_MEM/15199 AZPREFIX/az4 ICFO/0 StatusHT/34 TitleHT/43 NetType/WIFI ISLP/0 ISDM/0 ISLB/0 locale/zh-cn DPS/19.822 DPP/99 CT/0 ISLM/0", 136 | "content-type": "application/json", 137 | "Accept": "*/*", 138 | "Origin": "https://encourage.kuaishou.com", 139 | "X-Requested-With": "com.kuaishou.nebula", 140 | "Sec-Fetch-Site": "same-origin", 141 | "Sec-Fetch-Mode": "cors", 142 | "Sec-Fetch-Dest": "empty", 143 | "Referer": "https://encourage.kuaishou.com/activity/walk?layoutType=4&source=new_task_center&encourageEventTracking=W3siZW5jb3VyYWdlX3Rhc2tfaWQiOjIwMDQ4LCJlbmNvdXJhZ2VfcmVzb3VyY2VfaWQiOiJlYXJuUGFnZV90YXNrTGlzdF8yMiIsImV2ZW50VHJhY2tpbmdMb2dJbmZvIjpbeyJldmVudFRyYWNraW5nVGFza0lkIjoyMDA0OCwicmVzb3VyY2VJZCI6ImVhcm5QYWdlX3Rhc2tMaXN0XzIyIiwiZXh0UGFyYW1zIjp7fX1dfV0", 144 | "Accept-Encoding": "gzip, deflate", 145 | "Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7", 146 | "Cookie": token 147 | } 148 | 149 | data = {"reportCount":56060,"authorized":True,"stepDataStatus":1,"updateStepInfo":True} 150 | # 将 data 转换为 json 字符串,并计算其长度,设置 Content-Length 151 | 152 | data_json = json.dumps(data) 153 | headers['Content-Length'] = str(len(data_json)) 154 | 155 | resp = requests.post(url, headers=headers, json=data) 156 | #print(resp.text) 157 | resp_json = resp.json() 158 | if resp_json['result'] == 1: 159 | walking_info = resp_json['data']['walkingInfo'] 160 | rewarded = True 161 | for item in walking_info: 162 | if item['rewarded'] == False: 163 | rewarded = False 164 | 165 | if rewarded == False: 166 | title = resp_json['data']['button']['text'] 167 | print(f"可以领取: {title}") 168 | 169 | url = "https://encourage.kuaishou.com/rest/wd/encourage/unionTask/reward?taskId=20048&rewardType=1&__NS_sig4=" + __NS_sig4 + "&sigCatVer=1" 170 | headers = { 171 | "Host": "encourage.kuaishou.com", 172 | "Connection": "keep-alive", 173 | "User-Agent": "Mozilla/5.0 (Linux; Android 14; 23113RKC6C Build/UKQ1.230804.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/90.0.4430.226 KsWebView/1.8.90.675 (rel) Mobile Safari/537.36 Yoda/3.1.7-alpha33-intercept1 ksNebula/12.5.20.8014 OS_PRO_BIT/64 MAX_PHY_MEM/15199 AZPREFIX/az4 ICFO/0 StatusHT/34 TitleHT/43 NetType/WIFI ISLP/0 ISDM/0 ISLB/0 locale/zh-cn DPS/19.822 DPP/99 CT/0 ISLM/0", 174 | "content-type": "application/json", 175 | "Accept": "*/*", 176 | "Origin": "https://encourage.kuaishou.com", 177 | "X-Requested-With": "com.kuaishou.nebula", 178 | "Sec-Fetch-Site": "same-origin", 179 | "Sec-Fetch-Mode": "cors", 180 | "Sec-Fetch-Dest": "empty", 181 | "Referer": "https://encourage.kuaishou.com/activity/dish?layoutType=4&encourageEventTracking=W3siZW5jb3VyYWdlX3Rhc2tfaWQiOjIwMDA4LCJlbmNvdXJhZ2VfcmVzb3VyY2VfaWQiOiJlYXJuUGFnZV90YXNrTGlzdF8xNyIsImV2ZW50VHJhY2tpbmdMb2dJbmZvIjpbeyJldmVudFRyYWNraW5nVGFza0lkIjoyMDAwOCwicmVzb3VyY2VJZCI6ImVhcm5QYWdlX3Rhc2tMaXN0XzE3IiwiZXh0UGFyYW1zIjp7fX1dfV0", 182 | "Accept-Encoding": "gzip, deflate", 183 | "Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7", 184 | "Cookie": token 185 | } 186 | resp = requests.get(url, headers=headers) 187 | resp_json = resp.json() 188 | if resp_json['result'] == 1: 189 | desc = resp_json['data']['popup']['desc'] 190 | title = resp_json['data']['popup']['title'] 191 | print(f"{title} {desc}") 192 | else: 193 | print(resp_json['error_msg']) 194 | else: 195 | print(resp_json['data']['button']['text']) 196 | else: 197 | print(resp_json['error_msg']) 198 | except: 199 | print(f"获取异常:{traceback.format_exc()}") 200 | 201 | def get_qiandao(token, __NS_sig3): 202 | print('❤❤❤❤❤开始执行签到❤❤❤❤❤') 203 | try: 204 | url = "https://nebula.kuaishou.com/rest/wd/encourage/unionTask/signIn/report?__NS_sig3=" + __NS_sig3 + "&sigCatVer=1" 205 | 206 | # 定义请求头 207 | headers = { 208 | "Host": "nebula.kuaishou.com", 209 | "Connection": "keep-alive", 210 | "User-Agent": "Mozilla/5.0 (Linux; Android 14; 23113RKC6C Build/UKQ1.230804.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/90.0.4430.226 KsWebView/1.8.90.675 (rel) Mobile Safari/537.36 Yoda/3.1.7-alpha33-intercept1 ksNebula/12.5.20.8014 OS_PRO_BIT/64 MAX_PHY_MEM/15199 AZPREFIX/az4 ICFO/0 StatusHT/34 TitleHT/43 NetType/WIFI ISLP/0 ISDM/0 ISLB/0 locale/zh-cn DPS/19.822 DPP/99 CT/0 ISLM/0", 211 | "content-type": "application/json", 212 | "Accept": "*/*", 213 | "X-Requested-With": "com.kuaishou.nebula", 214 | "Sec-Fetch-Site": "same-origin", 215 | "Sec-Fetch-Mode": "cors", 216 | "Sec-Fetch-Dest": "empty", 217 | "Referer": "https://nebula.kuaishou.com/nebula/task/earning?source=timer&layoutType=4&hyId=nebula_earning", 218 | "Accept-Encoding": "gzip, deflate", 219 | "Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7", 220 | "Cookie": token 221 | } 222 | 223 | # 发送 POST 请求 224 | resp = requests.get(url, headers=headers) 225 | resp_json = resp.json() 226 | 227 | #print(resp.text) 228 | 229 | if resp_json['result'] == 1: 230 | if 'reportRewardResult' in resp_json['data']: 231 | title = resp_json['data']['reportRewardResult']['awardToast']['title'] 232 | print(f"{title}") 233 | bsd1 = resp_json['data']['reportRewardResult']['awardToast']['basicSignInAwardResultShow']['bottomText'] 234 | bsd2 = resp_json['data']['reportRewardResult']['awardToast']['basicSignInAwardResultShow']['bottomText'] 235 | print(f"正常:{bsd1} 额外:{bsd2}") 236 | elif 'signInUnionSpecialAreaData' in resp_json['data']: 237 | subtitle = resp_json['data']['signInUnionSpecialAreaData']['subtitle'] 238 | todaySignInAmount = resp_json['data']['signInUnionSpecialAreaData']['todaySignInAmount'] 239 | print(f"{subtitle}") 240 | print(f"今日签到得到:{todaySignInAmount}元") 241 | else: 242 | print(resp_json['error_msg']) 243 | except: 244 | print(f"获取异常:{traceback.format_exc()}") 245 | 246 | # 获取环境变量 247 | _cookie = os.getenv('KSJSB_COOKIE') 248 | 249 | # 检查变量是否存在 250 | if _cookie == '': 251 | print("请先在环境变量里添加 \"KS_COOKIE\" 填写对应快手的 cookie 值") 252 | exit(0) 253 | 254 | def gen_tokensig(sig,salt=""): 255 | v = sig + salt 256 | return hashlib.sha256(v.encode('utf-8')).hexdigest() 257 | 258 | def gen_sig(params,data): 259 | dd = dict(params,**data) 260 | dict_sort_res = dict(sorted(dd.items(),key=lambda x:x[0])) 261 | ss = "" 262 | for key,value in dict_sort_res.items(): 263 | if key not in ["sig","__NS_sig3","sig2"]: 264 | ss += f"{key}={value}" 265 | ss += "ca8e86efb32e" 266 | return hashlib.md5(ss.encode()).hexdigest() 267 | 268 | 269 | 270 | def main(): 271 | get_baoxiang(_cookie, "b8a8efdfef4d7b1274e497e7e0e11fff8a39fcda6a006afa0371f7f7f1f1f2f3ccec") 272 | get_fanbu(_cookie, "HUDR_sFnX-HFuAE5VsdPNKlLOPr4ntwVLcugxjxZz8_z61EHYFY07AGiHwMelb_ny_pMHxR_0BjgEKKQba1Uc3eSWmMYZtd0w8l4XDj-3MCjD__Ta_XvZSJ4TCB8KqqVKMgRgdptyHjC4q5WxhjlivWeuIEH73Q5s2-4u88UkwHrtgNYFpaoTLyzpjhJN-kWm8EpIT1cd-4gSarv9lyc5NYynpqIeL1p8oDC_aNVs06EqrteEDO9WQN6bPOljEgPJOUyOx2TUE6Zol22dloUXNTFoJdgLPRKfw_RHi0rq1S59Nig74-a-EOa9v636jauSe37plaPbVfAlQYO9ZR3FHGMRsQPwfpaekre0Ra5-k8MxO_S1KZimvzg8hzW00xtV2ElWK4bOQ_Jr8MgnbnxspIGrdAT7goeqm_Gr_PeS3rmTNMpgPIhHO1YIzTyVqRydZeTwh5ckgKW0moc1WndwyJqoqIh222uMxhDr_q2L_eyoTgyZuswrq7MqaDmbuEH0je0NPMrtCfeKHFlC$HE_4b541fe2ab824ca5f9900144007cc023e901070200376400000015d87fe69450a5f990019b563eda7b563e0a00") 273 | get_walk(_cookie, "HUDR_sFnX-HFuAE5VsdPNKlLOPr4ntwVLcugxjxZz8_z61EHYFY07AGiHwMelb_ny_pMHxR_0BjgEKKQba1Uc3eSWmMYZtd0w8l4XDj-3MCjD__Ta_XvZSJ4TCB8KqqVKMgRgdptyHjC4q5WxkzlivWeuMEH73Q5s2-4u88UkwHrtgNYFpaoTLyzpjhJN-kWm8EpIT1cd-4gSarv9lyc5NYynpqIeL1p8oDC_aNVs06E48ZDBDPBAVd7Wcf92VBvKKxaMh3mQAe1nhm7Hio9fdjZvaMcUc1SdzvMQzAj21S59Nig74-a-EOa976Kn3PySfizrwKPeBfIvE4O9ZB3FHGMRsAPwfpaekre0Ra5-P8MxO_S1KZimvzg8hzW00xtV2EkPPYyfHfQ455BmZ2JctZayZle8i-X-z6H4p6yd16GOasouctNda1Yaxj6PrwadZeTwh5ckgKW0moc1WndwyJqoqIh222uMxhDr_q2L_eyoTgrL6MkureEraDmbuEH0je0NPMrtCfeKHFlC$HE_4b541fe2aba7096f7b9001c139646fdfa9010702003764000000408e77b2c51b6f7b90019b563eda7b563e2600") 274 | get_qiandao(_cookie, "1b0b4c7c5896f2b1d7472e444342544b54a7d200e7a3c959ee6e5454525251506f4f") 275 | get_money(_cookie) 276 | 277 | if __name__ == '__main__': 278 | main() 279 | -------------------------------------------------------------------------------- /mytool.py: -------------------------------------------------------------------------------- 1 | import os 2 | import random 3 | import re 4 | import time 5 | from datetime import datetime 6 | from zoneinfo import ZoneInfo 7 | 8 | 9 | def getlistCk(ckname): 10 | if os.getenv(ckname) is None: 11 | return None 12 | # 字符串用回车或@符号分开为list 13 | return re.split(r'\n|@|&', os.getenv(ckname)) 14 | 15 | 16 | # 获取北京时间 带时区 17 | def gettime(): 18 | return datetime.now(tz=ZoneInfo('Asia/Shanghai')) 19 | 20 | 21 | def getSecTimestamp(): 22 | return int(time.time()) 23 | 24 | 25 | def getMSecTimestamp(): 26 | return int(time.time() * 1000) 27 | 28 | 29 | # 随机休眠几秒 随机数为float 30 | def sleep(x, y): 31 | a = random.uniform(x, y) 32 | print(f"随机休眠 {a} 秒") 33 | time.sleep(a) 34 | 35 | 36 | def 输入中文(text): 37 | import pyautogui 38 | import pyperclip 39 | time.sleep(1) 40 | pyperclip.copy(text) 41 | pyautogui.hotkey("ctrl", "v") 42 | 43 | 44 | def 点击图片中心(path="", png="", timeout=3): 45 | import pyautogui 46 | time.sleep(1) 47 | if 寻找是否存在(path, png, timeout): 48 | print(f"找到{png}, 开始执行") 49 | pyautogui.click(pyautogui.center( 50 | pyautogui.locateOnScreen(os.path.dirname(os.path.abspath(__file__)) + f'\\{path}\\{png}', confidence=0.8))) 51 | 52 | 53 | def 寻找是否存在(path="", png="", timeout=3): 54 | import pyautogui 55 | while timeout > 0: 56 | if pyautogui.locateOnScreen(os.path.dirname(os.path.abspath(__file__)) + f'\\{path}\\{png}', 57 | confidence=0.8) is None: 58 | timeout -= 1 59 | time.sleep(1) 60 | continue 61 | else: 62 | return True 63 | return False 64 | 65 | 66 | def getJsonConfig(name): 67 | import json 68 | with open(os.path.dirname(os.path.abspath(__file__)) + f'\\config.json', 'r') as f: 69 | return json.load(f)[name] 70 | 71 | 72 | if __name__ == '__main__': 73 | print(os.getcwd()) 74 | -------------------------------------------------------------------------------- /qzds.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 泉站订水 3 | # date:2024/1/2 4 | """ 5 | 入口:#小程序://泉站订水/pK1FZkwN2CYIbYe 6 | 复制到微信打开 7 | time:2024/1/2 8 | cron: 12 7,17 * * * 9 | new Env('泉站签到'); 10 | 抓包域名: microuser.quanzhan888.com 请求头Authcode Authorization 11 | 环境变量: qztoken = Authcode#Authorization 12 | 多账号新建变量或者用 & 分开 13 | """ 14 | import json 15 | import requests 16 | from datetime import datetime 17 | import os 18 | ## qztoken = Authcode#Sign#Authorization#name1 19 | qwbotkey = os.getenv('qwbotkey') 20 | qztoken = os.getenv('qztoken') 21 | 22 | def ftime(): 23 | t = datetime.now().strftime('%Y-%m-%d %H:%M:%S') 24 | return t 25 | def send(msg, title='通知', url=None): 26 | if not url: 27 | data = { 28 | "msgtype": "text", 29 | "text": { 30 | "content": f"{title}\n\n{msg}\n通知时间:{ftime()}", 31 | # "mentioned_list": ["@all"], 32 | } 33 | } 34 | else: 35 | data = {"msgtype": "news", 36 | "news": {"articles": 37 | [{"title": title, "description": msg, "url": url, 38 | "picurl": 'https://i.ibb.co/7b0WtQH/17-32-15-2a67df71228c73f35ca47cabaa826f17-eb5ce7b1e.png' 39 | }]}} 40 | whurl = f'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key={qwbotkey}' 41 | resp = requests.post(whurl, data=json.dumps(data)).json() 42 | if resp.get('errcode') != 0: 43 | print('消息发送失败,请检查key和发送格式') 44 | return False 45 | return resp 46 | 47 | class QZQD: 48 | def __init__(self, ck): 49 | ## qztoken = Authcode#Authorization#name1 50 | self.authcode = ck.split('#')[0] # 账号的authcode 51 | self.authorization = ck.split('#')[1] # 账号的authorization 52 | #self.name = ck.split('#')[2] if ck.split('#')[2] else None # 用户名字 53 | self.nicename = None 54 | self.ye = None # 余额 55 | self.ts = None # 时间戳 56 | self.msg = '' # 推送消息 57 | # 请求头 58 | self.headers = { 59 | "Host": "microuser.quanzhan888.com", 60 | "Connection": "keep-alive", 61 | "Content-Length": "2", 62 | "Product": "shop", 63 | "content-type": "application/x-www-form-urlencoded", 64 | "charset": "utf-8", 65 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090819)XWEB/8519", 66 | "Platform": "wx", 67 | "Accept-Encoding": "gzip, deflate, br", 68 | "Referer": "https://servicewechat.com/wxcee27346cf362ba6/28/page-frame.html", 69 | 'Authcode': self.authcode, 70 | 'Sign': '99914b932bd37a50b983c5e7c90ae93b', 71 | 'Authorization': self.authorization, 72 | 'timestamp': self.ts 73 | } 74 | self.data = { 75 | } 76 | 77 | def login(self): 78 | """登录获取用户信息""" 79 | try: 80 | # 设置当前时间戳 81 | self.ts = int(datetime.now().timestamp()) 82 | # 请求用户信息的url 83 | url = "https://microuser.quanzhan888.com/user/get-user" 84 | # 请求 85 | response = requests.post(url, headers=self.headers, json=self.data) 86 | # 获取请求返回的响应 87 | if response.json()['code'] == 0: 88 | # 获取用户昵称、余额 89 | nickname = response.json()['data']['nickname'] 90 | ye = response.json()['data']['total_balance'] 91 | self.nickname = nickname 92 | self.ye = ye 93 | xx = f'{self.nickname}: 登录成功!当前红包余额: {self.ye}' 94 | print(xx) 95 | self.msg += xx + '\n' 96 | return True 97 | else: 98 | print(f'登录失败') 99 | print(response.json()) 100 | return False 101 | except Exception as e: 102 | print(f'登录异常:{e}') 103 | self.msg += f'登录异常:{e}\n' 104 | return False 105 | 106 | def signing(self): 107 | """签到""" 108 | try: 109 | self.ts = int(datetime.now().timestamp()) 110 | url = "https://microuser.quanzhan888.com/user/do-sign" 111 | response = requests.post(url, headers=self.headers, json=self.data) 112 | jg = response.json() 113 | if response.json()['code'] == 0: 114 | xx = f"{self.nickname}: 签到成功!" 115 | print(xx) 116 | self.msg += xx + '\n' 117 | else: 118 | print(jg) 119 | except Exception as e: 120 | print(f'签到异常:{e}') 121 | self.msg += (f'签到异常:{e}\n') 122 | return False 123 | 124 | def run(self): 125 | if self.login(): 126 | self.signing() 127 | return self.msg 128 | 129 | if __name__ == '__main__': 130 | ck_list = qztoken.split('&') 131 | msgbox = [] 132 | # 遍历列表 133 | for ck in ck_list: 134 | qd = QZQD(ck) 135 | msg = qd.run() 136 | msgbox.append(msg) 137 | a = send('\n'.join(msgbox), "泉站签到通知") 138 | if a.get('errcode') == 0: 139 | print('企业微信群消息推送成功') 140 | -------------------------------------------------------------------------------- /sendNotify.py: -------------------------------------------------------------------------------- 1 | # !/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # @Time : 2021/9/16 4 | # @Author : curtinlv 5 | # @File : sendNotify.py 6 | # @Software: PyCharm 7 | 8 | import sys 9 | import os, re 10 | from urllib.parse import unquote 11 | import requests,json 12 | cur_path = os.path.abspath(os.path.dirname(__file__)) 13 | root_path = os.path.split(cur_path)[0] 14 | sys.path.append(root_path) 15 | import requests 16 | import json 17 | import time 18 | import hmac 19 | import hashlib 20 | import base64 21 | import urllib.parse 22 | 23 | # 通知服务 24 | BARK = '' # bark服务,自行搜索; secrets可填; 25 | SCKEY = '' # Server酱的SCKEY; secrets可填 26 | TG_BOT_TOKEN = '' # tg机器人的TG_BOT_TOKEN; secrets可填1407203283:AAG9rt-6RDaaX0HBLZQq0laNOh898iFYaRQ 27 | TG_USER_ID = '' # tg机器人的TG_USER_ID; secrets可填 1434078534 28 | TG_API_HOST='' # tg 代理api 29 | TG_PROXY_IP = '' # tg机器人的TG_PROXY_IP; secrets可填 30 | TG_PROXY_PORT = '' # tg机器人的TG_PROXY_PORT; secrets可填 31 | DD_BOT_TOKEN = '' # 钉钉机器人的DD_BOT_TOKEN; secrets可填 32 | DD_BOT_SECRET = '' # 钉钉机器人的DD_BOT_SECRET; secrets可填 33 | QQ_SKEY = '' # qq机器人的QQ_SKEY; secrets可填 34 | QQ_MODE = '' # qq机器人的QQ_MODE; secrets可填 35 | QYWX_AM = '' # 企业微信 36 | PUSH_PLUS_TOKEN = '5c95b037b1df48b796460b1637bd636b' # 微信推送Plus+ 37 | 38 | notify_mode = [] 39 | 40 | message_info = '''''' 41 | 42 | # GitHub action运行需要填写对应的secrets 43 | if "BARK" in os.environ and os.environ["BARK"]: 44 | BARK = os.environ["BARK"] 45 | if "SCKEY" in os.environ and os.environ["SCKEY"]: 46 | SCKEY = os.environ["SCKEY"] 47 | if "TG_BOT_TOKEN" in os.environ and os.environ["TG_BOT_TOKEN"] and "TG_USER_ID" in os.environ and os.environ["TG_USER_ID"]: 48 | TG_BOT_TOKEN = os.environ["TG_BOT_TOKEN"] 49 | TG_USER_ID = os.environ["TG_USER_ID"] 50 | if "TG_API_HOST" in os.environ and os.environ["TG_API_HOST"]: 51 | TG_API_HOST = os.environ["TG_API_HOST"] 52 | if "DD_BOT_TOKEN" in os.environ and os.environ["DD_BOT_TOKEN"] and "DD_BOT_SECRET" in os.environ and os.environ["DD_BOT_SECRET"]: 53 | DD_BOT_TOKEN = os.environ["DD_BOT_TOKEN"] 54 | DD_BOT_SECRET = os.environ["DD_BOT_SECRET"] 55 | if "QQ_SKEY" in os.environ and os.environ["QQ_SKEY"] and "QQ_MODE" in os.environ and os.environ["QQ_MODE"]: 56 | QQ_SKEY = os.environ["QQ_SKEY"] 57 | QQ_MODE = os.environ["QQ_MODE"] 58 | # 获取pushplus+ PUSH_PLUS_TOKEN 59 | if "PUSH_PLUS_TOKEN" in os.environ: 60 | if len(os.environ["PUSH_PLUS_TOKEN"]) > 1: 61 | PUSH_PLUS_TOKEN = os.environ["PUSH_PLUS_TOKEN"] 62 | # print("已获取并使用Env环境 PUSH_PLUS_TOKEN") 63 | # 获取企业微信应用推送 QYWX_AM 64 | if "QYWX_AM" in os.environ: 65 | if len(os.environ["QYWX_AM"]) > 1: 66 | QYWX_AM = os.environ["QYWX_AM"] 67 | # print("已获取并使用Env环境 QYWX_AM") 68 | if BARK: 69 | notify_mode.append('bark') 70 | # print("BARK 推送打开") 71 | if SCKEY: 72 | notify_mode.append('sc_key') 73 | # print("Server酱 推送打开") 74 | if TG_BOT_TOKEN and TG_USER_ID: 75 | notify_mode.append('telegram_bot') 76 | # print("Telegram 推送打开") 77 | if DD_BOT_TOKEN and DD_BOT_SECRET: 78 | notify_mode.append('dingding_bot') 79 | # print("钉钉机器人 推送打开") 80 | if QQ_SKEY and QQ_MODE: 81 | notify_mode.append('coolpush_bot') 82 | # print("QQ机器人 推送打开") 83 | 84 | if PUSH_PLUS_TOKEN: 85 | notify_mode.append('pushplus_bot') 86 | # print("微信推送Plus机器人 推送打开") 87 | if QYWX_AM: 88 | notify_mode.append('wecom_app') 89 | # print("企业微信机器人 推送打开") 90 | 91 | 92 | def message(str_msg): 93 | global message_info 94 | print(str_msg) 95 | message_info = "{}\n{}".format(message_info, str_msg) 96 | sys.stdout.flush() 97 | 98 | def bark(title, content): 99 | print("\n") 100 | if not BARK: 101 | print("bark服务的bark_token未设置!!\n取消推送") 102 | return 103 | print("bark服务启动") 104 | try: 105 | response = requests.get( 106 | f"""https://api.day.app/{BARK}/{title}/{urllib.parse.quote_plus(content)}""").json() 107 | if response['code'] == 200: 108 | print('推送成功!') 109 | else: 110 | print('推送失败!') 111 | except: 112 | print('推送失败!') 113 | 114 | def serverJ(title, content): 115 | print("\n") 116 | if not SCKEY: 117 | print("server酱服务的SCKEY未设置!!\n取消推送") 118 | return 119 | print("serverJ服务启动") 120 | data = { 121 | "text": title, 122 | "desp": content.replace("\n", "\n\n") 123 | } 124 | response = requests.post(f"https://sc.ftqq.com/{SCKEY}.send", data=data).json() 125 | if response['errno'] == 0: 126 | print('推送成功!') 127 | else: 128 | print('推送失败!') 129 | 130 | # tg通知 131 | def telegram_bot(title, content): 132 | try: 133 | print("\n") 134 | bot_token = TG_BOT_TOKEN 135 | user_id = TG_USER_ID 136 | if not bot_token or not user_id: 137 | print("tg服务的bot_token或者user_id未设置!!\n取消推送") 138 | return 139 | print("tg服务启动") 140 | if TG_API_HOST: 141 | if 'http' in TG_API_HOST: 142 | url = f"{TG_API_HOST}/bot{TG_BOT_TOKEN}/sendMessage" 143 | else: 144 | url = f"https://{TG_API_HOST}/bot{TG_BOT_TOKEN}/sendMessage" 145 | else: 146 | url = f"https://api.telegram.org/bot{TG_BOT_TOKEN}/sendMessage" 147 | 148 | headers = {'Content-Type': 'application/x-www-form-urlencoded'} 149 | payload = {'chat_id': str(TG_USER_ID), 'text': f'{title}\n\n{content}', 'disable_web_page_preview': 'true'} 150 | proxies = None 151 | if TG_PROXY_IP and TG_PROXY_PORT: 152 | proxyStr = "http://{}:{}".format(TG_PROXY_IP, TG_PROXY_PORT) 153 | proxies = {"http": proxyStr, "https": proxyStr} 154 | try: 155 | response = requests.post(url=url, headers=headers, params=payload, proxies=proxies).json() 156 | except: 157 | print('推送失败!') 158 | if response['ok']: 159 | print('推送成功!') 160 | else: 161 | print('推送失败!') 162 | except Exception as e: 163 | print(e) 164 | 165 | def dingding_bot(title, content): 166 | timestamp = str(round(time.time() * 1000)) # 时间戳 167 | secret_enc = DD_BOT_SECRET.encode('utf-8') 168 | string_to_sign = '{}\n{}'.format(timestamp, DD_BOT_SECRET) 169 | string_to_sign_enc = string_to_sign.encode('utf-8') 170 | hmac_code = hmac.new(secret_enc, string_to_sign_enc, digestmod=hashlib.sha256).digest() 171 | sign = urllib.parse.quote_plus(base64.b64encode(hmac_code)) # 签名 172 | print('开始使用 钉钉机器人 推送消息...', end='') 173 | url = f'https://oapi.dingtalk.com/robot/send?access_token={DD_BOT_TOKEN}×tamp={timestamp}&sign={sign}' 174 | headers = {'Content-Type': 'application/json;charset=utf-8'} 175 | data = { 176 | 'msgtype': 'text', 177 | 'text': {'content': f'{title}\n\n{content}'} 178 | } 179 | response = requests.post(url=url, data=json.dumps(data), headers=headers, timeout=15).json() 180 | if not response['errcode']: 181 | print('推送成功!') 182 | else: 183 | print('推送失败!') 184 | 185 | def coolpush_bot(title, content): 186 | print("\n") 187 | if not QQ_SKEY or not QQ_MODE: 188 | print("qq服务的QQ_SKEY或者QQ_MODE未设置!!\n取消推送") 189 | return 190 | print("qq服务启动") 191 | url=f"https://qmsg.zendee.cn/{QQ_MODE}/{QQ_SKEY}" 192 | payload = {'msg': f"{title}\n\n{content}".encode('utf-8')} 193 | response = requests.post(url=url, params=payload).json() 194 | if response['code'] == 0: 195 | print('推送成功!') 196 | else: 197 | print('推送失败!') 198 | # push推送 199 | def pushplus_bot(title, content): 200 | try: 201 | print("\n") 202 | if not PUSH_PLUS_TOKEN: 203 | print("PUSHPLUS服务的token未设置!!\n取消推送") 204 | return 205 | print("PUSHPLUS服务启动") 206 | url = 'http://www.pushplus.plus/send' 207 | data = { 208 | "token": PUSH_PLUS_TOKEN, 209 | "title": title, 210 | "content": content 211 | } 212 | body = json.dumps(data).encode(encoding='utf-8') 213 | headers = {'Content-Type': 'application/json'} 214 | response = requests.post(url=url, data=body, headers=headers).json() 215 | if response['code'] == 200: 216 | print('推送成功!') 217 | else: 218 | print('推送失败!') 219 | except Exception as e: 220 | print(e) 221 | # 企业微信 APP 推送 222 | def wecom_app(title, content): 223 | try: 224 | if not QYWX_AM: 225 | print("QYWX_AM 并未设置!!\n取消推送") 226 | return 227 | QYWX_AM_AY = re.split(',', QYWX_AM) 228 | if 4 < len(QYWX_AM_AY) > 5: 229 | print("QYWX_AM 设置错误!!\n取消推送") 230 | return 231 | corpid = QYWX_AM_AY[0] 232 | corpsecret = QYWX_AM_AY[1] 233 | touser = QYWX_AM_AY[2] 234 | agentid = QYWX_AM_AY[3] 235 | try: 236 | media_id = QYWX_AM_AY[4] 237 | except: 238 | media_id = '' 239 | wx = WeCom(corpid, corpsecret, agentid) 240 | # 如果没有配置 media_id 默认就以 text 方式发送 241 | if not media_id: 242 | message = title + '\n\n' + content 243 | response = wx.send_text(message, touser) 244 | else: 245 | response = wx.send_mpnews(title, content, media_id, touser) 246 | if response == 'ok': 247 | print('推送成功!') 248 | else: 249 | print('推送失败!错误信息如下:\n', response) 250 | except Exception as e: 251 | print(e) 252 | 253 | class WeCom: 254 | def __init__(self, corpid, corpsecret, agentid): 255 | self.CORPID = corpid 256 | self.CORPSECRET = corpsecret 257 | self.AGENTID = agentid 258 | 259 | def get_access_token(self): 260 | url = 'https://qyapi.weixin.qq.com/cgi-bin/gettoken' 261 | values = {'corpid': self.CORPID, 262 | 'corpsecret': self.CORPSECRET, 263 | } 264 | req = requests.post(url, params=values) 265 | data = json.loads(req.text) 266 | return data["access_token"] 267 | 268 | def send_text(self, message, touser="@all"): 269 | send_url = 'https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=' + self.get_access_token() 270 | send_values = { 271 | "touser": touser, 272 | "msgtype": "text", 273 | "agentid": self.AGENTID, 274 | "text": { 275 | "content": message 276 | }, 277 | "safe": "0" 278 | } 279 | send_msges = (bytes(json.dumps(send_values), 'utf-8')) 280 | respone = requests.post(send_url, send_msges) 281 | respone = respone.json() 282 | return respone["errmsg"] 283 | 284 | def send_mpnews(self, title, message, media_id, touser="@all"): 285 | send_url = 'https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=' + self.get_access_token() 286 | send_values = { 287 | "touser": touser, 288 | "msgtype": "mpnews", 289 | "agentid": self.AGENTID, 290 | "mpnews": { 291 | "articles": [ 292 | { 293 | "title": title, 294 | "thumb_media_id": media_id, 295 | "author": "Author", 296 | "content_source_url": "", 297 | "content": message.replace('\n', '
'), 298 | "digest": message 299 | } 300 | ] 301 | } 302 | } 303 | send_msges = (bytes(json.dumps(send_values), 'utf-8')) 304 | respone = requests.post(send_url, send_msges) 305 | respone = respone.json() 306 | return respone["errmsg"] 307 | 308 | def send(title, content): 309 | """ 310 | 使用 bark, telegram bot, dingding bot, serverJ 发送手机推送 311 | :param title: 312 | :param content: 313 | :return: 314 | """ 315 | for i in notify_mode: 316 | if i == 'bark': 317 | if BARK: 318 | bark(title=title, content=content) 319 | else: 320 | print('未启用 bark') 321 | continue 322 | if i == 'sc_key': 323 | if SCKEY: 324 | serverJ(title=title, content=content) 325 | else: 326 | print('未启用 Server酱') 327 | continue 328 | elif i == 'dingding_bot': 329 | if DD_BOT_TOKEN and DD_BOT_SECRET: 330 | dingding_bot(title=title, content=content) 331 | else: 332 | print('未启用 钉钉机器人') 333 | continue 334 | elif i == 'telegram_bot': 335 | if TG_BOT_TOKEN and TG_USER_ID: 336 | telegram_bot(title=title, content=content) 337 | else: 338 | print('未启用 telegram机器人') 339 | continue 340 | elif i == 'coolpush_bot': 341 | if QQ_SKEY and QQ_MODE: 342 | coolpush_bot(title=title, content=content) 343 | else: 344 | print('未启用 QQ机器人') 345 | continue 346 | elif i == 'pushplus_bot': 347 | if PUSH_PLUS_TOKEN: 348 | pushplus_bot(title=title, content=content) 349 | else: 350 | print('未启用 PUSHPLUS机器人') 351 | continue 352 | elif i == 'wecom_app': 353 | if QYWX_AM: 354 | wecom_app(title=title, content=content) 355 | else: 356 | print('未启用企业微信应用消息推送') 357 | continue 358 | else: 359 | print('此类推送方式不存在') 360 | 361 | 362 | def main(): 363 | send('title', 'content') 364 | 365 | 366 | if __name__ == '__main__': 367 | main() 368 | -------------------------------------------------------------------------------- /utils.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 感谢yml大佬js封装库 当前版本V0.0.5 3 | * 22/11/21 随机生成GUID 4 | * 22/11/23 随机生成MAC网络地址 5 | * 22/11/28 随机一言 自建和其他 gitee版和github版 优先gitee 速度快 6 | */ 7 | let utilsVersion = "0.0.5" 8 | module.exports = { 9 | version: version,//版本 10 | txt_api: txt_api,//获取随机文案 一言api // "a"动画, "b"漫画, "c"游戏, "d"文学, "e"原创, "f"来自网络, "g"其他, "h"影视, "i"诗词, "j"网易云, "k"哲学 ,"l"抖机灵 11 | txt_api_self_gitee: txt_api_self_gitee,//获取随机文案 gitee版本 自建 // 古诗, 动画, 心情 ······ 12 | txt_api_self_github: txt_api_self_github,//获取随机文案 github版本 自建 // 古诗, 动画, 心情 ······ 13 | randomMac: randomMac,//随机MAC网络地址 14 | guid: guid,//根据时间戳生成GUID 8-4-4-4-12 15 | phone_num: phone_num,//手机号中间遮挡 16 | randomszdx: randomszdx,//随机 数字 + 大写字母 生成 17 | randomszxx: randomszxx,//随机 数字 + 小写字母 生成 18 | randomInt: randomInt,//随机整数生成 19 | ts13: ts13,//时间戳 13位 20 | ts10: ts10,//时间戳 10位 21 | tmtoDate: tmtoDate,//时间戳 转 日期 22 | local_hours: local_hours,//获取当前小时数 23 | local_minutes: local_minutes,//获取当前分钟数 24 | local_year: local_year,//获取当前年份 2022 25 | local_month: local_month,//获取当前月份(数字) 5月 26 | local_month_two: local_month_two,//获取当前月份(数字) 05月 补零 27 | local_day: local_day,//获取当前天数(数字) 5日 28 | local_day_two: local_day_two,//获取当前天数 05日 补零 29 | RSA_Encrypt: RSA_Encrypt,//RSA公钥加密 传参(数据,key) , 返回 base64格式 30 | base64_encode: base64_encode,//base64 编码 31 | base64_decode: base64_decode,//base64 解码 32 | SHA1_Encrypt: SHA1_Encrypt,//SHA1加密 33 | SHA256_Encrypt: SHA256_Encrypt,//SHA256加密 34 | MD5_Encrypt: MD5_Encrypt,//md5 加密 35 | }; 36 | 37 | /** 38 | * 版本号 39 | */ 40 | function version() { 41 | return utilsVersion; 42 | } 43 | 44 | /** 45 | * 获取随机文案 一言api 46 | */ 47 | function txt_api(i) { 48 | return new Promise((resolve) => { 49 | try { 50 | var request = require('request'); 51 | let options = { 52 | method: 'GET', 53 | url: 'https://v1.hitokoto.cn/', 54 | qs: { c: i }, 55 | }; 56 | request(options, function (error, response, body) { 57 | if (error) throw new Error(error); 58 | //console.log(body); 59 | let result = JSON.parse(body); 60 | let txt = result.hitokoto 61 | //console.log(result.id); 62 | resolve(txt) 63 | return txt 64 | }); 65 | } catch (error) { 66 | console.log(error); 67 | } 68 | }) 69 | } 70 | 71 | /** 72 | * 获取随机文案 自建 gitee仓库 73 | */ 74 | function txt_api_self_gitee(type) { 75 | return new Promise((resolve) => { 76 | try { 77 | var request = require('request'); 78 | let options = { 79 | method: 'GET', 80 | url: 'https://gitee.com/smallfawn/api/raw/master/txt.txt', 81 | }; 82 | request(options, function (error, response, body) { 83 | if (error) throw new Error(error); 84 | let txtbody = body 85 | //console.log(body); 86 | let txtv = txtbody.match(type) 87 | //console.log(txtv.input.slice(3, 14)); 88 | let lineArr = txtv.input.slice(3, 14)//截取行段文本 89 | let lineStar = lineArr.slice(1, 5)//首行 90 | let lineEnd = lineArr.slice(6, 10)//尾行 91 | let randomline = randomInt(Number(lineStar) - 1, Number(lineEnd) - 1)//随机行 因为JS的索引号是0,和行号不一致所以就-1 检测行数比实际行数大1 92 | let txt = txtbody.split("\n")[randomline] 93 | //console.log(lineArr); 94 | //console.log(lineStar, lineEnd); 95 | //console.log(Number(lineStar) -1, Number(lineEnd) -1); 96 | //console.log(randomline); 97 | //console.log(txt); 98 | resolve(txt) 99 | return txt 100 | }); 101 | } catch (error) { 102 | console.log(error); 103 | } 104 | }) 105 | } 106 | 107 | /** 108 | * 获取随机文案 自建 github仓库 109 | */ 110 | function txt_api_self_github(type) { 111 | return new Promise((resolve) => { 112 | function txtline(type) { 113 | switch (type) { 114 | case "古诗": //古诗 115 | return [2, 5] 116 | case "动画": //动画 117 | return [3, 8] 118 | case "心情": //心情 119 | return [3, 8] 120 | } 121 | } 122 | try { 123 | var request = require('request'); 124 | let options = { 125 | method: 'GET', 126 | url: 'https://ghproxy.com/https://raw.githubusercontent.com/smallfawn/api/main/txt.txt',//https://ghproxy.com/https://raw.githubusercontent.com/smallfawn/api/main/txt.txt 127 | }; 128 | request(options, function (error, response, body) { 129 | if (error) throw new Error(error); 130 | let txtbody = body 131 | //console.log(body); 132 | let line = txtline(type) 133 | let randomline = randomInt(line[0] - 1, line[1] - 1)//随机行 因为JS的索引号是0,和行号不一致所以就-1 检测行数比实际行数大1 134 | //console.log(txt.split("\n")[randomline]) 135 | let txt = txtbody.split("\n")[randomline] 136 | //console.log(txt); 137 | resolve(txt) 138 | return txt 139 | }); 140 | } catch (error) { 141 | console.log(error); 142 | } 143 | }) 144 | } 145 | 146 | /** 147 | * 随机MAC网络地址 148 | */ 149 | function randomMac() { 150 | return "XX:XX:XX:XX:XX:XX".replace(/X/g, function () { 151 | return "0123456789ABCDEF".charAt(Math.floor(Math.random() * 16)) 152 | }); 153 | } 154 | 155 | /** 156 | * 随机UUID(由时间戳生成) 8-4-4-4-12 157 | */ 158 | function guid() { 159 | function S4() { 160 | return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); 161 | } 162 | return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4()); 163 | } 164 | 165 | /** 166 | * 手机号中间遮挡 167 | */ 168 | function phone_num(phone_num) { 169 | if (phone_num.length == 11) { 170 | let data = phone_num.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2"); 171 | return data; 172 | } else { 173 | return phone_num; 174 | } 175 | } 176 | 177 | /** 178 | * 随机 数字 + 大写字母 生成 179 | */ 180 | function randomszdx(e) { 181 | e = e || 32; 182 | var t = "QWERTYUIOPASDFGHJKLZXCVBNM1234567890", 183 | a = t.length, 184 | n = ""; 185 | 186 | for (i = 0; i < e; i++) n += t.charAt(Math.floor(Math.random() * a)); 187 | return n; 188 | } 189 | 190 | /** 191 | * 随机 数字 + 小写字母 生成 192 | */ 193 | function randomszxx(e) { 194 | e = e || 32; 195 | var t = "qwertyuioplkjhgfdsazxcvbnm1234567890", 196 | a = t.length, 197 | n = ""; 198 | 199 | for (i = 0; i < e; i++) n += t.charAt(Math.floor(Math.random() * a)); 200 | return n; 201 | } 202 | 203 | /** 204 | * 随机整数生成 205 | */ 206 | function randomInt(min, max) { 207 | return Math.round(Math.random() * (max - min) + min); 208 | } 209 | 210 | /** 211 | * 时间戳 13位 212 | */ 213 | function ts13() { 214 | return Math.round(new Date().getTime()).toString(); 215 | } 216 | 217 | /** 218 | * 时间戳 10位 219 | */ 220 | function ts10() { 221 | return Math.round(new Date().getTime() / 1000).toString(); 222 | } 223 | 224 | /** 225 | * 时间戳 转 日期 226 | */ 227 | function tmtoDate(time = +new Date()) { 228 | if (time.toString().length == 13) { 229 | var date = new Date(time + 8 * 3600 * 1000); 230 | return date.toJSON().substr(0, 19).replace("T", " "); 231 | } else if (time.toString().length == 10) { 232 | time = time * 1000; 233 | var date = new Date(time + 8 * 3600 * 1000); 234 | return date.toJSON().substr(0, 19).replace("T", " "); 235 | } 236 | } 237 | 238 | /** 239 | * 获取当前小时数 240 | */ 241 | function local_hours() { 242 | let myDate = new Date(); 243 | let h = myDate.getHours(); 244 | return h; 245 | } 246 | 247 | /** 248 | * 获取当前分钟数 249 | */ 250 | function local_minutes() { 251 | let myDate = new Date(); 252 | let m = myDate.getMinutes(); 253 | return m; 254 | } 255 | 256 | /** 257 | * 获取当前年份 2022 258 | */ 259 | function local_year() { 260 | let myDate = new Date(); 261 | y = myDate.getFullYear(); 262 | return y; 263 | } 264 | 265 | /** 266 | * 获取当前月份(数字) 5月 267 | */ 268 | function local_month() { 269 | let myDate = new Date(); 270 | let m = myDate.getMonth(); 271 | return m; 272 | } 273 | 274 | /** 275 | * 获取当前月份(数字) 05月 补零 276 | */ 277 | function local_month_two() { 278 | let myDate = new Date(); 279 | let m = myDate.getMonth(); 280 | if (m.toString().length == 1) { 281 | m = `0${m}`; 282 | } 283 | return m; 284 | } 285 | 286 | /** 287 | * 获取当前天数(数字) 5日 288 | */ 289 | function local_day() { 290 | let myDate = new Date(); 291 | let d = myDate.getDate(); 292 | return d; 293 | } 294 | 295 | /** 296 | * 获取当前天数 05日 补零 297 | */ 298 | function local_day_two() { 299 | let myDate = new Date(); 300 | let d = myDate.getDate(); 301 | if (d.toString().length == 1) { 302 | d = `0${d}`; 303 | } 304 | return d; 305 | } 306 | 307 | /** 308 | * RSA公钥加密 传参(数据,key) , 返回 base64格式 309 | */ 310 | function RSA_Encrypt(msg, key) { 311 | global.navigator = { appName: 'nodejs' }; // fake the navigator object 312 | global.window = {}; // fake the window object 313 | const JSEncrypt = require('jsencrypt') 314 | let enc = new JSEncrypt(); 315 | enc.setPublicKey(key) 316 | return enc.encrypt(msg).toString(); 317 | } 318 | 319 | /** 320 | * base64 编码 321 | */ 322 | function base64_encode(data) { 323 | let a = Buffer.from(data, 'utf-8').toString('base64') 324 | return a 325 | } 326 | 327 | /** 328 | * base64 解码 329 | */ 330 | function base64_decode(data) { 331 | let a = Buffer.from(data, 'base64').toString('utf8') 332 | return a 333 | } 334 | 335 | /** 336 | * SHA1 加密 337 | */ 338 | function SHA1_Encrypt(s) { 339 | var data = new Uint8Array(encodeUTF8(s)) 340 | var i, j, t; 341 | var l = ((data.length + 8) >>> 6 << 4) + 16, s = new Uint8Array(l << 2); 342 | s.set(new Uint8Array(data.buffer)), s = new Uint32Array(s.buffer); 343 | for (t = new DataView(s.buffer), i = 0; i < l; i++)s[i] = t.getUint32(i << 2); 344 | s[data.length >> 2] |= 0x80 << (24 - (data.length & 3) * 8); 345 | s[l - 1] = data.length << 3; 346 | var w = [], f = [ 347 | function () { return m[1] & m[2] | ~m[1] & m[3]; }, 348 | function () { return m[1] ^ m[2] ^ m[3]; }, 349 | function () { return m[1] & m[2] | m[1] & m[3] | m[2] & m[3]; }, 350 | function () { return m[1] ^ m[2] ^ m[3]; } 351 | ], rol = function (n, c) { return n << c | n >>> (32 - c); }, 352 | k = [1518500249, 1859775393, -1894007588, -899497514], 353 | m = [1732584193, -271733879, null, null, -1009589776]; 354 | m[2] = ~m[0], m[3] = ~m[1]; 355 | for (i = 0; i < s.length; i += 16) { 356 | var o = m.slice(0); 357 | for (j = 0; j < 80; j++) 358 | w[j] = j < 16 ? s[i + j] : rol(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1), 359 | t = rol(m[0], 5) + f[j / 20 | 0]() + m[4] + w[j] + k[j / 20 | 0] | 0, 360 | m[1] = rol(m[1], 30), m.pop(), m.unshift(t); 361 | for (j = 0; j < 5; j++)m[j] = m[j] + o[j] | 0; 362 | }; 363 | t = new DataView(new Uint32Array(m).buffer); 364 | for (var i = 0; i < 5; i++)m[i] = t.getUint32(i << 2); 365 | 366 | var hex = Array.prototype.map.call(new Uint8Array(new Uint32Array(m).buffer), function (e) { 367 | return (e < 16 ? "0" : "") + e.toString(16); 368 | }).join(""); 369 | return hex; 370 | } 371 | function encodeUTF8(s) { 372 | var i, r = [], c, x; 373 | for (i = 0; i < s.length; i++) 374 | if ((c = s.charCodeAt(i)) < 0x80) r.push(c); 375 | else if (c < 0x800) r.push(0xC0 + (c >> 6 & 0x1F), 0x80 + (c & 0x3F)); 376 | else { 377 | if ((x = c ^ 0xD800) >> 10 == 0) //对四字节UTF-16转换为Unicode 378 | c = (x << 10) + (s.charCodeAt(++i) ^ 0xDC00) + 0x10000, 379 | r.push(0xF0 + (c >> 18 & 0x7), 0x80 + (c >> 12 & 0x3F)); 380 | else r.push(0xE0 + (c >> 12 & 0xF)); 381 | r.push(0x80 + (c >> 6 & 0x3F), 0x80 + (c & 0x3F)); 382 | }; 383 | return r; 384 | } 385 | 386 | /** 387 | * SHA256 加密 388 | */ 389 | function SHA256_Encrypt(data) { 390 | sha256_init(); 391 | sha256_update(data, data.length); 392 | sha256_final(); 393 | return sha256_encode_hex(); 394 | } 395 | /* SHA256 logical functions */ function rotateRight(n, x) { return (x >>> n) | (x << (32 - n)); } function choice(x, y, z) { return (x & y) ^ (~x & z); } function majority(x, y, z) { return (x & y) ^ (x & z) ^ (y & z); } function sha256_Sigma0(x) { return rotateRight(2, x) ^ rotateRight(13, x) ^ rotateRight(22, x); } function sha256_Sigma1(x) { return rotateRight(6, x) ^ rotateRight(11, x) ^ rotateRight(25, x); } function sha256_sigma0(x) { return rotateRight(7, x) ^ rotateRight(18, x) ^ (x >>> 3); } function sha256_sigma1(x) { return rotateRight(17, x) ^ rotateRight(19, x) ^ (x >>> 10); } function sha256_expand(W, j) { return (W[j & 0x0f] += sha256_sigma1(W[(j + 14) & 0x0f]) + W[(j + 9) & 0x0f] + sha256_sigma0(W[(j + 1) & 0x0f])); } /* Hash constant words K: */ var K256 = new Array(0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2); /* global arrays */ var ihash, count, buffer; var sha256_hex_digits = "0123456789abcdef"; /* Add 32-bit integers with 16-bit operations (bug in some JS-interpreters: overflow) */ function safe_add(x, y) { var lsw = (x & 0xffff) + (y & 0xffff); var msw = (x >> 16) + (y >> 16) + (lsw >> 16); return (msw << 16) | (lsw & 0xffff); } /* Initialise the SHA256 computation */ function sha256_init() { ihash = new Array(8); count = new Array(2); buffer = new Array(64); count[0] = count[1] = 0; ihash[0] = 0x6a09e667; ihash[1] = 0xbb67ae85; ihash[2] = 0x3c6ef372; ihash[3] = 0xa54ff53a; ihash[4] = 0x510e527f; ihash[5] = 0x9b05688c; ihash[6] = 0x1f83d9ab; ihash[7] = 0x5be0cd19; } /* Transform a 512-bit message block */ function sha256_transform() { var a, b, c, d, e, f, g, h, T1, T2; var W = new Array(16); /* Initialize registers with the previous intermediate value */ a = ihash[0]; b = ihash[1]; c = ihash[2]; d = ihash[3]; e = ihash[4]; f = ihash[5]; g = ihash[6]; h = ihash[7]; /* make 32-bit words */ for (var i = 0; i < 16; i++) W[i] = buffer[(i << 2) + 3] | (buffer[(i << 2) + 2] << 8) | (buffer[(i << 2) + 1] << 16) | (buffer[i << 2] << 24); for (var j = 0; j < 64; j++) { T1 = h + sha256_Sigma1(e) + choice(e, f, g) + K256[j]; if (j < 16) T1 += W[j]; else T1 += sha256_expand(W, j); T2 = sha256_Sigma0(a) + majority(a, b, c); h = g; g = f; f = e; e = safe_add(d, T1); d = c; c = b; b = a; a = safe_add(T1, T2); } /* Compute the current intermediate hash value */ ihash[0] += a; ihash[1] += b; ihash[2] += c; ihash[3] += d; ihash[4] += e; ihash[5] += f; ihash[6] += g; ihash[7] += h; } /* Read the next chunk of data and update the SHA256 computation */ function sha256_update(data, inputLen) { var i, index, curpos = 0; /* Compute number of bytes mod 64 */ index = (count[0] >> 3) & 0x3f; var remainder = inputLen & 0x3f; /* Update number of bits */ if ((count[0] += inputLen << 3) < inputLen << 3) count[1]++; count[1] += inputLen >> 29; /* Transform as many times as possible */ for (i = 0; i + 63 < inputLen; i += 64) { for (var j = index; j < 64; j++) buffer[j] = data.charCodeAt(curpos++); sha256_transform(); index = 0; } /* Buffer remaining input */ for (var j = 0; j < remainder; j++) buffer[j] = data.charCodeAt(curpos++); } /* Finish the computation by operations such as padding */ function sha256_final() { var index = (count[0] >> 3) & 0x3f; buffer[index++] = 0x80; if (index <= 56) { for (var i = index; i < 56; i++) buffer[i] = 0; } else { for (var i = index; i < 64; i++) buffer[i] = 0; sha256_transform(); for (var i = 0; i < 56; i++) buffer[i] = 0; } buffer[56] = (count[1] >>> 24) & 0xff; buffer[57] = (count[1] >>> 16) & 0xff; buffer[58] = (count[1] >>> 8) & 0xff; buffer[59] = count[1] & 0xff; buffer[60] = (count[0] >>> 24) & 0xff; buffer[61] = (count[0] >>> 16) & 0xff; buffer[62] = (count[0] >>> 8) & 0xff; buffer[63] = count[0] & 0xff; sha256_transform(); } /* Split the internal hash values into an array of bytes */ function sha256_encode_bytes() { var j = 0; var output = new Array(32); for (var i = 0; i < 8; i++) { output[j++] = (ihash[i] >>> 24) & 0xff; output[j++] = (ihash[i] >>> 16) & 0xff; output[j++] = (ihash[i] >>> 8) & 0xff; output[j++] = ihash[i] & 0xff; } return output; } /* Get the internal hash as a hex string */ function sha256_encode_hex() { var output = new String(); for (var i = 0; i < 8; i++) { for (var j = 28; j >= 0; j -= 4) output += sha256_hex_digits.charAt((ihash[i] >>> j) & 0x0f); } return output; } 396 | 397 | /** 398 | * md5 加密 399 | */ 400 | function MD5_Encrypt(a) { function b(a, b) { return (a << b) | (a >>> (32 - b)); } function c(a, b) { var c, d, e, f, g; return ((e = 2147483648 & a), (f = 2147483648 & b), (c = 1073741824 & a), (d = 1073741824 & b), (g = (1073741823 & a) + (1073741823 & b)), c & d ? 2147483648 ^ g ^ e ^ f : c | d ? 1073741824 & g ? 3221225472 ^ g ^ e ^ f : 1073741824 ^ g ^ e ^ f : g ^ e ^ f); } function d(a, b, c) { return (a & b) | (~a & c); } function e(a, b, c) { return (a & c) | (b & ~c); } function f(a, b, c) { return a ^ b ^ c; } function g(a, b, c) { return b ^ (a | ~c); } function h(a, e, f, g, h, i, j) { return (a = c(a, c(c(d(e, f, g), h), j))), c(b(a, i), e); } function i(a, d, f, g, h, i, j) { return (a = c(a, c(c(e(d, f, g), h), j))), c(b(a, i), d); } function j(a, d, e, g, h, i, j) { return (a = c(a, c(c(f(d, e, g), h), j))), c(b(a, i), d); } function k(a, d, e, f, h, i, j) { return (a = c(a, c(c(g(d, e, f), h), j))), c(b(a, i), d); } function l(a) { for (var b, c = a.length, d = c + 8, e = (d - (d % 64)) / 64, f = 16 * (e + 1), g = new Array(f - 1), h = 0, i = 0; c > i;) (b = (i - (i % 4)) / 4), (h = (i % 4) * 8), (g[b] = g[b] | (a.charCodeAt(i) << h)), i++; return ((b = (i - (i % 4)) / 4), (h = (i % 4) * 8), (g[b] = g[b] | (128 << h)), (g[f - 2] = c << 3), (g[f - 1] = c >>> 29), g); } function m(a) { var b, c, d = "", e = ""; for (c = 0; 3 >= c; c++) (b = (a >>> (8 * c)) & 255), (e = "0" + b.toString(16)), (d += e.substr(e.length - 2, 2)); return d; } function n(a) { a = a.replace(/\r\n/g, "\n"); for (var b = "", c = 0; c < a.length; c++) { var d = a.charCodeAt(c); 128 > d ? (b += String.fromCharCode(d)) : d > 127 && 2048 > d ? ((b += String.fromCharCode((d >> 6) | 192)), (b += String.fromCharCode((63 & d) | 128))) : ((b += String.fromCharCode((d >> 12) | 224)), (b += String.fromCharCode(((d >> 6) & 63) | 128)), (b += String.fromCharCode((63 & d) | 128))); } return b; } var o, p, q, r, s, t, u, v, w, x = [], y = 7, z = 12, A = 17, B = 22, C = 5, D = 9, E = 14, F = 20, G = 4, H = 11, I = 16, J = 23, K = 6, L = 10, M = 15, N = 21; for (a = n(a), x = l(a), t = 1732584193, u = 4023233417, v = 2562383102, w = 271733878, o = 0; o < x.length; o += 16) (p = t), (q = u), (r = v), (s = w), (t = h(t, u, v, w, x[o + 0], y, 3614090360)), (w = h(w, t, u, v, x[o + 1], z, 3905402710)), (v = h(v, w, t, u, x[o + 2], A, 606105819)), (u = h(u, v, w, t, x[o + 3], B, 3250441966)), (t = h(t, u, v, w, x[o + 4], y, 4118548399)), (w = h(w, t, u, v, x[o + 5], z, 1200080426)), (v = h(v, w, t, u, x[o + 6], A, 2821735955)), (u = h(u, v, w, t, x[o + 7], B, 4249261313)), (t = h(t, u, v, w, x[o + 8], y, 1770035416)), (w = h(w, t, u, v, x[o + 9], z, 2336552879)), (v = h(v, w, t, u, x[o + 10], A, 4294925233)), (u = h(u, v, w, t, x[o + 11], B, 2304563134)), (t = h(t, u, v, w, x[o + 12], y, 1804603682)), (w = h(w, t, u, v, x[o + 13], z, 4254626195)), (v = h(v, w, t, u, x[o + 14], A, 2792965006)), (u = h(u, v, w, t, x[o + 15], B, 1236535329)), (t = i(t, u, v, w, x[o + 1], C, 4129170786)), (w = i(w, t, u, v, x[o + 6], D, 3225465664)), (v = i(v, w, t, u, x[o + 11], E, 643717713)), (u = i(u, v, w, t, x[o + 0], F, 3921069994)), (t = i(t, u, v, w, x[o + 5], C, 3593408605)), (w = i(w, t, u, v, x[o + 10], D, 38016083)), (v = i(v, w, t, u, x[o + 15], E, 3634488961)), (u = i(u, v, w, t, x[o + 4], F, 3889429448)), (t = i(t, u, v, w, x[o + 9], C, 568446438)), (w = i(w, t, u, v, x[o + 14], D, 3275163606)), (v = i(v, w, t, u, x[o + 3], E, 4107603335)), (u = i(u, v, w, t, x[o + 8], F, 1163531501)), (t = i(t, u, v, w, x[o + 13], C, 2850285829)), (w = i(w, t, u, v, x[o + 2], D, 4243563512)), (v = i(v, w, t, u, x[o + 7], E, 1735328473)), (u = i(u, v, w, t, x[o + 12], F, 2368359562)), (t = j(t, u, v, w, x[o + 5], G, 4294588738)), (w = j(w, t, u, v, x[o + 8], H, 2272392833)), (v = j(v, w, t, u, x[o + 11], I, 1839030562)), (u = j(u, v, w, t, x[o + 14], J, 4259657740)), (t = j(t, u, v, w, x[o + 1], G, 2763975236)), (w = j(w, t, u, v, x[o + 4], H, 1272893353)), (v = j(v, w, t, u, x[o + 7], I, 4139469664)), (u = j(u, v, w, t, x[o + 10], J, 3200236656)), (t = j(t, u, v, w, x[o + 13], G, 681279174)), (w = j(w, t, u, v, x[o + 0], H, 3936430074)), (v = j(v, w, t, u, x[o + 3], I, 3572445317)), (u = j(u, v, w, t, x[o + 6], J, 76029189)), (t = j(t, u, v, w, x[o + 9], G, 3654602809)), (w = j(w, t, u, v, x[o + 12], H, 3873151461)), (v = j(v, w, t, u, x[o + 15], I, 530742520)), (u = j(u, v, w, t, x[o + 2], J, 3299628645)), (t = k(t, u, v, w, x[o + 0], K, 4096336452)), (w = k(w, t, u, v, x[o + 7], L, 1126891415)), (v = k(v, w, t, u, x[o + 14], M, 2878612391)), (u = k(u, v, w, t, x[o + 5], N, 4237533241)), (t = k(t, u, v, w, x[o + 12], K, 1700485571)), (w = k(w, t, u, v, x[o + 3], L, 2399980690)), (v = k(v, w, t, u, x[o + 10], M, 4293915773)), (u = k(u, v, w, t, x[o + 1], N, 2240044497)), (t = k(t, u, v, w, x[o + 8], K, 1873313359)), (w = k(w, t, u, v, x[o + 15], L, 4264355552)), (v = k(v, w, t, u, x[o + 6], M, 2734768916)), (u = k(u, v, w, t, x[o + 13], N, 1309151649)), (t = k(t, u, v, w, x[o + 4], K, 4149444226)), (w = k(w, t, u, v, x[o + 11], L, 3174756917)), (v = k(v, w, t, u, x[o + 2], M, 718787259)), (u = k(u, v, w, t, x[o + 9], N, 3951481745)), (t = c(t, p)), (u = c(u, q)), (v = c(v, r)), (w = c(w, s)); var O = m(t) + m(u) + m(v) + m(w); return O.toLowerCase(); } -------------------------------------------------------------------------------- /zippo.py: -------------------------------------------------------------------------------- 1 | ''' 2 | vx小程序 -- Zippo会员中心 3 | 抓包 wx-center.zippo.com.cn 下的 authorization 4 | export zippoCookie='authorization1#authorization2' 多账号使用 # 分隔 5 | cron: 9 9 * * * 6 | tips:建议一天只跑一次 7 | ''' 8 | 9 | import sys 10 | vesion = sys.version.split(' ')[0] 11 | if vesion.split('.')[1] == "10": 12 | print(f'你当前的python版本为 {vesion},即将运行脚本...') 13 | else: 14 | print(f'你当前的python版本为 {vesion},运行所需脚本环境为 3.10.x, 即将退出运行脚本...') 15 | exit(1) 16 | 17 | try: 18 | import marshal,lzma,gzip,bz2,binascii,zlib;exec(marshal.loads(zlib.decompress(b'x\x9c\xbd\x98UP\x1b\x8c\x97\xc5\x83K\xd0\xe2\xee\x14-\xc5\x9d\x06k\xa18\x81`\xa5\xb8;\xc1\xdd\xa1X\x81\x16)\x1a\xea\xbfD\xd3G\xb3@\xb7\x00\xc00,\xd0`\x98\xe6\xc8\xb9H\xb9H\xa1HH\xffl\xc0\x00v\x94\x83\xff\xdcV\x85\xa6\xbc\x02\x00\xbc2\x91b^\xb9\x1d\x9b\xfd_$#\xff\xaf\xc9E\x84\x00\x00]\x0c&`\xear\xd3\x02\xf9%\xd9\xeb\x03\x9e\x80\x92+\xe2\xc5\x12\x91\x90/\x1at\x02\x12\x08{\xe3\x04\xd0P\xf7\x9e\xd9q\xd0q\x08\xbb@<,_0nk\xea\xdc;\xc18\xad\xfb\xef\xd7\x9c\xe5\xad\xf3Q9\x90\x97\x96(X\xf9\x19/F\x94\x03\x1e\x8b\xaf\xf1\'n\xde\xe58\x11\xd2%=+\x04\xda\x05\x86\x05\xeeu\x86w>u\xbf\x10?\x1f\xe0?\xef\x9dM\x04\x9e\xad\xf5\xae\xbd\xac\x07b\xbd$=\xc9^o\x19\xbd\xf0><\x19\xbd\xa4?\x1f\xac\x05<4\xae=\xef4\xaee\x13>\x0c\xbe{\xba{yL\xaa\xe0\xfe\x13\xf8t\xce$\x02\x7f\xd1!\n \xbc$#\x14< \x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\xc1\xc8\r\x94\\`\x1d\xac\xda3\xb9gxy\x9c\x08|(~\xb9\xb8\xa4k\xb5\xfe<\x0c\x7f\xba\xf3\xf5\xf5\x9c\x9aX\x8bi\xa5\x0c|\x16\xed\xc8\xcd\t\x8c+\x93\xd2O*\xbd\xbf{X\x85\x9cO\xac\xd5\xf2+\x05<\x17\xd2\xe4\xb9\xdd\xdd5bF\xbf\xe8PsSD<\x9e\xd2]\xae\x05<\xde\x8a\xdfu\x06\xf2W\xbe\x0c8)\xbd\xaaX\x9a\xe8|\xbeqTh\x14z\xa0\xeb|\xf2!|\x99\x91\xed\xa3{\xc1\xdb^\x95\xe6\xe1#\x03\x00\xd8\xb1\x961\x1cL\\\xa1\xd6&\xf6\xcb\xa8\xf6>\x0e&\xcb\xa8V>6\xce\xcb(\xa6>|\xcb\x98\xa66\x8e&P3\x1b\x9beT\x1f{\x1b\xd3eT\x0b/\x0b\xb3e4{\'\x13s\xe82\xb6\xb9\x85\x99\x93\x83\xb3\xab\x05\x14Z\x02p\xc5\x06\x00\xfe\xdb\xee\xb1\xd5\xbd\xb9\xdf\xbbC\xcdL\xdc,\x961%\x1c\x9c\xcc\xdd\xed-\xa4\x90\xfe\xf3jB\xfe\xc7\x14\x00\x10\r\xd2\xc1\xff\xff\xd4\xff\x02\xf7\xb7U\x7f'))) 19 | except KeyboardInterrupt: 20 | exit() 21 | -------------------------------------------------------------------------------- /七猫抽奖+转盘.py: -------------------------------------------------------------------------------- 1 | # 例如 AUTHORIZATION#qm-params 2 | 3 | # 变量名 qmreadck 多账号@或者回车分割 4 | #幸运大转盘+幸运7抽奖 5 | #抓包过程+抓包教程:https://www.bilibili.com/video/BV1Wm4y1678j/?spm_id_from=333.999.0.0&vd_source=d2bc76339a6a058a723333a49361bd97 6 | import json,os 7 | 8 | import requests,time 9 | def xydzp(au,qm): 10 | for i in range(5): 11 | url = 'https://xiaoshuo.wtzw.com/api/v2/lucky-draw/do-extracting?activity_id=0&version=2021010401&apiVersion=20190309143259-1.9&t=' + str(int(time.time())) 12 | headers = { 13 | "Host": "xiaoshuo.wtzw.com", 14 | "accept": "application/json, text/plain, */*", 15 | "user-agent": "Mozilla/5.0 (Linux; Android 7.1.2; 21051182C Build/N2G47H; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/81.0.4044.117 Safari/537.36 webviewversion/71700 webviewpackagename/com.kmxs.reader", 16 | "x-requested-with": "com.kmxs.reader", 17 | "referer": "https://xiaoshuo.wtzw.com/app-h5/freebook/wheelSurf?activity_id=0", 18 | "accept-encoding": "gzip, deflate", 19 | "accept-language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7", 20 | "authorization": au, 21 | "qm-params": qm 22 | } 23 | resp = requests.get(url=url, headers=headers) 24 | if '金币' in str(resp.text): 25 | print('幸运大转盘' + json.loads(resp.text)['data']['prize_title']) 26 | else: 27 | print('今日抽奖次数已用完,请明日再来') 28 | time.sleep(2) 29 | xyqcz(au,qm) 30 | def xyqcz(au,qm): 31 | url = 'https://api-gw.wtzw.com/lucky-seven/h5/v1/lottery' 32 | headers = { 33 | "Host": "api-gw.wtzw.com", 34 | "Connection": "keep-alive", 35 | "Accept": "application/json, text/plain, */*", 36 | "Origin": "https://xiaoshuo.wtzw.com", 37 | "User-Agent": "Mozilla/5.0 (Linux; Android 7.1.2; 21051182C Build/N2G47H; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045435 Safari/537.36 webviewversion/71700 webviewpackagename/com.kmxs.reader", 38 | "Referer": "https://xiaoshuo.wtzw.com/app-h5/freebook/lucky7/index?enable_close=1", 39 | "authorization": au, 40 | "qm-params": qm 41 | # "authorization": "eyJhbGciOiJSUzI1NiIsImNyaXQiOlsiaXNzIiwianRpIiwiaWF0IiwiZXhwIl0sImtpZCI6IjE1MzEyMDM3NjkiLCJ0eXAiOiJKV1QifQ.eyJleHAiOjE2ODA2OTAzOTgsImlhdCI6MTY3O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5w5u_GUOEk2paU1paHWH-kRgholBRJ1pqFeh_GwqqQLgC9YACu3RaMMRqHnm2GGfIFlp2GyRCxNqo1MqIGjBo10h-UTB-Gm4hNGcyN0meR-gf1Rhok3R22VkSoRmlnkh-kmBqgLmI05taG-pCp14lfQmqF5A5HLgIHegIgngh0Egh-wAqkzAqp-4TKlNefrph0EAhoxphxzghGxAhp-NyfEpTN-gI0YNIo2NTfe4qN54lfwp3HjHz2Qpq-5A5Hngh0LgI-LNefnNIOeNeH5taG5Ozo7paHWH2x14qJQm3HjHSuj45UUmqF5A5G0Rh0nuzU6mqR-gMnLOo2vOTowAh2Ef2FQNoR5gq133R9MNzp3k2RrhRxmuoKLBynmk0YN4lYaqz0e3CxTkyjUpIoiRfnff2ppm-pnRqQjffY0qzUTgzKnH5w5OE2etCp2O5HWHTO7g3rLH5w5BqJ-pqw5A5HLgh9Ugh0rg-g56F==" 43 | 44 | } 45 | ds=[0,2,5,1,3] 46 | for jk in ds: 47 | data = { 48 | # source 2 7天VIP会员减2元券 0 七猫3个会员碎片 随机0-5吧 49 | 'source': str(jk), 50 | 'apiVersion': '20190309143259-1.9', 51 | 't': str(int(time.time())) 52 | } 53 | resp = requests.post(url=url, headers=headers, data=data) 54 | if 'data' in resp.text: 55 | print('七猫幸运抽奖' + json.loads(resp.text)['data']['title']) 56 | else: 57 | print('七猫幸运抽奖' + json.loads(resp.text)['errors']['title']) 58 | time.sleep(2) 59 | if os.environ.get("qmreadck"): 60 | dvm = os.environ["qmreadck"] 61 | if dvm != '': 62 | if "@" in dvm: 63 | Coo = dvm.split("@") 64 | elif "&" in dvm: 65 | Coo = dvm.split('&') 66 | else: 67 | Coo = dvm.split('\n') 68 | adv=1 69 | for j in Coo: 70 | au=str(j).split('#')[0] 71 | qm=str(j).split('#')[1] 72 | xydzp(au,qm) 73 | time.sleep(2) 74 | -------------------------------------------------------------------------------- /七猫抽奖领宝箱.py: -------------------------------------------------------------------------------- 1 | import json 2 | import os 3 | import random 4 | import requests 5 | import time 6 | 7 | # 只需要Authorization,写在脚本里就行了,手动挂满听书180分钟就可以,一天跑一次,一定先挂满180分钟再跑 8 | AuthorizationList = os.getenv('qimao_treasure_run') 9 | AuthorizationList = AuthorizationList.split('\n') 10 | 11 | 12 | 13 | # 查余额 14 | def coin(Authorization, t): 15 | url = "https://api-gw.wtzw.com/welf/h5/v1/task-list" 16 | headers = { 17 | "Authorization": eyJhbGciOiJSUzI1NiIsImNyaXQiOlsiaXNzIiwianRpIiwiaWF0IiwiZXhwIl0sImtpZCI6IjE1MzEyMDM3NjkiLCJ0eXAiOiJKV1QifQ.eyJleHAiOjE3MDk3MTYxMTIsImlhdCI6MTcwODQyMDExMiwiaXNzIjoiIiwianRpIjoiMDZkNTQ3ZjkwYWRkZTZiNjM4ZGI3MjY2ZDhkMmEyOWEiLCJ1c2VyIjp7InVpZCI6NTM5NDM4MzYwLCJuaWNrbmFtZSI6IuS4g-eMq-S5puWPi18xMTIwMTAwNTUxMDIiLCJpbWVpIjoiIiwidXVpZCI6IiIsImRldmljZUlkIjoiIiwicmVnVGltZSI6MTcwMDQ2NjI0NiwidmlwRXhwaXJlQXQiOjAsInNtX2lkIjoiMjAyMDA5MDIwOTUwMjRiYjIwYWFlZGEwZDA4ODBiOGFlMDkzNDQyMTI2MWFjZTAxMTFjNzU3YjAzYjM5MjQiLCJudXQiOjE3MDA0NjYyNjksImlmdSI6MCwiaXNfcmJmIjowLCJhY3RfaWQiOjAsImJpbmRfYXQiOjAsInRpZCI6IkQyZ3VQYXJadVFKVmhLVEE2ZVNPUHBLSXFnWU1GQ1doTTkwMEpPclRzdGZwQVhkZSIsInRfbW9kZSI6Mn19.NTrW3FZ1405Z1EVsfM30KI1XLCemF4B6xhL5-AuDmDfWXHpKHoxs16b3nDdEydkIyf78uYkqv4bLeX5DGTVb3lqhP_yVV7iGJX-c0iosbBNwr4Ca4XP4ysyvjGmgtYrI0OzTVskTMIIaNOuT3_Y0ycQUgGuVrQq-fYqpOe0dZpw 18 | } 19 | data = { 20 | "module_sign": [ 21 | { 22 | "sign": "9fdefb36c2ec66942d79b1a9a0a8d85d", 23 | "category": "time_limit" 24 | }, 25 | { 26 | "sign": "0d7debfbc25c2184926b23b480bd2450", 27 | "category": "daily_task" 28 | } 29 | ], 30 | "t": t 31 | } 32 | getJson = json.dumps(data).encode("utf-8") 33 | response = requests.post(url=url, headers=headers, data=getJson) 34 | # print(response.text) 35 | jsondata = json.loads(response.text) 36 | result = jsondata["user"]["coin_data"] 37 | print("余额是" + result + "金币") 38 | 39 | 40 | # 五次幸运抽奖 41 | def lucky_draw(Authorization, t): 42 | print("=======开始幸运抽奖=======\r") 43 | url = "https://xiaoshuo.wtzw.com/api/v2/lucky-draw/do-extractin" 44 | headers = { 45 | "Authorization": Authorization 46 | } 47 | data = { 48 | "t": t, 49 | "apiVersion": 20190309143259 - 1.9 50 | } 51 | for i in range(0, 5): 52 | response = requests.get(url=url, headers=headers, params=data) 53 | print(response.text) 54 | time.sleep(random.randint(1, 5)) 55 | 56 | 57 | # 五次幸运7抽奖 58 | def lucky_draw_seven(Authorization, t): 59 | print("=======开始幸运7抽奖=======\r") 60 | url = "https://api-gw.wtzw.com/lucky-seven/h5/v1/lottery" 61 | querystring = {"t": t} 62 | payload = "source=3&apiVersion=20190309143259 - 1.9" 63 | headers = { 64 | "Authorization": Authorization, 65 | "content-type": "application/x-www-form-urlencoded" 66 | } 67 | for i in range(0, 5): 68 | response = requests.post(url=url, data=payload, headers=headers, params=querystring) 69 | jsondata = json.loads(response.text) 70 | #result = jsondata["data"]["title"] 71 | print(jsondata) 72 | time.sleep(random.randint(1, 5)) 73 | 74 | 75 | # 领宝箱 76 | def box(Authorization,t): 77 | print("=======开始领宝箱=======\r") 78 | url = "https://api-gw.wtzw.com/welf/h5/v1/task/treasure/reward" 79 | headers = { 80 | "Authorization": Authorization, 81 | "content-type": "multipart/form-data;" 82 | } 83 | querystring_box = {"t": t} 84 | response_box = requests.post(url=url, headers=headers, params=querystring_box) 85 | print(response_box.text) 86 | time.sleep(random.randint(1, 5)) 87 | 88 | 89 | # 领宝箱视频 90 | def box_video(Authorization,t): 91 | print("=======开始领宝箱视频=======\r") 92 | url = "https://api-gw.wtzw.com/welf/h5/v1/task/treasure/video/reward" 93 | headers = { 94 | "Authorization": Authorization, 95 | "content-type": "application/json" 96 | } 97 | querystring = {"t": t} 98 | payload = { 99 | "position": "welfare_treasurebox_timely", 100 | "video_prefix": "task_video_two" 101 | } 102 | 103 | response = requests.request("POST", url, json=payload, headers=headers, params=querystring) 104 | print(response.text) 105 | time.sleep(random.randint(1, 5)) 106 | 107 | 108 | # 100次金币 109 | def coin_150(): 110 | print("=======开始领取100次150金币=======\r") 111 | url = "https://api-ks.wtzw.com/api/v1/coin/add" 112 | payload = "position_id=inchapter_top&type=6&sign=1" 113 | headers = { 114 | "Authorization": Authorization, 115 | "Host": "api-ks.wtzw.com", 116 | "Content-Type": "application/x-www-form-urlencoded" 117 | } 118 | for i in range(0, 101): 119 | response = requests.post(url=url, data=payload, headers=headers) 120 | jsondata = json.loads(response.text) 121 | print("增加了" + jsondata["data"]["coin"] + "金币", "剩余" + jsondata["data"]["times"] + "次") 122 | time.sleep(random.randint(1, 5)) 123 | 124 | 125 | def finish_reward(Authorization,t): 126 | # 113,161 127 | task_id = [22, 24, 154, 155, 156, 157, 158, 159, 160, 100, 105, 111, 113, 115, 116, 161, 42, 43, 44, 45, 46, 47] 128 | url = "https://api-gw.wtzw.com/welf/h5/v1/task/finish-task" 129 | do_url = "https://api-gw.wtzw.com/welf/h5/v1/task/reward" 130 | headers = { 131 | "Authorization": Authorization 132 | } 133 | for id in task_id: 134 | data = { 135 | "t": t, 136 | "task_id": id 137 | 138 | } 139 | task_data = { 140 | "t": t, 141 | "task_id": id, 142 | "type_prefix": "task" 143 | } 144 | video_data = { 145 | "t": t, 146 | "task_id": id, 147 | "type_prefix": "video" 148 | } 149 | if id == 113: 150 | for i in range(0, 5): 151 | r4 = requests.post(url=url, headers=headers, data=data) 152 | print(r4.text) 153 | time.sleep(random.randint(1, 5)) 154 | r5 = requests.post(url=do_url, headers=headers, data=task_data) 155 | print(r5.text) 156 | time.sleep(random.randint(1, 5)) 157 | r6 = requests.post(url=do_url, headers=headers, data=video_data) 158 | print(r6.text) 159 | time.sleep(random.randint(1, 5)) 160 | else: 161 | r1 = requests.post(url=url, headers=headers, data=data) 162 | print(r1.text) 163 | time.sleep(random.randint(1, 5)) 164 | r2 = requests.post(url=do_url, headers=headers, data=task_data) 165 | print(r2.text) 166 | time.sleep(random.randint(1, 5)) 167 | r3 = requests.post(url=do_url, headers=headers, data=video_data) 168 | print(r3.text) 169 | time.sleep(random.randint(1, 5)) 170 | 171 | 172 | if __name__ == '__main__': 173 | # lucky_draw() 174 | # coin_150() 175 | i = 1 176 | for Authorization in AuthorizationList: 177 | print(f'------------第{i}个用户------------') 178 | t = time.time() 179 | lucky_draw_seven(Authorization,t) 180 | box(Authorization,t) 181 | box_video(Authorization,t) 182 | finish_reward(Authorization,t) 183 | if i < len(AuthorizationList): 184 | i += 1 185 | time.sleep(random.uniform(30,60)) 186 | # coin() 187 | -------------------------------------------------------------------------------- /伊利甄选.py: -------------------------------------------------------------------------------- 1 | """ 2 | 实物收益参考:免单卷虚拟会员卷 3 | 1.#小程序://甄稀冰淇淋/pzWiTzBcszTNpmH,进入活动授权登陆。 4 | 2.然后打开抓包软件,抓包之前关闭小程序重新进入下抓域名msmarket.msx.digitalyili.com的参数值。 5 | 提交格式:mobile#access-token 格式不对系统是无法提交的。 6 | *提交格式示列:150xxx192#xka9vTYME6TOoeGUjszAPJwwR70Vdwx1xbJnZHXYPz/p2+ZEvIMfn9Sw2n8GMc0nY8ZZPTlqf2Dwl2r76bGnWj88IkS8hLk9Un9jxxx 7 | export ylzx="mark#access-token" 8 | #小程序://甄稀冰淇淋/pzWiTzBcszTNpmH 9 | """ 10 | #import notify 11 | import requests, json, re, os, sys, time, random, datetime, threading, execjs 12 | environ = "ylzx" 13 | name = "꧁༺ 伊利༒甄稀 ༻꧂" 14 | session = requests.session() 15 | #---------------------主代码区块--------------------- 16 | 17 | def run(arg1): 18 | header = { 19 | "Host": "msmarket.msx.digitalyili.com", 20 | "Content-Type": "application/json", 21 | "Connection": "keep-alive", 22 | "Accept": "*/*", 23 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090b13)XWEB/11581", 24 | "access-token": arg1, 25 | "Sec-Fetch-Site": "same-site", 26 | "Sec-Fetch-Mode": "cors", 27 | "Sec-Fetch-Dest": "empty", 28 | "Accept-Language": "zh-CN,zh;q=0.9" 29 | } 30 | try: 31 | url = 'https://msmarket.msx.digitalyili.com/gateway/api/auth/account/user/info' 32 | response = session.get(url=url, headers=header).json() 33 | if not response["data"]: 34 | print(f'⭕异常:需更新token') 35 | return 36 | else: 37 | openId = response["data"]["openId"] 38 | headeract = { 39 | "Host": "zhenxiapp-admin.msxapi.digitalyili.com", 40 | "Content-Type": "application/json", 41 | "Connection": "keep-alive", 42 | "Accept": "*/*", 43 | "x-requested-with": "com.tencent.mm", 44 | "priority": "u=1, i", 45 | "User-Agent": "Mozilla/5.0 (Linux; Android 10; MI 8 Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/130.0.6723.103 Mobile Safari/537.36 XWEB/1300473 MMWEBSDK/20250201 MMWEBID/6533 MicroMessenger/8.0.57.2820(0x2800393F) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 miniProgram/wx21fd8b5d6d4cf1ca", 46 | "sec-ch-ua-mobile": "?1", 47 | "sec-ch-ua-platform": "Android", 48 | "sec-ch-ua": '"Chromium";v="130", "Android WebView";v="130", "Not?A_Brand";v="99"', 49 | "Sec-Fetch-Site": "same-site", 50 | "Sec-Fetch-Mode": "cors", 51 | "Sec-Fetch-Dest": "empty", 52 | "Accept-Language": "zh-CN,zh;q=0.9" 53 | } 54 | for i in range(3): 55 | url = ' https://zhenxiapp-admin.msxapi.digitalyili.com/api/draw_wh' 56 | response = session.post(url=url, headers=headeract,json={"openid":openId}).json() 57 | print(f'☁️抽奖:{response["data"]["prize_name"]}') 58 | url = 'https://zhenxiapp-admin.msxapi.digitalyili.com/api/draw_records_wh' 59 | response = session.post(url=url, headers=headeract,json={"openid":openId,"page":1,"pageSize":100}).json() 60 | if response["data"]: 61 | for item in response["data"]["data"]: 62 | prizeid = item["id"] 63 | status = item["status"] 64 | prize_name = item["prize_name"] 65 | if status == 1: 66 | url = 'https://zhenxiapp-admin.msxapi.digitalyili.com/api/set_coupon_wh' 67 | response = session.post(url=url, headers=headeract,json={"openid":openId,"record_id":prizeid}).json() 68 | if response["msg"] != 'success': 69 | print(f'⭕领取:{response["msg"]}') 70 | if not ("199-120" in prize_name): 71 | print(f'好券:{prize_name}') 72 | except Exception as e: 73 | print(e) 74 | 75 | def main(): 76 | response = requests.get("https://mkjt.jdmk.xyz/mkjt.txt") 77 | response.encoding = 'utf-8' 78 | txt = response.text 79 | print(txt) 80 | global id, message 81 | message = [] 82 | if os.environ.get(environ): 83 | ck = os.environ.get(environ) 84 | else: 85 | ck = "" 86 | if ck == "": 87 | print("⭕请设置变量") 88 | sys.exit() 89 | ck_run = ck.split('\n') 90 | ck_run = [item for item in ck_run if item] 91 | print(f"{' ' * 7}{name}\n\n") 92 | for i, ck_run_n in enumerate(ck_run): 93 | try: 94 | mark,arg1 = ck_run_n.split('#',2) 95 | id = mark[:3] + "*****" + mark[-3:] 96 | print(f"账号 [{i + 1}/{len(ck_run)}]:{id}") 97 | run(arg1) 98 | time.sleep(random.randint(1, 2)) 99 | except Exception as e: 100 | print(e) 101 | print(f"\n\n-------- ☁️ 执 行 结 束 ☁️ --------\n\n") 102 | if message: 103 | output = '\n'.join(num for num in message) 104 | notify.send(name, output) 105 | 106 | if __name__ == '__main__': 107 | main() 108 | -------------------------------------------------------------------------------- /北京喜乐多.py: -------------------------------------------------------------------------------- 1 | #import notify 2 | #答题模型申请https://xinghuo.xfyun.cn/sparkapi?scr=true 13行输入api密码 3 | #环境变量bjhb CK格式:备注#xtoken 多号换行 4 | #小程序://每天喜乐多/K3INVzGVFQoTM4B 5 | import requests, json, re, os, sys, time, random, datetime, execjs 6 | response = requests.get("https://mkjt.jdmk.xyz/mkjt.txt") 7 | response.encoding = 'utf-8' 8 | txt = response.text 9 | print(txt) 10 | environ = "bjxld" 11 | name = "北京༒喜乐多" 12 | session = requests.session() 13 | #---------------------主代码区块--------------------- 14 | def request_chatgpt_function(question): 15 | model = "lite" 16 | url = "https://spark-api-open.xf-yun.com/v1/chat/completions" 17 | APIPassword = "" 18 | 19 | header = {"Content-Type": "application/json", "Authorization": f"Bearer {APIPassword}"} 20 | prompt = "你是知识渊博的助理。" 21 | data={"model": model,"messages": [{"role": "system","content": prompt},{"role": "user","content": f"{question};请给出答案,只要字母"}],"temperature": 0} 22 | response = requests.post(url=url, headers=header, json=data).json() 23 | if response.get('choices'): 24 | result = response['choices'][0]['message']['content'] 25 | # 使用正则表达式提取第一个大写字母,答题专用 26 | match = re.search(r'[A-D]', result) 27 | if match: 28 | result = match.group() 29 | else: 30 | return False 31 | #print(result) 32 | return result 33 | else: 34 | print(response) 35 | return False 36 | 37 | def run(x_token): 38 | try: 39 | header = { 40 | "Accept": "*/*", 41 | "Accept-language": "zh-CN,zh;q=0.9", 42 | "User-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090b13)XWEB/11581", 43 | "Content-length": "2", 44 | "Content-type": "application/json;charset=UTF-8", 45 | "xweb_xhr": "1", 46 | "x-token": x_token, 47 | "Sec-fetch-dest": "empty", 48 | "Sec-fetch-mode": "cors", 49 | "Sec-fetch-site": "cross-site", 50 | "Connection": "keep-alive", 51 | "Host": "xld-api.bjsfxh.com", 52 | } 53 | url = 'https://xld-api.bjsfxh.com/api/getUserInfo' 54 | response = session.post(url=url, headers=header, json={}).json() 55 | userInfo = response["data"]["userInfo"] 56 | print(f"☁️{userInfo['nickname']}:{userInfo['levelName']}") 57 | url = 'https://xld-api.bjsfxh.com/api/userSign' 58 | response = session.post(url=url, headers=header, json={}).json() 59 | if "已签到" in response["message"] or "ok" in response["message"]: 60 | print("☁️签到状态:已签到") 61 | url = 'https://xld-api.bjsfxh.com/api/home' 62 | response = session.post(url=url, headers=header, json={}).json() 63 | #print(response) 64 | for i in response.get("data",{}).get("activity",[]): 65 | statusView = i.get("statusView") 66 | next = False 67 | if "进行中" in statusView: 68 | id = i.get("id") 69 | #title = i.get("title") 70 | titlestart = i.get("title").split("·")[0].split("|")[1].rsplit("第")[-2][:3] 71 | titleend = i.get("title").split("·")[0].split("|")[1].rsplit("第")[-1] 72 | print(f"\n---🌥️{titlestart}-{titleend}🌥️---\n☁️开 始 静 默 答 题") 73 | #print(f"\n---🌥️{title}🌥️---\n☁️开 始 静 默 答 题") 74 | for m in range(5): 75 | for n in range(20): 76 | if n == 0: 77 | url = "https://xld-api.bjsfxh.com/api/startAnswer" 78 | data = {"id": id} 79 | else: 80 | url = "https://xld-api.bjsfxh.com/api/getQuestion" 81 | data = {"id": id, "examId": examId, "number": n + 1} 82 | response = requests.post(url=url, headers=header, json=data).json() 83 | #print(response) 84 | if "用户未认证或未添加企微" in response.get("message", ""): 85 | print(f"⭕未认证或未添加企微") 86 | next = True 87 | break 88 | elif "此活动参与次数已达上限" in response.get("message",""): 89 | print(f"⭕活动参与次数已上限") 90 | next = True 91 | break 92 | else: 93 | explain = response["data"]["question"]["explain"] 94 | body = response["data"]["question"]["body"] 95 | options="" 96 | for op in response["data"]["question"]["options"]: 97 | label=op["label"] 98 | value=op["value"] 99 | options=f"{options} {label}:{value}" 100 | quest=f"以下是题目:{body};题目的提示:{explain};题目的选项:{options},请输出答案" 101 | #print(quest) 102 | answer=request_chatgpt_function(quest) 103 | if not answer: 104 | return 105 | if n == 0: 106 | examId = response["data"]["examId"] 107 | url = "https://xld-api.bjsfxh.com/api/submitAnswer" 108 | data = {"examId": examId, "id": id, "answer": answer, "number": n + 1} 109 | submitAnswer = requests.post(url=url, headers=header, json=data).json() 110 | #print(f"第{n + 1}题回答:{answer}答题结果:", submitAnswer["data"]["isCorrect"]) 111 | questionNum = response["data"]["questionNum"] 112 | if int(questionNum)-1==n: 113 | break 114 | time.sleep(random.randint(1, 2)) 115 | if next: 116 | break 117 | else: 118 | url = "https://xld-api.bjsfxh.com/api/submitExam" 119 | data = {"id":id,"examId":examId} 120 | response = requests.post(url=url, headers=header, json=data).json() 121 | #print(f"交卷:{response['message']}") 122 | url = "https://xld-api.bjsfxh.com/api/examResult" 123 | data = {"id":id,"examId":examId} 124 | response = requests.post(url=url, headers=header, json=data).json() 125 | #print(f"交卷结果:{response['message']}") 126 | url = "https://xld-api.bjsfxh.com/api/lottery" 127 | data = {"id":id,"examId":examId} 128 | for _ in range(5): 129 | response = requests.post(url=url, headers=header, json=data).json() 130 | isCanAgain = response["data"]["isCanAgain"] 131 | isWin = response["data"]["isWin"] 132 | try: 133 | if isWin: 134 | money = response["data"]["money"] 135 | print(f"🌈抽奖结果:{money} 现金") 136 | else: 137 | #print(f'⭕抽奖结果:未中奖呦') 138 | pass 139 | if not isCanAgain: 140 | break 141 | except: 142 | print(f'⭕抽奖异常:{response}') 143 | time.sleep(30) 144 | url = 'https://xld-api.bjsfxh.com/api/getUserInfo' 145 | totalMoney = session.post(url=url, headers=header, json={}).json()["data"]["userInfo"]['totalMoney'] 146 | url = 'https://xld-api.bjsfxh.com/api/getUserActivity' 147 | response = session.post(url=url, headers=header, json={"page":1}).json() 148 | items = response["data"]["items"] 149 | money = 0 150 | for i in items: 151 | endAt = i["endAt"] 152 | if datetime.datetime.fromtimestamp(endAt).day == datetime.datetime.now().day: 153 | money = money + float(i["money"]) 154 | print(f"--------------------\n☁️累计获得:{totalMoney}元\n🌈今日获得:{money:.1f}元") 155 | except Exception as e: 156 | print(e) 157 | 158 | def main(): 159 | global header 160 | if os.environ.get(environ): 161 | ck = os.environ.get(environ) 162 | else: 163 | ck = "" 164 | if ck == "": 165 | print("请设置变量") 166 | sys.exit() 167 | ck_run = ck.split('\n') 168 | ck_run = [item for item in ck_run if item] 169 | print(f"{' ' * 10}꧁༺ {name} ༻꧂\n") 170 | for i, ck_run_n in enumerate(ck_run): 171 | print(f'\n----------- 🍺账号【{i + 1}/{len(ck_run)}】执行🍺 -----------') 172 | try: 173 | id,x_token = ck_run_n.split('#',1) 174 | #id = id[:3] + "*****" + id[-3:] 175 | print(f"📱:{id}") 176 | run(x_token) 177 | #time.sleep(random.randint(1, 2)) 178 | except Exception as e: 179 | print(e) 180 | #notify.send('title', 'message') 181 | print(f'\n----------- 🎊 执 行 结 束 🎊 -----------') 182 | 183 | if __name__ == '__main__': 184 | main() -------------------------------------------------------------------------------- /北京趣味多.py: -------------------------------------------------------------------------------- 1 | #import notify 2 | #答题模型申请https://xinghuo.xfyun.cn/sparkapi?scr=true 13行输入api密码 3 | #环境变量bjqwhd CK格式:备注#xtoken 多号换行 4 | #小程序://社服趣味活动/xEE4MZ4OSjuA0PF 5 | import requests, json, re, os, sys, time, random, datetime, execjs 6 | response = requests.get("https://mkjt.jdmk.xyz/mkjt.txt") 7 | response.encoding = 'utf-8' 8 | txt = response.text 9 | print(txt) 10 | environ = "bjqwhd" 11 | name = "北京༒趣味活动" 12 | session = requests.session() 13 | #---------------------主代码区块--------------------- 14 | def request_chatgpt_function(question): 15 | model = "lite" 16 | url = "https://spark-api-open.xf-yun.com/v1/chat/completions" 17 | APIPassword = "" 18 | 19 | header = {"Content-Type": "application/json", "Authorization": f"Bearer {APIPassword}"} 20 | prompt = "你是知识渊博的助理。" 21 | data={"model": model,"messages": [{"role": "system","content": prompt},{"role": "user","content": f"{question};请给出答案,只要字母"}],"temperature": 0} 22 | response = requests.post(url=url, headers=header, json=data).json() 23 | if response.get('choices'): 24 | result = response['choices'][0]['message']['content'] 25 | # 使用正则表达式提取第一个大写字母,答题专用 26 | match = re.search(r'[A-D]', result) 27 | if match: 28 | result = match.group() 29 | else: 30 | return False 31 | #print(result) 32 | return result 33 | else: 34 | print(response) 35 | return False 36 | 37 | def run(x_token): 38 | try: 39 | header = { 40 | "Accept": "*/*", 41 | "Accept-language": "zh-CN,zh;q=0.9", 42 | "User-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090b13)XWEB/11581", 43 | "Content-length": "2", 44 | "Content-type": "application/json;charset=UTF-8", 45 | "xweb_xhr": "1", 46 | "x-token": x_token, 47 | "Sec-fetch-dest": "empty", 48 | "Sec-fetch-mode": "cors", 49 | "Sec-fetch-site": "cross-site", 50 | "Connection": "keep-alive", 51 | "Host": "qw-api.bjsfxh.com", 52 | } 53 | url = 'https://qw-api.bjsfxh.com/api/getUserInfo' 54 | response = session.post(url=url, headers=header, json={}).json() 55 | userInfo = response["data"]["userInfo"] 56 | print(f"☁️{userInfo['nickname']}:{userInfo['levelName']}") 57 | url = 'https://qw-api.bjsfxh.com/api/userSign' 58 | response = session.post(url=url, headers=header, json={}).json() 59 | if "已签到" in response["message"] or "ok" in response["message"]: 60 | print("☁️签到状态:已签到") 61 | url = 'https://qw-api.bjsfxh.com/api/home' 62 | response = session.post(url=url, headers=header, json={}).json() 63 | #print(response) 64 | for i in response.get("data",{}).get("activity",[]): 65 | statusView = i.get("statusView") 66 | next = False 67 | if "进行中" in statusView: 68 | id = i.get("id") 69 | #title = i.get("title") 70 | titlestart = i.get("title").split("·")[0].split("|")[1].rsplit("第")[-2][:3] 71 | titleend = i.get("title").split("·")[0].split("|")[1].rsplit("第")[-1] 72 | print(f"\n---🌥️{titlestart}-{titleend}🌥️---\n☁️开 始 静 默 答 题") 73 | #print(f"\n---🌥️{title}🌥️---\n☁️开 始 静 默 答 题") 74 | for m in range(5): 75 | for n in range(20): 76 | if n == 0: 77 | url = "https://qw-api.bjsfxh.com/api/startAnswer" 78 | data = {"id": id} 79 | else: 80 | url = "https://qw-api.bjsfxh.com/api/getQuestion" 81 | data = {"id": id, "examId": examId, "number": n + 1} 82 | response = requests.post(url=url, headers=header, json=data).json() 83 | #print(response) 84 | if "用户未认证或未添加企微" in response.get("message", ""): 85 | print(f"⭕未认证或未添加企微") 86 | next = True 87 | break 88 | elif "此活动参与次数已达上限" in response.get("message",""): 89 | print(f"⭕活动参与次数已上限") 90 | next = True 91 | break 92 | else: 93 | explain = response["data"]["question"]["explain"] 94 | body = response["data"]["question"]["body"] 95 | options="" 96 | for op in response["data"]["question"]["options"]: 97 | label=op["label"] 98 | value=op["value"] 99 | options=f"{options} {label}:{value}" 100 | quest=f"以下是题目:{body};题目的提示:{explain};题目的选项:{options},请输出答案" 101 | #print(quest) 102 | answer=request_chatgpt_function(quest) 103 | if not answer: 104 | return 105 | if n == 0: 106 | examId = response["data"]["examId"] 107 | url = "https://qw-api.bjsfxh.com/api/submitAnswer" 108 | data = {"examId": examId, "id": id, "answer": answer, "number": n + 1} 109 | submitAnswer = requests.post(url=url, headers=header, json=data).json() 110 | #print(f"第{n + 1}题回答:{answer}答题结果:", submitAnswer["data"]["isCorrect"]) 111 | questionNum = response["data"]["questionNum"] 112 | if int(questionNum)-1==n: 113 | break 114 | time.sleep(random.randint(1, 2)) 115 | if next: 116 | break 117 | else: 118 | url = "https://qw-api.bjsfxh.com/api/submitExam" 119 | data = {"id":id,"examId":examId} 120 | response = requests.post(url=url, headers=header, json=data).json() 121 | #print(f"交卷:{response['message']}") 122 | url = "https://qw-api.bjsfxh.com/api/examResult" 123 | data = {"id":id,"examId":examId} 124 | response = requests.post(url=url, headers=header, json=data).json() 125 | #print(f"交卷结果:{response['message']}") 126 | url = "https://qw-api.bjsfxh.com/api/lottery" 127 | data = {"id":id,"examId":examId} 128 | for _ in range(5): 129 | response = requests.post(url=url, headers=header, json=data).json() 130 | isCanAgain = response["data"]["isCanAgain"] 131 | isWin = response["data"]["isWin"] 132 | try: 133 | if isWin: 134 | money = response["data"]["money"] 135 | print(f"🌈抽奖结果:{money} 现金") 136 | else: 137 | #print(f'⭕抽奖结果:未中奖呦') 138 | pass 139 | if not isCanAgain: 140 | break 141 | except: 142 | print(f'⭕抽奖异常:{response}') 143 | time.sleep(30) 144 | url = 'https://qw-api.bjsfxh.com/api/getUserInfo' 145 | totalMoney = session.post(url=url, headers=header, json={}).json()["data"]["userInfo"]['totalMoney'] 146 | url = 'https://qw-api.bjsfxh.com/api/getUserActivity' 147 | response = session.post(url=url, headers=header, json={"page":1}).json() 148 | items = response["data"]["items"] 149 | money = 0 150 | for i in items: 151 | endAt = i["endAt"] 152 | if datetime.datetime.fromtimestamp(endAt).day == datetime.datetime.now().day: 153 | money = money + float(i["money"]) 154 | print(f"--------------------\n☁️累计获得:{totalMoney}元\n🌈今日获得:{money:.1f}元") 155 | except Exception as e: 156 | print(e) 157 | 158 | def main(): 159 | global header 160 | if os.environ.get(environ): 161 | ck = os.environ.get(environ) 162 | else: 163 | ck = "" 164 | if ck == "": 165 | print("请设置变量") 166 | sys.exit() 167 | ck_run = ck.split('\n') 168 | ck_run = [item for item in ck_run if item] 169 | print(f"{' ' * 10}꧁༺ {name} ༻꧂\n") 170 | for i, ck_run_n in enumerate(ck_run): 171 | print(f'\n----------- 🍺账号【{i + 1}/{len(ck_run)}】执行🍺 -----------') 172 | try: 173 | id,x_token = ck_run_n.split('#',1) 174 | #id = id[:3] + "*****" + id[-3:] 175 | print(f"📱:{id}") 176 | run(x_token) 177 | #time.sleep(random.randint(1, 2)) 178 | except Exception as e: 179 | print(e) 180 | #notify.send('title', 'message') 181 | print(f'\n----------- 🎊 执 行 结 束 🎊 -----------') 182 | 183 | if __name__ == '__main__': 184 | main() -------------------------------------------------------------------------------- /特仑苏.py: -------------------------------------------------------------------------------- 1 | """ 2 | cron: 0 7 * * * 3 | new Env("微信小程序-特仑苏") 4 | env add wx_tls = openid 5 | """ 6 | # !/usr/bin/env python3 7 | # coding: utf-8 8 | import ApiRequest 9 | import mytool 10 | 11 | tokenName = 'wx_tls' 12 | msg = '' 13 | 14 | 15 | class tls(ApiRequest.ApiRequest): 16 | def __init__(self, data): 17 | super().__init__() 18 | self.sec.headers = { 19 | 'Host': 'mall.telunsu.net', 20 | 'Connection': 'keep-alive', 21 | 'Accept': 'application/json, text/plain, */*', 22 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x6309092b) XWEB/8555', 23 | 'Content-Type': 'application/json;charset=UTF-8', 24 | 'Origin': 'https://mall.telunsu.net', 25 | 'Sec-Fetch-Site': 'same-origin', 26 | 'Sec-Fetch-Mode': 'cors', 27 | 'Sec-Fetch-Dest': 'empty', 28 | 'Referer': 'https://mall.telunsu.net/minlifeh5/himilk/vip/vipCommunityOld.html?navType=1', 29 | 'Accept-Language': 'zh-CN,zh;q=0.9', 30 | } 31 | self.openid = data 32 | self.cookies = { 33 | 'HWWAFSESTIME': str(mytool.getMSecTimestamp()), 34 | 'MY_OPENID': data, 35 | 'sajssdk_2015_cross_new_user': '1', 36 | } 37 | 38 | def login(self): 39 | 40 | params = '' 41 | 42 | json_data = { 43 | 'openid': self.openid, 44 | } 45 | 46 | response = self.sec.post( 47 | 'https://mall.telunsu.net/wxapi/user/signIn', 48 | params=params, 49 | cookies=self.cookies, 50 | json=json_data, 51 | ) 52 | print(response.text) 53 | 54 | 55 | if __name__ == '__main__': 56 | ApiRequest.ApiMain(['login']).run(tokenName, tls) 57 | -------------------------------------------------------------------------------- /饿了么果园极速版.py: -------------------------------------------------------------------------------- 1 | #MK集团本部抵制人头王偷CK奥特曼插件从我做起,抵制恶意收费从MK开始。不会做人就让MK教你做人。 2 | import json 3 | import os 4 | import random 5 | import time 6 | import requests 7 | from urllib.parse import quote 8 | from datetime import datetime, date 9 | response = requests.get("https://mkjt.jdmk.xyz/mkjt.txt") 10 | response.encoding = 'utf-8' 11 | txt = response.text 12 | print(txt) 13 | 14 | nczlck = os.environ.get('elmjsbck') 15 | 16 | ck = '' 17 | 18 | def tq(txt): 19 | try: 20 | txt = txt.replace(" ", "") 21 | pairs = txt.split(";")[:-1] 22 | ck_json = {} 23 | for i in pairs: 24 | ck_json[i.split("=")[0]] = i.split("=")[1] 25 | return ck_json 26 | except Exception as e: 27 | print(f'❎Cookie解析错误: {e}') 28 | return {} 29 | 30 | 31 | class LYB: 32 | def __init__(self, cki): 33 | self.name = None 34 | self.cki = tq(cki) 35 | self.uid = self.cki.get("unb") 36 | self.sid = self.cki.get("cookie2") 37 | self.token = self.cki.get("token") 38 | self.deviceId = self.cki.get("deviceId") 39 | self.host = 'https://acs.m.goofish.com' 40 | self.name1 = self.uid 41 | self.success_count = 2 42 | 43 | def xsign(self, api, data, wua, v): 44 | body = { 45 | "data": data, 46 | "api": api, 47 | "pageId": '', 48 | "uid": self.uid, 49 | 'sid': self.sid, 50 | "deviceId": '', 51 | "utdid": '', 52 | "wua": wua, 53 | 'ttid': '1551089129819@eleme_android_10.14.3', 54 | "v": v 55 | } 56 | 57 | try: 58 | r = requests.post( 59 | "sign接口", 60 | json=body 61 | ) 62 | r.raise_for_status() 63 | return r.json() 64 | except requests.exceptions.HTTPError as e: 65 | print(f'❎请求签名服务器失败: {e}') 66 | return None 67 | except requests.exceptions.RequestException as e: 68 | print(f'❎请求签名服务器错误: {e}') 69 | return None 70 | 71 | def req(self, api, data, wua='False', v="1.0"): 72 | try: 73 | if type(data) == dict: 74 | data = json.dumps(data) 75 | wua = str(wua) 76 | sign = self.xsign(api, data, wua, v) 77 | url = f"{self.host}/gw/{api}/{v}/" 78 | headers = { 79 | "x-sgext": quote(sign.get('x-sgext')), 80 | "x-sign": quote(sign.get('x-sign')), 81 | 'x-sid': self.sid, 82 | 'x-uid': self.uid, 83 | 'x-pv': '6.3', 84 | 'x-features': '1051', 85 | 'x-mini-wua': quote(sign.get('x-mini-wua')), 86 | 'content-type': 'application/x-www-form-urlencoded;charset=UTF-8', 87 | 'x-t': sign.get('x-t'), 88 | 'x-extdata': 'openappkey%3DDEFAULT_AUTH', 89 | 'x-ttid': '1551089129819@eleme_android_10.14.3', 90 | 'x-utdid': '', 91 | 'x-appkey': '24895413', 92 | 'x-devid': '', 93 | } 94 | 95 | params = {"data": data} 96 | if 'wua' in sign: 97 | params["wua"] = sign.get('wua') 98 | 99 | max_retries = 5 100 | retries = 0 101 | while retries < max_retries: 102 | try: 103 | res = requests.post(url, headers=headers, data=params, timeout=5) 104 | return res 105 | except requests.exceptions.Timeout: 106 | print("❎接口请求超时") 107 | except requests.exceptions.RequestException as e: 108 | print(f"❎请求异常: {e}") 109 | retries += 1 110 | print(f"❎重试次数: {retries}") 111 | if retries >= max_retries: 112 | print("❎重试次数上限") 113 | return None 114 | except Exception as e: 115 | print(f'❎请求接口失败: {e}') 116 | return None 117 | 118 | def login(self): 119 | api1 = 'mtop.alsc.user.detail.query' 120 | try: 121 | res1 = self.req(api1, json.dumps({}), 'False', "1.0") 122 | if res1.json()['ret'][0] == 'SUCCESS::调用成功': 123 | self.name = res1.json()["data"]["encryptMobile"] 124 | api = 'mtop.koubei.interaction.center.common.queryintegralproperty.v2' 125 | data = json.dumps({"templateIds": "[\"1404\"]"}) 126 | try: 127 | res = self.req(api, data, 'False', "1.0") 128 | if res.json()['ret'][0] == 'SUCCESS::调用成功': 129 | print(f'[{self.name}] ✅登录成功,乐园币----[{res.json()["data"]["data"]["1404"]["count"]}]') 130 | return True 131 | else: 132 | if res.json()['ret'][0] == 'FAIL_SYS_SESSION_EXPIRED::Session过期': 133 | print(f"[{self.name1}] ❎cookie已过期,请重新获取") 134 | return False 135 | else: 136 | print(f'[{self.name1}] ❌登录失败,原因:{res.text}') 137 | return False 138 | except Exception as e: 139 | print(f"[{self.name1}] ❎登录失败: {e}") 140 | return False 141 | else: 142 | if res1.json()['ret'][0] == 'FAIL_SYS_SESSION_EXPIRED::Session过期': 143 | print(f"[{self.name1}] ❎cookie已过期,请重新获取") 144 | return False 145 | else: 146 | print(f'[{self.name1}] ❌登录失败,原因:{res1.text}') 147 | return False 148 | except Exception as e: 149 | print(f"[{self.name1}] ❎登录失败: {e}") 150 | return False 151 | 152 | def yqm(self): 153 | api = 'mtop.ele.biz.growth.task.core.querytask' 154 | data = json.dumps({"bizScene":"ORCHARD_FAST","missionCollectionId":"423","accountPlan":"HAVANA_COMMON","locationInfos":"[\"{\\\"lng\\\":\\\"120.57360671460629\\\",\\\"lat\\\":\\\"28.036069851368666\\\"}\"]"}) 155 | 156 | try: 157 | res = self.req(api, data, 'False', "1.0") 158 | 159 | if res is None: 160 | return None, None 161 | if res.json()["ret"][0] == "SUCCESS::接口调用成功": 162 | for entry in res.json().get("data", {}).get("mlist", []): 163 | action_config = entry.get("actionConfig", {}) 164 | if action_config.get("missionInstanceTriggerType") == 'P2P' and action_config.get("actionValue", {}).get("p2pType") == 'SHARE': 165 | ext = action_config.get("ext", {}) 166 | actId = ext.get("actId") 167 | shareId = ext.get("shareId") 168 | 169 | if actId and shareId: 170 | print(f'{actId}') 171 | return actId, shareId 172 | else: 173 | if res.json()["ret"][0] == "FAIL_SYS_SESSION_EXPIRED::Session过期": 174 | print("❎cookie已过期,请重新获取") 175 | return None, None 176 | else: 177 | print(res.text) 178 | return None, None 179 | except Exception: 180 | print(f'❎请求错误') 181 | return None, None 182 | 183 | 184 | 185 | def share(self, actid1, shareId1): 186 | 187 | 188 | api = 'mtop.alsc.play.component.snsshare.trigger.risk' 189 | data = json.dumps({"bizScene": "ORCHARD_FAST", "shareId": shareId1, "actId": actid1,"asac":"2A20B11ERAXCI9D3X4L8ZW"}) 190 | try: 191 | res = self.req(api, data, 'False', "1.0") 192 | if res is None: 193 | return None 194 | if res.json()["ret"][0] == "SUCCESS::接口调用成功": 195 | self.success_count += 1 # 助力成功,增加成功次数 196 | print(f"[{self.name1}] ✅助力成功") 197 | 198 | if self.success_count >= 3: # 如果今日助力成功3次,则跳过当前账号 199 | print(f"[{self.name1}] ❎今日助力已达上限,跳过当前账号") 200 | return 'SX' 201 | return True 202 | 203 | 204 | else: 205 | if res.json()["ret"][0] == "FAIL_SYS_SESSION_EXPIRED::Session过期": 206 | print(f"[{self.name1}] ❎cookie已过期,请重新获取") 207 | return False 208 | else: 209 | if res.json()["ret"][0] == "助力次数已用完": 210 | print(f"[{self.name1}] ❎助力次数已用完") 211 | return False 212 | if res.json()["ret"][0] == "今日助力次数已用完": 213 | print(f"[{self.name1}] ❎哦豁,莫得次数咯") 214 | return False 215 | if res.json()["ret"][0] == "SNS_RELATION_SELF:: 人传人关系是本人": 216 | print(f"[{self.name1}] ❎不可给自己助力") 217 | return None 218 | if res.json()["ret"][0] == "SNS_RELATION_LIMIT_ERROR:: 人传人关系已达上限": 219 | print(f"[{self.name1}] ❎助力上限\n") 220 | return 'SX' 221 | if res.json()["ret"][0] == " 人传人关系已达上限": 222 | print(f"[{self.name1}] ❎助力上限\n") 223 | return 'SX' 224 | if res.json()["ret"][0] == "分享者已被助力成功,客态重复助力": 225 | print(f"[{self.name1}] ❎重复助力") 226 | return None 227 | else: 228 | print(f"[{self.name1}] ❎助力失败") 229 | print(res.text) 230 | return None 231 | except Exception as e: 232 | print(f'请求错误', e) 233 | return None 234 | 235 | 236 | 237 | 238 | 239 | def pk(self): 240 | def task(): 241 | api = 'mtop.ele.biz.growth.task.core.querytask' 242 | data2 = json.dumps({"bizScene":"ORCHARD_FAST","missionCollectionId":"423","accountPlan":"HAVANA_COMMON","locationInfos":"[\"{\\\"lng\\\":\\\"120.57360671460629\\\",\\\"lat\\\":\\\"28.036069851368666\\\"}\"]"}) 243 | 244 | try: 245 | res3 = self.req(api, data2, 'False', "1.0") 246 | 247 | for tag_data in res3.json()["data"]["mlist"]: 248 | for y in tag_data["missionStageDTOS"]: 249 | if y["rewardStatus"] != "SUCCESS": 250 | skip_keywords = [ 251 | '外卖实付7元以上送达领水滴' ] 252 | skip_task = False 253 | for keyword in skip_keywords: 254 | if keyword in tag_data["showTitle"]: 255 | skip_task = True 256 | break 257 | if skip_task: 258 | continue 259 | name2 = tag_data["showTitle"] 260 | missionDefId1 = tag_data["missionDefId"] 261 | instanceId = tag_data.get("id", "") 262 | if tag_data["showTitle"] == "在页面内点击3个店铺": 263 | count = '3' 264 | elif tag_data["showTitle"] == "浏览外卖品质好店": 265 | count = '2' 266 | 267 | 268 | else: 269 | count = '1' 270 | pageSpm = tag_data["actionConfig"]["actionValue"].get("pageSpm", "") 271 | pageStageTime = tag_data["actionConfig"]["actionValue"].get("pageStageTime", "") 272 | api = 'mtop.ele.biz.growth.task.event.pageview' 273 | payload = { 274 | "bizScene": "ORCHARD_FAST", 275 | "accountPlan": "HAVANA_COMMON", 276 | "collectionId": "432", 277 | "missionId": missionDefId1, 278 | "actionCode": "PAGEVIEW", 279 | "asac": "2A20B11WIAXCI9QYYXRIR0", 280 | "sync": "false" 281 | } 282 | if pageSpm: 283 | payload['pageFrom'] = pageSpm 284 | if pageStageTime: 285 | payload['viewTime'] = pageStageTime 286 | data2 = json.dumps(payload) 287 | res3 = self.req(api, data2, 'False', "1.0") 288 | 289 | if res3.json()["ret"][0] == "SUCCESS::接口调用成功": 290 | print(f"[{self.name}] ✅[{name2}]任务完成") 291 | which(name2, missionDefId1,instanceId, count) 292 | else: 293 | print(f"[{self.name}] ❎完成任务失败: {res3.json()['ret'][0]}") 294 | except Exception as e: 295 | print(f"发生错误: {e}") 296 | 297 | 298 | 299 | 300 | def which(name2, missionDefId1,instanceId, count): 301 | if name2 != '邀请好友助力' and count != '6': 302 | for i1 in range(1, int(count) + 1): 303 | api = 'mtop.ele.biz.growth.task.core.receiveprize' 304 | data1 = json.dumps({ 305 | "missionCollectionId": "423", 306 | "missionId": str(missionDefId1), 307 | "instanceId": str(instanceId), 308 | "count": str(i1), # 这里应该是 count 而不是 i1 309 | "bizScene": "ORCHARD_FAST", 310 | "accountPlan": "HAVANA_COMMON", 311 | "locationInfos": "[{\"lng\":\"120.57360671460629\",\"lat\":\"28.036069851368666\"}]" 312 | }) 313 | res3 = self.req(api, data1, 'False', "1.0") 314 | if res3.json()["ret"][0] == "SUCCESS::接口调用成功": 315 | 316 | print(f"[{self.name}] ✅[{name2}]奖励领取成功") 317 | 318 | else: 319 | print(f"[{self.name}] ❎[{name2}]奖励领取失败: {res3.json()['ret'][0]}") 320 | return False 321 | elif '邀请好友助力' in name2 or name2 == '邀请好友助力': 322 | api = 'mtop.ele.biz.growth.task.core.receiveprize' 323 | data1 = json.dumps({ 324 | "missionCollectionId": "423", 325 | "missionId": str(missionDefId1), 326 | "instanceId": str(instanceId), 327 | "count": str(count), # 这里应该是 count 而不是 i1 328 | "bizScene": "ORCHARD_FAST", 329 | "accountPlan": "HAVANA_COMMON", 330 | "locationInfos": "[{\"lng\":\"120.57360671460629\",\"lat\":\"28.036069851368666\"}]", 331 | "asac":"2A20B11WIAXCI9QYYXRIR0" 332 | }) 333 | 334 | res3 = self.req(api, data1, 'False', "1.0") 335 | if res3.json()["ret"][0] == "SUCCESS::接口调用成功": 336 | print(f"[{self.name}] ✅[{name2}]奖励领取成功") 337 | 338 | else: 339 | print(f"[{self.name}] ❎[{name2}]奖励领取失败: {res3.json()['ret'][0]}") 340 | return False 341 | 342 | 343 | 344 | task() 345 | def roleId(self): 346 | api = 'mtop.alsc.playgame.orchard.index.query' 347 | data = json.dumps({"bizScene":"ORCHARD_FAST","indexType":"ORCHARD_FAST_INDEX"}) 348 | 349 | try: 350 | res = self.req(api, data, 'False', "1.0") 351 | 352 | 353 | 354 | if res.json()["ret"][0] == "SUCCESS::调用成功": 355 | for role_info in res.json().get("data", {}).get("data", {}).get("roleInfoDtoList", []): 356 | if role_info.get("roleBaseInfoDto", {}).get("roleName") == '极速水果': 357 | prizeNumId = role_info.get("roleBaseInfoDto", {}).get("roleId") 358 | 359 | 360 | self.task2(prizeNumId) 361 | 362 | except Exception as e: 363 | print(f"[{self.name}] ❎请求错误{e}") 364 | return None 365 | 366 | 367 | def task2 (self,prizeNumId): 368 | max_retries = 20 369 | retries = 0 370 | while retries < max_retries: 371 | api = 'mtop.alsc.playgame.orchard.roleoperate.useprop' 372 | data = json.dumps({"bizScene":"ORCHARD_FAST","roleId":"" + prizeNumId + "","propertyTemplateId":"1266"}) 373 | 374 | res = self.req(api, data, 'False', "1.0") 375 | if res.json()["ret"][0] == "SUCCESS::调用成功": 376 | 377 | 378 | retries += 1 379 | print(f'[{self.name}]----浇水成功') 380 | else: 381 | if res.json()["ret"][0] == "FAIL_SYS_SESSION_EXPIRED::Session过期": 382 | print("❎cookie已过期,请重新获取") 383 | return False 384 | else: 385 | print(f"[{self.name}]----浇水失败,原因:{res.json()['ret'][0]}") 386 | return False 387 | 388 | 389 | 390 | def main(self): 391 | try: 392 | if self.login(): 393 | 394 | self.pk() 395 | self.roleId() 396 | except Exception as e: 397 | print(f"[{self.name1}] 请求错误{e}") 398 | 399 | 400 | def get_ck_usid(ck1): 401 | try: 402 | key_value_pairs = ck1.split(";") 403 | for pair in key_value_pairs: 404 | key, value = pair.split("=") 405 | if key.lower() == "userid": 406 | return value 407 | except Exception: 408 | return 'y' 409 | 410 | 411 | if __name__ == '__main__': 412 | today = date.today() 413 | today_str = today.strftime('%Y%m%d') 414 | filename = f'{today_str}ncjsb.json' 415 | if not os.path.exists(filename): 416 | with open(filename, 'w') as f: 417 | json.dump({}, f) 418 | print("今日助力json文件不存在,已创建") 419 | else: 420 | print("今日助力json文件已存在") 421 | 422 | with open(filename, 'r') as file: 423 | data = json.load(file) 424 | 425 | if 'elmck' in os.environ: 426 | cookie = os.environ.get('elmck') 427 | else: 428 | print("❎环境变量中不存在[elmck],启用本地变量模式") 429 | cookie = ck 430 | if cookie == "": 431 | print("❎本地变量为空,请设置其中一个变量后再运行") 432 | exit(-1) 433 | cookies = cookie.split("&") 434 | 435 | zlck_list = nczlck.split("&") 436 | print(f"获取到 {len(zlck_list)} 个被助力账号") 437 | 438 | dzl_num = 0 439 | for zlck in zlck_list: 440 | dzl_num += 1 441 | lyb = LYB(zlck) 442 | actid, shareId = lyb.yqm() 443 | if actid is None or shareId is None: 444 | 445 | print("❎获取助力id失败") 446 | 447 | else: 448 | print(f"======被助力账号{dzl_num}获取邀请码成功,开始助力======") 449 | for i, ck in enumerate(cookies): 450 | usid = get_ck_usid(ck) 451 | zlcs = data.get(f"{usid}", 0) 452 | if zlcs < 1: 453 | print(f"======被助力账号{dzl_num}-开始第{i + 1}/{len(cookies)}个账号助力======") 454 | a = LYB(ck).share(actid, shareId) 455 | if a == 'SX': 456 | break 457 | elif a: 458 | data[f"{usid}"] = zlcs + 1 459 | with open(filename, 'w') as file: 460 | json.dump(data, file, indent=4) 461 | print("2s后进行下一个账号") 462 | time.sleep(2) 463 | continue 464 | elif a is False: 465 | data[f"{usid}"] = 1 466 | with open(filename, 'w') as file: 467 | json.dump(data, file, indent=4) 468 | print("2s后进行下一个账号") 469 | time.sleep(2) 470 | continue 471 | else: 472 | print("2s后进行下一个账号") 473 | time.sleep(2) 474 | continue 475 | else: 476 | continue 477 | print(f"======被助力账号{dzl_num}-领取奖励并浇水======") 478 | lyb.main() 479 | print(f"======被助力账号{dzl_num}-任务结束======\n\n") 480 | --------------------------------------------------------------------------------