Initial commit

This commit is contained in:
CronyAkatsuki 2022-11-21 12:37:43 +01:00
commit 59b5283b79
2 changed files with 33 additions and 0 deletions

8
README.md Normal file
View File

@ -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
- ...

25
ia-downloader Executable file
View File

@ -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"