From df08a8840fec63298bfa9bb12e3b37bfa423f1af Mon Sep 17 00:00:00 2001 From: db123 Date: Fri, 26 Jun 2026 00:09:41 +0330 Subject: [PATCH] fix: add --progress flag to force progress in non-TTY pipes yt-dlp suppresses progress output by default when not in a TTY. The --progress flag overrides this. Without it, readProgress sees only 4 stderr lines (no [download] progress) and reports 0 matches. This was the root cause of progress always showing 0.0%. --- internal/dl/ytdlp.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/dl/ytdlp.go b/internal/dl/ytdlp.go index c7c401d..ade0764 100644 --- a/internal/dl/ytdlp.go +++ b/internal/dl/ytdlp.go @@ -283,8 +283,9 @@ func (c *Client) StartDownload(job *domain.DownloadJob, downloadDir string) (<-c outputPath := filepath.Join(downloadDir, job.ID+"_%(id)s.%(ext)s") args = append(args, "--output", outputPath) - // Use --newline so each progress line is newline-delimited in pipe - args = append(args, "--newline") + // --progress forces progress output in non-TTY (pipe) environments + // --newline uses \n instead of \r so bufio.Scanner can read line-by-line + args = append(args, "--progress", "--newline") // Language selection if specified if job.Language != "" {