2022-12-07 03:24:38 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-12-07 17:06:44 +00:00
|
|
|
OPTS=""
|
|
|
|
if [[ -n "$DEBUG" ]]
|
|
|
|
then
|
|
|
|
set -x
|
|
|
|
else
|
|
|
|
OPTS="-q"
|
|
|
|
fi
|
2022-12-07 03:24:38 +00:00
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
if ! [[ -d /opt/mixcloud-downloader/venv ]]
|
|
|
|
then
|
|
|
|
virtualenv -p python3 /opt/mixcloud-downloader/venv
|
|
|
|
fi
|
|
|
|
|
|
|
|
source /opt/mixcloud-downloader/venv/bin/activate
|
|
|
|
|
|
|
|
pip install --upgrade pip yt-dlp
|
|
|
|
|
2022-12-07 17:06:44 +00:00
|
|
|
errors=0
|
|
|
|
|
2022-12-07 03:24:38 +00:00
|
|
|
for i in Neosignal tasmo starkato b4m Alexeyan jakehunnter davem_dokebi tasmo
|
|
|
|
do
|
2022-12-07 17:06:44 +00:00
|
|
|
echo "> mixcloud $i" >&2
|
2022-12-07 03:24:38 +00:00
|
|
|
if ! [[ -d "/storage/nas/Musik/mixcloud/$i" ]]
|
|
|
|
then
|
|
|
|
# no -p here, this should fail if
|
|
|
|
# zfs is not mounted
|
|
|
|
mkdir "/storage/nas/Musik/mixcloud/$i"
|
|
|
|
fi
|
|
|
|
(
|
|
|
|
cd "/storage/nas/Musik/mixcloud/$i"
|
2022-12-07 17:06:44 +00:00
|
|
|
yt-dlp $OPTS "https://mixcloud.com/$i"
|
|
|
|
echo $? >&2
|
|
|
|
) || errors=1
|
2022-12-07 03:24:38 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
for i in CouchsofaLiveSets
|
2022-12-07 17:06:44 +00:00
|
|
|
do
|
|
|
|
echo "> archive.org $i" >&2
|
2022-12-07 03:24:38 +00:00
|
|
|
if ! [[ -d "/storage/nas/Musik/mixcloud/$i" ]]
|
|
|
|
then
|
|
|
|
# no -p here, this should fail if
|
|
|
|
# zfs is not mounted
|
|
|
|
mkdir "/storage/nas/Musik/mixcloud/$i"
|
|
|
|
fi
|
|
|
|
(
|
|
|
|
cd "/storage/nas/Musik/mixcloud/$i"
|
2022-12-07 17:06:44 +00:00
|
|
|
yt-dlp $OPTS "https://archive.org/details/$i"
|
|
|
|
echo $? >&2
|
|
|
|
) || errors=1
|
2022-12-07 03:24:38 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
for i in tschunkelmusik
|
2022-12-07 17:06:44 +00:00
|
|
|
do
|
|
|
|
echo "> soundcloud $i" >&2
|
2022-12-07 03:24:38 +00:00
|
|
|
if ! [[ -d "/storage/nas/Musik/mixcloud/$i" ]]
|
|
|
|
then
|
|
|
|
# no -p here, this should fail if
|
|
|
|
# zfs is not mounted
|
|
|
|
mkdir "/storage/nas/Musik/mixcloud/$i"
|
|
|
|
fi
|
|
|
|
(
|
|
|
|
cd "/storage/nas/Musik/mixcloud/$i"
|
2022-12-07 17:06:44 +00:00
|
|
|
yt-dlp $OPTS "https://soundcloud.com/$i"
|
|
|
|
echo $? >&2
|
|
|
|
) || errors=1
|
2022-12-07 03:24:38 +00:00
|
|
|
done
|
2022-12-07 17:06:44 +00:00
|
|
|
|
|
|
|
exit $errors
|