bundles/mixcloud-downloader: add login via netrc

This commit is contained in:
Franzi 2024-07-07 10:22:26 +02:00
parent 52b68d6e42
commit 5a86e657ff
Signed by: kunsi
GPG key ID: 12E3D2136B818350
4 changed files with 23 additions and 2 deletions

View file

@ -1,11 +1,15 @@
#!/bin/bash
OPTS=""
OPTS="--netrc"
OPTS="$OPTS --netrc-location /opt/mixcloud-downloader/netrc"
OPTS="$OPTS --retry-sleep linear=1::2"
OPTS="$OPTS --retry-sleep fragment:exp=1:60"
OPTS="$OPTS --extractor-retries 5"
if [[ -n "$DEBUG" ]]
then
set -x
else
OPTS="-q"
OPTS="$OPTS -q"
fi
set -euo pipefail

View file

@ -0,0 +1,3 @@
% for domain, data in sorted(node.metadata.get('mixcloud-downloader/netrc', {}).items()):
machine ${domain} login ${data['username']} password ${data['password']}
% endfor

View file

@ -6,3 +6,9 @@ files['/opt/mixcloud-downloader/download.sh'] = {
directories['/opt/mixcloud-downloader'] = {
'owner': 'kunsi',
}
files['/opt/mixcloud-downloader/netrc'] = {
'content_type': 'mako',
'mode': '0400',
'owner': 'kunsi',
}

View file

@ -101,6 +101,14 @@ nodes['home.nas'] = {
'home.lgtv-wohnzimmer',
},
},
'mixcloud-downloader': {
'netrc': {
'soundcloud': {
'username': 'oauth',
'password': bwpass.attr('soundcloud.com/hi@kunsmann.eu', 'oauth_token'),
},
},
},
'mosquitto': {
'bridges': {
'c3voc': {