Skip to main content

Python client for MAX messenger

Project description

vkmax

Python user client for VK MAX messenger (OneMe) with userbot and ToS avoiding features

What is VK MAX?

MAX (internal code name OneMe) is another project by the Russian government in an attempt to create a unified domestic messaging platform with features such as login via the government services account (Gosuslugi/ESIA).
It is developed by VK Group.
As usual, the application is extremely poorly made: all your contacts, login info and private messages are sent over the network in plain text without any encryption (besides TLS).

What is vkmax?

This is a client library for VK MAX, allowing to create userbots and custom clients.
An example of a simple userbot that retrieves weather can be found at examples/weather-userbot.

Protocol

The packet consists of five JSON fields:

  • ver (int) - currently it's 11
  • seq (int) - packet incremental ID. Request and response seq match.
  • cmd (int[0, 1]) - 0 for outgoing packets, 1 for incoming packets
  • opcode (int) - RPC method ID
  • payload (json) - arbitrary

Authorization flow

  1. Connect to websocket wss://ws-api.oneme.ru/websocket
  2. Send hello packet:
    {
     "userAgent": {
         "deviceType": "WEB",
         "locale": "ru_RU",
         "osVersion": "macOS",
         "deviceName": "vkmax Python",
         "headerUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36",
         "deviceLocale": "ru-RU",
         "appVersion": APP_VERSION,
         "screen": "956x1470 2.0x",
         "timezone": "Asia/Vladivostok"
        },
     "deviceId": str(uuid.uuid4())
    }
    
  3. Start auth:
    {
        "ver":11,
        "cmd":0,
        "seq":1,
        "opcode":17,
        "payload":{
           "phone":"phone",
           "type":"START_AUTH",
           "language":"ru"
        }
     }
    
    After that websocket sends a packet with sms_token to client
  4. Confirm SMS code:
    {
     "token": sms_token,
     "verifyCode": str(sms_code),
     "authTokenType": "CHECK_CODE"
    }
    
    Now you are logged in.

Client flow

Baseline packet looks like:

{
   "ver": RPC_VERSION,
   "cmd": 0, 
   "seq": seq,
   "opcode": opcode,
   "payload": payload
}

Known opcodes are listed in opcodes.md file.
Example of using baseline packet to send message:

{
  "ver": 11,
  "cmd": 0,
  "seq": seq,
  "opcode": 64,
  "payload": {
    "chatId": to_chat_id,
    "message": {
      "text": "text you need to send",
      "cid": 175xxxxxxxxxx,
      "elements": [],
      "attaches": []
    },
    "notify": true
  }
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vkmax-1.0.1.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vkmax-1.0.1-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file vkmax-1.0.1.tar.gz.

File metadata

  • Download URL: vkmax-1.0.1.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for vkmax-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e9ac8d22c3b7c86decf0b62a23c14784990c28dba9dded2501d07b5ca3bf7d63
MD5 953ad92b3fdf73662ecf9fa350943490
BLAKE2b-256 3210648acebb2a11fbbe2f6edfc40e29ad4dc6674b7662c6e5f46bf25310615a

See more details on using hashes here.

File details

Details for the file vkmax-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: vkmax-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for vkmax-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6120c8be6860d022fd4f09b7fe0338273146ae22780dcd5370f93f5cbaaebe7e
MD5 cd11d702a29cfc61102530629c5eacf6
BLAKE2b-256 b1d42c3fa836e8e39b87b76dee478e744b4febd7d7c58f8b1e1f2485cd016a5e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page