Run the application
yt-summarizer supports two storage modes:
- Filesystem mode requires no Notion credentials and writes an OKF bundle to
docs/by default. - Notion mode reads and updates a Notion database. You can also enable filesystem output to keep a local copy.
Run without Notion
Provide a playlist URL to populate a local bundle:
yt_summarizer \
--playlist-url "https://www.youtube.com/playlist?list=PLAYLIST_ID" \
--model "ollama/llama3.2" \
--api-base "http://localhost:11434" \
--workers 4
Use --output-dir to write somewhere other than docs/:
yt_summarizer \
--playlist-url "https://www.youtube.com/playlist?list=PLAYLIST_ID" \
--output-dir "knowledge" \
--model "ollama/llama3.2"
--output-dir selects filesystem mode even if NOTION_DATABASE_ID is set in
the environment. To use a GitHub collection such as
yt-conferences, check it
out locally and pass its directory as --output-dir.
Run with Notion
The application reads a Notion token from /etc/notion/secrets.txt by default.
For local testing, put configuration in a .env file in the directory where
you run yt_summarizer:
NOTION_TOKEN=your-notion-token-here
NOTION_DATABASE_ID=your-database-id
LLM_MODEL=ollama/llama3.2
LLM_API_BASE=http://localhost:11434
Then run the CLI with no credential or model flags:
yt_summarizer
The CLI loads .env automatically. Variables already exported in the shell
take precedence over .env, and command-line options take precedence over both.
The repository ignores .env files; do not commit credentials.
Alternatively, you can:
- Create the token file (recommended for production):
echo "your-notion-token-here" > /etc/notion/secrets.txt
chmod 600 /etc/notion/secrets.txt
- Or use environment variable (for quick testing):
export NOTION_TOKEN="your-notion-token-here"
Then execute the CLI with your Notion database ID:
yt_summarizer --notion-db-id "your-database-id" --model "ollama/llama3.2" --api-base "http://localhost:11434"
Or specify a custom token file location:
yt_summarizer --notion-db-id "your-database-id" --notion-token-file "/path/to/token/file"
You can combine Notion input with a playlist. Existing URLs are skipped, and new playlist videos are added to the current processing queue:
yt_summarizer \
--notion-db-id "your-database-id" \
--playlist-url "https://www.youtube.com/playlist?list=PLAYLIST_ID" \
--model "ollama/llama3.2"
Configuration options
During video processing, the CLI displays an overall progress bar and a bar for each worker, showing completed/assigned videos, percentage, and remaining videos. Videos are assigned to worker queues in round-robin order. Each bar advances after a video has finished processing and storage. The executive summary starts after all videos finish and has a separate spinner.
In an interactive terminal, the bars update in place. Redirected output records progress snapshots without terminal cursor-control sequences.
--notion-db-id: Notion database ID (required, or setNOTION_DATABASE_IDenvironment variable)--notion-token-file: Path to file containing Notion API token (default:/etc/notion/secrets.txt, or setNOTION_TOKEN_FILE)--model: LLM model identifier (default:ollama/llama3.2, or setLLM_MODEL)--api-base: LLM API base URL (default:http://localhost:11434, or setLLM_API_BASE)--playlist-url: Optional YouTube playlist URL to add to the queue--workers: Number of videos to process concurrently (defaults to the CPU core count, or setWORKERS)--output-dir: OKF bundle root. Defaults todocsin filesystem mode, or is disabled when omitted with Notion mode. When set, an environment-providedNOTION_DATABASE_IDis ignored; pass--notion-db-idexplicitly to enable both storage backends.--proxy-username: Optional Webshare proxy username, or setPROXY_USERNAME--proxy-password: Optional Webshare proxy password, or setPROXY_PASSWORD--log-level: Logging verbosity - DEBUG, INFO, WARNING, ERROR, or CRITICAL (default: INFO)
If you use Ollama locally, make sure the service is running before starting the CLI.
When the configured LLM endpoint cannot be reached, the CLI now exits with a specific connection error that includes the failing --api-base and model values.
Environment Variables
| Name | Default | Description |
|---|---|---|
| NOTION_TOKEN | Notion API token - overrides token file (optional) | |
| NOTION_TOKEN_FILE | /etc/notion/secrets.txt | Path to file containing Notion API token |
| NOTION_DATABASE_ID | Optional Notion database ID | |
| LLM_MODEL | ollama/llama3.2 | LLM model identifier for analysis |
| LLM_API_BASE | http://localhost:11434 |
Base URL for the LLM API endpoint |
| OUTPUT_DIR | OKF bundle root | |
| WORKERS | CPU core count | Number of videos to process concurrently |
| PROXY_USERNAME | Optional Webshare proxy username | |
| PROXY_PASSWORD | Optional Webshare proxy password |
NOTION_TOKEN takes precedence over NOTION_TOKEN_FILE when both are set.
For models whose name starts with github_copilot/, the application uses the
provider default endpoint unless --api-base is explicitly supplied.
Notion database schema
The database must expose a URL property named URL.
The application reads these properties when present:
IDis used internally to update an existing page.Titlestores the YouTube title.URLstores the canonical video URL.Transcriptcan provide an existing transcript, although the current filesystem writer does not persist it.Summarystores the generated summary.Main pointsorMain Pointsstores the generated bullet points.
When writing to Notion, the application updates Title, URL, Summary, and
Main Points. Records without a URL are skipped.
Run in Docker
When running with Docker, mount the secrets file:
docker run -v /path/to/secrets.txt:/etc/notion/secrets.txt \
-e NOTION_DATABASE_ID="your-database-id" \
yt-summarizer:latest
Or pass the token via environment variable:
docker run \
-e NOTION_TOKEN="your-notion-token-here" \
-e NOTION_DATABASE_ID="your-database-id" \
yt-summarizer:latest
Run the tests
To run the test suite, use the make test command.
This will clean up any build artifacts, ensure the required dependencies are installed, and execute the tests using tox.
make test
Ensure that you have the necessary tools installed, such as uvx, which will be automatically installed if missing.
Troubleshoot common problems
Common Issues
-
Unreachable LLM Endpoint: Ensure the
--api-baseURL is correct and the LLM service is running. The CLI will provide a specific connection error message with details about the failing--api-baseand model values. -
Video cannot be summarized: The video may be private, deleted, age-restricted, unplayable, missing captions, or missing captions in the supported languages:
es,es-419,en,en-US, anden-GB. -
Playlist extraction fails: Verify that the playlist URL is public and that
yt-dlpcan reach YouTube. -
Notion authentication fails: Check the token value, database ID, and that the integration has access to the database. An empty token file is rejected.