Open enjoymoreradio opened 4 months ago
Over the All Star break MLB implemented a newer Okta Interaction Code grant type, replacing the old auth system. I'm still trying to fix my private app that runs in Ruby on Rails and when I do I'll try and give guidance to some of the Python developers and hopefully somebody can implement that solution in mlbv. Until then unfortunately the Ruby on Rails app and the Python app are both dead in the water.
More info here if you care: https://developer.okta.com/docs/concepts/interaction-code/
Thanks for the quick response. Authentication protocols are more complicated than my novice python skills can handle, but I'll read the docs and see what I can piece together.
It's not just the auth either it turns out. It looks like MLB.tv switched entirely to a new streaming service with Google. The master m3u8 packages are completely different now. It will take pretty significant changes to mlbv to restore service. I'll add more details if I ever get my Ruby on Rails app working.
I managed to download yesterday's Padres game using youtube-dlp by accidentally stumbling across "X-CDN-Token" in the request headers of a *.vtt file. I passed that value as a header and used the master.m3u8 for the URL. Hope this helps you fix this. Manual downloads are OK but I'd much rather do it this way!
The proof of concept posted by @mattiasa link worked this way, provided you have a valid okta access token
It seems the only thing that's needed to get media download to work at least is to get a device_id from the graphql endpoint instead of the old method. I've implemented a hack to do that that along with getting the media url from the same endpoint.
It's available in https://github.com/mattiasa/mlbv/tree/new-auth
This is by no means ready to be merged but feel free to use it. It was enough to allow me to download and watch last night's Cubs vs Diamondbacks game.
That would be good. In my own app I've implemented the Interaction Code grant type stuff and was able to rip out all the entitlement token stuff. The app works locally but not on the web due to CORs issues. It's still a work in progress. If I ever get it all working we can compare notes and hopefully the python app will be ready to go again.
You may run into a problem where you need to use the interaction code logic so let me know and I can show you my ruby code that will give you a sense of what you need to do. I've resolved the CORs problem with the streaming files in my app and updated everything to work with the new content id it uses instead of the older media id. I had to use broadcasts data instead of the older epg stuff but I'm not sure if you're running into that problem or not.
I haven't had the time to mess around with this, but did either of you make an progress on the new okta procedures or the rehosted streams? Hoping i'll have time over the offseason to work on it, but don't want to reinvent the wheel
The response I get when requesting token is: