bundles/mixcloud-downloader: improvements

This commit is contained in:
Franzi 2022-12-07 18:06:44 +01:00
parent 15ea875742
commit d86dc32f51
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -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