mirror of
https://github.com/Glitchy-Sheep/boosty-downloader.git
synced 2026-10-14 21:33:23 +00:00
[PR #170] [MERGED] [downloader] Download post media in parallel #171
Labels
No labels
api-drift
bug
ci
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Glitchy-Sheep/boosty-downloader#171
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Glitchy-Sheep/boosty-downloader/pull/170
Author: @Glitchy-Sheep
Created: 8/22/2026
Status: ✅ Merged
Merged: 8/23/2026
Merged by: @Glitchy-Sheep
Base:
main← Head:feat/parallel-media📝 Commits (3)
4280033fix: Run yt-dlp off the event loopa43f996feat: Download post media in parallel12042a9test: Prove parallel downloads and changelog the speedup📊 Changes
6 files changed (+449 additions, -15 deletions)
View changed files
📝
CHANGELOG.md(+5 -0)📝
boosty_downloader/application/use_cases/download_single_post.py(+62 -13)📝
boosty_downloader/infrastructure/file_downloader.py(+3 -1)📝
test/e2e/download_flow_test.py(+35 -1)➕
test/unit/use_cases/ext_video_threading_test.py(+138 -0)➕
test/unit/use_cases/parallel_media_test.py(+206 -0)📄 Description
[downloader] Download post media in parallel
Summary
Media of one post now downloads up to 4 files at once instead of strictly one by one. Measured on live CDN before designing: the CDN caps every single connection (~8-15 MB/s cold) and a cold small-file request pays seconds of latency, so a wide channel sat idle. Parallelism reclaims it: ~10x on image-heavy posts, 2-3x on video posts.
Live measurements that drove the design
Four connections keep most of the win without hammering the host; posts still go one by one (deliberate - progress readability, the failure-streak breaker and cache semantics stay intact).
Changes
asyncio.to_thread): an external video no longer freezes every other download and the progress display. Progress updates are marshalled onto the loop thread before touching Rich; Ctrl+C still aborts the download - the cancel flag raisesKeyboardInterruptinside the worker, yt-dlp's own abort path_process_chunks_concurrently- a named private step of the use case: semaphore(4) +gather. Two invariants are pinned: the page keeps the author's chunk order whatever finishes first, and the error contract is unchanged (a failed chunk surfaces as its own error, an outer cancel maps to the application cancellation that the 130 exit code relies on)Verification
task cigreen: 182 tests + 1 xfail (7 new)execute(); a slow-server e2e where four 0.4s media must beat the sequential lower bound🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.