Downloading and playing YouTube videos, and shell redirects

A long time ago, I wrote a script, meant to be called via a window manager shortcut, that would read a YouTube (or other video website) URL from the clipboard, extract the video URL with yt-dlp -g , and pass it to vlc or mpv to play. This would play it directly from the stream, without downloading the video first. Then YouTube stopped providing single audio+video streams, and started to provide…