xhan / qqbot

基于WebQQ协议的QQ机器人。命令行工具,Hubot支持!
MIT License
1.42k stars 383 forks source link

无法登陆 #43

Open smartwsw opened 9 years ago

smartwsw commented 9 years ago

登陆会报错10003 好像是因为腾讯把smartqq改成了只能二维码登陆

violarulan commented 9 years ago

+10086

floatinghotpot commented 9 years ago

这是个很好的项目,如果废弃实在可惜了。昨天我加上了二维码扫描认证登录的功能,已经向原作者提交PR,不知道他能否看到。

除此之外,我还增加了一些其它的小功能,想先睹为快的,可以来看看我的版本:https://github.com/floatinghotpot/qqbot

或者直接安装使用:

$ [sudo] npm install -g smartqq-bot
$ qqbot
xros commented 9 years ago

@floatinghotpot I have gotten this error after that I installed smartqq-bot on my PC.

Then I did node main.js

/home/alex/joy/npm_proj/node_modules/smartqq-bot/src/qqauth-qrcode.js:305 check_sig_get_cookies, ^ SyntaxError: Unexpected token , at exports.runInThisContext (vm.js:73:16) at Module._compile (module.js:443:25) at Object.Module._extensions..js (module.js:478:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Module.require (module.js:365:17) at require (module.js:384:17) at Object. (/home/alex/joy/npm_proj/node_modules/smartqq-bot/main.js:7:14) at Object. (/home/alex/joy/npm_proj/node_modules/smartqq-bot/main.js:67:4) at Module._compile (module.js:460:26)

Do you know how to fix this? Thanks!

floatinghotpot commented 9 years ago

sorry, it's a bug of typo error. should be check_sig_get_cookies: check_sig_get_cookies,

i've fixed it, please update to v1.6.1

$ [sudo] npm install smartqq-bot
xros commented 9 years ago

@floatinghotpot thanks for the patching. But I still got another error

/home/alex/joy/npm_proj/node_modules/smartqq-bot/src/defaults.js:8 var path = Path.join(os.homedir(), '.tmp', 'store.json'); ^ TypeError: undefined is not a function at Object. (/home/alex/joy/npm_proj/node_modules/smartqq-bot/src/defaults.js:8:27) at Object. (/home/alex/joy/npm_proj/node_modules/smartqq-bot/src/defaults.js:48:4) at Module._compile (module.js:460:26) at Object.Module._extensions..js (module.js:478:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Module.require (module.js:365:17) at require (module.js:384:17) at Object. (/home/alex/joy/npm_proj/node_modules/smartqq-bot/main.js:10:18) at Object. (/home/alex/joy/npm_proj/node_modules/smartqq-bot/main.js:67:4)

I would assume that was an error only about paths, right?

floatinghotpot commented 9 years ago

no no ... it seems that module is not found, weird ... i will double check the code, and give you feedback.

floatinghotpot commented 9 years ago

which version of nodejs are you using? on linux or mac?

xros commented 9 years ago

@floatinghotpot I am on Ubuntu14.04 AMD64, npm --version == 2.10.1 . It fails if directory .tmp was created by hand.

floatinghotpot commented 9 years ago

it works fine on my host, with nodejs v4.2.1.

i mean node -v or nodejs -v, if the nodejs is too old, i just guess var Path = require('path') may not have join() function.

BTW, you can use npm install -g n to install/manage nodejs versions easily. https://github.com/tj/n

xros commented 9 years ago

@floatinghotpot node -v v0.12.4

I have not installed nodejs. So are they two different packages? I have zero knowledge to nodejs. I would try it later if i got time.

Thank you anyway

yanboz commented 9 years ago

@floatinghotpot

hitokoto失效中, 似乎是原来coffee版的robot.request.get无法使用了. 是否在JS版中实现?

lazybios commented 9 years ago

@xros I have the same problem. I solved it by update node version. you can follow [https://github.com/tj/n]() document.

@floatinghotpot I have a new problem. When I execute qqbot , it tell me below message:

dyld: bad external relocation length
[1]    72902 trace trap  qqbot

what's wrong?

flyingnn commented 9 years ago

@floatinghotpot smartqqbot centos 6 报错:os.homedir() 大意是没有这个对象;

然后只能用这个代替:

function getUserHome() { return process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME']; }

floatinghotpot commented 9 years ago

是不是 nodejs 版本的问题?

可以考虑升级到 nodejs v4.x,参考:https://nodejs.org/en/download/package-manager/

flyingnn commented 9 years ago

的确是版本问题

flyingnn commented 8 years ago

@floatinghotpot 又无法登录了:

floatinghotpot commented 8 years ago

是的,腾讯又改了webqq的通讯协议,登录的最后一个环节报错,暂时还没时间去详细分析

xros commented 8 years ago

@floatinghotpot Next time tencent would do something like what 12306 did to make people very difficult to get into its system. That's called "Object Recognition". Think about the global market rather some regions. No matter how hard you try, you just can not get a persistent and stable proxy to tencent. Unless someone was employed by tencent or he had business with it. He would get the internal API and not suffer anymore. The unfair fact is that tencent charges.

floatinghotpot commented 8 years ago

smartqq-bot 已经修复了,请更新。感谢两位网友 ScienJus 和 thegfw 提供的帮助。

[sudo] npm install -g smartqq-bot
blambin commented 8 years ago

@floatinghotpot 你那边没法留issue,我写在这里吧。 我在用webapi的时候 ,调用 ip:3200/stdin 的时候 ,qq就挂掉了 ,我想远程接收信息,这个能修复么。

[Mon Jan 11 2016 08:00:10 GMT-0500 (EST)] DEBUG polling...
[Mon Jan 11 2016 08:00:25 GMT-0500 (EST)] DEBUG [api] /stdin

/usr/lib/node_modules/smartqq-bot/plugins/apiserver.js:178
      value = params.value.trim();
                           ^
TypeError: Cannot call method 'trim' of undefined
at APIServer.on_stdin (/usr/lib/node_modules/smartqq-bot/plugins/apiserver.js:178:28)
at APIServer.<anonymous> (/usr/lib/node_modules/smartqq-bot/plugins/apiserver.js:152:25)
at APIServer.handle_request (/usr/lib/node_modules/smartqq-bot/plugins/apiserver.js:173:10)
at Server.<anonymous> (/usr/lib/node_modules/smartqq-bot/plugins/apiserver.js:115:26)
at Server.emit (events.js:98:17)
at HTTPParser.parser.onIncoming (http.js:2113:12)
at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:122:23)
at Socket.socket.ondata (http.js:1971:22)
at TCP.onread (net.js:528:27)
wujianguo commented 8 years ago

@floatinghotpot 请问下你的 smartqq-bot 可以能否直接用在 hubot 上?貌似需要修改代码?

floatinghotpot commented 8 years ago

hubot我没用过,不熟悉

hoojianliang commented 8 years ago

hi,我一直停留在step 1。 我是使用 smartqq-bot 的

uwang commented 7 years ago

smartqq-bot 也无法正常运行了:

vagrant@dev:~$ qqbot
[Thu Jul 20 2017 15:34:48 GMT+0800 (CST)] INFO 登录 step0 - 登录方式检测
[Thu Jul 20 2017 15:34:48 GMT+0800 (CST)] INFO 登录 step0.5 获取二维码
[Thu Jul 20 2017 15:34:48 GMT+0800 (CST)] NOTICE 请用 手机QQ 扫描该地址的二维码图片-> http://localhost:3100
[Thu Jul 20 2017 15:34:48 GMT+0800 (CST)] INFO 登录 step1 等待二维码校验结果
[Thu Jul 20 2017 15:35:09 GMT+0800 (CST)] INFO 登录 step2 cookie 获取 ptwebqq
[Thu Jul 20 2017 15:35:09 GMT+0800 (CST)] INFO 登录 step3 获取 vfwebqq
[Thu Jul 20 2017 15:35:09 GMT+0800 (CST)] INFO 登录 step4 获取 uin, psessionid
[Thu Jul 20 2017 15:35:10 GMT+0800 (CST)] INFO 登录成功
[Thu Jul 20 2017 15:35:10 GMT+0800 (CST)] INFO 登录 step5 获取 好友列表
[Thu Jul 20 2017 15:35:10 GMT+0800 (CST)] DEBUG Loading Plugin help
[Thu Jul 20 2017 15:35:10 GMT+0800 (CST)] DEBUG Loading Plugin debug
[Thu Jul 20 2017 15:35:10 GMT+0800 (CST)] DEBUG Loading Plugin apiserver
[Thu Jul 20 2017 15:35:10 GMT+0800 (CST)] INFO api server started at port 3200
[Thu Jul 20 2017 15:35:10 GMT+0800 (CST)] INFO fetching buddy list...
[Thu Jul 20 2017 15:35:10 GMT+0800 (CST)] INFO fetching group list...
[Thu Jul 20 2017 15:35:10 GMT+0800 (CST)] INFO fetching discuss group list
[Thu Jul 20 2017 15:35:10 GMT+0800 (CST)] INFO update discuss group list
[Thu Jul 20 2017 15:35:10 GMT+0800 (CST)] INFO fetching all groupmember...
[Thu Jul 20 2017 15:35:10 GMT+0800 (CST)] DEBUG updating all: all 3 finished 2 success 2
[Thu Jul 20 2017 15:35:10 GMT+0800 (CST)] INFO fetching account info: type1, uin500088096
解析出错 http://s.web2.qq.com/api/get_friend_uin2 <html><head><title>Apache Tomcat/7.0.50 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The requested resource is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/7.0.50</h3></body></html>
[Thu Jul 20 2017 15:35:10 GMT+0800 (CST)] DEBUG updating all: all 3 finished 3 success 2
[Thu Jul 20 2017 15:35:10 GMT+0800 (CST)] ERROR 获取信息失败,再次尝试
[Thu Jul 20 2017 15:35:10 GMT+0800 (CST)] INFO fetching buddy list...
[Thu Jul 20 2017 15:35:10 GMT+0800 (CST)] INFO fetching group list...
[Thu Jul 20 2017 15:35:10 GMT+0800 (CST)] INFO fetching discuss group list
[Thu Jul 20 2017 15:35:10 GMT+0800 (CST)] INFO update discuss group list
[Thu Jul 20 2017 15:35:10 GMT+0800 (CST)] INFO fetching all groupmember...
[Thu Jul 20 2017 15:35:10 GMT+0800 (CST)] DEBUG updating all: all 3 finished 2 success 2
[Thu Jul 20 2017 15:35:11 GMT+0800 (CST)] INFO fetching account info: type1, uin500088096
解析出错 http://s.web2.qq.com/api/get_friend_uin2 <html><head><title>Apache Tomcat/7.0.50 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The requested resource is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/7.0.50</h3></body></html>
[Thu Jul 20 2017 15:35:11 GMT+0800 (CST)] DEBUG updating all: all 3 finished 3 success 2
[Thu Jul 20 2017 15:35:11 GMT+0800 (CST)] ERROR 获取信息失败,请重新运行