├── ChinaUnicomLogin.py
├── JS
└── .gitkeep
├── LICENSE
├── README.md
├── backUp
├── 52pojie.js
├── china_telecom.py
├── iqiyiRed.js
├── telecom_live_lotter.py
├── txsp_vipRed.py
├── txspegg.py
└── txspjfdh.py
├── clean_log.sh
├── divination.py
├── gobing_checkin.py
├── iqiyi.py
├── iqiyiRed.py
├── jryc_monitor.py
├── login
├── telecom_login.py
└── unicom_login.py
├── logs
└── .gitkeep
├── mt_wxpusher.js
├── qfxhd.js
├── requirements.txt
├── sfexpress.py
├── tools
├── aes_encrypt.py
├── encrypt_symmetric.py
├── iqiyi_login.py
├── notify.py
├── ql_api.js
├── ql_api.py
├── ql_util.py
├── rsa_encrypt.py
├── send_msg.py
├── sfExpressLogin.py
├── tool.py
└── wxy_login.py
├── user_agent.json
├── wochangyou.py
├── wochangyou_token.py
├── wochangyou_token_psw.py
└── wyx.py
/JS/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanter/misaka/ec8bfa12f90bfb14091faaf983741fb18bc7ae16/JS/.gitkeep
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 不再维护,告辞
2 | # 原仓库来源limoruirui/misaka,本仓库仅做修改
3 |
4 |
--------------------------------------------------------------------------------
/backUp/52pojie.js:
--------------------------------------------------------------------------------
1 | /*
2 | -- coding: utf-8 --
3 | -------------------------------
4 | @Author : github@limoruirui https://github.com/limoruirui/misaka
5 | @Time : 24/7/2022 00:14
6 | -------------------------------*/
7 | /*
8 | * 1. 浏览器打开抓包 https://www.52pojie.cn/home.php?mod=spacecp&ac=credit&showcredit=1
9 | * 2. 将获取到的cookie整段填入15行中 或者填入boxjs中 变量名POJIE_COOKIE
10 | * 3. 只测试了Loon 其它自测 crontab 自选
11 | * [Script]
12 | * cron "13 13 * * *" script-path=https://raw.githubusercontent.com/limoruirui/misaka/master/52pojie.js, tag=52破解签到
13 | * 4. 脚本有风险,使用需谨慎.*/
14 | //若要将cookie填在脚本里 请填在下面这行
15 | let pojie_cookie = "";
16 | const $ = API("52破解签到");
17 | pojie_cookie = pojie_cookie || $.read("POJIE_COOKIE");
18 | const chrome_version_min = 89;
19 | const chrome_version_max = 103;
20 | const chrome_version = Math.floor(Math.random() * (chrome_version_max - chrome_version_min)) + chrome_version_min;
21 | const headers = {
22 | "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.9",
23 | "Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8,zh-TW;q=0.7",
24 | "Cache-Control": "no-cache",
25 | "Connection": "keep-alive",
26 | "Cookie": pojie_cookie,
27 | "Host": "www.52pojie.cn",
28 | "Content-Type": "text/plain;charset=UTF-8",
29 | "Pragma": "no-cache",
30 | "sec-ch-ua": `".Not/A)Brand";v="99", "Google Chrome";v="${chrome_version}", "Chromium";v="${chrome_version}"`,
31 | "sec-ch-ua-mobile": "?0",
32 | "sec-ch-ua-platform": "Windows",
33 | "Sec-Fetch-Dest": "document",
34 | "Sec-Fetch-Mode": "navigate",
35 | "Sec-Fetch-Site": "none",
36 | "Sec-Fetch-User": "?1",
37 | "Upgrade-Insecure-Requests": "1",
38 | "User-Agent": `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/${chrome_version}.0.${Math.floor(Math.random() * (999 - 100)) + 100}.${Math.floor(Math.random() * (99 - 10)) + 10} Safari/537.36`
39 | };
40 | if (pojie_cookie.length === 0) {
41 | $.notify("52破解", "", "cookie为空, 请检查");
42 | } else {
43 | (async () => {
44 | await get_task();
45 | //接任务后等待两秒钟后再执行
46 | await $.wait(2000);
47 | await check_in();
48 | $.done();
49 | })();
50 | }
51 |
52 | function get_task() {
53 | let get_task_req_data = {
54 | url: "https://www.52pojie.cn/home.php?mod=task&do=apply&id=2",
55 | headers: headers
56 | }
57 | $.http.put(get_task_req_data)
58 | }
59 |
60 | async function check_in() {
61 | let check_in_data = {
62 | url: "https://www.52pojie.cn/home.php?mod=task&do=draw&id=2&referer=https%3A%2F%2Fwww.52pojie.cn%2F.%2F%2Fthread-1521480-1-1.html",
63 | headers: headers
64 | }
65 | let req = await $.http.put(check_in_data);
66 | if (req.body.indexOf("您需要先登录才能继续本操作") !== -1) {
67 | $.notify("52破解", "", "cookie失效, 请检查");
68 | } else if (req.body.indexOf("不是进行中的任务") !== -1) {
69 | $.notify("52破解", "", "签到失败, 原因为今日已签到或者领取任务失败");
70 | } else if (req.body.indexOf("任务已完成") !== -1) {
71 | $.notify("52破解", "", "签到成功");
72 | } else {
73 | $.notify("52破解", "", "签到失败, 签到原因未知, 请查看日志")
74 | console.log(req.body);
75 | }
76 | }
77 |
78 | //https://github.com/Peng-YM/QuanX/blob/master/Tools/OpenAPI/api-minified.js
79 | function ENV(){const e="function"==typeof require&&"undefined"!=typeof $jsbox;return{isQX:"undefined"!=typeof $task,isLoon:"undefined"!=typeof $loon,isSurge:"undefined"!=typeof $httpClient&&"undefined"!=typeof $utils,isBrowser:"undefined"!=typeof document,isNode:"function"==typeof require&&!e,isJSBox:e,isRequest:"undefined"!=typeof $request,isScriptable:"undefined"!=typeof importModule}}function HTTP(e={baseURL:""}){const{isQX:t,isLoon:s,isSurge:o,isScriptable:n,isNode:i,isBrowser:r}=ENV(),u=/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/;const a={};return["GET","POST","PUT","DELETE","HEAD","OPTIONS","PATCH"].forEach(h=>a[h.toLowerCase()]=(a=>(function(a,h){h="string"==typeof h?{url:h}:h;const d=e.baseURL;d&&!u.test(h.url||"")&&(h.url=d?d+h.url:h.url),h.body&&h.headers&&!h.headers["Content-Type"]&&(h.headers["Content-Type"]="application/x-www-form-urlencoded");const l=(h={...e,...h}).timeout,c={onRequest:()=>{},onResponse:e=>e,onTimeout:()=>{},...h.events};let f,p;if(c.onRequest(a,h),t)f=$task.fetch({method:a,...h});else if(s||o||i)f=new Promise((e,t)=>{(i?require("request"):$httpClient)[a.toLowerCase()](h,(s,o,n)=>{s?t(s):e({statusCode:o.status||o.statusCode,headers:o.headers,body:n})})});else if(n){const e=new Request(h.url);e.method=a,e.headers=h.headers,e.body=h.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))})}else r&&(f=new Promise((e,t)=>{fetch(h.url,{method:a,headers:h.headers,body:h.body}).then(e=>e.json()).then(t=>e({statusCode:t.status,headers:t.headers,body:t.data})).catch(t)}));const y=l?new Promise((e,t)=>{p=setTimeout(()=>(c.onTimeout(),t(`${a} URL: ${h.url} exceeds the timeout ${l} ms`)),l)}):null;return(y?Promise.race([y,f]).then(e=>(clearTimeout(p),e)):f).then(e=>c.onResponse(e))})(h,a))),a}function API(e="untitled",t=!1){const{isQX:s,isLoon:o,isSurge:n,isNode:i,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(i){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)||"{}")),(o||n)&&(this.cache=JSON.parse($persistentStore.read(this.name)||"{}")),i){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),(o||n)&&$persistentStore.write(e,this.name),i&&(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||o)return $persistentStore.write(e,t);if(s)return $prefs.setValueForKey(e,t);i&&(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||o?$persistentStore.read(e):s?$prefs.valueForKey(e):i?this.root[e]:void 0)}delete(e){if(this.log(`DELETE ${e}`),-1!==e.indexOf("#")){if(e=e.substr(1),n||o)return $persistentStore.write(null,e);if(s)return $prefs.removeValueForKey(e);i&&delete this.root[e]}else delete this.cache[e];this.persistCache()}notify(e,t="",a="",h={}){const d=h["open-url"],l=h["media-url"];if(s&&$notify(e,t,a,h),n&&$notification.post(e,t,a+`${l?"\n多媒体:"+l:""}`,{url:d}),o){let s={};d&&(s.openUrl=d),l&&(s.mediaUrl=l),"{}"===JSON.stringify(s)?$notification.post(e,t,a):$notification.post(e,t,a,s)}if(i||u){const s=a+(d?`\n点击跳转: ${d}`:"")+(l?`\n多媒体: ${l}`:"");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||o||n?$done(e):i&&!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)}
--------------------------------------------------------------------------------
/backUp/china_telecom.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3
2 | # -- coding: utf-8 --
3 | # -------------------------------
4 | # @Author : github@limoruirui https://github.com/limoruirui by院长修改
5 | # @Time : 2022/9/12 16:10
6 | # cron "0 9,12 * * *" script-path=xxx.py,tag=匹配cron用
7 | # const $ = new Env('电信签到');
8 | # -------------------------------
9 |
10 | """
11 | 1. 电信签到 支持多账号执行 不需要抓包 脚本仅供学习交流使用, 请在下载后24h内删除
12 | 2. cron说明 12点必须执行一次(用于兑换) 然后12点之外还需要执行一次(用于执行每日任务) 一天共两次 可直接使用默认cron
13 | 3. 环境变量说明:
14 | 变量名(必须): TELECOM_PHONE_PASSWORD 格式: 手机号&服务密码,1317xxx1322&123456
15 | 单个CK塞多个账号时,以#分隔开:手机号&服务密码#手机号&服务密码,1317xxx1322&123456#1317xxx1322&123456
16 | 选填 TELECOM_FOOD : 给宠物喂食次数 默认为0 不喂食 根据用户在网时长 每天可以喂食5-10次
17 | 4. 必须登录过 电信营业厅 app的账号才能正常运行
18 | """
19 | """
20 | update:
21 | 2022.10.25 参考大佬 github@QGCliveDavis https://github.com/QGCliveDavis 的 loginAuthCipherAsymmertric 参数解密 新增app登录获取token 完成星播客系列任务 感谢大佬
22 | 2022.11.11 增加分享任务
23 | """
24 | import re
25 | from datetime import date, datetime
26 | from random import shuffle, randint, choices
27 | from time import sleep, strftime
28 | from re import findall
29 | from requests import get, post
30 | from base64 import b64encode
31 | from tools.aes_encrypt import AES_Ctypt
32 | from tools.rsa_encrypt import RSA_Encrypt
33 | from tools.tool import timestamp, get_environ, print_now
34 | from tools.ql_api import get_cookie
35 | from tools.send_msg import push
36 | from tools.notify import send
37 | from login.telecom_login import TelecomLogin
38 | from string import ascii_letters, digits
39 | import threading
40 |
41 |
42 | msg_str = ""
43 |
44 |
45 | class ChinaTelecom:
46 | def __init__(self, account, pwd, checkin=True):
47 | self.phone = account
48 | self.ticket = ""
49 | self.token = ""
50 | if pwd != "" and checkin:
51 | userLoginInfo = TelecomLogin(account, pwd).main()
52 | self.ticket = userLoginInfo[0]
53 | self.token = userLoginInfo[1]
54 |
55 | def init(self):
56 | self.msg = ""
57 | self.ua = f"CtClient;9.6.1;Android;12;SM-G9860;{b64encode(self.phone[5:11].encode()).decode().strip('=+')}!#!{b64encode(self.phone[0:5].encode()).decode().strip('=+')}"
58 | self.headers = {
59 | "Host": "wapside.189.cn:9001",
60 | "Referer": "https://wapside.189.cn:9001/resources/dist/signInActivity.html",
61 | "User-Agent": self.ua
62 | }
63 | self.key = "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+ugG5A8cZ3FqUKDwM57GM4io6\nJGcStivT8UdGt67PEOihLZTw3P7371+N47PrmsCpnTRzbTgcupKtUv8ImZalYk65\ndU8rjC/ridwhw9ffW2LBwvkEnDkkKKRi2liWIItDftJVBiWOh17o6gfbPoNrWORc\nAdcbpk2L+udld5kZNwIDAQAB\n-----END PUBLIC KEY-----"
64 |
65 |
66 | def req(self, url, method, data=None):
67 | if method == "GET":
68 | data = get(url, headers=self.headers).json()
69 | return data
70 | elif method.upper() == "POST":
71 | data = post(url, headers=self.headers, json=data).json()
72 | return data
73 | else:
74 | print_now("您当前使用的请求方式有误,请检查")
75 |
76 | # 长明文分段rsa加密
77 | def telecom_encrypt(self, text):
78 | if len(text) <= 32:
79 | return RSA_Encrypt(self.key).encrypt(text)
80 | else:
81 | encrypt_text = ""
82 | for i in range(int(len(text) / 32) + 1):
83 | split_text = text[(32 * i):(32 * (i + 1))]
84 | encrypt_text += RSA_Encrypt(self.key).encrypt(split_text)
85 | return encrypt_text
86 |
87 | @staticmethod
88 | def geneRandomToken():
89 | randomList = choices(ascii_letters + digits, k=129)
90 | token = f"V1.0{''.join(x for x in randomList)}"
91 | return token
92 |
93 | # 签到
94 | def chech_in(self):
95 | url = "https://wapside.189.cn:9001/jt-sign/api/home/sign"
96 | data = {
97 | "encode": AES_Ctypt("34d7cb0bcdf07523").encrypt(
98 | f'{{"phone":{self.phone},"date":{timestamp()},"signSource":"smlprgrm"}}')
99 | }
100 | print_now(self.req(url, "post", data))
101 |
102 | # 获取任务列表
103 | def get_task(self):
104 | url = "https://wapside.189.cn:9001/jt-sign/paradise/getTask"
105 | data = {
106 | "para": self.telecom_encrypt(f'{{"phone":{self.phone}}}')
107 | }
108 | msg = self.req(url, "post", data)
109 | # print_now(dumps(msg, indent=2, ensure_ascii=False))
110 | if msg["resoultCode"] == "0":
111 | self.task_list = msg["data"]
112 | else:
113 | print_now("获取任务列表失败")
114 | print_now(msg)
115 | return
116 |
117 | # 做每日任务
118 | def do_task(self):
119 | url = "https://wapside.189.cn:9001/jt-sign/paradise/polymerize"
120 | for task in self.task_list:
121 | if "翻牌抽好礼" in task["title"] or "查看我的订单" in task["title"] or "查看我的云盘" in task[
122 | "title"] or "查看权益中心" in task["title"] or "访问宽带余额" in task["title"] or "访问“我的宽带”" in \
123 | task["title"] or "查看“装修进度”" in task["title"] or "查看视频彩铃" in task["title"]:
124 | # if "翻牌抽好礼" in task["title"] or "查看我的订单" in task["title"] or "查看我的云盘" in task["title"]:
125 | #print_now(f'{task["title"]}----{task["taskId"]}')
126 | #print_now(f'{task["title"]}')
127 | decrept_para = f'{{"phone":"{self.phone}","jobId":"{task["taskId"]}"}}'
128 | data = {
129 | "para": self.telecom_encrypt(decrept_para)
130 | }
131 | data = self.req(url, "POST", data)
132 | if data["data"]["code"] == 0:
133 | print(f'账号{self.phone} {task["title"]}-------------------{data["resoultMsg"]}')
134 | # print_now(data)
135 | else:
136 | print_now(f'账号{self.phone} 聚合任务完成失败,原因是{data["resoultMsg"]}')
137 |
138 | # 给宠物喂食
139 | def food(self):
140 | url = "https://wapside.189.cn:9001/jt-sign/paradise/food"
141 | data = {
142 | "para": self.telecom_encrypt(f'{{"phone":{self.phone}}}')
143 | }
144 | res_data = self.req(url, "POST", data)
145 | if res_data["resoultCode"] == "0":
146 | print_now(res_data["resoultMsg"])
147 | else:
148 | print_now(f'账号{self.phone} 聚合任务完成失败,原因是{res_data["resoultMsg"]}')
149 |
150 | # 查询宠物等级
151 | def get_level(self):
152 | url = "https://wapside.189.cn:9001/jt-sign/paradise/getParadiseInfo"
153 | body = {
154 | "para": self.telecom_encrypt(f'{{"phone":{self.phone}}}')
155 | }
156 | data = self.req(url, "POST", body)
157 | self.level = int(data["userInfo"]["paradiseDressup"]["level"])
158 | if self.level < 5:
159 | print_now(f"账号{self.phone} 当前等级小于5级 不领取等级权益")
160 | return
161 | url = "https://wapside.189.cn:9001/jt-sign/paradise/getLevelRightsList"
162 | right_list = self.req(url, "POST", body)[f"V{self.level}"]
163 | for data in right_list:
164 | # print(dumps(data, indent=2, ensure_ascii=0))
165 | if "00金豆" in data["righstName"] or "话费" in data["righstName"]:
166 | rightsId = data["id"]
167 | self.level_ex(rightsId)
168 | continue
169 | # print(self.rightsId)
170 |
171 | # 每月领取等级金豆
172 | def level_ex(self, rightsId):
173 | # self.get_level()
174 | url = "https://wapside.189.cn:9001/jt-sign/paradise/conversionRights"
175 | data = {
176 | "para": self.telecom_encrypt(f'{{"phone":{self.phone},"rightsId":"{rightsId}"}},"receiveCount":1')
177 | }
178 | print_now(self.req(url, "POST", data))
179 |
180 | # 查询连续签到天数
181 | def query_signinfo(self):
182 | url = "https://wapside.189.cn:9001/jt-sign/reward/activityMsg"
183 | body = {
184 | "para": self.telecom_encrypt(f'{{"phone":{self.phone}}}')
185 | }
186 | data = self.req(url, "post", body)
187 | # print(dumps(data, indent=2, ensure_ascii=0))
188 | recordNum = data["recordNum"]
189 | if recordNum != 0:
190 | return data["date"]["id"]
191 | return ""
192 |
193 | # 若连续签到为7天 则兑换
194 | def convert_reward(self):
195 | global msg_str #声明我们在函数内部使用的是在函数外部定义的全局变量msg_str
196 | url = "https://wapside.189.cn:9001/jt-sign/reward/convertReward"
197 | try:
198 | rewardId = self.query_signinfo() # "baadc927c6ed4d8a95e28fa3fc68cb9"
199 | except:
200 | rewardId = "baadc927c6ed4d8a95e28fa3fc68cb9"
201 | if rewardId == "":
202 | return
203 | body = {
204 | "para": self.telecom_encrypt(
205 | f'{{"phone":"{self.phone}","rewardId":"{rewardId}","month":"{date.today().__format__("%Y%m")}"}}')
206 | }
207 | for i in range(10):
208 | try:
209 | data = self.req(url, "post", body)
210 | except Exception as e:
211 | print(f"请求发送失败: " + str(e))
212 | sleep(6)
213 | continue
214 | print_now(data)
215 | if data["code"] == "0":
216 | break
217 | sleep(6)
218 | reward_status = self.get_coin_info()
219 | if reward_status:
220 | self.msg += f"账号{self.phone}连续签到7天兑换2元话费成功\n"
221 | msg_str += f"账号{self.phone}连续签到7天兑换2元话费成功\n"
222 | print_now(self.msg)
223 | #push("电信签到兑换", self.msg)
224 | else:
225 | self.msg += f"账号{self.phone}连续签到7天兑换2元话费失败 明天会继续尝试兑换\n"
226 | msg_str += f"账号{self.phone}连续签到7天兑换2元话费失败 明天会继续尝试兑换\n"
227 | print_now(self.msg)
228 | #push("电信签到兑换", self.msg)
229 |
230 | # 查询金豆数量
231 | def coin_info(self):
232 | url = "https://wapside.189.cn:9001/jt-sign/api/home/userCoinInfo"
233 | data = {
234 | "para": self.telecom_encrypt(f'{{"phone":{self.phone}}}')
235 | }
236 | self.coin_count = self.req(url, "post", data)
237 | print_now(self.coin_count)
238 |
239 | def author(self):
240 | """
241 | 通过usercode 获取 authorization
242 | :return:
243 | """
244 | self.get_usercode()
245 | url = "https://xbk.189.cn/xbkapi/api/auth/userinfo/codeToken"
246 | data = {
247 | "usercode": self.usercode
248 | }
249 | data = post(url, headers=self.headers_live, json=data).json()
250 | self.authorization = f"Bearer {data['data']['token']}"
251 | self.headers_live["Authorization"] = self.authorization
252 |
253 | def get_usercode(self):
254 | """
255 | 授权星播客登录获取 usercode
256 | :return:
257 | """
258 | url = f"https://xbk.189.cn/xbkapi/api/auth/jump?userID={self.ticket}&version=9.3.3&type=room&l=renwu"
259 | self.headers_live = {
260 | "User-Agent": self.ua,
261 | "Host": "xbk.189.cn",
262 | "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
263 | "Accept-Language": "zh-CN,zh-Hans;q=0.9"
264 | }
265 | location = get(url, headers=self.headers_live, allow_redirects=False).headers["location"]
266 | usercode = findall(r"usercode=(.*?)&", location)[0]
267 | self.usercode = usercode
268 |
269 | def watch_video(self):
270 | """
271 | 看视频 一天可完成6次
272 | :return:
273 | """
274 | url = "https://xbk.189.cn/xbkapi/lteration/liveTask/index/watchVideo"
275 | data = {
276 | "articleId": 3453
277 | }
278 | data = post(url, headers=self.headers_live, json=data).json()
279 | if data["code"] == 0:
280 | print("账号{self.phone} 看小视频15s完成一次")
281 | else:
282 | print(f"账号{self.phone} 完成看小视频15s任务失败, 失败原因为{data['msg']}")
283 |
284 | def like(self):
285 | """
286 | 点赞直播间 可完成5次
287 | :return:
288 | """
289 | url = "https://xbk.189.cn/xbkapi/lteration/room/like"
290 | liveId_list = [1820, 2032, 2466, 2565, 1094, 2422, 1858, 2346]
291 | shuffle(liveId_list)
292 | for liveId in liveId_list[:5]:
293 | data = {
294 | "account": self.phone,
295 | "liveId": liveId
296 | }
297 | try:
298 | data = post(url, headers=self.headers_live, json=data).json()
299 | if data["code"] == 8888:
300 | sleep(2)
301 | print(data["msg"])
302 | else:
303 | print(f"账号{self.phone} 完成点赞直播间任务失败,原因是{data['msg']}")
304 | except Exception:
305 | print(Exception)
306 |
307 | def watch_live(self):
308 | # 首先初始化任务,等待15秒倒计时后再完成 可完成10次
309 | url = "https://xbk.189.cn/xbkapi/lteration/liveTask/index/watchLiveInit"
310 | live_id = randint(1000, 2700)
311 | data = {
312 | "period": 1,
313 | "liveId": live_id
314 | }
315 | data = post(url, headers=self.headers_live, json=data).json()
316 | if data["code"] == 0:
317 | taskcode = data["data"]
318 | url = "https://xbk.189.cn/xbkapi/lteration/liveTask/index/watchLive"
319 | data = {
320 | "key": taskcode,
321 | "period": 1,
322 | "liveId": live_id
323 | }
324 | print("正在等待15秒")
325 | sleep(15)
326 | data = post(url, headers=self.headers_live, json=data).json()
327 | if data["code"] == 0:
328 | print("账号{self.phone} 完成1次观看直播任务")
329 | else:
330 | print(f"账号{self.phone} 完成观看直播任务失败,原因是{data['msg']}")
331 | else:
332 | print(f"账号{self.phone} 初始化观看直播任务失败,失败原因为{data['msg']}")
333 |
334 | def get_userid(self):
335 | url = "https://wapside.189.cn:9001/jt-sign/api/home/homeInfo"
336 | body = {
337 | "para": self.telecom_encrypt(
338 | f'{{"phone":"{self.phone}","signDate":"{datetime.now().__format__("%Y-%m")}"}}')
339 | }
340 | userid = post(url, json=body).json()["data"]["userInfo"]["userThirdId"]
341 | return userid
342 |
343 | def share(self):
344 | """
345 | 50的分享任务 token不做校检 有值即可 若登录成功了 使用自己的token 否则生成随机的token
346 | :return:
347 | """
348 | url = "https://appfuwu.189.cn:9021/query/sharingGetGold"
349 | body = {
350 | "headerInfos": {
351 | "code": "sharingGetGold",
352 | "timestamp": datetime.now().__format__("%Y%m%d%H%M%S"),
353 | "broadAccount": "",
354 | "broadToken": "",
355 | "clientType": "#9.6.1#channel50#iPhone 14 Pro Max#",
356 | "shopId": "20002",
357 | "source": "110003",
358 | "sourcePassword": "Sid98s",
359 | "token": self.token if self.token != "" else self.geneRandomToken(),
360 | "userLoginName": self.phone
361 | },
362 | "content": {
363 | "attach": "test",
364 | "fieldData": {
365 | "shareSource": "3",
366 | "userId": self.get_userid(),
367 | "account": TelecomLogin.get_phoneNum(self.phone)
368 | }
369 | }
370 | }
371 | headers = {
372 | "user-agent": "iPhone 14 Pro Max/9.6.1"
373 | }
374 | data = post(url, headers=headers, json=body).json()
375 | print_now(data)
376 |
377 | def main(self):
378 | global msg_str #声明我们在函数内部使用的是在函数外部定义的全局变量msg_str
379 | self.init()
380 | self.chech_in()
381 | self.get_task()
382 | self.do_task()
383 | if foods != 0:
384 | for i in range(foods):
385 | self.food()
386 | # self.convert_reward()
387 | if datetime.now().day == 1:
388 | self.get_level()
389 | self.share()
390 | # if self.ticket != "":
391 | # self.author()
392 | # for i in range(6):
393 | # self.watch_video()
394 | # sleep(15)
395 | # self.like()
396 | # for i in range(10):
397 | # try:
398 | # self.watch_live()
399 | # except:
400 | # continue
401 | self.coin_info()
402 | self.msg += f"\n账号{self.phone} 当前有金豆{self.coin_count['totalCoin']}\n"
403 | msg_str += f"\n账号{self.phone} 当前有金豆{self.coin_count['totalCoin']}\n"
404 | #push("电信app签到", self.msg)
405 |
406 | def get_coin_info(self):
407 | url = "https://wapside.189.cn:9001/jt-sign/api/getCoinInfo"
408 | decrept_para = f'{{"phone":"{self.phone}","pageNo":0,"pageSize":10,type:"1"}}'
409 | data = {
410 | "para": self.telecom_encrypt(decrept_para)
411 | }
412 | data = self.req(url, "POST", data)
413 |
414 | try:
415 | if "skuName" in data["data"]["biz"]["results"][0] and "连续签到" in data["data"]["biz"]["results"][0]["skuName"]:
416 | return True
417 | except Exception as e:
418 | print(f"账号{self.phone}出现错误,请求失败结果: " )
419 | print_now(data)
420 | return False
421 |
422 |
423 |
424 |
425 |
426 |
427 | def start(phone,password):
428 | if phone == "":
429 | exit(0)
430 | if password == "":
431 | print_now("电信服务密码未提供 只执行部分任务")
432 | if datetime.now().hour + (8 - int(strftime("%z")[2])) == 12:
433 | telecom = ChinaTelecom(phone, password, False)
434 | telecom.init()
435 | telecom.convert_reward()
436 | else:
437 | telecom = ChinaTelecom(phone, password)
438 | telecom.main()
439 | print("\n")
440 |
441 |
442 |
443 |
444 | if __name__ == '__main__':
445 | l = []
446 | user_map = []
447 | cklist = get_cookie("TELECOM_PHONE_PASSWORD")
448 | for i in range(len(cklist)):
449 | #以#分割开的ck
450 | split1 = cklist[i].split("#")
451 | if len(split1)>1:
452 | for j in range(len(split1)):
453 | split2 = split1[j].split("&")
454 | if len(split2)>1:
455 | user_map.append(split1[j])
456 | else:
457 | userinfo = cklist[i].split("&")
458 | if len(userinfo)>1:
459 | user_map.append(cklist[i])
460 |
461 |
462 |
463 | num_list = get_cookie("TELECOM_FOOD", 0, False)
464 | num = 0
465 | if num_list != 0:
466 | if len(num_list)>0:
467 | num = num_list[0]
468 | foods = int(float(num))
469 | for i in range(len(user_map)):
470 | phone=""
471 | password=""
472 | userinfo = user_map[i].split("&")
473 | if len(userinfo)>1:
474 | phone = userinfo[0]
475 | password = userinfo[1]
476 | print('开始执行第{}个账号:{}'.format((i+1),phone))
477 | if phone == "":
478 | print("当前账号未填写手机号 跳过")
479 | print("\n")
480 | continue
481 | p = threading.Thread(target=start,args=(phone,password))
482 | l.append(p)
483 | p.start()
484 | print("\n")
485 | for i in l:
486 | i.join()
487 | send("电信签到",msg_str)
488 |
--------------------------------------------------------------------------------
/backUp/telecom_live_lotter.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3
2 | # -- coding: utf-8 --
3 | # -------------------------------
4 | # @Author : github@limoruirui https://github.com/limoruirui by院长修改
5 | # @Time : 2022/11/11 10:42
6 | # cron "*/30 8-23 * * *" script-path=xxx.py,tag=匹配cron用
7 | # const $ = new Env('某营业厅直播抽奖');
8 | # -------------------------------
9 | """
10 | 1. 脚本仅供学习交流使用, 请在下载后24h内删除
11 | 2. 环境变量说明:
12 | 变量名(必须): TELECOM_PHONE_PASSWORD
13 | 格式: 手机号&服务密码,1317xxx1322&123456
14 | 单个CK塞多个账号时,以#分隔开:手机号&服务密码#手机号&服务密码,1317xxx1322&123456#1317xxx1322&123456
15 | 3. 必须登录过 电信营业厅 app的账号才能正常运行
16 | """
17 | import re
18 | from random import randint
19 | from base64 import b64encode
20 | from time import mktime, strptime, strftime, sleep as time_sleep
21 | from requests import post, get, packages
22 | packages.urllib3.util.ssl_.DEFAULT_CIPHERS += ":HIGH:!DH:!aNULL"
23 | from datetime import datetime, timedelta
24 | from asyncio import wait, sleep, run
25 |
26 | from tools.ql_api import get_cookie
27 | from tools.tool import timestamp, get_environ, print_now
28 | from tools.send_msg import push
29 | from china_telecom import ChinaTelecom
30 | import threading
31 | import time
32 | import requests
33 | import json
34 |
35 | from tools.notify import send
36 |
37 | class TelecomLotter:
38 | def __init__(self, phone, password):
39 | self.phone = phone
40 | chinaTelecom = ChinaTelecom(phone, password)
41 | chinaTelecom.init()
42 | chinaTelecom.author()
43 | self.authorization = chinaTelecom.authorization
44 | self.ua = chinaTelecom.ua
45 | self.token = chinaTelecom.token
46 |
47 | def get_action_id(self, liveId):
48 | url = "https://appkefu.189.cn:8301/query/getWaresList"
49 | body = {
50 | "headerInfos": {
51 | "code": "getWaresList",
52 | "timestamp": datetime.now().__format__("%Y%m%d%H%M%S"),
53 | "broadAccount": "",
54 | "broadToken": "",
55 | "clientType": "#9.6.1#channel128#samsung SM-G9860#",
56 | "shopId": "20002",
57 | "source": "110003",
58 | "sourcePassword": "Sid98s",
59 | "token": self.token,
60 | "userLoginName": self.phone
61 | },
62 | "content": {
63 | "attach": "test",
64 | "fieldData": {
65 | "limit": "",
66 | "page": "1",
67 | "liveId": liveId
68 | }
69 | }
70 | }
71 | headers = {
72 | "User-Agent": self.ua,
73 | "authorization": self.authorization
74 | }
75 | data = post(url, headers=headers, json=body).json()
76 | try:
77 | for waresInfo in data["responseData"]["data"]["waresInfos"]:
78 | print(waresInfo["title"])
79 | if "转盘" in waresInfo["title"] or "抽奖" in waresInfo["title"]:
80 | active_code = findall(r"active_code\u003d(.*?)\u0026", waresInfo["link"])[0]
81 | return active_code
82 | return None
83 | except:
84 | return None
85 | def get_action_id_other(self, liveId):
86 | def encrypt_phone():
87 | result = ""
88 | for i in self.phone:
89 | result += chr(ord(i) + 2)
90 | return result
91 | url = "https://wapmkt.189.cn:8301/query/directSeedingInfo"
92 | body = {
93 | "headerInfos": {
94 | "code": "directSeedingInfo",
95 | "timestamp": datetime.now().__format__("%Y%m%d%H%M%S"),
96 | "broadAccount": "",
97 | "broadToken": "",
98 | "clientType": "#9.6.1#channel128#samsung SM-G9860#",
99 | "shopId": "20002",
100 | "source": "110003",
101 | "sourcePassword": "Sid98s",
102 | "token": self.token,
103 | "userLoginName": self.phone
104 | },
105 | "content": {
106 | "attach": "test",
107 | "fieldData": {
108 | "liveId": liveId,
109 | "account": encrypt_phone()
110 | }
111 | }
112 | }
113 | headers = {
114 | "User-Agent": self.ua,
115 | "authorization": self.authorization
116 | }
117 | data = post(url, headers=headers, json=body).json()["responseData"]["data"]
118 | try:
119 | if data["buoyLink"] is None:
120 | return None
121 | active_code = findall(r"active_code\u003d(.*?)\u0026", data["buoyLink"])[0]
122 | return active_code
123 | except:
124 | return None
125 | async def lotter(self, liveId, period):
126 | """
127 | :param liveId: 直播间id
128 | :param period: 某个参数 暂不明意义 查询直播间信息时会返回
129 | :return:
130 | """
131 | print_now(f"当前执行的直播间id为{liveId}")
132 | for i in range(2):
133 | # active_code1 查询直播间购物车中的大转盘活动id
134 | active_code1 = self.get_action_id(liveId)
135 | # active_code2 查询直播间非购物车 而是右上角的大转盘活动id
136 | active_code2 = self.get_action_id_other(liveId)
137 | if active_code1 is not None or active_code2 is not None:
138 | break
139 | print(f"此直播间暂无抽奖活动, 等待10秒后再次查询 剩余查询次数{2 - i}")
140 | await sleep(10)
141 | continue
142 | if active_code1 is None and active_code2 is None:
143 | print("查询结束 本直播间暂无抽奖活动")
144 | return
145 | elif active_code1 is None or active_code2 is None:
146 | active_code = active_code1 if active_code2 is None else active_code2
147 | active_code_list = [active_code]
148 | else:
149 | active_code_list = [active_code1, active_code2]
150 | for active_code in active_code_list:
151 | url = "https://xbk.189.cn/xbkapi/active/v2/lottery/do"
152 | body = {
153 | "active_code": active_code,
154 | "liveId": liveId,
155 | "period": period
156 | }
157 | headers = {
158 | "User-Agent": self.ua,
159 | "authorization": self.authorization
160 | }
161 | data = post(url, headers=headers, json=body).json()
162 | print(data)
163 | time_sleep(10)
164 | if data["code"] == 0:
165 | push("直播抽奖", f"{self.phone}: 获得了{data['data']['title']}")
166 | def find_price(self):
167 | url = "https://xbk.189.cn/xbkapi/active/v2/lottery/getMyWinList?page=1&give_status=200&activeCode="
168 | headers = {
169 | "User-Agent": self.ua,
170 | "authorization": self.authorization
171 | }
172 | data = get(url, headers=headers).json()
173 | if data["code"] == 0:
174 | all_price_list = data["data"]
175 | compare_date = lambda date: date.split("-")[1] == str((datetime.now() + timedelta(hours=8 - int(strftime("%z")[2]))).month)
176 | month_price = [f'{info["win_time"]}: {info["title"]}' for info in all_price_list if compare_date(info["win_time"])]
177 | month_price_info = "\n".join(month_price)
178 | print(month_price_info)
179 | push("本月直播奖品查询", f"{self.phone}:\n{month_price_info}")
180 | else:
181 | print(f"获取奖品信息失败, 接口返回" + str(data))
182 |
183 |
184 |
185 |
186 | def get_data():
187 | print('正在加载今日直播数据ing...')
188 | all_list = []
189 | code = 1
190 | msg_str = ""
191 | for i in range(35):
192 | if code < 10:
193 | code_str = '0' + str(code)
194 | else:
195 | code_str = str(code)
196 | url = f'https://xbk.189.cn/xbkapi/lteration/index/recommend/anchorRecommend?provinceCode={code_str}'
197 | random_phone = f"1537266{randint(1000, 9999)}"
198 | headers = {
199 | "referer": "https://xbk.189.cn/xbk/newHome?version=9.4.0&yjz=no&l=card&longitude=%24longitude%24&latitude=%24latitude%24&utm_ch=hg_app&utm_sch=hg_sh_shdbcdl&utm_as=xbk_tj&loginType=1",
200 | "user-agent": f"CtClient;9.6.1;Android;12;SM-G9860;{b64encode(random_phone[5:11].encode()).decode().strip('=+')}!#!{b64encode(random_phone[0:5].encode()).decode().strip('=+')}"
201 | }
202 | # print(url)
203 | data = requests.get(url, headers=headers).json()
204 | body = data["data"]
205 | for i in body:
206 | if time.strftime('%Y-%m-%d') in i['start_time']:
207 | if i not in all_list:
208 | print('今日开播时间:'+i['start_time']+' 直播间名称:'+i['nickname'] )
209 | print('安卓浏览器(如via、alook浏览器)直接打开链接 ctclient://startapp/android/open?LinkType=5&Link=https://xbk.189.cn/xbk/livingRoom?liveId='+str(i['liveId']) )
210 | print('通用打开方式,先登录:https://xbk.189.cn/xbk/newHome 然后直接打开 https://xbk.189.cn/xbk/livingRoom?liveId='+str(i['liveId']) )
211 | print('\n\n')
212 | msg_str += '今日开播时间:'+i['start_time']+' 直播间名称:'+i['nickname']+'\n1、安卓打开方式\n浏览器(如via、alook浏览器)直接打开链接:\nctclient://startapp/android/open?LinkType=5&Link=https://xbk.189.cn/xbk/livingRoom?liveId='+str(i['liveId'])+'\n2、通用打开方式\n先登录:\nhttps://xbk.189.cn/xbk/newHome\n然后直接打开链接:\nhttps://xbk.189.cn/xbk/livingRoom?liveId='+str(i['liveId'])+'\n\n'
213 | all_list.append(i)
214 | code += 1
215 | list = {}
216 | f = 1
217 | for i in all_list:
218 | list['liveRoom' + str(f)] = i
219 | f += 1
220 | print('直播数据加载完毕')
221 | print('\n\n')
222 | #发送消息
223 | send('电信星播客直播通知', msg_str)
224 | return list
225 |
226 |
227 |
228 |
229 |
230 | def main(phone, password):
231 | apiType = 1
232 | #切换使用直接加载方式
233 | data = getData
234 | # try:
235 | # url = "https://gitee.com/kele2233/genxin/raw/master/telecomLiveInfo.json"
236 | # data = get(url, timeout=5).json()
237 | # except:
238 | # print("主直播接口失效,进入备用抓包接口")
239 | # data = list_d
240 | # # try:
241 | # # url = "https://raw.githubusercontent.com/limoruirui/Hello-Wolrd/main/telecomLiveInfo.json"
242 | # # #url = "https://api.ruirui.fun/telecom/getLiveInfo"
243 | # # data = get(url, timeout=5).json()
244 | # # except:
245 | # # url = "https://xbk.189.cn/xbkapi/lteration/index/recommend/anchorRecommend?provinceCode=01"
246 | # # random_phone = f"1537266{randint(1000, 9999)}"
247 | # # headers = {
248 | # # "referer": "https://xbk.189.cn/xbk/newHome?version=9.4.0&yjz=no&l=card&longitude=%24longitude%24&latitude=%24latitude%24&utm_ch=hg_app&utm_sch=hg_sh_shdbcdl&utm_as=xbk_tj&loginType=1",
249 | # # "user-agent": f"CtClient;9.6.1;Android;12;SM-G9860;{b64encode(random_phone[5:11].encode()).decode().strip('=+')}!#!{b64encode(random_phone[0:5].encode()).decode().strip('=+')}"
250 | # # }
251 | # # data = get(url, headers=headers).json()
252 | # # apiType = 2
253 | print(data)
254 | liveListInfo = {}
255 | allLiveInfo = data.values() if apiType == 1 else data["data"]
256 | for liveInfo in allLiveInfo:
257 | if 1740 > timestamp(True) - int(mktime(strptime(liveInfo["start_time"], "%Y-%m-%d %H:%M:%S"))) + (
258 | 8 - int(strftime("%z")[2])) * 3600 > 0:
259 | liveListInfo[liveInfo["liveId"]] = liveInfo["period"]
260 | if len(liveListInfo) == 0:
261 | print("查询结束 没有近期开播的直播间")
262 | else:
263 | telecomLotter = TelecomLotter(phone, password)
264 | all_task = [telecomLotter.lotter(liveId, period) for liveId, period in liveListInfo.items()]
265 | run(wait(all_task))
266 | now = datetime.now()
267 | if now.hour == 12 + int(strftime("%z")[2]) and now.minute > 10:
268 | TelecomLotter(phone, password).find_price()
269 |
270 |
271 |
272 | def start(phone,password):
273 | if phone == "" or password == "":
274 | print("未填写相应变量 退出")
275 | exit(0)
276 | main(phone, password)
277 | print("\n")
278 |
279 |
280 |
281 |
282 | if __name__ == '__main__':
283 | getData = []
284 | # try:
285 | # url = "https://gitcode.net/weixin_52142858/telecomliveinfo/-/raw/master/telecomLiveInfo.json"
286 | # getData = get(url, timeout=5).json()
287 | # except:
288 | # #加载今日直播信息
289 | # print('主接口失效,使用备用接口中。。。。')
290 | # getData=get_data()
291 |
292 |
293 |
294 |
295 |
296 | l = []
297 | getData=get_data()
298 | # user_map = []
299 | # cklist = get_cookie("TELECOM_PHONE_PASSWORD")
300 | # for i in range(len(cklist)):
301 | # #以#分割开的ck
302 | # split1 = cklist[i].split("#")
303 | # if len(split1)>1:
304 | # for j in range(len(split1)):
305 | # split2 = split1[j].split("&")
306 | # if len(split2)>1:
307 | # user_map.append(split1[j])
308 | # else:
309 | # userinfo = cklist[i].split("&")
310 | # if len(userinfo)>1:
311 | # user_map.append(cklist[i])
312 |
313 |
314 |
315 | # for i in range(len(user_map)):
316 | # phone=""
317 | # password=""
318 | # userinfo = user_map[i].split("&")
319 | # if len(userinfo)>1:
320 | # phone = userinfo[0]
321 | # password = userinfo[1]
322 | # print('开始执行第{}个账号:{}'.format((i+1),phone))
323 | # if phone == "" or password == "":
324 | # print("当前账号未填写手机号或者密码 跳过")
325 | # print("\n")
326 | # continue
327 | # p = threading.Thread(target=start,args=(phone,password))
328 | # l.append(p)
329 | # p.start()
330 | # print("\n")
331 | # for i in l:
332 | # i.join()
333 |
--------------------------------------------------------------------------------
/backUp/txsp_vipRed.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3
2 | # -- coding: utf-8 --
3 | # -------------------------------
4 | # @Author : github@limoruirui https://github.com/limoruirui
5 | # @Time : 22/5/2022 10:48
6 | # -------------------------------
7 |
8 | """
9 | 1.腾讯视频每月领取会员天数红包 请低调使用 请不要用于商业牟利
10 | 2.活动时间为每个月的 8号到13号 的 10点到24点
11 | 3.活动期间内一天一次 每天限制领取两次 每个月限制次数暂时未知 请自行探索 请自行斟酌crontab
12 | 4.cookie获取方式
13 | 1.cookie可以用别人loon、qx等软件的mitm类自动获取再去boxjs里复制出来填写到环境变量或本脚本中
14 | 2.也可以自行抓包 电脑或者手机都可以 抓链接为https://access.video.qq.com/user/auth_refresh?的 要整段url和对应headers下的cookie
15 | 5.cookie食用方式: cookie和url都要整段 青龙运行可新建并分别放入到环境变量 V_COOKIE和V_REF_URL 中
16 | 6.推荐抓取腾讯视频app端随便一条链接的headers下的user-agent 并放入环境变量 TX_UA 中 不填写会使用随机的chrome浏览器的user-agent
17 | 7.推送支持tgbot和pushplus 会读取环境变量 青龙若之前有设置 则不需要额外设置
18 | """
19 | from random import randint
20 | from time import time, sleep
21 | from re import findall
22 | from os import environ, system
23 | from sys import exit, stdout
24 | from json import dumps, load
25 | from datetime import datetime
26 |
27 | try:
28 | from requests import Session, get, post
29 | from fake_useragent import UserAgent
30 | except:
31 | print(
32 | "你还没有安装requests库和fake_useragent库 正在尝试自动安装 请在安装结束后重新执行此脚本\n若还是提示本条消息 请自行运行pip3 install requests和pip3 install fake-useragent或者在青龙的依赖管理里安装python的requests和fake-useragent")
33 | system("pip3 install fake-useragent")
34 | system("pip3 install requests")
35 | print("安装完成 脚本退出 请重新执行")
36 | exit(0)
37 |
38 |
39 | class Txsp_vipRed:
40 | def __init__(self):
41 | self.cookie = environ.get("V_COOKIE")
42 | self.ref_url = environ.get("V_REF_URL")
43 | if self.cookie == "" or self.ref_url == "":
44 | self.print_now("未填写腾讯V_COOKIE或者V_REF_URL")
45 | exit(0)
46 |
47 | self.msg = ""
48 | self.actId = ""
49 | self.laisee_id = ""
50 | self.session = Session()
51 | self.ua = environ.get("TX_UA") if environ.get("TX_UA") else UserAgent().chrome
52 | self.own_ex = environ.get("TX_EGG_OWN") if environ.get("TX_EGG_OWN") else False
53 | self.headers = {
54 | "user-agent": self.ua
55 | }
56 |
57 | """推送相关"""
58 | self.pushplus_token = environ.get("PUSH_PLUS_TOKEN") if environ.get("PUSH_PLUS_TOKEN") else ""
59 | self.tgbot_token = environ.get("TG_BOT_TOKEN") if environ.get("TG_BOT_TOKEN") else ""
60 | self.tg_userId = environ.get("TG_USER_ID") if environ.get("TG_USER_ID") else ""
61 | self.tg_push_api = environ.get("TG_API_HOST") if environ.get("TG_API_HOST") else ""
62 |
63 | """工具"""
64 |
65 | def pushplus(self, title, content):
66 | url = "http://www.pushplus.plus/send"
67 | headers = {
68 | "Content-Type": "application/json"
69 | }
70 | data = {
71 | "token": self.pushplus_token,
72 | "title": title,
73 | "content": content
74 | }
75 | try:
76 | post(url, headers=headers, data=dumps(data))
77 | except:
78 | self.print_now('推送失败')
79 |
80 | def tgpush(self, content):
81 | url = f"https://api.telegram.org/bot{self.tgbot_token}/sendMessage"
82 | if self.tg_push_api != "":
83 | url = f"https://{self.tg_push_api}/bot{self.tgbot_token}/sendMessage"
84 | headers = {'Content-Type': 'application/x-www-form-urlencoded'}
85 | data = {'chat_id': str(self.tg_userId), 'text': content, 'disable_web_page_preview': 'true'}
86 | try:
87 | post(url, headers=headers, data=data, timeout=10)
88 | except:
89 | self.print_now('推送失败')
90 |
91 | def push(self, msg):
92 | if self.pushplus_token != "":
93 | self.pushplus("腾讯视频每月领取会员", msg)
94 | if self.tgbot_token != "" and self.tg_userId != "":
95 | self.tgpush(f"腾讯视频每月领取会员\n{msg}")
96 |
97 | def timestamp(self, short=False):
98 | if (short):
99 | return int(time())
100 | return int(time() * 1000)
101 |
102 | def print_now(self, content):
103 | print(content)
104 | stdout.flush()
105 |
106 | """重置cookie有效期"""
107 |
108 | def refresh_cookie(self):
109 | headers = {
110 | 'Referer': 'https://v.qq.com',
111 | "Cookie": self.cookie,
112 | "User-Agent": self.ua
113 | }
114 | req = self.session.get(self.ref_url, headers=headers)
115 | if req.headers.get("Set-Cookie") == None:
116 | if self.pushplus_token != "":
117 | self.pushplus("腾讯视频碰蛋活动", "cookie过期或填写错误")
118 | if self.tgbot_token != "" and self.tg_userId != "":
119 | self.tgpush(f"腾讯视频碰蛋活动\ncookie过期或填写错误")
120 | self.print_now("cookie过期或者填写错误, 退出")
121 | exit(0)
122 | # data = loads(req.text[42:-2])
123 | data = req.text
124 | # self.head = data["head"]
125 | # self.nickname = data["nick"]
126 | self.head = findall(r"\"head\":\"(.*?)\"", data)[0]
127 | self.nickname = findall(r"\"nick\":\"(.*?)\"", data)[0]
128 |
129 | def get_laisee_id(self):
130 | url = "https://api.ruirui.fun/txsp/get_laisee_id"
131 | try:
132 | data = get(url).json()
133 | if data.get("msg") == "success":
134 | self.print_now(f"获取到的助力码为{data['data']}")
135 | return data["data"]
136 | else:
137 | self.print_now("从获取助力码失败,最大可能是助力池为空")
138 | self.msg += "本次运行没有获取到红包码, 可能是池子为空"
139 | return False
140 | except:
141 | self.print_now("获取助力码失败, 可能是api炸了, 也可能你的网络有问题")
142 | return False
143 |
144 | def post_laisee_id(self, laisee_id):
145 | url = "https://api.ruirui.fun/txsp/post_laisee_id"
146 | body = {
147 | "laisee_id": laisee_id,
148 | "last_num": self.lastnum
149 | }
150 | headers = {
151 | "Content-Type": "application/json"
152 | }
153 | try:
154 | data = post(url, headers=headers, json=body).json()
155 | if data.get("data") == "success":
156 | self.msg += "互助码提交成功"
157 | self.print_now("互助码提交成功")
158 | except:
159 | self.print_now("互助码提交失败,跳过提交,获取助力码")
160 |
161 | def get_level(self):
162 | url = f'https://vip.video.qq.com/fcgi-bin/comm_cgi?name=payvip&cmd=1&otype=json&getannual=1&geticon=1&getsvip=1&g_tk=610014353&_={self.timestamp()}&callback=Zepto{self.timestamp()}'
163 | headers = {
164 | "referer": "https://film.qq.com/x/autovue/grade/?ptag=user.h5",
165 | "host": "vip.video.qq.com",
166 | "accept-encoding": "gzip, deflate, br",
167 | "user-agent": self.ua}
168 | response = self.session.get(url=url, headers=headers)
169 | response.encoding = "utf-8"
170 | try:
171 | level = response.text.split('level')[1].split(',')[0].split(':')[1]
172 | return level
173 | except:
174 | self.print_now("获取等级信息失败, 最大可能是cookie过期或者格式不对, 也可能为网络原因")
175 | exit(0)
176 |
177 | def getActId(self):
178 | url = 'https://film.qq.com/x/autovue/privilege/?pid=privilege&hidetitlebar=1&hidestatusbar=0&style=titlecolor%3D%23ffffff%26contentbkcolor%3D%23fdf6e2&aid=V0$$1:0$2:7$3:8.4.77.25550$4:0$8:4$12:&isDarkMode=0&uiType=MAX'
179 | headers = {
180 | 'User-Agent': 'Mozilla/5.0 (iPad; CPU OS 15_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Mobile/11A465 QQLiveBrowser /8.4.55 AppType/UN WebKitCore/WKWebView iOS GDTTangramMobSDK/4.370.6 GDTMobSDK/4.370.6 cellPhone/iPad 1G'
181 | }
182 | req = self.session.get(url, headers=headers)
183 | req.encoding = 'utf-8'
184 | actId = findall(r'"laiSeeActId":"(.*?)",', req.text)[0]
185 | if len(actId) == 26:
186 | return actId
187 | else:
188 | self.msg += '活动id获取失败,请检查'
189 | return None
190 |
191 | def check_lastnum(self, laisee_id):
192 | url = f"https://vip.video.qq.com/fcgi-bin/comm_cgi?name=spp_vipred_route_read&cmd=1&laisee_id={laisee_id}&otype=xjson&_ts={self.timestamp()}"
193 | headers = {
194 | "Referer": f"https://m.film.qq.com/magic-act/{self.actId}/index_index.html?ovscroll=0&page=index&isDarkMode=0&uiType=MAX",
195 | "User-Agent": self.ua
196 | }
197 | data = get(url, headers=headers).json()
198 | self.lastnum = int(data["total"]) - int(data["used"])
199 | if self.lastnum == 0:
200 | self.print_now("您本月的红包已被领完,暂不提交")
201 | return False
202 | return True
203 |
204 | def gen_laisee_id(self, actId):
205 | url = f'https://vip.video.qq.com/rpc/trpc.vip_red_group.vip_red_qualification.VipRedQualification/RedQualificationSend?rpc_data=%7B%22act_id%22:%22{actId}%22%7D'
206 | headers = {
207 | 'User-Agent': self.ua,
208 | 'Referer': 'https://film.qq.com/x/autovue/privilege/route/homepage/take?pid=privilege&hidetitlebar=1&hidestatusbar=0&style=titlecolor%3D%23ffffff%26contentbkcolor%3D%23fdf6e2&aid=V0%24%241%3A0%242%3A7%243%3A8.4.77.25550%244%3A0%248%3A4%2412%3A&isDarkMode=0&uiType=MAX'
209 | }
210 | data = self.session.get(url, headers=headers).json()
211 | order_id = data['orderid']
212 | # print(order_id)
213 | url2 = f'https://vip.video.qq.com/fcgi-bin/comm_cgi?callback=jQuery{randint(30000000000000000000, 39999999999999999999)}_{self.timestamp()}&name=spp_vipred_route_write&cmd=1&head={self.head}&nick={self.nickname}&order_id={order_id}&_={self.timestamp()}'
214 | # print(url2)
215 | data = self.session.get(url2, headers=headers).text
216 | self.print_now(data)
217 | try:
218 | self.laisee_id = findall(r'"laisee_id":"(.*?)",', data)[0]
219 | except:
220 | self.print_now("生成红包码失败, 可能是今天已经领完了, 请明天早上10点再来")
221 | self.laisee_id = ""
222 | if self.laisee_id != "":
223 | self.msg += f"腾讯视频红包分享链接,https://m.film.qq.com/magic-act/{actId}/1_index_index.html?ptag=redshare&redenvelopeId={self.laisee_id}&ovscroll=0&page=index 点击链接领取几天腾讯视频会员"
224 | return True
225 | else:
226 | return False
227 |
228 | def receive(self, laisee_id):
229 | url = f'https://vip.video.qq.com/fcgi-bin/comm_cgi?name=spp_vipred_route_write&cmd=2&laisee_id={laisee_id}&nick={self.nickname}&head={self.head}&act_id={self.actId}&otype=xjson&_ts={self.timestamp()}'
230 | headers = {
231 | 'Origin': 'https://m.film.qq.com',
232 | 'Accept-Encoding': 'gzip, deflate, br',
233 | 'Host': 'vip.video.qq.com',
234 | 'User-Agent': self.ua,
235 | 'Referer': f'https://m.film.qq.com/magic-act/{self.actId}/index_index.html?ovscroll=0&page=index&isDarkMode=0&uiType=MAX'
236 | }
237 | data = self.session.get(url, headers=headers).json()
238 | self.print_now(data)
239 | if "content" in data:
240 | receive_day = data["content"]
241 | self.print_now(f"领取成功, 获得{receive_day}天会员, 也可能是这个月已经领过的")
242 | self.msg += f"领取成功, 获得{receive_day}天会员, 也可能是这个月已经领过的"
243 | sleep(1)
244 | else:
245 | self.print_now("领取失败,此红包码已被领完或者你本日/本周/本月已领到上限")
246 |
247 | def main(self):
248 | today = datetime.today().day
249 | hour = datetime.today().hour
250 | if today < 8 or today > 13 or hour < 10:
251 | self.print_now("当前不在活动时间 活动时间为每个月的8号到13号的10点到24点")
252 | exit(0)
253 | self.refresh_cookie()
254 | self.actId = self.getActId()
255 | if self.actId is None:
256 | self.print_now(self.msg)
257 | self.push(self.msg)
258 | exit(0)
259 | if int(self.get_level()) >= 6:
260 | self.print_now("您当前账号大于等于6级, 领取红包码并分享")
261 | if self.gen_laisee_id(self.actId):
262 | if self.check_lastnum(self.laisee_id):
263 | self.post_laisee_id(self.laisee_id)
264 | laisee_id_list = self.get_laisee_id()
265 | if laisee_id_list:
266 | self.print_now(f"本次获取到的红包码为\n{laisee_id_list}")
267 | for laisee_id in laisee_id_list:
268 | self.receive(laisee_id)
269 | self.push(self.msg)
270 |
271 | if __name__ == '__main__':
272 | Txsp_vipRed().main()
273 | # test = Txsp_vipRed()
274 | # test.gen_laisee_id(actId="6iuw8rky3tsid022s4rf5iauqg")
275 |
--------------------------------------------------------------------------------
/backUp/txspegg.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3
2 | # -- coding: utf-8 --
3 | # -------------------------------
4 | # @Author : github@limoruirui https://github.com/limoruirui
5 | # @Time : 7/5/2022 20:48
6 | # -------------------------------
7 | """
8 | 1.腾讯视频碰蛋活动 请低调使用 请不要用于商业牟利
9 | 2.一天一次或者两次(推荐一次) (((若在每天的16点后运行且环境变量 TX_EGG_OWN 设置为true 则会自己的账号单独开一次(个人不是很建议这种做法 不找人碰不确定会不会加大黑号风险 请自行斟酌),)))
10 | 括号内的时间和变量必须同时满足才会自己碰自己 否则都是池子有码就碰池子 没有就上传你的码到池子 请自行斟酌设置crontab
11 | 3.cookie获取方式
12 | 1.cookie可以用别人loon、qx等软件的mitm类自动获取再去boxjs里复制出来填写到环境变量或本脚本中
13 | 2.也可以自行抓包 电脑或者手机都可以 抓链接为https://access.video.qq.com/user/auth_refresh?的 要整段url和对应headers下的cookie
14 | 4.cookie食用方式: cookie和url都要整段 青龙运行可新建并分别放入到环境变量 V_COOKIE和V_REF_URL 中
15 | 5.推荐抓取腾讯视频app端随便一条链接的headers下的user-agent 并放入环境变量 TX_UA 中 不填写会使用随机的chrome浏览器的user-agent
16 | 6.推送支持tgbot和pushplus 会读取环境变量 青龙若之前有设置 则不需要额外设置
17 | """
18 | from time import time, sleep, localtime
19 | from re import findall
20 | from os import environ, system
21 | from sys import exit, stdout
22 | from json import dumps
23 |
24 | try:
25 | from requests import Session, get, post
26 | from fake_useragent import UserAgent
27 | except:
28 | print(
29 | "你还没有安装requests库和fake_useragent库 正在尝试自动安装 请在安装结束后重新执行此脚本\n若还是提示本条消息 请自行运行pip3 install requests和pip3 install fake-useragent或者在青龙的依赖管理里安装python的requests和fake-useragent")
30 | system("pip3 install fake-useragent")
31 | system("pip3 install requests")
32 | print("安装完成 脚本退出 请重新执行")
33 | exit(0)
34 |
35 |
36 | class Txspegg:
37 | def __init__(self):
38 | self.cookie = environ.get("V_COOKIE")
39 | self.ref_url = environ.get("V_REF_URL")
40 | if self.cookie == "" or self.ref_url == "":
41 | self.print_now("未填写腾讯V_COOKIE或者V_REF_URL")
42 | exit(0)
43 |
44 | self.msg = ""
45 | self.session = Session()
46 | self.ua = environ.get("TX_UA") if environ.get("TX_UA") else UserAgent().chrome
47 | self.own_ex = environ.get("TX_EGG_OWN") if environ.get("TX_EGG_OWN") else False
48 | self.headers = {
49 | "user-agent": self.ua
50 | }
51 |
52 | """推送相关"""
53 | self.pushplus_token = environ.get("PUSH_PLUS_TOKEN") if environ.get("PUSH_PLUS_TOKEN") else ""
54 | self.tgbot_token = environ.get("TG_BOT_TOKEN") if environ.get("TG_BOT_TOKEN") else ""
55 | self.tg_userId = environ.get("TG_USER_ID") if environ.get("TG_USER_ID") else ""
56 | self.tg_push_api = environ.get("TG_API_HOST") if environ.get("TG_API_HOST") else ""
57 |
58 | """工具"""
59 |
60 | def pushplus(self, title, content):
61 | url = "http://www.pushplus.plus/send"
62 | headers = {
63 | "Content-Type": "application/json"
64 | }
65 | data = {
66 | "token": self.pushplus_token,
67 | "title": title,
68 | "content": content
69 | }
70 | try:
71 | post(url, headers=headers, data=dumps(data))
72 | except:
73 | self.print_now('推送失败')
74 |
75 | def tgpush(self, content):
76 | url = f"https://api.telegram.org/bot{self.tgbot_token}/sendMessage"
77 | if self.tg_push_api != "":
78 | url = f"https://{self.tg_push_api}/bot{self.tgbot_token}/sendMessage"
79 | headers = {'Content-Type': 'application/x-www-form-urlencoded'}
80 | data = {'chat_id': str(self.tg_userId), 'text': content, 'disable_web_page_preview': 'true'}
81 | try:
82 | post(url, headers=headers, data=data, timeout=10)
83 | except:
84 | self.print_now('推送失败')
85 |
86 | def timestamp(self, short=False):
87 | if (short):
88 | return int(time())
89 | return int(time() * 1000)
90 |
91 | def print_now(self, content):
92 | print(content)
93 | stdout.flush()
94 |
95 | """重置cookie有效期"""
96 |
97 | def refresh_cookie(self):
98 | headers = {
99 | 'Referer': 'https://v.qq.com',
100 | "Cookie": self.cookie,
101 | "User-Agent": self.ua
102 | }
103 | req = self.session.get(self.ref_url, headers=headers)
104 | if req.headers.get("Set-Cookie") == None:
105 | if self.pushplus_token != "":
106 | self.pushplus("腾讯视频碰蛋活动", "cookie过期或填写错误")
107 | if self.tgbot_token != "" and self.tg_userId != "":
108 | self.tgpush(f"腾讯视频碰蛋活动\ncookie过期或填写错误")
109 | self.print_now("cookie过期或者填写错误, 退出")
110 | exit(0)
111 |
112 | """碰了别人的则上报别人的次数+1 用于计数别人的蛋有没有碰完 暂时未使用 后续观察情况再说"""
113 | def egg_sharecode_success(self, sharecode):
114 | url = "https://api.ruirui.fun/txsp/egg_success"
115 | body = {
116 | "sharecode": sharecode
117 | }
118 | try:
119 | post(url, json=body)
120 | except:
121 | self.print_now("上报失败")
122 |
123 | def get_egg_sharecode(self):
124 | url = "https://api.ruirui.fun/txsp/get_egg_sharecode"
125 | try:
126 | data = get(url).json()
127 | if data.get("msg") == "success":
128 | self.print_now(f"获取到的助力码为{data['data']}")
129 | return data["data"]
130 | else:
131 | self.print_now("从获取助力码失败,最大可能是助力池为空, 会尝试将您的助力码提交到池中")
132 | return False
133 | except:
134 | self.print_now("获取助力码失败, 可能是api炸了, 也可能你的网络有问题")
135 | return False
136 |
137 | def post_sharecode(self):
138 | url = "https://api.ruirui.fun/txsp/post_egg_sharecode"
139 | body = {
140 | "sharecode": self.get_sharecode()
141 | }
142 | headers = {
143 | "Content-Type": "application/json"
144 | }
145 | try:
146 | data = post(url, headers=headers, json=body).json()
147 | if data.get("data") == "success":
148 | self.msg += "互助码提交成功"
149 | self.print_now("互助码提交成功")
150 | except:
151 | self.print_now("互助码提交失败,跳过提交,获取助力码")
152 |
153 | def get_level(self):
154 | url = f'https://vip.video.qq.com/fcgi-bin/comm_cgi?name=payvip&cmd=1&otype=json&getannual=1&geticon=1&getsvip=1&g_tk=610014353&_={self.timestamp()}&callback=Zepto{self.timestamp()}'
155 | headers = {
156 | "referer": "https://film.qq.com/x/autovue/grade/?ptag=user.h5",
157 | "host": "vip.video.qq.com",
158 | "accept-encoding": "gzip, deflate, br",
159 | "user-agent": self.ua}
160 | response = self.session.get(url=url, headers=headers)
161 | response.encoding = "utf-8"
162 | try:
163 | level = response.text.split('level')[1].split(',')[0].split(':')[1]
164 | return level
165 | except:
166 | self.print_now("获取等级信息失败, 最大可能是cookie过期或者格式不对, 也可能为网络原因")
167 | exit(0)
168 |
169 | def get_sharecode(self):
170 | url = f'https://vip.video.qq.com/fcgi-bin/comm_cgi?otype=xjson&name=spp_fulishe_eggs_collision&cmd=65391&actid=flspd_com&_st={self.timestamp()}'
171 | headers = {
172 | 'User-Agent': self.ua,
173 | 'Referer': 'https://film.qq.com/act/d2d-welfare/index.html?showMission=1&ptag=fuli.xrk&isDarkMode=0&uiType=MAX'
174 | }
175 | share_code = self.session.get(url, headers=headers).json()['data']['share_code']
176 | return share_code
177 |
178 | def get_egg(self):
179 | url = f'https://vip.video.qq.com/fcgi-bin/comm_cgi?otype=xjson&name=fulishe_eggs_adapter&cmd=1&actid=flspd_com&_st={self.timestamp()}'
180 | headers = {
181 | 'User-Agent': self.ua,
182 | 'Referer': 'https://film.qq.com/act/d2d-welfare/index.html?showMission=1&ptag=fuli.xrk&isDarkMode=0&uiType=MAX'
183 | }
184 | self.session.get(url, headers=headers)
185 |
186 | def get_egg_count(self):
187 | url = f'https://vip.video.qq.com/fcgi-bin/comm_cgi?otype=xjson&name=spp_fulishe_eggs_index&cmd=2&actid=flspd_com&_st={self.timestamp()}'
188 | headers = {
189 | 'User-Agent': self.ua,
190 | 'Referer': 'https://film.qq.com/act/d2d-welfare/index.html?showMission=1&ptag=fuli.xrk&isDarkMode=0&uiType=MAX'
191 | }
192 |
193 | return self.session.get(url, headers=headers).json()['data']['egg_count']
194 |
195 | def together(self, share_code):
196 | url = f'https://vip.video.qq.com/fcgi-bin/comm_cgi?otype=xjson&name=spp_fulishe_eggs_collision&cmd=65394&share_code={share_code}&_st={self.timestamp()}'
197 | headers = {
198 | 'User-Agent': self.ua,
199 | 'Referer': 'https://film.qq.com/act/d2d-welfare/index.html?showMission=1&ptag=fuli.xrk&isDarkMode=0&uiType=MAX'
200 | }
201 | data = self.session.get(url, headers=headers).json()
202 | if data['ret'] == -1019:
203 | self.print_now('您已经和他碰过了')
204 | return ""
205 | if data['ret'] == -1016:
206 | self.print_now('他已经没有蛋蛋了')
207 | return ""
208 | if data['ret'] == -1017:
209 | self.print_now('你已经没有蛋蛋了')
210 | return ""
211 | if data['ret'] == 0:
212 | try:
213 | own = data['data']['guest_lottery_info']['property_name']
214 | guest = data['data']['master_lottery_info']['property_name']
215 | result = f'你得到了{own}, 对方得到了{guest}'
216 | # self.egg_sharecode_success(share_code)
217 | self.print_now(result)
218 | self.msg += f'{result}\n'
219 | except:
220 | self.tgpush(data)
221 |
222 | def own(self):
223 | own_url = f'https://vip.video.qq.com/fcgi-bin/comm_cgi?otype=json&name=spp_fulishe_eggs_collision&cmd=65395&actid=flspd_com&_={self.timestamp()}&callback=Zepto{self.timestamp()}'
224 | headers = {
225 | 'User-Agent': self.ua,
226 | 'Referer': 'https://film.qq.com/act/d2d-welfare/index.html?showMission=1&ptag=fuli.xrk&isDarkMode=0&uiType=MAX'
227 | }
228 | html_data = self.session.get(own_url, headers=headers).text
229 | try:
230 | data = findall(r'"property_name":"(.*?)","property_result"', html_data)[0]
231 | self.msg += f'你得到了{data}'
232 | except:
233 | self.print_now("自己碰自己失败 可能为网络问题")
234 |
235 | def main(self):
236 | self.refresh_cookie()
237 | if int(self.get_level()) < 1:
238 | self.print_now("您当前账号不是腾讯视频会员, 无法参与")
239 | exit(0)
240 | if self.own_ex and localtime().tm_hour == 16:
241 | self.own()
242 | else:
243 | self.get_egg()
244 | sharecode_list = self.get_egg_sharecode()
245 | if sharecode_list != False:
246 | for sharecode in sharecode_list:
247 | if int(self.get_egg_count()) == 0:
248 | self.print_now("你已经没有蛋蛋了, 退出执行")
249 | self.msg = "你没有蛋蛋了"
250 | break
251 | self.together(sharecode)
252 | sleep(2)
253 | if int(self.get_egg_count()) > 0:
254 | self.post_sharecode()
255 | if self.msg == "互助码提交成功":
256 | self.msg += "\n本次执行没有碰到任何蛋,但是成功将互助码提交到了互助池,等待其它人碰即可"
257 | if self.msg == "":
258 | self.msg = "本次执行既没有碰到别人的蛋 也没能将您的助力码提交到池子 可能为池子服务器问题或者网络原因 请尝试重新提交"
259 | if self.pushplus_token != "":
260 | self.pushplus("腾讯视频碰蛋活动", self.msg)
261 | if self.tgbot_token != "" and self.tg_userId != "":
262 | self.tgpush(f"腾讯视频碰蛋活动\n{self.msg}")
263 |
264 | if __name__ == '__main__':
265 | Txspegg().main()
266 |
--------------------------------------------------------------------------------
/backUp/txspjfdh.py:
--------------------------------------------------------------------------------
1 | # !!!!!此脚本应该已不可用,更新了 需要逆向解密参数 没什么收益 懒得更新了 需要更新的话提issue再说吧
2 | #腾讯视频积分兑换任务,9积分换10成长值,一周一次(别问为什么写,问就是写完之前不知道是一周一次)
3 | #ck用签到ck,获取方法其它腾讯视频签到库有,两个参数分别填在33 34行内,多账号格式['xxx', 'yyy', 'zzz']
4 | #tg推送改15 16行参数
5 | from requests import get, post
6 | from random import choice
7 | from time import time
8 | from re import findall
9 | def get_ua(brower_name):
10 | url = 'https://raw.githubusercontent.com/limoruirui/misaka/master/user-agent.json'
11 | useragent = choice(get(url).json()[brower_name])
12 | return useragent
13 | def timestamp():
14 | return int(round(time()*1000))
15 | def tgpush(content):
16 | bot_token = ''
17 | user_id = ''
18 | url = f"https://api.telegram.org/bot{bot_token}/sendMessage"
19 | headers = {'Content-Type': 'application/x-www-form-urlencoded'}
20 | data = {'chat_id': str(user_id), 'text': content, 'disable_web_page_preview': 'true'}
21 | try:
22 | req = post(url, headers=headers, data=data)
23 | except:
24 | print('推送失败')
25 | def get_headers(ck, ua, Referer):
26 | headers = {
27 | 'Cookie':ck,
28 | 'User-Agent':ua,
29 | 'Referer': Referer
30 | }
31 | return headers
32 | def login():
33 | cookie_list = []
34 | ref_url_list = ['']
35 | ck_list = ['']
36 | login_list = zip(ref_url_list, ck_list)
37 | for ref_url, ck in login_list:
38 | headers_resetck = {
39 | 'Referer': 'https://v.qq.com',
40 | "Cookie":ck,
41 | "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Safari/605.1.15"
42 | }
43 | faul_num = 3
44 | while faul_num > 0:
45 | try:
46 | req = get(ref_url,headers=headers_resetck)
47 | if req.status_code == 200:
48 | try:
49 | vqq_vusession = req.headers['Set-Cookie'].split('vqq_vusession=')[1].split(';')[0]
50 | except:
51 | faul_num -= 1
52 | continue
53 | cookie = ck.split('vqq_vusession=')[0] + f'vqq_vusession={vqq_vusession};' + ck.split('vqq_vusession=')[1].split(';', 1)[1]
54 | cookie_list.append(cookie)
55 | break
56 | except:
57 | continue
58 | #return cookie_list[int(argv[1])]
59 | return cookie_list
60 | def jfye(ck, ua):
61 | url = f'https://vip.video.qq.com/fcgi-bin/comm_cgi?name=get_cscore&type=1&_={timestamp()}&callback=Zepto{timestamp()}'
62 | headers = {
63 | 'Cookie':ck,
64 | 'User-Agent':ua,
65 | 'Referer': 'https://film.qq.com/x/credit_mall/route/creditDetail?ptag=hlw.vmallscore'
66 | }
67 | jfye = findall(r'"vip_score_total":(.*?),', get(url, headers=headers).text)[0]
68 | return jfye
69 | def get_9list():
70 | for i in range(0, 3):
71 | url = 'https://film.qq.com/x/credit_mall/cgi/productListByModule?_param=%7B%22moduleId%22%3A%2220200710006728%22%2C%22page%22%3A1%2C%22page_size%22%3A15%7D'
72 | shop_data = get(url).json()['data'][i]
73 | if shop_data['uiRealCreditPrice'] <= 10:
74 | sProductId = shop_data['sProductId']
75 | return sProductId
76 | else:
77 | continue
78 | tgpush('本次运行未发现积分低于10的物品')
79 | def get_billno(ck, ua):
80 | url = f'https://vip.video.qq.com/fcgi-bin/comm_cgi?name=welfare_donate&g_vstk=1376497764&g_actk=3899139375&aid=V0%24%242%3A5%2412%3Ahlw.vmallscore%243%3A8.4.90%2434%3A1%248%3A4101&welfare_id={get_9list()}&score=1&remark=&_={timestamp()}&callback=Zepto{timestamp()}'
81 | Referer = f'https://film.qq.com/x/credit_mall/route/productDetail?productId={get_9list()}&ptag=hlw.vmallscore'
82 | billno = findall(r'"bill_no":"(.*?)",', get(url, headers=get_headers(ck, ua, Referer)).text)[0]
83 | return billno
84 | def exchange(ck, ua):
85 | url = f'https://vip.video.qq.com/fcgi-bin/comm_cgi?name=scores_exchange&cmd=61232&source=101&bill_no={get_billno(ck, ua)}&productid={get_9list()}&price=9&aid=V0%24%242%3A5%244%3A0%2412%3Ahlw.vmallscore%248%3A999%243%3A8.4.60%241%3A0%2434%3A1%248%3A4002&_={timestamp()}&callback=Zepto{timestamp()}'
86 | Referer = f'https://film.qq.com/x/credit_mall/route/productDetail?productId={get_9list()}&ptag=hlw.vmallscore'
87 | get(url, headers=get_headers(ck, ua, Referer))
88 | print(f'您当前拥有{jfye(ck, ua)}积分')
89 | def lingqu(ck, ua, account_numb):
90 | url = f'https://vip.video.qq.com/fcgi-bin/comm_cgi?name=spp_MissionFaHuo&cmd=4&task_id=8&_={timestamp()}&callback=Zepto{timestamp()}'
91 | Referer = 'https://v.qq.com'
92 | try:
93 | data = get(url, headers=get_headers(ck, ua, Referer)).text
94 | score = findall(r'"score":(.*?)}', data)[0]
95 | if score != 0:
96 | account_numb += 1
97 | except:
98 | print('周任务-积分兑换完成失败')
99 | return data
100 | def main():
101 | ck_list = login()
102 | account_numb = 0
103 | for ck in ck_list:
104 | ua = get_ua('Safari')
105 | data = lingqu(ck, ua, account_numb)
106 | if '已发过货' in data:
107 | print('此账号本周已领取,请下周再来')
108 | account_numb += 1
109 | elif '"score":' in data:
110 | print('领取成功')
111 | else:
112 | exchange(ck, ua)
113 | lingqu(ck, ua, account_numb)
114 | tgpush(f'本次运行周任务-积分兑换成功完成{account_numb}个账号')
115 | if __name__ == '__main__':
116 | main()
117 |
--------------------------------------------------------------------------------
/clean_log.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | echo "=================== start clean qinglong logs =========================="
3 |
4 | logs=$(find /var/log/nginx/*.log)
5 |
6 | for log in $logs;
7 | do
8 | echo "clean logs:"
9 | echo $log
10 | cat /dev/null> $log
11 | done
12 |
13 | echo "==================== end clean qinglong logs =========================="
14 |
--------------------------------------------------------------------------------
/iqiyi.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3
2 | # -- coding: utf-8 --
3 | # -------------------------------
4 | # @Author : github@limoruirui https://github.com/limoruirui
5 | # @Time : 5/5/2022 20:09
6 | # -------------------------------
7 | """
8 | 1.爱奇艺每日任务脚本 请低调使用 请不要用于商业牟利 一天一次 请自行斟酌设置crontab
9 | 2.cookie获取方式
10 | 1.cookie可以用别人loon、qx等软件的mitm类自动获取再去boxjs里复制出来填写到环境变量或本脚本中
11 | 2.也可以自行抓包 电脑或者手机都可以
12 | 3.实在都不会
13 | 3.cookie食用方式: 可以只保留P00001=xxx;中xxx的值 也可以整段都要 青龙运行可新建并放入到环境变量 iqy_ck 中 也可以直接填写在本脚本中
14 | 4.关于dfp
15 | 1.dfp相当于爱奇艺的浏览器指纹 不需要登录也会有 有效期非常长 实测半年多前的还能用 其中领取每日任务的奖励和刷观影时长都需要使用到
16 | 2.dfp目前本脚本写死了一个 但是多用户使用同一个不知道有没有风险
17 | 3.建议有能力的自己抓包 在cookie里的__dfp字段 然后环境变量新增 iqiyi_dfp 填入 或者在本脚本内写死
18 | 4.不会自己抓的话 请打开设置环境变量 get_iqiyi_dfp 为 True 再执行脚本会获得并输出到面板 请复制后按上一条填入环境变量 获取完请删除get_iqiyi_dfp环境变量 小鸡经不起操
19 | 5.get请求 没携带任何东西出去 开源脚本 请不要说什么提交什么东西到我服务器
20 | 5.库中有每月自动领取爱奇艺会员天数红包的脚本 可配合使用(需有高等级的运行脚本提供红包 其它人才可以领取)
21 | """
22 | cookie = ""
23 | iqiyi_dfp = ""
24 | from time import sleep, time
25 | from random import randint, choice
26 | from json import dumps
27 | from hashlib import md5 as md5Encode
28 | from string import digits, ascii_lowercase, ascii_uppercase
29 | from sys import exit, stdout
30 | from os import environ, system
31 | from re import findall
32 |
33 | try:
34 | from requests import Session, get, post
35 | from fake_useragent import UserAgent
36 | except:
37 | print(
38 | "你还没有安装requests库和fake_useragent库 正在尝试自动安装 请在安装结束后重新执行此脚本\n若还是提示本条消息 请自行运行pip3 install requests和pip3 install fake-useragent或者在青龙的依赖管理里安装python的requests和fake-useragent")
39 | system("pip3 install fake-useragent")
40 | system("pip3 install requests")
41 | print("安装完成 脚本退出 请重新执行")
42 | exit(0)
43 | iqy_ck = environ.get("iqy_ck") if environ.get("iqy_ck") else cookie
44 | get_iqiyi_dfp = environ.get("get_iqiyi_dfp") if environ.get("get_iqiyi_dfp") else False
45 | pushplus_token = environ.get("PUSH_PLUS_TOKEN") if environ.get("PUSH_PLUS_TOKEN") else ""
46 | tgbot_token = environ.get("TG_BOT_TOKEN") if environ.get("TG_BOT_TOKEN") else ""
47 | tg_userId = environ.get("TG_USER_ID") if environ.get("TG_USER_ID") else ""
48 | tg_push_api = environ.get("TG_API_HOST") if environ.get("TG_API_HOST") else ""
49 | if iqy_ck == "":
50 | print("未填写cookie 青龙可在环境变量设置 iqy_ck 或者在本脚本文件上方将获取到的cookie填入cookie中")
51 | exit(0)
52 | if "__dfp" in iqy_ck:
53 | iqiyi_dfp = findall(r"__dfp=(.*?)(;|$)", iqy_ck)[0][0]
54 | iqiyi_dfp = iqiyi_dfp.split("@")[0]
55 | if "P00001" in iqy_ck:
56 | iqy_ck = findall(r"P00001=(.*?)(;|$)", iqy_ck)[0][0]
57 | if iqiyi_dfp == "":
58 | iqiyi_dfp = environ.get("iqiyi_dfp") if environ.get(
59 | "iqiyi_dfp") else "a18af56a9b6a224272ab8ed00d1a587078cd5c8ab119b2a4a689d5a22f06bcbd8b"
60 |
61 |
62 | class Iqiyi:
63 | def __init__(self, ck, dfp):
64 | self.ck = ck
65 | self.session = Session()
66 | self.user_agent = UserAgent().chrome
67 | self.headers = {
68 | "User-Agent": self.user_agent,
69 | "Cookie": f"P00001={self.ck}",
70 | "Content-Type": "application/json"
71 | }
72 | self.dfp = dfp
73 | self.uid = ""
74 | self.msg = ""
75 | self.user_info = ""
76 | self.sleep_await = environ.get("sleep_await") if environ.get("sleep_await") else 1
77 |
78 | """工具"""
79 |
80 | def req(self, url, req_method="GET", body=None):
81 | data = {}
82 | if req_method.upper() == "GET":
83 | try:
84 | data = self.session.get(url, headers=self.headers, params=body).json()
85 | except:
86 | self.print_now("请求发送失败,可能为网络异常")
87 | # data = self.session.get(url, headers=self.headers, params=body).text
88 | return data
89 | elif req_method.upper() == "POST":
90 | try:
91 | data = self.session.post(url, headers=self.headers, data=dumps(body)).json()
92 | except:
93 | self.print_now("请求发送失败,可能为网络异常")
94 | # data = self.session.post(url, headers=self.headers, data=dumps(body)).text
95 | return data
96 | elif req_method.upper() == "OTHER":
97 | try:
98 | self.session.get(url, headers=self.headers, params=dumps(body))
99 | except:
100 | self.print_now("请求发送失败,可能为网络异常")
101 | else:
102 | self.print_now("您当前使用的请求方式有误,请检查")
103 |
104 | def timestamp(self, short=False):
105 | if (short):
106 | return int(time())
107 | return int(time() * 1000)
108 |
109 | def md5(self, str):
110 | m = md5Encode(str.encode(encoding='utf-8'))
111 | return m.hexdigest()
112 |
113 | def uuid(self, num, upper=False):
114 | str = ''
115 | if upper:
116 | for i in range(num):
117 | str += choice(digits + ascii_lowercase + ascii_uppercase)
118 | else:
119 | for i in range(num):
120 | str += choice(digits + ascii_lowercase)
121 | return str
122 |
123 | def pushplus(self, title, content):
124 | url = "http://www.pushplus.plus/send"
125 | headers = {
126 | "Content-Type": "application/json"
127 | }
128 | data = {
129 | "token": pushplus_token,
130 | "title": title,
131 | "content": content
132 | }
133 | try:
134 | post(url, headers=headers, data=dumps(data))
135 | except:
136 | self.print_now('推送失败')
137 |
138 | def tgpush(self, content):
139 | url = f"https://api.telegram.org/bot{tgbot_token}/sendMessage"
140 | if tg_push_api != "":
141 | url = f"https://{tg_push_api}/bot{tgbot_token}/sendMessage"
142 | headers = {'Content-Type': 'application/x-www-form-urlencoded'}
143 | data = {'chat_id': str(tg_userId), 'text': content, 'disable_web_page_preview': 'true'}
144 | try:
145 | post(url, headers=headers, data=data, timeout=10)
146 | except:
147 | self.print_now('推送失败')
148 |
149 | def print_now(self, content):
150 | print(content)
151 | stdout.flush()
152 |
153 | def get_dfp_params(self):
154 | get_params_url = "https://api.lomoruirui.com/iqiyi/get_dfp"
155 | data = get(get_params_url).json()
156 | return data
157 |
158 | def get_dfp(self):
159 | body = self.get_dfp_params()
160 | url = "https://cook.iqiyi.com/security/dfp_pcw/sign"
161 | headers = {
162 | "Accept": "*/*",
163 | "Accept-Encoding": "gzip, deflate, br",
164 | "Accept-Language": "zh-CN,zh;q=0.9",
165 | "Cache-Control": "no-cache",
166 | "Connection": "keep-alive",
167 | "Content-Length": "1059",
168 | "Content-Type": "application/x-www-form-urlencoded",
169 | "Host": "cook.iqiyi.com",
170 | "Origin": "https://www.iqiyi.com",
171 | "Pragma": "no-cache",
172 | "Referer": "https://www.iqiyi.com/",
173 | "sec-ch-ua": f"\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"{body['data']['sv']}\", \"Google Chrome\";v=\"{body['data']['sv']}\"",
174 | "sec-ch-ua-mobile": "?0",
175 | "sec-ch-ua-platform": "Windows",
176 | "Sec-Fetch-Dest": "empty",
177 | "Sec-Fetch-Mode": "cors",
178 | "Sec-Fetch-Site": "same-site",
179 | "User-Agent": self.user_agent
180 | }
181 | data = post(url, headers=headers, data=body["data"]["body"]).json()
182 | self.dfp = data["result"]["dfp"]
183 | self.print_now(self.dfp)
184 |
185 | def get_userinfo(self):
186 | url = f"https://tc.vip.iqiyi.com/growthAgency/v2/growth-aggregation?messageId={self.qyid}&platform=97ae2982356f69d8&P00001={self.ck}&responseNodes=duration%2Cgrowth%2Cupgrade%2CviewTime%2CgrowthAnnualCard&_={self.timestamp()}"
187 | data = self.req(url)
188 | msg = data['data']['growth']
189 | try:
190 | self.user_info = f"查询成功: 到期时间{msg['deadline']}\t当前等级为{msg['level']}\n\t今日获得成长值{msg['todayGrowthValue']}\t总成长值{msg['growthvalue']}\t距离下一等级还差{msg['distance']}成长值"
191 | self.print_now(self.user_info)
192 | except:
193 | self.user_info = f"查询失败,未获取到用户信息"
194 |
195 | """获取用户id"""
196 |
197 | def getUid(self):
198 | url = f'https://passport.iqiyi.com/apis/user/info.action?authcookie={self.ck}&fields=userinfo%2Cqiyi_vip&timeout=15000'
199 | data = self.req(url)
200 | if data.get("code") == 'A00000':
201 | self.uid = data['data']['userinfo']['pru']
202 | else:
203 | self.print_now("请求api失败 最大可能是cookie失效了 也可能是网络问题")
204 | self.tgpush("爱奇艺每日任务: 请求api失败 最大可能是cookie失效了 也可能是网络问题")
205 | exit(0)
206 |
207 | def get_watch_time(self):
208 | url = "https://tc.vip.iqiyi.com/growthAgency/watch-film-duration"
209 | data = self.req(url)
210 | watch_time = data['data']['viewtime']['time']
211 | return watch_time
212 |
213 | def get_sign(self):
214 | self.qyid = self.md5(self.uuid(16))
215 | time_stamp = self.timestamp()
216 | if self.uid == "":
217 | self.print_now("获取用户id失败 可能为cookie设置错误或者网络异常,请重试或者检查cookie")
218 | exit(0)
219 | data = f'agentType=1|agentversion=1|appKey=basic_pcw|authCookie={self.ck}|qyid={self.qyid}|task_code=natural_month_sign|timestamp={time_stamp}|typeCode=point|userId={self.uid}|UKobMjDMsDoScuWOfp6F'
220 | url = f'https://community.iqiyi.com/openApi/task/execute?agentType=1&agentversion=1&appKey=basic_pcw&authCookie={self.ck}&qyid={self.qyid}&sign={self.md5(data)}&task_code=natural_month_sign×tamp={time_stamp}&typeCode=point&userId={self.uid}'
221 | return url
222 |
223 | def getUrl(self, Time, dfp):
224 | return f'https://msg.qy.net/b?u=f600a23f03c26507f5482e6828cfc6c5&pu={self.uid}&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()}'
225 |
226 | def sign(self):
227 | url = self.get_sign()
228 | body = {
229 | "natural_month_sign": {
230 | "taskCode": "iQIYI_mofhr",
231 | "agentType": 1,
232 | "agentversion": 1,
233 | "authCookie": self.ck,
234 | "qyid": self.qyid,
235 | "verticalCode": "iQIYI"
236 | }
237 | }
238 | data = self.req(url, "post", body)
239 | # print(data)
240 | if data.get('code') == 'A00000':
241 | self.print_now(f"签到执行成功, {data['data']['msg']}")
242 | else:
243 | self.print_now("签到失败,原因可能是签到接口又又又又改了")
244 |
245 | def dailyTask(self):
246 | taskcodeList = {
247 | 'b6e688905d4e7184': "浏览生活福利",
248 | 'a7f02e895ccbf416': "看看热b榜",
249 | '8ba31f70013989a8': "每日观影成就",
250 | "freeGetVip": "浏览会员兑换活动",
251 | "GetReward": "逛领福利频道"}
252 | for taskcode in taskcodeList:
253 | # 领任务
254 | url = f'https://tc.vip.iqiyi.com/taskCenter/task/joinTask?P00001={self.ck}&taskCode={taskcode}&platform=b6c13e26323c537d&lang=zh_CN&app_lm=cn'
255 | if self.req(url)['code'] == 'A00000':
256 | # print(f'领取{taskcodeList[taskcode]}任务成功')
257 | sleep(10)
258 | # 完成任务
259 | url = f'https://tc.vip.iqiyi.com/taskCenter/task/notify?taskCode={taskcode}&P00001={self.ck}&platform=97ae2982356f69d8&lang=cn&bizSource=component_browse_timing_tasks&_={self.timestamp()}'
260 | if self.req(url)['code'] == 'A00000':
261 | # print(f'完成{taskcodeList[taskcode]}任务成功')
262 | sleep(2)
263 | # 领取奖励
264 | # url = f'https://tc.vip.iqiyi.com/taskCenter/task/getTaskRewards?P00001={self.ck}&taskCode={taskcode}&dfp={self.dfp}&platform=b6c13e26323c537d&lang=zh_CN&app_lm=cn&deviceID={self.md5(self.uuid(8))}&token=&multiReward=1&fv=bed99b2cf5722bfe'
265 | url = f"https://tc.vip.iqiyi.com/taskCenter/task/getTaskRewards?P00001={self.ck}&taskCode={taskcode}&lang=zh_CN&platform=b2f2d9af351b8603"
266 | try:
267 | price = self.req(url)['dataNew'][0]["value"]
268 | self.print_now(f"领取{taskcodeList[taskcode]}任务奖励成功, 获得{price}点成长值")
269 | except:
270 | self.print_now(f"领取{taskcodeList[taskcode]}任务奖励可能出错了 也可能没出错 只是你今天跑了第二次")
271 | sleep(5)
272 |
273 | def lottery_draw(self, lottery=True):
274 | """
275 | 查询剩余抽奖次数和抽奖
276 | True 抽
277 | False 查
278 | """
279 |
280 | url = "https://iface2.iqiyi.com/aggregate/3.0/lottery_activity"
281 | lottery_params = {
282 | "app_k": "0",
283 | "app_v": "0",
284 | "platform_id": 10,
285 | "dev_os": "2.0.0",
286 | "dev_ua": "COL-AL10",
287 | "net_sts": 1,
288 | "qyid": self.qyid,
289 | "psp_uid": self.uid,
290 | "psp_cki": self.ck,
291 | "psp_status": 3,
292 | "secure_v": 1,
293 | "secure_p": "0",
294 | "req_sn": self.timestamp()
295 | }
296 | # get_change_params = deepcopy(lottery_params)
297 | # get_change_params["lottery_chance"] = 1
298 | # params = get_change_params
299 | # if lottery:
300 | # params = lottery_params
301 | params = lottery_params
302 | data = self.req(url, "get", params)
303 | # if lottery and data.get("code") == 0:
304 | if data.get("code") == 0:
305 | self.print_now(f'抽奖成功, 获得{data["awardName"]}')
306 | return data["daysurpluschance"]
307 | elif data.get("code") == 3:
308 | self.print_now(f"抽奖成功, 但是获得奖励信息错误, 大概率是没用的开通会员优惠券")
309 | return data["daysurpluschance"]
310 | else:
311 | return 0
312 | # elif not lottery and data.get("code") == 0:
313 | # return data["daysurpluschance"]
314 |
315 | def start(self):
316 | self.print_now("正在执行刷观影时长脚本 为减少风控 本过程运行时间较长 大概半个小时")
317 | totalTime = self.get_watch_time()
318 | if totalTime >= 7200:
319 | self.print_now(f"你的账号今日观影时长大于2小时 不执行刷观影时长")
320 | return
321 | for i in range(150):
322 | Time = randint(60, 120)
323 | url = self.getUrl(Time, self.dfp)
324 | self.req(url, 'other')
325 | totalTime += Time
326 | sleep(randint(20, 40))
327 | if i % 20 == 3:
328 | self.print_now(f"现在已经刷到了{totalTime}秒, 数据同步有延迟, 仅供参考")
329 | if totalTime >= 7600:
330 | break
331 |
332 | def main(self):
333 | if get_iqiyi_dfp:
334 | self.get_dfp()
335 | self.getUid()
336 | self.get_sign()
337 | self.start()
338 | for i in range(10):
339 | change = self.lottery_draw()
340 | if int(change) == 0:
341 | break
342 | sleep(3)
343 | self.sign()
344 | self.dailyTask()
345 | self.print_now(f"任务已经执行完成, 因爱奇艺观影时间同步较慢,这里等待3分钟再查询今日成长值信息,若不需要等待直接查询,请设置环境变量名 sleep_await = 0 默认为等待")
346 | if int(self.sleep_await) == 1:
347 | sleep(180)
348 | self.get_userinfo()
349 | if pushplus_token != "":
350 | self.pushplus("爱奇艺每日任务签到", self.user_info)
351 | if tgbot_token != "" and tg_userId != "":
352 | self.tgpush(self.user_info)
353 |
354 |
355 | if __name__ == '__main__':
356 | iqiyi = Iqiyi(iqy_ck, iqiyi_dfp)
357 | iqiyi.main()
358 |
--------------------------------------------------------------------------------
/iqiyiRed.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3
2 | # -- coding: utf-8 --
3 | # -------------------------------
4 | # @Author : github@limoruirui https://github.com/limoruirui
5 | # @Time : 17/5/2022 19:26
6 | # -------------------------------
7 |
8 | """
9 | 1.爱奇艺每月领取会员天数红包脚本 请低调使用 请不要用于商业牟利
10 | 2.每个号每个月能领三个 会员等级大于等于5级可以发给别人领 请自行斟酌设置crontab
11 | 3.cookie获取方式
12 | 1.cookie可以用别人loon、qx等软件的mitm类自动获取再去boxjs里复制出来填写到环境变量或本脚本中
13 | 2.也可以自行抓包 电脑或者手机都可以, 已知电脑不顶号的情况下有效期为三个月
14 | 4.cookie食用方式: 可以只保留P00001=xxx;中xxx的值 也可以整段都要 青龙运行可新建并放入到环境变量 iqy_ck 中 也可以直接填写在本脚本中
15 | """
16 | cookie = ""
17 | from time import sleep, time
18 | from random import choice
19 | from json import dumps
20 | from hashlib import md5 as md5Encode
21 | from string import digits, ascii_lowercase, ascii_uppercase
22 | from sys import exit, stdout
23 | from os import environ, system
24 | from re import findall
25 |
26 | try:
27 | from requests import Session, get, post
28 | from fake_useragent import UserAgent
29 | except:
30 | print(
31 | "你还没有安装requests库和fake_useragent库 正在尝试自动安装 请在安装结束后重新执行此脚本\n若还是提示本条消息 请自行运行pip3 install requests和pip3 install fake-useragent或者在青龙的依赖管理里安装python的requests和fake-useragent")
32 | system("pip3 install fake-useragent")
33 | system("pip3 install requests")
34 | print("安装完成 脚本退出 请重新执行")
35 | exit(0)
36 | iqy_ck = environ.get("iqy_ck") if environ.get("iqy_ck") else cookie
37 | pushplus_token = environ.get("PUSH_PLUS_TOKEN") if environ.get("PUSH_PLUS_TOKEN") else ""
38 | tgbot_token = environ.get("TG_BOT_TOKEN") if environ.get("TG_BOT_TOKEN") else ""
39 | tg_userId = environ.get("TG_USER_ID") if environ.get("TG_USER_ID") else ""
40 | tg_push_api = environ.get("TG_API_HOST") if environ.get("TG_API_HOST") else ""
41 | if iqy_ck == "":
42 | print("未填写cookie 青龙可在环境变量设置 iqy_ck 或者在本脚本文件上方将获取到的cookie填入cookie中")
43 | exit(0)
44 | if "P00001" in iqy_ck:
45 | iqy_ck = findall(r"P00001=(.*?)(;|$)", iqy_ck)[0][0]
46 |
47 |
48 | class Iqiyi:
49 | def __init__(self, ck):
50 | self.ck = ck
51 | self.session = Session()
52 | self.user_agent = UserAgent().chrome
53 | self.headers = {
54 | "User-Agent": self.user_agent,
55 | "Cookie": f"P00001={self.ck}",
56 | "Content-Type": "application/json"
57 | }
58 | self.msg = ""
59 | self.redNo = ""
60 | self.last_num = 0
61 |
62 | """工具"""
63 |
64 | def req(self, url, req_method="GET", body=None):
65 | data = {}
66 | if req_method.upper() == "GET":
67 | try:
68 | data = self.session.get(url, headers=self.headers, params=body).json()
69 | except:
70 | self.print_now("请求发送失败,可能为网络异常")
71 | # data = self.session.get(url, headers=self.headers, params=body).text
72 | return data
73 | elif req_method.upper() == "POST":
74 | try:
75 | data = self.session.post(url, headers=self.headers, data=dumps(body)).json()
76 | except:
77 | self.print_now("请求发送失败,可能为网络异常")
78 | # data = self.session.post(url, headers=self.headers, data=dumps(body)).text
79 | return data
80 | elif req_method.upper() == "OTHER":
81 | try:
82 | self.session.get(url, headers=self.headers, params=dumps(body))
83 | except:
84 | self.print_now("请求发送失败,可能为网络异常")
85 | else:
86 | self.print_now("您当前使用的请求方式有误,请检查")
87 |
88 | def timestamp(self, short=False):
89 | if (short):
90 | return int(time())
91 | return int(time() * 1000)
92 |
93 | def md5(self, str):
94 | m = md5Encode(str.encode(encoding='utf-8'))
95 | return m.hexdigest()
96 |
97 | def uuid(self, num, upper=False):
98 | str = ''
99 | if upper:
100 | for i in range(num):
101 | str += choice(digits + ascii_lowercase + ascii_uppercase)
102 | else:
103 | for i in range(num):
104 | str += choice(digits + ascii_lowercase)
105 | return str
106 |
107 | def pushplus(self, title, content):
108 | url = "http://www.pushplus.plus/send"
109 | headers = {
110 | "Content-Type": "application/json"
111 | }
112 | data = {
113 | "token": pushplus_token,
114 | "title": title,
115 | "content": content
116 | }
117 | try:
118 | post(url, headers=headers, data=dumps(data))
119 | except:
120 | self.print_now('推送失败')
121 |
122 | def tgpush(self, content):
123 | url = f"https://api.telegram.org/bot{tgbot_token}/sendMessage"
124 | if tg_push_api != "":
125 | url = f"https://{tg_push_api}/bot{tgbot_token}/sendMessage"
126 | headers = {'Content-Type': 'application/x-www-form-urlencoded'}
127 | data = {'chat_id': str(tg_userId), 'text': content, 'disable_web_page_preview': 'true'}
128 | try:
129 | post(url, headers=headers, data=data, timeout=10)
130 | except:
131 | self.print_now('推送失败')
132 |
133 | def push(self, msg):
134 | if pushplus_token != "":
135 | self.pushplus("爱奇艺每月领取会员", msg)
136 | if tgbot_token != "" and tg_userId != "":
137 | self.tgpush(f"爱奇艺每月领取会员\n{msg}")
138 |
139 | def print_now(self, content):
140 | print(content)
141 | stdout.flush()
142 |
143 | """获取用户会员等级"""
144 |
145 | def get_level(self):
146 | url = f'https://passport.iqiyi.com/apis/user/info.action?authcookie={self.ck}&fields=userinfo%2Cqiyi_vip&timeout=15000'
147 | data = self.req(url)
148 | if data.get("code") == 'A00000':
149 | self.level = data['data']['qiyi_vip_info']['level']
150 | else:
151 | self.print_now("获取用户等级信息失败 最大可能是cookie失效了 也可能是网络问题")
152 | exit(0)
153 |
154 | def genRedNo(self):
155 | url = f"https://act.vip.iqiyi.com/level-right/red/gen?fv=b75a9b2a7d208020&P00001={self.ck}"
156 | data = self.req(url)
157 | code = data.get("code")
158 | if code == "A00000":
159 | self.redNo = data["data"]["redNo"]
160 | elif code == "B000205":
161 | self.print_now("当前账号本月已领取等级红包 直接查询")
162 | self.query_redNo()
163 |
164 | def query_redNo(self):
165 | url = f"https://act.vip.iqiyi.com/level-right/red/status?fv=b75a9b2a7d208020&P00001={self.ck}"
166 | data = self.req(url)
167 | code = data.get("code")
168 | if code == "A00000":
169 | self.redNo = data["data"][0]["redNo"]
170 |
171 | def last_redNo(self, redNo):
172 | url = f"https://act.vip.iqiyi.com/bonus/query/queryRed?redNo={redNo}"
173 | data = self.req(url)
174 | if data.get("code") == "A00000":
175 | last_num = data["data"]["totalNum"] - data["data"]["receivedNum"]
176 | return last_num
177 | else:
178 | return 0
179 |
180 | def post_redNo(self):
181 | url = "https://api.limoruirui.com/iqiyi/postRedNo"
182 | body = {
183 | "RedNo": self.redNo,
184 | "last_num": self.last_num
185 | }
186 | req = post(url, json=body)
187 | if req.status_code == 200:
188 | data = req.json()
189 | if data.get("data") == "success":
190 | self.print_now("已将您的红包码提交到助力池")
191 | self.msg += "已将您的红包码提交到助力池"
192 | else:
193 | self.print_now(data["data"])
194 | else:
195 | self.print_now("提交失败, 可能为池子服务器炸了, 请截图运行时间和日志反馈")
196 |
197 | def get_redNo(self):
198 | url = "https://api.limoruirui.com/iqiyi/getRedNo"
199 | req = get(url)
200 | if req.status_code == 200:
201 | data = req.json()
202 | if data["msg"] == "success":
203 | redNo_list = data["data"]
204 | else:
205 | self.print_now("当前池子红包码为空")
206 | redNo_list = []
207 | return redNo_list
208 | else:
209 | self.print_now("从池子获取红包码失败, 可能为池子服务器炸了, 请携带日志反馈")
210 | exit(0)
211 |
212 | def receive(self, redNo):
213 | url = f"https://act.vip.iqiyi.com/bonus/api/grabRed?accountType=2&P00001={self.ck}&redNo={redNo}"
214 | data = self.req(url)
215 | code = data.get("code")
216 | if code == "A00000":
217 | receiveDay = data["data"]["receiveDays"]
218 | self.print_now(f"领取成功, 获得{receiveDay}天会员")
219 | self.msg += f"领取成功, 获得{receiveDay}天会员\n"
220 | return False
221 | else:
222 | self.print_now(f"领取失败 原因是{data['msg']}")
223 | if "上限" in data["msg"]:
224 | return True
225 |
226 | def main(self):
227 | self.get_level()
228 | if int(self.level) >= 5:
229 | self.genRedNo()
230 | self.last_num = self.last_redNo(self.redNo)
231 | if self.last_num > 0:
232 | self.print_now(f"您的红包码为{self.redNo}, 正在尝试提交")
233 | self.post_redNo()
234 | else:
235 | self.print_now(f"您本月的会员红包已被领完, 不提交")
236 | redNo_list = self.get_redNo()
237 | if len(self.redNo) == 28 and len(redNo_list) > 6:
238 | redNo_list.insert(0, self.redNo)
239 | self.print_now(f"本次获取到的红包码为\n{redNo_list}")
240 | for redNo in redNo_list:
241 | if redNo == "":
242 | continue
243 | status = self.receive(redNo)
244 | if status:
245 | break
246 | sleep(2)
247 | if self.msg == "":
248 | self.msg = "本次运行啥都没有得到"
249 | self.push(self.msg)
250 |
251 |
252 | if __name__ == '__main__':
253 | iqiyi = Iqiyi(iqy_ck)
254 | iqiyi.main()
255 |
--------------------------------------------------------------------------------
/login/telecom_login.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3
2 | # -- coding: utf-8 --
3 | # -------------------------------
4 | # @Author : github@limoruirui https://github.com/limoruirui
5 | # @Time : 2022/10/24 17:52
6 | # -------------------------------
7 | """
8 | 营业厅登录获取token loginAuthCipherAsymmertric参数解密参考自 github@QGCliveDavis https://github.com/QGCliveDavis 感谢大佬
9 | """
10 | from requests import post
11 | from datetime import datetime
12 | from xml.etree.ElementTree import XML
13 | from uuid import uuid4
14 | from sys import path
15 | if "telecom_login" in __file__:
16 | path.append("../tools")
17 | from rsa_encrypt import RSA_Encrypt
18 | from encrypt_symmetric import Crypt
19 | from tool import print_now
20 | else:
21 | from tools.rsa_encrypt import RSA_Encrypt
22 | from tools.tool import print_now
23 | class TelecomLogin:
24 | def __init__(self, account, pwd):
25 | self.account = account
26 | self.pwd = pwd
27 | self.deviceUid = uuid4().hex
28 | def login(self):
29 | url = "https://appgologin.189.cn:9031/login/client/userLoginNormal"
30 | timestamp = datetime.now().__format__("%Y%m%d%H%M%S")
31 | key = "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBkLT15ThVgz6/NOl6s8GNPofd\nWzWbCkWnkaAm7O2LjkM1H7dMvzkiqdxU02jamGRHLX/ZNMCXHnPcW/sDhiFCBN18\nqFvy8g6VYb9QtroI09e176s+ZCtiv7hbin2cCTj99iUpnEloZm19lwHyo69u5UMi\nPMpq0/XKBO8lYhN/gwIDAQAB\n-----END PUBLIC KEY-----"
32 | body = {
33 | "headerInfos": {
34 | "code": "userLoginNormal",
35 | "timestamp": timestamp,
36 | "broadAccount": "",
37 | "broadToken": "",
38 | "clientType": "#9.6.1#channel50#iPhone 14 Pro Max#",
39 | "shopId": "20002",
40 | "source": "110003",
41 | "sourcePassword": "Sid98s",
42 | "token": "",
43 | "userLoginName": self.account
44 | },
45 | "content": {
46 | "attach": "test",
47 | "fieldData": {
48 | "loginType": "4",
49 | "accountType": "",
50 | "loginAuthCipherAsymmertric": RSA_Encrypt(key).encrypt(f"iPhone 14 15.4.{self.deviceUid[:12]}{self.account}{timestamp}{self.pwd}0$$$0.", b64=True),
51 | "deviceUid": self.deviceUid[:16],
52 | "phoneNum": self.get_phoneNum(self.account),
53 | "isChinatelecom": "0",
54 | "systemVersion": "15.4.0",
55 | "authentication": self.pwd
56 | }
57 | }
58 | }
59 | headers = {
60 | "user-agent": "iPhone 14 Pro Max/9.6.1",
61 |
62 | }
63 |
64 | data = post(url, headers=headers, json=body).json()
65 | code = data["responseData"]["resultCode"]
66 | if code != "0000":
67 | print_now("账号【"+self.account+"】,登陆失败,可能密码错误, 接口日志" + str(data))
68 | return None
69 | self.token = data["responseData"]["data"]["loginSuccessResult"]["token"]
70 | self.userId = data["responseData"]["data"]["loginSuccessResult"]["userId"]
71 | return True
72 |
73 | def get_ticket(self):
74 | url = "https://appgologin.189.cn:9031/map/clientXML"
75 | body = f"getSingle
\n