Coder Social home page Coder Social logo

smartqq's Issues

长轮询接收消息超时

@ScienJus 在使用消息接收接口经常会出现超时的问题,我这里设置的超时时间是65s,smartqq应该是最长60s内肯定会返回消息,不清楚为什么会出现这个问题,你遇到过吗?

不能正常发送和接受消息

接收消息问题:有消息过来,但是程序接收不到

2016-12-27 23:15:08,070 INFO c.s.s.c.SmartQQClient [Thread-1] 正在登录,请稍后
2016-12-27 23:15:08,070 DEBUG c.s.s.c.SmartQQClient [Thread-1] 开始获取ptwebqq
2016-12-27 23:15:08,445 DEBUG c.s.s.c.SmartQQClient [Thread-1] 开始获取vfwebqq
2016-12-27 23:15:08,618 DEBUG c.s.s.c.SmartQQClient [Thread-1] 开始获取uin和psessionid
2016-12-27 23:15:08,759 DEBUG c.s.s.c.SmartQQClient [Thread-4] 15:8 开始接收消息
2016-12-27 23:16:08,805 ERROR c.s.s.c.SmartQQClient [Thread-4] 请求失败,Http返回码[504]
2016-12-27 23:16:08,805 DEBUG c.s.s.c.SmartQQClient [Thread-4] 16:8 开始接收消息

发送问题:

2016-12-27 23:18:04,988 ERROR c.s.s.c.SmartQQClient [pool-3-thread-1] 发送失败,Api返回码[100001]

修复 103 错误码

昨天收到一封邮件,一位用户提供了一种修复 103 错误码的方式,文章为:

http://blog.csdn.net/u012934723/article/details/50968447

想联系下该文章的作者是否愿意提交一个 Pull Request 完成这部分的功能,如果比较忙也没关系,我会替他提交这部分代码并同样注明他为贡献者,总之感谢他提供的解决方案。

希望可以彻底解决这个恼人的问题。

二维码的api有变动?

从昨天晚上开始 貌似无法登陆了。
扫描二维码后 无响应;或者直接二维码无效。

但是webqq 可以登陆。

以 jar 方式运行会出现空指针异常

Exception in thread "main" java.lang.NullPointerException
at com.scienjus.smartqq.client.SmartQQClient.getQRCode(SmartQQClient.java:91)
at com.scienjus.smartqq.client.SmartQQClient.login(SmartQQClient.java:79)
at com.scienjus.smartqq.client.SmartQQClient.(SmartQQClient.java:56)
at com.scienjus.smartqq.Application.main(Application.java:18)

本打算直接 mvn 打包成 jar 后用在这里,不过因为这行代码的原因就会有问题:
String filePath = getClass().getResource("/").getPath().concat("qrcode.png");
建议直接换成 "qrcode.png" 然后用 getCanonicalPath() 之类的方法得到绝对路径

喜闻乐见的无法使用

大约于7月初clone的repo,Windows 10 10586 + IntelliJ IDEA + jdk 1.8.0
异常发生于扫码后
控制台输出:

Exception in thread "main" java.lang.ExceptionInInitializerError
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:123)
Caused by: net.dongliu.requests.exception.RequestException: 请求失败,Api返回码[100000]
    at 包名.client.SmartQQClient.getResponseJson(SmartQQClient.java:689)
    at 包名.client.SmartQQClient.getJsonObjectResult(SmartQQClient.java:646)
    at 包名.client.SmartQQClient.getVfwebqq(SmartQQClient.java:204)
    at 包名.client.SmartQQClient.login(SmartQQClient.java:120)
    at 包名.client.SmartQQClient.<init>(SmartQQClient.java:66)
    at 包名.主类名.<clinit>(.java:482)
    ... 3 more

Process finished with exit code 1

如果新的commit已经解决了此问题,烦请告知;否则请修复一下,谢谢

顺便如果可以的话请加一下发送消息失败时重发,这样我就不用自己修改而可以改用maven了(逃

现在运行 demo 的时候就一直重复报了这个错,用的是maven上面的依赖

 [framework] 2016-07-06 07:26:18,411 - org.apache.http.impl.execchain.MainClientExec -45904 [main] DEBUG org.apache.http.impl.execchain.MainClientExec  - Connection can be kept alive indefinitely
 [framework] 2016-07-06 07:26:18,412 - org.apache.http.impl.conn.PoolingHttpClientConnectionManager -45905 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager  - Connection [id: 0][route: {s}->https://ssl.ptlogin2.qq.com:443] can be kept alive indefinitely
 [framework] 2016-07-06 07:26:18,412 - org.apache.http.impl.conn.PoolingHttpClientConnectionManager -45905 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager  - Connection released: [id: 0][route: {s}->https://ssl.ptlogin2.qq.com:443][total kept alive: 1; route allocated: 1 of 5; total allocated: 1 of 10]
 [framework] 2016-07-06 07:26:19,412 - org.apache.http.client.protocol.RequestAddCookies -46905 [main] DEBUG org.apache.http.client.protocol.RequestAddCookies  - CookieSpec selected: default
 [framework] 2016-07-06 07:26:19,413 - org.apache.http.client.protocol.RequestAddCookies -46906 [main] DEBUG org.apache.http.client.protocol.RequestAddCookies  - Cookie [version: 0][name: qrsig][value: LEo9qua-yFS9oTVDcmkdI4tnAEsJIK5m76-rCPxOzVDmjPrkPYdkUT23O-5teKYw][domain: ptlogin2.qq.com][path: /][expiry: null] match [(secure)ssl.ptlogin2.qq.com:443/ptqrlogin]
 [framework] 2016-07-06 07:26:19,413 - org.apache.http.client.protocol.RequestAuthCache -46906 [main] DEBUG org.apache.http.client.protocol.RequestAuthCache  - Auth cache not set in the context
 [framework] 2016-07-06 07:26:19,413 - org.apache.http.impl.conn.PoolingHttpClientConnectionManager -46906 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager  - Connection request: [route: {s}->https://ssl.ptlogin2.qq.com:443][total kept alive: 1; route allocated: 1 of 5; total allocated: 1 of 10]
 [framework] 2016-07-06 07:26:19,414 - org.apache.http.impl.conn.PoolingHttpClientConnectionManager -46907 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager  - Connection leased: [id: 0][route: {s}->https://ssl.ptlogin2.qq.com:443][total kept alive: 0; route allocated: 1 of 5; total allocated: 1 of 10]
 [framework] 2016-07-06 07:26:19,414 - org.apache.http.impl.conn.DefaultManagedHttpClientConnection -46907 [main] DEBUG org.apache.http.impl.conn.DefaultManagedHttpClientConnection  - http-outgoing-0: set socket timeout to 10000
 [framework] 2016-07-06 07:26:19,414 - org.apache.http.impl.execchain.MainClientExec -46907 [main] DEBUG org.apache.http.impl.execchain.MainClientExec  - Executing request GET /ptqrlogin?webqq_type=10&remember_uin=1&login2qq=1&aid=501004106&u1=http%3A%2F%2Fw.qq.com%2Fproxy.html%3Flogin2qq%3D1%26webqq_type%3D10&ptredirect=0&ptlang=2052&daid=164&from_ui=1&pttype=1&dumy=&fp=loginerroralert&action=0-0-157510&mibao_css=m_webqq&t=1&g=1&js_type=0&js_ver=10143&login_sig=&pt_randsalt=0 HTTP/1.1
 [framework] 2016-07-06 07:26:19,414 - org.apache.http.impl.execchain.MainClientExec -46907 [main] DEBUG org.apache.http.impl.execchain.MainClientExec  - Target auth state: UNCHALLENGED
 [framework] 2016-07-06 07:26:19,414 - org.apache.http.impl.execchain.MainClientExec -46907 [main] DEBUG org.apache.http.impl.execchain.MainClientExec  - Proxy auth state: UNCHALLENGED
 [framework] 2016-07-06 07:26:19,414 - org.apache.http.headers -46907 [main] DEBUG org.apache.http.headers  - http-outgoing-0 >> GET /ptqrlogin?webqq_type=10&remember_uin=1&login2qq=1&aid=501004106&u1=http%3A%2F%2Fw.qq.com%2Fproxy.html%3Flogin2qq%3D1%26webqq_type%3D10&ptredirect=0&ptlang=2052&daid=164&from_ui=1&pttype=1&dumy=&fp=loginerroralert&action=0-0-157510&mibao_css=m_webqq&t=1&g=1&js_type=0&js_ver=10143&login_sig=&pt_randsalt=0 HTTP/1.1
 [framework] 2016-07-06 07:26:19,414 - org.apache.http.headers -46907 [main] DEBUG org.apache.http.headers  - http-outgoing-0 >> User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36
 [framework] 2016-07-06 07:26:19,414 - org.apache.http.headers -46907 [main] DEBUG org.apache.http.headers  - http-outgoing-0 >> Referer: https://ui.ptlogin2.qq.com/cgi-bin/login?daid=164&target=self&style=16&mibao_css=m_webqq&appid=501004106&enable_qlogin=0&no_verifyimg=1&s_url=http%3A%2F%2Fw.qq.com%2Fproxy.html&f_url=loginerroralert&strong_login=1&login_state=10&t=20131024001
 [framework] 2016-07-06 07:26:19,415 - org.apache.http.headers -46908 [main] DEBUG org.apache.http.headers  - http-outgoing-0 >> Host: ssl.ptlogin2.qq.com
 [framework] 2016-07-06 07:26:19,415 - org.apache.http.headers -46908 [main] DEBUG org.apache.http.headers  - http-outgoing-0 >> Connection: Keep-Alive
 [framework] 2016-07-06 07:26:19,415 - org.apache.http.headers -46908 [main] DEBUG org.apache.http.headers  - http-outgoing-0 >> Cookie: qrsig=LEo9qua-yFS9oTVDcmkdI4tnAEsJIK5m76-rCPxOzVDmjPrkPYdkUT23O-5teKYw
 [framework] 2016-07-06 07:26:19,415 - org.apache.http.headers -46908 [main] DEBUG org.apache.http.headers  - http-outgoing-0 >> Accept-Encoding: gzip,deflate
 [framework] 2016-07-06 07:26:19,415 - org.apache.http.wire -46908 [main] DEBUG org.apache.http.wire  - http-outgoing-0 >> "GET /ptqrlogin?webqq_type=10&remember_uin=1&login2qq=1&aid=501004106&u1=http%3A%2F%2Fw.qq.com%2Fproxy.html%3Flogin2qq%3D1%26webqq_type%3D10&ptredirect=0&ptlang=2052&daid=164&from_ui=1&pttype=1&dumy=&fp=loginerroralert&action=0-0-157510&mibao_css=m_webqq&t=1&g=1&js_type=0&js_ver=10143&login_sig=&pt_randsalt=0 HTTP/1.1[\r][\n]"
 [framework] 2016-07-06 07:26:19,415 - org.apache.http.wire -46908 [main] DEBUG org.apache.http.wire  - http-outgoing-0 >> "User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36[\r][\n]"
 [framework] 2016-07-06 07:26:19,415 - org.apache.http.wire -46908 [main] DEBUG org.apache.http.wire  - http-outgoing-0 >> "Referer: https://ui.ptlogin2.qq.com/cgi-bin/login?daid=164&target=self&style=16&mibao_css=m_webqq&appid=501004106&enable_qlogin=0&no_verifyimg=1&s_url=http%3A%2F%2Fw.qq.com%2Fproxy.html&f_url=loginerroralert&strong_login=1&login_state=10&t=20131024001[\r][\n]"
 [framework] 2016-07-06 07:26:19,415 - org.apache.http.wire -46908 [main] DEBUG org.apache.http.wire  - http-outgoing-0 >> "Host: ssl.ptlogin2.qq.com[\r][\n]"
 [framework] 2016-07-06 07:26:19,416 - org.apache.http.wire -46909 [main] DEBUG org.apache.http.wire  - http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
 [framework] 2016-07-06 07:26:19,416 - org.apache.http.wire -46909 [main] DEBUG org.apache.http.wire  - http-outgoing-0 >> "Cookie: qrsig=LEo9qua-yFS9oTVDcmkdI4tnAEsJIK5m76-rCPxOzVDmjPrkPYdkUT23O-5teKYw[\r][\n]"
 [framework] 2016-07-06 07:26:19,416 - org.apache.http.wire -46909 [main] DEBUG org.apache.http.wire  - http-outgoing-0 >> "Accept-Encoding: gzip,deflate[\r][\n]"
 [framework] 2016-07-06 07:26:19,416 - org.apache.http.wire -46909 [main] DEBUG org.apache.http.wire  - http-outgoing-0 >> "[\r][\n]"
 [framework] 2016-07-06 07:26:19,461 - org.apache.http.wire -46954 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "HTTP/1.1 200 OK[\r][\n]"
 [framework] 2016-07-06 07:26:19,461 - org.apache.http.wire -46954 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "Server: nginx/1.9.10[\r][\n]"
 [framework] 2016-07-06 07:26:19,461 - org.apache.http.wire -46954 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "Date: Tue, 05 Jul 2016 23:26:24 GMT[\r][\n]"
 [framework] 2016-07-06 07:26:19,461 - org.apache.http.wire -46954 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "Content-Type: application/x-javascript; charset=utf-8[\r][\n]"
 [framework] 2016-07-06 07:26:19,461 - org.apache.http.wire -46954 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "Content-Length: 66[\r][\n]"
 [framework] 2016-07-06 07:26:19,461 - org.apache.http.wire -46954 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "Connection: keep-alive[\r][\n]"
 [framework] 2016-07-06 07:26:19,461 - org.apache.http.wire -46954 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "Pragma: no-cache[\r][\n]"
 [framework] 2016-07-06 07:26:19,461 - org.apache.http.wire -46954 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "Cache-Control: no-cache; must-revalidate[\r][\n]"
 [framework] 2016-07-06 07:26:19,461 - org.apache.http.wire -46954 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "Expires: -1[\r][\n]"
 [framework] 2016-07-06 07:26:19,461 - org.apache.http.wire -46954 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "[\r][\n]"
 [framework] 2016-07-06 07:26:19,461 - org.apache.http.wire -46954 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "ptuiCB('66','0','','0','[0xe4][0xba][0x8c][0xe7][0xbb][0xb4][0xe7][0xa0][0x81][0xe6][0x9c][0xaa][0xe5][0xa4][0xb1][0xe6][0x95][0x88][0xe3][0x80][0x82](1301298524)', '');[\r][\n]"
 [framework] 2016-07-06 07:26:19,462 - org.apache.http.headers -46955 [main] DEBUG org.apache.http.headers  - http-outgoing-0 << HTTP/1.1 200 OK
 [framework] 2016-07-06 07:26:19,462 - org.apache.http.headers -46955 [main] DEBUG org.apache.http.headers  - http-outgoing-0 << Server: nginx/1.9.10
 [framework] 2016-07-06 07:26:19,462 - org.apache.http.headers -46955 [main] DEBUG org.apache.http.headers  - http-outgoing-0 << Date: Tue, 05 Jul 2016 23:26:24 GMT
 [framework] 2016-07-06 07:26:19,462 - org.apache.http.headers -46955 [main] DEBUG org.apache.http.headers  - http-outgoing-0 << Content-Type: application/x-javascript; charset=utf-8
 [framework] 2016-07-06 07:26:19,462 - org.apache.http.headers -46955 [main] DEBUG org.apache.http.headers  - http-outgoing-0 << Content-Length: 66
 [framework] 2016-07-06 07:26:19,462 - org.apache.http.headers -46955 [main] DEBUG org.apache.http.headers  - http-outgoing-0 << Connection: keep-alive
 [framework] 2016-07-06 07:26:19,462 - org.apache.http.headers -46955 [main] DEBUG org.apache.http.headers  - http-outgoing-0 << Pragma: no-cache
 [framework] 2016-07-06 07:26:19,462 - org.apache.http.headers -46955 [main] DEBUG org.apache.http.headers  - http-outgoing-0 << Cache-Control: no-cache; must-revalidate
 [framework] 2016-07-06 07:26:19,462 - org.apache.http.headers -46955 [main] DEBUG org.apache.http.headers  - http-outgoing-0 << Expires: -1
 [framework] 2016-07-06 07:26:19,462 - org.apache.http.impl.execchain.MainClientExec -46955 [main] DEBUG org.apache.http.impl.execchain.MainClientExec  - Connection can be kept alive indefinitely
 [framework] 2016-07-06 07:26:19,463 - org.apache.http.impl.conn.PoolingHttpClientConnectionManager -46956 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager  - Connection [id: 0][route: {s}->https://ssl.ptlogin2.qq.com:443] can be kept alive indefinitely
 [framework] 2016-07-06 07:26:19,463 - org.apache.http.impl.conn.PoolingHttpClientConnectionManager -46956 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager  - Connection released: [id: 0][route: {s}->https://ssl.ptlogin2.qq.com:443][total kept alive: 1; route allocated: 1 of 5; total allocated: 1 of 10]
 [framework] 2016-07-06 07:26:20,463 - org.apache.http.client.protocol.RequestAddCookies -47956 [main] DEBUG org.apache.http.client.protocol.RequestAddCookies  - CookieSpec selected: default
 [framework] 2016-07-06 07:26:20,464 - org.apache.http.client.protocol.RequestAddCookies -47957 [main] DEBUG org.apache.http.client.protocol.RequestAddCookies  - Cookie [version: 0][name: qrsig][value: LEo9qua-yFS9oTVDcmkdI4tnAEsJIK5m76-rCPxOzVDmjPrkPYdkUT23O-5teKYw][domain: ptlogin2.qq.com][path: /][expiry: null] match [(secure)ssl.ptlogin2.qq.com:443/ptqrlogin]
 [framework] 2016-07-06 07:26:20,464 - org.apache.http.client.protocol.RequestAuthCache -47957 [main] DEBUG org.apache.http.client.protocol.RequestAuthCache  - Auth cache not set in the context
 [framework] 2016-07-06 07:26:20,464 - org.apache.http.impl.conn.PoolingHttpClientConnectionManager -47957 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager  - Connection request: [route: {s}->https://ssl.ptlogin2.qq.com:443][total kept alive: 1; route allocated: 1 of 5; total allocated: 1 of 10]
 [framework] 2016-07-06 07:26:20,465 - org.apache.http.impl.conn.PoolingHttpClientConnectionManager -47958 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager  - Connection leased: [id: 0][route: {s}->https://ssl.ptlogin2.qq.com:443][total kept alive: 0; route allocated: 1 of 5; total allocated: 1 of 10]
 [framework] 2016-07-06 07:26:20,465 - org.apache.http.impl.conn.DefaultManagedHttpClientConnection -47958 [main] DEBUG org.apache.http.impl.conn.DefaultManagedHttpClientConnection  - http-outgoing-0: set socket timeout to 10000
 [framework] 2016-07-06 07:26:20,465 - org.apache.http.impl.execchain.MainClientExec -47958 [main] DEBUG org.apache.http.impl.execchain.MainClientExec  - Executing request GET /ptqrlogin?webqq_type=10&remember_uin=1&login2qq=1&aid=501004106&u1=http%3A%2F%2Fw.qq.com%2Fproxy.html%3Flogin2qq%3D1%26webqq_type%3D10&ptredirect=0&ptlang=2052&daid=164&from_ui=1&pttype=1&dumy=&fp=loginerroralert&action=0-0-157510&mibao_css=m_webqq&t=1&g=1&js_type=0&js_ver=10143&login_sig=&pt_randsalt=0 HTTP/1.1
 [framework] 2016-07-06 07:26:20,465 - org.apache.http.impl.execchain.MainClientExec -47958 [main] DEBUG org.apache.http.impl.execchain.MainClientExec  - Target auth state: UNCHALLENGED
 [framework] 2016-07-06 07:26:20,465 - org.apache.http.impl.execchain.MainClientExec -47958 [main] DEBUG org.apache.http.impl.execchain.MainClientExec  - Proxy auth state: UNCHALLENGED
 [framework] 2016-07-06 07:26:20,465 - org.apache.http.headers -47958 [main] DEBUG org.apache.http.headers  - http-outgoing-0 >> GET /ptqrlogin?webqq_type=10&remember_uin=1&login2qq=1&aid=501004106&u1=http%3A%2F%2Fw.qq.com%2Fproxy.html%3Flogin2qq%3D1%26webqq_type%3D10&ptredirect=0&ptlang=2052&daid=164&from_ui=1&pttype=1&dumy=&fp=loginerroralert&action=0-0-157510&mibao_css=m_webqq&t=1&g=1&js_type=0&js_ver=10143&login_sig=&pt_randsalt=0 HTTP/1.1
 [framework] 2016-07-06 07:26:20,465 - org.apache.http.headers -47958 [main] DEBUG org.apache.http.headers  - http-outgoing-0 >> User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36
 [framework] 2016-07-06 07:26:20,465 - org.apache.http.headers -47958 [main] DEBUG org.apache.http.headers  - http-outgoing-0 >> Referer: https://ui.ptlogin2.qq.com/cgi-bin/login?daid=164&target=self&style=16&mibao_css=m_webqq&appid=501004106&enable_qlogin=0&no_verifyimg=1&s_url=http%3A%2F%2Fw.qq.com%2Fproxy.html&f_url=loginerroralert&strong_login=1&login_state=10&t=20131024001
 [framework] 2016-07-06 07:26:20,465 - org.apache.http.headers -47958 [main] DEBUG org.apache.http.headers  - http-outgoing-0 >> Host: ssl.ptlogin2.qq.com
 [framework] 2016-07-06 07:26:20,466 - org.apache.http.headers -47959 [main] DEBUG org.apache.http.headers  - http-outgoing-0 >> Connection: Keep-Alive
 [framework] 2016-07-06 07:26:20,466 - org.apache.http.headers -47959 [main] DEBUG org.apache.http.headers  - http-outgoing-0 >> Cookie: qrsig=LEo9qua-yFS9oTVDcmkdI4tnAEsJIK5m76-rCPxOzVDmjPrkPYdkUT23O-5teKYw
 [framework] 2016-07-06 07:26:20,466 - org.apache.http.headers -47959 [main] DEBUG org.apache.http.headers  - http-outgoing-0 >> Accept-Encoding: gzip,deflate
 [framework] 2016-07-06 07:26:20,466 - org.apache.http.wire -47959 [main] DEBUG org.apache.http.wire  - http-outgoing-0 >> "GET /ptqrlogin?webqq_type=10&remember_uin=1&login2qq=1&aid=501004106&u1=http%3A%2F%2Fw.qq.com%2Fproxy.html%3Flogin2qq%3D1%26webqq_type%3D10&ptredirect=0&ptlang=2052&daid=164&from_ui=1&pttype=1&dumy=&fp=loginerroralert&action=0-0-157510&mibao_css=m_webqq&t=1&g=1&js_type=0&js_ver=10143&login_sig=&pt_randsalt=0 HTTP/1.1[\r][\n]"
 [framework] 2016-07-06 07:26:20,466 - org.apache.http.wire -47959 [main] DEBUG org.apache.http.wire  - http-outgoing-0 >> "User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36[\r][\n]"
 [framework] 2016-07-06 07:26:20,466 - org.apache.http.wire -47959 [main] DEBUG org.apache.http.wire  - http-outgoing-0 >> "Referer: https://ui.ptlogin2.qq.com/cgi-bin/login?daid=164&target=self&style=16&mibao_css=m_webqq&appid=501004106&enable_qlogin=0&no_verifyimg=1&s_url=http%3A%2F%2Fw.qq.com%2Fproxy.html&f_url=loginerroralert&strong_login=1&login_state=10&t=20131024001[\r][\n]"
 [framework] 2016-07-06 07:26:20,466 - org.apache.http.wire -47959 [main] DEBUG org.apache.http.wire  - http-outgoing-0 >> "Host: ssl.ptlogin2.qq.com[\r][\n]"
 [framework] 2016-07-06 07:26:20,466 - org.apache.http.wire -47959 [main] DEBUG org.apache.http.wire  - http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
 [framework] 2016-07-06 07:26:20,467 - org.apache.http.wire -47960 [main] DEBUG org.apache.http.wire  - http-outgoing-0 >> "Cookie: qrsig=LEo9qua-yFS9oTVDcmkdI4tnAEsJIK5m76-rCPxOzVDmjPrkPYdkUT23O-5teKYw[\r][\n]"
 [framework] 2016-07-06 07:26:20,467 - org.apache.http.wire -47960 [main] DEBUG org.apache.http.wire  - http-outgoing-0 >> "Accept-Encoding: gzip,deflate[\r][\n]"
 [framework] 2016-07-06 07:26:20,467 - org.apache.http.wire -47960 [main] DEBUG org.apache.http.wire  - http-outgoing-0 >> "[\r][\n]"
 [framework] 2016-07-06 07:26:20,573 - org.apache.http.wire -48066 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "HTTP/1.1 200 OK[\r][\n]"
 [framework] 2016-07-06 07:26:20,573 - org.apache.http.wire -48066 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "Server: nginx/1.9.10[\r][\n]"
 [framework] 2016-07-06 07:26:20,573 - org.apache.http.wire -48066 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "Date: Tue, 05 Jul 2016 23:26:25 GMT[\r][\n]"
 [framework] 2016-07-06 07:26:20,573 - org.apache.http.wire -48066 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "Content-Type: application/x-javascript; charset=utf-8[\r][\n]"
 [framework] 2016-07-06 07:26:20,573 - org.apache.http.wire -48066 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "Content-Length: 66[\r][\n]"
 [framework] 2016-07-06 07:26:20,573 - org.apache.http.wire -48066 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "Connection: keep-alive[\r][\n]"
 [framework] 2016-07-06 07:26:20,573 - org.apache.http.wire -48066 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "Pragma: no-cache[\r][\n]"
 [framework] 2016-07-06 07:26:20,573 - org.apache.http.wire -48066 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "Cache-Control: no-cache; must-revalidate[\r][\n]"
 [framework] 2016-07-06 07:26:20,573 - org.apache.http.wire -48066 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "Expires: -1[\r][\n]"
 [framework] 2016-07-06 07:26:20,573 - org.apache.http.wire -48066 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "[\r][\n]"
 [framework] 2016-07-06 07:26:20,573 - org.apache.http.wire -48066 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "ptuiCB('66','0','','0','[0xe4][0xba][0x8c][0xe7][0xbb][0xb4][0xe7][0xa0][0x81][0xe6][0x9c][0xaa][0xe5][0xa4][0xb1][0xe6][0x95][0x88][0xe3][0x80][0x82](2593137996)', '');[\r][\n]"
 [framework] 2016-07-06 07:26:20,574 - org.apache.http.headers -48067 [main] DEBUG org.apache.http.headers  - http-outgoing-0 << HTTP/1.1 200 OK
 [framework] 2016-07-06 07:26:20,574 - org.apache.http.headers -48067 [main] DEBUG org.apache.http.headers  - http-outgoing-0 << Server: nginx/1.9.10
 [framework] 2016-07-06 07:26:20,574 - org.apache.http.headers -48067 [main] DEBUG org.apache.http.headers  - http-outgoing-0 << Date: Tue, 05 Jul 2016 23:26:25 GMT
 [framework] 2016-07-06 07:26:20,574 - org.apache.http.headers -48067 [main] DEBUG org.apache.http.headers  - http-outgoing-0 << Content-Type: application/x-javascript; charset=utf-8
 [framework] 2016-07-06 07:26:20,574 - org.apache.http.headers -48067 [main] DEBUG org.apache.http.headers  - http-outgoing-0 << Content-Length: 66
 [framework] 2016-07-06 07:26:20,574 - org.apache.http.headers -48067 [main] DEBUG org.apache.http.headers  - http-outgoing-0 << Connection: keep-alive
 [framework] 2016-07-06 07:26:20,574 - org.apache.http.headers -48067 [main] DEBUG org.apache.http.headers  - http-outgoing-0 << Pragma: no-cache
 [framework] 2016-07-06 07:26:20,574 - org.apache.http.headers -48067 [main] DEBUG org.apache.http.headers  - http-outgoing-0 << Cache-Control: no-cache; must-revalidate
 [framework] 2016-07-06 07:26:20,574 - org.apache.http.headers -48067 [main] DEBUG org.apache.http.headers  - http-outgoing-0 << Expires: -1
 [framework] 2016-07-06 07:26:20,574 - org.apache.http.impl.execchain.MainClientExec -48067 [main] DEBUG org.apache.http.impl.execchain.MainClientExec  - Connection can be kept alive indefinitely
 [framework] 2016-07-06 07:26:20,575 - org.apache.http.impl.conn.PoolingHttpClientConnectionManager -48068 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager  - Connection [id: 0][route: {s}->https://ssl.ptlogin2.qq.com:443] can be kept alive indefinitely
 [framework] 2016-07-06 07:26:20,575 - org.apache.http.impl.conn.PoolingHttpClientConnectionManager -48068 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager  - Connection released: [id: 0][route: {s}->https://ssl.ptlogin2.qq.com:443][total kept alive: 1; route allocated: 1 of 5; total allocated: 1 of 10]

日志上显示机器人发送消息成功,但群里未收到

昨天和今天都出现刚刚扫码登陆的机器人,日志上显示机器人发送消息成功,但群里未收到。还有两个机器人是连续登了超过一天的,就能发送消息成功,群里能收到。登陆w.qq.com 用刚刚发消息不成功的QQ扫码登陆后,发送消息,群里也收不到,也是得到{"errCode":0,"msg":"send ok"}
这是被封号了吗?昨天过了几分钟后就正常了

获取登录二维码的时候出现Unsupported cookie policy: default错误

运行代码Application.java中的main方法的时候,出现如下错误:

com.scienjus.smartqq.client.SmartQQClient  - 开始获取二维码
Exception in thread "main" net.dongliu.requests.exception.RequestException: org.apache.http.client.ClientProtocolException
    at net.dongliu.requests.Client.execute(Client.java:175)
    at net.dongliu.requests.RequestBuilder.execute(RequestBuilder.java:36)
    at net.dongliu.requests.RequestBuilder.file(RequestBuilder.java:66)
    at com.scienjus.smartqq.client.SmartQQClient.getQRCode(SmartQQClient.java:120)
    at com.scienjus.smartqq.client.SmartQQClient.login(SmartQQClient.java:100)
    at com.scienjus.smartqq.client.SmartQQClient.<init>(SmartQQClient.java:77)
    at com.scienjus.smartqq.Application.main(Application.java:19)
Caused by: org.apache.http.client.ClientProtocolException
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:186)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
    at net.dongliu.requests.Client.execute(Client.java:172)
    ... 6 more
Caused by: org.apache.http.HttpException: Unsupported cookie policy: default
    at org.apache.http.client.protocol.RequestAddCookies.process(RequestAddCookies.java:150)
    at org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:131)
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:193)
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:86)
    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:108)
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
    ... 8 more

注:使用的httpclient的版本是4.3.6

获取二维码报错

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: timestamp check failed

Webqq修改二维码验证结果请求地址了?

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/http/client/CredentialsProvider

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/http/client/CredentialsProvider
at com.scienjus.smartqq.client.SmartQQClient.(SmartQQClient.java:62)
at com.scienjus.smartqq.Application.main(Application.java:18)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: java.lang.ClassNotFoundException: org.apache.http.client.CredentialsProvider
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 7 more

Process finished with exit code 1

发送消息失败

调用SmartQQClient.sendMessageToFriend出现:发送失败,Api返回码[{"retcode":1202,"errmsg":""}]
偶尔又可以发送成功,这是什么情况?

webQQ协议支持XML格式的QQ消息么

Hi, all 我想问一下Web QQ API可以发送自定义的xml信息么,就那种奇怪的红包或者什么群信息,窝自己写的可以发送纯文本,但是只要带上xml结构就发送失败报错100001, 有谁了解是否可以发送可否告知一下~ 谢谢=w=

请求失败,Http返回码[502]

Exception in thread "Thread-14" java.lang.RuntimeException: 请求失败,Http返回码[502]
at com.scienjus.smartqq.client.SmartQQClient.getJsonArrayResult(SmartQQClient.java:508)
at com.scienjus.smartqq.client.SmartQQClient.pollMessage(SmartQQClient.java:185)
at com.scienjus.smartqq.client.SmartQQClient.access$100(SmartQQClient.java:25)
at com.scienjus.smartqq.client.SmartQQClient$1.run(SmartQQClient.java:68)
at java.lang.Thread.run(Thread.java:745)
Exception in thread "Thread-15" java.lang.RuntimeException: 请求失败,Http返回码[502]
at com.scienjus.smartqq.client.SmartQQClient.getJsonArrayResult(SmartQQClient.java:508)
at com.scienjus.smartqq.client.SmartQQClient.pollMessage(SmartQQClient.java:185)
at com.scienjus.smartqq.client.SmartQQClient.access$100(SmartQQClient.java:25)
at com.scienjus.smartqq.client.SmartQQClient$1.run(SmartQQClient.java:68)
at java.lang.Thread.run(Thread.java:745)

不能长时间采集?

你好:
  我使用这个项目进行QQ信息采集,大概一两天就会断开,需要重新扫码后才能继续使用,而且每次断开后同一个QQ群的group_code就变了,这是怎么回事儿呢,怎么解决呢?

返回retcode =100012

@ScienJus 返回retcode =100012 是什么原因 我之前一直在返回100012 时 设置了smartqq进行重启动,认为其挂了,但还是不太清楚返回100012的原因

Connect to d1.web2.qq.com:443 [d1.web2.qq.com/58.247.205.43] failed: Connection timed out

在pollMessage()catch住 RequestException e异常
org.apache.http.conn.ConnectTimeoutException: Connect to d1.web2.qq.com:443 [d1.web2.qq.com/58.247.205.43] failed: Connection timed out
这是服务器的原因吗?之后机器人能正常运行。

堆栈信息:代码有所变动,行号与此项目的行号不一致
net.dongliu.requests.exception.RequestException: org.apache.http.conn.ConnectTimeoutException: Connect to d1.web2.qq.com:443 [d1.web2.qq.com/58.247.205.43] failed: Connection timed out
at net.dongliu.requests.Client.execute(Client.java:175)
at net.dongliu.requests.RequestBuilder.execute(RequestBuilder.java:36)
at net.dongliu.requests.RequestBuilder.text(RequestBuilder.java:51)
at com.scienjus.smartqq.client.SmartQQClient.post(SmartQQClient.java:655)
at com.scienjus.smartqq.client.SmartQQClient.pollMessage(SmartQQClient.java:258)
at com.scienjus.smartqq.client.SmartQQClient.access$100(SmartQQClient.java:34)
at com.scienjus.smartqq.client.SmartQQClient$1.run(SmartQQClient.java:102)

pollMessage()进行try-catch 捕获到异常信息 syntax error, pos 1

pollMessage()进行try-catch 捕获到异常信息 syntax error, pos 1
堆栈信息
com.alibaba.fastjson.JSONException: syntax error, pos 1
at com.alibaba.fastjson.parser.DefaultJSONParser.parse(DefaultJSONParser.java:1295)
at com.alibaba.fastjson.parser.DefaultJSONParser.parse(DefaultJSONParser.java:1205)
at com.alibaba.fastjson.JSON.parse(JSON.java:109)
at com.alibaba.fastjson.JSON.parse(JSON.java:100)
at com.alibaba.fastjson.JSON.parseObject(JSON.java:171)
at com.scienjus.smartqq.client.SmartQQClient.pollMessage(SmartQQClient.java:257)
at com.scienjus.smartqq.client.SmartQQClient.access$100(SmartQQClient.java:34)
at com.scienjus.smartqq.client.SmartQQClient$1.run(SmartQQClient.java:102)
at java.lang.Thread.run(Thread.java:745)
因为自己有添加逻辑,代码行数不一样。com.scienjus.smartqq.client.SmartQQClient.pollMessage(SmartQQClient.java:257) 这里报错的代码是JSONObject json = JSON.parseObject(response.getBody());

每天第一次登录就会出现103

com.scienjus.smartqq.client.SmartQQClient - 正在登录,请稍后
com.scienjus.smartqq.client.SmartQQClient - 请求失败,Api返回码[103]。你需要进入http://w.qq.com,检查是否能正常接收消息。如果可以的话点击[设置]->[退出登录]后查看是否恢复正常
我的好友
com.scienjus.smartqq.client.SmartQQClient - java.net.SocketException: Socket closed

每天第一次登录就会出现103,得进入官网登录一次才能回复正常。

NoClassDefFoundError

Caused by: java.lang.ClassNotFoundException: org.apache.http.client.CredentialsProvider

刚改得日志记录不对

17:10:07.291 [main] INFO c.w.b.s.s.q.s.c.SmartQQClient - 开始发送群消息
17:10:07.440 [main] ERROR c.w.b.s.s.q.s.c.SmartQQClient - 发送群消息成功。。。。这块改成 info 吧

 if (result != null && result == 0) {
                LOGGER.error("发送讨论组消息成功");
         }

咱们是geeker,对吧

无法接收消息 (请求失败,Api返回码[15])

运行环境:

系统: Windows 10 Pro 14986 Insider Preview [Build 14986.rs_prerelease.161202-1928]
IDE: IntelliJ IDEA Community Edition 2016.3.2
JRE: 1.8.0_111-b14
JDK: 8u112

提出issue前(2016.12.31)clone的repo,有人发送消息时触发异常,master分支与java8分支均存在问题
更换登录账号或更换网络环境后暂时恢复正常,一段时间(5分钟-1小时不等)后问题复现。问题出现后,立即进入 w.qq.com ,发现无法接收消息,但可以正常发送。
但仅长时间(我测试了10小时左右)登录 WebQQ(不使用机器人),则不会出现该问题,总能正常收发消息。
个人猜测与请求次数过多有关。(我的主号加了近100个群= =,登录5分钟左右后就会出问题)

控制台输出:(java8分支)

net.dongliu.requests.exception.RequestsException: 请求失败,Api返回码[15]
	at 包名.client.SmartQQClient.getResponseJson(SmartQQClient.java:639)
	at 包名.client.SmartQQClient.getJsonObjectResult(SmartQQClient.java:606)
	at 包名.client.SmartQQClient.getGroupInfo(SmartQQClient.java:482)
	at 包名.主类名.getGroupName(主类名.java:139)
	at 包名.主类名.access$200(主类名.java:16)
	at 包名.主类名$1.onGroupMessage(主类名.java:39)
	at 包名.主类名.SmartQQClient.pollMessage(SmartQQClient.java:207)
	at 包名.主类名.SmartQQClient.access$100(SmartQQClient.java:25)
	at 包名.主类名.SmartQQClient$1.run(SmartQQClient.java:72)
	at java.lang.Thread.run(Thread.java:745)

SmartQQ不稳定如何解决

你好,2016年11月21日smartQQ完全登陆不了,w.qq.com登陆后的功能也多有异常。
我更想问问除了smartqq外还有什么其他更稳定的QQ消息的集成方式吗?
想做个QQ聊天机器人但是苦于没找到集成途径,好不容易有个smartQQ,还不稳定。。

java.lang.RuntimeException: 请求失败,Api返回码[100000]

Exception in thread "main" java.lang.RuntimeException: 请求失败,Api返回码[100000]
at com.scienjus.smartqq.client.SmartQQClient.getJsonObjectResult(SmartQQClient.java:500)
at com.scienjus.smartqq.client.SmartQQClient.getVfwebqq(SmartQQClient.java:136)
at com.scienjus.smartqq.client.SmartQQClient.login(SmartQQClient.java:83)
at com.scienjus.smartqq.client.SmartQQClient.(SmartQQClient.java:57)
at QQListenService.main(QQListenService.java:22)

长轮训poll2失败

我发现直接轮训poll2消息会失败.
如果在浏览器上登陆webqq后,在使用爬虫的话则会成功.
请问您知道这个问题吗?您知道如何解决吗?

信息发送不出去啊亲

client.sendMessageToXXXX(long,string) 调用这个方法 log信息显示发送成功,实际上没有收到信息,是什么情况?

部署smartqq到linux报错,异地登陆问题

QQservice.java 453行报错

private void sendMessageToGroup(final Long groupId, final String msg) {
    Group group = QQ_GROUPS.get(groupId);
    if (null == group) {
        reloadGroups();

        group = QQ_GROUPS.get(groupId);
    }

    if (null == group) {

获取不到group,求解!

接收消息丢失数据

感谢你提供的接口,我想用来开发我们组织的专门的机器人,但是我测试的时候发现丢失数据,私聊的时候有一半的数据都丢掉了。我也不知道是我使用的原因还是接口存在的问题。所以想来咨询下!

请求失败,Api返回码[100000]

Exception in thread "main" java.lang.RuntimeException: 请求失败,Api返回码[100000]
    at com.scienjus.smartqq.client.SmartQQClient.getResponseJson(SmartQQClient.java:589)
    at com.scienjus.smartqq.client.SmartQQClient.getJsonObjectResult(SmartQQClient.java:557)
    at com.scienjus.smartqq.client.SmartQQClient.getVfwebqq(SmartQQClient.java:199)
    at com.scienjus.smartqq.client.SmartQQClient.login(SmartQQClient.java:111)
    at com.scienjus.smartqq.client.SmartQQClient.<init>(SmartQQClient.java:85)
    at com.scienjus.smartqq.Application.main(Application.java:29)
``

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.