-
Notifications
You must be signed in to change notification settings - Fork 15
Description
Hello developer 👋
First of all, thank you for creating and maintaining dra, it’s really useful for automatically downloading release assets!
I have seen #307 and it’s great progress.
I’d like to suggest an enhancement: supporting mirror prefixes when downloading release assets.
In some regions, direct access to GitHub release assets can be slow or unstable. A common workaround is to prepend a mirror prefix in front of the original GitHub link.
For example, the original asset link:
https://github.com/JGRennison/OpenTTD-patches/releases/download/jgrpp-0.66.1/openttd-jgrpp-0.66.1-windows-win64.zip
might be accessed through mirrors like:
https://gh.***.cc/https://github.com/JGRennison/OpenTTD-patches/releases/download/jgrpp-0.66.1/openttd-jgrpp-0.66.1-windows-win64.zip
https://github.***.xyz/https://github.com/JGRennison/OpenTTD-patches/releases/download/jgrpp-0.66.1/openttd-jgrpp-0.66.1-windows-win64.zip
...
So a possible usage in dra could be:
dra download --repo JGRennison/OpenTTD-patches \
--mirror-prefix https://github.***.xyz/https://github.comHere, --mirror-prefix simply prepends the given string to the original GitHub asset URL, making it easy to adapt to different mirrors without changing the repo or tag arguments.
Additionally, it would be great to have a mirror management feature (e.g., saving mirror prefixes in a config file or global settings), so users don’t need to type the parameter every time.
Benefits:
- Improve reliability and speed in regions with limited GitHub connectivity.
- Very simple to implement (just prepend prefix).
- Flexible for different public mirrors or internal caching proxies.
Would you consider adding this feature in a future release?
If yes, I’d be happy to help with testing or even contribute a PR.
Thanks again for your great work on dra! 🙏