fix: remove --progress-template, parse default [download] output instead
All checks were successful
CI / build (push) Successful in 40s

--progress-template output is suppressed in non-TTY subprocesses
(yt-dlp issue #13649). The default [download] progress format
works reliably in pipes. Changes:

- Remove --progress-template from yt-dlp args entirely
- Keep --newline for newline-delimited output in pipe
- Fix progressRE regex to handle HLS format: ~ with leading
  spaces before size (e.g. '~   1.00KiB')
- Fix speed parsing in [download] fallback to handle multiple
  leading spaces (e.g. 'at    976.20B/s')
- Fix ETA parsing to strip (frag n/m) suffix
- Filter Unknown/N/A speed/eta in [download] fallback
- Add test cases for real HLS fragment output format
This commit is contained in:
2026-06-26 00:01:35 +03:30
parent 7c02cd3d89
commit 959b7e388d
3 changed files with 42 additions and 6 deletions

View File

@@ -283,9 +283,8 @@ 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)
// Progress reporting using progress-template for machine-readable output
// Use --newline so each progress line is newline-delimited in pipe
args = append(args, "--newline")
args = append(args, "--progress-template", "DLPROG|%(progress._percent_str)s|%(progress._speed_str)s|%(progress._eta_str)s")
// Language selection if specified
if job.Language != "" {