From 1dcdf0cdb769296c33737d285ba9008cff0d60ba Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Thu, 16 Nov 2023 21:56:12 +0100 Subject: improved compatibility for different frontends Introduces the use of parameter expansion for converting the link, also convert to youtube.com, because this fixes the bug where you couldn't download playlists/channels. --- bin/common/ytclipo | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'bin/common') 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 $inp" || : -- cgit v1.2.3