aboutsummarylogtreecommitdiffstats
path: root/youtube-dl-mp3
diff options
context:
space:
mode:
Diffstat (limited to 'youtube-dl-mp3')
-rwxr-xr-xyoutube-dl-mp38
1 files changed, 7 insertions, 1 deletions
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