Fix #29: validate --container against known containers #30

Merged
max merged 1 commits from fix/issue-29 into dev 2026-09-02 15:47:06 +04:00
Showing only changes of commit 8b67de59a3 - Show all commits
+7
View File
@@ -32,6 +32,7 @@ from .defaults import (
DEFAULT_SKIP_EXISTING,
DEFAULT_DELETE_ORIGINAL,
)
from .constants import CONTAINER_NAMES
from .core import split_audio
from .tracklist import read_tracklist, parse_format
from .ffmpeg import has_cover_or_video, validate_cover_images
@@ -196,6 +197,12 @@ def main():
print(f"Error: Tracklist file not found: {args.tracklist_file}")
sys.exit(1)
# Validate container if provided
if args.container and args.container not in CONTAINER_NAMES:
print(f"Error: Invalid container '{args.container}'. "
f"Valid containers: {', '.join(sorted(CONTAINER_NAMES))}.")
sys.exit(1)
# Check FFmpeg
try:
subprocess.run(['ffmpeg', '-version'], capture_output=True, check=True)