diff --git a/lidarr/Audio.service.bash b/lidarr/Audio.service.bash
index 32a62831..8caea50f 100644
--- a/lidarr/Audio.service.bash
+++ b/lidarr/Audio.service.bash
@@ -1,5 +1,5 @@
#!/usr/bin/with-contenv bash
-scriptVersion="2.48"
+scriptVersion="2.5"
scriptName="Audio"
### Import Settings
@@ -71,7 +71,10 @@ verifyConfig () {
preferSpecialEditions="true"
fi
- audioPath="$downloadPath/audio"
+ audioPath="$downloadPath/audio"
+ tidalerConfigDir="/config/extended/tidaler"
+ tidalerConfigFile="${tidalerConfigDir}/config.json"
+ tidalerConfigTemplate="/config/extended/tidaler.json"
}
@@ -101,8 +104,11 @@ Configuration () {
- if [ ! -d /config/xdg ]; then
- mkdir -p /config/xdg
+ if [ ! -d /config/extended ]; then
+ mkdir -p /config/extended
+ fi
+ if [ ! -d "$tidalerConfigDir" ]; then
+ mkdir -p "$tidalerConfigDir"
fi
if [ -z $topLimit ]; then
@@ -206,16 +212,16 @@ DownloadFormat () {
if [ "$audioFormat" == "native" ]; then
if [ "$audioBitrate" == "master" ]; then
- tidalQuality=Master
+ tidalQuality=HI_RES_LOSSLESS
deemixQuality=flac
elif [ "$audioBitrate" == "lossless" ]; then
- tidalQuality=HiFi
+ tidalQuality=LOSSLESS
deemixQuality=flac
elif [ "$audioBitrate" == "high" ]; then
- tidalQuality=High
+ tidalQuality=HIGH
deemixQuality=320
elif [ "$audioBitrate" == "low" ]; then
- tidalQuality=128
+ tidalQuality=LOW
deemixQuality=128
else
log "ERROR :: Invalid audioFormat and audioBitrate options set..."
@@ -229,7 +235,7 @@ DownloadFormat () {
else
bitrateError="false"
audioFormatError="false"
- tidalQuality=HiFi
+ tidalQuality=LOSSLESS
deemixQuality=flac
case "$audioBitrate" in
@@ -269,7 +275,7 @@ DownloadFormat () {
exit
fi
- tidal-dl -q HiFi
+ XDG_CONFIG_HOME=/config/extended tidaler cfg quality_audio LOSSLESS 2>&1 | tee -a "/config/logs/$logFileName"
deemixQuality=flac
bitrateError=""
audioFormatError=""
@@ -301,32 +307,36 @@ NotFoundFolderCleaner () {
}
TidalClientSetup () {
- log "TIDAL :: Verifying tidal-dl configuration"
- touch /config/xdg/.tidal-dl.log
- if [ -f /config/xdg/.tidal-dl.json ]; then
- rm /config/xdg/.tidal-dl.json
- fi
- if [ ! -f /config/xdg/.tidal-dl.json ]; then
- log "TIDAL :: No default config found, importing default config \"tidal.json\""
- if [ -f /config/extended/tidal-dl.json ]; then
- cp /config/extended/tidal-dl.json /config/xdg/.tidal-dl.json
- chmod 777 -R /config/xdg/
+ log "TIDAL :: Verifying tidaler configuration"
+ touch "${tidalerConfigDir}/tidaler.log"
+ if [ -f "$tidalerConfigFile" ]; then
+ rm "$tidalerConfigFile"
+ fi
+ if [ ! -f "$tidalerConfigFile" ]; then
+ log "TIDAL :: No default config found, importing default config \"tidaler.json\""
+ if [ -f "$tidalerConfigTemplate" ]; then
+ cp "$tidalerConfigTemplate" "$tidalerConfigFile"
+ chmod 777 -R "$tidalerConfigDir"
fi
fi
- TidaldlStatusCheck
- tidal-dl -o "$audioPath"/incomplete 2>&1 | tee -a "/config/logs/$logFileName"
+ TidalerStatusCheck
DownloadFormat
+ XDG_CONFIG_HOME=/config/extended tidaler cfg download_base_path "$audioPath/incomplete" 2>&1 | tee -a "/config/logs/$logFileName"
+ XDG_CONFIG_HOME=/config/extended tidaler cfg quality_audio "$tidalQuality" 2>&1 | tee -a "/config/logs/$logFileName"
+ XDG_CONFIG_HOME=/config/extended tidaler cfg path_binary_ffmpeg "/usr/bin/ffmpeg" 2>&1 | tee -a "/config/logs/$logFileName"
- if [ ! -f /config/xdg/.tidal-dl.token.json ]; then
- TidaldlStatusCheck
- #log "TIDAL :: ERROR :: Downgrade tidal-dl for workaround..."
- #pip3 install tidal-dl==2022.3.4.2 --no-cache-dir &>/dev/null
+ if ! ls "${tidalerConfigDir}"/*auth*.json "${tidalerConfigDir}"/*token*.json 1>/dev/null 2>&1; then
+ TidalerStatusCheck
log "TIDAL :: ERROR :: Loading client for required authentication, please authenticate, then exit the client..."
NotifyWebhook "FatalError" "TIDAL requires authentication, please authenticate now (check logs)"
- TidaldlStatusCheck
- tidal-dl
+ TidalerStatusCheck
+ if command -v script >/dev/null 2>&1; then
+ script -q -c "PYTHONUNBUFFERED=1 XDG_CONFIG_HOME=/config/extended tidaler login" /dev/null
+ else
+ PYTHONUNBUFFERED=1 XDG_CONFIG_HOME=/config/extended tidaler login
+ fi
fi
if [ ! -d /config/extended/cache/tidal ]; then
@@ -346,19 +356,17 @@ TidalClientSetup () {
rm -rf "$audioPath"/incomplete/*
fi
- TidaldlStatusCheck
- #log "TIDAL :: Upgrade tidal-dl to newer version..."
- #pip3 install tidal-dl==2022.07.06.1 --no-cache-dir &>/dev/null
+ TidalerStatusCheck
}
-TidaldlStatusCheck () {
+TidalerStatusCheck () {
until false
do
running=no
- if ps aux | grep "tidal-dl" | grep -v "grep" | read; then
+ if ps aux | grep "tidaler" | grep -v "grep" | read; then
running=yes
- log "STATUS :: TIDAL-DL :: BUSY :: Pausing/waiting for all active tidal-dl tasks to end..."
+ log "STATUS :: TIDALER :: BUSY :: Pausing/waiting for all active tidaler tasks to end..."
sleep 2
continue
fi
@@ -367,12 +375,12 @@ TidaldlStatusCheck () {
}
TidalClientTest () {
- log "TIDAL :: tidal-dl client setup verification..."
+ log "TIDAL :: tidaler client setup verification..."
i=0
while [ $i -lt 3 ]; do
i=$(( $i + 1 ))
- TidaldlStatusCheck
- tidal-dl -q Normal -o "$audioPath"/incomplete -l "$tidalClientTestDownloadId" 2>&1 | tee -a "/config/logs/$logFileName"
+ TidalerStatusCheck
+ XDG_CONFIG_HOME=/config/extended tidaler dl "https://tidal.com/browse/album/$tidalClientTestDownloadId" 2>&1 | tee -a "/config/logs/$logFileName"
downloadCount=$(find "$audioPath"/incomplete -type f -regex ".*/.*\.\(flac\|opus\|m4a\|mp3\)" | wc -l)
if [ $downloadCount -le 0 ]; then
continue
@@ -380,11 +388,9 @@ TidalClientTest () {
break
fi
done
- tidalClientTest="unknown"
+ tidalClientTest="unknown"
if [ $downloadCount -le 0 ]; then
- if [ -f /config/xdg/.tidal-dl.token.json ]; then
- rm /config/xdg/.tidal-dl.token.json
- fi
+ rm -f "${tidalerConfigDir}"/*auth*.json "${tidalerConfigDir}"/*token*.json
log "TIDAL :: ERROR :: Download failed"
log "TIDAL :: ERROR :: You will need to re-authenticate on next script run..."
log "TIDAL :: ERROR :: Exiting..."
@@ -555,9 +561,11 @@ DownloadProcess () {
fi
if [ "$2" == "TIDAL" ]; then
- TidaldlStatusCheck
+ TidalerStatusCheck
- tidal-dl -q $tidalQuality -o "$audioPath/incomplete" -l "$1" 2>&1 | tee -a "/config/logs/$logFileName"
+ XDG_CONFIG_HOME=/config/extended tidaler cfg download_base_path "$audioPath/incomplete" 2>&1 | tee -a "/config/logs/$logFileName"
+ XDG_CONFIG_HOME=/config/extended tidaler cfg quality_audio "$tidalQuality" 2>&1 | tee -a "/config/logs/$logFileName"
+ XDG_CONFIG_HOME=/config/extended tidaler dl "https://tidal.com/browse/album/$1" 2>&1 | tee -a "/config/logs/$logFileName"
# Verify Client Works...
clientTestDlCount=$(find "$audioPath"/incomplete/ -type f -regex ".*/.*\.\(flac\|opus\|m4a\|mp3\)" | wc -l)
diff --git a/lidarr/TidalVideoDownloader.bash b/lidarr/TidalVideoDownloader.bash
index ae8fb399..223cfafc 100644
--- a/lidarr/TidalVideoDownloader.bash
+++ b/lidarr/TidalVideoDownloader.bash
@@ -1,5 +1,5 @@
#!/usr/bin/with-contenv bash
-scriptVersion="2.1"
+scriptVersion="2.2"
scriptName="TidalVideoDownloader"
#### Import Settings
@@ -24,6 +24,9 @@ verifyConfig () {
downloadPath="/config/extended/downloads"
fi
videoDownloadPath="$downloadPath/tidal/videos"
+ tidalerConfigDir="/config/extended/tidaler"
+ tidalerConfigFile="${tidalerConfigDir}/config.json"
+ tidalerConfigTemplate="/config/extended/tidaler.json"
if [ -z "$videoScriptInterval" ]; then
videoScriptInterval="15m"
fi
@@ -45,24 +48,35 @@ verifyConfig () {
}
TidalClientSetup () {
- log "TIDAL :: Verifying tidal-dl configuration"
- if [ ! -f /config/xdg/.tidal-dl.json ]; then
- log "TIDAL :: No default config found, importing default config \"tidal.json\""
- if [ -f /config/extended/tidal-dl.json ]; then
- cp /config/extended/tidal-dl.json /config/xdg/.tidal-dl.json
- chmod 777 -R /config/xdg/
+ log "TIDAL :: Verifying tidaler configuration"
+ if [ ! -d /config/extended ]; then
+ mkdir -p /config/extended
+ fi
+ if [ ! -d "$tidalerConfigDir" ]; then
+ mkdir -p "$tidalerConfigDir"
+ fi
+ if [ ! -f "$tidalerConfigFile" ]; then
+ log "TIDAL :: No default config found, importing default config \"tidaler.json\""
+ if [ -f "$tidalerConfigTemplate" ]; then
+ cp "$tidalerConfigTemplate" "$tidalerConfigFile"
+ chmod 777 -R "$tidalerConfigDir"
fi
fi
-
- tidal-dl -o "$videoDownloadPath"/incomplete 2>&1 | tee -a "/config/logs/$logFileName"
- tidalQuality=HiFi
- if [ ! -f /config/xdg/.tidal-dl.token.json ]; then
- #log "TIDAL :: ERROR :: Downgrade tidal-dl for workaround..."
- #pip3 install tidal-dl==2022.3.4.2 --no-cache-dir &>/dev/null
+ tidalQuality=LOSSLESS
+ XDG_CONFIG_HOME=/config/extended tidaler cfg download_base_path "$videoDownloadPath/incomplete" 2>&1 | tee -a "/config/logs/$logFileName"
+ XDG_CONFIG_HOME=/config/extended tidaler cfg quality_audio "$tidalQuality" 2>&1 | tee -a "/config/logs/$logFileName"
+ XDG_CONFIG_HOME=/config/extended tidaler cfg quality_video "1080" 2>&1 | tee -a "/config/logs/$logFileName"
+ XDG_CONFIG_HOME=/config/extended tidaler cfg path_binary_ffmpeg "/usr/bin/ffmpeg" 2>&1 | tee -a "/config/logs/$logFileName"
+
+ if ! ls "${tidalerConfigDir}"/*auth*.json "${tidalerConfigDir}"/*token*.json 1>/dev/null 2>&1; then
log "TIDAL :: ERROR :: Loading client for required authentication, please authenticate, then exit the client..."
NotifyWebhook "FatalError" "TIDAL requires authentication, please authenticate now (check logs)"
- tidal-dl 2>&1 | tee -a "/config/logs/$logFileName"
+ if command -v script >/dev/null 2>&1; then
+ script -q -c "PYTHONUNBUFFERED=1 XDG_CONFIG_HOME=/config/extended tidaler login" /dev/null
+ else
+ PYTHONUNBUFFERED=1 XDG_CONFIG_HOME=/config/extended tidaler login
+ fi
fi
if [ ! -d "$videoDownloadPath/incomplete" ]; then
@@ -72,18 +86,18 @@ TidalClientSetup () {
rm -rf "$videoDownloadPath"/incomplete/*
fi
- #log "TIDAL :: Upgrade tidal-dl to newer version..."
- #pip3 install tidal-dl==2022.07.06.1 --no-cache-dir &>/dev/null
+ #log "TIDAL :: Upgrade tidaler to newer version..."
+ #pip3 install tidaler --no-cache-dir &>/dev/null
}
-TidaldlStatusCheck () {
+TidalerStatusCheck () {
until false
do
running=no
- if ps aux | grep "tidal-dl" | grep -v "grep" | read; then
+ if ps aux | grep "tidaler" | grep -v "grep" | read; then
running=yes
- log "STATUS :: TIDAL-DL :: BUSY :: Pausing/waiting for all active tidal-dl tasks to end..."
+ log "STATUS :: TIDALER :: BUSY :: Pausing/waiting for all active tidaler tasks to end..."
sleep 2
continue
fi
@@ -92,12 +106,12 @@ TidaldlStatusCheck () {
}
TidalClientTest () {
- log "TIDAL :: tidal-dl client setup verification..."
+ log "TIDAL :: tidaler client setup verification..."
i=0
while [ $i -lt 3 ]; do
i=$(( $i + 1 ))
- TidaldlStatusCheck
- tidal-dl -q Normal -o "$videoDownloadPath"/incomplete -l "$tidalClientTestDownloadId" 2>&1 | tee -a "/config/logs/$logFileName"
+ TidalerStatusCheck
+ XDG_CONFIG_HOME=/config/extended tidaler dl "https://tidal.com/browse/album/$tidalClientTestDownloadId" 2>&1 | tee -a "/config/logs/$logFileName"
downloadCount=$(find "$videoDownloadPath"/incomplete -type f -regex ".*/.*\.\(flac\|opus\|m4a\|mp3\)" | wc -l)
if [ $downloadCount -le 0 ]; then
continue
@@ -105,11 +119,9 @@ TidalClientTest () {
break
fi
done
- tidalClientTest="unknown"
+ tidalClientTest="unknown"
if [ $downloadCount -le 0 ]; then
- if [ -f /config/xdg/.tidal-dl.token.json ]; then
- rm /config/xdg/.tidal-dl.token.json
- fi
+ rm -f "${tidalerConfigDir}"/*auth*.json "${tidalerConfigDir}"/*token*.json
log "TIDAL :: ERROR :: Download failed"
log "TIDAL :: ERROR :: You will need to re-authenticate on next script run..."
log "TIDAL :: ERROR :: Exiting..."
@@ -339,7 +351,10 @@ VideoProcess () {
downloadFailed=false
log "$processCount/$lidarrArtistCount :: $lidarrArtistName :: $tidalVideoProcessNumber/$tidalVideoIdsCount :: $videoTitle ($id) :: Downloading..."
- tidal-dl -r P1080 -o "$videoDownloadPath/incomplete" -l "$videoUrl" 2>&1 | tee -a "/config/logs/$logFileName"
+ XDG_CONFIG_HOME=/config/extended tidaler cfg download_base_path "$videoDownloadPath/incomplete" 2>&1 | tee -a "/config/logs/$logFileName"
+ XDG_CONFIG_HOME=/config/extended tidaler cfg quality_video "1080" 2>&1 | tee -a "/config/logs/$logFileName"
+ XDG_CONFIG_HOME=/config/extended tidaler cfg path_binary_ffmpeg "/usr/bin/ffmpeg" 2>&1 | tee -a "/config/logs/$logFileName"
+ XDG_CONFIG_HOME=/config/extended tidaler dl "$videoUrl" 2>&1 | tee -a "/config/logs/$logFileName"
find "$videoDownloadPath/incomplete" -type f -exec mv "{}" "$videoDownloadPath/incomplete"/ \;
find "$videoDownloadPath/incomplete" -mindepth 1 -type d -exec rm -rf "{}" \; &>/dev/null
find "$videoDownloadPath/incomplete" -type f -regex ".*/.*\.\(mkv\|mp4\)" -print0 | while IFS= read -r -d '' video; do
diff --git a/lidarr/setup.bash b/lidarr/setup.bash
index 2658d5d0..c2ee4863 100644
--- a/lidarr/setup.bash
+++ b/lidarr/setup.bash
@@ -1,5 +1,5 @@
#!/usr/bin/with-contenv bash
-scriptVersion="1.4.5"
+scriptVersion="1.4.6"
SMA_PATH="/usr/local/sma"
if [ -f /config/setup_version.txt ]; then
@@ -42,7 +42,7 @@ uv pip install --system --upgrade --no-cache-dir --break-system-packages \
jellyfish \
beautifulsoup4 \
yt-dlp \
- beets \
+ "beets<2.6" \
yq \
pyxDamerauLevenshtein \
pyacoustid \
@@ -52,10 +52,10 @@ uv pip install --system --upgrade --no-cache-dir --break-system-packages \
pylast \
mutagen \
r128gain \
- tidal-dl \
deemix \
langdetect \
apprise && \
+uv pip install --system --upgrade --no-cache-dir --break-system-packages "git+https://github.com/maya-doshi/tidaler@ca82ffa526ca0fa91484e4dd858d53a498a7f719" && \
echo "************ setup SMA ************"
if [ -d "${SMA_PATH}" ]; then
rm -rf "${SMA_PATH}"
@@ -72,55 +72,55 @@ uv pip install --system --break-system-packages -r ${SMA_PATH}/setup/requirement
mkdir -p /custom-services.d/python /config/extended
parallel ::: \
- 'echo "Download QueueCleaner service..." && curl -sfL https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/universal/services/QueueCleaner -o /custom-services.d/QueueCleaner && echo "Done"' \
- 'echo "Download AutoConfig service..." && curl -sfL https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/AutoConfig.service.bash -o /custom-services.d/AutoConfig && echo "Done"' \
- 'echo "Download Video service..." && curl -sfL https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/Video.service.bash -o /custom-services.d/Video && echo "Done"' \
- 'echo "Download Tidal Video Downloader service..." && curl -sfL https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/TidalVideoDownloader.bash -o /custom-services.d/TidalVideoDownloader && echo "Done"' \
- 'echo "Download Audio service..." && curl -sfL https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/Audio.service.bash -o /custom-services.d/Audio && echo "Done"' \
- 'echo "Download AutoArtistAdder service..." && curl -sfL https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/AutoArtistAdder.bash -o /custom-services.d/AutoArtistAdder && echo "Done"' \
- 'echo "Download UnmappedFilesCleaner service..." && curl -sfL https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/UnmappedFilesCleaner.bash -o /custom-services.d/UnmappedFilesCleaner && echo "Done"' \
- 'echo "Download ARLChecker service..." && curl -sfL https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/python/ARLChecker.py -o /custom-services.d/python/ARLChecker.py && curl -sfL https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/ARLChecker -o /custom-services.d/ARLChecker && echo "Done"' \
- 'echo "Download Script Functions..." && curl -sfL https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/universal/functions.bash -o /config/extended/functions && echo "Done"' \
- 'echo "Download PlexNotify script..." && curl -sfL https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/PlexNotify.bash -o /config/extended/PlexNotify.bash && echo "Done"' \
- 'echo "Download SMA config..." && curl -sfL https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/sma.ini -o /config/extended/sma.ini && echo "Done"' \
- 'echo "Download LyricExtractor script..." && curl -sfL https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/LyricExtractor.bash -o /config/extended/LyricExtractor.bash && echo "Done"' \
- 'echo "Download ArtworkExtractor script..." && curl -sfL https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/ArtworkExtractor.bash -o /config/extended/ArtworkExtractor.bash && echo "Done"' \
- 'echo "Download Beets Tagger script..." && curl -sfL https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/BeetsTagger.bash -o /config/extended/BeetsTagger.bash && echo "Done"'
+ 'echo "Download QueueCleaner service..." && curl -sfL https://raw.githubusercontent.com/samhaswon/arr-scripts/main/universal/services/QueueCleaner -o /custom-services.d/QueueCleaner && echo "Done"' \
+ 'echo "Download AutoConfig service..." && curl -sfL https://raw.githubusercontent.com/samhaswon/arr-scripts/main/lidarr/AutoConfig.service.bash -o /custom-services.d/AutoConfig && echo "Done"' \
+ 'echo "Download Video service..." && curl -sfL https://raw.githubusercontent.com/samhaswon/arr-scripts/main/lidarr/Video.service.bash -o /custom-services.d/Video && echo "Done"' \
+ 'echo "Download Tidal Video Downloader service..." && curl -sfL https://raw.githubusercontent.com/samhaswon/arr-scripts/main/lidarr/TidalVideoDownloader.bash -o /custom-services.d/TidalVideoDownloader && echo "Done"' \
+ 'echo "Download Audio service..." && curl -sfL https://raw.githubusercontent.com/samhaswon/arr-scripts/main/lidarr/Audio.service.bash -o /custom-services.d/Audio && echo "Done"' \
+ 'echo "Download AutoArtistAdder service..." && curl -sfL https://raw.githubusercontent.com/samhaswon/arr-scripts/main/lidarr/AutoArtistAdder.bash -o /custom-services.d/AutoArtistAdder && echo "Done"' \
+ 'echo "Download UnmappedFilesCleaner service..." && curl -sfL https://raw.githubusercontent.com/samhaswon/arr-scripts/main/lidarr/UnmappedFilesCleaner.bash -o /custom-services.d/UnmappedFilesCleaner && echo "Done"' \
+ 'echo "Download ARLChecker service..." && curl -sfL https://raw.githubusercontent.com/samhaswon/arr-scripts/main/lidarr/python/ARLChecker.py -o /custom-services.d/python/ARLChecker.py && curl -sfL https://raw.githubusercontent.com/samhaswon/arr-scripts/main/lidarr/ARLChecker -o /custom-services.d/ARLChecker && echo "Done"' \
+ 'echo "Download Script Functions..." && curl -sfL https://raw.githubusercontent.com/samhaswon/arr-scripts/main/universal/functions.bash -o /config/extended/functions && echo "Done"' \
+ 'echo "Download PlexNotify script..." && curl -sfL https://raw.githubusercontent.com/samhaswon/arr-scripts/main/lidarr/PlexNotify.bash -o /config/extended/PlexNotify.bash && echo "Done"' \
+ 'echo "Download SMA config..." && curl -sfL https://raw.githubusercontent.com/samhaswon/arr-scripts/main/lidarr/sma.ini -o /config/extended/sma.ini && echo "Done"' \
+ 'echo "Download LyricExtractor script..." && curl -sfL https://raw.githubusercontent.com/samhaswon/arr-scripts/main/lidarr/LyricExtractor.bash -o /config/extended/LyricExtractor.bash && echo "Done"' \
+ 'echo "Download ArtworkExtractor script..." && curl -sfL https://raw.githubusercontent.com/samhaswon/arr-scripts/main/lidarr/ArtworkExtractor.bash -o /config/extended/ArtworkExtractor.bash && echo "Done"' \
+ 'echo "Download Beets Tagger script..." && curl -sfL https://raw.githubusercontent.com/samhaswon/arr-scripts/main/lidarr/BeetsTagger.bash -o /config/extended/BeetsTagger.bash && echo "Done"'
if [ ! -f /config/extended/beets-config.yaml ]; then
echo "Download Beets config..."
- curl -sfL "https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/beets-config.yaml" -o /config/extended/beets-config.yaml
+ curl -sfL "https://raw.githubusercontent.com/samhaswon/arr-scripts/main/lidarr/beets-config.yaml" -o /config/extended/beets-config.yaml
echo "Done"
fi
if [ ! -f /config/extended/beets-config-lidarr.yaml ]; then
echo "Download Beets lidarr config..."
- curl -sfL "https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/beets-config-lidarr.yaml" -o /config/extended/beets-config-lidarr.yaml
+ curl -sfL "https://raw.githubusercontent.com/samhaswon/arr-scripts/main/lidarr/beets-config-lidarr.yaml" -o /config/extended/beets-config-lidarr.yaml
echo "Done"
fi
if [ ! -f /config/extended/deemix_config.json ]; then
echo "Download Deemix config..."
- curl -sfL "https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/deemix_config.json" -o /config/extended/deemix_config.json
+ curl -sfL "https://raw.githubusercontent.com/samhaswon/arr-scripts/main/lidarr/deemix_config.json" -o /config/extended/deemix_config.json
echo "Done"
fi
-if [ ! -f /config/extended/tidal-dl.json ]; then
- echo "Download Tidal config..."
- curl -sfL "https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/tidal-dl.json" -o /config/extended/tidal-dl.json
+if [ ! -f /config/extended/tidaler.json ]; then
+ echo "Download Tidal (tidaler) config..."
+ curl -sfL "https://raw.githubusercontent.com/samhaswon/arr-scripts/main/lidarr/tidaler.json" -o /config/extended/tidaler.json
echo "Done"
fi
if [ ! -f /config/extended/beets-genre-whitelist.txt ]; then
echo "Download beets-genre-whitelist.txt..."
- curl -sfL https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/beets-genre-whitelist.txt -o /config/extended/beets-genre-whitelist.txt
+ curl -sfL https://raw.githubusercontent.com/samhaswon/arr-scripts/main/lidarr/beets-genre-whitelist.txt -o /config/extended/beets-genre-whitelist.txt
echo "Done"
fi
if [ ! -f /config/extended.conf ]; then
echo "Download Extended config..."
- curl -sfL https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/extended.conf -o /config/extended.conf
+ curl -sfL https://raw.githubusercontent.com/samhaswon/arr-scripts/main/lidarr/extended.conf -o /config/extended.conf
chmod 777 /config/extended.conf
echo "Done"
fi
diff --git a/lidarr/tidal-dl.json b/lidarr/tidal-dl.json
deleted file mode 100644
index c986d6fe..00000000
--- a/lidarr/tidal-dl.json
+++ /dev/null
@@ -1 +0,0 @@
-{"albumFolderFormat": "atd", "apiKeyIndex": 4, "audioQuality": "HiFi", "checkExist": true, "downloadPath": "/downloads/lidarr-extended/incomplete", "includeEP": true, "language": "0", "lyricFile": true, "multiThread": false, "saveAlbumInfo": false, "saveCovers": false, "showProgress": true, "showTrackInfo": true, "trackFileFormat": "{TrackNumber} - {TrackTitle}", "usePlaylistFolder": false, "videoFileFormat": "{VideoNumber} - {ArtistName} - {VideoTitle}{ExplicitFlag}", "videoQuality": "P1080"}
diff --git a/lidarr/tidaler.json b/lidarr/tidaler.json
new file mode 100644
index 00000000..de8f2e23
--- /dev/null
+++ b/lidarr/tidaler.json
@@ -0,0 +1,16 @@
+{
+ "download_base_path": "/downloads/lidarr-extended/incomplete",
+ "quality_audio": "LOSSLESS",
+ "quality_video": "1080",
+ "format_album": "{album_artist}/{album_title} ({album_year})",
+ "format_track": "{track_number} - {track_title}",
+ "format_playlist": "{playlist_title}/{track_number} - {track_title}",
+ "format_mix": "{mix_title}/{track_number} - {track_title}",
+ "format_video": "{artist_name} - {track_title}",
+ "path_binary_ffmpeg": "/usr/bin/ffmpeg",
+ "extract_flac": false,
+ "save_album_info": false,
+ "save_covers": false,
+ "save_lyrics": true,
+ "hide_progress": false
+}
diff --git a/universal/functions.bash b/universal/functions.bash
index ed3df173..346cef56 100644
--- a/universal/functions.bash
+++ b/universal/functions.bash
@@ -21,15 +21,15 @@ logfileSetup () {
getArrAppInfo () {
# Get Arr App information
if [ -z "$arrUrl" ] || [ -z "$arrApiKey" ]; then
- arrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)"
- if [ "$arrUrlBase" == "null" ]; then
+ arrUrlBase="$(sed -n 's:.*\(.*\).*:\1:p' /config/config.xml | head -n1)"
+ if [ -z "$arrUrlBase" ]; then
arrUrlBase=""
else
- arrUrlBase="/$(echo "$arrUrlBase" | sed "s/\///")"
+ arrUrlBase="/$(echo "$arrUrlBase" | sed 's:^/*::; s:/*$::')"
fi
- arrName="$(cat /config/config.xml | xq | jq -r .Config.InstanceName)"
- arrApiKey="$(cat /config/config.xml | xq | jq -r .Config.ApiKey)"
- arrPort="$(cat /config/config.xml | xq | jq -r .Config.Port)"
+ arrName="$(sed -n 's:.*\(.*\).*:\1:p' /config/config.xml | head -n1)"
+ arrApiKey="$(sed -n 's:.*\(.*\).*:\1:p' /config/config.xml | head -n1)"
+ arrPort="$(sed -n 's:.*\(.*\).*:\1:p' /config/config.xml | head -n1)"
arrUrl="http://127.0.0.1:${arrPort}${arrUrlBase}"
fi
}
@@ -39,14 +39,15 @@ verifyApiAccess () {
do
arrApiTest=""
arrApiVersion=""
+
+ arrApiVersion="v1"
+ arrApiTest="$(curl -fsS "$arrUrl/api/$arrApiVersion/system/status?apikey=$arrApiKey" 2>/dev/null | jq -er '.instanceName // .appName // empty' 2>/dev/null || true)"
+
if [ -z "$arrApiTest" ]; then
arrApiVersion="v3"
- arrApiTest="$(curl -s "$arrUrl/api/$arrApiVersion/system/status?apikey=$arrApiKey" | jq -r .instanceName)"
- fi
- if [ -z "$arrApiTest" ]; then
- arrApiVersion="v1"
- arrApiTest="$(curl -s "$arrUrl/api/$arrApiVersion/system/status?apikey=$arrApiKey" | jq -r .instanceName)"
+ arrApiTest="$(curl -fsS "$arrUrl/api/$arrApiVersion/system/status?apikey=$arrApiKey" 2>/dev/null | jq -er '.instanceName // .appName // empty' 2>/dev/null || true)"
fi
+
if [ ! -z "$arrApiTest" ]; then
break
else