mirror of
https://github.com/daiyanan1992/qinglongtest
synced 2025-12-17 15:25:04 +08:00
Update LevelExch.py
修改自动获取等级id
This commit is contained in:
114
LevelExch.py
114
LevelExch.py
@@ -17,6 +17,8 @@
|
|||||||
task 后边是脚本所在目录/china_telecom.py conc TELECOM
|
task 后边是脚本所在目录/china_telecom.py conc TELECOM
|
||||||
3. 必须登录过 电信营业厅 app的账号才能正常运行
|
3. 必须登录过 电信营业厅 app的账号才能正常运行
|
||||||
"""
|
"""
|
||||||
|
import json
|
||||||
|
|
||||||
"""
|
"""
|
||||||
update:
|
update:
|
||||||
2022.10.25 参考大佬 github@QGCliveDavis https://github.com/QGCliveDavis 的 loginAuthCipherAsymmertric 参数解密 新增app登录获取token 完成星播客系列任务 感谢大佬
|
2022.10.25 参考大佬 github@QGCliveDavis https://github.com/QGCliveDavis 的 loginAuthCipherAsymmertric 参数解密 新增app登录获取token 完成星播客系列任务 感谢大佬
|
||||||
@@ -33,12 +35,25 @@ from base64 import b64encode
|
|||||||
from tools.aes_encrypt import AES_Ctypt
|
from tools.aes_encrypt import AES_Ctypt
|
||||||
from tools.rsa_encrypt import RSA_Encrypt
|
from tools.rsa_encrypt import RSA_Encrypt
|
||||||
from tools.tool import timestamp, get_environ, print_now
|
from tools.tool import timestamp, get_environ, print_now
|
||||||
from tools.send_msg import push
|
|
||||||
from login.telecom_login import TelecomLogin
|
from login.telecom_login import TelecomLogin
|
||||||
from string import ascii_letters, digits
|
from string import ascii_letters, digits
|
||||||
from tools.notify import send
|
from tools.notify import send
|
||||||
|
|
||||||
|
|
||||||
|
data = {}
|
||||||
|
try:
|
||||||
|
with open('权益id.log') as fr:
|
||||||
|
data = eval(fr.read())
|
||||||
|
except:
|
||||||
|
with open('权益id.log', 'w') as f:
|
||||||
|
pass
|
||||||
|
|
||||||
|
yf = datetime.now().strftime("%Y%m")
|
||||||
|
dd = datetime.now().strftime("%d")
|
||||||
|
# dd = '01'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ChinaTelecom:
|
class ChinaTelecom:
|
||||||
def __init__(self, account, pwd, checkin=True):
|
def __init__(self, account, pwd, checkin=True):
|
||||||
self.phone = account
|
self.phone = account
|
||||||
@@ -49,14 +64,13 @@ class ChinaTelecom:
|
|||||||
self.ticket = userLoginInfo[0]
|
self.ticket = userLoginInfo[0]
|
||||||
self.token = userLoginInfo[1]
|
self.token = userLoginInfo[1]
|
||||||
|
|
||||||
|
def getSign(self, tick):
|
||||||
def getSign(self,tick):
|
|
||||||
url = "https://wapside.189.cn:9001/jt-sign/ssoHomLogin"
|
url = "https://wapside.189.cn:9001/jt-sign/ssoHomLogin"
|
||||||
|
|
||||||
data = {'ticket': f'{tick}'}
|
data = {'ticket': f'{tick}'}
|
||||||
resp = get(url=url,params=data).json()
|
resp = get(url=url, params=data).json()
|
||||||
sign = resp["sign"]
|
sign = resp["sign"]
|
||||||
print(sign)
|
# print(sign)
|
||||||
return sign
|
return sign
|
||||||
|
|
||||||
def init(self):
|
def init(self):
|
||||||
@@ -93,13 +107,33 @@ class ChinaTelecom:
|
|||||||
return encrypt_text
|
return encrypt_text
|
||||||
|
|
||||||
|
|
||||||
|
def get_level(self):
|
||||||
|
|
||||||
|
url = "https://wapside.189.cn:9001/jt-sign/paradise/getLevelRightsList"
|
||||||
|
body = {
|
||||||
|
"para": self.telecom_encrypt(f'{{"phone":{self.phone}}}')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
rightsId = ''
|
||||||
|
levelStr = ['V4','V5','V6']
|
||||||
|
for str in levelStr:
|
||||||
|
right_list = self.req(url, "POST", body)[f"{str}"]
|
||||||
|
for data in right_list:
|
||||||
|
# print(dumps(data, indent=2, ensure_ascii=0))
|
||||||
|
if "话费" in data["righstName"]:
|
||||||
|
rightsId += f'{data["id"]}#'
|
||||||
|
|
||||||
|
print(rightsId)
|
||||||
|
return rightsId
|
||||||
|
# print(f'等级返回:{data}')
|
||||||
|
|
||||||
|
# print(self.rightsId)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# 每月领取等级金豆
|
# 每月领取等级金豆
|
||||||
def level_ex(self,rightsId):
|
def level_ex(self, rightsId):
|
||||||
# self.get_level()
|
# self.get_level()
|
||||||
now = datetime.now().strftime('%H:%M:%S.%f')
|
now = datetime.now().strftime('%H:%M:%S.%f')
|
||||||
url = "https://wapside.189.cn:9001/jt-sign/paradise/conversionRights"
|
url = "https://wapside.189.cn:9001/jt-sign/paradise/conversionRights"
|
||||||
@@ -111,51 +145,65 @@ class ChinaTelecom:
|
|||||||
print_now(f'{now}--Phone:{self.phone}--{resp}')
|
print_now(f'{now}--Phone:{self.phone}--{resp}')
|
||||||
|
|
||||||
|
|
||||||
|
def getId(self):
|
||||||
|
# global data
|
||||||
|
if yf not in data:
|
||||||
|
data[yf] = {}
|
||||||
|
|
||||||
|
str1 = self.get_level()
|
||||||
|
str2 = str1.split('#')
|
||||||
|
# print(str2)
|
||||||
|
for i in range(0, 3):
|
||||||
|
data[yf][f'{i + 4}'] = str2[i]
|
||||||
|
|
||||||
|
|
||||||
def main(self):
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def main(self,level):
|
||||||
|
global data
|
||||||
self.init()
|
self.init()
|
||||||
now = datetime.now().strftime('%H:%M:%S.%f')
|
if dd == '01':
|
||||||
#六级
|
self.getId()
|
||||||
rightsId = '38485966b5ff4360931f41b64fd8d517'
|
with open('权益id.log', 'w') as f:
|
||||||
#五级
|
f.write(json.dumps(data))
|
||||||
# rightsId = '0bea825669ee4a2dbf8ac32241b96856'
|
else:
|
||||||
start_time = time.time()
|
# now = datetime.now().strftime('%H:%M:%S.%f')
|
||||||
while 1==1:
|
# 六级
|
||||||
current_time = time.time()
|
# rightsId = 'c50d38e5ab9a4288b89d751357738408'
|
||||||
try:
|
rightsId = data[yf][level]
|
||||||
data = self.level_ex(rightsId)
|
print(rightsId)
|
||||||
except Exception as e:
|
start_time = time.time()
|
||||||
print(f"请求发送失败: " + str(e))
|
while 1 == 1:
|
||||||
|
current_time = time.time()
|
||||||
|
try:
|
||||||
|
data = self.level_ex(rightsId)
|
||||||
|
except Exception as e:
|
||||||
|
print(f"请求发送失败: " + str(e))
|
||||||
# # sleep(6)
|
# # sleep(6)
|
||||||
continue
|
continue
|
||||||
elapsed_time = current_time - start_time
|
elapsed_time = current_time - start_time
|
||||||
if elapsed_time >= 200: # 5分钟是300秒
|
if elapsed_time >= 200: # 5分钟是300秒
|
||||||
break
|
break
|
||||||
# for i in range(100):
|
|
||||||
|
|
||||||
|
|
||||||
# print_now(data)
|
|
||||||
# if data["code"] == "0":
|
|
||||||
# break
|
|
||||||
print('========================================================')
|
print('========================================================')
|
||||||
print('============================分隔符=======================')
|
print('============================分隔符=======================')
|
||||||
print('========================================================')
|
print('========================================================')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# 主方法与源文件不同;增加了多账号的判断;变量格式如下
|
# 主方法与源文件不同;增加了多账号的判断;变量格式如下
|
||||||
# TELECOM 13311111111@111111@10&13322222222@222222@10
|
# TELECOM 13311111111@111111@10&13322222222@222222@10
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
requests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS += 'HIGH:!DH:!aNULL'
|
requests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS += 'HIGH:!DH:!aNULL'
|
||||||
TELECOM = get_environ("chinaTelecomAccount")
|
TELECOM = get_environ("chinaTelecomAccount")
|
||||||
|
# TELECOM = '18751355555#322224#4'
|
||||||
users = TELECOM.split("&")
|
users = TELECOM.split("&")
|
||||||
for i in range(len(users)):
|
for i in range(len(users)):
|
||||||
user = users[i].split("#")
|
user = users[i].split("#")
|
||||||
phone = user[0]
|
phone = user[0]
|
||||||
password = user[1]
|
password = user[1]
|
||||||
|
levelid = user[2]
|
||||||
|
|
||||||
print(phone, password)
|
print(phone, password)
|
||||||
if phone == "":
|
if phone == "":
|
||||||
@@ -165,4 +213,4 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
telecom = ChinaTelecom(phone, password)
|
telecom = ChinaTelecom(phone, password)
|
||||||
telecom.main()
|
telecom.main(levelid)
|
||||||
|
|||||||
Reference in New Issue
Block a user