Skip to content

Download video parts through the yt-dlp binary - #44

Merged
Linuxuser67 merged 1 commit into
mainfrom
binary-parts
Sep 18, 2026
Merged

Linuxuser67 merged 1 commit into
mainfrom
binary-parts

Conversation

@Linuxuser67

Copy link
Copy Markdown
Owner

TikTok direct downloads 403 because the crate's download stack cannot send what the CDN requires: its HttpHeaders has four fields (no Referer), unknown extractor headers are dropped at deserialization, and there is no cookie channel (the extraction jar is gone with the process). Upstream yt-dlp works because extraction, cookies and headers stay in one process — confirmed against the #9997 thread and tiktok.py's per-format Referer.

This moves split-part downloads onto the binary, keeping the crate for brains (selection, planning) and using the binary for transport:

  • run_part_ytdlp: exact -f id + exact -o path, --newline progress folded into the existing byte-weighted row progress, shared abort channel across sequential parts, per-part timeout, log-tail failure details.
  • Stale ids (rotated between dialog resolve and attempt) get one fallback-spec retry (bv* height-capped video, ba/b audio, best-single for adopted singles) before failing.
  • Merge, manifest/resume, zero-byte guards and phase messages unchanged; abort still lands quiet Ok(None).

Tests: argv pinning (flags, -f/-o, trailing -- + page, cookies/UA passthrough), fallback matrix, unavailability detection, plus fake-binary integration proving spawn, progress reporting and the stale-id fallback retry end to end. 209 passing, clippy clean.

@Linuxuser67
Linuxuser67 merged commit dee2686 into main Sep 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant