Created
April 28, 2023 14:18
-
-
Save kadiwa4/d58fb9a0b5fa609cf5ac62cf1973515d to your computer and use it in GitHub Desktop.
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
| #!/usr/bin/env bash | |
| cd "$(dirname -- "$0")" | |
| mkdir mods 2> /dev/null | |
| cd mods | |
| echo Creating download URL list... | |
| download_urls="$(paste -d \0 <(perl -n -e '/^.+?"projectID":\s*(\d+)/ && print "https://www.curseforge.com/api/v1/mods/$1\n"' < ../manifest.json) <(perl -n -e '/^.+?"fileID":\s*(\d+)/ && print "/files/$1/download\n"' < ../manifest.json))" | |
| echo Created download URL list | |
| echo Downloading mods... | |
| echo "$download_urls" | while read url | |
| do | |
| url="$(curl --tlsv1.2 -sSfI "$url" | perl -n -e '/location:\s*([^\r\n]+)/i && print "$1"')" | |
| curl --proto "=https" --tlsv1.2 -sSfLO "$url" | |
| done | |
| echo Downloaded mods |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment