初玩whatsapp 的命令行小伙伴

whatsapp 的命令行小伙伴

环境:仅限在中国大陆地区联通手机用户
网络:无需翻墙

update:

whatapp会封第三方的接口,这方面的问题没有法子,希望网友自行解决。

本文提供思路,而且是2016年的尝试,仅供参考


1 注册

请求注册

`
yowsup-cli registration –requestcode sms –phone 86xxx######## –cc 86 –mcc 460 –mnc 01

`

INFO:yowsup.common.http.warequest:{"status":"sent","length":6,"method":"sms","retry_after":65,"sms_wait":65,"voice_wait":65}

status: sent
retry_after: 65
length: 6
method: sms

使用注册码,get密码

yowsup-cli registration --register ***-*** --phone 86xxx######## --cc 86

status: ok
kind: free
pw: &&&
price: ¥6.00
price_expiration: 1471558176
currency: CNY
cost: 6.00
expiration: 4444444444.0
login: 86xxx########
type: existing

2 使用

预先配置账号config
## Actual config starts below ##    
 cc=86 #if not specified it will be autodetected
 phone=86xxxxxxxxxx
 password=xxxxxxxxxxxxxxx=
demo登陆


yowsup-cli demos --yowsup --config config

勤用/help

列举常用命令

/L                                                          Quick login         
/message       broadcast      <numbers> <content>           Broadcast message. numbers should comma separated phone numbers
/message       send           <number> <content>            Send message to a friend
/image         send           <number> <path> [caption]     Send an image with optional caption
/groups        create         <subject> [jids]              Create a new group with the specified subject and participants. Jids are a comma separated list but optional.
/audio         send           <number> <path>               Send audio file     
正式登陆

输入/L姐可以登陆

发消息


/message send 86xxxxxxxxxx "This is a message sent from 甲苯狗"

收消息

当然就是等待

Alt text

结果在这里

3 小结

文本双向通信OK
多媒体有option支持,但我的环境尝试不稳定

4 其他

issue send wav to phone
  File "/usr/local/lib/python2.7/dist-packages/yowsup/layers/protocol_media/protocolentities/message_media_downloadable_audio.py", line 96, in fromFilePath
    entity = DownloadableMediaMessageProtocolEntity.fromFilePath(fpath, url, DownloadableMediaMessageProtocolEntity.MEDIA_TYPE_AUDIO, ip, to, mimeType, preview)
AttributeError: type object 'DownloadableMediaMessageProtocolEntity' has no attribute 'fromFilePath'

ERROR:yowsup.demos.cli.layer:Upload file /home/noya/Desktop/ambeHome/english_sample/espeak/wav8k/numbers/six.wav to https://mmi678.whatsapp.net/u/OC3hgm1TvTJnC6q9nfk8RreZuOUABTfM-jyi9A/Ak1pLOyURps9-V9sL7D6xZRkkpB3za1UXDml37fcDK-- for 86#########@s.whatsapp.net failed!
bug time when receive UTF-8 words
    MESSAGE_ID = message.getId()
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-3: ordinal not in range(128)

bug time when get audio
  File "/usr/local/lib/python2.7/dist-packages/yowsup/layers/axolotl/layer_receive.py", line 88, in handleEncMessage
    self.handleWhisperMessage(node)
  File "/usr/local/lib/python2.7/dist-packages/yowsup/layers/axolotl/layer_receive.py", line 144, in handleWhisperMessage
    self.parseAndHandleMessageProto(encMessageProtocolEntity, plaintext[:-padding])
  File "/usr/local/lib/python2.7/dist-packages/yowsup/layers/axolotl/layer_receive.py", line 204, in parseAndHandleMessageProto
    raise ValueError("Unhandled")
ValueError: Unhandled

bug 多媒体当前bug状态

Alt text

issue 重发message情形

Alt text

to try 一条命令发送text


python yowsup-cli demos -c /root/.yowsup/config -s 441234567890 "Hola"
python yowsup-cli demos -c /root/.yowsup/config -s 441234567890 "Hola" -n "Happy birthday"

more for this tip

参考


official guide : yowsup-cli

guide :WhatsApp on Raspberry Pi

whatsapp 年费政策介绍
whatsapp 免费介绍

工业支持情况

intel 论坛态度 支持whatsapp

多媒体支持

多媒体在yowsup上面的支持情况

offical : Upload and send Media
2014年支持 多媒体的方案

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值