Yowsup是一个Whatsapp API。我已将它安装在我的计算机上,但我找不到在其中注册手机的命令。我试过谷歌搜索它,但我发现的所有命令都是旧版本的Yowsup,现在已经改变了。任何解释相同的教程或文档都将不胜感激。
我尝试了下面答案中提到的命令,但是我收到了以下错误:
Traceback (most recent call last):
File "/usr/local/bin/yowsup-cli", line 4, in <module>
__import__('pkg_resources').run_script('yowsup2==2.4.48', 'yowsup-cli')
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 735, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1659, in run_script
exec(script_code, namespace, namespace)
File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.4.48-py2.7.egg/EGG-INFO/scripts/yowsup-cli", line 323, in <module>
File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.4.48-py2.7.egg/EGG-INFO/scripts/yowsup-cli", line 158, in process
File "/usr/local/lib/python2.7/dist-packages/yowsup2-2.4.48-py2.7.egg/EGG-INFO/scripts/yowsup-cli", line 176, in handleRequestCode
File "build/bdist.linux-x86_64/egg/yowsup/registration/coderequest.py", line 46, in send
File "build/bdist.linux-x86_64/egg/yowsup/common/http/warequest.py", line 73, in send
File "build/bdist.linux-x86_64/egg/yowsup/common/http/warequest.py", line 111, in sendGetRequest
File "build/bdist.linux-x86_64/egg/yowsup/common/http/warequest.py", line 167, in sendRequest
File "/usr/lib/python2.7/httplib.py", line 1052, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python2.7/httplib.py", line 1092, in _send_request
self.endheaders(body)
File "/usr/lib/python2.7/httplib.py", line 1048, in endheaders
self._send_output(message_body)
File "/usr/lib/python2.7/httplib.py", line 892, in _send_output
self.send(msg)
File "/usr/lib/python2.7/httplib.py", line 854, in send
self.connect()
File "/usr/lib/python2.7/httplib.py", line 1273, in connect
server_hostname=server_hostname)
File "/usr/lib/python2.7/ssl.py", line 352, in wrap_socket
_context=self)
File "/usr/lib/python2.7/ssl.py", line 579, in __init__
self.do_handshake()
File "/usr/lib/python2.7/ssl.py", line 808, in do_handshake
self._sslobj.do_handshake()
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:590)
任何想法如何解决?
答案 0 :(得分:0)
在github中,您可以找到注册电话号码的确切命令。我安装了yowsup的最新版本(v2.4.48),它的工作原理如文档中所述。
yowsup-cli registration --requestcode sms --phone 34XXXXXXXX --cc 34 --mcc 123 --mnc 456
在互联网上可以找到mcc和mnc代码,例如wikipedia中的西班牙代码都是需要的代码。
您将收到如下内容:
INFO:yowsup.common.http.warequest: {"status":"sent","length":6,"method":"sms","retry_after":64,"sms_wait":64,"voice_wait":64}
status: sent
retry_after: 64
length: 6
method: sms
这将向您发送注册所需的SMS代码。检查您的手机是否有新短信,您会看到123-456
等代码。
使用此代码,您现在可以注册您的whatsapp:
yowsup-cli registration --register 123-456 --phone 34XXXXXXXX --cc 34 --mcc 123 --mnc 456
您将在输出中收到确认信息:
INFO:yowsup.common.http.warequest:{"status":"ok","login":"49XXXXXXX","type":"existing","pw":"****************","expiration":55555555555.0,"kind":"free","price":"0,89 \u20ac","cost":"0.89","currency":"EUR","price_expiration":1461485976}
status: ok
kind: free
pw: **********************
price: 0,89 €
price_expiration: 1461485976
currency: EUR
cost: 0.89
expiration: 55555555555.0
login: 34XXXXXXXX
type: existing
将密码复制到yowsup.config
:
cc=34
phone=34XXXXXXXX
password=**********************
然后您可以使用此命令执行yowsup(对于echo演示示例):
yowsup-cli demos -c yowsup.config -e
答案 1 :(得分:0)
现在的密码(PW)已替换为client_static_keypair
。从CLI复制它,然后粘贴到配置文件中,而不要粘贴密钥"client_static_keypair"
上的密码。
异常文本帮助我找到了它:"Setting a password in Config is deprecated and not used anymore. client_static_keypair is used instead"