这个东西很有用,平时习惯使用 QQ 互联登陆各式的网站和论坛,正常网站还好,其它的就不好说。如果稍不留意 QQ 就会被永封!
登陆
https://connect.qq.com/manage.html#/appauth/user 查看 QQ 授权详细。
环境
- Windows 10
- Python3
过程
- 安装 Python,勾选自动设置环境变量。
安装 Requests。下载压缩包 cmd.exe 进入该文件夹执行:
pip install .
新建 qq.py 脚本
#!/usr/bin/env python3 # License: Public Domain import requests session = requests.session() session.cookies.set("uin", "待填1") session.cookies.set("skey", "待填2") def fetch_auth_list(start, limit): response = session.get( "https://cgi.connect.qq.com/authmng/get_auth_app_list", headers={ "Referer": "https://connect.qq.com/manage.html", }, params={ "sort": "time", "apptype": "all", "token": 5381, "order": "desc", "start": start, "limit": limit, }, ) return response.json() def delete_connect(app_id): response = session.post( "https://cgi.connect.qq.com/authmng/del_app_auth", headers={ "Referer": "https://cgi.connect.qq.com/proxy.html?callback=1&id=1" }, data={ "appid": app_id, }, ) payload = response.json() print("AppID: %s, Message: %s" % (app_id, payload["msg"])) def main(): total = fetch_auth_list(0, 0)["result"]["total"] app_ids = set() for index in range(0, total, 20): apps = fetch_auth_list(index, 20)["result"]["data"] app_ids |= set(app["appid"] for app in apps) for app_id in sorted(app_ids): delete_connect(app_id) if __name__ == "__main__": main()
获取 uin 和 skey
a. Chrome 登陆 https://connect.qq.com
b. F12 - Application
c. 查看 Cookies 的 uin 和 skey
d. 修改脚本代码执行
python qq.py
即可C:\Users\Administrator\Desktop>python qq.py AppID: 200002, Message: ok AppID: 200004, Message: ok AppID: 200017, Message: ok AppID: 200034, Message: ok AppID: 200065, Message: ok AppID: 200079, Message: ok ...
更新 2019-04-15