thfr 6c0f5c88c6 update to depotdownloader 2.3.3
currently failing to connect with Steam with both 2.3.2 and 2.3.3
switch to app entry URL from v0002 to v2 - reivyr (on #openbsd-gaming)
reports v0002 doesn't work in South America region.
Note new -debug flag which should help with bug reports
2020-04-12 13:34:54 +00:00

45 lines
1.1 KiB
Bash

#!/bin/sh
app=
appentry=
appid=
appname=
dd_args=$@
realappname=
if $(echo "$*" | grep -qm 1 "[[:blank:]]\-dir[[:blank:]]"); then
dirpath=""
else
mkdir -p ~/games/steamdepots
cd ~/games/steamdepots
dirpath="$HOME/games/steamdepots"
fi
while [ $# -gt 0 ]; do
case "$1" in
-appname) appname="$2"; shift;;
esac
shift
done
if [ -n "$appname" ]; then
appentry="$(ftp -Vo - https://api.steampowered.com/ISteamApps/GetAppList/v2 \
| grep -Eio "\{[^\{]*\"[[:blank:]]*$appname[[:blank:]]*\"")"
appid="$(echo "$appentry" | grep -Eo '[[:digit:]]+')"
if [ -z "$appid" ]; then
echo "Could not find AppId for \"$appname\""
exit 1
fi
realappname="$(echo "$appentry" | grep -io "$appname")"
dirpath="$dirpath/$realappname"
appid="-app $appid"
elif [ -n "$dirpath" ] ; then
dirpath="$dirpath/app"
fi
dirpath=$(echo $dirpath | sed -E 's|[[:blank:]]|_|g')
dirpath="-dir $dirpath"
dd_args="$(echo "$dd_args" | sed -E "s|\-appname[[:blank:]]+$appname||g")"
MONO_PATH=/usr/local/share/depotdownloader mono \
/usr/local/share/depotdownloader/DepotDownloader.dll $appid $dirpath $dd_args