fix: set PYTHONUNBUFFERED=1 to force real-time progress output
All checks were successful
CI / build (push) Successful in 58s
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user