home.nas: add bundle:mixcloud-downloader

This commit is contained in:
Franzi 2022-12-07 04:24:38 +01:00
parent 615f6107bc
commit 15ea875742
Signed by: kunsi
GPG key ID: 12E3D2136B818350
4 changed files with 74 additions and 6 deletions

View file

@ -0,0 +1,54 @@
#!/bin/bash
[[ -n "$DEBUG" ]] && set -x
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
for i in Neosignal tasmo starkato b4m Alexeyan jakehunnter davem_dokebi tasmo
do
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"
yt-dlp "https://mixcloud.com/$i"
)
done
for i in CouchsofaLiveSets
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"
yt-dlp "https://archive.org/details/$i"
)
done
for i in tschunkelmusik
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"
yt-dlp "https://soundcloud.com/$i"
)
done

View file

@ -0,0 +1,8 @@
files['/opt/mixcloud-downloader/download.sh'] = {
'mode': '0500',
'owner': 'kunsi',
}
directories['/opt/mixcloud-downloader'] = {
'owner': 'kunsi',
}

View file

@ -0,0 +1,11 @@
defaults = {
'systemd-timers': {
'timers': {
'mixcloud-downloader': {
'command': '/opt/mixcloud-downloader/download.sh',
'user': 'kunsi',
'when': '*-*-* 03:00:00',
},
},
},
}