feat: capture yt-dlp stderr on download failures for debugging

Add StderrLog field to DownloadJob and collect all stderr lines during
download. Log the captured stderr output when a download fails to help
diagnose exit code 2 errors (geo-restrictions, auth, etc.).
This commit is contained in:
2026-06-25 16:12:03 +03:30
parent 8408b17ca0
commit cd7aaeebc2
3 changed files with 10 additions and 6 deletions

View File

@@ -315,7 +315,7 @@ func (c *Client) StartDownload(job *domain.DownloadJob, downloadDir string) (<-c
<-progressDone
if err != nil {
job.Status = domain.StatusFailed
slog.Error("download failed", "url", job.URL, "error", err)
slog.Error("download failed", "url", job.URL, "error", err, "stderr", job.StderrLog)
} else {
job.Status = domain.StatusCompleted
}