(Using Windows PowerShell, adapt for UNIX bash shouldn’t be a big issue)

Record a live stream

So something nice with youtube-dl is like you can ask not to download the media but to fetch for the media link :

>> youtube-dl -g https://www.youtube.com/watch?v=RJt01u4yrLQ
https://r2---sn-h0jeened.googlevideo.com/videoplayback?expire=1[...]

If you use that for a twitch channel that is streaming live, it returns you the HLS stream.

>> youtube-dl -g https://www.twitch.tv/farore_de_firone
https://video-weaver.ber01.hls.ttvnw.net/v1/playlist/CpkEQusnrcdffNI3[..]MA2c4.m3u8

It by default binds to the best quality video, but you can check and select all format available using -F