Update LevelExch.py

修了下id自动获取
This commit is contained in:
daiyanan1992
2024-12-11 19:24:30 +08:00
committed by GitHub
parent 12eddbb10f
commit 4922e2b81a

View File

@@ -95,23 +95,27 @@ dd = datetime.datetime.now().strftime("%d")
# dd = '01' # dd = '01'
def getId(phone,ck): def getId(phone,ck,session):
# global data # global data
if yf not in data: if yf not in data:
data[yf] = {} data[yf] = {}
str1 = get_level(phone,ck) str1 = get_level(phone,ck,session)
str2 = str1.split('#') str2 = str1.split('#')
# print(str2) # print(str2)
for i in range(0, 3): for i in range(0, 3):
data[yf][f'{i + 4}'] = str2[i] data[yf][f'{i + 4}'] = str2[i]
def get_level(phone,ck): def get_level(phone,ck,session):
url = "https://wapside.189.cn:9001/jt-sign/paradise/getLevelRightsList" try:
bd = js.call('main').split('=')
ck[bd[0]] = bd[1]
body = {"para": encrypt_para(f'{{"phone":{phone}}}')} body = {"para": encrypt_para(f'{{"phone":{phone}}}')}
right_list = requests.post("https://wapside.189.cn:9001/jt-sign/paradise/getLevelRightsList", json=body, str1 = session.post("https://wapside.189.cn:9001/jt-sign/paradise/getLevelRightsList", json=body,
cookies=ck).text cookies=ck).text
right_list_json = json.loads(right_list) right_list_json = json.loads(str1)
printn(right_list_json)
rightsId = '' rightsId = ''
levelStr = ['V4','V5','V6'] levelStr = ['V4','V5','V6']
@@ -127,6 +131,8 @@ def get_level(phone,ck):
print(rightsId) print(rightsId)
return rightsId return rightsId
except Exception as e:
print(e)
wxp = {} wxp = {}
@@ -360,26 +366,19 @@ def ks(phone, ticket,level, uid):
if rs: if rs:
# bd = js.call('main').split('=')
# ck[bd[0]] = bd[1]
# response_data = s.get('https://wapside.189.cn:9001/jt-sign/ssoHomLogin?ticket=' + ticket, cookies=ck).json()['sign']
# new_header = {
# "User-Agent": f"CtClient;9.6.1;Android;12;SM-G9860;{base64.b64encode(phone[5:11].encode()).decode().strip('=+')}!#!{base64.b64encode(phone[0:5].encode()).decode().strip('=+')}",
# "Referer": "https://wapside.189.cn:9001/resources/dist/signInActivity.html",
# "sign":response_data}
# s.headers.update(new_header)
if dd == '01' or dirsize == 0:
getId(phone,ck)
with open('权益id.log', 'w') as f:
f.write(json.dumps(data))
print('再跑一次脚本')
rightsId = data[yf][level]
sign = getSign(ticket, s) sign = getSign(ticket, s)
new_header = { new_header = {
"User-Agent": f"CtClient;9.6.1;Android;12;SM-G9860;{base64.b64encode(phone[5:11].encode()).decode().strip('=+')}!#!{base64.b64encode(phone[0:5].encode()).decode().strip('=+')}", "User-Agent": f"CtClient;9.6.1;Android;12;SM-G9860;{base64.b64encode(phone[5:11].encode()).decode().strip('=+')}!#!{base64.b64encode(phone[0:5].encode()).decode().strip('=+')}",
"Referer": "https://wapside.189.cn:9001/resources/dist/signInActivity.html", "Referer": "https://wapside.189.cn:9001/resources/dist/signInActivity.html",
"sign": sign} "sign": sign}
s.headers.update(new_header) s.headers.update(new_header)
if dd == '01' or dirsize == 0:
getId(phone,ck,s)
with open('权益id.log', 'w') as f:
f.write(json.dumps(data))
print('再跑一次脚本')
rightsId = data[yf][level]
start_time = time.time() start_time = time.time()
while 1 == 1: while 1 == 1:
current_time = time.time() current_time = time.time()
@@ -445,11 +444,10 @@ def main():
chinaTelecomAccount = os.environ.get('chinaTelecomAccount') chinaTelecomAccount = os.environ.get('chinaTelecomAccount')
else: else:
print('添加chinaTelecomAccount环境变量啊') print('添加chinaTelecomAccount环境变量啊')
# chinaTelecomAccount = '18811118888@111111@6'
for i in chinaTelecomAccount.split('&'): for i in chinaTelecomAccount.split('&'):
i = i.split('@') i = i.split('#')
phone = i[0] phone = i[0]
password = i[1] password = i[1]
level = i[2] level = i[2]