Ever wanted to open youtube links in your native player from any acme(1) window?
youtube-dl(1) will parse url's of youtube and other providers and download the video. mpv(1) is capable of using it as a backend to download youtube videos.
Put this in your plumber(4) file
type is text data matches '(watch\?)([a-zA-Z0-9]+\=[a-zA-Z0-9\_@\-]+\&)*(v\=[a-zA-Z0-9\_@\-]+)+(\&[a-zA-Z0-9]+\=[a-zA-Z0-9\_@\-]+\&?)*' plumb start sh -c 'mpv --cache-secs=60 --really-quiet --force-window=immediate --ytdl-format=bestvideo[height\<=?1080]+bestaudio/best --ytdl-raw-options=yes-playlist= https://www.youtube.com/'"$0"'
Reload your plumb(7) rules with
cat plumbing | 9p write plumb/rules
Right click the
watch? part of this url https://www.youtube.com/watch?v=V1J3OBm9D1k
The regex matches any text that has
watch?v=id along with any other query parameters.
To test a new plumb rule regex, use
plumb start sh -c 'echo '"$0"' as it's action.
The video is me initiating a young girl to sit-skiing.
The mpv options in order
list=idin the params will load a playlist
Other media players can be used by piping the output of youtube-dl to them. Although they might have their own integrations.