Skip to main content
The config module provides functions to access configuration values from config.json and environment variables.

Constants

ROOT_DIR
str
Root directory of the application, calculated as os.path.dirname(sys.path[0])

Folder Structure

assert_folder_structure

Ensures the necessary folder structure exists.
def assert_folder_structure() -> None
Returns None - Creates .mp folder if it doesn’t exist Example
from config import assert_folder_structure

# Called at startup in main.py
assert_folder_structure()

get_first_time_running

Checks if the program is running for the first time.
def get_first_time_running() -> bool
Returns bool - True if .mp folder doesn’t exist, False otherwise Example
from config import get_first_time_running

if get_first_time_running():
    print("Welcome! Running setup...")

General Configuration

get_verbose

Gets the verbose flag from the config file.
def get_verbose() -> bool
Returns bool - Verbose logging flag Example
from config import get_verbose

if get_verbose():
    print("=> Creating .mp folder")

get_headless

Gets the headless browser flag from the config file.
def get_headless() -> bool
Returns bool - Headless mode flag for browser automation

get_firefox_profile_path

Gets the path to the Firefox profile.
def get_firefox_profile_path() -> str
Returns str - Path to the Firefox profile directory

get_threads

Gets the number of threads to use for operations like MoviePy.
def get_threads() -> int
Returns int - Number of threads to use

Email Configuration

get_email_credentials

Gets email credentials from the config file.
def get_email_credentials() -> dict
Returns dict - Email credentials dictionary

LLM Configuration

get_ollama_base_url

Gets the Ollama server base URL.
def get_ollama_base_url() -> str
Returns str - Ollama base URL (defaults to http://127.0.0.1:11434) Example
from config import get_ollama_base_url
import ollama

client = ollama.Client(host=get_ollama_base_url())

get_ollama_model

Gets the Ollama model name from the config file.
def get_ollama_model() -> str
Returns str - Ollama model name, or empty string if not configured Example
from config import get_ollama_model
from llm_provider import select_model

configured_model = get_ollama_model()
if configured_model:
    select_model(configured_model)

Image Generation (Nano Banana 2)

get_nanobanana2_api_base_url

Gets the Nano Banana 2 (Gemini image) API base URL.
def get_nanobanana2_api_base_url() -> str
Returns str - API base URL (defaults to https://generativelanguage.googleapis.com/v1beta)

get_nanobanana2_api_key

Gets the Nano Banana 2 API key from config or environment.
def get_nanobanana2_api_key() -> str
Returns str - API key from config file or GEMINI_API_KEY environment variable Example
from config import get_nanobanana2_api_key

api_key = get_nanobanana2_api_key()
if not api_key:
    print("Please set GEMINI_API_KEY environment variable")

get_nanobanana2_model

Gets the Nano Banana 2 model name.
def get_nanobanana2_model() -> str
Returns str - Model name (defaults to gemini-3.1-flash-image-preview)

get_nanobanana2_aspect_ratio

Gets the aspect ratio for image generation.
def get_nanobanana2_aspect_ratio() -> str
Returns str - Aspect ratio (defaults to 9:16)

Speech-to-Text Configuration

get_assemblyai_api_key

Gets the AssemblyAI API key.
def get_assemblyai_api_key() -> str
Returns str - AssemblyAI API key

get_stt_provider

Gets the configured speech-to-text provider.
def get_stt_provider() -> str
Returns str - STT provider (defaults to local_whisper)

get_whisper_model

Gets the local Whisper model name.
def get_whisper_model() -> str
Returns str - Whisper model name (defaults to base)

get_whisper_device

Gets the target device for Whisper inference.
def get_whisper_device() -> str
Returns str - Device for Whisper (defaults to auto)

get_whisper_compute_type

Gets the compute type for Whisper inference.
def get_whisper_compute_type() -> str
Returns str - Compute type (defaults to int8)

Text-to-Speech Configuration

get_tts_voice

Gets the TTS voice from the config file.
def get_tts_voice() -> str
Returns str - TTS voice name (defaults to Jasper)

Social Media Configuration

get_twitter_language

Gets the Twitter language setting.
def get_twitter_language() -> str
Returns str - Twitter language code

get_is_for_kids

Gets the YouTube “made for kids” flag.
def get_is_for_kids() -> bool
Returns bool - Whether content is marked as made for kids

Scraper Configuration

get_scraper_timeout

Gets the timeout for web scraping operations.
def get_scraper_timeout() -> int
Returns int - Timeout in seconds (defaults to 300)

get_google_maps_scraper_zip_url

Gets the URL to the Google Maps scraper zip file.
def get_google_maps_scraper_zip_url() -> str
Returns str - URL to the scraper zip file

get_google_maps_scraper_niche

Gets the niche for Google Maps scraping.
def get_google_maps_scraper_niche() -> str
Returns str - Scraper niche/category

Outreach Configuration

get_outreach_message_subject

Gets the outreach email subject line.
def get_outreach_message_subject() -> str
Returns str - Email subject line

get_outreach_message_body_file

Gets the path to the outreach message body file.
def get_outreach_message_body_file() -> str
Returns str - Path to the message body template file

Video Configuration

get_zip_url

Gets the URL to the zip file containing background songs.
def get_zip_url() -> str
Returns str - URL to the songs zip file

get_font

Gets the font name from the config file.
def get_font() -> str
Returns str - Font name for video subtitles

get_fonts_dir

Gets the fonts directory path.
def get_fonts_dir() -> str
Returns str - Path to the fonts directory

get_imagemagick_path

Gets the path to ImageMagick binary.
def get_imagemagick_path() -> str
Returns str - Path to ImageMagick executable

get_script_sentence_length

Gets the forced script sentence length for video generation.
def get_script_sentence_length() -> int
Returns int - Sentence length (defaults to 4 if not configured)

Subtitle Utilities

equalize_subtitles

Equalizes subtitles in an SRT file by limiting characters per line.
def equalize_subtitles(srt_path: str, max_chars: int = 10) -> None
Parameters
srt_path
str
required
Path to the SRT subtitle file
max_chars
int
default:"10"
Maximum characters per subtitle line
Returns None - Modifies the SRT file in place Example
from config import equalize_subtitles

# Limit subtitles to 10 characters per line
equalize_subtitles("output.srt", max_chars=10)

Build docs developers (and LLMs) love