# Troubleshooting Common RedditVideoMakerBot Issues: A Complete Technical Guide

> Resolve common RedditVideoMakerBot issues with this technical guide. Fix FFmpeg, API credential, and TTS engine problems easily. Learn to troubleshoot and configure your bot for success.

- Repository: [Lewis Menelaws/RedditVideoMakerBot](https://github.com/elebumm/RedditVideoMakerBot)
- Tags: how-to-guide
- Published: 2026-04-08

---

**TLDR: Most RedditVideoMakerBot failures stem from missing FFmpeg binaries, invalid Reddit API credentials in config.toml, or misconfigured TTS engine settings, all of which are diagnosable through specific error handlers in [`main.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/main.py) and [`utils/settings.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/utils/settings.py) and resolvable through targeted configuration updates.**

RedditVideoMakerBot is a Python 3.10+ application that transforms Reddit threads into short videos through a pipeline involving PRAW API interaction, Playwright screenshot capture, and FFmpeg video assembly. When troubleshooting common RedditVideoMakerBot issues, developers must trace failures through specific modules: configuration validation occurs in [`utils/settings.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/utils/settings.py), Reddit data fetching in [`reddit/subreddit.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/reddit/subreddit.py), and final rendering in [`video_creation/final_video.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/video_creation/final_video.py). This guide provides exact file references, line numbers, and resolution steps for the seven most frequent failure points.

## Fixing FFmpeg Installation and Detection Errors

The bot requires FFmpeg for video processing, validated during startup by [`utils/ffmpeg_install.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/utils/ffmpeg_install.py).

**Symptom:** The program aborts with `FFmpeg is not installed on this system` or raises `FileNotFoundError` during video assembly.

**Root Cause:** The [`ffmpeg_install.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/ffmpeg_install.py) module checks for the FFmpeg executable in the system PATH. The automatic installation only supports Windows, Linux (apt), and macOS (Homebrew) platforms.

**Platform-Specific Solutions:**

- **Windows:** Execute the bot once and confirm the automatic download prompt. The script downloads and extracts FFmpeg from the URL defined at lines 10-13 of [`utils/ffmpeg_install.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/utils/ffmpeg_install.py), then requires a system restart to update PATH variables.
- **Linux:** Ensure sudo privileges are available; the script executes `sudo apt install ffmpeg` automatically. For manual installation, place the `ffmpeg` binary in the working directory or add it to PATH.
- **macOS:** Install Homebrew first (`/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"`), then run the bot to trigger `brew install ffmpeg`.

If automatic installation fails, manually download a static FFmpeg build and place the binary in the project root or system PATH.

## Resolving Configuration Validation Failures in config.toml

Configuration errors occur when [`utils/settings.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/utils/settings.py) detects missing or malformed values against the [`.config.template.toml`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/.config.template.toml) schema.

**Symptom:** Repeated input prompts or `ValueError` exceptions such as "Please set the config variable STREAMLABS_POLLY_VOICE".

**Technical Details:** The `check` function at line 24 of [`utils/settings.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/utils/settings.py) validates each key. Required keys trigger interactive prompts when missing, while optional keys defaulting to `NotImplemented` cause downstream crashes.

**Critical Configuration Sections:**

- **`settings.tts.tiktok_sessionid`** – Required for TikTok voice; blank values trigger validation errors at [`main.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/main.py) lines 99-102. Obtain a fresh session cookie from the TikTok web UI.
- **`settings.tts.streamlabs_polly_voice`** – Must match the allowed voices list defined in [`TTS/streamlabs_polly.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/TTS/streamlabs_polly.py) lines 10-25. Valid options include: Brian, Emma, Russell, Joey, Matthew, Joanna, Kimberly, Amy, Geraint, Nicole, Justin, Ivy, Kendra, Salli, and Raveena.
- **`settings.tts.elevenlabs_api_key`** – Missing keys cause 401 unauthorized errors in [`TTS/elevenlabs.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/TTS/elevenlabs.py). Generate a valid API key from the ElevenLabs dashboard.
- **`settings.reddit.client_id` and `client_secret`** – Invalid credentials raise `ResponseException` caught at [`main.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/main.py) lines 122-124.

**Quick Fix:** Delete offending lines from [`config.toml`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/config.toml) and restart the bot. The startup sequence at [`main.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/main.py) lines 90-95 regenerates missing configuration entries automatically.

## Repairing Reddit API Authentication Errors

Authentication failures occur during PRAW initialization in [`reddit/subreddit.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/reddit/subreddit.py).

**Symptom:** Abort message reading `## Invalid credentials` followed by `Please check your credentials in the config.toml file`.

**Diagnosis:** The `praw.Reddit` instance creation fails when `client_id`, `client_secret`, `username`, or `password` values are incorrect, revoked, or malformed. The exception propagates to [`main.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/main.py) lines 122-124 where it is caught and converted to a user-friendly error message.

**Resolution Workflow:**

1. Navigate to https://www.reddit.com/prefs/apps and create a **script** type application.
2. Copy the 14-character `client_id` displayed beneath the app name and the `client_secret` value.
3. Update [`config.toml`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/config.toml) under the `[reddit]` section with these values plus your Reddit username and password.
4. Re-run the bot; the settings validator will prompt for confirmation of new values.

## Handling TTS Rate-Limiting and Service Errors

Text-to-speech failures manifest when [`utils/voice.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/utils/voice.py) detects API constraints or authentication errors in TTS engines.

**Symptom:** Console messages stating "Error occurred calling Streamlabs Polly" or HTTP 429 (Too Many Requests) responses.

**Mechanism:** Each engine implements rate-limit checking through `check_ratelimit` in [`utils/voice.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/utils/voice.py). Upon receiving 429 errors, engines like `StreamlabsPolly.run` (lines 51-53) attempt recursive retries, but persistent failures require manual intervention.

**Engine-Specific Fixes:**

- **Streamlabs Polly** – Insert `time.sleep(1)` delays between calls in [`TTS/streamlabs_polly.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/TTS/streamlabs_polly.py) to reduce request frequency, or verify daily quota limits.
- **OpenAI TTS** – Validate `openai_api_key` in config.toml has available credits and correct permissions.
- **TikTok** – Replace stale `sessionid` cookies; 403 errors indicate expired authentication.
- **ElevenLabs** – Ensure API key is present; the engine raises `ValueError` immediately if the key is missing.

To bypass problematic cloud services, switch to the offline `pyttsx` engine by setting `voice_choice = "pyttsx"` in config.toml.

## Solving Screenshot Capture Timeouts

Playwright-based screenshot collection fails when pages exceed load time limits in [`video_creation/screenshot_downloader.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/video_creation/screenshot_downloader.py).

**Symptom:** `TimeoutError: Skipping screenshot…` at line 258, resulting in videos missing comment images.

**Root causes** include improper Playwright installation or Reddit posts containing heavy media that exceed the default 30-second timeout.

**Resolution:**

Ensure Playwright browsers are installed:

```bash
python -m playwright install
python -m playwright install-deps

```

For slow-loading threads, increase the timeout threshold at line 248 of [`screenshot_downloader.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/screenshot_downloader.py):

```python
page.set_default_timeout(60000)  # 60 seconds

```

Alternatively, reduce `settings.comments_to_process` in config.toml to decrease concurrent load.

## Repairing Background Media Download Failures

Background video and audio handling occurs in [`video_creation/background.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/video_creation/background.py), which downloads assets specified in [`utils/background_videos.json`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/utils/background_videos.json) and [`utils/background_audios.json`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/utils/background_audios.json).

**Symptom:** `AttributeError` or `OSError` during background clipping, or `ffmpeg` errors in `chop_background` function calls.

**Cause:** Outdated URLs in the JSON configuration files or connectivity issues preventing downloads. The `download_background_video` and `download_background_audio` functions rely on `ffmpeg` for post-download processing.

**Fix:** Verify URL accessibility manually, update entries in [`utils/background_videos.json`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/utils/background_videos.json) with current direct links, and ensure `ffprobe` can read downloaded files:

```bash
ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 background_video.mp4

```

## Debugging Unexpected Crashes via main.py

Unhandled exceptions trigger a safety handler in the main execution loop.

**Symptom:** Redacted configuration dumps followed by stack traces referencing [`main.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/main.py) lines 126-136.

**Technical Details:** The generic exception handler in [`main.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/main.py) captures all uncaught errors, dumps a sanitized configuration (removing secrets), and re-raises the exception to preserve the original traceback.

**Diagnosis Tip:** Execute with full fault handling to capture the precise failure point:

```bash
python -X faulthandler main.py

```

Review the console output to identify whether the failure occurs during configuration loading, Reddit API interaction, TTS generation, or video assembly phases.

## Summary

- **FFmpeg errors** resolve through platform-specific installation via [`utils/ffmpeg_install.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/utils/ffmpeg_install.py) or manual PATH configuration.
- **Configuration validation** errors require checking [`config.toml`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/config.toml) against template requirements in [`utils/settings.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/utils/settings.py), particularly for TTS credentials and Reddit API keys.
- **Reddit authentication** failures indicate incorrect `client_id` or `client_secret` values in the Reddit app preferences.
- **TTS rate limits** require implementing delays, switching engines, or refreshing authentication tokens like `tiktok_sessionid`.
- **Screenshot timeouts** are fixed by increasing `page.set_default_timeout()` in [`video_creation/screenshot_downloader.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/video_creation/screenshot_downloader.py) or reducing comment counts.
- **Background media issues** stem from outdated URLs in JSON configuration files that require manual updates.
- **Generic crashes** are diagnosed through the exception handler at [`main.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/main.py) lines 126-136 with full traceback analysis.

## Frequently Asked Questions

### Why does RedditVideoMakerBot keep asking for the same configuration values?

The `check` function at line 24 of [`utils/settings.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/utils/settings.py) validates entries against [`.config.template.toml`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/.config.template.toml) and re-prompts when values are empty, malformed, or fail type validation. Delete [`config.toml`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/config.toml) to force regeneration, or manually edit the file while ensuring no values remain blank for required fields like `tiktok_sessionid` or `streamlabs_polly_voice`.

### How do I fix "Invalid credentials" errors when my Reddit app details are correct?

Verify you created a **script** type application at reddit.com/prefs/apps, not a "web app" or "installed app". Ensure the `client_id` is the string displayed directly under the app name (not the secret), and that `username` and `password` match your Reddit account credentials exactly, including case sensitivity. Incorrect app types or credential mismatches trigger the `ResponseException` handler at [`main.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/main.py) lines 122-124.

### What causes TimeoutError during screenshot collection and how do I prevent it?

Playwright's default 30-second timeout in [`video_creation/screenshot_downloader.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/video_creation/screenshot_downloader.py) (line 248) expires when Reddit pages contain heavy media. Increase the timeout to 60000ms (60 seconds) by modifying `page.set_default_timeout(60000)` at line 248, or process fewer comments simultaneously by adjusting `comments_to_process` in config.toml to reduce memory and network load.

### Can I use RedditVideoMakerBot without installing FFmpeg manually?

Yes, on supported platforms (Windows, Linux with apt, macOS with Homebrew), run `python -c "import utils.ffmpeg_install as f; f.ffmpeg_install()"` to trigger automatic download and installation. Windows users must restart their computer after installation to update system PATH variables, as the installer modifies environment variables that require a fresh session.