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',
},
},
},
}

View file

@ -5,6 +5,7 @@ nodes['home.nas'] = {
'bundles': {
'backup-client',
'lm-sensors',
'mixcloud-downloader',
'mosquitto',
'nfs-server',
'scansnap',
@ -186,12 +187,6 @@ nodes['home.nas'] = {
'find /storage/nas/ -type d -exec chmod 0775 {} \;',
'find /storage/nas/ -type f -exec chmod 0664 {} \;',
],
'when': '*-*-* 03:00:00',
},
'nas_mixcloud': {
'command': vault.decrypt('encrypt$gAAAAABgxFkM0Zd8SOhk8aK_zsUY5S39FvyxvEq9TVnAK-ryn9qjrpziqUgNyPXFQBSUHPCV5DX6CW6iSQFGO54truPoaymdHFwchWh3u6bOar_h8x3er3I=').format_into('wget --mirror --page-requisites --convert-links --domains {0} --execute robots=off https://{0}/'),
'pwd': '/storage/nas/Musik/Compilations',
'user': 'kunsi',
'when': '*-*-* 02:00:00',
},
},