Twitch Highlight
A Twitch highlight extraction tool for extracting clips and segments from Twitch streams.
Configuration
This application requires Twitch API credentials to function. You need to set up a .env file in the root of the project with the following environment variables:
TWITCH_NICKNAME=your_twitch_username
TWITCH_OAUTH_TOKEN=oauth:your_oauth_token
TWITCH_CLIENT_ID=your_client_id
Getting Twitch Credentials
You have a few options to get your OAuth token:
- Go to https://twitchtokengenerator.com/
- Click "Connect with Twitch" to authorize
- Select the scopes you need (e.g., "Chat: Read Chat", "Chat: Send Chat Messages")
- Copy the generated token (it will start with
oauth:)
4. Your Twitch Nickname
This is simply your Twitch username (the one you use to log in). For example, if your Twitch channel is https://twitch.tv/yourname, your nickname is yourname.
Setting Up the .env File
Create a .env file in the project root directory:
TWITCH_NICKNAME=relicjamin1
TWITCH_OAUTH_TOKEN=oauth:your_actual_token_here
TWITCH_CLIENT_ID=your_actual_client_id_here
Important: Never commit your .env file to version control. The .env file is already included in .gitignore.
Installation
pip install -e .
For development dependencies:
pip install -e ".[dev]"
Usage
python ./src/main.py
Development
# Run tests
pytest
# Format code
black .
# Lint
ruff check .
# Type check
mypy src/