download-directory / download-directory.github.io

Web App: Download just a sub directory from a GitHub repo.
https://download-directory.github.io
MIT License
1.25k stars 117 forks source link

Doesn't work for branches with slashes #35

Closed MiniDigger closed 9 months ago

MiniDigger commented 4 years ago

It tries to GET https://api.github.com/repos/PaperMC/Paper/git/trees/feature?recursive=1 which returns 404 (Not Found), while I initiated the download from his link https://github.com/PaperMC/Paper/tree/feature/mcp/mcp

fregante commented 4 years ago

That’s right, the URL doesn’t tell me whether mcp is still part of the branch or not, so we just guess it’s a folder, because that’s the most common situation.

If you’re a Refined GitHub user however this could be resolved by making download-directory accept a pre-parsed URL:

?user=PaperMC&repository=Paper&path=mcp&ref=feature/mcp 

Refined GitHub can parse this information directly from the DOM rather than from the URL