commit 59b5283b7973315f682f2c32be5c5a5ef73a5774 Author: Crony Akatsuki Date: Mon Nov 21 12:37:43 2022 +0100 Initial commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..9b4c56f --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +# ia-downloader + +Downloads rom's from ia by providing the script xlm path set. + +Won't download specific roms like +- Beta +- Prototype +- ... diff --git a/ia-downloader b/ia-downloader new file mode 100755 index 0000000..328a97a --- /dev/null +++ b/ia-downloader @@ -0,0 +1,25 @@ +#!/bin/bash + +# script to quickly download rom sets from internet archive at max speed from its xml with the list of files + +xml_url="$1" +base_url=$(dirname $xml_url) + +dl="aria2c -j 16 -s 16 -x 16 -k 5M --file-allocation=none --continue=true" + +# getting roms while removing unneded files and roms like prototypes and betas +roms=$(wget -q $xml_url -O - | grep name | cut -d \" -f 2 | sed '/.xml/d' | sed '/.sqlite/d' | sed '/(Proto)/d' | sed '/(Unl)/d' | sed '/(Beta)/d') +rom_count=$(printf '%s\n' "${roms}" | wc -l) + +printf '%s\n' "Downloading $rom_count roms" + +count="1" + +while read rom; do + # getting the url and making it usable + rom_url=$(printf '%s\n' "${base_url}/${rom}") + printf '%s\n' "Downloading ${count}. ${rom}" + $dl "${rom_url}" + printf '%s\n' "Done, left $((${rom_count} - ${count})) roms to download" + count=$(($count + 1)) +done <<< "$roms"