getqq=function(){ //获取登陆中的qq
import inet.http;
import inet;
import process;
url1="https://xui.ptlogin2.qq.com/cgi-bin/xlogin?appid=715030901&daid=371&pt_no_auth=1&s_url=https://buluo.qq.com/#"
url2="https://localhost.ptlogin2.qq.com:4301/pt_get_uins?callback=ptui_getuins_CB&r=0.11639253945250783&pt_local_tk="
for processEntry in process.each( "qq.exe" ) {
qq=processEntry.th32ProcessID
}
if qq==null return ;
http=inet.http()
http.get(url1)
cookie=inet.getCookie(url1) //取得COOKIE后获得pt_local_token
_,j=string.find(cookie,"pt_local_token=")
v=string.find(cookie,";",j)
pt_local_token=string.slice(cookie,j 1,v-1)
http.referer='https://buluo.qq.com/' //一定要设才让访问
ret=http.get(url2 pt_local_token) //用合法的token向本地端口访问取得qq的数据
ret=string.replace(ret,"@@];ptui_getuins_CB(var_sso_uin_list);","")
ret=string.replace(ret,"@@var var_sso_uin_list=[","")
json=web.json.parse(ret)
return json.nickname,json.account
}
————————————————
版权声明:本文为CSDN博主「steak123」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/steak123/article/details/120414026