Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Commit

Permalink
1.0.10 - New Feature - download using Freyr client
Browse files Browse the repository at this point in the history
#102 - Resolves this request

If no ARL token is provided, use Freyr software to perform download without an account.

requireQuality must be disabled for it to function.
dlClientSource must be set to "both" or "deezer"

More info on Freyr can be found here: https://github.com/miraclx/freyr-js
  • Loading branch information
RandomNinjaAtk authored Jun 16, 2023
1 parent 4cacf42 commit b14973c
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions root/scripts/Audio.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
scriptVersion="1.0.9"
scriptVersion="1.0.10"
if [ -z "$lidarrUrl" ] || [ -z "$lidarrApiKey" ]; then
lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)"
if [ "$lidarrUrlBase" == "null" ]; then
Expand All @@ -24,7 +24,7 @@ fi
#addRelatedArtists="true"
#numberOfRelatedArtistsToAddPerArtist="1"
#beetsMatchPercentage="90"
#requireQuality="true"
#requireQuality="false"
#searchSort="album"
#arlToken=""
#matchDistance=10
Expand Down Expand Up @@ -174,6 +174,10 @@ Configuration () {

}

DownloadClientFreyr () {
freyr -d /downloads-lidarr-extended/incomplete deezer:album:$1
}

DownloadFormat () {

if [ "$audioFormat" == "native" ]; then
Expand Down Expand Up @@ -434,7 +438,11 @@ DownloadProcess () {
log "$page :: $wantedAlbumListSource :: $processNumber of $wantedListAlbumTotal :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Download Attempt number $downloadTry"
if [ "$2" == "DEEZER" ]; then

deemix -b $deemixQuality -p "$downloadPath"/incomplete "https://www.deezer.com/album/$1"
if [ -z $arlToken ]; then
DownloadClientFreyr $1
else
deemix -b $deemixQuality -p "$downloadPath"/incomplete "https://www.deezer.com/album/$1"
fi

if [ -d "/tmp/deemix-imgs" ]; then
rm -rf /tmp/deemix-imgs
Expand Down Expand Up @@ -524,13 +532,9 @@ DownloadProcess () {
done

# Consolidate files to a single folder
if [ "$2" == "TIDAL" ]; then
log "$page :: $wantedAlbumListSource :: $processNumber of $wantedListAlbumTotal :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Consolidating files to single folder"
find "$downloadPath/incomplete" -type f -exec mv "{}" "$downloadPath"/incomplete/ \;
if [ -d "$downloadPath"/incomplete/atd ]; then
rm -rf "$downloadPath"/incomplete/atd
fi
fi
log "$page :: $wantedAlbumListSource :: $processNumber of $wantedListAlbumTotal :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Consolidating files to single folder"
find "$downloadPath/incomplete" -type f -exec mv "{}" "$downloadPath"/incomplete/ \;
find /downloads-lidarr-extended/incomplete/ -type d -mindepth 1 -maxdepth 1 -exec rm -rf {} \;

downloadCount=$(find "$downloadPath"/incomplete/ -type f -regex ".*/.*\.\(flac\|m4a\|mp3\)" | wc -l)
if [ "$downloadCount" -gt "0" ]; then
Expand Down

0 comments on commit b14973c

Please sign in to comment.