import random
import math
import requests
import time
import execjs
def nonce_get():
a = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]
for i in range(500):
c = ''
for x in range(9):
e = math.floor(16 * random.random())
c += a[e]
return c
def user_login(n,p):
# 获取 nonce 值
nonce= nonce_get()
# flag 值
flag = str(time.time()).replace('.','')[:13] + str(random.random())
username = n
passwd = p
# password 值
jm = execjs.compile(open('jm.js','r').read())
password = jm.call('b',passwd)
password = jm.call('b',password+'daddy')
# xyz 值
xyz_str = "/xdnphb/login/new/usernameLogin?AppKey=joker&flag={}&identifyCode=&password={}&username={}&nonce={}".format(flag,password,use