From 41274612c1c20c18169bf3136cbee71e985b5941 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Wed, 5 Apr 2023 16:16:22 +0200 Subject: use last 11 chars for youtube url --- bin/common/ytclipo | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'bin/common') diff --git a/bin/common/ytclipo b/bin/common/ytclipo index 337064d..e97cb94 100755 --- a/bin/common/ytclipo +++ b/bin/common/ytclipo @@ -4,10 +4,9 @@ test -z "${inp:=${1:-"$(xclip -sel c -o)"}}" && inp="$(cat /dev/stdin)" -echo "inp: ${inp}" 1>&2 # take last link from clipboard # works when link is from yt-local -inp="$(echo -n "$inp" | awk -F 'https?://' '{print $NF}')" +inp="https://youtu.be/$(echo "$inp" | sed 's/.*\(.\{11\}\)$/\1/')" echo "inp: ${inp}" 1>&2 notify-send "ytclipo" "downloading $inp" -- cgit v1.2.3