mirror of
https://github.com/Glitchy-Sheep/boosty-downloader.git
synced 2026-10-14 21:33:23 +00:00
[PR #132] [MERGED] [downloader] Keep file extensions and stop producing .bin files #136
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#136
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/132
Author: @Glitchy-Sheep
Created: 8/9/2026
Status: ✅ Merged
Merged: 8/9/2026
Merged by: @Glitchy-Sheep
Base:
main← Head:fix/no-bin-extensions📝 Commits (2)
ef15050fix: 🐛 Downloads keep their extensions and never get .bin534508arefactor: ♻️ Extension policy follows the name's origin, not letter counting📊 Changes
4 files changed (+120 additions, -5 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
boosty_downloader/src/application/use_cases/download_single_post.py(+5 -1)📝
boosty_downloader/src/infrastructure/file_downloader.py(+19 -4)➕
test/unit/file_downloader/extension_guessing_test.py(+95 -0)📄 Description
Summary
The downloader used to trust the server's content type over the filename and renamed
archive.zipintoarchive.bin. Research showed there is no universal way to tell whether a name "has an extension" - so the code stops asking. Every download site declares where its name came from, and that origin decides everything.Fixes #75
Problem
application/octet-stream("bytes, type unknown");mimetypesturns that into.binand the old code replaced the author's real extension with it.appimageis a real extension longer than the window, and a video titledUpdate v1.2looks like it ends with oneContent-Typeis the only source in existenceFix
The extension policy follows the name's origin, with zero name heuristics:
.doc,.appimage, anything worksoctet-streamappends nothing, so.binis never born.png/.jpginstead of a bare uuidBefore / After
Before:
file-sample_1MB.doclands asfile-sample_1MB.bin; images land as extensionless uuids.After: the file keeps its name; the image becomes
40f9e868-….png; the video becomesSome title (a2dd6942).mp4.Tests
download_filesback to guessing revives.binand fails the suite.docintact, content verified), audio (.mp3intact), video (.mp4appended), image (.pngappended)post.htmlreferences the new names correctlytask cigreenNotes
Content-Dispositionon files, thefileTypefield on audio)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.