summaryrefslogtreecommitdiff
path: root/conf.d/99-youtube-dl.zsh
diff options
context:
space:
mode:
authorTill Höppner2017-05-15 14:32:03 +0200
committerTill Höppner2017-05-15 14:32:03 +0200
commit25cd8380f802b069f95d9514563aa2a083176925 (patch)
tree932cee39b430d984570842817d7f4649f6a33956 /conf.d/99-youtube-dl.zsh
parentb2bf9b7a2d72f91d75f2222a70d54eaeb8b04d61 (diff)
downloadzsh-25cd8380f802b069f95d9514563aa2a083176925.tar.gz
zsh-25cd8380f802b069f95d9514563aa2a083176925.tar.xz
zsh-25cd8380f802b069f95d9514563aa2a083176925.zip
Add prompt and other conf.d
Diffstat (limited to 'conf.d/99-youtube-dl.zsh')
-rw-r--r--conf.d/99-youtube-dl.zsh20
1 files changed, 20 insertions, 0 deletions
diff --git a/conf.d/99-youtube-dl.zsh b/conf.d/99-youtube-dl.zsh
new file mode 100644
index 0000000..8e572a5
--- /dev/null
+++ b/conf.d/99-youtube-dl.zsh
@@ -0,0 +1,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
+}