From da1191fa298643b35ca253128bd8e64f0af8a86f Mon Sep 17 00:00:00 2001
From: lzx <93460847+lpxks@users.noreply.github.com>
Date: Thu, 2 Jan 2025 13:17:44 +0800
Subject: [PATCH] test multiple accounts
---
main.py | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/main.py b/main.py
index 0e96365..7216d61 100644
--- a/main.py
+++ b/main.py
@@ -47,16 +47,23 @@ def push(content):
print(f'[{email}] 进行登录...')
response = json.loads(session.post(url=login_url,headers=header,data=data).text)
print(response['msg'])
- # 获取账号名称
- # info_html = session.get(url=info_url,headers=header).text
- # info = "".join(re.findall('(.*?)', info_html, re.S))
+ # 获取之前的流量
+ remain_html = session.get(url=user_url,headers=header).text
+ #之前剩余流量
+ remain = re.findall('(.*?) GB', remain_html, re.S);
# 进行签到
result = json.loads(session.post(url=check_url,headers=header).text)
print(result['msg'])
content = result['msg']
+ #签到后获取剩余总流量
+ total_html = session.get(url = user_url,headers = header).text;
+ total = re.findall('(.*?) GB', total_html, re.S);
# 进行推送
+ content = email + '\n签到前剩余总流量: ' + remain[0] + 'GB\n' + content + '\n当前剩余总流量: ' + total[0] + 'GB';
push(content)
except:
- content = '签到失败'
- print(content)
- push(content)
+ total_html = session.get(url = user_url,headers = header).text;
+ total = re.findall('(.*?) GB', total_html, re.S);
+ content = '签到失败' + ',当前剩余总流量: ' + total + "GB"
+ print(content);
+ push(content);