home.nas: add bundle:mixcloud-downloader
This commit is contained in:
parent
615f6107bc
commit
15ea875742
4 changed files with 74 additions and 6 deletions
54
bundles/mixcloud-downloader/files/download.sh
Normal file
54
bundles/mixcloud-downloader/files/download.sh
Normal 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
|
8
bundles/mixcloud-downloader/items.py
Normal file
8
bundles/mixcloud-downloader/items.py
Normal file
|
@ -0,0 +1,8 @@
|
|||
files['/opt/mixcloud-downloader/download.sh'] = {
|
||||
'mode': '0500',
|
||||
'owner': 'kunsi',
|
||||
}
|
||||
|
||||
directories['/opt/mixcloud-downloader'] = {
|
||||
'owner': 'kunsi',
|
||||
}
|
11
bundles/mixcloud-downloader/metadata.py
Normal file
11
bundles/mixcloud-downloader/metadata.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
defaults = {
|
||||
'systemd-timers': {
|
||||
'timers': {
|
||||
'mixcloud-downloader': {
|
||||
'command': '/opt/mixcloud-downloader/download.sh',
|
||||
'user': 'kunsi',
|
||||
'when': '*-*-* 03:00:00',
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue