summaryrefslogtreecommitdiff
path: root/conf.d/99-youtube-dl.zsh
blob: 8e572a56209d553ee2b635c721558aaa0e8b8157 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function download_audio() {
  youtube-dl \
    --extract-audio --audio-format vorbis --audio-quality 0 --no-call-home \
    --restrict-filenames --ignore-errors --add-metadata $@
}

function rip() {
  if [ "$#" -ne 1 ]; then
    download_audio $(xclip -o)
  else
    download_audio $@
  fi
}

function ripto() {
  mkdir $1
  pushd $1
  rip $2
  popd
}