aboutsummarylogtreecommitdiffstats
path: root/youtube-dl-mp3
diff options
context:
space:
mode:
authorRadostin Stoyanov2018-01-03 12:21:48 +0000
committerRadostin Stoyanov2018-01-03 12:21:48 +0000
commitc8ed4efdc7b731388c7f33ad9f79f7476c2fe48d (patch)
treea5c75026eebf4419fbc09e0fb7e0bf291d3caf2f /youtube-dl-mp3
parent1ae7006cc7b461ed8ba995195e866851393978b2 (diff)
downloadaur-c8ed4efdc7b731388c7f33ad9f79f7476c2fe48d.tar.gz
Get URL from clipboard if no arguments are given
Use `xclip` to get URL from clipboard
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