From f8f9d99e69a734f4d45cad98c148a229d9da0394 Mon Sep 17 00:00:00 2001 From: db123 Date: Thu, 25 Jun 2026 16:24:07 +0330 Subject: [PATCH] fix: set PYTHONUNBUFFERED=1 to force real-time progress output 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. --- internal/dl/ytdlp.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/dl/ytdlp.go b/internal/dl/ytdlp.go index 733d56b..0e84b18 100644 --- a/internal/dl/ytdlp.go +++ b/internal/dl/ytdlp.go @@ -265,6 +265,7 @@ func (c *Client) StartDownload(job *domain.DownloadJob, downloadDir string) (<-c slog.Info("starting download", "url", job.URL, "format", formatID) cmd := exec.Command(c.binaryPath, args...) + cmd.Env = append(os.Environ(), "PYTHONUNBUFFERED=1") stderr, err := cmd.StderrPipe() if err != nil {