Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BillLi
ItChat
提交
c58174e1
I
ItChat
项目概览
BillLi
/
ItChat
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
ItChat
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
c58174e1
编写于
1月 23, 2017
作者:
L
LittleCoder
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix bugs caused by strange contact return values [PR#208: lostdragon]
上级
71d5c572
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
15 addition
and
6 deletion
+15
-6
docs/tutorial/tutorial1.md
docs/tutorial/tutorial1.md
+4
-3
itchat/components/contact.py
itchat/components/contact.py
+11
-3
未找到文件。
docs/tutorial/tutorial1.md
浏览文件 @
c58174e1
...
...
@@ -30,7 +30,7 @@ Python与基本的网络基础都不困难,所以即使没有这方面基础
![
QRCode
](
http://7xrip4.com1.z0.glb.clouddn.com/ItChat%2FQRCode2.jpg?imageView/2/w/400/
)
##本部分所需环境
##
本部分所需环境
本文是这一教程的第一部分,需要配置抓包与Python环境。
...
...
@@ -59,6 +59,7 @@ Wireshark是常见的抓包软件,这里通过一些配置抓取微信网页
我们都登录过网页端微信,没有的话可以现在做一个尝试:
[
微信网页端
](
https://wx.qq.com
)
。
这个过程简单而言可以分为如下几步:
1.
向服务器提供一些用于获取二维码的数据
1.
服务器返回二维码
1.
向服务器询问二维码扫描状态
...
...
@@ -313,9 +314,9 @@ print('Log in as %s'%dic['User']['NickName'])
那么做一个小练习好了,测试一下学到的东西:读取命令行的输入并发送给自己。(这部分的源码放在了文末)
##具体运用时可能遇到的难点
##
具体运用时可能遇到的难点
###命令行登录一段时间后无法与服务器正常交互
###
命令行登录一段时间后无法与服务器正常交互
这是因为微信网页端存在心跳机制,一段时间不交互将会断开连接。
...
...
itchat/components/contact.py
浏览文件 @
c58174e1
...
...
@@ -173,8 +173,10 @@ def update_local_friends(core, l):
'''
fullList
=
core
.
memberList
+
core
.
mpList
for
friend
in
l
:
utils
.
emoji_formatter
(
friend
,
'NickName'
)
utils
.
emoji_formatter
(
friend
,
'DisplayName'
)
if
'NickName'
in
friend
:
utils
.
emoji_formatter
(
friend
,
'NickName'
)
if
'DisplayName'
in
friend
:
utils
.
emoji_formatter
(
friend
,
'DisplayName'
)
oldInfoDict
=
utils
.
search_dict_list
(
fullList
,
'UserName'
,
friend
[
'UserName'
])
if
oldInfoDict
is
None
:
...
...
@@ -223,7 +225,13 @@ def update_local_uin(core, msg):
update_chatroom
(
core
,
username
)
newChatroomDict
=
utils
.
search_dict_list
(
core
.
chatroomList
,
'UserName'
,
username
)
newChatroomDict
[
'Uin'
]
=
uin
if
newChatroomDict
is
None
:
newChatroomDict
=
utils
.
struct_friend_info
({
'UserName'
:
username
,
'Uin'
:
uin
,
})
core
.
chatroomList
.
append
(
newChatroomDict
)
else
:
newChatroomDict
[
'Uin'
]
=
uin
elif
'@'
in
username
:
update_friend
(
core
,
username
)
newFriendDict
=
utils
.
search_dict_list
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录