I spent a few hours building BiliDan into a BiliBili Stream downloader folr Gaz.
However, as tipped off by the author, there is already a Python script designed to scrape the website, and has cookie, geolocation, and copyright defeating mechanisms, which is BiliGrab.
Still, there might be benefits to this method of stream scraping with MPV. We could look at the two and maybe merge beneficial functions of both.