diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-11-21 08:10:42 +0100 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-11-21 08:10:42 +0100 |
commit | b7d6233eafbd99ddeb290cd819d45dc47963f38b (patch) | |
tree | 4a721595a3c4271616bd5a14022fe4f39c231f9f /bin/common | |
parent | bfa7773e012872619696ecc3754c11606f8a272d (diff) | |
parent | d17ca596e01d30334160eefeb7fb9b22cbc629c5 (diff) |
Merge branch 'main' of debuc.com:dotfiles
Diffstat (limited to 'bin/common')
-rwxr-xr-x | bin/common/ytclipo | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/bin/common/ytclipo b/bin/common/ytclipo index 8997539..959ee21 100755 --- a/bin/common/ytclipo +++ b/bin/common/ytclipo @@ -11,9 +11,13 @@ fi inp="$1" [ "${inp:=$(paste)}" ] || inp="$(cat /dev/stdin)" -# take last link from clipboard -# works when link is from yt-local -inp="https://youtu.be/$(echo "$inp" | sed 's/.*\(.\{11\}\)$/\1/')" +# remove util scheme +inp="${inp#*//}" +# convert to youtube.com/path url +# works for: +# - 'youtu.be/watch?v=xxxxxx' +# - 'https://piped.video/watch?v=xxxxx' +inp="https://youtube.com/${inp#*/}" >&2 printf "inp: %s\n" "$inp" notify-send "ytclipo" "downloading <i>$inp</i>" || : |