diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-04-05 16:16:22 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-04-05 16:16:22 +0200 |
commit | 41274612c1c20c18169bf3136cbee71e985b5941 (patch) | |
tree | 8320646edd2e24e7ef7d672b2e086ba1b3ef7ab9 /bin | |
parent | ad91c1f586860e3d1fcf9f91b35d30d22f49ed68 (diff) |
use last 11 chars for youtube url
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/common/ytclipo | 3 |
1 files changed, 1 insertions, 2 deletions
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" "<b>downloading</b> $inp" |