Viewing youtube videos in Lynx Thu, 16 Oct 2025 22:17:59 +0200 +-----------------------------------------------------------------+ Thanks to the lynx-dev mailing list I can now view html pages in rdrview and launch mpv to play youtube videos directly from Lynx. Mime-types are managed by my mailcap file, but youtube videos are a https url and require EXTERNAL_LINK handling. Lynx has to be compiled with --enable-externs for this to function. You can download my fork of Lynx 2.9.2 here: https://git.wittamore.com/lynx Lynx config option: EXTERNAL_MENU::: %s:: [:environment] If there is more than one EXTERNAL_MENU option for any given situation, Lynx will display a menu of the options. As I have a French keyboard I changed the EXTERNAL_LINK keymap to ';'. Hitting ";" on a link will execute ythandler. I've included my mpv.conf as I run DWM with mpv set as a floating centered window for both audio and video files. +--- lynx.cfg ---------------------------------------------------+ KEYMAP:,:EXTERN_PAGE KEYMAP:;:EXTERN_LINK EXTERNAL_MENU:http:Reader:rdrview --disable-sandbox -T title -B "lynx -cfg /home/philip/.config/lynx/lynx.cfg" '%s':TRUE EXTERNAL_MENU::Youtube:ythandler '%s':TRUE +--- ythandler --------------------------------------------------+ #!/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 notify-send "Launching mpv $URL" mpv $URL >/dev/null 2>&1 & else notify-send "invalid URL $URL" fi +--- mpv.conf --------------------------------------------------+ script-opts=osc-visibility=always geometry=1068x600 ontop idle=yes force-window=yes