summaryrefslogtreecommitdiff
path: root/scripts/.local/bin/yt
blob: fb8900ab4befb893eef796c08f14a4653cb44b2c (plain)
1
2
3
4
5
6
7
8
9
10
#!/bin/sh

VIDEO="https://www.youtube.com/watch?v=$(echo "<-" | dmenu -p "Youtube:" | xargs -I {} queryt -s "{}" | sed "s:\t:     :g" | dmenu -l 10 -p "Video: " | awk '{print $1}')"

if [ "$VIDEO" != "" ]; then
	mpv --ytdl-format=22 "$VIDEO"
	if [ $? -ne 0 ]; then
		mpv "$VIDEO"
	fi
fi