diff options
Diffstat (limited to 'bin/common/ytclipo')
-rwxr-xr-x | bin/common/ytclipo | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/bin/common/ytclipo b/bin/common/ytclipo new file mode 100755 index 0000000..ee5bf0f --- /dev/null +++ b/bin/common/ytclipo @@ -0,0 +1,17 @@ +#!/bin/sh + +# argument ($1) -> clipboard -> stdin +test -z "${inp:=${1:-"$(xclip -sel c -o)"}}" \ + && inp="$(cat /dev/stdin)" + +echo "inp: ${inp}" 1>&2 +# take last link from clipboard +# works when link is from yt-local +inp="$(echo -n "$inp" | awk -F 'https?://' '{print $NF}')" +echo "inp: ${inp}" 1>&2 + +yt-dlp "$inp" \ + -f "b" \ + -S "res:720" \ + -P "$HOME/vids" \ + -o "%(title)s.%(ext)s" |