mirror of
https://github.com/Glitchy-Sheep/boosty-downloader.git
synced 2026-10-14 21:33:23 +00:00
[PR #150] [MERGED] [downloader] Re-fetch posts with expired signed links and fetch single posts directly #154
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#154
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/150
Author: @Glitchy-Sheep
Created: 8/15/2026
Status: ✅ Merged
Merged: 8/15/2026
Merged by: @Glitchy-Sheep
Base:
main← Head:feat/single-post-refetch📝 Commits (4)
d670377feat: Fetch a single post through the dedicated API endpointda3c3cbfeat: Download a post by url with one direct API request2126aecfix: Refresh expired signed links once instead of dyingf003a8fdocs: Note the expired-link refresh in the changelog📊 Changes
9 files changed (+661 additions, -173 deletions)
View changed files
📝
CHANGELOG.md(+5 -0)➕
boosty_downloader/src/application/post_retry.py(+194 -0)📝
boosty_downloader/src/application/use_cases/download_all_posts.py(+14 -126)📝
boosty_downloader/src/application/use_cases/download_specific_post.py(+37 -44)📝
boosty_downloader/src/infrastructure/boosty_api/core/client.py(+41 -0)📝
boosty_downloader/src/infrastructure/file_downloader.py(+20 -0)📝
test/unit/boosty_api/client_test.py(+41 -0)📝
test/unit/use_cases/download_all_posts_test.py(+113 -3)➕
test/unit/use_cases/download_specific_post_test.py(+196 -0)📄 Description
Summary
Signed download links live about 24 hours from the moment a listing page is fetched. On long runs they died mid-download: five retries hit the same dead url, the post went to the failed log, and five such posts in a row stopped the whole run. Now a dead link triggers one re-fetch of the post - fresh signatures, immediate retry. On top of that,
--post-urluses the newly discovered single-post API endpoint: one direct request instead of walking the blog page by page.Problem
--post-urllinear-scanned 100-post pagesFix
get_single_poston the API client:GET blog/{author}/post/{id}, one call, fresh signed urls; a missing post and an unparsable post raise distinct, clearly-worded errors--post-urlasks for the post directly; a paywalled post without access now says so instead of downloading an empty previewis_expired_link_errorrecognizes a CDN 400/403 anywhere in the error cause chainPostDownloadRetrier(next toFailureStreakBreaker): attempt budget, backoff, and one expired-link refresh per post - a healed post touches neither the failed log nor the failure streakBefore / After
Before: a run longer than the signature lifetime ends with "Skip post after 5 failed attempts" for every post of a stale page, then the systemic-failure stop; the user reruns by hand.
After: the log says
Signed links look expired, refreshing the post: ..., the post re-fetches and downloads;--post-urlstarts downloading instantly with links fetched seconds ago.Verification
--debugrun of--post-url: the debug log shows exactly one API request - the directGET .../post/{id}- and the post downloads--post-urlflow (download, not found, unparsable, no access), and the refresh policy (healed on second try; refresh spent once; API failure falls back to the old retry path)task cigreen: checks, unit tests, 6 live integration tests, buildNotes
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.