Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 7 additions & 1 deletion api/chaoxing.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
from base64 import b64encode
from hashlib import md5

from pyDes import des, PAD_PKCS5
import binascii


import requests
from requests.utils import dict_from_cookiejar

Expand Down Expand Up @@ -48,9 +52,11 @@ def login(self):
:return:
"""
url = "https://passport2.chaoxing.com/fanyalogin"
des_obj = des("u2oh6Vu^", "u2oh6Vu^", pad=None, padmode=PAD_PKCS5)
secret_bytes = des_obj.encrypt(self.passwd, padmode=PAD_PKCS5)
data = {"fid": "-1",
"uname": self.usernm,
"password": b64encode(self.passwd.encode("utf8")),
"password": binascii.b2a_hex(secret_bytes).decode("utf-8"),
"t": "true",
"forbidotherlogin": "0",
"validate": ""}
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ maskpass
natsort
requests
urllib3==1.25.11
pyDes