Note that the YouTube API does not provide access to the media streams for videos. And while Google does provide a number of black-box-style widgets for embedding in apps or webpages, they are not suitable for all use cases. For example: every VR app that wants to include support for YouTube playback has to use a scraping tool of some kind because none of the embedding options can be rendered in 3D.
EDIT: I'd love to be proven wrong here. But I've dug into the code of several open source VR apps that include YouTube playback and they all end in including youtube-dl or yt-dlp.
EDIT: I'd love to be proven wrong here. But I've dug into the code of several open source VR apps that include YouTube playback and they all end in including youtube-dl or yt-dlp.