• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

p4kl0nc4t/kyros: Python wrapper for WhatsApp Web API websocket communication (ba ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

p4kl0nc4t/kyros

开源软件地址:

https://github.com/p4kl0nc4t/kyros

开源编程语言:

HTML 97.2%

开源软件介绍:

Kyros

Kyros, for now, is a Python interface to communicate easier with WhatsApp Web API. It provides an interface to connect and communicate with WhatsApp Web's websocket server. Kyros will handle encryption and decryption kind of things. In the future, Kyros is aimed to provide a full implementation of WhatsApp Web API which will give developers a clean interface to work with (more or less like go-whatsapp). This module is designed to work with Python 3.6 or latest. Special thanks to the creator of whatsapp-web-reveng and go-whatsapp. This project is largely motivated by their work. Please note that Kyros is not meant to be used actively in production servers as it is currently not production ready. Use it at your own risk.

Installation

Kyros could be installed by using pip or directly cloning it then invoking setup.py. For example, if you want to use pip, run the following command:

pip install git+https://[email protected]/p4kl0nc4t/kyros

Documentation

A simple example

import asyncio
import logging

import pyqrcode

import kyros

logging.basicConfig()
# set a logging level: just to know if something (bad?) happens
logging.getLogger("kyros").setLevel(logging.WARNING)

async def main():
    # create the Client instance using create class method
    whatsapp = await kyros.Client.create()
    
    # do a QR login
    qr_data, scanned = await whatsapp.qr_login()
    
    # generate qr code image
    qr_code = pyqrcode.create(qr_data)
    print(qr_code.terminal(quiet_zone=1))

    try:
        # wait for the QR code to be scanned
        await scanned
    except asyncio.TimeoutError:
        # timed out (left unscanned), do a shutdown
        await whatsapp.shutdown()
        return
    
    # how to send a websocket message
    message = kyros.WebsocketMessage(None, ["query", "exist", "[email protected]"])
    await whatsapp.websocket.send_message(message)

    # receive a websocket message
    print(await whatsapp.websocket.messages.get(message.tag))


if __name__ == "__main__":
    asyncio.run(main())

A "much more detailed documentation" kind of thing for this project is available here. You will see a piece of nightmare, happy exploring! Better documentation are being planned.

Contribution

This work is still being slowly developed. Your contribution will of course make the development process of this project even faster. Any kind of contribution is highly appreciated.

License

This project is licensed with MIT License.

Disclaimer

This code is in no way affiliated with, authorized, maintained, sponsored or endorsed by WhatsApp or any of its affiliates or subsidiaries. This is an independent and unofficial software. Use at your own risk.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Apibug/apibug.github.io: qq查手机,q绑,8eqq发布时间:2022-06-13
下一篇:
sigalor/whatsapp-web-reveng: Reverse engineering WhatsApp Web.发布时间:2022-06-13
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap