mirror of
https://github.com/darkzoul5/YoutubePlaylistSync.git
synced 2026-09-18 20:43:54 +03:00
fix(backend): CLI now prints a clear hint when yt-dlp is missing and exits with code 2
This commit is contained in:
+8
-1
@@ -43,7 +43,14 @@ def main(argv: list[str] | None = None) -> int:
|
||||
for pl in playlists:
|
||||
url = pl.get("url")
|
||||
pid = extract_playlist_id(url) or (url or "")
|
||||
actions = service.sync_from_config(pl)
|
||||
try:
|
||||
actions = service.sync_from_config(pl)
|
||||
except ImportError as e:
|
||||
msg = str(e)
|
||||
if "yt_dlp" in msg or "yt-dlp" in msg:
|
||||
print("yt-dlp Python package is required. Install with: pip install -U yt-dlp")
|
||||
return 2
|
||||
raise
|
||||
counts: dict[str, int] = {}
|
||||
for a in actions:
|
||||
counts[a.type.name] = counts.get(a.type.name, 0) + 1
|
||||
|
||||
@@ -10,7 +10,6 @@ DEFAULT_CONFIG: Dict[str, Any] = {
|
||||
"download_mode": "audio",
|
||||
"max_video_quality": "1080p",
|
||||
"save_path": "./downloads",
|
||||
"yt_dlp_path": "yt-dlp",
|
||||
"ffmpeg_path": "ffmpeg",
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user