Installation
Requirements
Python 3.9 or newer.
Install from PyPI
Install from source
Dependencies
These install automatically:
| Package | What it does |
|---|---|
aiohttp |
Async HTTP client for API calls and uploads |
requests |
Sync HTTP for token retrieval |
websockets |
WebSocket client for the OK.ru protocol |
munch |
Turns dicts into objects for message attributes |
selectolax |
Fast HTML parser for profile scraping |
sulguk |
Converts HTML to OK.ru's entity format |
Getting an AUTHCODE
You need the AUTHCODE cookie from ok.ru:
- Log in to ok.ru in your browser
- Open Developer Tools (F12) → Application → Cookies
- Find the
AUTHCODEcookie and copy its value
This cookie is what authorizes your bot. Keep it private — anyone with your AUTHCODE can send messages as your bot.