diff options
author | Tharre <tharre3@gmail.com> | 2016-08-25 06:56:02 +0200 |
---|---|---|
committer | Tharre <tharre3@gmail.com> | 2016-10-07 20:13:40 +0000 |
commit | 921665ddc86ac02d211ba55804b546d77b6ecd7a (patch) | |
tree | 0e5eaf258487f0d09d266fe936431f936d54aeb7 | |
parent | cacd76fca9d0cb6f664df2cc8e1427301ef964eb (diff) | |
download | dotfiles-921665ddc86ac02d211ba55804b546d77b6ecd7a.tar.gz dotfiles-921665ddc86ac02d211ba55804b546d77b6ecd7a.tar.xz dotfiles-921665ddc86ac02d211ba55804b546d77b6ecd7a.zip |
zsh: add play for playing music from youtube
-rw-r--r-- | shell/_zshrc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/shell/_zshrc b/shell/_zshrc index 668e1c8..6de5049 100644 --- a/shell/_zshrc +++ b/shell/_zshrc @@ -108,6 +108,19 @@ function 256color_test { done ) } +# requires youtube-dl, mpv +function play { + # Skip DASH manifest for speed purposes. This might actually disable + # being able to specify things like 'bestaudio' as the requested format, + # but try anyway. + # Use "$*" so that quoting the requested song isn't necessary. + mpv $(youtube-dl --default-search=ytsearch: \ + --max-downloads 1 \ + --youtube-skip-dash-manifest \ + --format="bestaudio" \ + -g "$*") +} + # update function update_dotfiles() { dotfiles="$HOME/dotfiles" |