Yowsup身份验证don'

2024-10-01 15:46:54 发布

您现在位置:Python中文网/ 问答频道 /正文

我想用这个漂亮的图书馆做些测试。在

我已经用yowsupcli成功地进行了测试,但是现在我想创建一个小python脚本来以智能方式管理事件(使用listener/callback)。在

我正在尝试这里解释的代码https://github.com/tgalal/yowsup/wiki/Yowsup-Library-Documentation

def onAuthSuccess(username):
print "Logged in with %s" % s
# make a call to method ready to be able to receive messages
methodsInterface.call("ready")


y = YowsupConnectionManager()
signalsInterface = y.getSignalsInterface()
methodsInterface = y.getMethodsInterface()
signalsInterface.registerListener("auth_success", onAuthSuccess)
methodsInterface.call("auth_login", ("username", "password"))

很明显,用户名应该是nationNumber+phoneNumber,没有其他符号。但我不清楚密码应该在哪里找到。 对于cli,身份验证机制不同,它需要注册。在

你能帮帮我吗?谢谢


Tags: to脚本auth图书馆智能方式事件username
2条回答

你可能想写信

import base64

尽管如此,这对我仍然不起作用,尽管使用yowsupcli发送消息很好。在

在身份验证方面似乎仍然存在着我不理解的区别。在

如果有人遇到了同样的问题,即身份验证不起作用,尽管您将正确的用户名和密码作为参数传递,您必须像在命令行客户机中那样对密码进行base64编码。在

您必须通过使用Yowsup或WART注册或从您的手机(https://github.com/tgalal/yowsup/issues/234?)在

 import base 64
 password= 'randomletters+somenumbers=' #Get this by registering
 password = base64.b64decode(bytes(rawPass.encode('utf-8'))) 

这并不明显,我经常忘记,可能是出了什么问题。在

相关问题 更多 >

    热门问题