import base64
import json
from Crypto.Cipher import AES
import random
from Crypto.Util.Padding import pad, unpad
key = 'G$$QawckGfaLB97r'
iv = 'qqqwwwwasszxsazs'
data = {"query":"java","cityCode":101010100,"salaryId":"","experienceId":"","pageNum":1,"limit":15}
text = json.dumps(data).encode()
aes = AES.new(key.encode(),AES.MODE_CBC,iv.encode())
encrypt_data = aes.encrypt(pad(text,16))
res =base64.b64encode(encrypt_data).decode().replace('/','_').replace('+','-').replace('=','~')
url = "https://www.kanzhun.com/api_to/search/job.json"
import requests
headers = {
'User-Agent':
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36'
}
params = {
"kiv":iv,
"b":res
}
ret = requests.get(url=url,headers=headers,params=params)
data = ret.text
aes1 = AES.new(key.encode(),AES.MODE_CBC,iv.encode())
de_data = aes1.decrypt(base64.b64decode(data.encode()))
en_data = unpad(de_data,16).decode()
print(json.loads(en_data))