mirror of
https://github.com/Glitchy-Sheep/boosty-downloader.git
synced 2026-10-14 21:33:23 +00:00
[PR #115] [MERGED] [boosty-api] Survive unknown Boosty content instead of crashing the download #120
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#120
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/115
Author: @Glitchy-Sheep
Created: 8/8/2026
Status: ✅ Merged
Merged: 8/8/2026
Merged by: @Glitchy-Sheep
Base:
main← Head:fix/tolerant-api-validation📝 Commits (6)
a6727fafix: 🛡️ Tolerate unknown ok_video url types from Boostyc841736Keep unknown Boosty values as named types instead of crashing18211d1docs: 📝 Describe download flow and the Tolerant Reader concept9ec0e21feat: ✨ Human-readable validation error detailse8aee24fix: 🛡️ Skip broken posts with a warning instead of failing the paged48b11efeat: ✨ Final run summary of skipped posts and unknown content📊 Changes
28 files changed (+1129 additions, -46 deletions)
View changed files
📝
CHANGELOG.md(+2 -0)📝
boosty_downloader/main.py(+8 -3)📝
boosty_downloader/src/application/mappers/list.py(+2 -1)📝
boosty_downloader/src/application/mappers/post_mapper.py(+17 -0)📝
boosty_downloader/src/application/use_cases/check_total_posts.py(+29 -0)📝
boosty_downloader/src/application/use_cases/download_all_posts.py(+36 -0)📝
boosty_downloader/src/application/use_cases/download_specific_post.py(+82 -26)📝
boosty_downloader/src/infrastructure/boosty_api/core/client.py(+26 -4)📝
boosty_downloader/src/infrastructure/boosty_api/models/post/base_post_data.py(+31 -2)📝
boosty_downloader/src/infrastructure/boosty_api/models/post/post_data_types/__init__.py(+2 -0)📝
boosty_downloader/src/infrastructure/boosty_api/models/post/post_data_types/post_data_list.py(+38 -3)📝
boosty_downloader/src/infrastructure/boosty_api/models/post/post_data_types/post_data_ok_video.py(+16 -2)➕
boosty_downloader/src/infrastructure/boosty_api/models/post/post_data_types/post_data_unknown.py(+14 -0)📝
boosty_downloader/src/infrastructure/boosty_api/models/post/posts_request.py(+26 -5)➕
boosty_downloader/src/infrastructure/boosty_api/models/unknown_content.py(+64 -0)➕
boosty_downloader/src/infrastructure/boosty_api/models/unknown_value.py(+31 -0)➕
boosty_downloader/src/infrastructure/boosty_api/utils/validation_errors.py(+91 -0)➕
docs/concepts/boosty/download-flow.md(+32 -0)➕
docs/concepts/boosty/tolerant-reader.md(+52 -0)📝
test/unit/boosty_api/client_test.py(+61 -0)...and 8 more files
📄 Description
Summary
Boosty changes its API without notice, and one unknown word used to kill the whole download. The client now follows the Tolerant Reader pattern: unknown data is kept, skipped where needed, and reported to the user with exact paths.
Problem
ondemand_dash/ondemand_hlsvideo url types (Aug 2026), and everycheck/downloadrun died with a validation errorFix
BoostyUnknownValue(raw=...)for values outside a known enum,BoostyPostDataUnknownDTOfor whole chunksEnum | UnknownValue, the enum stays the point of truth, the raw word is keptcollect_unknown_content) finds every unknown in a parsed post as an API path, with no registry to keep in synccheckanddownloadend with a summary of everything not understood, asking to report it at GitHub issuesdownload --post-urlsays the real reason when the target post itself can't be parsed - it used to end with a misleading "not found"docs/concepts/boosty/(download flow + Tolerant Reader)Before / After
Before:
check -u <author>on a blog with one new video url type crashed with a wall of pydantic error dicts.After: the run finishes and ends with:
Tests
test_unknown_url_type_keeps_raw_word,test_known_url_type_still_parses_exactly- tolerant enum parsing, and the catch-all never swallows known valuestest_unknown_chunk_type_parses_as_unknown,test_known_chunk_with_broken_body_still_fails- chunk fallback triggers on unknown tags onlytest_wrapper_is_found_at_any_depth,test_clean_tree_yields_nothing- the generic walktest_broken_post_is_skipped_and_page_survives,test_broken_pagination_still_fails_the_page- per-post validation boundariestest_enum_error_shows_the_offending_word,test_nested_loc_renders_as_api_path- readable validation errorstest_skipped_post_warns_inline_and_run_summary_reports_everything,test_run_summary_is_none_when_clean- the final summarycheckanddownloadon a blog with the new video url types finish and print the summary aboveNotes
download --post-urland clean-run silence are covered by tests; the incident blog itself was the live testbed🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.