diff options
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>" || : |