Loading pkgs/applications/audio/pianoteq/default.nix +23 −15 Original line number Diff line number Diff line { lib, stdenv, curl, jq, xorg, alsa-lib, freetype, p7zip, autoPatchelfHook, writeShellScript, zlib, libjack2, makeWrapper }: { lib, stdenv, curl, jq, htmlq, xorg, alsa-lib, freetype, p7zip, autoPatchelfHook, writeShellScript, zlib, libjack2, makeWrapper }: let versionForFile = v: builtins.replaceStrings ["."] [""] v; Loading Loading @@ -93,10 +93,14 @@ let fetchWithCurlScript { inherit name sha256; script = '' html=$( "''${curl[@]}" --silent --request GET \ --cookie cookies \ --header "accept: */*" \ https://www.modartt.com/ -o /dev/null 'https://www.modartt.com/try?file=${name}' ) signature="$(echo "$html" | ${htmlq}/bin/htmlq '#download-form' --attribute action | cut -f2 -d'&' | cut -f2 -d=)" json=$( "''${curl[@]}" --silent --request POST \ Loading @@ -105,11 +109,15 @@ let --header "origin: https://www.modartt.com" \ --header "content-type: application/json; charset=UTF-8" \ --header "accept: application/json, text/javascript, */*" \ --data-raw '{"file": "${name}", "get": "url"}' \ --data-raw '{"file": "${name}", "get": "url", "signature": "'"$signature"'"}' \ https://www.modartt.com/api/0/download ) url=$(echo $json | ${jq}/bin/jq -r .url) if [ "$url" == "null" ]; then echo "Could not get download URL, open an issue on https://github.com/NixOS/nixpkgs" return 1 fi "''${curl[@]}" --progress-bar --cookie cookies -o $out "$url" ''; }; Loading Loading
pkgs/applications/audio/pianoteq/default.nix +23 −15 Original line number Diff line number Diff line { lib, stdenv, curl, jq, xorg, alsa-lib, freetype, p7zip, autoPatchelfHook, writeShellScript, zlib, libjack2, makeWrapper }: { lib, stdenv, curl, jq, htmlq, xorg, alsa-lib, freetype, p7zip, autoPatchelfHook, writeShellScript, zlib, libjack2, makeWrapper }: let versionForFile = v: builtins.replaceStrings ["."] [""] v; Loading Loading @@ -93,10 +93,14 @@ let fetchWithCurlScript { inherit name sha256; script = '' html=$( "''${curl[@]}" --silent --request GET \ --cookie cookies \ --header "accept: */*" \ https://www.modartt.com/ -o /dev/null 'https://www.modartt.com/try?file=${name}' ) signature="$(echo "$html" | ${htmlq}/bin/htmlq '#download-form' --attribute action | cut -f2 -d'&' | cut -f2 -d=)" json=$( "''${curl[@]}" --silent --request POST \ Loading @@ -105,11 +109,15 @@ let --header "origin: https://www.modartt.com" \ --header "content-type: application/json; charset=UTF-8" \ --header "accept: application/json, text/javascript, */*" \ --data-raw '{"file": "${name}", "get": "url"}' \ --data-raw '{"file": "${name}", "get": "url", "signature": "'"$signature"'"}' \ https://www.modartt.com/api/0/download ) url=$(echo $json | ${jq}/bin/jq -r .url) if [ "$url" == "null" ]; then echo "Could not get download URL, open an issue on https://github.com/NixOS/nixpkgs" return 1 fi "''${curl[@]}" --progress-bar --cookie cookies -o $out "$url" ''; }; Loading