@ -20,18 +20,18 @@ if [ ! -f /config/xdg/.tidal-dl.json ]; then
tidal-dl -o /downloads/lidarr/incomplete
tidal-dl -r P1080
tidal-dl -q HiFi
fi
fi
# check for backup token and use it if exists
if [ ! -f /root/.tidal-dl.token.json ] ; then
# check for backup token and use it if exists
if [ ! -f /root/.tidal-dl.token.json ] ; then
if [ -f /config/backup/tidal-dl.token.json ] ; then
cp -p /config/backup/tidal-dl.token.json /root/.tidal-dl.token.json
# remove backup token
rm /config/backup/tidal-dl.token.json
fi
fi
fi
if [ -f /root/.tidal-dl.token.json ] ; then
if [ -f /root/.tidal-dl.token.json ] ; then
if [ [ $( find "/config/xdg/.tidal-dl.token.json" -mtime +6 -print) ] ] ; then
log "TIDAL :: ERROR :: Token expired, removing..."
rm /config/xdg/.tidal-dl.token.json
@ -42,19 +42,17 @@ if [ ! -f /config/xdg/.tidal-dl.json ]; then
fi
cp -p /config/xdg/.tidal-dl.token.json /config/backup/tidal-dl.token.json
fi
fi
fi
if [ ! -f /config/xdg/.tidal-dl.token.json ] ; then
if [ ! -f /config/xdg/.tidal-dl.token.json ] ; then
log "TIDAL :: ERROR :: Loading client for required authentication, please authenticate, then exit the client..."
tidal-dl
fi
fi
DownloadProcess ( ) {
downloadedAlbumTitleClean = " $( echo " $downloadedAlbumTitle " | sed -e "s%[^[:alpha:][:digit:]._' ]% %g" -e "s/ */ /g" | sed 's/^[.]*//' | sed 's/[.]*$//g' | sed 's/^ *//g' | sed 's/ *$//g' ) "
if [ ! -d "/downloads/lidarr" ] ; then
mkdir -p /downloads/lidarr
chmod 777 /downloads/lidarr