From 3256a9efdc535d5f766d6d6ac47f9ca912ad9c01 Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Fri, 18 Aug 2023 11:36:33 +0000 Subject: [PATCH] Update Downloader.bash --- ra-rom-downloader/Downloader.bash | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/ra-rom-downloader/Downloader.bash b/ra-rom-downloader/Downloader.bash index 6e8965f..ad64073 100644 --- a/ra-rom-downloader/Downloader.bash +++ b/ra-rom-downloader/Downloader.bash @@ -1,7 +1,10 @@ #!/usr/bin/with-contenv bash scriptVersion="1.0" scriptName="RA-ROM-Downloader" -romPath="$romPath/RA_collection" +downloadPath="$romPath/RA_collection" + +#### Import Settings +source /config/extended.conf #### Funcitons logfileSetup () { @@ -22,13 +25,13 @@ logfileSetup () { DownloadRomCountSummary () { OIFS="$IFS" IFS=$'\n' - romCount=$(find "$romPath" -type f -iname "*.zip" | wc -l) - platformCount=$(find "/$romPath" -maxdepth 1 -mindepth 1 -type d | wc -l) + romCount=$(find "$downloadPath" -type f -iname "*.zip" | wc -l) + platformCount=$(find "$downloadPath" -maxdepth 1 -mindepth 1 -type d | wc -l) echo "################## ROM SUMMARY ##################" 2>&1 | tee -a /config/$scriptName.log echo "$romCount ROMS downloaded on $platformCount different platforms!!!" 2>&1 | tee -a /config/$scriptName.log echo "############### DETAILED SUMMARY ################" 2>&1 | tee -a /config/$scriptName.log echo "Platforms ($platformCount):;Total:" > /config/temp - for romfolder in $(find "/$romPath" -maxdepth 1 -mindepth 1 -type d); do + for romfolder in $(find "$downloadPath" -maxdepth 1 -mindepth 1 -type d); do platform="$(basename "$romfolder")" platformRomCount=$(find "$romfolder" -type f -iname "*.zip" | wc -l) echo "$platform;$platformRomCount" >> /config/temp @@ -42,12 +45,12 @@ DownloadRomCountSummary () { DownloadRoms () { echo "############### UPDATING ROMS #################" 2>&1 | tee -a /config/$scriptName.log - rclone sync -P --http-url https://ia902505.us.archive.org ":http:/27/items/retroachievements_collection_v5" "$romPath" --filter="- SNES/**" --filter="- NES/**" --filter="- PlayStation Portable/**" --filter="- PlayStation/**" --filter="- PlayStation 2/**" --filter "- retroachievements_collection*" --filter "- TamperMonkeyRetroachievements*" --filter "- __ia_thumb.jpg" --filter "- rclone.txt" --local-case-sensitive --delete-before --transfers $downloadTransfers --checkers $downloadCheckers --tpslimit $downloadTpslimit --log-file="/config/rclong.log" - rclone sync -P --http-url https://ia902701.us.archive.org ":http:/29/items/retroachievements_collection_NES/NES" "$romPath/NES" --local-case-sensitive --delete-before --transfers $downloadTransfers --checkers $downloadCheckers --tpslimit $downloadTpslimit --log-file="/config/rclong.log" - rclone sync -P --http-url https://ia802606.us.archive.org ":http:/25/items/retroachievements_collection_SNES/SNES" "$romPath/SNES" --local-case-sensitive --delete-before --transfers $downloadTransfers --checkers $downloadCheckers --tpslimit $downloadTpslimit --filter="- *(MSU)*" --log-file="/config/rclong.log" - rclone sync -P --http-url https://ia902607.us.archive.org ":http:/23/items/retroachievements_collection_PlayStation_Portable/PlayStation Portable" "$romPath/PlayStation Portable" --local-case-sensitive --delete-before --transfers $downloadTransfers --checkers $downloadCheckers --tpslimit $downloadTpslimit --log-file="/config/rclong.log" - rclone sync -P --http-url https://ia902709.us.archive.org ":http:/31/items/retroachievements_collection_PlayStation/PlayStation" "$romPath/PlayStation" --local-case-sensitive --delete-before --transfers $downloadTransfers --checkers $downloadCheckers --tpslimit $downloadTpslimit --log-file="/config/rclong.log" - rclone sync -P --http-url https://ia904707.us.archive.org ":http:/16/items/retroachievements_collection_PS2/PlayStation 2" "$romPath/PlayStation 2" --local-case-sensitive --delete-before --transfers $downloadTransfers --checkers $downloadCheckers --tpslimit $downloadTpslimit --log-file="/config/rclong.log" + rclone sync -P --http-url https://ia902505.us.archive.org ":http:/27/items/retroachievements_collection_v5" "$downloadPath" --filter="- SNES/**" --filter="- NES/**" --filter="- PlayStation Portable/**" --filter="- PlayStation/**" --filter="- PlayStation 2/**" --filter "- retroachievements_collection*" --filter "- TamperMonkeyRetroachievements*" --filter "- __ia_thumb.jpg" --filter "- rclone.txt" --local-case-sensitive --delete-before --transfers $downloadTransfers --checkers $downloadCheckers --tpslimit $downloadTpslimit --log-file="/config/rclong.log" + rclone sync -P --http-url https://ia902701.us.archive.org ":http:/29/items/retroachievements_collection_NES/NES" "$downloadPath/NES" --local-case-sensitive --delete-before --transfers $downloadTransfers --checkers $downloadCheckers --tpslimit $downloadTpslimit --log-file="/config/rclong.log" + rclone sync -P --http-url https://ia802606.us.archive.org ":http:/25/items/retroachievements_collection_SNES/SNES" "$downloadPath/SNES" --local-case-sensitive --delete-before --transfers $downloadTransfers --checkers $downloadCheckers --tpslimit $downloadTpslimit --filter="- *(MSU)*" --log-file="/config/rclong.log" + rclone sync -P --http-url https://ia902607.us.archive.org ":http:/23/items/retroachievements_collection_PlayStation_Portable/PlayStation Portable" "$downloadPath/PlayStation Portable" --local-case-sensitive --delete-before --transfers $downloadTransfers --checkers $downloadCheckers --tpslimit $downloadTpslimit --log-file="/config/rclong.log" + rclone sync -P --http-url https://ia902709.us.archive.org ":http:/31/items/retroachievements_collection_PlayStation/PlayStation" "$downloadPath/PlayStation" --local-case-sensitive --delete-before --transfers $downloadTransfers --checkers $downloadCheckers --tpslimit $downloadTpslimit --log-file="/config/rclong.log" + rclone sync -P --http-url https://ia904707.us.archive.org ":http:/16/items/retroachievements_collection_PS2/PlayStation 2" "$downloadPath/PlayStation 2" --local-case-sensitive --delete-before --transfers $downloadTransfers --checkers $downloadCheckers --tpslimit $downloadTpslimit --log-file="/config/rclong.log" } # Loop Script