Repository navigation
fix: download the file, not the page, for HF blob and Civitai page links - #16
Merged
Merged
Conversation
A Hugging Face `/blob/` link (what the file viewer shows) returns the HTML
page, so aria2 saved a ~130 KB web page named like the model. The same
happened for Civitai model page links.
- ParseResult gains `download_url`, which the download form now hands to
aria2 instead of the pasted URL.
- Hugging Face: rewrite `/blob/` and `/raw/` (LFS pointer) to `/resolve/`;
repo pages without a file are rejected with a hint.
- Civitai: model page links map to /api/download/models/{version}, using
?modelVersionId or else the model's latest version.
- Other links: if HEAD reports text/html, report that the link is a web
page instead of downloading it.
mogurt
pushed a commit
that referenced
this pull request
Sep 30, 2026
🤖 I have created a release *beep* *boop* --- ## [0.1.3](v0.1.2...v0.1.3) (2026-09-30) ### Bug Fixes * download the file, not the page, for HF blob and Civitai page links ([#16](#16)) ([19554db](19554db)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pasting a Hugging Face
/blob/link (the URL of the file viewer page) downloaded a ~130 KB HTML page saved under the model's file name, instead of the model. Example:https://huggingface.co/Comfy-Org/Qwen-Image-2.1/blob/main/text_encoders/qwen3.5_9b_qwen_image_2.1_pe_i2i.int8_convrot.safetensors…/blob/main/…text/html, 127,700 bytes…/resolve/main/…application/octet-stream, 9,471,072,252 bytesCivitai model page links (
civitai.com/models/7808/…) had the same problem.ParseResultgainsdownload_url, and the download form now hands that to aria2 instead of the pasted URL./blob/and/raw/(the latter serves the LFS pointer) are rewritten to/resolve/. Repo pages that point to no file are rejected with a hint./api/download/models/{version}, using?modelVersionIdor, if it's missing, the model's latest version.text/html, parsing fails with "this link opens a web page" instead of downloading it.Cargo.lock's package version to 0.1.2; release-please doesn't update the lock file.Testing
cargo clippy --all-targets -- -D warnings,cargo test: 25 passed, with new tests for the blob/raw → resolve rewrite and Civitai model-id extractionnpm run lint,npm run typecheck,npm test: 20 passedEnd-to-end in
tauri dev(separate data dir), via real IPC and the UI:…/resolve/main/…, 9,471,072,252 bytes, typeclip.?modelVersionId=9208→https://civitai.com/api/download/models/9208,easynegative.safetensors, 24,655 bytes./blob/link (hf-internal-testing/tiny-random-bert): aria2 received the/resolve/URL, and the saved file is 520,212 bytes and starts with the safetensors header, not HTML.