Python library for interacting with the Chaturbate Events API
This project has been archived.
The maintainers of this project have marked this project as archived. No new releases are expected.
Project description
Chaturbate Poller
Python library and CLI for monitoring Chaturbate Events API. Real-time event tracking with automatic error handling and optional InfluxDB integration.
Features
- Real-time event monitoring - Chat messages, tips, room status changes, and user interactions
- Robust error handling - Automatic retries with exponential backoff and connection recovery
- Structured data output - Clean event formatting with type-safe models
- Database integration - Optional InfluxDB support for analytics and time-series data
- Flexible configuration - Environment variables, CLI options, or programmatic setup
Installation
Using uv (recommended)
uv pip install chaturbate-poller
Using pip
pip install chaturbate-poller
CLI without installation
uvx chaturbate_poller start
API Token
Generate your API token at https://chaturbate.com/statsapi/authtoken/ with "Events API" permission.
Quick Start
CLI Usage
# Direct credentials
chaturbate_poller start --username your_username --token your_token
# Testbed environment
chaturbate_poller start --testbed --verbose
# Environment configuration
chaturbate_poller start
Environment Configuration
Create a .env file in your project root:
CB_USERNAME="your_chaturbate_username"
CB_TOKEN="your_chaturbate_token"
# Optional InfluxDB configuration
INFLUXDB_URL="http://influxdb:8086"
INFLUXDB_TOKEN="your_influxdb_token"
INFLUXDB_ORG="chaturbate-poller"
INFLUXDB_BUCKET="events"
Usage
CLI Options
chaturbate_poller start [OPTIONS]
Key options:
--username TEXT- Chaturbate username--token TEXT- API token--timeout FLOAT- Request timeout in seconds (default: 10.0)--database- Enable InfluxDB integration--testbed- Use testbed environment--verbose- Enable detailed logging
Docker
docker run -e CB_USERNAME="username" -e CB_TOKEN="token" \
ghcr.io/mountaingod2/chaturbate_poller:latest --verbose
Docker Compose
cp .env.example .env
# Configure credentials in .env
docker-compose up -d
Programmatic Usage
Basic Client
import asyncio
from chaturbate_poller import ChaturbateClient
async def main():
async with ChaturbateClient("username", "token") as client:
url = None
while True:
response = await client.fetch_events(url)
for event in response.events:
print(f"Event: {event.method}")
print(event.model_dump_json(indent=2))
url = response.next_url
asyncio.run(main())
Event Handling
from chaturbate_poller import ChaturbateClient, format_message
async def process_events():
async with ChaturbateClient("username", "token") as client:
url = None
while True:
response = await client.fetch_events(url)
for event in response.events:
if event.method == "tip":
amount = event.object.tip.tokens
user = event.object.user.username
print(f"Tip: {user} -> {amount} tokens")
elif event.method == "chatMessage":
message = format_message(event)
print(f"Chat: {message}")
url = response.next_url
InfluxDB Integration
Enable with --database flag to store events for analytics. See sample queries for data analysis examples.
Development
git clone https://github.com/MountainGod2/chaturbate_poller.git
cd chaturbate_poller
uv sync --all-extras
uv run pytest
Documentation
Contributing
Pull requests welcome. Fork the repository, create a feature branch, add tests, and submit a PR.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chaturbate_poller-5.1.8.tar.gz.
File metadata
- Download URL: chaturbate_poller-5.1.8.tar.gz
- Upload date:
- Size: 236.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de25552af2a06f6d5dcdb7ee38b862f91ec9cba333d8b05e8ae551c657414baa
|
|
| MD5 |
cadc0743bb38e64285ec20a069fdd64a
|
|
| BLAKE2b-256 |
bff33ea36fd8cd7cc803a4e0f18bbde7ea13e06dc53a07630d4669e8837e4404
|
Provenance
The following attestation bundles were made for chaturbate_poller-5.1.8.tar.gz:
Publisher:
manual-release.yml on MountainGod2/chaturbate_poller
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chaturbate_poller-5.1.8.tar.gz -
Subject digest:
de25552af2a06f6d5dcdb7ee38b862f91ec9cba333d8b05e8ae551c657414baa - Sigstore transparency entry: 408947348
- Sigstore integration time:
-
Permalink:
MountainGod2/chaturbate_poller@e59cba2827a878540141974c756d7789caa1a248 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/MountainGod2
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
manual-release.yml@e59cba2827a878540141974c756d7789caa1a248 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file chaturbate_poller-5.1.8-py3-none-any.whl.
File metadata
- Download URL: chaturbate_poller-5.1.8-py3-none-any.whl
- Upload date:
- Size: 31.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e886f9526c59c6ca1847bbd5892c3d60cd989d3e8fbc6fab76054d72c7e0caf
|
|
| MD5 |
3d57d2530a0dddc0dca802c90a4cb971
|
|
| BLAKE2b-256 |
0ee75495c0756aa29946065bac36fa1a7cf2fad04f413463dedb9305befbb916
|
Provenance
The following attestation bundles were made for chaturbate_poller-5.1.8-py3-none-any.whl:
Publisher:
manual-release.yml on MountainGod2/chaturbate_poller
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chaturbate_poller-5.1.8-py3-none-any.whl -
Subject digest:
1e886f9526c59c6ca1847bbd5892c3d60cd989d3e8fbc6fab76054d72c7e0caf - Sigstore transparency entry: 408947359
- Sigstore integration time:
-
Permalink:
MountainGod2/chaturbate_poller@e59cba2827a878540141974c756d7789caa1a248 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/MountainGod2
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
manual-release.yml@e59cba2827a878540141974c756d7789caa1a248 -
Trigger Event:
workflow_dispatch
-
Statement type: