summaryrefslogtreecommitdiffstats
path: root/fish/functions/ytmp3.fish
diff options
context:
space:
mode:
authorMatthew Lemon <matt@matthewlemon.com>2022-09-05 14:14:34 +0100
committerMatthew Lemon <matt@matthewlemon.com>2022-09-05 14:14:34 +0100
commit5f504660a8e7478fac3f5b14e8661399154b119c (patch)
treefd879e1617af74d644ef314a79d8df7dbd74b71c /fish/functions/ytmp3.fish
parent7a77faf913cd9e51d520705de3e78d73b09b43a1 (diff)
parentb1e86fd7e719ff243535751cf8bc3c75f8531f29 (diff)
Merge branch 'master' of github.com:yulqen/openbsddotfiles
Diffstat (limited to 'fish/functions/ytmp3.fish')
-rw-r--r--fish/functions/ytmp3.fish7
1 files changed, 7 insertions, 0 deletions
diff --git a/fish/functions/ytmp3.fish b/fish/functions/ytmp3.fish
new file mode 100644
index 0000000..f66467e
--- /dev/null
+++ b/fish/functions/ytmp3.fish
@@ -0,0 +1,7 @@
+function ytmp3 --description 'Download YouTube video or playlist as audio' --argument url
+ if test -n "$url"
+ cd ~/Downloads && yt-dlp -f 'ba' -x --audio-format mp3 "$url" -o '%(title)s.%(ext)s' && cd - || return
+ else
+ echo "Please give me a URL."
+ end
+end