Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

更新了登录接口 #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions xuechebu_crack.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
import os

import requests
import hashlib

USER = ['驾校帐号', '密码']
USER = ['', '']
USER_INFO_CORRECT = True


Expand Down Expand Up @@ -82,19 +83,23 @@ def get_should_chapter(session):


def login(session, username, password):
url = 'http://api.xuechebu.com/user/stulogin'
url = 'https://api.xuechebu.com/usercenter/userinfo/login'

m = hashlib.md5()
m.update(password.encode('utf-8'))

data = {
'username': username,
'password': password,
'passwordmd5': m.hexdigest(),
'callback': 'tfrnghub',
'os': 'pc'
}

try:
r = session.post(url, data)
data = get_response_data(r)

print('登录成功! 姓名: {}, 驾校: {}.'.format(data['xm'], data['jxmc']))
print('登录成功! 姓名: {}, 驾校: {}.'.format(data['XM'], data['JXMC']))
return True

except Exception as e:
Expand Down