给大家分享一个tt的互动数解密,挺简单的

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)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值