本帖最后由 miracle1989 于 2024-9-8 21:23 编辑
本人通过论坛教程使用charles抓取了某app请求数据, 想分析其请求从而获取app中文章图片,但是发现获取的内容的是加密的,请教大佬下一步应该如何做呢?
:method: GET
:path: /v2.5/article/last/date
:authority: api.zbdk8ws.com
:scheme: https
content-type: application/x-www-form-urlencoded
uuid: 300b8ae9-1abc-3f12-a638-91df3888df7f
timestamp: 1725799776
ip: 0.0.0.0
user-key:
platform: 1
sign: 87139ff03cd1805938af9bbe997a8cbb
app-version: 2.4.0
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOjI5Nzg3MzMzLCJpc192aXNpdG9yIjoxLCJ1dWlkIjoiMzAwYjhhZTktMWFiYy0zZjEyLWE2MzgtOTFkZjM4ODhkZjdmIiwibmlja25hbWUiOiJcdTUxYWNcdTZjZjNcdTYwMmFcdTllM2Q4Mzk4OTc2IiwiaXAiOiIzNi4xMDEuMTI5Ljc2IiwiaWF0IjoxNzI1NTcyOTU0LCJleHAiOjE3MjYxODEzNTQsIm5iZiI6MTcyNTU3Mjk1NCwic3ViIjoiYXBpLjRjODZkMDMuY29tIiwianRpIjoiYzI1ZmFjN2I5YmQwNGEwMzU3ZDg3YjMwYzE1OGFlNzcifQ.KkwjCP7iXpyP-RIve7nlrHmxKqcwaovl-1w9NXgIyWk
accept-encoding: gzip
user-agent: okhttp/4.3.1
这是python代码[Asm] 纯文本查看 复制代码 import requests
import time
# 设置请求头
headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'uuid': '300b8ae9-1abc-3f12-a638-91df3888df7f',
'timestamp': str(int(time.time())), # 使用当前时间戳
'ip': '0.0.0.0',
'user-key': '',
'platform': '1',
'sign': '22b279fb0311c34b5893047938dc8481',
'app-version': '2.4.0',
'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOjI5Nzg3MzMzLCJpc192aXNpdG9yIjoxLCJ1dWlkIjoiMzAwYjhhZTktMWFiYy0zZjEyLWE2MzgtOTFkZjM4ODhkZjdmIiwibmlja25hbWUiOiJcdTUxYWNcdTZjZjNcdTYwMmFcdTllM2Q4Mzk4OTc2IiwiaXAiOiIzNi4xMDEuMTI5Ljc2IiwiaWF0IjoxNzI1NTcyOTU0LCJleHAiOjE3MjYxODEzNTQsIm5iZiI6MTcyNTU3Mjk1NCwic3ViIjoiYXBpLjRjODZkMDMuY29tIiwianRpIjoiYzI1ZmFjN2I5YmQwNGEwMzU3ZDg3YjMwYzE1OGFlNzcifQ.KkwjCP7iXpyP-RIve7nlrHmxKqcwaovl-1w9NXgIyWk',
'Accept-Encoding': 'gzip',
'User-Agent': 'okhttp/4.3.1'
}
# POST请求的URL
url = 'https://api.zbdk8ws.com/v2.5/article/last/date'
# 如果需要发送表单数据,则在这里定义
data = {
'Content-Type': 'application/x-www-form-urlencoded',
'uuid': '300b8ae9-1abc-3f12-a638-91df3888df7f',
'timestamp': str(int(time.time())), # 使用当前时间戳
'ip': '0.0.0.0',
'user-key': '',
'platform': '1',
'sign': '22b279fb0311c34b5893047938dc8481',
'app-version': '2.4.0',
'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOjI5Nzg3MzMzLCJpc192aXNpdG9yIjoxLCJ1dWlkIjoiMzAwYjhhZTktMWFiYy0zZjEyLWE2MzgtOTFkZjM4ODhkZjdmIiwibmlja25hbWUiOiJcdTUxYWNcdTZjZjNcdTYwMmFcdTllM2Q4Mzk4OTc2IiwiaXAiOiIzNi4xMDEuMTI5Ljc2IiwiaWF0IjoxNzI1NTcyOTU0LCJleHAiOjE3MjYxODEzNTQsIm5iZiI6MTcyNTU3Mjk1NCwic3ViIjoiYXBpLjRjODZkMDMuY29tIiwianRpIjoiYzI1ZmFjN2I5YmQwNGEwMzU3ZDg3YjMwYzE1OGFlNzcifQ.KkwjCP7iXpyP-RIve7nlrHmxKqcwaovl-1w9NXgIyWk',
'Accept-Encoding': 'gzip',
'User-Agent': 'okhttp/4.3.1'
} # 根据实际需求填充表单数据
# 发送POST请求
response = requests.post(url, headers=headers, data=data)
# 检查响应状态码
if response.status_code == 200:
print("请求成功!")
print(response.json()) # 假设响应是JSON格式
else:
print(f"请求失败,状态码:{response.status_code}")
print(response.text)
报错显示 :请求失败,状态码:406
{"code":406,"message":"Not Acceptable"}
|