马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
import requests
session = requests.session()
post_url = "http://rrwapi.renren.com/account/v1/loginByPassword"
data = {"user":"13086186183"
,"password":"0b3011edc0c95732d0c9d9cf0d7be1a61"
,"appKey":"bcceb522717c2c49f895b561fa913d10"
,"sig":"2b9659a6d0fdf44a1cae821137146d13"
,"sessionKey":""
,"callId":"1621769695934"
}
headers = {"User-Agent":"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36"
,"Content-Type":"application/json;charset=UTF-8"
,"Content-Length":"194"
,"Accept":"application/json, text/plain, */*"
,"Accept-Encoding":"gzip, deflate"
,"Accept-Language":"zh-CN,zh;q=0.9"
,"Referer":"http://www.renren.com/"
,"Host":"rrwapi.renren.com"
,"Origin":"http://www.renren.com"
,"Connection":"keep-alive"
}
rep = session.post(url=post_url,data=data,headers=headers)
print(rep)
即使我把所有的请求头都打包过去都没用,求鱼油解惑!!!
没有人人网账号,初步分析登录请求,可以这样做,有可能后面还需要验证图形验证码才能登录成功。 # 人人网
import requests
import json
import time
import hashlib
url = 'http://rrwapi.renren.com/account/v1/loginByPassword'
headers = {
'Content-Type': 'application/json',
'User-Agent': 'Mozilla/5.0'
}
t = str(int(time.time() * 1000))
user = '12321321312'
password = '12345'
pwd = hashlib.md5(password.encode()).hexdigest()
data = {
'appKey': "bcceb522717c2c49f895b561fa913d10",
'callId': t,
'password': pwd,
'sessionKey': "",
'user': user
}
r = f'appKey=bcceb522717c2c49f895b561fa913d10callId{t}password={pwd}sessionKey=user={user}'
sig = hashlib.md5(r.encode()).hexdigest()
res = requests.post(url, headers=headers, data=json.dumps(data))
print(res.json)
|