From d86dc32f516260614d5f2669828b98f96133b79d Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Wed, 7 Dec 2022 18:06:44 +0100 Subject: [PATCH] bundles/mixcloud-downloader: improvements --- bundles/mixcloud-downloader/files/download.sh | 32 +++++++++++++++---- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/bundles/mixcloud-downloader/files/download.sh b/bundles/mixcloud-downloader/files/download.sh index 84c8039..963d44d 100644 --- a/bundles/mixcloud-downloader/files/download.sh +++ b/bundles/mixcloud-downloader/files/download.sh @@ -1,6 +1,12 @@ #!/bin/bash -[[ -n "$DEBUG" ]] && set -x +OPTS="" +if [[ -n "$DEBUG" ]] +then + set -x +else + OPTS="-q" +fi set -euo pipefail @@ -13,8 +19,11 @@ source /opt/mixcloud-downloader/venv/bin/activate pip install --upgrade pip yt-dlp +errors=0 + for i in Neosignal tasmo starkato b4m Alexeyan jakehunnter davem_dokebi tasmo do + echo "> mixcloud $i" >&2 if ! [[ -d "/storage/nas/Musik/mixcloud/$i" ]] then # no -p here, this should fail if @@ -23,11 +32,14 @@ do fi ( cd "/storage/nas/Musik/mixcloud/$i" - yt-dlp "https://mixcloud.com/$i" - ) + yt-dlp $OPTS "https://mixcloud.com/$i" + echo $? >&2 + ) || errors=1 done for i in CouchsofaLiveSets +do + echo "> archive.org $i" >&2 if ! [[ -d "/storage/nas/Musik/mixcloud/$i" ]] then # no -p here, this should fail if @@ -36,11 +48,14 @@ for i in CouchsofaLiveSets fi ( cd "/storage/nas/Musik/mixcloud/$i" - yt-dlp "https://archive.org/details/$i" - ) + yt-dlp $OPTS "https://archive.org/details/$i" + echo $? >&2 + ) || errors=1 done for i in tschunkelmusik +do + echo "> soundcloud $i" >&2 if ! [[ -d "/storage/nas/Musik/mixcloud/$i" ]] then # no -p here, this should fail if @@ -49,6 +64,9 @@ for i in tschunkelmusik fi ( cd "/storage/nas/Musik/mixcloud/$i" - yt-dlp "https://soundcloud.com/$i" - ) + yt-dlp $OPTS "https://soundcloud.com/$i" + echo $? >&2 + ) || errors=1 done + +exit $errors