Giter VIP home page Giter VIP logo

pual_bot's Introduction

pual_bot 一个弱智的QQ机器人

pual_bot 是基于twqq的高效的支持并发的WebQQ机器人, 其主要功能有 执行Python代码, 贴代码, 英汉互译

测试QQ

我在VPS上跑了一个测试的, 大家可以把这个号拉进群里进行调戏1685359365

安装配置

程序依赖 可使用 easy_install 安装

必装依赖

easy_install twqq

可选依赖

easy_install http-parser regex requests pyxmpp2

有些插件依赖于 bs4, 所以可以通过 apt 安装

sudo apt-get install python-bs4

初始化配置文件

config.py.example重命名为 config.py, 填入QQ号码和密码配置, 执行webqq.py脚本.

    mv doc/config.py.example config.py

最近更新

2014-06-25

  • 插件优先级机制
  • 更新添加插件
  • 更新 Simsimi 接口

2014-03-05

  • 增加讨论组支持

2014-01-16

  • 增加插件机制
  • 更改原先的消息处理机制, 使用插件机制来处理消息

2013-11-27

  • 在遇到踢出时首先尝试重新登录(需更新 twqq 包)

2013-11-15

TODO

  • 修复群成员列表获取
  • 修复临时消息
  • 对代码重构
  • 提取文档
  • 去除废弃代码
  • 将代码提取出一个包

pual_bot's People

Contributors

coldnight avatar jseagull avatar recall704 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pual_bot's Issues

linux网络环境需要用到http proxy代理的情况下无法登录

如题,在http Proxy条件下,无法登录(系统已配置http_proxy 环境变量,并可联网),请指点~
执行python2 webqq.py之后,反馈内容如下:
[W 140601 17:58:23 requests:70] 没有获取到 Login Sig, 重新获取

  • Hostname was found in DNS cache
  • Trying 111.30.131.126...

被腾迅封了!

输入验证码后,提示限制异常登陆.PC手动登陆web.qq.com,可以使用。

群消息响应失败

我在群里发送指令后,控制台日志里面显示机器人回复成功了,但是我在QQ里却没有收到。
下面是部分日志记录(我设置“大雄”为机器人的nickname了):

[I 140829 11:26:48 requests:440] 获取消息: {u'retcode': 0, u'result': [{u'poll_type': u'group_message', u'value': {u'reply_ip': 180064301, u'group_code': 1494019774, u'seq': 26019, u'msg_type': 43, u'send_uin': 581530372, u'info_seq': 79614930, u'msg_id': 29092, u'content': [[u'font', {u'color': u'0080ff', u'style': [1, 0, 0], u'name': u'Tahoma', u'size': 10}], u'\u5927\u96c4 '], u'msg_id2': 843024, u'from_uin': 2976486328, u'time': 1409282808, u'to_uin': 1213380834}}]}
[I 140829 11:26:48 hub:571] 获取消息: [{u'poll_type': u'group_message', u'value': {u'reply_ip': 180064301, u'group_code': 1494019774, u'seq': 26019, u'msg_type': 43, u'send_uin': 581530372, u'info_seq': 79614930, u'msg_id': 29092, u'content': [[u'font', {u'color': u'0080ff', u'style': [1, 0, 0], u'name': u'Tahoma', u'size': 10}], u'\u5927\u96c4 '], u'msg_id2': 843024, u'from_uin': 2976486328, u'time': 1409282808, u'to_uin': 1213380834}}]
[I 140829 11:26:48 __init__:89] Plugin SimSimiPlugin handled message 大雄
[I 140829 11:26:48 client:68] [群消息] 1494019774: 夸客 ==> 大雄 
* Hostname was found in DNS cache
*   Trying 112.95.242.171...
* Rebuilt URL to: http://www.simsimi.com/?
* Found bundle for host www.simsimi.com: 0x327fa10
* Re-using existing connection! (#16) with host www.simsimi.com
* Connected to www.simsimi.com (54.236.144.23) port 80 (#16)
> GET /? 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.simsimi.com
Accept: */*
Accept-Encoding: gzip,deflate
Cookie: AWSELB=B9551BF112497261E578B202D2B846B8A14A9E16497C786DB8922E1E6A69C0E9D6C41B7353F357B9385B46EBC3D8C20423580E4174B0C3EF4724DB56B6C005AE715398E96A; Filtering=0.0; sid=s%3AH5K5iv8VYHlooUXNtamg9Oqs.ZbqSeNMpsTGj%2BiRkiZ0L90p2n%2BUSCcShKLYX3a3V0Fk; Filtering=0.0
Accept-Charset: UTF-8,*;q=0.5
Connection: keep-alive

* Found bundle for host d.web2.qq.com: 0x2d99980
* Hostname was found in DNS cache
*   Trying 112.95.242.171...
* Connected to d.web2.qq.com (112.95.242.171) port 80 (#19)
> POST /channel/poll2 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: p_skey=blA*GBmO3nx7jOeAG*KA5Fo23QArYzZhOUGOG1BTpXE_; p_uin=o1213380834; pt4_token=hGuwt-6cSSJAxNZuyau87Q__; RK=Mg8eyfwQYb; pt2gguin=o1213380834; ptcz=2a476ed1d4f27da07a6d31f28a5a88a8f5920922722e54233006d18b38f2bef9; ptisp=cm; ptwebqq=874c503d346b9df201ee7b5319e2fd9c8d6546212fec2a15123f8499e1f86877; skey=@Hf2QFaNzE; uin=o1213380834; verifysession=h02ZrmQ6ZkYlcSsqpz3gM4tbkYfAhnfATKAgNjUltdWONR7NMFJnQCpGaUVUn5i9yDuQLpLb2oWgImXxFuWQSXIQw**
Origin: http://d.web2.qq.com
Accept-Charset: UTF-8,*;q=0.5
Connection: keep-alive
Referer: https://d.web2.qq.com/cfproxy.html?v=20110331002&callback=1
Content-Length: 583
Content-Type: application/x-www-form-urlencoded

* Connected to d.web2.qq.com (112.95.242.171) port 80 (#18)
> POST /channel/send_qun_msg2 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: p_skey=blA*GBmO3nx7jOeAG*KA5Fo23QArYzZhOUGOG1BTpXE_; p_uin=o1213380834; pt4_token=hGuwt-6cSSJAxNZuyau87Q__; RK=Mg8eyfwQYb; pt2gguin=o1213380834; ptcz=2a476ed1d4f27da07a6d31f28a5a88a8f5920922722e54233006d18b38f2bef9; ptisp=cm; ptwebqq=874c503d346b9df201ee7b5319e2fd9c8d6546212fec2a15123f8499e1f86877; skey=@Hf2QFaNzE; uin=o1213380834; verifysession=h02ZrmQ6ZkYlcSsqpz3gM4tbkYfAhnfATKAgNjUltdWONR7NMFJnQCpGaUVUn5i9yDuQLpLb2oWgImXxFuWQSXIQw**
Origin: http://d.web2.qq.com
Accept-Charset: UTF-8,*;q=0.5
Connection: keep-alive
Referer: https://d.web2.qq.com/cfproxy.html?v=20110331002&callback=1
Content-Length: 895
Content-Type: application/x-www-form-urlencoded

< HTTP/1.1 302 Moved Temporarily
< Access-Control-Allow-Headers: Content-Type, Authorization, Content-Length, X-Requested-With
< Access-Control-Allow-Methods: GET,PUT,POST,DELETE,OPTIONS
< Access-Control-Allow-Origin: *
< Content-Type: text/plain; charset=UTF-8
< Date: Fri, 29 Aug 2014 03:26:48 GMT
< Location: /talk.htm
< Vary: Accept, Accept-Encoding
< X-Powered-By: Express
< Content-Length: 43
< Connection: keep-alive
< 
* Ignoring the response-body
* Connection #16 to host www.simsimi.com left intact
* Issue another request to this URL: 'http://www.simsimi.com/talk.htm'
* Found bundle for host www.simsimi.com: 0x327fa10
* Re-using existing connection! (#16) with host www.simsimi.com
* Connected to www.simsimi.com (54.236.144.23) port 80 (#16)
> GET /talk.htm 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.simsimi.com
Accept: */*
Accept-Encoding: gzip,deflate
Cookie: AWSELB=B9551BF112497261E578B202D2B846B8A14A9E16497C786DB8922E1E6A69C0E9D6C41B7353F357B9385B46EBC3D8C20423580E4174B0C3EF4724DB56B6C005AE715398E96A; Filtering=0.0; sid=s%3AH5K5iv8VYHlooUXNtamg9Oqs.ZbqSeNMpsTGj%2BiRkiZ0L90p2n%2BUSCcShKLYX3a3V0Fk; Filtering=0.0
Accept-Charset: UTF-8,*;q=0.5
Connection: keep-alive

< HTTP/1.1 200 OK
< Date: Fri, 29 Aug 2014 03:26:48 GMT
< Content-Type: text/plain; charset=utf-8
< Content-Length: 29
< Cache-Control: no-cache
< Connection: close
< 
* Closing connection 18
[I 140829 11:26:48 requests:45] [群消息] 夸客: 小的在 ==> 1494019774 成功
< HTTP/1.1 302 Moved Temporarily
< Access-Control-Allow-Headers: Content-Type, Authorization, Content-Length, X-Requested-With
< Access-Control-Allow-Methods: GET,PUT,POST,DELETE,OPTIONS
< Access-Control-Allow-Origin: *
< Content-Type: text/plain; charset=UTF-8
< Date: Fri, 29 Aug 2014 03:26:48 GMT
< Location: /language.htm
< Vary: Accept, Accept-Encoding
< X-Powered-By: Express
< Content-Length: 47
< Connection: keep-alive
< 
* Ignoring the response-body
* Connection #16 to host www.simsimi.com left intact
* Issue another request to this URL: 'http://www.simsimi.com/language.htm'
* Found bundle for host www.simsimi.com: 0x327fa10
* Re-using existing connection! (#16) with host www.simsimi.com
* Connected to www.simsimi.com (54.236.144.23) port 80 (#16)
> GET /language.htm 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.simsimi.com
Accept: */*
Accept-Encoding: gzip,deflate
Cookie: AWSELB=B9551BF112497261E578B202D2B846B8A14A9E16497C786DB8922E1E6A69C0E9D6C41B7353F357B9385B46EBC3D8C20423580E4174B0C3EF4724DB56B6C005AE715398E96A; Filtering=0.0; sid=s%3AH5K5iv8VYHlooUXNtamg9Oqs.ZbqSeNMpsTGj%2BiRkiZ0L90p2n%2BUSCcShKLYX3a3V0Fk; Filtering=0.0
Accept-Charset: UTF-8,*;q=0.5
Connection: keep-alive

< HTTP/1.1 200 OK
< Access-Control-Allow-Headers: Content-Type, Authorization, Content-Length, X-Requested-With
< Access-Control-Allow-Methods: GET,PUT,POST,DELETE,OPTIONS
< Access-Control-Allow-Origin: *
< Content-Encoding: gzip
< Content-Type: text/html; charset=utf-8
< Date: Fri, 29 Aug 2014 03:26:49 GMT
< ETag: "991066145"
< Vary: Accept-Encoding
< X-Powered-By: Express
< transfer-encoding: chunked
< Connection: keep-alive
< 
* Connection #16 to host www.simsimi.com left intact
* Found bundle for host www.simsimi.com: 0x327fa10
* Re-using existing connection! (#16) with host www.simsimi.com
* Connected to www.simsimi.com (54.236.144.23) port 80 (#16)
> POST /func/setProfile 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.simsimi.com
Accept-Encoding: gzip,deflate
Cookie: AWSELB=B9551BF112497261E578B202D2B846B8A14A9E16497C786DB8922E1E6A69C0E9D6C41B7353F357B9385B46EBC3D8C20423580E4174B0C3EF4724DB56B6C005AE715398E96A; Filtering=0.0; sid=s%3AH5K5iv8VYHlooUXNtamg9Oqs.ZbqSeNMpsTGj%2BiRkiZ0L90p2n%2BUSCcShKLYX3a3V0Fk; Filtering=0.0
Accept-Language: zh-cn,en_us;q=0.7,en;q=0.3
Accept: application/json, text/javascript, */*; q=0.01
Referer: http://www.simsimi.com/set_profile_frameview.htm
Accept-Charset: UTF-8,*;q=0.5
Connection: keep-alive
Cookie: simsimi_uid=52125598
X-Requested-With: XMLHttpRequest
Content-Type: application/json; charset=utf-8
Content-Length: 22

< HTTP/1.1 400 Bad Request
< Access-Control-Allow-Headers: Content-Type, Authorization, Content-Length, X-Requested-With
< Access-Control-Allow-Methods: GET,PUT,POST,DELETE,OPTIONS
< Access-Control-Allow-Origin: *
< Content-Type: text/html
< Date: Fri, 29 Aug 2014 03:26:49 GMT
< Vary: Accept-Encoding
< X-Powered-By: Express
< Content-Length: 11
< Connection: keep-alive
* HTTP error before end of send, stop sending
< 
* Closing connection 16
* Hostname was NOT found in DNS cache
* Resolving timed out after 501 milliseconds
* Closing connection 20
[I 140829 11:27:33 requests:408] 心跳...

问问twqq的版本选用问题?

我试了下面两个版本,0.17.0 不能登录,0.2.11报下面的错,版本选择需要注意什么吗?之前有跑起来过,现在似乎有变化。 谢谢!
twqq-0.17.0
twqq-0.2.11
/usr/local/lib/python2.7/dist-packages/twqq-0.2.11-py2.7.egg/twqq/requests.py:309: UserWarning: In next version we will rename twqq.requests.FreindInfoRequest to twqq.requests.FriendListRequest

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.