# Dick Show Index - Configuration Template # Copy to config.py and customize import os # ============================================================================ # Base Paths # ============================================================================ BASE_DIR = os.path.dirname(os.path.abspath(__file__)) # Data directories AUDIO_DIR = os.path.join(BASE_DIR, "audio") TRANSCRIPT_DIR = os.path.join(BASE_DIR, "transcripts") DATA_DIR = os.path.join(BASE_DIR, "data") DB_PATH = os.path.join(DATA_DIR, "index.db") EPISODES_JSONL = os.path.join(DATA_DIR, "episodes.jsonl") # RSS Feed FEED_URL = "https://thedickshow.com/feed/podcast/" # ============================================================================ # Whisper Settings # ============================================================================ # Model: tiny, base, small, medium, large-v3 # smaller = faster, less accurate WHISPER_MODEL = os.environ.get("DS_MODEL", "small") # Device: cpu, cuda DEVICE = os.environ.get("DS_DEVICE", "cpu") # Compute type: int8, float16, float32 # int8 = fastest, lowest memory (CPU) # float16 = GPU with tensor cores COMPUTE_TYPE = os.environ.get("DS_COMPUTE", "int8") # Language LANGUAGE = "en" # VAD filter removes silence/music - big speed win VAD_FILTER = True # Beam size (1 = greedy, 5 = better accuracy, slower) BEAM_SIZE = 1 # Word timestamps (slower, more detailed) WORD_TIMESTAMPS = False # Condition on previous text (can propagate errors on long audio) CONDITION_ON_PREVIOUS_TEXT = False # ============================================================================ # Audio Processing # ============================================================================ TARGET_RATE = 16000 # Whisper expects 16kHz # HTTP settings DOWNLOAD_TIMEOUT = (15, 120) # (connect, read) seconds CHUNK_SIZE = 1 << 20 # 1 MiB MAX_FEED_RETRIES = 3 # Disk policy: delete MP3 after transcription (saves ~75GB for full backlog) KEEP_AUDIO = os.environ.get("DS_KEEP_AUDIO", "0") == "1" # ============================================================================ # Analysis (opencode/LLM) # ============================================================================ # Path to opencode binary OPENCODE = os.environ.get("OPENCODE_BIN", os.path.expanduser(r"~\.opencode\bin\opencode.exe")) # Model for analysis (see: opencode models) OPENCODE_MODEL = os.environ.get("OPENCODE_ANALYZE_MODEL", "opencode/nemotron-3-ultra-free") # Timeout for analysis (seconds) OPENCODE_TIMEOUT = int(os.environ.get("DS_ANALYZE_TIMEOUT", "600")) # Pause between analysis calls (seconds) - be nice to the provider ANALYSIS_PAUSE = int(os.environ.get("DS_ANALYZE_PAUSE", "45")) # ============================================================================ # Memory / Rate Limit Guards # ============================================================================ # Minimum free RAM before pausing transcription (bytes) MIN_FREE_RAM = int(os.environ.get("DS_MIN_FREE_RAM", str(1024 * 1024 * 1024))) # 1 GB # Cooldown after rate limit hit (seconds) RATE_COOLDOWN_SECONDS = int(os.environ.get("DS_RATE_COOLDOWN", "900")) # 15 min # ============================================================================ # HTTP / Feed # ============================================================================ DOWNLOAD_TIMEOUT = (15, 120) # (connect, read) CHUNK_SIZE = 1 << 20 # 1 MiB MAX_FEED_RETRIES = 3 # Ensure directories exist os.makedirs(AUDIO_DIR, exist_ok=True) os.makedirs(TRANSCRIPT_DIR, exist_ok=True) os.makedirs(os.path.join(os.path.dirname(__file__), "data"), exist_ok=True) # ============================================================================ # Analysis Timeout (seconds) # ============================================================================ ANALYSIS_TIMEOUT = int(os.environ.get("DS_ANALYZE_TIMEOUT", "600")) # Analysis pause between calls ANALYSIS_PAUSE = int(os.environ.get("DS_ANALYZE_PAUSE", "45")) # Minimum free RAM (bytes) MIN_FREE_RAM = int(os.environ.get("DS_MIN_FREE_RAM", str(1024 * 1024 * 1024))) # Rate cooldown seconds RATE_COOLDOWN_SECONDS = int(os.environ.get("DS_RATE_COOLDOWN", "900")) # ============================================================================ # Directory Setup (auto-create) # ============================================================================ for d in [AUDIO_DIR, TRANSCRIPT_DIR, os.path.join(os.path.dirname(__file__), "data")]: os.makedirs(d, exist_ok=True)