summaryrefslogtreecommitdiffstats
path: root/files/.bin/download_music.sh
blob: e3a3601a3a1564d22652743559e04cdead0132f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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