From 23a70dc3ece576344603c67ac219b524f7086bca Mon Sep 17 00:00:00 2001 From: jdlugosz963 Date: Wed, 28 Dec 2022 16:16:57 +0100 Subject: Add custom scripts to bin folder --- .bin/download_music.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 .bin/download_music.sh (limited to '.bin/download_music.sh') diff --git a/.bin/download_music.sh b/.bin/download_music.sh new file mode 100755 index 0000000..e3a3601 --- /dev/null +++ b/.bin/download_music.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +BOLD="\e[1"; +ENDCOLOR="\e[0m"; +Green="32"; +LightRed="31"; + +if ! [ $1 ]; then + echo "" + echo -e $BOLD";"";"$LightRed"m Please provide music url!"$ENDCOLOR + echo "" + exit +fi + +MUSIC_DIR="~/Documents/Music/%(artist)s/%(album)s/%(title)s-%(id)s.%(ext)s" +if [ $2 ]; then + MUSIC_DIR="${a}/%(artist)s/%(album)s/%(title)s-%(id)s.%(ext)s" +fi + +echo "" +echo -e $BOLD";"";"$Green"m Music will download to ${MUSIC_DIR} directory!"$ENDCOLOR +echo "" + +sleep 1 + +yt-dlp -x --audio-format mp3 --embed-metadata -o $MUSIC_DIR $1 -- cgit v1.2.3