fix: add --progress flag to force progress in non-TTY pipes
All checks were successful
CI / build (push) Successful in 50s
All checks were successful
CI / build (push) Successful in 50s
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%.
This commit is contained in:
@@ -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 != "" {
|
||||
|
||||
Reference in New Issue
Block a user