From 8901be40118becd7184fd2322833f8cc94e1f7ee Mon Sep 17 00:00:00 2001 From: takayama Date: Sun, 3 Oct 2021 22:05:20 +0900 Subject: [PATCH] Update web-api.md --- web-api.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/web-api.md b/web-api.md index 4b1ad5ad..8169006a 100644 --- a/web-api.md +++ b/web-api.md @@ -1,6 +1,6 @@ # QQ Web Api 收集 -web api 是需要 cookie 或 csrf-token 才可正常访问,用于实现一些扩展功能的 api +web api 是需要 cookie 或 csrf-token(bkn) 才可正常访问,用于实现一些扩展功能的 api 如果你知道一些尚未收集到的有用api,欢迎提交pr到这个文件 ---- @@ -9,24 +9,24 @@ web api 是需要 cookie 或 csrf-token 才可正常访问,用于实现一些 ```js let domain = ""; //支持qun.qq.com等多个domain -const cookie = (await client.getCookies(domain)).data.cookies; -const token = (await client.getCsrfToken()).data.token; +const cookie = client.cookies[domain]; +const bkn = client.bkn; // cookie需要设置在http请求头部 ``` |Name|Method|Url|Cookie|Domain| |-|-|-|-|-| |取QQ等级|GET|`https://club.vip.qq.com/api/vip/getQQLevelInfo?requestBody={"iUin":${QQ号}}`|YES|`vip.qq.com` -|取群资料|GET|`https://qinfo.clt.qq.com/cgi-bin/qun_info/get_group_info_all?gc=${群号}&bkn=${token}`
*※陌生群也可以获取*|YES|空 -|取群设置|GET|`https://qinfo.clt.qq.com/cgi-bin/qun_info/get_group_setting_v2?gc=${群号}&bkn=${token}`
*※必须是群员*|YES|空 -|取群操作记录|GET|`https://qinfo.clt.qq.com/cgi-bin/qun_info/get_sys_msg?gc=${群号}&bkn=${token}`
*※必须是管理员*|YES|空 +|取群资料|GET|`https://qinfo.clt.qq.com/cgi-bin/qun_info/get_group_info_all?gc=${群号}&bkn=${bkn}`
*※陌生群也可以获取*|YES|空 +|取群设置|GET|`https://qinfo.clt.qq.com/cgi-bin/qun_info/get_group_setting_v2?gc=${群号}&bkn=${bkn}`
*※必须是群员*|YES|空 +|取群操作记录|GET|`https://qinfo.clt.qq.com/cgi-bin/qun_info/get_sys_msg?gc=${群号}&bkn=${bkn}`
*※必须是管理员*|YES|空 |取QQ资料|GET|`https://cgi.find.qq.com/qqfind/buddy/search_v3?keyword=${QQ号}`|YES|空 -|开关匿名|GET|`https://qqweb.qq.com/c/anonymoustalk/set_anony_switch?bkn=${token}&value=${1或0}&group_code=${群号}`|YES|`qqweb.qq.com` +|开关匿名|GET|`https://qqweb.qq.com/c/anonymoustalk/set_anony_switch?bkn=${bkn}&value=${1或0}&group_code=${群号}`|YES|`qqweb.qq.com` |取群荣誉|GET|`https://qun.qq.com/interactive/qunhonor?gc=${群号}`|YES|`qun.qq.com` |精华消息|GET|`https://qun.qq.com/essence/index?gc=${群号}`|YES|`qun.qq.com` -|取群公告|GET|`https://web.qun.qq.com/cgi-bin/announce/get_t_list?bkn=${token}&qid=${群号}&ft=23&s=-1&n=20`|YES|`qun.qq.com`| -|发群公告|POST|`https://web.qun.qq.com/cgi-bin/announce/add_qun_notice?bkn=${token}`
POST数据:`qid=${群号}&bkn=${token}&text=${内容}&pinned=0&type=1&settings={"is_show_edit_card":1,"tip_window_type":1,"confirm_required":1}`|YES|`qun.qq.com` -|取群成员|GET|`https://qun.qq.com/cgi-bin/qun_mgr/search_group_members?gc=${群号}&st=${0}%end=${20}&sort=0&bkn=${token}`|YES|`qun.qq.com`| +|取群公告|GET|`https://web.qun.qq.com/cgi-bin/announce/get_t_list?bkn=${bkn}&qid=${群号}&ft=23&s=-1&n=20`|YES|`qun.qq.com`| +|发群公告|POST|`https://web.qun.qq.com/cgi-bin/announce/add_qun_notice?bkn=${bkn}`
POST数据:`qid=${群号}&bkn=${bkn}&text=${内容}&pinned=0&type=1&settings={"is_show_edit_card":1,"tip_window_type":1,"confirm_required":1}`|YES|`qun.qq.com` +|取群成员|GET|`https://qun.qq.com/cgi-bin/qun_mgr/search_group_members?gc=${群号}&st=${0}%end=${20}&sort=0&bkn=${bkn}`|YES|`qun.qq.com`| |取群头像|GET|`https://p.qlogo.cn/gh/${群号}/${群号}/${0(size)}`|NO|| |取群历史头像|GET|`https://p.qlogo.cn/gh/${群号}/${群号}_${1}/${0(size)}`|NO|| |取QQ头像|GET|`https://q1.qlogo.cn/g?b=qq&s=${0(size)}&nk=${QQ号}`|NO||