diff options
Diffstat (limited to 'bin/common/ytclipo')
-rwxr-xr-x | bin/common/ytclipo | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/bin/common/ytclipo b/bin/common/ytclipo index 5d86c3f..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>" || : @@ -23,5 +27,5 @@ yt-dlp "$inp" \ -f "b" \ -S "res:1080" \ -P "$HOME/vids/youtube/" \ - -o "%(channel)s - %(title)s.%(ext)s" + -o "%(channel)s/%(title)s.%(ext)s" notify-send "ytclipo" "finished downloading." || : |