I have this piece of a code in a package (note the %2F&
in the URL):
src = fetchurl {
# This does not work; why?
url = "https://sdrive.cnrs.fr/s/BmXHoY3EgbY6Yre/download?path=%2F&files=imager-dec24.tar.gz";
};
When I build the package, I get the following error:
nix-build --arg pkgs 'import <nixpkgs> {}' -A imager
warning: found empty hash, assuming 'sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA='
these 2 derivations will be built:
/nix/store/g18472sawslpg3r6qp0gx9nmdgrb5d55-download?path=-2F-files=imager-dec24.tar.gz.drv
/nix/store/dycqzbv0sd4vigmbicmvnn2n6xij8xzm-imager-4.4-01.drv
building '/nix/store/g18472sawslpg3r6qp0gx9nmdgrb5d55-download?path=-2F-files=imager-dec24.tar.gz.drv'...
trying https://sdrive.cnrs.fr/s/BmXHoY3EgbY6Yre/download?path=%2F&files=imager-dec24.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (22) The requested URL returned error: 403
error: cannot download download?path=-2F-files=imager-dec24.tar.gz from any mirror
Note that %2F&
has been replaced by -2F-
. How can I escape these characters in the URL?