aboutsummaryrefslogtreecommitdiff
path: root/lynx-youtube-handler
diff options
context:
space:
mode:
authorPhilip Wittamore <philip@wittamore.com>2025-10-21 18:05:17 +0200
committerPhilip Wittamore <philip@wittamore.com>2025-10-21 18:05:17 +0200
commitf888cb15e8f1be5ca69fa5cfbaeb21bcf3b53c31 (patch)
treeda9a0582f496fe9ac7b0cc10a632b345b7a16554 /lynx-youtube-handler
parent681133565ce3c417bec8c06e44dda1812f6a257e (diff)
downloadscripts-f888cb15e8f1be5ca69fa5cfbaeb21bcf3b53c31.tar.gz
scripts-f888cb15e8f1be5ca69fa5cfbaeb21bcf3b53c31.tar.bz2
scripts-f888cb15e8f1be5ca69fa5cfbaeb21bcf3b53c31.zip
update
Diffstat (limited to 'lynx-youtube-handler')
-rwxr-xr-xlynx-youtube-handler4
1 files changed, 2 insertions, 2 deletions
diff --git a/lynx-youtube-handler b/lynx-youtube-handler
index da71719..df2dcb1 100755
--- a/lynx-youtube-handler
+++ b/lynx-youtube-handler
@@ -1,13 +1,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
- 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