diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2021-02-24 17:07:33 +0100 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2021-02-24 17:07:33 +0100 |
| commit | 468a789dbc4b1928c035d8590895efc533520a27 (patch) | |
| tree | 74cb056c37eaa50cd50491a7665608488ed4feb1 /local/bin/music-dl | |
| parent | f9883d2c3b3699d91e98feeffd7eece546f7c57e (diff) | |
| download | dotfiles-468a789dbc4b1928c035d8590895efc533520a27.tar.gz dotfiles-468a789dbc4b1928c035d8590895efc533520a27.tar.bz2 dotfiles-468a789dbc4b1928c035d8590895efc533520a27.zip | |
Updated file tree to match XDG base directory specification
Diffstat (limited to 'local/bin/music-dl')
| -rwxr-xr-x | local/bin/music-dl | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/local/bin/music-dl b/local/bin/music-dl new file mode 100755 index 0000000..a16cd97 --- /dev/null +++ b/local/bin/music-dl @@ -0,0 +1,34 @@ +#!/bin/sh + +conf_filename=music-dl.conf + +error() { + echo "Error: $1" + return 1 +} + +fatal() { + error "$1" + exit 1 +} + +[ ! -f "$conf_filename" ] && fatal "'$conf_filename' not found in current directory" + +conf_get() { + key="$1" + matches="$(sed -n 's/^'"$key"'=\(.*\)$/\1/ p' $conf_filename)" + if [ -z "$matches" ] + then + error "'$key' not found in '$conf_filename'" + return 1 + fi + echo "$matches" | tail -n 1 +} + +conf_get bonjour || echo pas bien +conf_get aurevoir + + +# ytdl='youtube-dl --output "%(title)s.%(ext)s"' +# ytdlp='youtube-dl --audio-format mp3 -i --output "%(playlist_index)s-%(title)s.%(ext)s"' +# ytdla='youtube-dl --audio-format mp3 -i -x -f bestaudio/best --output "%(playlist_index)s-%(title)s.%(ext)s"' |
