Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

itchat.get_chatrooms(update=True)无法获取全部的群组列表,只能获取到活跃的群组,其他获取不到 #480

Closed
wu860 opened this issue Aug 14, 2017 · 4 comments
Labels

Comments

@wu860
Copy link

wu860 commented Aug 14, 2017

请使用itchat.run(debug=True)运行,并将输出粘贴在下面:
chatroomsList =itchat.get_chatrooms(update=True)
#time.sleep(10)
print chatroomsList
for chatroom in chatroomsList:
#time.sleep(20)
print chatroom["NickName"]
itchat.send(u'测试!!!,请勿回复!',chatroom['UserName'])

█
Start auto replying.
chatroom member fetch failed with @e421e218da99fd75690984a1f7e71b5c9ae8d7e037376c75ec9adb70b1f2f68b
No uins in 51 message
chatroom member fetch failed with @e421e218da99fd75690984a1f7e71b5c9ae8d7e037376c75ec9adb70b1f2f68b
No uins in 51 message
chatroom member fetch failed with @e421e218da99fd75690984a1f7e71b5c9ae8d7e037376c75ec9adb70b1f2f68b
No uins in 51 message
No uins in 51 message
chatroom member fetch failed with @e421e218da99fd75690984a1f7e71b5c9ae8d7e037376c75ec9adb70b1f2f68b
No uins in 51 message
chatroom member fetch failed with @e421e218da99fd75690984a1f7e71b5c9ae8d7e037376c75ec9adb70b1f2f68b
No uins in 51 message
loading login status succeeded.
[<Chatroom: {u'UserName': u'@@2e5c08983305ba369f260d0548085f9f644fca76fedba85a0c351c9d9a68f3a5', u'City': u'', u'DisplayName': u'', u'UniFriend': 0, 'Self': <User: {'UserName': u'@e421e218da99fd75690984a1f7e71b5c9ae8d7e037376c75ec9adb70b1f2f68b', 'City': '', 'DisplayName': '', 'UniFriend': 0, 'MemberList': <ContactList: []>, 'PYQuanPin': u'', 'RemarkPYInitial': u'', 'Sex': 1, 'AppAccountFlag': 0, 'VerifyFlag': 0, 'Province': '', 'KeyWord': '', 'RemarkName': u'', 'PYInitial': u'', 'ChatRoomId': 0, 'HideInputBarFlag': 0, u'HeadImgFlag': 1, 'EncryChatRoomId': '', 'AttrStatus': 0, u'WebWxPluginSwitch': 0, 'SnsFlag': 17, 'MemberCount': 0, 'OwnerUin': 0, 'Alias': '', 'Signature': u'', 'ContactFlag': 0, 'NickName': u'0day', 'RemarkPYQuanPin': u'', 'HeadImgUrl': u'/cgi-bin/mmwebwx-bin/webwxgeticon?seq=1509879885&username=@e421e218da99fd75690984a1f7e71b5c9ae8d7e037376c75ec9adb70b1f2f68b&skey=@crypt_e9f17604_332656f38762428fd611438b0096a603', 'Uin': 1184739341, 'StarFriend': 0, 'Statues': 0}>, 'MemberList': <ContactList: []>, u'PYQuanPin': u'', u'RemarkPYInitial': u'', u'Sex': 0, u'AppAccountFlag': 0, u'VerifyFlag': 0, u'Province': u'', u'KeyWord': u'', u'RemarkName': u'', u'PYInitial': u'', u'IsOwner': 0, u'ChatRoomId': 0, u'HideInputBarFlag': 0, u'EncryChatRoomId': u'', u'AttrStatus': 0, u'SnsFlag': 0, u'MemberCount': 59, u'OwnerUin': 0, u'Alias': u'', 'IsAdmin': None, u'Signature': u'', u'ContactFlag': 0, u'NickName': u'100\u7fa4LCF\u5e73\u5b89116\u7cfb\u7edfA80\u5927\u533a', u'RemarkPYQuanPin': u'', u'HeadImgUrl': u'/cgi-bin/mmwebwx-bin/webwxgetheadimg?seq=0&username=@@2e5c08983305ba369f260d0548085f9f644fca76fedba85a0c351c9d9a68f3a5&skey=@crypt_e9f17604_332656f38762428fd611438b0096a603', u'Uin': 0, u'StarFriend': 0, u'Statues': 0}>, <Chatroom: {u'UserName': u'@@bd13be874bf0b2f322ee1d67580db3131fb29636baba18419e6ed8c546309129', u'City': u'', u'DisplayName': u'', u'UniFriend': 0, 'Self': <User: {'UserName': u'@e421e218da99fd75690984a1f7e71b5c9ae8d7e037376c75ec9adb70b1f2f68b', 'City': '', 'DisplayName': '', 'UniFriend': 0, 'MemberList': <ContactList: []>, 'PYQuanPin': u'', 'RemarkPYInitial': u'', 'Sex': 1, 'AppAccountFlag': 0, 'VerifyFlag': 0, 'Province': '', 'KeyWord': '', 'RemarkName': u'', 'PYInitial': u'', 'ChatRoomId': 0, 'HideInputBarFlag': 0, u'HeadImgFlag': 1, 'EncryChatRoomId': '', 'AttrStatus': 0, u'WebWxPluginSwitch': 0, 'SnsFlag': 17, 'MemberCount': 0, 'OwnerUin': 0, 'Alias': '', 'Signature': u'', 'ContactFlag': 0, 'NickName': u'0day', 'RemarkPYQuanPin': u'', 'HeadImgUrl': u'/cgi-bin/mmwebwx-bin/webwxgeticon?seq=1509879885&username=@e421e218da99fd75690984a1f7e71b5c9ae8d7e037376c75ec9adb70b1f2f68b&skey=@crypt_e9f17604_332656f38762428fd611438b0096a603', 'Uin': 1184739341, 'StarFriend': 0, 'Statues': 0}>, 'MemberList': <ContactList: []>, u'PYQuanPin': u'', u'RemarkPYInitial': u'', u'Sex': 0, u'AppAccountFlag': 0, u'VerifyFlag': 0, u'Province': u'', u'KeyWord': u'', u'RemarkName': u'', u'PYInitial': u'', u'IsOwner': 0, u'ChatRoomId': 0, u'HideInputBarFlag': 0, u'EncryChatRoomId': u'', u'AttrStatus': 0, u'SnsFlag': 0, u'MemberCount': 222, u'OwnerUin': 0, u'Alias': u'', 'IsAdmin': None, u'Signature': u'', u'ContactFlag': 2, u'NickName': u'A\u4e07\u4e07\u6ca1\u60f3\u5230', u'RemarkPYQuanPin': u'', u'HeadImgUrl': u'/cgi-bin/mmwebwx-bin/webwxgetheadimg?seq=663538868&username=@@bd13be874bf0b2f322ee1d67580db3131fb29636baba18419e6ed8c546309129&skey=@crypt_e9f17604_332656f38762428fd611438b0096a603', u'Uin': 0, u'StarFriend': 0, u'Statues': 0}>, <Chatroom: {u'UserName': u'@e421e218da99fd75690984a1f7e71b5c9ae8d7e037376c75ec9adb70b1f2f68b', u'City': u'', u'DisplayName': u'', u'UniFriend': 0, 'Self': <User: {'UserName': u'@e421e218da99fd75690984a1f7e71b5c9ae8d7e037376c75ec9adb70b1f2f68b', 'City': '', 'DisplayName': '', 'UniFriend': 0, 'OwnerUin': 0, 'MemberList': <ContactList: []>, 'PYQuanPin': u'', 'RemarkPYInitial': u'', 'Uin': 1184739341, 'AppAccountFlag': 0, 'VerifyFlag': 0, 'Province': '', 'KeyWord': '', 'RemarkName': u'', 'PYInitial': u'', 'ChatRoomId': 0, 'HideInputBarFlag': 0, u'HeadImgFlag': 1, 'EncryChatRoomId': '', 'AttrStatus': 0, 'SnsFlag': 17, 'MemberCount': 0, u'WebWxPluginSwitch': 0, 'Alias': '', 'Signature': u'', 'ContactFlag': 0, 'NickName': u'0day', 'RemarkPYQuanPin': u'', 'HeadImgUrl': u'/cgi-bin/mmwebwx-bin/webwxgeticon?seq=1509879885&username=@e421e218da99fd75690984a1f7e71b5c9ae8d7e037376c75ec9adb70b1f2f68b&skey=@crypt_e9f17604_332656f38762428fd611438b0096a603', 'Sex': 1, 'StarFriend': 0, 'Statues': 0}>, 'MemberList': <ContactList: []>, u'PYQuanPin': u'', u'RemarkPYInitial': u'', u'Sex': 0, u'AppAccountFlag': 0, u'VerifyFlag': 0, u'Province': u'', u'KeyWord': u'', u'RemarkName': u'', u'PYInitial': u'', u'IsOwner': 0, u'ChatRoomId': 0, u'HideInputBarFlag': 0, u'EncryChatRoomId': u'', u'AttrStatus': 0, u'SnsFlag': 0, u'MemberCount': 0, u'OwnerUin': 0, u'Alias': u'', 'IsAdmin': None, u'Signature': u'', u'ContactFlag': 0, u'NickName': u'', u'RemarkPYQuanPin': u'', u'HeadImgUrl': u'', u'Uin': 0, u'StarFriend': 0, u'Statues': 0}>]
100群LCF平安116系统A80大区
Request to send a text message to @@2e5c08983305ba369f260d0548085f9f644fca76fedba85a0c351c9d9a68f3a5: 测试!!!,请勿回复!
A万万没想到
Request to send a text message to @@bd13be874bf0b2f322ee1d67580db3131fb29636baba18419e6ed8c546309129: 测试!!!,请勿回复!
Request to send a text message to @e421e218da99fd75690984a1f7e71b5c9ae8d7e037376c75ec9adb70b1f2f68b: 测试!!!,请勿回复!
succeed

itchat (1.3.9)使用pip安装,python2.7.12 x64 win7 x64
其他的内容或者问题更详细的描述都可以添加在下面:

我有许多个群组,但是只获取到这其中的两个群组。不能全部获取。只能获得比较活跃,常使用的群组。

@wu860 wu860 changed the title itchat.get_chatrooms(update=True)无法获取全部的群组列表 itchat.get_chatrooms(update=True)无法获取全部的群组列表,只能获取到部分活跃的群组 Aug 15, 2017
@wu860 wu860 changed the title itchat.get_chatrooms(update=True)无法获取全部的群组列表,只能获取到部分活跃的群组 itchat.get_chatrooms(update=True)无法获取全部的群组列表,只能获取到活跃的群组,其他获取不到 Aug 15, 2017
@mapleflow
Copy link

保存到通讯录,经常刷下活跃。

@gd-liuzhihua
Copy link

@mapleflow 是不是保存到通讯录,并且活跃的群才能获取到?

@littlecodersh
Copy link
Owner

@gd-liuzhihua 保存到通讯录和收到过消息的群。

@hupili
Copy link

hupili commented Sep 27, 2018

Ping back this thread for a quick solution, in case others also want to get the full list of group members: https://github.com/hupili/wechat-egonet/blob/master/scrape-wechat-egonet.py#L5

This generates a large volume of network traffic and wechat may not be happy with it. In my test, the program can sometimes output ~20K connections (about the size of my circle) but sometimes only up to 10K

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants