coldnight / twqq

An asynchronous WebQQ client library based on tornado
Other
53 stars 29 forks source link

启用网页验证验证码后,出错,返回信息如下 #4

Closed mofelee closed 10 years ago

mofelee commented 10 years ago

[E 140508 21:50:53 web:1357] Uncaught exception POST / (127.0.0.1) HTTPRequest(protocol='http', host='127.0.0.1:8000', method='POST', uri='/', version='HTTP/1.1', remoteip='127.0.0.1', headers={'Origin': 'http://127.0.0.1:8000', 'Content-Length': '34', 'Accept-Language': 'zh-CN,zh;q=0.8,en;q=0.6', 'Accept-Encoding': 'gzip,deflate,sdch', 'Host': '127.0.0.1:8000', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/_;q=0.8', 'User-Agent': 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.132 Safari/537.36', 'Connection': 'keep-alive', 'Referer': 'http://127.0.0.1:8000/', 'Cache-Control': 'max-age=0', 'Content-Type': 'application/x-www-form-urlencoded'}) Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/tornado-3.2.1-py2.7-linux-i686.egg/tornado/web.py", line 1244, in _stack_context_handle_exception raise_exc_info((type, value, traceback)) File "/usr/local/lib/python2.7/dist-packages/tornado-3.2.1-py2.7-linux-i686.egg/tornado/stack_context.py", line 302, in wrapped ret = fn(_args, _kwargs) File "build/bdist.linux-i686/egg/twqq/hub.py", line 488, in _wrap func(resp, data, _args, _kwargs) File "build/bdist.linux-i686/egg/twqq/requests.py", line 228, in callback if data.get("retcode") != 0: AttributeError: 'str' object has no attribute 'get' [E 140508 21:50:53 web:1780] 500 POST / (127.0.0.1) 37303.14ms

mofelee commented 10 years ago

等等,可能是我这边的权限问题。。。我再试试

coldnight commented 10 years ago

这个错误可能是我判断不够, 参见下面两个 commit: https://github.com/coldnight/twqq/commit/2d57cb8f27f8fd81bb3f3807ef94264c21e322b3 https://github.com/coldnight/twqq/commit/5c81eae42ac10861d82f79c2f154f9f8fbc4444b

mofelee commented 10 years ago

但是我取消了,好像都登录不进去。昨天都好好的。。。

mofelee commented 10 years ago

[E 140508 22:22:37 ioloop:491] Exception in callback <functools.partial object at 0xa1ca39c> Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/tornado-3.2.1-py2.7-linux-i686.egg/tornado/ioloop.py", line 477, in _run_callback callback() File "/usr/local/lib/python2.7/dist-packages/tornado-3.2.1-py2.7-linux-i686.egg/tornado/stack_context.py", line 331, in wrapped raise_exc_info(exc) File "/usr/local/lib/python2.7/dist-packages/tornado-3.2.1-py2.7-linux-i686.egg/tornado/stack_context.py", line 302, in wrapped ret = fn(_args, *_kwargs) File "/home/mofe/PycharmProjects/qqbot/twqq/hub.py", line 493, in _wrap f(request, resp, data) File "/home/mofe/PycharmProjects/qqbot/webqq.py", line 149, in handle_login_errorcode if data.get("retcode") != 0: AttributeError: 'str' object has no attribute 'get'

coldnight commented 10 years ago

判断一下吧, data 不是一个json, 可能是个提示信息, 把它输出出来.

mofelee commented 10 years ago

data里的内容

'<html><h1>Error occured:</h1><pre>{{case_clause,{invalid_json,"lexical error: invalid char in json text.\\n"}},
 [{application_util,invoke,3},
  {api_web,loop,2},
  {mochiweb_http,headers,4},
  {proc_lib,init_p_do_apply,3}]}</pre></html>'
coldnight commented 10 years ago

貌似是 Erlang 啊, 看不懂. 这个哪个url返回的.

mofelee commented 10 years ago

输入完验证码就出现这个,我设置了一个断点在data的位置。不设置断点就会出现前面那个错误

coldnight commented 10 years ago

输完验证码貌似没有 json 数据提交到服务器. 这个错误有点怪... 我这边的测试账号不能遇到验证码. 测不了. 等会找个账号抓包分析下. 是不是验证码这块协议改了.

mofelee commented 10 years ago

你都没有验证码?我每次都出现验证码。。。你是群里的“呼吸”吗?我申请了个帐号,每次都有验证码。。

coldnight commented 10 years ago

不是... 新账号密保不全的话会有验证码, 跑一段时间就好了.

mofelee commented 10 years ago

好的,如果需要我这个有验证码的帐号,我可以把帐号密码发到你邮箱里。

coldnight commented 10 years ago

你确认你处理的方法没有问题? 我刚才测了一下. 有验证码的也可以正常登录, 没有问题.

mofelee commented 10 years ago

我试试重新拉一次代码再吧。

mofelee commented 10 years ago
/usr/bin/python2.7 /home/mofe/PycharmProjects/qqpunch/webqq.py
/home/mofe/PycharmProjects/qqpunch/twqq/requests.py:286: UserWarning: In next version we will rename twqq.requests.FreindInfoRequest to twqq.requests.FriendListRequest
  warnings.warn("In next version we will rename twqq.requests.FreindInfoRequest "
[I 140509 11:26:40 requests:46] 获取 login_sig...
* About to connect() to ui.ptlogin2.qq.com port 443 (#0)
*   Trying 101.226.103.81... * Connected to ui.ptlogin2.qq.com (101.226.103.81) port 443 (#0)
* found 164 certificates in /etc/ssl/certs/ca-certificates.crt
*    server certificate verification SKIPPED
*    common name: xui.ptlogin2.qq.com (matched)
*    server certificate expiration date OK
*    server certificate activation date OK
*    certificate public key: RSA
*    certificate version: #3
*    subject: serialNumber=fTF4II7BwxWodn9hFQw1em2LNDJRH4r/,C=CN,ST=guangdong,L=shenzhen,O=Shenzhen Tencent Computer Systems Company Limited,OU=R&D,CN=xui.ptlogin2.qq.com
*    start date: Sun, 14 Jul 2013 14:07:37 GMT
*    expire date: Sat, 16 Jul 2016 11:01:55 GMT
*    issuer: C=US,O=GeoTrust\, Inc.,CN=GeoTrust SSL CA
*    compression: NULL
*    cipher: AES-256-CBC
*    MAC: SHA1
> GET /cgi-bin/login?daid=164&target=self&style=5&mibao_css=m_webqq&appid=1003903&enable_qlogin=0&no_verifyimg=1&s_url=http%3A%2F%2Fweb2.qq.com%2Floginproxy.html&f_url=loginerroralert&strong_login=1&login_state=10&t=20130723001 HTTP/1.1
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/28.0.1500.71 Chrome/28.0.1500.71 Safari/537.36
Host: ui.ptlogin2.qq.com
Accept: */*
Accept-Encoding: gzip,deflate
Accept-Charset: UTF-8,*;q=0.5
Connection: keep-alive

< HTTP/1.1 200 OK
< Server: nginx/1.4.7
< Date: Fri, 09 May 2014 03:26:41 GMT
< Content-Type: text/html
< Content-Length: 9891
< Connection: keep-alive
< P3P: CP="CAO PSA OUR"
< Cache-Control: max-age=86400
* Added cookie login_param="daid%3D164%26target%3Dself%26style%3D5%26mibao_css%3Dm_webqq%26appid%3D1003903%26enable_qlogin%3D0%26no_verifyimg%3D1%26s_url%3Dhttp%253A%252F%252Fweb2.qq.com%252Floginproxy.html%26f_url%3Dloginerroralert%26strong_login%3D1%26login_state%3D10%26t%3D20130723001" for domain ui.ptlogin2.qq.com, path /, expire 0
< Set-Cookie: login_param=daid%3D164%26target%3Dself%26style%3D5%26mibao_css%3Dm_webqq%26appid%3D1003903%26enable_qlogin%3D0%26no_verifyimg%3D1%26s_url%3Dhttp%253A%252F%252Fweb2.qq.com%252Floginproxy.html%26f_url%3Dloginerroralert%26strong_login%3D1%26login_state%3D10%26t%3D20130723001; PATH=/; DOMAIN=ui.ptlogin2.qq.com;
* Added cookie uikey="ec1a1453e2628aee2d769eda27d408279556ca2f609b7ab9465c1a853c7dd320" for domain ptlogin2.qq.com, path /, expire 0
< Set-Cookie: uikey=ec1a1453e2628aee2d769eda27d408279556ca2f609b7ab9465c1a853c7dd320; PATH=/; DOMAIN=ptlogin2.qq.com;
* Added cookie pt_user_id="8473688320265136614" for domain ui.ptlogin2.qq.com, path /, expire 1714966001
< Set-Cookie: pt_user_id=8473688320265136614; EXPIRES=Mon, 06-May-2024 03:26:41 GMT; PATH=/; DOMAIN=ui.ptlogin2.qq.com;
* Added cookie ptui_identifier="000DA7AFEEBFA38884E89739E1FE46488AD6A0D55037B167D1CA9E4D" for domain ui.ptlogin2.qq.com, path /, expire 0
< Set-Cookie: ptui_identifier=000DA7AFEEBFA38884E89739E1FE46488AD6A0D55037B167D1CA9E4D; PATH=/; DOMAIN=ui.ptlogin2.qq.com;
< Last-Modified: Tue, 05 May 2015 01:30:00 GMT
< Content-Encoding: gzip
< 
* Connection #0 to host ui.ptlogin2.qq.com left intact
[I 140509 11:26:42 requests:64] 获取Login Sig: Ys6038RAgkSLQ6DzaMVfdZwu69QnSHjUqL9pgMDvblJHY3hqjSyAziK7r0jzlv9f
* About to connect() to check.ptlogin2.qq.com port 80 (#1)
*   Trying 101.226.103.34... * Connected to check.ptlogin2.qq.com (101.226.103.34) port 80 (#1)
> GET /check?u1=http%3A%2F%2Fweb2.qq.com%2Floginproxy.html&js_type=0&js_ver=10040&login_sig=Ys6038RAgkSLQ6DzaMVfdZwu69QnSHjUqL9pgMDvblJHY3hqjSyAziK7r0jzlv9f&uin=2931906870&r=0.0662340740211&appid=1003903 HTTP/1.1
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/28.0.1500.71 Chrome/28.0.1500.71 Safari/537.36
Host: check.ptlogin2.qq.com
Accept: */*
Accept-Encoding: gzip,deflate
Cookie: uikey=ec1a1453e2628aee2d769eda27d408279556ca2f609b7ab9465c1a853c7dd320
Accept-Charset: UTF-8,*;q=0.5
Connection: keep-alive
Referer: https://ui.ptlogin2.qq.com/cgi-bin/login?daid=164&target=self&style=5&mibao_css=m_webqq&appid=1003903&enable_qlogin=0&no_verifyimg=1&s_url=http%3A%2F%2Fweb2.qq.com%2Floginproxy.html&f_url=loginerroralert&strong_login=1&login_state=10&t=20130723001

< HTTP/1.1 200 OK
< Server: tencent http server
< Pragma: No-cache
< P3P: CP="CAO PSA OUR"
* Added cookie confirmuin="0" for domain ptlogin2.qq.com, path /, expire 0
< Set-Cookie: confirmuin=0; PATH=/; DOMAIN=ptlogin2.qq.com;
* Added cookie ptisp="ctc" for domain qq.com, path /, expire 0
< Set-Cookie: ptisp=ctc; PATH=/; DOMAIN=qq.com;
< Connection: close
< Content-Type: application/x-javascript; charset=utf-8
< 
* Closing connection #1
[W 140509 11:26:45 requests:93] 验证码检查完毕, 需要验证码
* About to connect() to ssl.captcha.qq.com port 443 (#1)
*   Trying 113.108.7.234... * Connected to ssl.captcha.qq.com (113.108.7.234) port 443 (#1)
* found 164 certificates in /etc/ssl/certs/ca-certificates.crt
*    server certificate verification SKIPPED
*    common name: ssl.captcha.qq.com (matched)
*    server certificate expiration date OK
*    server certificate activation date OK
*    certificate public key: RSA
*    certificate version: #3
*    subject: C=CN,ST=Guangdong,L=Shenzhen,O=Tencent Technology(Shenzhen) Company Limited,OU=R&D,OU=Terms of use at www.verisign.com/rpa (c)05,CN=ssl.captcha.qq.com
*    start date: Wed, 27 Nov 2013 00:00:00 GMT
*    expire date: Wed, 25 Jan 2017 23:59:59 GMT
*    issuer: C=US,O=VeriSign\, Inc.,OU=VeriSign Trust Network,OU=Terms of use at https://www.verisign.com/rpa (c)10,CN=VeriSign Class 3 International Server CA - G3
*    compression: NULL
*    cipher: AES-256-CBC
*    MAC: SHA1
> GET /getimage?aid=1003903&r=0.46460386081&uin=2931906870 HTTP/1.1
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/28.0.1500.71 Chrome/28.0.1500.71 Safari/537.36
Host: ssl.captcha.qq.com
Accept: */*
Accept-Encoding: gzip,deflate
Cookie: ptisp=ctc
Accept-Charset: UTF-8,*;q=0.5
Connection: keep-alive
Referer: https://ui.ptlogin2.qq.com/cgi-bin/login?daid=164&target=self&style=5&mibao_css=m_webqq&appid=1003903&enable_qlogin=0&no_verifyimg=1&s_url=http%3A%2F%2Fweb2.qq.com%2Floginproxy.html&f_url=loginerroralert&strong_login=1&login_state=10&t=20130723001

< HTTP/1.1 200 OK
< Server: nginx/0.7.67
< Date: Fri, 09 May 2014 03:26:46 GMT
< Content-Type: image/jpeg
< Connection: keep-alive
< Accept-Ranges: bytes
< Pragma: No-cache
< P3P: CP=CAO PSA OUR
< Content-Length: 2265
* Added cookie verifysession="h02oBxuuIGcxryBLYJ4VCR5fUSNYTI5Zkm7P3GIuDmDtmtMnNZEKmYkKqdq3tJ6TjzO1V6jLBC4wl08QcbqXLdGXQ**" for domain qq.com, path /, expire 0
< Set-Cookie: verifysession=h02oBxuuIGcxryBLYJ4VCR5fUSNYTI5Zkm7P3GIuDmDtmtMnNZEKmYkKqdq3tJ6TjzO1V6jLBC4wl08QcbqXLdGXQ**; PATH=/; DOMAIN=qq.com;
< 
* Connection #1 to host ssl.captcha.qq.com left intact
[I 140509 11:26:46 webqq:113] 验证码本地路径为: /tmp/tmpIrDIom.jpg
输入验证码: mxxa
* Connection #0 seems to be dead!
* Closing connection #0
* Connection #1 seems to be dead!
* Closing connection #1
* About to connect() to ssl.ptlogin2.qq.com port 443 (#0)
*   Trying 123.151.45.47... * Connected to ssl.ptlogin2.qq.com (123.151.45.47) port 443 (#0)
* found 164 certificates in /etc/ssl/certs/ca-certificates.crt
*    server certificate verification SKIPPED
*    common name: ssl.ui.ptlogin2.qq.com (matched)
*    server certificate expiration date OK
*    server certificate activation date OK
*    certificate public key: RSA
*    certificate version: #3
*    subject: serialNumber=K3CPPnVX0K95UWnHcSWtKctJpFIFRvCk,C=CN,ST=guangdong,L=shenzhen,O=Tencent Technology   (Shenzhen) Company Limited,OU=R&D,CN=ssl.ui.ptlogin2.qq.com
*    start date: Sat, 17 Nov 2012 22:22:31 GMT
*    expire date: Sat, 21 Nov 2015 06:30:08 GMT
*    issuer: C=US,O=GeoTrust\, Inc.,CN=GeoTrust SSL CA
*    compression: NULL
*    cipher: AES-256-CBC
*    MAC: SHA1
> GET /login?u=2931906870&p=9588ED4E7D2FC5465408E3F7E0A79E99&verifycode=mxxa&webqq_type=10&remember_uin=1&login2qq=1&aid=1003903&u1=http%3A%2F%2Fwww.qq.com%2Floginproxy.html%3Flogin2qq%3D1%26webqq_type%3D10&h=1&action=4-5-8246&ptredirect=0&ptlang=2052&from_ui=1&daid=164&pttype=1&dumy=&fp=loginerroralert&mibao_css=m_webqq&t=1&g=1&js_type=0&js_ver=10040&login_sig=Ys6038RAgkSLQ6DzaMVfdZwu69QnSHjUqL9pgMDvblJHY3hqjSyAziK7r0jzlv9f HTTP/1.1
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/28.0.1500.71 Chrome/28.0.1500.71 Safari/537.36
Host: ssl.ptlogin2.qq.com
Accept: */*
Accept-Encoding: gzip,deflate
Cookie: verifysession=h02oBxuuIGcxryBLYJ4VCR5fUSNYTI5Zkm7P3GIuDmDtmtMnNZEKmYkKqdq3tJ6TjzO1V6jLBC4wl08QcbqXLdGXQ**; ptisp=ctc; confirmuin=0; uikey=ec1a1453e2628aee2d769eda27d408279556ca2f609b7ab9465c1a853c7dd320
Accept-Charset: UTF-8,*;q=0.5
Connection: keep-alive
Referer: https://ui.ptlogin2.qq.com/cgi-bin/login?daid=164&target=self&style=5&mibao_css=m_webqq&appid=1003903&enable_qlogin=0&no_verifyimg=1&s_url=http%3A%2F%2Fweb2.qq.com%2Floginproxy.html&f_url=loginerroralert&strong_login=1&login_state=10&t=20130903001

< HTTP/1.1 200 OK
< Server: nginx/1.4.7
< Date: Fri, 09 May 2014 03:27:07 GMT
< Content-Type: application/x-javascript; charset=utf-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< P3P: CP="CAO PSA OUR"
* Added cookie pt2gguin="o2931906870" for domain qq.com, path /, expire 1577923200
< Set-Cookie: pt2gguin=o2931906870; EXPIRES=Fri, 02-Jan-2020 00:00:00 GMT; PATH=/; DOMAIN=qq.com;
* Added cookie uin="o2931906870" for domain qq.com, path /, expire 0
< Set-Cookie: uin=o2931906870; PATH=/; DOMAIN=qq.com;
* Added cookie skey="@INgZ9aiON" for domain qq.com, path /, expire 0
< Set-Cookie: skey=@INgZ9aiON; PATH=/; DOMAIN=qq.com;
* Added cookie ETK="" for domain ptlogin2.qq.com, path /, expire 0
< Set-Cookie: ETK=; PATH=/; DOMAIN=ptlogin2.qq.com;
* Added cookie superuin="o2931906870" for domain ptlogin2.qq.com, path /, expire 0
< Set-Cookie: superuin=o2931906870; PATH=/; DOMAIN=ptlogin2.qq.com;
* Added cookie superkey="GP9zdzZZB99owrQ3dq7OqMUdVo1D2qTQC5hXVMCYDas_" for domain ptlogin2.qq.com, path /, expire 0
< Set-Cookie: superkey=GP9zdzZZB99owrQ3dq7OqMUdVo1D2qTQC5hXVMCYDas_; PATH=/; DOMAIN=ptlogin2.qq.com; HttpOnly
* Added cookie supertoken="2164381550" for domain ptlogin2.qq.com, path /, expire 0
< Set-Cookie: supertoken=2164381550; PATH=/; DOMAIN=ptlogin2.qq.com;
* Replaced cookie ptisp="ctc" for domain qq.com, path /, expire 0
< Set-Cookie: ptisp=ctc; PATH=/; DOMAIN=qq.com;
* Added cookie RK="5T3v8agE4N" for domain qq.com, path /, expire 1714966026
< Set-Cookie: RK=5T3v8agE4N; EXPIRES=Mon, 06-May-2024 03:27:06 GMT; PATH=/; DOMAIN=qq.com;
* Added cookie ptuserinfo="7171626f7432" for domain ptlogin2.qq.com, path /, expire 0
< Set-Cookie: ptuserinfo=7171626f7432; PATH=/; DOMAIN=ptlogin2.qq.com;
* Added cookie ptcz="b5050c0ed5bd881f6c37077e581d7e560cbf39322f38b3406f13d506509fb6d3" for domain qq.com, path /, expire 1577923200
< Set-Cookie: ptcz=b5050c0ed5bd881f6c37077e581d7e560cbf39322f38b3406f13d506509fb6d3; EXPIRES=Fri, 02-Jan-2020 00:00:00 GMT; PATH=/; DOMAIN=qq.com;
* Added cookie ptcz="" for domain ptlogin2.qq.com, path /, expire 86400
< Set-Cookie: ptcz=; EXPIRES=Fri, 02-Jan-1970 00:00:00 GMT; PATH=/; DOMAIN=ptlogin2.qq.com;
* Added cookie airkey="" for domain qq.com, path /, expire 86400
< Set-Cookie: airkey=; EXPIRES=Fri, 02-Jan-1970 00:00:00 GMT; PATH=/; DOMAIN=qq.com;
* Added cookie ptwebqq="b222d9262526efeedd4e0f87308456afe34396d8af2dd30f05b467ec6e4d71dd" for domain qq.com, path /, expire 0
< Set-Cookie: ptwebqq=b222d9262526efeedd4e0f87308456afe34396d8af2dd30f05b467ec6e4d71dd; PATH=/; DOMAIN=qq.com;
< Pragma: no-cache
< Cache-Control: no-cache; must-revalidate
< 
* Connection #0 to host ssl.ptlogin2.qq.com left intact
[I 140509 11:27:07 requests:147] 登录返回数据: ptuiCB('0','0','http://ptlogin4.web2.qq.com/check_sig?pttype=1&uin=2931906870&service=login&nodirect=0&ptsig=rTih30tmv5QV83zxaBjyJtLFY*q02AWvJMOyRcPl8Xw_&s_url=http%3A%2F%2Fwww.qq.com%2Floginproxy.html%3Flogin2qq%3D1%26webqq_type%3D10&f_url=&ptlang=2052&ptredirect=100&aid=1003903&daid=164&j_later=0&low_login_hour=0&regmaster=0&pt_login_type=1&pt_aid=0&pt_aaid=0&pt_light=0','0','登录成功!', 'qqbot2')
[I 140509 11:27:07 requests:153] 从Cookie中获取ptwebqq的值
[I 140509 11:27:07 requests:181] 检查完毕
[I 140509 11:27:07 requests:191] 开始登录前准备...
[I 140509 11:27:07 requests:147] 登录返回数据: ptuiCB('0','0','http://ptlogin4.web2.qq.com/check_sig?pttype=1&uin=2931906870&service=login&nodirect=0&ptsig=rTih30tmv5QV83zxaBjyJtLFY*q02AWvJMOyRcPl8Xw_&s_url=http%3A%2F%2Fwww.qq.com%2Floginproxy.html%3Flogin2qq%3D1%26webqq_type%3D10&f_url=&ptlang=2052&ptredirect=100&aid=1003903&daid=164&j_later=0&low_login_hour=0&regmaster=0&pt_login_type=1&pt_aid=0&pt_aaid=0&pt_light=0','0','登录成功!', 'qqbot2')
* About to connect() to ptlogin4.web2.qq.com port 80 (#1)
*   Trying 61.151.224.40... * Connected to ptlogin4.web2.qq.com (61.151.224.40) port 80 (#1)
> GET /check_sig?pttype=1&uin=2931906870&service=login&nodirect=0&ptsig=rTih30tmv5QV83zxaBjyJtLFY*q02AWvJMOyRcPl8Xw_&s_url=http%3A%2F%2Fwww.qq.com%2Floginproxy.html%3Flogin2qq%3D1%26webqq_type%3D10&f_url=&ptlang=2052&ptredirect=100&aid=1003903&daid=164&j_later=0&low_login_hour=0&regmaster=0&pt_login_type=1&pt_aid=0&pt_aaid=0&pt_light=0? HTTP/1.1
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/28.0.1500.71 Chrome/28.0.1500.71 Safari/537.36
Host: ptlogin4.web2.qq.com
Accept: */*
Accept-Encoding: gzip,deflate
Cookie: ptwebqq=b222d9262526efeedd4e0f87308456afe34396d8af2dd30f05b467ec6e4d71dd; ptcz=b5050c0ed5bd881f6c37077e581d7e560cbf39322f38b3406f13d506509fb6d3; RK=5T3v8agE4N; skey=@INgZ9aiON; uin=o2931906870; pt2gguin=o2931906870; verifysession=h02oBxuuIGcxryBLYJ4VCR5fUSNYTI5Zkm7P3GIuDmDtmtMnNZEKmYkKqdq3tJ6TjzO1V6jLBC4wl08QcbqXLdGXQ**; ptisp=ctc
Accept-Charset: UTF-8,*;q=0.5
Connection: keep-alive
Referer: https://ui.ptlogin2.qq.com/cgi-bin/login?daid=164&target=self&style=5&mibao_css=m_webqq&appid=1003903&enable_qlogin=0&no_verifyimg=1&s_url=http%3A%2F%2Fweb2.qq.com%2Floginproxy.html&f_url=loginerroralert&strong_login=1&login_state=10&t=20130723001

< HTTP/1.1 302 Found
< Date: Fri, 09 May 2014 03:27:07 GMT
< Server: Tencent Login Server/2.0.0
< P3P: CP="CAO PSA OUR"
* Replaced cookie pt2gguin="o2931906870" for domain qq.com, path /, expire 1577923200
< Set-Cookie: pt2gguin=o2931906870; EXPIRES=Fri, 02-Jan-2020 00:00:00 GMT; PATH=/; DOMAIN=qq.com;
* Replaced cookie uin="o2931906870" for domain qq.com, path /, expire 0
< Set-Cookie: uin=o2931906870; PATH=/; DOMAIN=qq.com;
* Replaced cookie skey="@G5sRXYgrC" for domain qq.com, path /, expire 0
< Set-Cookie: skey=@G5sRXYgrC; PATH=/; DOMAIN=qq.com;
* Added cookie p_uin="o2931906870" for domain web2.qq.com, path /, expire 0
< Set-Cookie: p_uin=o2931906870; PATH=/; DOMAIN=web2.qq.com;
* Added cookie p_skey="BjRMc5P8nF5I*Q2EJn3fq81ihuZQEDHfq3hxQbKI*0Q_" for domain web2.qq.com, path /, expire 0
< Set-Cookie: p_skey=BjRMc5P8nF5I*Q2EJn3fq81ihuZQEDHfq3hxQbKI*0Q_; PATH=/; DOMAIN=web2.qq.com;
* Added cookie pt4_token="WEF1Aksc*MXkQWpkatctLA__" for domain web2.qq.com, path /, expire 0
< Set-Cookie: pt4_token=WEF1Aksc*MXkQWpkatctLA__; PATH=/; DOMAIN=web2.qq.com;
* Added cookie p_uin="" for domain qq.com, path /, expire 86400
< Set-Cookie: p_uin=; EXPIRES=Fri, 02-Jan-1970 00:00:00 GMT; PATH=/; DOMAIN=qq.com;
* Added cookie p_skey="" for domain qq.com, path /, expire 86400
< Set-Cookie: p_skey=; EXPIRES=Fri, 02-Jan-1970 00:00:00 GMT; PATH=/; DOMAIN=qq.com;
* Added cookie pt4_token="" for domain qq.com, path /, expire 86400
< Set-Cookie: pt4_token=; EXPIRES=Fri, 02-Jan-1970 00:00:00 GMT; PATH=/; DOMAIN=qq.com;
< Location: http://www.qq.com/loginproxy.html?login2qq=1&webqq_type=10
< Connection: Close
< Content-Type: text/html
< 
* Closing connection #1
* Issue another request to this URL: 'http://www.qq.com/loginproxy.html?login2qq=1&webqq_type=10'
* About to connect() to www.qq.com port 80 (#1)
*   Trying 101.226.103.106... * Connected to www.qq.com (101.226.103.106) port 80 (#1)
> GET /loginproxy.html?login2qq=1&webqq_type=10 HTTP/1.1
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/28.0.1500.71 Chrome/28.0.1500.71 Safari/537.36
Host: www.qq.com
Accept: */*
Accept-Encoding: gzip,deflate
Cookie: ptwebqq=b222d9262526efeedd4e0f87308456afe34396d8af2dd30f05b467ec6e4d71dd; ptcz=b5050c0ed5bd881f6c37077e581d7e560cbf39322f38b3406f13d506509fb6d3; RK=5T3v8agE4N; skey=@G5sRXYgrC; uin=o2931906870; pt2gguin=o2931906870; verifysession=h02oBxuuIGcxryBLYJ4VCR5fUSNYTI5Zkm7P3GIuDmDtmtMnNZEKmYkKqdq3tJ6TjzO1V6jLBC4wl08QcbqXLdGXQ**; ptisp=ctc
Accept-Charset: UTF-8,*;q=0.5
Connection: keep-alive
Referer: https://ui.ptlogin2.qq.com/cgi-bin/login?daid=164&target=self&style=5&mibao_css=m_webqq&appid=1003903&enable_qlogin=0&no_verifyimg=1&s_url=http%3A%2F%2Fweb2.qq.com%2Floginproxy.html&f_url=loginerroralert&strong_login=1&login_state=10&t=20130723001

< HTTP/1.1 404 Not Found
< Server: squid/3.2.1
< Date: Fri, 09 May 2014 03:27:09 GMT
< Content-Type: text/html; charset=GB2312
< Transfer-Encoding: chunked
< Connection: keep-alive
< Vary: Accept-Encoding
< Content-Encoding: gzip
< 
* Connection #1 to host www.qq.com left intact
[I 140509 11:27:09 requests:211] 准备完毕, 开始登录
* About to connect() to d.web2.qq.com port 80 (#2)
*   Trying 119.147.192.13... * Connected to d.web2.qq.com (119.147.192.13) port 80 (#2)
> POST /channel/login2 HTTP/1.1
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/28.0.1500.71 Chrome/28.0.1500.71 Safari/537.36
Host: d.web2.qq.com
Accept: */*
Accept-Encoding: gzip,deflate
Cookie: pt4_token=WEF1Aksc*MXkQWpkatctLA__; p_skey=BjRMc5P8nF5I*Q2EJn3fq81ihuZQEDHfq3hxQbKI*0Q_; p_uin=o2931906870; ptwebqq=b222d9262526efeedd4e0f87308456afe34396d8af2dd30f05b467ec6e4d71dd; ptcz=b5050c0ed5bd881f6c37077e581d7e560cbf39322f38b3406f13d506509fb6d3; RK=5T3v8agE4N; skey=@G5sRXYgrC; uin=o2931906870; pt2gguin=o2931906870; verifysession=h02oBxuuIGcxryBLYJ4VCR5fUSNYTI5Zkm7P3GIuDmDtmtMnNZEKmYkKqdq3tJ6TjzO1V6jLBC4wl08QcbqXLdGXQ**; ptisp=ctc
Origin: http://d.web2.qq.com
Accept-Charset: UTF-8,*;q=0.5
Connection: keep-alive
Referer: http://s.web2.qq.com/proxy.html?v=20110412001&callback=1&id=3
Content-Length: 40
Content-Type: application/x-www-form-urlencoded

< HTTP/1.1 500 Internal Server Error
< Date: Fri, 09 May 2014 03:27:11 GMT
< Content-Length: 236
< Connection: close
< 
* Closing connection #2
[E 140509 11:27:11 requests:225] 没有获取到数据或数据格式错误, 登录失败:<html><h1>Error occured:</h1><pre>{{case_clause,{invalid_json,"lexical error: invalid char in json text.\n"}},
     [{application_util,invoke,3},
      {api_web,loop,2},
      {mochiweb_http,headers,4},
      {proc_lib,init_p_do_apply,3}]}</pre></html>
[I 140509 11:27:11 requests:46] 获取 login_sig...
[E 140509 11:27:11 ioloop:491] Exception in callback <functools.partial object at 0x898939c>
    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/dist-packages/tornado-3.2.1-py2.7-linux-i686.egg/tornado/ioloop.py", line 477, in _run_callback
        callback()
      File "/usr/local/lib/python2.7/dist-packages/tornado-3.2.1-py2.7-linux-i686.egg/tornado/stack_context.py", line 331, in wrapped
        raise_exc_info(exc)
      File "/usr/local/lib/python2.7/dist-packages/tornado-3.2.1-py2.7-linux-i686.egg/tornado/stack_context.py", line 302, in wrapped
        ret = fn(*args, **kwargs)
      File "/home/mofe/PycharmProjects/qqpunch/twqq/hub.py", line 493, in _wrap
        f(request, resp, data)
      File "/home/mofe/PycharmProjects/qqpunch/webqq.py", line 149, in handle_login_errorcode
        if data.get("retcode") != 0:
    AttributeError: 'str' object has no attribute 'get'
* About to connect() to ui.ptlogin2.qq.com port 443 (#2)
*   Trying 101.226.103.81... * Connected to ui.ptlogin2.qq.com (101.226.103.81) port 443 (#2)
* found 164 certificates in /etc/ssl/certs/ca-certificates.crt
* SSL re-using session ID
*    server certificate verification SKIPPED
*    common name: xui.ptlogin2.qq.com (matched)
*    server certificate expiration date OK
*    server certificate activation date OK
*    certificate public key: RSA
*    certificate version: #3
*    subject: serialNumber=fTF4II7BwxWodn9hFQw1em2LNDJRH4r/,C=CN,ST=guangdong,L=shenzhen,O=Shenzhen Tencent Computer Systems Company Limited,OU=R&D,CN=xui.ptlogin2.qq.com
*    start date: Sun, 14 Jul 2013 14:07:37 GMT
*    expire date: Sat, 16 Jul 2016 11:01:55 GMT
*    issuer: C=US,O=GeoTrust\, Inc.,CN=GeoTrust SSL CA
*    compression: NULL
*    cipher: AES-256-CBC
*    MAC: SHA1
> GET /cgi-bin/login?daid=164&target=self&style=5&mibao_css=m_webqq&appid=1003903&enable_qlogin=0&no_verifyimg=1&s_url=http%3A%2F%2Fweb2.qq.com%2Floginproxy.html&f_url=loginerroralert&strong_login=1&login_state=10&t=20130723001 HTTP/1.1
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/28.0.1500.71 Chrome/28.0.1500.71 Safari/537.36
Host: ui.ptlogin2.qq.com
Accept: */*
Accept-Encoding: gzip,deflate
Cookie: ptwebqq=b222d9262526efeedd4e0f87308456afe34396d8af2dd30f05b467ec6e4d71dd; ptcz=b5050c0ed5bd881f6c37077e581d7e560cbf39322f38b3406f13d506509fb6d3; ptuserinfo=7171626f7432; RK=5T3v8agE4N; supertoken=2164381550; superkey=GP9zdzZZB99owrQ3dq7OqMUdVo1D2qTQC5hXVMCYDas_; superuin=o2931906870; ETK=; skey=@G5sRXYgrC; uin=o2931906870; pt2gguin=o2931906870; verifysession=h02oBxuuIGcxryBLYJ4VCR5fUSNYTI5Zkm7P3GIuDmDtmtMnNZEKmYkKqdq3tJ6TjzO1V6jLBC4wl08QcbqXLdGXQ**; ptisp=ctc; confirmuin=0; ptui_identifier=000DA7AFEEBFA38884E89739E1FE46488AD6A0D55037B167D1CA9E4D; pt_user_id=8473688320265136614; uikey=ec1a1453e2628aee2d769eda27d408279556ca2f609b7ab9465c1a853c7dd320; login_param=daid%3D164%26target%3Dself%26style%3D5%26mibao_css%3Dm_webqq%26appid%3D1003903%26enable_qlogin%3D0%26no_verifyimg%3D1%26s_url%3Dhttp%253A%252F%252Fweb2.qq.com%252Floginproxy.html%26f_url%3Dloginerroralert%26strong_login%3D1%26login_state%3D10%26t%3D20130723001
Origin: http://d.web2.qq.com
Accept-Charset: UTF-8,*;q=0.5
Connection: keep-alive
Referer: http://s.web2.qq.com/proxy.html?v=20110412001&callback=1&id=3

< HTTP/1.1 200 OK
< Server: nginx/1.4.7
< Date: Fri, 09 May 2014 03:27:11 GMT
< Content-Type: text/html
< Content-Length: 9891
< Connection: keep-alive
< P3P: CP="CAO PSA OUR"
< Cache-Control: max-age=86400
* Replaced cookie login_param="daid%3D164%26target%3Dself%26style%3D5%26mibao_css%3Dm_webqq%26appid%3D1003903%26enable_qlogin%3D0%26no_verifyimg%3D1%26s_url%3Dhttp%253A%252F%252Fweb2.qq.com%252Floginproxy.html%26f_url%3Dloginerroralert%26strong_login%3D1%26login_state%3D10%26t%3D20130723001" for domain ui.ptlogin2.qq.com, path /, expire 0
< Set-Cookie: login_param=daid%3D164%26target%3Dself%26style%3D5%26mibao_css%3Dm_webqq%26appid%3D1003903%26enable_qlogin%3D0%26no_verifyimg%3D1%26s_url%3Dhttp%253A%252F%252Fweb2.qq.com%252Floginproxy.html%26f_url%3Dloginerroralert%26strong_login%3D1%26login_state%3D10%26t%3D20130723001; PATH=/; DOMAIN=ui.ptlogin2.qq.com;
* Replaced cookie uikey="1961fc8f64d50e978ba9032c0d95ae01182b929334cb36b0b626637e6def8cc0" for domain ptlogin2.qq.com, path /, expire 0
< Set-Cookie: uikey=1961fc8f64d50e978ba9032c0d95ae01182b929334cb36b0b626637e6def8cc0; PATH=/; DOMAIN=ptlogin2.qq.com;
* Replaced cookie ptui_identifier="000E010A568C3B5980D41B531B201CB90127A7E69535916AF4CAFE64F039" for domain ui.ptlogin2.qq.com, path /, expire 0
< Set-Cookie: ptui_identifier=000E010A568C3B5980D41B531B201CB90127A7E69535916AF4CAFE64F039; PATH=/; DOMAIN=ui.ptlogin2.qq.com;
< Last-Modified: Tue, 05 May 2015 01:30:00 GMT
< Content-Encoding: gzip
< 
* Connection #2 to host ui.ptlogin2.qq.com left intact
[I 140509 11:27:11 requests:64] 获取Login Sig: 6lIjQapOWy2cJkXRvcA7THkt3WZk*jzmb6fwnhqxmuqUxw0jGkRR1p3KfhIgU8RB
* About to connect() to check.ptlogin2.qq.com port 80 (#3)
*   Trying 101.226.103.34... * Connected to check.ptlogin2.qq.com (101.226.103.34) port 80 (#3)
> GET /check?u1=http%3A%2F%2Fweb2.qq.com%2Floginproxy.html&js_type=0&js_ver=10040&login_sig=6lIjQapOWy2cJkXRvcA7THkt3WZk%2Ajzmb6fwnhqxmuqUxw0jGkRR1p3KfhIgU8RB&uin=2931906870&r=0.815736726669&appid=1003903 HTTP/1.1
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/28.0.1500.71 Chrome/28.0.1500.71 Safari/537.36
Host: check.ptlogin2.qq.com
Accept: */*
Accept-Encoding: gzip,deflate
Cookie: ptwebqq=b222d9262526efeedd4e0f87308456afe34396d8af2dd30f05b467ec6e4d71dd; ptcz=b5050c0ed5bd881f6c37077e581d7e560cbf39322f38b3406f13d506509fb6d3; ptuserinfo=7171626f7432; RK=5T3v8agE4N; supertoken=2164381550; superkey=GP9zdzZZB99owrQ3dq7OqMUdVo1D2qTQC5hXVMCYDas_; superuin=o2931906870; ETK=; skey=@G5sRXYgrC; uin=o2931906870; pt2gguin=o2931906870; verifysession=h02oBxuuIGcxryBLYJ4VCR5fUSNYTI5Zkm7P3GIuDmDtmtMnNZEKmYkKqdq3tJ6TjzO1V6jLBC4wl08QcbqXLdGXQ**; ptisp=ctc; confirmuin=0; uikey=1961fc8f64d50e978ba9032c0d95ae01182b929334cb36b0b626637e6def8cc0
Origin: http://d.web2.qq.com
Accept-Charset: UTF-8,*;q=0.5
Connection: keep-alive
Referer: https://ui.ptlogin2.qq.com/cgi-bin/login?daid=164&target=self&style=5&mibao_css=m_webqq&appid=1003903&enable_qlogin=0&no_verifyimg=1&s_url=http%3A%2F%2Fweb2.qq.com%2Floginproxy.html&f_url=loginerroralert&strong_login=1&login_state=10&t=20130723001

< HTTP/1.1 200 OK
< Server: tencent http server
< Pragma: No-cache
< P3P: CP="CAO PSA OUR"
* Replaced cookie confirmuin="0" for domain ptlogin2.qq.com, path /, expire 0
< Set-Cookie: confirmuin=0; PATH=/; DOMAIN=ptlogin2.qq.com;
< Connection: close
< Content-Type: application/x-javascript; charset=utf-8
< 
* Closing connection #3
[W 140509 11:27:12 requests:93] 验证码检查完毕, 需要验证码
* About to connect() to ssl.captcha.qq.com port 443 (#3)
*   Trying 113.108.7.234... * Connected to ssl.captcha.qq.com (113.108.7.234) port 443 (#3)
* found 164 certificates in /etc/ssl/certs/ca-certificates.crt
* SSL re-using session ID
*    server certificate verification SKIPPED
*    common name: ssl.captcha.qq.com (matched)
*    server certificate expiration date OK
*    server certificate activation date OK
*    certificate public key: RSA
*    certificate version: #3
*    subject: C=CN,ST=Guangdong,L=Shenzhen,O=Tencent Technology(Shenzhen) Company Limited,OU=R&D,OU=Terms of use at www.verisign.com/rpa (c)05,CN=ssl.captcha.qq.com
*    start date: Wed, 27 Nov 2013 00:00:00 GMT
*    expire date: Wed, 25 Jan 2017 23:59:59 GMT
*    issuer: C=US,O=VeriSign\, Inc.,OU=VeriSign Trust Network,OU=Terms of use at https://www.verisign.com/rpa (c)10,CN=VeriSign Class 3 International Server CA - G3
*    compression: NULL
*    cipher: AES-256-CBC
*    MAC: SHA1
> GET /getimage?aid=1003903&r=0.143318931544&uin=2931906870 HTTP/1.1
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/28.0.1500.71 Chrome/28.0.1500.71 Safari/537.36
Host: ssl.captcha.qq.com
Accept: */*
Accept-Encoding: gzip,deflate
Cookie: ptwebqq=b222d9262526efeedd4e0f87308456afe34396d8af2dd30f05b467ec6e4d71dd; ptcz=b5050c0ed5bd881f6c37077e581d7e560cbf39322f38b3406f13d506509fb6d3; RK=5T3v8agE4N; skey=@G5sRXYgrC; uin=o2931906870; pt2gguin=o2931906870; verifysession=h02oBxuuIGcxryBLYJ4VCR5fUSNYTI5Zkm7P3GIuDmDtmtMnNZEKmYkKqdq3tJ6TjzO1V6jLBC4wl08QcbqXLdGXQ**; ptisp=ctc
Origin: http://d.web2.qq.com
Accept-Charset: UTF-8,*;q=0.5
Connection: keep-alive
Referer: https://ui.ptlogin2.qq.com/cgi-bin/login?daid=164&target=self&style=5&mibao_css=m_webqq&appid=1003903&enable_qlogin=0&no_verifyimg=1&s_url=http%3A%2F%2Fweb2.qq.com%2Floginproxy.html&f_url=loginerroralert&strong_login=1&login_state=10&t=20130723001

输入验证码: < HTTP/1.1 200 OK
< Server: nginx/0.7.67
< Date: Fri, 09 May 2014 03:27:13 GMT
< Content-Type: image/jpeg
< Connection: keep-alive
< Accept-Ranges: bytes
< Pragma: No-cache
< P3P: CP=CAO PSA OUR
< Content-Length: 2392
* Replaced cookie verifysession="h02bxmJld-7J5kc1YQO-NN6kjhd5s7qjosJrhjJ8hwNlzO7H3W-u7T0J4AgxabWKIZJlLuTeTMT80o9f1TZkBXGUw**" for domain qq.com, path /, expire 0
< Set-Cookie: verifysession=h02bxmJld-7J5kc1YQO-NN6kjhd5s7qjosJrhjJ8hwNlzO7H3W-u7T0J4AgxabWKIZJlLuTeTMT80o9f1TZkBXGUw**; PATH=/; DOMAIN=qq.com;
< 
* Connection #3 to host ssl.captcha.qq.com left intact
[I 140509 11:27:12 webqq:113] 验证码本地路径为: /tmp/tmpIrDIom.jpg
mofelee commented 10 years ago

完整的错误信息,一直都是验证码,我也不知道为什么。运行在虚拟机,所以把错误信息发上来,等下我回到上一个快照。看还有问题不

coldnight commented 10 years ago

验证码已经过了. 不是验证的问题. 是登录的问题.

mofelee commented 10 years ago

没有问题了,昨天做插件修改了一些东西,然后今天早上一登陆就出错了。。。