diff options
-rw-r--r-- | PKGBUILD | 4 | ||||
-rwxr-xr-x | youtube-dl-mp3 | 8 |
2 files changed, 9 insertions, 3 deletions
@@ -1,8 +1,8 @@ # Maintainer: Radostin Stoyanov <rstoyanov1 at gmail dot com> pkgname=youtube-dl-mp3 -pkgver=2017.04.14 +pkgver=2018.01.03 _appname=youtube-dl-mp3 -_release=2017.04.14 +_release=2018.01.03 pkgrel=1 pkgdesc="Convert YouTube videos in HQ audio with mp3 format." arch=('any') diff --git a/youtube-dl-mp3 b/youtube-dl-mp3 index c1f44bfbb8db..6ea53f1f2634 100755 --- a/youtube-dl-mp3 +++ b/youtube-dl-mp3 @@ -1,2 +1,8 @@ #!/bin/bash -youtube-dl --extract-audio --audio-format mp3 --audio-quality 0 --ignore-errors -o "%(title)s.%(ext)s" $@ + +# Check if xclip is installed and no argument are passed +if [ -x "$(command -v xclip)" ] && [ "$#" -le 1 ] ; then + youtube-dl --extract-audio --audio-format mp3 --audio-quality 0 --ignore-errors -o "%(title)s.%(ext)s" "$(xclip -o)" +else + youtube-dl --extract-audio --audio-format mp3 --audio-quality 0 --ignore-errors -o "%(title)s.%(ext)s" $@ +fi |