Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BillLi
ItChat
提交
6f7d63bd
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 搜索 >>
提交
6f7d63bd
编写于
6月 27, 2017
作者:
L
LittleCoder
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add limited warning
上级
86a3fefc
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
17 addition
and
5 deletion
+17
-5
README.md
README.md
+2
-0
itchat/components/login.py
itchat/components/login.py
+13
-3
itchat/config.py
itchat/config.py
+2
-2
未找到文件。
README.md
浏览文件 @
6f7d63bd
...
...
@@ -51,6 +51,8 @@ itchat.run()
这是一个基于这一项目的
[
开源小机器人
][
robot-source-code
]
,百闻不如一见,有兴趣可以尝试一下。
由于好友数量实在增长过快,自动通过好友验证的功能演示暂时关闭。
![
QRCode
][
robot-qr
]
## 截屏
...
...
itchat/components/login.py
浏览文件 @
6f7d63bd
...
...
@@ -59,7 +59,8 @@ def login(self, enableCmdQR=False, picDir=None, qrCallback=None,
break
if
isLoggedIn
:
break
logger
.
info
(
'Log in time out, reloading QR code.'
)
elif
self
.
isLogging
:
logger
.
info
(
'Log in time out, reloading QR code.'
)
else
:
return
# log in process is stopped by user
logger
.
info
(
'Loading the contact, this may take a little while.'
)
...
...
@@ -129,8 +130,10 @@ def check_login(self, uuid=None):
regx
=
r
'window.code=(\d+)'
data
=
re
.
search
(
regx
,
r
.
text
)
if
data
and
data
.
group
(
1
)
==
'200'
:
process_login_info
(
self
,
r
.
text
)
return
'200'
if
process_login_info
(
self
,
r
.
text
):
return
'200'
else
:
return
'400'
elif
data
:
return
data
.
group
(
1
)
else
:
...
...
@@ -171,6 +174,11 @@ def process_login_info(core, loginContent):
core
.
loginInfo
[
'wxuin'
]
=
core
.
loginInfo
[
'BaseRequest'
][
'Uin'
]
=
node
.
childNodes
[
0
].
data
elif
node
.
nodeName
==
'pass_ticket'
:
core
.
loginInfo
[
'pass_ticket'
]
=
core
.
loginInfo
[
'BaseRequest'
][
'DeviceID'
]
=
node
.
childNodes
[
0
].
data
if
not
all
([
key
in
core
.
loginInfo
for
key
in
(
'skey'
,
'wxsid'
,
'wxuin'
,
'pass_ticket'
)]):
logger
.
error
(
'Your wechat account may be LIMITED to log in WEB wechat, error info:
\n
%s'
%
r
.
text
)
core
.
isLogging
=
False
return
False
return
True
def
web_init
(
self
):
url
=
'%s/webwxinit?r=%s'
%
(
self
.
loginInfo
[
'url'
],
int
(
time
.
time
()))
...
...
@@ -252,6 +260,8 @@ def start_receiving(self, exitCallback=None, getReceivingFnOnly=False):
self
.
msgList
.
put
(
chatroomMsg
)
update_local_friends
(
self
,
otherList
)
retryCount
=
0
except
requests
.
exceptions
.
ReadTimeout
:
pass
except
:
retryCount
+=
1
logger
.
error
(
traceback
.
format_exc
())
...
...
itchat/config.py
浏览文件 @
6f7d63bd
import
os
,
platform
VERSION
=
'1.3.
7
'
VERSION
=
'1.3.
8
'
BASE_URL
=
'https://login.weixin.qq.com'
OS
=
platform
.
system
()
#Windows, Linux, Darwin
OS
=
platform
.
system
()
#
Windows, Linux, Darwin
DIR
=
os
.
getcwd
()
DEFAULT_QR
=
'QR.png'
TIMEOUT
=
(
10
,
60
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录