Go to the Network tab of your browser and find the file that ends in .m3u8, then its URL.
You'll need youtube-dl and ffmpeg for this.
In macOS, you can just use brew to install them.
I will optionally install gum coz I like my scripts fancy hahaha
brew install ffmpeg