├── README.md ├── eslt.py ├── follow.py ├── ftej.js ├── imt.py ├── iqy.py ├── tjbl.py ├── v2ex.py ├── xmdl.py └── zxsc.py /README.md: -------------------------------------------------------------------------------- 1 | # QLscripts 2 | 自用青龙脚本 3 | 4 | # 使用 5 | 6 | - 拉库命令 7 | 8 | - 可以直链github/国外机: `ql repo https://github.com/AKA-Cigma/QLscripts.git` 9 | 10 | # 特别声明 11 | 12 | 本仓库发布的脚本及其中涉及的任何解锁和解密分析脚本,仅用于测试和学习研究,禁止用于商业用途,不能保证其合法性,准确性,完整性和有效性,请根据情况自行判断。 13 | 14 | 本项目内所有资源文件,禁止任何公众号、自媒体进行任何形式的转载、发布。 15 | 16 | 本人对任何脚本问题概不负责,包括但不限于由任何脚本错误导致的任何损失或损害。 17 | 18 | 间接使用脚本的任何用户,包括但不限于建立VPS或在某些行为违反国家/地区法律或相关法规的情况下进行传播, 本人对于由此引起的任何隐私泄漏或其他后果概不负责。 19 | 20 | 请勿将本仓库的任何内容用于商业或非法目的,否则后果自负。 21 | 22 | 如果任何单位或个人认为该项目的脚本可能涉嫌侵犯其权利,则应及时通知并提供身份证明,所有权证明,我们将在收到认证文件后删除相关脚本。 23 | 24 | 任何以任何方式查看此项目的人或直接或间接使用该项目的任何脚本的使用者都应仔细阅读此声明。本人保留随时更改或补充此免责声明的权利。一旦使用并复制了任何相关脚本或Script项目的规则,则视为您已接受此免责声明。 25 | 26 | 您必须在下载后的24小时内从计算机或手机中完全删除以上内容 27 | 28 | 您使用或者复制了本仓库且本人制作的任何脚本,则视为 已接受 此声明,请仔细阅读 29 | -------------------------------------------------------------------------------- /eslt.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # coding: utf-8 3 | ''' 4 | 项目名称: AKA-Cigma / QLscripts 5 | Author: AKA-Cigma 6 | 功能:恩山论坛自动签到 7 | 抓电脑网页端恩山论坛积分页面请求头的完整cookie填到环境变量'esltck'里,多账号&连接 8 | Date: 2024/09/17 9 | cron: 5 0 * * * 10 | new Env('恩山论坛'); 11 | ''' 12 | import requests, json, time, os, sys 13 | from lxml import etree 14 | try: 15 | from notify import send 16 | except: 17 | pass 18 | 19 | accounts = os.getenv('esltck') 20 | 21 | if accounts is None: 22 | print('未检测到esltck') 23 | exit(1) 24 | 25 | accounts_list = accounts.split('&') 26 | print(f"获取到 {len(accounts_list)} 个账号\n") 27 | 28 | url = "https://www.right.com.cn/forum/home.php?mod=spacecp&ac=credit&op=log&suboperation=creditrulelog" 29 | 30 | headers = { 31 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36', 32 | 'Connection' : 'keep-alive', 33 | 'Host' : 'www.right.com.cn', 34 | 'Upgrade-Insecure-Requests' : '1', 35 | 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 36 | 'Accept-Language' : 'zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2', 37 | 'Accept-Encoding' : 'gzip, deflate, br', 38 | 'Cookie': '' 39 | } 40 | 41 | result = [] 42 | 43 | for i, account in enumerate(accounts_list, start=1): 44 | print(f"=======开始执行账号{i}=======\n") 45 | 46 | headers['Cookie'] = account 47 | 48 | data = requests.get(url, headers=headers) 49 | if data and '每天登录' in data.text: 50 | result.append(f"账号{i}签到成功!\n") 51 | h = etree.HTML(data.text) 52 | signin_data = h.xpath('//tr[td[1]="每天登录"]/td[position() >= 2 and position() <= 6]/text()') 53 | if len(signin_data) == 5: 54 | result.append(f'签到总次数:{signin_data[0]},签到周期次数:{signin_data[1]},贡献:{signin_data[2]},\ 55 | 获得恩山币:{signin_data[3]},最后签到时间:{signin_data[4]}\n') 56 | else: 57 | result.append(f'返回参数异常,可能是界面变更:{signin_data}\n') 58 | else: 59 | result.append(f"账号{i}签到失败:{data}\n") 60 | 61 | try: 62 | send("恩山论坛签到",f"{''.join(result)}") 63 | except Exception as e: 64 | print(f"消息推送失败:{e}!\n{result}\n") 65 | -------------------------------------------------------------------------------- /follow.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # coding: utf-8 3 | """ 4 | 项目名称: AKA-Cigma / QLscripts 5 | Author: AKA-Cigma 6 | 功能:Follow自动签到 7 | 抓Follow网页端的全部cookie填到环境变量'followck'里,多账号&连接 8 | Date: 2024/10/24 9 | cron: 8 8 * * * 10 | new Env('Follow'); 11 | """ 12 | from logging import exception 13 | 14 | import requests 15 | import time 16 | import os 17 | try: 18 | from notify import send 19 | except: 20 | pass 21 | 22 | accounts = os.getenv('followck') 23 | 24 | if accounts is None: 25 | print('未检测到followck') 26 | exit(1) 27 | 28 | accounts_list = accounts.split('&') 29 | print(f"获取到 {len(accounts_list)} 个账号\n") 30 | 31 | urls = ["https://api.follow.is/auth/csrf", 32 | "https://api.follow.is/wallets/transactions/claim-check", 33 | "https://api.follow.is/wallets/transactions/claim_daily", 34 | "https://api.follow.is/wallets", 35 | "https://api.follow.is/wallets/transactions?fromOrToUserId=", 36 | ] 37 | 38 | headers = { 39 | 'accept': '*/*', 40 | 'accept-language': 'zh-CN,zh;q=0.9,zh-TW;q=0.8,en-US;q=0.7,en;q=0.6', 41 | 'content-type': 'application/json', 42 | 'origin': 'https://app.follow.is', 43 | 'priority': 'u=1, i', 44 | 'sec-ch-ua': '"Chromium";v="130", "Google Chrome";v="130", "Not?A_Brand";v="99"', 45 | 'sec-ch-ua-mobile': '?0', 46 | 'sec-ch-ua-platform': '"Windows"', 47 | 'sec-fetch-dest': 'empty', 48 | 'sec-fetch-mode': 'cors', 49 | 'sec-fetch-site': 'same-site', 50 | 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36' 51 | } 52 | 53 | result = [] 54 | 55 | for i, account in enumerate(accounts_list, start=1): 56 | print(f"=======开始执行账号{i}=======\n") 57 | 58 | texts = [] 59 | for s in account.split(";"): 60 | text = s.strip() 61 | if not text or text.startswith("authjs.callback-url=") or text.startswith("authjs.csrf-token="): 62 | continue 63 | 64 | texts.append(text) 65 | 66 | cleaned_cookie = "; ".join(texts) 67 | headers['cookie'] = cleaned_cookie 68 | session = requests.Session() 69 | session.headers.update(headers) 70 | try: 71 | data = session.get(urls[0]) 72 | if data.text: 73 | xCsrfToken = data.json()['csrfToken'] 74 | csrfToken = data.cookies.get_dict().get('authjs.csrf-token') 75 | callback = data.cookies.get_dict().get('authjs.callback-url') 76 | else: 77 | result.append(f"账号{i}未获取到xCsrfToken:{data}\n") 78 | continue 79 | 80 | headers['cookie'] = cleaned_cookie + "; authjs.callback-url=" + callback + "; authjs.csrf-token=" + csrfToken if callback and csrfToken else account 81 | headers['x-csrf-token'] = xCsrfToken or '' 82 | session.headers.update(headers) 83 | transactionHash = None 84 | 85 | data = session.get(urls[1]) 86 | if data.text and data.json().get('data'): 87 | if not data.json()['data']: 88 | result.append(f"账号{i}今日已签到!") 89 | else: 90 | data = session.post(urls[2]) 91 | if data.text and data.json()['code'] == 0: 92 | result.append(f"账号{i}签到成功!") 93 | transactionHash = data.json()['data']['transactionHash'] 94 | print("等待一分钟后刷新……") 95 | time.sleep(60) 96 | else: 97 | result.append(f"账号{i}签到失败:{data},") 98 | else: 99 | result.append(f"账号{i}查询签到状态失败:{data}") 100 | 101 | data = session.get(urls[3]) 102 | if data.text: 103 | userId = data.json()['data'][0]['userId'] 104 | powerToken = int(data.json()['data'][0]['powerToken']) / (10 ** 18) 105 | result.append(f"总power:{powerToken},") 106 | else: 107 | result.append(f"查询power总数失败:{data}\n") 108 | continue 109 | 110 | data = session.get(urls[4] + userId) 111 | if data.text: 112 | if transactionHash and data.json()['data'][0]['hash'] == transactionHash: 113 | result.append(f"签到校验成功!\n") 114 | elif transactionHash is None: 115 | result.append(f"仅在每天第一次签到校验结果。\n") 116 | else: 117 | result.append(f"签到校验失败:{data.json()['data'][0]['hash']}\n") 118 | else: 119 | result.append(f"签到校验失败:{data}\n") 120 | except Exception as e: 121 | result.append(f"出现未知错误:{e}即将进行下一账号\n") 122 | finally: 123 | session.close() 124 | 125 | try: 126 | send("Follow签到",f"{''.join(result)}") 127 | except Exception as e: 128 | print(f"消息推送失败:{e}!\n{result}\n") 129 | -------------------------------------------------------------------------------- /ftej.js: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | 项目名称: AKA-Cigma / QLscripts 4 | Author: 未知,仅修复皮卡生活任务,如有侵权请联系我删除 5 | 功能:福田e家&皮卡生活自动签到 6 | 账号#密码填到环境变量'ftej'里,两个APP通用,皮卡生活登录会发短信,建议拉黑名单 7 | 偶尔会报错 多定时两次就好了 8 | Date: 2024/09/25 9 | cron: 6 12 * * * 10 | new Env('福田e家'); 11 | */ 12 | 13 | const $ = new Env("福田e家"); 14 | //let envSplitor = ['\n','@','#'] 15 | const fs = require('fs') 16 | let httpResult, httpReq, httpResp 17 | const ckFile1 = 'ftej.txt' 18 | const ckName = 'ftej' 19 | let userCookie = [] 20 | try { 21 | userCookie = userCookie.concat(fs.readFileSync(`./${ckFile1}`,'utf-8').split('\n')||[]) 22 | console.log(`ck文件[ ${ckFile1} ]加载成功`) 23 | this.mxr = true 24 | } catch (e) { 25 | console.log(`未发现本地文件 调用青龙环境变量`) 26 | this.mxr = false 27 | } 28 | let mxr=this.mxr 29 | if (this.mxr == false){ 30 | try { 31 | userCookie = userCookie.concat((($.isNode() ? process.env[ckName] : $.getdata(ckName))||'')?.split('\n')||[]) 32 | console.log(`环境变量[ ${ckName} ]加载成功`) 33 | } catch (e) { 34 | //console.log(e) 35 | } 36 | } 37 | 38 | let userList = [] 39 | let userIdx = 0 40 | let userCount = 0 41 | let time = Math.round( Date.now()) 42 | 43 | /////////////////////////////////////////////////////////////////// 44 | class UserInfo { 45 | constructor(str) { 46 | this.index = ++userIdx 47 | 48 | this.valid = false 49 | 50 | try { 51 | this.ck = str.split('#') 52 | this.user = phoneNum(`${this.ck[0]}`) 53 | this.ckValid = true 54 | } catch (e) { 55 | 56 | } 57 | } 58 | 59 | 60 | async cashck() { 61 | try { 62 | let url = `https://czyl.foton.com.cn/ehomes-new/homeManager/getLoginMember`; 63 | let body =`{"password":"${this.ck[1]}","version_name":"","version_auth":"","device_id":"","device_model":"","ip":"","name":"${this.ck[0]}","version_code":"180","deviceSystemVersion":"","device_type":"0"}`; 64 | //console.log(body) 65 | let h = { 66 | "Host": "czyl.foton.com.cn", 67 | "Content-Type": "application/json;charset\u003dutf-8", 68 | } 69 | let urlObject = popu(url, h, body) 70 | await httpRequest('post', urlObject) 71 | let result = httpResult; 72 | // console.log(result) 73 | if (result.code == 200) { 74 | console.log(`账号 ${this.user} 登录成功 `) 75 | this.token = result.data.token 76 | this.memberComplexCode = result.data.memberComplexCode 77 | this.uid = result.data.uid 78 | this.memberID = result.data.memberID 79 | if(result.data.signIn== "未签到"){ 80 | await this.sign() 81 | } 82 | // await $.wait(3000); 83 | await this.getTaskList()//每日关注 84 | // await $.wait(3000); 85 | await this.grxx() 86 | }else{ 87 | console.log(`账号 ${this.user} 登录失败 `) 88 | } 89 | } catch (e) { 90 | console.log(e) 91 | } finally { 92 | return Promise.resolve(1); 93 | } 94 | } 95 | //任务列表 96 | async getTaskList() { 97 | let tim = Math.round( Date.now()) 98 | try { 99 | let url = `https://czyl.foton.com.cn/ehomes-new/homeManager/api/Member/getTaskList`; 100 | let body = `{"memberId":"${this.memberID}","userId":"${this.uid}","userType":"61","uid":"${this.uid}","mobile":"${this.ck[0]}","tel":"${this.ck[0]}","brandName":"","seriesName":"","token":"ebf76685e48d4e14a9de6fccc76483e3","safeEnc":${tim-20220000},"businessId":1}`; 101 | 102 | 103 | let h = { 104 | "user-agent": "web", 105 | "Content-Type": "application/json; charset\u003dutf-8", 106 | "token": "", 107 | "host": "czyl.foton.com.cn" 108 | } 109 | //console.log(body) 110 | let urlObject = popu(url, h, body) 111 | await httpRequest('post', urlObject) 112 | let result = httpResult; 113 | // console.log(result) 114 | if (result.code == 200) { 115 | if (result.data[4].completeNum == 0) { 116 | await this.sign()//签到 117 | }else if (result.data[4].completeNum ==1 ){ 118 | console.log(`账号 ${this.user} ${result.data[4].ruleName} 已完成 `) 119 | } 120 | if (result.data[5].completeNum == 0) { 121 | await this.fx()//分享 122 | }else if (result.data[5].completeNum ==1 ){ 123 | console.log(`账号 ${this.user} ${result.data[6].ruleName} 已完成 `) 124 | } 125 | if (result.data[6].completeNum == 0) { 126 | await this.topicList()//发帖 127 | }else if (result.data[6].completeNum ==1 ){ 128 | console.log(`账号 ${this.user} ${result.data[6].ruleName} 已完成 `) 129 | } 130 | if (result.data[8].completeNum == 0) { 131 | await this.follow2nd()//关注 132 | }else if (result.data[8].completeNum ==1 ){ 133 | console.log(`账号 ${this.user} ${result.data[8].ruleName} 已完成 `) 134 | } 135 | if (result.data[7].completeNum == 0) { 136 | await this.comment2nd()//评论 137 | }else if (result.data[7].completeNum ==1 ){ 138 | console.log(`账号 ${this.user} ${result.data[7].ruleName} 已完成 `) 139 | } 140 | } 141 | } catch (e) { 142 | console.log(e) 143 | } finally { 144 | return Promise.resolve(1); 145 | } 146 | } 147 | async sign() { 148 | let time1 = Math.round( Date.now()) 149 | try { 150 | let url = `https://czyl.foton.com.cn/ehomes-new/homeManager/api/bonus/signActivity2nd`; 151 | let body = `{"memberId":"${this.memberComplexCode}","userId":"${this.uid}","userType":"61","uid":"${this.uid}","mobile":"${this.ck[0]}","tel":"${this.ck[0]}","brandName":"","seriesName":"","token":"ebf76685e48d4e14a9de6fccc76483e3","safeEnc":${time1-20220000},"businessId":1}`; 152 | let h = { 153 | "Host": "czyl.foton.com.cn", 154 | "Content-Type": "application/json;charset\u003dutf-8", 155 | "token": ``, 156 | } 157 | //console.log(body) 158 | let urlObject = popu(url, h, body) 159 | await httpRequest('post', urlObject) 160 | let result = httpResult; 161 | //console.log(result) 162 | if (result.code == 200) { 163 | console.log(`账号 ${this.user} 签到成功获得积分 ${result.data.data.integral} `) 164 | } else if (result.code == 500) { 165 | console.log(`账号 ${this.user} 今日已经签到`) 166 | } 167 | } catch (e) { 168 | console.log(e) 169 | } finally { 170 | return Promise.resolve(1); 171 | } 172 | } 173 | 174 | //关注列表 175 | async postList() { 176 | let time2 = Math.round( Date.now()) 177 | try { 178 | let url = `https://czyl.foton.com.cn/ehomes-new/ehomesCommunity/api/post/nowPostList`; 179 | let body = ` {"memberId":"${this.memberID}","userId":"${this.uid}","userType":"61","uid":"${this.uid}","mobile":"${this.ck[0]}","tel":"${this.ck[0]}","brandName":"","seriesName":"","token":"ebf76685e48d4e14a9de6fccc76483e3","safeEnc":${time2-20220000},"businessId":1,"pageNumber":1,"pageSize":30,"follow":"1"}`; 180 | let h = { 181 | "user-agent": "web", 182 | "Content-Type": "application/json; charset\u003dutf-8", 183 | "token": "", 184 | "host": "czyl.foton.com.cn" 185 | } 186 | //console.log(body) 187 | let urlObject = popu(url, h, body) 188 | await httpRequest('post', urlObject) 189 | let result = httpResult; 190 | // console.log(result) 191 | if (result.code == 200) { 192 | for (let i=1;i { 657 | if (typeof $request !== "undefined") { 658 | await GetRewrite() 659 | } else { 660 | 661 | if (!(await checkEnv())) return; 662 | 663 | 664 | 665 | if (userList.length > 0) { 666 | console.log('\n------- 福田e家-------\n') 667 | taskall = [] 668 | for (let user of userList) { 669 | taskall.push(user.cashck()) 670 | } 671 | await Promise.all(taskall) 672 | console.log('\n------- 卡车生活-------\n') 673 | taskall = [] 674 | for (let user of userList) { 675 | taskall.push(user.kclogin()) 676 | } 677 | await Promise.all(taskall) 678 | } 679 | 680 | } 681 | })() 682 | .catch((e) => console.log(e)) 683 | .finally(() => $.done()) 684 | 685 | /////////////////////////////////////////////////////////////////// 686 | async function GetRewrite() { 687 | 688 | } 689 | 690 | 691 | function checkEnv() { 692 | if(userCookie) { 693 | for(let userCookies of userCookie) { 694 | if(userCookies) userList.push(new UserInfo(userCookies)) 695 | } 696 | userCount = userList.length 697 | } else { 698 | console.log(`未找到CK`) 699 | return false; 700 | } 701 | 702 | console.log(`\n共找到${userCount}个账号`) 703 | return true 704 | } 705 | 706 | 707 | 708 | //////////////////////////////////////////////////////////////////// 709 | function popu(url, h, body = '') { 710 | let host = url.replace('//', '/').split('/')[1] 711 | let urlObject = { 712 | url: url, 713 | headers: h, 714 | timeout: 5000, 715 | } 716 | if (body) { 717 | urlObject.body = body 718 | } 719 | 720 | return urlObject; 721 | } 722 | 723 | 724 | async function httpRequest(method, url) { 725 | httpResult = null, httpReq = null, httpResp = null; 726 | return new Promise((resolve) => { 727 | $.send(method, url, async (err, req, resp) => { 728 | try { 729 | httpReq = req; 730 | httpResp = resp; 731 | if (err) { 732 | } else { 733 | if (resp.body) { 734 | if (typeof resp.body == "object") { 735 | httpResult = resp.body; 736 | } else { 737 | try { 738 | httpResult = JSON.parse(resp.body); 739 | } catch (e) { 740 | httpResult = resp.body; 741 | } 742 | } 743 | } 744 | } 745 | } catch (e) { 746 | console.log(e); 747 | } finally { 748 | resolve(); 749 | } 750 | }); 751 | }); 752 | } 753 | //////////////////////////////////////////////////////////////////// 754 | function randomArr(arr) { 755 | return arr[parseInt(Math.random() * arr.length, 10)]; 756 | } 757 | function phoneNum(phone_num) { 758 | if (phone_num.length == 11) { 759 | let data = phone_num.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2"); 760 | return data; 761 | } else { 762 | return phone_num; 763 | } 764 | } 765 | //MD5加密 766 | function MD5_Encrypt(a) { 767 | function b(a, b) { 768 | return a << b | a >>> 32 - b 769 | } 770 | 771 | function c(a, b) { 772 | var c, d, e, f, g; 773 | return e = 2147483648 & a, 774 | f = 2147483648 & b, 775 | c = 1073741824 & a, 776 | d = 1073741824 & b, 777 | g = (1073741823 & a) + (1073741823 & b), 778 | c & d ? 2147483648 ^ g ^ e ^ f : c | d ? 1073741824 & g ? 3221225472 ^ g ^ e ^ f : 1073741824 ^ g ^ e ^ f : 779 | g ^ e ^ f 780 | } 781 | 782 | function d(a, b, c) { 783 | return a & b | ~a & c 784 | } 785 | 786 | function e(a, b, c) { 787 | return a & c | b & ~c 788 | } 789 | 790 | function f(a, b, c) { 791 | return a ^ b ^ c 792 | } 793 | 794 | function g(a, b, c) { 795 | return b ^ (a | ~c) 796 | } 797 | 798 | function h(a, e, f, g, h, i, j) { 799 | return a = c(a, c(c(d(e, f, g), h), j)), 800 | c(b(a, i), e) 801 | } 802 | 803 | function i(a, d, f, g, h, i, j) { 804 | return a = c(a, c(c(e(d, f, g), h), j)), 805 | c(b(a, i), d) 806 | } 807 | 808 | function j(a, d, e, g, h, i, j) { 809 | return a = c(a, c(c(f(d, e, g), h), j)), 810 | c(b(a, i), d) 811 | } 812 | 813 | function k(a, d, e, f, h, i, j) { 814 | return a = c(a, c(c(g(d, e, f), h), j)), 815 | c(b(a, i), d) 816 | } 817 | 818 | function l(a) { 819 | 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 = 820 | 0; c > i;) 821 | b = (i - i % 4) / 4, 822 | h = i % 4 * 8, 823 | g[b] = g[b] | a.charCodeAt(i) << h, 824 | i++; 825 | return b = (i - i % 4) / 4, 826 | h = i % 4 * 8, 827 | g[b] = g[b] | 128 << h, 828 | g[f - 2] = c << 3, 829 | g[f - 1] = c >>> 29, 830 | g 831 | } 832 | 833 | function m(a) { 834 | var b, c, d = "", 835 | e = ""; 836 | for (c = 0; 3 >= c; c++) 837 | b = a >>> 8 * c & 255, 838 | e = "0" + b.toString(16), 839 | d += e.substr(e.length - 2, 2); 840 | return d 841 | } 842 | 843 | function n(a) { 844 | a = a.replace(/\r\n/g, "\n"); 845 | for (var b = "", c = 0; c < a.length; c++) { 846 | var d = a.charCodeAt(c); 847 | 128 > d ? b += String.fromCharCode(d) : d > 127 && 2048 > d ? (b += String.fromCharCode(d >> 6 | 192), 848 | b += String.fromCharCode(63 & d | 128)) : (b += String.fromCharCode(d >> 12 | 224), 849 | b += String.fromCharCode(d >> 6 & 63 | 128), 850 | b += String.fromCharCode(63 & d | 128)) 851 | } 852 | return b 853 | } 854 | 855 | var o, p, q, r, s, t, u, v, w, x = [], 856 | y = 7, 857 | z = 12, 858 | A = 17, 859 | B = 22, 860 | C = 5, 861 | D = 9, 862 | E = 14, 863 | F = 20, 864 | G = 4, 865 | H = 11, 866 | I = 16, 867 | J = 23, 868 | K = 6, 869 | L = 10, 870 | M = 15, 871 | N = 21; 872 | for (a = n(a), 873 | x = l(a), 874 | t = 1732584193, 875 | u = 4023233417, 876 | v = 2562383102, 877 | w = 271733878, 878 | o = 0; o < x.length; o += 16) 879 | p = t, 880 | q = u, 881 | r = v, 882 | s = w, 883 | t = h(t, u, v, w, x[o + 0], y, 3614090360), 884 | w = h(w, t, u, v, x[o + 1], z, 3905402710), 885 | v = h(v, w, t, u, x[o + 2], A, 606105819), 886 | u = h(u, v, w, t, x[o + 3], B, 3250441966), 887 | t = h(t, u, v, w, x[o + 4], y, 4118548399), 888 | w = h(w, t, u, v, x[o + 5], z, 1200080426), 889 | v = h(v, w, t, u, x[o + 6], A, 2821735955), 890 | u = h(u, v, w, t, x[o + 7], B, 4249261313), 891 | t = h(t, u, v, w, x[o + 8], y, 1770035416), 892 | w = h(w, t, u, v, x[o + 9], z, 2336552879), 893 | v = h(v, w, t, u, x[o + 10], A, 4294925233), 894 | u = h(u, v, w, t, x[o + 11], B, 2304563134), 895 | t = h(t, u, v, w, x[o + 12], y, 1804603682), 896 | w = h(w, t, u, v, x[o + 13], z, 4254626195), 897 | v = h(v, w, t, u, x[o + 14], A, 2792965006), 898 | u = h(u, v, w, t, x[o + 15], B, 1236535329), 899 | t = i(t, u, v, w, x[o + 1], C, 4129170786), 900 | w = i(w, t, u, v, x[o + 6], D, 3225465664), 901 | v = i(v, w, t, u, x[o + 11], E, 643717713), 902 | u = i(u, v, w, t, x[o + 0], F, 3921069994), 903 | t = i(t, u, v, w, x[o + 5], C, 3593408605), 904 | w = i(w, t, u, v, x[o + 10], D, 38016083), 905 | v = i(v, w, t, u, x[o + 15], E, 3634488961), 906 | u = i(u, v, w, t, x[o + 4], F, 3889429448), 907 | t = i(t, u, v, w, x[o + 9], C, 568446438), 908 | w = i(w, t, u, v, x[o + 14], D, 3275163606), 909 | v = i(v, w, t, u, x[o + 3], E, 4107603335), 910 | u = i(u, v, w, t, x[o + 8], F, 1163531501), 911 | t = i(t, u, v, w, x[o + 13], C, 2850285829), 912 | w = i(w, t, u, v, x[o + 2], D, 4243563512), 913 | v = i(v, w, t, u, x[o + 7], E, 1735328473), 914 | u = i(u, v, w, t, x[o + 12], F, 2368359562), 915 | t = j(t, u, v, w, x[o + 5], G, 4294588738), 916 | w = j(w, t, u, v, x[o + 8], H, 2272392833), 917 | v = j(v, w, t, u, x[o + 11], I, 1839030562), 918 | u = j(u, v, w, t, x[o + 14], J, 4259657740), 919 | t = j(t, u, v, w, x[o + 1], G, 2763975236), 920 | w = j(w, t, u, v, x[o + 4], H, 1272893353), 921 | v = j(v, w, t, u, x[o + 7], I, 4139469664), 922 | u = j(u, v, w, t, x[o + 10], J, 3200236656), 923 | t = j(t, u, v, w, x[o + 13], G, 681279174), 924 | w = j(w, t, u, v, x[o + 0], H, 3936430074), 925 | v = j(v, w, t, u, x[o + 3], I, 3572445317), 926 | u = j(u, v, w, t, x[o + 6], J, 76029189), 927 | t = j(t, u, v, w, x[o + 9], G, 3654602809), 928 | w = j(w, t, u, v, x[o + 12], H, 3873151461), 929 | v = j(v, w, t, u, x[o + 15], I, 530742520), 930 | u = j(u, v, w, t, x[o + 2], J, 3299628645), 931 | t = k(t, u, v, w, x[o + 0], K, 4096336452), 932 | w = k(w, t, u, v, x[o + 7], L, 1126891415), 933 | v = k(v, w, t, u, x[o + 14], M, 2878612391), 934 | u = k(u, v, w, t, x[o + 5], N, 4237533241), 935 | t = k(t, u, v, w, x[o + 12], K, 1700485571), 936 | w = k(w, t, u, v, x[o + 3], L, 2399980690), 937 | v = k(v, w, t, u, x[o + 10], M, 4293915773), 938 | u = k(u, v, w, t, x[o + 1], N, 2240044497), 939 | t = k(t, u, v, w, x[o + 8], K, 1873313359), 940 | w = k(w, t, u, v, x[o + 15], L, 4264355552), 941 | v = k(v, w, t, u, x[o + 6], M, 2734768916), 942 | u = k(u, v, w, t, x[o + 13], N, 1309151649), 943 | t = k(t, u, v, w, x[o + 4], K, 4149444226), 944 | w = k(w, t, u, v, x[o + 11], L, 3174756917), 945 | v = k(v, w, t, u, x[o + 2], M, 718787259), 946 | u = k(u, v, w, t, x[o + 9], N, 3951481745), 947 | t = c(t, p), 948 | u = c(u, q), 949 | v = c(v, r), 950 | w = c(w, s); 951 | var O = m(t) + m(u) + m(v) + m(w); 952 | return O.toLowerCase() 953 | } 954 | function Env(a, b) { 955 | return "undefined" != typeof process && JSON.stringify(process.env).indexOf("xxx") > -1 && process.exit(0), new class { 956 | constructor(a, b) { 957 | this.name = a, this.notifyStr = "", this.startTime = (new Date).getTime(), Object.assign(this, b), console.log(`${this.name} 开始运行: 958 | `) 959 | } 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 } getdata(b) { let a = this.getval(b); if (/^@/.test(b)) { let [, c, f] = /^@(.*?)\.(.*?)$/.exec(b), d = c ? this.getval(c) : ""; if (d) try { let e = JSON.parse(d); a = e ? this.lodash_get(e, f, "") : a } catch (g) { a = "" } } return a } setdata(c, d) { let a = !1; if (/^@/.test(d)) { let [, b, e] = /^@(.*?)\.(.*?)$/.exec(d), f = this.getval(b), i = b ? "null" === f ? null : f || "{}" : "{}"; try { let g = JSON.parse(i); this.lodash_set(g, e, c), a = this.setval(JSON.stringify(g), b) } catch (j) { let h = {}; this.lodash_set(h, e, c), a = this.setval(JSON.stringify(h), b) } } else a = this.setval(c, d); return a } getval(a) { return this.isSurge() || this.isLoon() ? $persistentStore.read(a) : this.isQuanX() ? $prefs.valueForKey(a) : this.isNode() ? (this.data = this.loaddata(), this.data[a]) : this.data && this.data[a] || null } setval(b, a) { return this.isSurge() || this.isLoon() ? $persistentStore.write(b, a) : this.isQuanX() ? $prefs.setValueForKey(b, a) : this.isNode() ? (this.data = this.loaddata(), this.data[a] = b, this.writedata(), !0) : this.data && this.data[a] || null } send(b, a, f = () => { }) { if ("get" != b && "post" != b && "put" != b && "delete" != b) { console.log(`无效的http方法:${b}`); return } if ("get" == b && a.headers ? (delete a.headers["Content-Type"], delete a.headers["Content-Length"]) : a.body && a.headers && (a.headers["Content-Type"] || (a.headers["Content-Type"] = "application/x-www-form-urlencoded")), this.isSurge() || this.isLoon()) { this.isSurge() && this.isNeedRewrite && (a.headers = a.headers || {}, Object.assign(a.headers, { "X-Surge-Skip-Scripting": !1 })); let c = { method: b, url: a.url, headers: a.headers, timeout: a.timeout, data: a.body }; "get" == b && delete c.data, $axios(c).then(a => { let { status: b, request: c, headers: d, data: e } = a; f(null, c, { statusCode: b, headers: d, body: e }) }).catch(a => console.log(a)) } else if (this.isQuanX()) a.method = b.toUpperCase(), this.isNeedRewrite && (a.opts = a.opts || {}, Object.assign(a.opts, { hints: !1 })), $task.fetch(a).then(a => { let { statusCode: b, request: c, headers: d, body: e } = a; f(null, c, { statusCode: b, headers: d, body: e }) }, a => f(a)); else if (this.isNode()) { this.got = this.got ? this.got : require("got"); let { url: d, ...e } = a; this.instance = this.got.extend({ followRedirect: !1 }), this.instance[b](d, e).then(a => { let { statusCode: b, request: c, headers: d, body: e } = a; f(null, c, { statusCode: b, headers: d, body: e }) }, b => { let { message: c, response: a } = b; f(c, a, a && a.body) }) } } time(a) { let b = { "M+": (new Date).getMonth() + 1, "d+": (new Date).getDate(), "h+": (new Date).getHours(), "m+": (new Date).getMinutes(), "s+": (new Date).getSeconds(), "q+": Math.floor(((new Date).getMonth() + 3) / 3), S: (new Date).getMilliseconds() }; for (let c in /(y+)/.test(a) && (a = a.replace(RegExp.$1, ((new Date).getFullYear() + "").substr(4 - RegExp.$1.length))), b) new RegExp("(" + c + ")").test(a) && (a = a.replace(RegExp.$1, 1 == RegExp.$1.length ? b[c] : ("00" + b[c]).substr(("" + b[c]).length))); return a } async showmsg() { if (!this.notifyStr) return; let a = this.name + " \u8FD0\u884C\u901A\u77E5\n\n" + this.notifyStr; if ($.isNode()) { var b = require("./sendNotify"); console.log("\n============== \u63A8\u9001 =============="), await b.sendNotify(this.name, a) } else this.msg(a) } logAndNotify(a) { console.log(a), this.notifyStr += a, this.notifyStr += "\n" } msg(d = t, a = "", b = "", e) { let f = a => { if (!a) return a; if ("string" == typeof a) return this.isLoon() ? a : this.isQuanX() ? { "open-url": a } : this.isSurge() ? { url: a } : void 0; if ("object" == typeof a) { if (this.isLoon()) { let b = a.openUrl || a.url || a["open-url"], c = a.mediaUrl || a["media-url"]; return { openUrl: b, mediaUrl: c } } if (this.isQuanX()) { let d = a["open-url"] || a.url || a.openUrl, e = a["media-url"] || a.mediaUrl; return { "open-url": d, "media-url": e } } if (this.isSurge()) return { url: a.url || a.openUrl || a["open-url"] } } }; this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(d, a, b, f(e)) : this.isQuanX() && $notify(d, a, b, f(e))); let c = ["", "============== \u7CFB\u7EDF\u901A\u77E5 =============="]; c.push(d), a && c.push(a), b && c.push(b), console.log(c.join("\n")) } getMin(a, b) { return a < b ? a : b } getMax(a, b) { return a < b ? b : a } padStr(e, b, f = "0") { let a = String(e), g = b > a.length ? b - a.length : 0, c = ""; for (let d = 0; d < g; d++)c += f; return c + a } json2str(b, e, f = !1) { let c = []; for (let d of Object.keys(b).sort()) { let a = b[d]; a && f && (a = encodeURIComponent(a)), c.push(d + "=" + a) } return c.join(e) } str2json(e, f = !1) { let d = {}; for (let a of e.split("#")) { if (!a) continue; let b = a.indexOf("="); if (-1 == b) continue; let g = a.substr(0, b), c = a.substr(b + 1); f && (c = decodeURIComponent(c)), d[g] = c } return d } randomString(d, a = "abcdef0123456789") { let b = ""; for (let c = 0; c < d; c++)b += a.charAt(Math.floor(Math.random() * a.length)); return b } randomList(a) { let b = Math.floor(Math.random() * a.length); return a[b] } wait(a) { return new Promise(b => setTimeout(b, a)) } done(a = {}) { 960 | let b = (new Date).getTime(), c = (b - this.startTime) / 1e3; console.log(` 961 | ${this.name} 运行结束,共运行了 ${c} 秒!`), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(a) 962 | } 963 | }(a, b) 964 | } 965 | //===============================================获取远程通知======================================== 966 | async function getNotice() { 967 | try { 968 | const urls = [ 969 | "https://tfapi.cn/tl.json", 970 | 971 | ]; 972 | let notice = null; 973 | for (const url of urls) { 974 | const options = { url, headers: { "User-Agent": "" }, }; 975 | const result = await httpRequest(options); 976 | if (result && "notice" in result) { 977 | notice = result.notice.replace(/\\n/g, "\n"); 978 | break; 979 | } 980 | } 981 | if (notice) { $.DoubleLog(notice); } 982 | } catch (e) { 983 | console.log(e); 984 | } 985 | } 986 | -------------------------------------------------------------------------------- /imt.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -- coding: utf-8 -- 3 | ''' 4 | 项目名称: AKA-Cigma / QLscripts 5 | Author: 未知,仅修复import失败,默认申请全部可申请,如有侵权请联系我删除 6 | 功能:i茅台自动预约 7 | 青龙面板加入环境变量 export MTTokenD,多账号&连接 8 | MTTokenD是茅台预约参数,格式'省份,城市,经度,维度,设备id,token,MT-Token-Wap(抓包小茅运)' 9 | 例:xx省,xx市,111.111111,22.222222,clips_xxx=,eyJxxx,eyJxxx 10 | MT-Token-Wap参数是小茅运的领奖励,不需要的话MTTokenD格式改成 省份,城市,经度,维度,设备id,token,'' 11 | 依赖pycryptodome 12 | Date: 2024/09/26 13 | cron: 0 10,30 9 * * * 14 | new Env('i茅台'); 15 | ''' 16 | 17 | import datetime 18 | import os 19 | import random 20 | import time,re 21 | 22 | import requests 23 | import base64 24 | import json 25 | from Crypto.Cipher import AES 26 | from Crypto.Util.Padding import pad 27 | 28 | from notify import send 29 | 30 | p_c_map = {} 31 | mt_r = 'clips_OlU6TmFRag5rCXwbNAQ/Tz1SKlN8THcecBp/' 32 | # 下面定义的是申请哪几个,可通过iMT_Products环境变量来设置,比如{"10941": "贵州茅台酒(甲辰龙年)", "2478": "贵州茅台酒(珍品)", "10942": "贵州茅台酒(甲辰龙年)x2"},不知道的运行一次有打印,不设置默认全申请 33 | products = os.getenv('iMT_Products') 34 | 35 | if not products: 36 | try: 37 | with open('productsCookie.json', 'r') as json_file: 38 | res_map = json.load(json_file) 39 | except: 40 | print('无productsCookie.json历史记录文件') 41 | res_map = {'10941': '贵州茅台酒 (甲辰龙年)', '10942': '贵州茅台酒 (甲辰龙年)'} 42 | else: 43 | res_map = json.loads(products) 44 | print('拟预约商品:') 45 | print(res_map) 46 | #加密 47 | def aes_cbc_encrypt(data, key, iv): 48 | cipher = AES.new(key.encode('utf-8'), AES.MODE_CBC, iv.encode('utf-8')) 49 | padded_data = pad(data.encode('utf-8'), AES.block_size) 50 | encrypted_data = cipher.encrypt(padded_data) 51 | return base64.b64encode(encrypted_data).decode('utf-8') 52 | 53 | def mt_add(itemId, shopId, sessionId, userId, token, Device_ID): 54 | MT_K = f'{int(time.time() * 1000)}' 55 | headers = {'User-Agent': 'iPhone 14', 56 | 'MT-Token': token, 57 | 'MT-Network-Type': 'WIFI', 'MT-User-Tag': '0', 58 | 'MT-R': mt_r, 'MT-K': MT_K, 59 | 'MT-Info': '028e7f96f6369cafe1d105579c5b9377', 'MT-APP-Version': mt_version, 60 | 'MT-Request-ID': f'{int(time.time() * 1000)}', 'Accept-Language': 'zh-Hans-CN;q=1', 61 | 'MT-Device-ID': Device_ID, 62 | 'MT-Bundle-ID': 'com.moutai.mall', 63 | 'mt-lng': lng, 64 | 'mt-lat': lat} 65 | d = {"itemInfoList": [{"count": 1, "itemId": str(itemId)}], "sessionId": sessionId, "userId": str(userId), 66 | "shopId": str(shopId)} 67 | r = aes_cbc_encrypt(json.dumps(d),'qbhajinldepmucsonaaaccgypwuvcjaa','2018534749963515') 68 | d['actParam'] = r 69 | json_data = d 70 | response = requests.post('https://app.moutai519.com.cn/xhr/front/mall/reservation/add', headers=headers, 71 | json=json_data) 72 | code = response.json().get('code', 0) 73 | if code == 2000: 74 | return response.json().get('data', {}).get('successDesc', "未知") 75 | return '申购失败:' + response.json().get('message', "未知原因") 76 | 77 | 78 | def tongzhi(ss): 79 | user_list = os.getenv('mtec_user', '').split(',') 80 | for user in user_list: 81 | url = 'http://wxpusher.zjiecode.com/api/send/message/?appToken=&content={}&uid={}'.format( 82 | ss, user) 83 | r = requests.get(url) 84 | print(r.text) 85 | 86 | 87 | def get_session_id(device_id, token): 88 | headers = { 89 | 'mt-device-id': device_id, 90 | 'mt-user-tag': '0', 91 | 'accept': '*/*', 92 | 'mt-network-type': 'WIFI', 93 | 'mt-token': token, 94 | 'mt-bundle-id': 'com.moutai.mall', 95 | 'accept-language': 'zh-Hans-CN;q=1', 96 | 'mt-request-id': f'{int(time.time() * 1000)}', 97 | 'mt-app-version': mt_version, 98 | 'user-agent': 'iPhone 14', 99 | 'mt-r': mt_r, 100 | 'mt-lng': lng, 101 | 'mt-lat': lat 102 | } 103 | 104 | response = requests.get('https://static.moutai519.com.cn/mt-backend/xhr/front/mall/index/session/get/' + time_keys, 105 | headers=headers) 106 | sessionId = response.json().get('data', {}).get('sessionId') 107 | itemList = response.json().get('data', {}).get('itemList', []) 108 | itemCodes = [item.get('itemCode') for item in itemList] 109 | return sessionId, itemCodes 110 | 111 | # 打印所有商品列表 112 | def get_shop_items(sessionId, device_id, token, province, city): 113 | headers = { 114 | 'mt-device-id': device_id, 115 | 'mt-user-tag': '0', 116 | 'mt-lat': '', 117 | 'accept': '*/*', 118 | 'mt-network-type': 'WIFI', 119 | 'mt-token': token, 120 | 'mt-bundle-id': 'com.moutai.mall', 121 | 'accept-language': 'zh-Hans-CN;q=1', 122 | 'mt-request-id': f'{int(time.time() * 1000)}', 123 | 'mt-r': mt_r, 124 | 'mt-app-version': mt_version, 125 | 'user-agent': 'iPhone 14', 126 | 'mt-lng': lng, 127 | 'mt-lat': lat 128 | } 129 | 130 | response = requests.get( 131 | 'https://static.moutai519.com.cn/mt-backend/xhr/front/mall/index/session/get/' + time_keys, headers=headers) 132 | item_list = response.json().get('data', {}).get("itemList", []) 133 | # 创建一个空字典,用于存储 itemCode 和 title 的映射关系 134 | item_code_title_map = {} 135 | # 遍历 itemList,提取 itemCode 和 title,并将它们添加到字典中 136 | for item in item_list: 137 | item_code_title_map[item.get("itemCode")] = item.get("title") 138 | print('可预约商品列表:') 139 | print(item_code_title_map) 140 | with open('productsCookie.json', 'w') as json_file: 141 | json.dump(item_code_title_map, json_file) 142 | print('已更新productsCookie.json历史记录文件') 143 | return item_code_title_map 144 | 145 | def get_shop_item(sessionId, itemId, device_id, token, province, city): 146 | headers = { 147 | 'mt-device-id': device_id, 148 | 'mt-user-tag': '0', 149 | 'mt-lat': '', 150 | 'accept': '*/*', 151 | 'mt-network-type': 'WIFI', 152 | 'mt-token': token, 153 | 'mt-bundle-id': 'com.moutai.mall', 154 | 'accept-language': 'zh-Hans-CN;q=1', 155 | 'mt-request-id': f'{int(time.time() * 1000)}', 156 | 'mt-r': mt_r, 157 | 'mt-app-version': mt_version, 158 | 'user-agent': 'iPhone 14', 159 | 'mt-lng': lng, 160 | 'mt-lat': lat 161 | } 162 | 163 | response = requests.get( 164 | 'https://static.moutai519.com.cn/mt-backend/xhr/front/mall/shop/list/slim/v3/' + str( 165 | sessionId) + '/' + province + '/' + str(itemId) + '/' + time_keys, 166 | headers=headers) 167 | data = response.json().get('data', {}) 168 | shops = data.get('shops', []) 169 | shop_id_ = p_c_map[province][city] 170 | for shop in shops: 171 | if not shop.get('shopId') in shop_id_: 172 | continue 173 | if itemId in str(shop): 174 | return shop.get('shopId') 175 | 176 | 177 | def get_user_id(token, Device_ID): 178 | headers = { 179 | 'MT-User-Tag': '0', 180 | 'Accept': '*/*', 181 | 'MT-Network-Type': 'WIFI', 182 | 'MT-Token': token, 183 | 'MT-Bundle-ID': 'com.moutai.mall', 184 | 'Accept-Language': 'zh-Hans-CN;q=1, en-CN;q=0.9', 185 | 'MT-Request-ID': f'{int(time.time() * 1000)}', 186 | 'MT-APP-Version': mt_version, 187 | 'User-Agent': 'iOS;16.0.1;Apple;iPhone 14 ProMax', 188 | 'MT-R': mt_r, 189 | 'MT-Device-ID': Device_ID, 190 | 'mt-lng': lng, 191 | 'mt-lat': lat 192 | } 193 | 194 | response = requests.get( 195 | 'https://app.moutai519.com.cn/xhr/front/user/info', headers=headers) 196 | userName = response.json().get('data', {}).get('userName') 197 | userId = response.json().get('data', {}).get('userId') 198 | mobile = response.json().get('data', {}).get('mobile') 199 | return userName, userId, mobile 200 | 201 | 202 | def getUserEnergyAward(device_id, ck): 203 | """ 204 | 领取耐力 205 | :return: 206 | """ 207 | 208 | cookies = { 209 | 'MT-Device-ID-Wap': device_id, 210 | 'MT-Token-Wap': ck, 211 | 'YX_SUPPORT_WEBP': '1', 212 | } 213 | 214 | headers = { 215 | 'X-Requested-With': 'XMLHttpRequest', 216 | 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_2_1 like Mac OS X)', 217 | 'Referer': 'https://h5.moutai519.com.cn/gux/game/main?appConfig=2_1_2', 218 | 'Client-User-Agent': 'iOS;15.0.1;Apple;iPhone 12 ProMax', 219 | 'MT-R': mt_r, 220 | 'Origin': 'https://h5.moutai519.com.cn', 221 | 'MT-APP-Version': mt_version, 222 | 'MT-Request-ID': f'{int(time.time() * 1000)}', 223 | 'Accept-Language': 'zh-CN,zh-Hans;q=0.9', 224 | 'MT-Device-ID': device_id, 225 | 'Accept': 'application/json, text/javascript, */*; q=0.01', 226 | 'mt-lng': lng, 227 | 'mt-lat': lat 228 | } 229 | response = requests.post('https://h5.moutai519.com.cn/game/isolationPage/getUserEnergyAward', cookies=cookies, 230 | headers=headers, json={}) 231 | return response.json().get('message') if '无法领取奖励' in response.text else "领取奖励成功" 232 | 233 | 234 | def get_map(): 235 | global p_c_map 236 | url = 'https://static.moutai519.com.cn/mt-backend/xhr/front/mall/resource/get' 237 | headers = { 238 | 'X-Requested-With': 'XMLHttpRequest', 239 | 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_0_1 like Mac OS X)', 240 | 'Referer': 'https://h5.moutai519.com.cn/gux/game/main?appConfig=2_1_2', 241 | 'Client-User-Agent': 'iOS;16.0.1;Apple;iPhone 14 ProMax', 242 | 'MT-R': mt_r, 243 | 'Origin': 'https://h5.moutai519.com.cn', 244 | 'MT-APP-Version': mt_version, 245 | 'MT-Request-ID': f'{int(time.time() * 1000)}{random.randint(1111111, 999999999)}{int(time.time() * 1000)}', 246 | 'Accept-Language': 'zh-CN,zh-Hans;q=1', 247 | 'MT-Device-ID': f'{int(time.time() * 1000)}{random.randint(1111111, 999999999)}{int(time.time() * 1000)}', 248 | 'Accept': 'application/json, text/javascript, */*; q=0.01', 249 | 'mt-lng': lng, 250 | 'mt-lat': lat 251 | } 252 | res = requests.get(url, headers=headers, ) 253 | mtshops = res.json().get('data', {}).get('mtshops_pc', {}) 254 | urls = mtshops.get('url') 255 | r = requests.get(urls) 256 | for k, v in dict(r.json()).items(): 257 | provinceName = v.get('provinceName') 258 | cityName = v.get('cityName') 259 | if not p_c_map.get(provinceName): 260 | p_c_map[provinceName] = {} 261 | if not p_c_map[provinceName].get(cityName, None): 262 | p_c_map[provinceName][cityName] = [k] 263 | else: 264 | p_c_map[provinceName][cityName].append(k) 265 | return p_c_map 266 | 267 | 268 | def login(phone, vCode, Device_ID): 269 | """ 270 | 271 | :param phone: 手机号 272 | :param vCode: 验证码 273 | :param Device_ID: 设备id 274 | :return: 275 | """ 276 | MT_K = f'{int(time.time() * 1000)}' 277 | r = requests.get( 278 | f'http://82.157.10.108:8086/get_mtv?DeviceID={Device_ID}&MTk={MT_K}&version={mt_version}&key=yaohuo') 279 | headers = { 280 | 'MT-Device-ID': Device_ID, 281 | 'MT-User-Tag': '0', 282 | 'Accept': '*/*', 283 | 'MT-Network-Type': 'WIFI', 284 | 'MT-Token': '', 285 | 'MT-K': MT_K, 286 | 'MT-Bundle-ID': 'com.moutai.mall', 287 | 'MT-V': r.text, 288 | 'User-Agent': 'iOS;16.0.1;Apple;iPhone 14 ProMax', 289 | 'Accept-Language': 'zh-Hans-CN;q=1', 290 | 'MT-Request-ID': f'{int(time.time() * 1000)}18342', 291 | 'MT-R': mt_r, 292 | 'MT-APP-Version': mt_version, 293 | } 294 | 295 | json_data = { 296 | 'ydToken': '', 297 | 'mobile': f'{phone}', 298 | 'vCode': f'{vCode}', 299 | 'ydLogId': '', 300 | } 301 | 302 | response = requests.post('https://app.moutai519.com.cn/xhr/front/user/register/login', headers=headers, 303 | json=json_data) 304 | data = response.json().get('data', {}) 305 | token = data.get('token') 306 | cookie = data.get('cookie') # MT-Token-Wap 307 | print(Device_ID, token, cookie) 308 | return Device_ID, token, cookie 309 | 310 | 311 | if __name__ == '__main__': 312 | mt_tokens = os.getenv("MTTokenD") 313 | mt_version = "".join(re.findall('whats-new__latest__version">(.*?)

', 314 | requests.get('https://apps.apple.com/cn/app/i%E8%8C%85%E5%8F%B0/id1600482450').text, 315 | re.S)).replace('版本 ', '').replace('版本 ', '') # line:248 316 | print('当前最新版本为:' + mt_version) # line:249 317 | if not mt_tokens: 318 | print('MTToken is null') 319 | exit() 320 | if not mt_version: 321 | print('版本号为空 is null') 322 | exit() 323 | mt_token_list = mt_tokens.split('&') 324 | s = "-------------------总共" + \ 325 | str(int(len(mt_token_list))) + \ 326 | "个用户-------------------"+'\n' 327 | userCount = 0 328 | if len(mt_token_list) > 0: 329 | for mt_token in mt_token_list: 330 | userCount += 1 331 | try: 332 | province, city, lng, lat, device_id, token, ck = mt_token.split(',') 333 | province, city, lng, lat, device_id, token, ck = province.strip(), city.strip(), lng.strip(), lat.strip(), device_id.strip(), token.strip(), ck.strip() 334 | except Exception as e: 335 | s = "MTTokenD未正确配置,格式'省份,城市,经度,维度,设备id,token,MT-Token-Wap(抓包小茅运)'" 336 | send("i茅台申购+小茅运", s) 337 | exit() 338 | time_keys = str( 339 | int(time.mktime(datetime.date.today().timetuple())) * 1000) 340 | get_map() 341 | 342 | try: 343 | sessionId, itemCodes = get_session_id(device_id, token) 344 | userName, user_id, mobile = get_user_id(token, device_id) 345 | if not user_id: 346 | s += "第"+str(userCount)+"个用户token失效,请重新登录"+'\n' 347 | continue 348 | s += "第"+str(userCount)+"个用户----------------"+userName + '_' + \ 349 | mobile + "开始任务" + "----------------"+'\n' 350 | items = get_shop_items(sessionId, device_id, token, province, city) 351 | for itemCode in itemCodes: 352 | name = res_map.get(str(itemCode)) 353 | if name: 354 | shop_id = get_shop_item( 355 | sessionId, itemCode, device_id, token, province, city) 356 | res = mt_add(itemCode, str(shop_id), sessionId, 357 | user_id, token, device_id) 358 | s += itemCode + \ 359 | '_' + name + '---------------' + res + '\n' 360 | if ck: 361 | if ck == "\'\'" : 362 | s += userName + '_' + mobile + '---------------' + \ 363 | "未设置MT-Token-Wap,小茅运领取奖励跳过" + '\n' 364 | else : 365 | r = getUserEnergyAward(device_id, ck) 366 | s += userName + '_' + mobile + '---------------' + \ 367 | "小茅运:" + r + '\n' 368 | s += userName + '_' + mobile + "正常结束任务"+'\n \n' 369 | except Exception as e: 370 | s += userName + '_' + mobile + "异常信息"+e 371 | send("i茅台申购+小茅运", s) 372 | -------------------------------------------------------------------------------- /iqy.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -- coding: utf-8 -- 3 | ''' 4 | 项目名称: AKA-Cigma / QLscripts 5 | Author: 未知,仅新增CK过期推送,如有侵权请联系我删除 6 | 功能:爱奇艺签到 刷观影时长 做任务领取奖励 7 | 青龙面板加入环境变量 export iqyck = "cookie",抓爱奇艺包含"P00001", "P00003", "QC005", "__dfp"的整个cookie 8 | Date: 2024/10/03 9 | cron: 10 7 * * * 10 | new Env('爱奇艺'); 11 | ''' 12 | 13 | from datetime import datetime 14 | from hashlib import md5 as md5Encode 15 | from json import dumps 16 | from time import sleep, time 17 | from os import environ, system, path 18 | from random import randint, choice 19 | from re import findall 20 | from string import digits, ascii_lowercase, ascii_uppercase 21 | from sys import exit, stdout 22 | from uuid import uuid4 23 | import requests 24 | # import urllib3 25 | # urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) 26 | 27 | def load_send(): 28 | cur_path = path.abspath(path.dirname(__file__)) 29 | if path.exists(cur_path + "/notify.py"): 30 | try: 31 | from notify import send 32 | return send 33 | except ImportError: 34 | return False 35 | else: 36 | return False 37 | 38 | try: 39 | from requests import Session, get, post 40 | from fake_useragent import UserAgent 41 | except: 42 | print( 43 | "你还没有安装requests库和TL库_useragent库 正在尝试自动安装 请在安装结束后重新执行此脚本\n若还是提示本条消息 请自行运行pip3 install requests和pip3 install fake-useragent或者在青龙的依赖管理里安装python的requests和fake-useragent") 44 | system("pip3 install fake-useragent") 45 | system("pip3 install requests") 46 | print("安装完成 脚本退出 请重新执行") 47 | exit(0) 48 | iqyck = environ.get("iqyck") if environ.get("iqyck") else "" 49 | P00001 = P00003 = dfp = qyid = "" 50 | if iqyck == "": 51 | print("未找到iqy_ck,请填写iqy_ck变量") 52 | exit(0) 53 | 54 | check_items = ["P00001", "P00003", "QC005", "__dfp"] 55 | 56 | for item in check_items: 57 | try: 58 | found = findall(rf"{item}=(.*?)(;|$)", iqyck) 59 | 60 | if found: 61 | value = found[0][0] 62 | 63 | if item == "P00001": 64 | P00001 = value 65 | elif item == "P00003": 66 | P00003 = value 67 | elif item == "QC005": 68 | qyid = value 69 | elif item == "__dfp": 70 | dfp = value 71 | dfp = dfp.split("@")[0] 72 | else: 73 | print(f"{item}未在iqyck中找到") 74 | except IndexError: 75 | print(f"{item}存在但无法被正确解析") 76 | 77 | class IQiYi: 78 | name = "爱奇艺" 79 | def __init__(self): 80 | self.P00001 = P00001 81 | self.userId = P00003 82 | self.dfp = dfp 83 | self.qyid = qyid 84 | self.platform = str(uuid4())[:16], 85 | self.session = Session() 86 | self.user_agent = UserAgent().chrome 87 | self.headers = { 88 | "User-Agent": self.user_agent, 89 | "Cookie": f"P00001={self.P00001}", 90 | 'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", 91 | 'sec-fetch-site': "none", 92 | 'sec-fetch-dest': "document", 93 | 'accept-language': "zh-CN,zh-Hans;q=0.9", 94 | 'sec-fetch-mode': "navigate" 95 | } 96 | self.msg = "" 97 | self.user_info = "" 98 | self.task_info = "" 99 | self.msg = "" 100 | self.taskList = [] 101 | self.lotteryList = [] 102 | self.shakeLotteryList = [] 103 | self.gift_list = [] 104 | self.sleep_await = environ.get("sleep_await") if environ.get("sleep_await") else 1 105 | 106 | """工具""" 107 | def req(self, url, req_method="GET", body=None): 108 | data = {} 109 | method = req_method.upper() 110 | if method not in ["GET", "POST", "OTHER"]: 111 | self.print_now(f"错误:不支持的请求方法:{method}") 112 | return 113 | 114 | try: 115 | if method == "GET": 116 | response = self.session.get(url, headers=self.headers, params=body) 117 | elif method == "POST": 118 | response = self.session.post(url, headers=self.headers, data=dumps(body)) 119 | elif method == "OTHER": 120 | response = self.session.get(url, headers=self.headers, params=dumps(body)) 121 | 122 | if method in ["GET", "POST"]: 123 | data = response.json() 124 | 125 | except requests.exceptions.RequestException as e: 126 | self.print_now(f"请求发送失败,可能为网络异常,异常详细信息:{str(e)}") 127 | 128 | return data 129 | 130 | def timestamp(self, short=False): 131 | if (short): 132 | return int(time()) 133 | return int(time() * 1000) 134 | 135 | def md5(self, str): 136 | m = md5Encode(str.encode(encoding='utf-8')) 137 | return m.hexdigest() 138 | 139 | def uuid(self, num, upper=False): 140 | str = '' 141 | if upper: 142 | for i in range(num): 143 | str += choice(digits + ascii_lowercase + ascii_uppercase) 144 | else: 145 | for i in range(num): 146 | str += choice(digits + ascii_lowercase) 147 | return str 148 | 149 | def print_now(self, content): 150 | print(content) 151 | stdout.flush() 152 | 153 | def sign(self): 154 | # lequ-qfe.iqiyi.com 155 | time_stamp = self.timestamp() 156 | data = f'agenttype=20|agentversion=15.5.5|appKey=lequ_rn|appver=15.5.5|authCookie={self.P00001}|qyid={self.qyid}|srcplatform=20|task_code=natural_month_sign|timestamp={time_stamp}|userId={self.userId}|cRcFakm9KSPSjFEufg3W' 157 | url = f'https://community.iqiyi.com/openApi/task/execute?task_code=natural_month_sign×tamp={time_stamp}&appKey=lequ_rn&userId={self.userId}&authCookie={self.P00001}&agenttype=20&agentversion=15.5.5&srcplatform=20&appver=15.5.5&qyid={self.qyid}&sign={self.md5(data)}' 158 | headers = { 159 | 'Content-Type': 'application/json' 160 | } 161 | body = { 162 | "natural_month_sign": { 163 | "verticalCode": "iQIYI", 164 | "agentVersion": "15.4.6", 165 | "authCookie": self.P00001, 166 | "taskCode": "iQIYI_mofhr", 167 | "dfp": self.dfp, 168 | "qyid": self.qyid, 169 | "agentType": 20, 170 | "signFrom": 1 171 | } 172 | } 173 | data = post(url, headers=headers, data=dumps(body)).json() 174 | signDays = None 175 | if 'code' in data and data['code'] == 'A0003': 176 | self.print_now("iqyck已失效,请重新获取") 177 | exit(0) 178 | elif 'code' in data and data['code'] == 'A00000': 179 | data_data = data.get('data', {}) 180 | msg = data_data.get('msg') 181 | 182 | if data_data.get('data'): 183 | signDays = data_data.get('data', {}).get('signDays') 184 | if msg and '已经到达上限' in msg: 185 | self.print_now(f"签到失败,今天已签到") 186 | self.task_info += f"签到失败,今天已签到\n" 187 | elif signDays is not None: 188 | self.print_now(f"签到成功, 本月累计签到{signDays}天") 189 | self.task_info += f"签到成功, 本月累计签到{signDays}天\n" 190 | 191 | if data_data['code'] != 'A0000' and data_data['code'] != 'A0014' and not (data_data.get('success')): 192 | self.print_now(f"签到失败:{msg}") 193 | self.task_info += f"签到失败:{msg}\n" 194 | else: 195 | self.print_now(f"签到失败:{data}") 196 | self.task_info += f"签到失败:{data}\n" 197 | 198 | def get_watch_time(self): 199 | url = "https://tc.vip.iqiyi.com/growthAgency/watch-film-duration" 200 | data = self.req(url) 201 | watch_time = data['data']['viewtime']['time'] 202 | return watch_time 203 | 204 | def watchVideo(self): 205 | totalTime = self.get_watch_time() 206 | if totalTime >= 7200: 207 | self.print_now(f"您的账号今日观影时长大于2小时,不执行刷观影时长") 208 | self.task_info += f"今日观影任务已完成\n" 209 | return 210 | self.print_now("正在刷观影时长,为减少风控,本过程运行大概1个小时") 211 | for i in range(1, 121): 212 | Time = randint(70, 90) 213 | url = f"https://msg.qy.net/b?u=f600a23f03c26507f5482e6828cfc6c5&pu={self.userId}&p1=1_10_101&v=5.2.66&ce={self.uuid(32)}&de=1616773143.1639632721.1639653680.29&c1=2&ve={self.uuid(32)}&ht=0&pt={randint(1000000000, 9999999999) / 1000000}&isdm=0&duby=0&ra=5&clt=&ps2=DIRECT&ps3=&ps4=&br=mozilla%2F5.0%20(windows%20nt%2010.0%3B%20win64%3B%20x64)%20applewebkit%2F537.36%20(khtml%2C%20like%20gecko)%20chrome%2F96.0.4664.110%20safari%2F537.36&mod=cn_s&purl=https%3A%2F%2Fwww.iqiyi.com%2Fv_1eldg8u3r08.html%3Fvfrm%3Dpcw_home%26vfrmblk%3D712211_cainizaizhui%26vfrmrst%3D712211_cainizaizhui_image1%26r_area%3Drec_you_like%26r_source%3D62%2540128%26bkt%3DMBA_PW_T3_53%26e%3Db3ec4e6c74812510c7719f7ecc8fbb0f%26stype%3D2&tmplt=2&ptid=01010031010000000000&os=window&nu=0&vfm=&coop=&ispre=0&videotp=0&drm=&plyrv=&rfr=https%3A%2F%2Fwww.iqiyi.com%2F&fatherid={randint(1000000000000000, 9999999999999999)}&stauto=1&algot=abr_v12-rl&vvfrom=&vfrmtp=1&pagev=playpage_adv_xb&engt=2&ldt=1&krv=1.1.85&wtmk=0&duration={randint(1000000, 9999999)}&bkt=&e=&stype=&r_area=&r_source=&s4={randint(100000, 999999)}_dianshiju_tbrb_image2&abtest=1707_B%2C1550_B&s3={randint(100000, 999999)}_dianshiju_tbrb&vbr={randint(100000, 999999)}&mft=0&ra1=2&wint=3&s2=pcw_home&bw=10&ntwk=18&dl={randint(10, 999)}.27999999999997&rn=0.{randint(1000000000000000, 9999999999999999)}&dfp={dfp}&stime={self.timestamp()}&r={randint(1000000000000000, 9999999999999999)}&hu=1&t=2&tm={Time}&_={self.timestamp()}" 214 | self.req(url, 'other') 215 | totalTime += Time 216 | sleep(randint(30, 50)) 217 | if i % 30 == 0: 218 | self.print_now(f"现在已经刷到了{totalTime}秒, 数据同步有延迟, 仅供参考") 219 | if totalTime >= 7200: 220 | sleep(60) 221 | self.print_now(f"今日观影任务已完成") 222 | self.task_info += f"今日观影任务已完成\n" 223 | break 224 | 225 | def dailyTask(self): 226 | # 查询任务 227 | """ 228 | status: 0 已完成,未领奖 1 已完成,已领奖 2 未完成 229 | """ 230 | url = f'https://tc.vip.iqiyi.com/taskCenter/task/queryUserTask?P00001={self.P00001}' 231 | data = self.req(url) 232 | if data['code'] == 'A00000': 233 | for item in data["data"].get("tasks", {}).get("daily", []): 234 | if item["taskCode"] != "WatchVideo60mins" and item["status"] != 1: 235 | self.taskList.append( 236 | { 237 | "taskTitle": item["taskTitle"], 238 | "taskCode": item["taskCode"], 239 | "status": item["status"] 240 | } 241 | ) 242 | if self.taskList: 243 | for item in self.taskList: 244 | if item["status"] == 2: 245 | # 领任务 246 | url = f'https://tc.vip.iqiyi.com/taskCenter/task/joinTask?P00001={self.P00001}&taskCode={item["taskCode"]}&platform={self.platform}&lang=zh_CN&app_lm=cn' 247 | if self.req(url)['code'] == 'A00000': 248 | sleep(10) 249 | # 完成任务 250 | url = f'https://tc.vip.iqiyi.com/taskCenter/task/notify?taskCode={item["taskCode"]}&P00001={self.P00001}&platform={self.platform}&lang=cn&bizSource=component_browse_timing_tasks&_={self.timestamp()}' 251 | if self.req(url)['code'] == 'A00000': 252 | sleep(2) 253 | if item["status"] == 2 or item["status"] == 0: 254 | # 领取奖励 255 | url = f"https://tc.vip.iqiyi.com/taskCenter/task/getTaskRewards?P00001={self.P00001}&taskCode={item['taskCode']}&lang=zh_CN&platform={self.platform}" 256 | data = self.req(url) 257 | if data['code'] == 'A00000': 258 | price = data['dataNew'][0]["value"] 259 | self.print_now(f"{item['taskTitle']}任务已完成, 获得{int(price[1:])}点成长值") 260 | self.task_info += f"{item['taskTitle']}任务已完成, 获得{int(price[1:])}点成长值\n" 261 | sleep(5) 262 | else: 263 | self.print_now("今日日常浏览任务已全部完成") 264 | self.task_info += "今日日常浏览任务已全部完成\n" 265 | 266 | def lottery(self): 267 | url = "https://iface2.iqiyi.com/aggregate/3.0/lottery_activity" 268 | lottery_params = { 269 | "app_k": 0, 270 | "app_v": 0, 271 | "platform_id": 10, 272 | "dev_os": 0, 273 | "dev_ua": 0, 274 | "net_sts": 0, 275 | "qyid": self.qyid, 276 | "psp_uid": self.userId, 277 | "psp_cki": self.P00001, 278 | "psp_status": 3, 279 | "secure_v": 1, 280 | "secure_p": 0, 281 | "req_sn": self.timestamp() 282 | } 283 | params = lottery_params 284 | data = self.req(url, "get", params) 285 | if data.get("code") == 0: 286 | daysurpluschance = int(data.get("daysurpluschance")) 287 | if daysurpluschance == 0: 288 | if self.lotteryList: 289 | self.print_now(f"抽奖奖品:{'、'.join(self.lotteryList)}") 290 | self.task_info += f"抽奖奖品:{'、'.join(self.lotteryList)}\n" 291 | else: 292 | self.print_now(f"抽奖次数已用完, 明日再来吧") 293 | self.task_info += f"抽奖次数已用完, 明日再来吧\n" 294 | else: 295 | award_info = data.get("awardName") 296 | self.lotteryList.append(award_info) 297 | sleep(2) 298 | self.lottery() 299 | else: 300 | self.print_now(f"抽奖接口请求失败:{data}\n") 301 | 302 | def shake_lottery(self): 303 | url = f'https://act.vip.iqiyi.com/shake-api/lottery?P00001={self.P00001}&dfp={self.dfp}&qyid={self.qyid}&deviceID={self.qyid}&version=15.4.6&agentType=12&platform=bb35a104d95490f6&ptid=02030031010000000000&fv=afc0b50ed49e732d&source=afc0b50ed49e732d&_={self.timestamp()}&vipType=1&lotteryType=0&actCode=0k9GkUcjddj4tne8&freeLotteryNum=3&extendParams={{"appIds":"iqiyi_pt_vip_iphone_video_autorenew_12m_348yuan_v2","supportSk2Identity":true,"testMode":"0","iosSystemVersion":"17.4.1","bundleId":"com.qiyi.iphone"}}' 304 | data = self.req(url) 305 | if data.get("code") == 'A00000': 306 | award_info = data.get("data", {}).get("title") 307 | self.shakeLotteryList.append(award_info) 308 | sleep(2) 309 | self.shake_lottery() 310 | elif data.get("msg") == "抽奖次数用完": 311 | if self.shakeLotteryList: 312 | self.print_now(f"每天摇一摇奖品:{'、'.join(self.shakeLotteryList)}") 313 | self.task_info += f"每天摇一摇奖品:{'、'.join(self.shakeLotteryList)}\n" 314 | else: 315 | self.print_now(f"每天摇一摇次数已用完, 明日再来吧") 316 | self.task_info += f"每天摇一摇次数已用完, 明日再来吧\n" 317 | else: 318 | self.print_now(f'每天摇一摇:{data.get("msg")}\n') 319 | 320 | def giveTimes(self): 321 | times_code_list = ["browseWeb", "browseWeb", "bookingMovie"] 322 | for times_code in times_code_list: 323 | url = f"https://pcell.iqiyi.com/lotto/giveTimes?dfp&qyid={self.qyid}&version&deviceId={self.qyid}&_cctimer={self.timestamp()}&actCode=bcf9d354bc9f677c×Code={times_code}&P00001={self.P00001}" 324 | data = self.req(url) 325 | 326 | def queryTimes(self): 327 | url = f"https://pcell.iqiyi.com/lotto/queryTimes?dfp&qyid={self.qyid}&version&deviceId={self.qyid}&_cctimer={self.timestamp()}&actCode=bcf9d354bc9f677c&P00001={self.P00001}" 328 | data = self.req(url) 329 | if data.get("code") == 'A00000': 330 | times = data["data"]["times"] 331 | return times 332 | 333 | def lotto_lottery(self): 334 | self.giveTimes() 335 | times = self.queryTimes() 336 | if times == 0: 337 | self.print_now(f"白金抽奖次数已用完, 明日再来吧") 338 | self.task_info += f"白金抽奖次数已用完, 明日再来吧" 339 | for _ in range(times): 340 | url = f"https://pcell.iqiyi.com/lotto/lottery?dfp&qyid={self.qyid}&version&deviceId={self.qyid}&_cctimer={self.timestamp()}&actCode=bcf9d354bc9f677c&P00001={self.P00001}" 341 | data = self.req(url) 342 | gift_name = data["data"]["giftName"] 343 | if gift_name and "未中奖" not in gift_name: 344 | self.gift_list.append(gift_name) 345 | if self.gift_list: 346 | self.print_now(f"白金抽奖奖品:{'、'.join(self.gift_list)}") 347 | self.task_info += f"白金抽奖奖品:{'、'.join(self.gift_list)}" 348 | elif times != 0: 349 | self.print_now(f"很遗憾,白金抽奖未中奖") 350 | self.task_info += f"很遗憾,白金抽奖未中奖" 351 | 352 | def get_userinfo(self): 353 | url = f"https://tc.vip.iqiyi.com/growthAgency/v2/growth-aggregation?messageId=b7d48dbba64c4fd0f9f257dc89de8e25&platform=97ae2982356f69d8&P00001={self.P00001}&responseNodes=duration,growth,upgrade,viewTime,growthAnnualCard&_={self.timestamp()}" 354 | data = self.req(url) 355 | growth_info = data['data']['growth'] 356 | if data.get("code") == 'A00000': 357 | self.user_info += f"用户昵称:{ data['data']['user']['nickname']}\nVIP等级:{growth_info['level']}\nVIP到期时间:{growth_info['deadline']}\n今日成长:{growth_info['todayGrowthValue']}\n当前成长:{growth_info['growthvalue']}\n升级还需:{growth_info['distance']}\n" 358 | else: 359 | self.user_info = f"查询失败,未获取到用户信息\n" 360 | 361 | def main(self): 362 | self.sign() 363 | self.watchVideo() 364 | self.dailyTask() 365 | self.lottery() 366 | self.shake_lottery() 367 | self.lotto_lottery() 368 | self.print_now(f"任务已经执行完成,因爱奇艺观影时间同步较慢,这里等待1分钟再查询今日成长值信息\n若不需要等待直接查询,请设置环境变量名 sleep_await = 0") 369 | if int(self.sleep_await) == 1: 370 | sleep(60) 371 | self.get_userinfo() 372 | self.msg = self.user_info + self.task_info 373 | send = load_send() 374 | if callable(send): 375 | send("爱奇艺", self.msg) 376 | else: 377 | print('\n加载通知服务失败') 378 | 379 | if __name__ == '__main__': 380 | iqiyi = IQiYi() 381 | try: 382 | iqiyi.main() 383 | except KeyError as e: 384 | send = load_send() 385 | if callable(send): 386 | send("爱奇艺", f"CK过期!{e}") 387 | else: 388 | print(f'\nCK过期!{e}\n加载通知服务失败') 389 | -------------------------------------------------------------------------------- /tjbl.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # coding: utf-8 3 | ''' 4 | 项目名称: AKA-Cigma / QLscripts 5 | Author: AKA-Cigma 6 | 功能:唐久便利自动签到 7 | 抓手机端小程序签到请求头里面的authorization#accept-serial#User-Agent填到环境变量'tjblck'里,多账号&连接 8 | Date: 2024/09/06 9 | cron: 4 0 * * * 10 | new Env('唐久便利'); 11 | ''' 12 | import requests 13 | import os 14 | import json 15 | try: 16 | from notify import send 17 | except: 18 | pass 19 | 20 | accounts = os.getenv('tjblck') 21 | 22 | if accounts is None: 23 | print('未检测到tjblck') 24 | exit(1) 25 | 26 | accounts_list = accounts.split('&') 27 | print(f"获取到 {len(accounts_list)} 个账号\n") 28 | 29 | urls = ["https://api.xiantjbl.com/prod-api/user/score/userSignDay", 30 | "https://api.xiantjbl.com/prod-api/user/score/queryUserSignList?signMonth\u003d", 31 | "https://api.xiantjbl.com/prod-api/user/score/queryUserScoreItem", 32 | ] 33 | 34 | headers = { 35 | "Host": "api.xiantjbl.com", 36 | "Connection": "keep-alive", 37 | "authorization": "", 38 | "charset": "utf-8", 39 | "accept-language": "zh", 40 | "User-Agent": "", 41 | "content-type": "application/json", 42 | "Accept-Encoding": "gzip,compress,br,deflate", 43 | "accept-serial": "" 44 | } 45 | 46 | result = [] 47 | 48 | def request_json(url, headers): 49 | response = requests.get(url, headers=headers) 50 | 51 | try: 52 | raw_response = response.content.decode('utf-8') 53 | data = json.loads(raw_response) 54 | return data 55 | except json.JSONDecodeError: 56 | print("无法解析为JSON格式:\n") 57 | print(raw_response) 58 | return None 59 | except Exception as e: 60 | print("请求出错:\n") 61 | print(e) 62 | return None 63 | 64 | 65 | for i, account in enumerate(accounts_list, start=1): 66 | print(f"=======开始执行账号{i}=======\n") 67 | params_list = account.split('#') 68 | if len(params_list) != 3: 69 | result.append(f"参数数量错误!跳过账号{i}!\n") 70 | continue 71 | 72 | headers['authorization'] = params_list[0] 73 | headers['accept-serial'] = params_list[1] 74 | headers['User-Agent'] = params_list[2] 75 | 76 | data = request_json(urls[0], headers=headers) 77 | if data and data['msg'] == "操作成功": 78 | result.append(f"账号{i}签到成功!\n") 79 | else: 80 | result.append(f"账号{i}签到失败:{data}\n") 81 | 82 | data = request_json(urls[1], headers=headers) 83 | if data and data['msg'] == "操作成功": 84 | result.append(f"本月签到{data['data']['numCount']}次,共获得积分:{data['data']['scoreCount']},") 85 | else: 86 | result.append(f"查询签到详情失败:{data},") 87 | 88 | data = request_json(urls[2], headers=headers) 89 | if data and data['msg'] == "操作成功": 90 | result.append(f"当前账户总积分:{data['data']['totalScore']},昵称:{data['data']['nickName']}\n") 91 | else: 92 | result.append(f"查询当前积分失败:{data}\n") 93 | 94 | try: 95 | send("唐久便利签到",f"{''.join(result)}") 96 | except Exception as e: 97 | print(f"消息推送失败:{e}!\n{result}\n") 98 | -------------------------------------------------------------------------------- /v2ex.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # coding: utf-8 3 | ''' 4 | 项目名称: AKA-Cigma / QLscripts 5 | Author: AKA-Cigma 6 | 功能:v2ex论坛自动签到 7 | 抓电脑网页端v2ex论坛积分页面请求头的完整cookie填到环境变量'v2exck'里,多账号&连接 8 | Date: 2024/10/31 9 | cron: 9 8 * * * 10 | new Env('v2ex'); 11 | ''' 12 | import requests, json, time, os, sys, re 13 | from lxml import html 14 | from datetime import datetime 15 | try: 16 | from notify import send 17 | except: 18 | pass 19 | 20 | accounts = os.getenv('v2exck') 21 | 22 | if accounts is None: 23 | print('未检测到v2exck') 24 | exit(1) 25 | 26 | accounts_list = accounts.split('&') 27 | print(f"获取到 {len(accounts_list)} 个账号\n") 28 | 29 | urls = ['https://www.v2ex.com/mission/daily', 30 | 'https://www.v2ex.com', 31 | 'https://www.v2ex.com/balance', 32 | ] 33 | 34 | headers = { 35 | 'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7', 36 | 'accept-language': 'zh-CN,zh;q=0.9,zh-TW;q=0.8,en-US;q=0.7,en;q=0.6', 37 | 'priority': 'u=0, i', 38 | 'sec-ch-ua': '"Chromium";v="130", "Google Chrome";v="130", "Not?A_Brand";v="99"', 39 | 'sec-ch-ua-mobile': '?0', 40 | 'sec-ch-ua-platform': '"Windows"', 41 | 'sec-fetch-dest': 'document', 42 | 'sec-fetch-mode': 'navigate', 43 | 'sec-fetch-site': 'same-origin', 44 | 'sec-fetch-user': '?1', 45 | 'upgrade-insecure-requests': '1', 46 | 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36' 47 | } 48 | 49 | result = [] 50 | 51 | for i, account in enumerate(accounts_list, start=1): 52 | print(f"=======开始执行账号{i}=======\n") 53 | 54 | headers['Cookie'] = account 55 | 56 | data = requests.get(urls[0], headers=headers) 57 | if data and '每日登录奖励已领取' in data.text: 58 | result.append(f"账号{i}今日已签到!") 59 | elif data and '领取 X 铜币' in data.text: 60 | tree = html.fromstring(data.text) 61 | link = tree.xpath('//input[@class="super normal button"]/@onclick') 62 | match = re.search(r"'/([^']+)'", link[0]) 63 | if match: 64 | url = f"/{match.group(1)}" 65 | else: 66 | result.append(f"账号{i}未获取到签到链接:{link[0]}\n") 67 | continue 68 | 69 | data = requests.get(urls[1] + url, headers=headers) 70 | result.append(f"账号{i}已尝试签到!") 71 | else: 72 | result.append(f"账号{i}签到异常:{data}\n") 73 | 74 | data = requests.get(urls[2], headers=headers) 75 | if data and data.text: 76 | tree = html.fromstring(data.text) 77 | signin_time = tree.xpath('//table[@class="data"]/tr[2]/td[1]/small/text()')[0] 78 | time = datetime.fromisoformat(signin_time.replace(" +08:00", "")).date() 79 | today = datetime.now().date() 80 | if time == today: 81 | amount_value = tree.xpath('//table[@class="data"]/tr[2]/td[3]/span/strong/text()') 82 | result.append(f"今日签到成功,获得铜币:{amount_value[0]}\n") 83 | else: 84 | result.append(f"签到失败:{time}\n") 85 | 86 | # 查找账户余额区域 87 | balance_div = tree.xpath('//div[@class="balance_area bigger"]') 88 | if balance_div: 89 | balance_div = balance_div[0] # 获取第一个匹配的余额区域 90 | 91 | # 提取数字和币种图片信息 92 | numbers = balance_div.xpath('text()') # 提取文字部分(数字) 93 | image_sources = balance_div.xpath('.//img/@src') # 提取图片路径 94 | 95 | # 初始化金银铜币 96 | gold, silver, bronze = 0, 0, 0 97 | 98 | # 遍历图片路径与数字对应 99 | index = 0 100 | for src in image_sources: 101 | while index < len(numbers) and not numbers[index].strip(): 102 | index += 1 # 跳过空白字符 103 | if index >= len(numbers): 104 | break 105 | num = int(numbers[index].strip()) # 提取数字 106 | if "gold" in src: 107 | gold = num 108 | elif "silver" in src: 109 | silver = num 110 | elif "bronze" in src: 111 | bronze = num 112 | index += 1 113 | 114 | result.append(f"金币数量:{gold},银币数量:{silver},铜币数量:{bronze}\n") 115 | else: 116 | result.append(f"获取余额异常:{data}\n") 117 | else: 118 | result.append(f"获取余额异常:{data}\n") 119 | 120 | try: 121 | send("v2ex论坛签到",f"{''.join(result)}") 122 | except Exception as e: 123 | print(f"消息推送失败:{e}!\n{result}\n") 124 | -------------------------------------------------------------------------------- /xmdl.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # coding: utf-8 3 | ''' 4 | 项目名称: AKA-Cigma / QLscripts 5 | Author: AKA-Cigma 6 | 功能:熊猫代理自动签到 7 | 注册地址: http://www.xiongmaodaili.com?invitationCode=FE66C96A-C72F-48AC-819B-079152005E4F 8 | 账号#密码填到环境变量'xmdlck'里,多账号&连接 9 | Date: 2024/09/25 10 | cron: 7 0 * * * 11 | new Env('熊猫代理'); 12 | ''' 13 | import requests 14 | import os 15 | from requests_toolbelt.multipart.encoder import MultipartEncoder 16 | try: 17 | from notify import send 18 | except: 19 | pass 20 | 21 | accounts = os.getenv('xmdlck') 22 | 23 | if accounts is None: 24 | print('未检测到xmdlck') 25 | exit(1) 26 | 27 | accounts_list = accounts.split('&') 28 | print(f"获取到 {len(accounts_list)} 个账号\n") 29 | 30 | urls = ["http://www.xiongmaodaili.com/xiongmao-web/user/login", 31 | "http://www.xiongmaodaili.com/xiongmao-web/points/getSignInDay", 32 | "http://www.xiongmaodaili.com/xiongmao-web/points/getSignInDayTime", 33 | "http://www.xiongmaodaili.com/xiongmao-web/points/receivePoints?signInDay=", 34 | "http://www.xiongmaodaili.com/xiongmao-web/points/getUserPoints", 35 | ] 36 | 37 | headers = { 38 | "Host": "www.xiongmaodaili.com", 39 | "Proxy-Connection": "keep-alive", 40 | "Accept": "application/json, text/plain, */*", 41 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.6261.95 Safari/537.36", 42 | "Origin": "http://www.xiongmaodaili.com", 43 | "Referer": "http://www.xiongmaodaili.com/", 44 | "Accept-Encoding": "gzip, deflate", 45 | "Accept-Language": "zh-CN,zh;q=0.9", 46 | } 47 | 48 | result = [] 49 | 50 | 51 | for i, account in enumerate(accounts_list, start=1): 52 | print(f"=======开始执行账号{i}=======\n") 53 | params_list = account.split('#') 54 | if len(params_list) != 2: 55 | result.append(f"参数数量错误!跳过账号{i}!\n") 56 | continue 57 | 58 | 59 | encoded = MultipartEncoder( 60 | fields={"account": params_list[0], "password": params_list[1], "originType": "1"} 61 | ) 62 | headers["Content-Type"] = encoded.content_type 63 | data = requests.post( 64 | urls[0], 65 | headers=headers, 66 | data=encoded, 67 | cookies={"invitationCode": "FE66C96A-C72F-48AC-819B-079152005E4F"}, 68 | verify=False, 69 | ) 70 | if data and data.json()["code"] == "0": 71 | cookies = data.cookies 72 | print(f"账号{i}登录成功!\n") 73 | else: 74 | result.append(f"账号{i}登录失败:{data}\n") 75 | continue 76 | 77 | 78 | headers["Content-Type"] = "application/json;charset=UTF-8" 79 | data = requests.get( 80 | urls[1], 81 | headers=headers, 82 | cookies=cookies, 83 | verify=False, 84 | ) 85 | if data and data.json()["code"] == "0": 86 | if data.json()["obj"][0]["status"] == 1: 87 | result.append(f"账号{i}今日已签到!\n") 88 | elif data.json()["obj"][0]["status"] == 0: 89 | pass 90 | else: 91 | result.append(f"账号{i}查询签到详情失败:{data}\n") 92 | continue 93 | else: 94 | result.append(f"账号{i}查询签到详情失败:{data}\n") 95 | continue 96 | 97 | 98 | data = requests.get( 99 | urls[2], 100 | headers=headers, 101 | cookies=cookies, 102 | verify=False, 103 | ) 104 | if data and data.json()["code"] == "0": 105 | pass 106 | else: 107 | result.append(f"账号{i}查询当前签到天数失败:{data}\n") 108 | continue 109 | 110 | 111 | data = requests.get( 112 | urls[3] + str(data.json()["obj"] + 1), 113 | headers=headers, 114 | cookies=cookies, 115 | verify=False, 116 | ) 117 | if data and data.json()["msg"] == "领取成功!": 118 | result.append(f"账号{i}签到成功!\n") 119 | else: 120 | result.append(f"账号{i}签到失败:{data}\n") 121 | 122 | 123 | data = requests.get( 124 | urls[4], 125 | headers=headers, 126 | cookies=cookies, 127 | verify=False, 128 | ) 129 | if data and data.json()["code"] == "0": 130 | result.append(f"当前积分:{data.json()['obj']}\n") 131 | else: 132 | result.append(f"账号{i}查询当前积分失败:{data}\n") 133 | 134 | try: 135 | send("熊猫代理签到",f"{''.join(result)}") 136 | except Exception as e: 137 | print(f"消息推送失败:{e}!\n{result}\n") 138 | -------------------------------------------------------------------------------- /zxsc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # coding: utf-8 3 | ''' 4 | 项目名称: AKA-Cigma / QLscripts 5 | Author: AKA-Cigma 6 | 功能:中兴商城自动签到 7 | 一天5毛买东西可抵扣 8 | 抓手机端签到请求链接里面的accessToken=后面的字符串(如dc487xxxx9d67)填到环境变量'zxscck'里,多账号&连接,网页版签到抓到的accessToken没有测试,有可能能用 9 | Date: 2023/10/16 10 | cron: 3 0 * * * 11 | new Env('中兴商城'); 12 | ''' 13 | import requests 14 | import os 15 | try: 16 | from notify import send 17 | except: 18 | pass 19 | 20 | url = "https://www.ztemall.com/index.php/topapi" 21 | headers = { 22 | "Accept": "*/*", 23 | "platform": "android", 24 | "C-Version": "5.2.32.2308151406", 25 | "User-Agent": "Mozilla/5.0 (Linux; Android 8.0.0; MI 5 Build/OPR1.170623.032; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/68.0.3440.91 Mobile Safari/537.36", 26 | "model": "MI 5", 27 | "Accept-Encoding": "gzip", 28 | "Host": "www.ztemall.com", 29 | "Connection": "Keep-Alive" 30 | } 31 | accounts = os.getenv('zxscck') 32 | 33 | if accounts is None: 34 | print('未检测到zxscck') 35 | exit(1) 36 | 37 | accounts_list = accounts.split('&') 38 | print(f"获取到 {len(accounts_list)} 个账号\n") 39 | result = [] 40 | 41 | for i, account in enumerate(accounts_list, start=1): 42 | print(f"=======开始执行账号{i}=======\n") 43 | params = { 44 | "method": "member.checkIn.add", 45 | "format": "json", 46 | "v": "v1", 47 | "accessToken": account 48 | } 49 | 50 | response = requests.get(url, headers=headers, params=params).json() 51 | if response['errorcode'] == 0: 52 | currentCheckInPoint = response['data']['currentCheckInPoint'] 53 | point = response['data']['point'] 54 | print(f"账号{i}签到成功,获得{currentCheckInPoint}积分,当前积分:{point}\n") 55 | result.append(f"账号{i}签到成功,获得{currentCheckInPoint}积分,当前积分:{point}\n") 56 | else: 57 | msg = response['msg'] 58 | print(f"账号{i}签到失败,{msg}\n") 59 | result.append(f"账号{i}签到失败,{msg}\n") 60 | 61 | try: 62 | send("中兴商城签到",f"{''.join(result)}") 63 | except Exception as e: 64 | print(f"消息推送失败:{e}!\n{result}\n") 65 | --------------------------------------------------------------------------------