diff options
Diffstat (limited to 'bin/common/ytclipo')
-rwxr-xr-x | bin/common/ytclipo | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/bin/common/ytclipo b/bin/common/ytclipo index 5d86c3f..6416a15 100755 --- a/bin/common/ytclipo +++ b/bin/common/ytclipo @@ -1,21 +1,8 @@ #!/bin/sh -# argument ($1) -> clipboard -> stdin -if [ "$WAYLAND_DISPLAY" ] -then paste() { wl-paste; } -elif [ "$TERMUX_VERSION" ] -then paste() { termux-clipboard-get; } -else paste() { xclip -o -sel c; } -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/')" +inp="$(ytlink)" >&2 printf "inp: %s\n" "$inp" -notify-send "ytclipo" "downloading <i>$inp</i>" || : +# notify-send "ytclipo" "downloading <i>$inp</i>" || : yt-dlp "$inp" \ --restrict-filenames \ @@ -23,5 +10,5 @@ yt-dlp "$inp" \ -f "b" \ -S "res:1080" \ -P "$HOME/vids/youtube/" \ - -o "%(channel)s - %(title)s.%(ext)s" -notify-send "ytclipo" "finished downloading." || : + -o "%(channel)s/%(title)s.%(ext)s" +# notify-send "ytclipo" "finished downloading." || : |