mirror of
https://github.com/darkzoul5/YoutubePlaylistSync.git
synced 2026-11-08 08:15:12 +02:00
fix(backend): CLI now prints a clear hint when yt-dlp is missing and exits with code 2
This commit is contained in:
1 parent
f886ebcd12
commit
7715d53bba
2 files changed
+8
-2
No files matched your search
+8
-1
@@ -43,7 +43,14 @@ def main(argv: list[str] | None = None) -> int:
|
|||||||
for pl in playlists:
|
for pl in playlists:
|
||||||
url = pl.get("url")
|
url = pl.get("url")
|
||||||
pid = extract_playlist_id(url) or (url or "")
|
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] = {}
|
counts: dict[str, int] = {}
|
||||||
for a in actions:
|
for a in actions:
|
||||||
counts[a.type.name] = counts.get(a.type.name, 0) + 1
|
counts[a.type.name] = counts.get(a.type.name, 0) + 1
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ DEFAULT_CONFIG: Dict[str, Any] = {
|
|||||||
"download_mode": "audio",
|
"download_mode": "audio",
|
||||||
"max_video_quality": "1080p",
|
"max_video_quality": "1080p",
|
||||||
"save_path": "./downloads",
|
"save_path": "./downloads",
|
||||||
"yt_dlp_path": "yt-dlp",
|
|
||||||
"ffmpeg_path": "ffmpeg",
|
"ffmpeg_path": "ffmpeg",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user