{"record":{"id":"aa49b73d541e2717","repo":"calesthio/OpenMontage","slug":"unknown-profile-name-r-available-available","errorCode":null,"errorMessage":"Unknown profile {name!r}. Available: {available}","messagePattern":"Unknown profile (.+?)\\. Available: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"lib/media_profiles.py","lineNumber":146,"sourceCode":")\n\n\n# ---- Profile registry ----\n\nALL_PROFILES: dict[str, MediaProfile] = {\n    p.name: p for p in [\n        YOUTUBE_LANDSCAPE, YOUTUBE_4K, YOUTUBE_SHORTS,\n        INSTAGRAM_REELS, INSTAGRAM_FEED,\n        TIKTOK, LINKEDIN, CINEMATIC, GENERIC_HD,\n    ]\n}\n\n\ndef get_profile(name: str) -> MediaProfile:\n    \"\"\"Get a media profile by name.\"\"\"\n    if name not in ALL_PROFILES:\n        available = \", \".join(ALL_PROFILES.keys())\n        raise ValueError(f\"Unknown profile {name!r}. Available: {available}\")\n    return ALL_PROFILES[name]\n\n\ndef get_profiles_for_platform(platform: str) -> list[MediaProfile]:\n    \"\"\"Get all profiles matching a platform prefix.\"\"\"\n    return [p for name, p in ALL_PROFILES.items() if name.startswith(platform)]\n\n\ndef ffmpeg_output_args(profile: MediaProfile) -> list[str]:\n    \"\"\"Generate FFmpeg output arguments for a media profile.\"\"\"\n    args = [\n        \"-c:v\", profile.codec,\n        \"-c:a\", profile.audio_codec,\n        \"-crf\", str(profile.crf),\n        \"-pix_fmt\", profile.pixel_format,\n        \"-r\", str(profile.fps),\n        \"-vf\", f\"scale={profile.width}:{profile.height}\",\n    ]","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/lib/media_profiles.py#L128-L164","documentation":"Raised by lib/media_profiles.py's get_profile() when the requested profile name is not a key in ALL_PROFILES. The registry is a fixed dict of nine built-in profiles (YOUTUBE_LANDSCAPE, YOUTUBE_4K, YOUTUBE_SHORTS, INSTAGRAM_REELS, INSTAGRAM_FEED, TIKTOK, LINKEDIN, CINEMATIC, GENERIC_HD); profile names are exact-match, case-sensitive identifiers. The error message lists all valid names, so a mismatch is usually a typo, wrong casing, or an assumption that a profile exists after a rename.","triggerScenarios":"Calling get_profile('youtube_shorts') (lowercase) instead of get_profile('YOUTUBE_SHORTS'); passing a user-supplied or config-file profile string straight through; referencing a profile name that was renamed or removed between versions.","commonSituations":"Typo or wrong case in a pipeline config or CLI flag; profile renamed in an upstream release; assuming platform prefixes (e.g. 'youtube') are themselves profiles.","solutions":["Copy the exact name from the error's Available list (names are UPPERCASE with underscores).","If the name comes from config, validate it against get_profiles_for_platform or ALL_PROFILES before use.","Use list/registry helpers (ALL_PROFILES keys, get_profiles_for_platform(platform)) to pick a valid name programmatically."],"exampleFix":"# before\nprofile = get_profile(\"youtube_shorts\")  # ValueError\n\n# after\nprofile = get_profile(\"YOUTUBE_SHORTS\")\n# or discover valid names:\nvalid = list(ALL_PROFILES)  # / get_profiles_for_platform(\"YOUTUBE\")","handlingStrategy":"type-guard","validationCode":"from lib.media_profiles import ALL_PROFILES\n\nif profile_name not in ALL_PROFILES:\n    raise SystemExit(f\"Pick one of: {', '.join(ALL_PROFILES)}\")","typeGuard":"from lib.media_profiles import ALL_PROFILES, MediaProfile\n\ndef is_valid_profile(name: str) -> bool:\n    return name in ALL_PROFILES","tryCatchPattern":"try:\n    profile = get_profile(name)\nexcept ValueError as e:\n    # message already lists valid names; surface it to the user/config error path\n    raise ConfigError(str(e)) from e","preventionTips":["Source profile names from ALL_PROFILES keys or get_profiles_for_platform rather than string literals.","Validate profile names at config load time, not at render time.","Remember names are UPPERCASE and exact-match."],"tags":["media","profiles","validation","configuration"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}