aboutsummaryrefslogtreecommitdiff
path: root/lynx-youtube-handler
blob: df2dcb17b55d476f15b583cad45447d899275d96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env bash
# open youtube link in mpv

# remove gopher section of URL passed 
# by Lynx as mpv doesn't understand it
URL=https:$(awk -F'https%3a' '{print $2}' <<< "$1")

if curl --head --silent $URL > /dev/null 2>&1; then
    notify-send "Launching mpv $URL" 
    mpv $URL >/dev/null 2>&1 &
else
    notify-send "invalid URL $URL"
fi