youtube-dl
1. Install https://github.com/ytdl-org/youtube-dl
ffmpeg
2. Install
rtsp-simple-server
(repo here)
3. Run docker run --rm -it -e RTSP_PROTOCOLS=tcp -p 8554:8554 -p 1935:1935 -p 8888:8888 aler9/rtsp-simple-server
ffmpeg
with best available quality Youtube video
4. Run ffmpeg -re -stream_loop -1 -i $(youtube-dl -g https://www.youtube.com/watch\?v\=vbgwWfwGSR4) -f rtsp rtsp://localhost:8554/stream
5. Access stream from anywhere (NVR; Home Assistant; etc) with the rtsp url:
rtsp://localhost:8554/stream