summaryrefslogtreecommitdiff
path: root/yt.sh
diff options
context:
space:
mode:
Diffstat (limited to 'yt.sh')
-rwxr-xr-xyt.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/yt.sh b/yt.sh
index d422a66..2ec834e 100755
--- a/yt.sh
+++ b/yt.sh
@@ -47,7 +47,8 @@ prompt_url() {
## Grab url from clipboard/primary selection, else get via prompt
grab_url() {
- if url=$(xclip -o -selection clipboard 2>/dev/null || echo) && check_if_youtube $url; then
+ if url="$1" && check_if_youtube $url; then
+ elif url=$(xclip -o -selection clipboard 2>/dev/null || echo) && check_if_youtube $url; then
elif url=$(xclip -o 2>/dev/null || echo) && check_if_youtube $url; then
elif url=$(grab_url_stdin) && check_if_youtube $url; then
elif url=$(prompt_url) && check_if_youtube $url; then
@@ -131,7 +132,7 @@ print_info() {
## Main
mkdir -p "$DOWNLOAD_DIR"
-url=$(grab_url)
+url=$(grab_url "$1")
case "$(get_action_single)" in
5)