Detect private/sign-in yt-dlp errors

Update AnalysisThread error handling to detect yt-dlp stderr containing "Private video" or "Sign in". For those cases, emit a localized errors.private_video message and log a specific private-video error; otherwise preserve the existing generic ytdlp_failed behavior. Playlist visibility signals and early return remain unchanged.
This commit is contained in:
oop7
2026-04-28 13:29:26 +03:00
parent fe0f8241ff
commit 5bbecf1e1d
+7 -2
View File
@@ -131,8 +131,13 @@ class AnalysisThread(QThread):
return
if result.returncode != 0:
logger.error(f"yt-dlp failed: {result.stderr}")
self.analysis_error.emit(_("errors.ytdlp_failed", error=result.stderr))
if "Private video" in result.stderr or "Sign in" in result.stderr:
logger.error(f"yt-dlp failed (private video): {result.stderr}")
self.analysis_error.emit(_("errors.private_video"))
else:
logger.error(f"yt-dlp failed: {result.stderr}")
self.analysis_error.emit(_("errors.ytdlp_failed", error=result.stderr))
self.playlist_info_visible.emit(False)
self.playlist_select_btn_visible.emit(False)
return