dotfiles

Cross platform dotfiles for linux, mac and windows
git clone git@getsh.org:dotfiles.git
Log | Files | Refs

songdl (293B)


      1 #!/bin/sh
      2 
      3 [ $# -ne 1 ] && echo "Usage: $0 <youtube-url>" && exit 1
      4 
      5 : ${XDG_MUSIC_DIR:=$HOME/Music}
      6 cd "${XDG_MUSIC_DIR:?$XDG_MUSIC_DIR not found}"
      7 
      8 song_name=$1
      9 
     10 yt-dlp --extract-audio --audio-format mp3 "$song_name" --external-downloader aria2c
     11 
     12 if type mpc >/dev/null; then
     13 	mpc update
     14 fi