mirror of
https://github.com/Glitchy-Sheep/boosty-downloader.git
synced 2026-10-14 21:33:23 +00:00
[GH-ISSUE #75] .BIN extension files problem (file downloader) #11
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#11
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?
Originally created by @chorin2193-spec on GitHub (Sep 30, 2025).
Original GitHub issue: https://github.com/Glitchy-Sheep/boosty-downloader/issues/75
Originally assigned to: @Glitchy-Sheep on GitHub.
Subject: Proposal: Two post-processing utilities (auto extension fixer + offline index generator)
Hello! 👋
Thank you for the excellent tool. I see active development (latest release v2.0.1 on 25 Sep 2025), a clean CLI and a “Contributing” section — so I’d like to propose two small but useful utilities to post-process downloaded content. I think they could be added as separate CLI subcommands or placed in a
utils/folder and documented.1)
fix_bin_to_known_types.py— auto-detect format by magic bytes and renameWhy: sometimes files are downloaded without correct extensions (e.g.
.bin). This script detects the real type (PDF / ZIP / JPEG / PNG / GIF / WebP / TIFF / BMP / MP3 / WAV / FLAC / OGG / archives TAR / 7z / RAR / GZ / BZ2 / XZ, ISO-BMFF containers — MP4 / MOV / HEIC / AVIF; DOCX / XLSX / PPTX / EPUB / ODT / ODS / ODP and older OLE DOC / XLS / PPT) and renames them to the proper extension. It supports a safe “dry run” mode (no overwrite) and name collision handling (adding(1),(2)), optional auto-unzip of ZIP, and a CSV log.Key features:
--dry-runto preview without modifying--extto change which source suffix to treat (default.bin)--overwriteto allow overwriting existing files--log— path to CSV log file--unzip— after renaming, unzip ZIP files automaticallyHow to run (examples):
Suggested integration into the project:
boosty-downloader fix-ext(orrepair) with mapping of flags (--dry-run,--ext,--log,--unzip,--overwrite)utils/fix_bin_to_known_types.pyand mention in README as a recommended post-processing step (especially useful when mirroring sources that may lose extensions)2)
build_index_tree_search_folder_subtree.py— offlineindex.htmlgenerator for folder treesWhy: to create a convenient offline index of a downloaded library: fast search by folder names only (if a folder matches → show its entire subtree: subfolders + files), collapsible/expandable tree, match highlighting, node state persistence (via
localStorage). In the end, the user gets a browsable “catalog” of their collection in the browser.What it does:
.git,__pycache__,.idea,.vscode,_index, hidden folders)index.html(responsive layout, sticky header, toolbar with search and “Expand All” / “Collapse All” buttons)ALLOWED_FILE_EXTSHow to run:
Suggested integration into the project:
boosty-downloader make-index→ scans theoutputdirectory and writesindex.html--make-index, to auto-generate the index after downloads completeProposed repository layout
Why this helps users of boosty-downloader
index.htmlgives them a self-contained browser interface for searching and browsingIf the additions are useful to the community, I would be honored to have my name included in the “Credits / Contributors” section.
Thank you for your time and effort! 🙌
build_index_tree_search_folder_subtree_fix.py
fix_bin_to_known_types_v5.py
@Glitchy-Sheep commented on GitHub (Oct 1, 2025):
Hi! Thank you very much for your proposal.
As to the first point about .bin files, yeah, I think the main problem is somewhere in the file downloader module, because it tries to "guess" the mime type, but I didn't consider some other formats.
This is definitely a bug, and I've reproduced it myself a few times. I will try to fix it - I think I have some ideas about how to do it.
And I really like the second idea actually. I thought about something similar; maybe it's not even hard to implement, but right now it adds a bit too much complexity, so I'll add it to my wish-list, maybe =)
@chorin2193-spec commented on GitHub (Oct 1, 2025):
I've attached the finished scripts below. I don't mind if you use my work in your software — I'd even be happy about it, which is why I posted them. At the moment these two scripts do what I described. So if you integrate them into your code, it would greatly expand the loader's capabilities. As I said, I'd be glad to see my name in the helpers if my scripts turn out to be useful to you.
build_index_tree_search_folder_subtree_fix.py
fix_bin_to_known_types_v5.py