hexsum / Mojo-Webqq

【重要通知:WebQQ将在2019年1月1日停止服务,此项目目前已停止维护,感谢大家四年来的一路陪伴】使用Perl语言(不会没关系)编写的smartqq/webqq客户端框架(非GUI),可通过插件提供基于HTTP协议的api接口供其他语言或系统调用

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

获取不到群成员的qq号

winrey opened this issue · comments

环境是docker-compose直接拉取hub镜像部署的。刚去看了镜像17天前还更新过,应该能排除是没更新的问题。
使用的是md5密码登陆的方式,扫码过程中没有任何报错。

接口{{host}}/openqq/get_group_info返回是这样的:

[
    {
        "code": 120555xxx,
        "createtime": 1468635xxx,
        "id": 1375660xxx,
        "level": 0,
        "markname": null,
        "member": [
            {
                "card": "吃瓜群众",
                "city": "海淀",
                "client_type": "unknown",
                "country": "**",
                "id": 3207438xxx,
                "name": "Renne.",
                "province": "北京",
                "sex": "female",
                "state": "offline"
            }
        ],
        "memo": "群简介",
        "name": "群名",
        "owner_id": 2881432xxx,
        "owner_uid": 469762xxx,
        "role": "attend",
        "uid": 454710xxx
    }
]

群成员中没有Uid的项目。

猜测正是因此,receiver_uid 没有缓存的值,获取群消息后值返回为空

{
    'class': 'recv',
    'content': '。',
    'group': '测试',
    'group_id': 289936xxxx,
    'group_uid': 60924xxxx,
    'id': 64529,
    'post_type': 'receive_message',
    'receiver': 'test',
    'receiver_id': 23799xxxx,
    'receiver_uid': None,
    'sender': '我',
    'sender_id': 16xxxxxxxx,
    'sender_uid': None,
    'time': 1526738315,
    'type': 'group_message'
}

我去截包看了下官方qun.qq.com的接口
qun.qq.com使用的接口是:
POST https://qun.qq.com/cgi-bin/qun_mgr/search_group_members
gc=群号&st=0&end=20&sort=0&bkn=csrf_token
Cookies暂略
返回的数据大概是这样:

{
    "adm_max": 20,
    "adm_num": 9,
    "count": 881,
    "ec": 0,
    "levelname": {},
    "max_count": 2000,
    "mems": [{
            "card": "",
            "flag": 0,
            "g": 255,
            "join_time": 1445063165,
            "last_speak_time": 1526736663,
            "lv": {
                "level": 6,
                "point": 3341
            },
            "nick": "昵称",
            "qage": 13,
            "role": 0,
            "tags": "-1",
            "uin": QQ号
        }
    ],
    "search_count": 881,
    "svr_time": 1526745821,
    "vecsize": 5
}

不过在翻history的时候,好像原先使用的是这种方式,后来似乎是因为什么原因更换了成了http://qinfo.clt.qq.com/member.html这个接口?是不是这个功能被删除了?

不知道能不能帮上忙_(:з)∠)_

https://github.com/sjdy521/Mojo-Webqq/blob/6c1a9555cbb0795b76e0d346a7770c7f7aee83b9/lib/Mojo/Webqq/Model/Remote/_get_group_info_ext.pm#L63
我试了试这个接口,Cookie照抄了qun.qq.com里的,返回了一个404,不知道是我参数的问题还是腾讯的问题

<html>
    <head>
        <title>404 Not Found</title>
    </head>
    <body bgcolor="white">
        <center>
            <h1>404 Not Found</h1>
        </center>
        <hr>
        <center>nginx</center>
    </body>
</html>

image

@remini1998 非常抱歉,这么晚才看到你的issue,这个可能是目前存在的一个bug

试试先通过/openqq/get_group_info或者 /openqq/get_group_basic_info 来获取群号码

然后再通过 /openqq/search_group来获取指定群号码对应的群成员信息

这样的方式应该可以获取到群成员的uid

也可以加群讨论比较方便,官方QQ群: 498880156

@sjdy521 十分感谢。
辛苦啦