blob: e97cb9479e3d0e744bedac981dbfe4e629b6deaa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#!/bin/sh
# argument ($1) -> clipboard -> stdin
test -z "${inp:=${1:-"$(xclip -sel c -o)"}}" &&
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/')"
echo "inp: ${inp}" 1>&2
notify-send "ytclipo" "<b>downloading</b> $inp"
yt-dlp "$inp" \
--restrict-filenames \
-f "b" \
-S "res:720" \
-P "$HOME/vids" \
-o "%(title)s.%(ext)s"
notify-send "ytclipo" "<b>ytclipo</b><br>finished downloading."
|