import re
import requests
import hashlib
from base64 import b64decode
from Cryptodome.Cipher import AES
from binascii import unhexlify
def count_md5(input_string):
md5_obj = hashlib.md5()
md5_obj.update(input_string.encode(‘utf-8’))
md5_hash = md5_obj.hexdigest()
return md5_hash
def decrypt_aes(key_hex, ciphertext_b64):
key = unhexlify(key_hex)
iv = unhexlify(key_hex)
ciphertext = b64decode(ciphertext_b64)
cipher = AES.new(key, AES.MODE_CBC, iv)
decrypted_bytes = cipher.decrypt(ciphertext)
decrypted_text = decrypted_bytes
return re.findall(“(\d+)”,decrypted_text.decode(‘utf-8’))[0]
user_id = 1
url = f"https://profile.zjurl.cn/user/profile/homepage/share/v7/?app_name=news_article&user_id={user_id}"
response = requests.get(url).json()[‘data’]
log_id = response[‘log_id’]
seed = count_md5(log_id)
decrypt_md5 = count_md5(log_id + seed + log_id)
digg_count = decrypt_aes(decrypt_md5, response[‘digg_count’])
followers_count = decrypt_aes(decrypt_md5, response[‘followers_count’])
followings_count = decrypt_aes(decrypt_md5, response[‘followings_count’])
pgc_like_count = decrypt_aes(decrypt_md5, response[‘pgc_like_count’])
print(digg_count)
print(followers_count)
print(followings_count)
print(pgc_like_count)