diff options
author | Philip Wittamore <philip@wittamore.com> | 2025-10-18 17:01:10 +0200 |
---|---|---|
committer | Philip Wittamore <philip@wittamore.com> | 2025-10-18 17:01:10 +0200 |
commit | 681133565ce3c417bec8c06e44dda1812f6a257e (patch) | |
tree | 856d89b0650f919490a1f5f1f84c645b4b552e2b /lynx-youtube-handler | |
parent | c6a7d51df19e6dc06f2a120c07619980b865d0ce (diff) | |
download | scripts-681133565ce3c417bec8c06e44dda1812f6a257e.tar.gz scripts-681133565ce3c417bec8c06e44dda1812f6a257e.tar.bz2 scripts-681133565ce3c417bec8c06e44dda1812f6a257e.zip |
Diffstat (limited to 'lynx-youtube-handler')
-rwxr-xr-x | lynx-youtube-handler | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lynx-youtube-handler b/lynx-youtube-handler new file mode 100755 index 0000000..da71719 --- /dev/null +++ b/lynx-youtube-handler @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +# open youtube link in mpv + +URL=https:$(awk -F'https%3a' '{print $2}' <<< "$1") + +if curl --head --silent $URL > /dev/null 2>&1; then + echo "Opening Youtube video $URL" >> $HOME/.lynx-log + notify-send "Launching mpv $URL" + mpv $URL >/dev/null 2>&1 & +else + echo "Youtube video: invalid URL $URL" >> $HOME/.lynx-log + notify-send "invalid URL $URL" +fi |