diff options
author | jdlugosz963 <jdlugosz963@gmail.com> | 2022-12-28 16:16:57 +0100 |
---|---|---|
committer | jdlugosz963 <jdlugosz963@gmail.com> | 2022-12-28 16:16:57 +0100 |
commit | 23a70dc3ece576344603c67ac219b524f7086bca (patch) | |
tree | 9703cd58012c7f69903627e6bb6577c7d0b844cb /.bin/download_music.sh | |
parent | aaf735839cdd308dd2a4f89b6f85d482c970710e (diff) | |
download | dotfiles-23a70dc3ece576344603c67ac219b524f7086bca.tar.gz dotfiles-23a70dc3ece576344603c67ac219b524f7086bca.zip |
Add custom scripts to bin folder
Diffstat (limited to '.bin/download_music.sh')
-rwxr-xr-x | .bin/download_music.sh | 26 |
1 files changed, 26 insertions, 0 deletions
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 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | BOLD="\e[1"; | ||
4 | ENDCOLOR="\e[0m"; | ||
5 | Green="32"; | ||
6 | LightRed="31"; | ||
7 | |||
8 | if ! [ $1 ]; then | ||
9 | echo "" | ||
10 | echo -e $BOLD";"";"$LightRed"m Please provide music url!"$ENDCOLOR | ||
11 | echo "" | ||
12 | exit | ||
13 | fi | ||
14 | |||
15 | MUSIC_DIR="~/Documents/Music/%(artist)s/%(album)s/%(title)s-%(id)s.%(ext)s" | ||
16 | if [ $2 ]; then | ||
17 | MUSIC_DIR="${a}/%(artist)s/%(album)s/%(title)s-%(id)s.%(ext)s" | ||
18 | fi | ||
19 | |||
20 | echo "" | ||
21 | echo -e $BOLD";"";"$Green"m Music will download to ${MUSIC_DIR} directory!"$ENDCOLOR | ||
22 | echo "" | ||
23 | |||
24 | sleep 1 | ||
25 | |||
26 | yt-dlp -x --audio-format mp3 --embed-metadata -o $MUSIC_DIR $1 | ||