summaryrefslogtreecommitdiff
path: root/bin/common/ytclipo
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2024-01-05 16:56:42 +0100
committerRaymaekers Luca <raymaekers.luca@gmail.com>2024-01-05 16:56:42 +0100
commite6e98313b9769b431d8a66c0aac2b82295d2bf1e (patch)
tree1cdbc2075815fa88a0b80818174542e00a41f855 /bin/common/ytclipo
parent541ab2e483efe77d08ae5d04119a834f24b6d150 (diff)
parent0d10205772b2745356969176de6f52510527e5a6 (diff)
Merge branch 'main' of db:dotfiles
Diffstat (limited to 'bin/common/ytclipo')
-rwxr-xr-xbin/common/ytclipo21
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." || :