fix: set PYTHONUNBUFFERED=1 to force real-time progress output
All checks were successful
CI / build (push) Successful in 58s

yt-dlp is a Python script. When stderr is a pipe (not a TTY), Python
buffers output, causing progress updates to arrive in large chunks or
only at the end. Setting PYTHONUNBUFFERED=1 forces line-buffered output,
giving real-time progress.
This commit is contained in:
2026-06-25 16:24:07 +03:30
parent e8120b9529
commit f8f9d99e69

View File

@@ -265,6 +265,7 @@ func (c *Client) StartDownload(job *domain.DownloadJob, downloadDir string) (<-c
slog.Info("starting download", "url", job.URL, "format", formatID) slog.Info("starting download", "url", job.URL, "format", formatID)
cmd := exec.Command(c.binaryPath, args...) cmd := exec.Command(c.binaryPath, args...)
cmd.Env = append(os.Environ(), "PYTHONUNBUFFERED=1")
stderr, err := cmd.StderrPipe() stderr, err := cmd.StderrPipe()
if err != nil { if err != nil {