m0ngr31 / EPlusTV

Virtual linear channels for ESPN, ESPN+, MSG+, Paramount+, MLB.tv, and FOX Sports
117 stars 21 forks source link

Request: MSG / MSG Go #61

Closed adamef93 closed 6 months ago

SoSJames commented 1 year ago

I, too, would love to see this. This may be too big an ask, however. For one thing, it's regional and there's probably no chance the developer has an account to use to see the inner workings of the platform. Then, there's the fact that MSG / MSG Go use two different authentication standards based on your service type. For standard MSG, there's TVEverywhere that allows access to certain cable subscribers. For the new subscription MSG Go service, there's a proprietary login/authentication setup. That's an awful lot to support just to add two (sometimes three) channels to EPLusTV.

It's worth pointing out that there's a slim chance that Channels DVR will re-add MSG to its TVEverywhere plugin now that MSG finished making changes to its site to support their standalone streaming service. You might stand a better chance there since they already have the code done to handle working with MSG.

adamef93 commented 1 year ago

Honestly, MSG being added to TV Everywhere would be fantastic. The whole reason I opened this request was because I can watch MSG Go with a shared cable login, but they don't offer a way to watch on a smart TV. It's either the app or the website and the Android app requires Google Play services, so no sideloading on Fire OS

I figured this app would be a good way to bridge the gap between logging in on the website and adding the feed to Channels but I have no idea how involved it would be

m0ngr31 commented 1 year ago

I did start looking at adding it, but I was having an issue with authentication on the Android app. Could be my login is geo-blocked from accessing it, but it might have been an issue with my MITM proxy. I'll have to play with it some more

SoSJames commented 1 year ago

If it helps at all, the actual streams inside MSG (at least the cable login version) aren't encrypted. They appear to change every 24 hours or so, but once you have one it will play without keys, etc. I believe that the cable login sends a standardized request to each cable provider's login system, which returns an access code upon successful login to authorize the MSG app to let the user in. I'm not sure about their standalone MSG Go service, but I assume it uses the same feeds. So, if you figure out the authentication part, the rest should be a breeze.

m0ngr31 commented 10 months ago

@SoSJames @adamef93 have you seen this? https://github.com/fancybits/chrome-capture-for-channels

Might be a game changer for something like this that I haven't been able to add in

adamef93 commented 9 months ago

Great find, gonna check it out and report back. Thanks for the reply all these months later

adamef93 commented 9 months ago

Doesn't work, unfortunately. It just streams the MSG login page with no way to interact with it to log in. The quality is also atrocious, but I'll chalk that up to it maybe not streaming an actual video

MSG actually seems to have completed their rebrand to MSG+ which, even more unfortunately, seems to have stopped the ability to get the m3u stream link by inspecting the page elements which puts me very SOL for hockey season. @m0ngr31 you see if the rebrand/rebuild makes the service compatible with this app?

SoSJames commented 9 months ago

@m0ngr31 Thanks for the suggestion. I played around with the Chrome capture and the new MSG+ site. I realized that the problem @adamef93 reported is because MSG+ switched to DASH streaming instead of HLS. As he said, the Docker version of the Chrome capture is headless and won't let you log in to the site to enable the stream. However, I was able to ingest the DASH stream manually to a basic web player and pipe it through Chrome capture from there. Unfortunately it looks like the capture is capped at 30FPS which makes it look super muddy for high-action sports.

As an alternative, how hard do you think it would be to bolt on this library:

https://github.com/hyugogirubato/pydash2hls

Theoretically that would allow for support of DASH streams without having to make any extensive changes to your existing code. Obviously I know this is a "wouldn't that be nice" request, but it might open up your software to support other sports sites, as well. Anyway, thanks again for the suggestion and I'll keep looking into alternatives.

m0ngr31 commented 9 months ago

@adamef93 @SoSJames There is supposed to be a port that you use on that docker that lets you control Chrome and login... I'd say see if you can find that. I haven't tried it, but I did see it mentioned in the thread on the Channels forum.

I'll look at the dash to HLS stuff, but I'd have to convert it to javascript which may or may not be a whole thing. I'll have to look

SoSJames commented 9 months ago

@m0ngr31 Thanks for the heads-up on the port. I will look at that.

adamef93 commented 9 months ago

For what it's worth, I tried accessing the container via port 5589 which is the only port I see mentioned anywhere and it brought up a plain text page with basic use instructions. Very possible I might've missed something though

SoSJames commented 9 months ago

@adamef93 , from what I can see in the forum covering the tool, they've added instructions to connect to the container via VNC remote desktop. I haven't tested it yet, though. The specifics are detailed here: https://community.getchannels.com/t/beta-chrome-capture-for-channels/36667/84 if you'd like to try and get it working.

m0ngr31 commented 9 months ago

image

SoSJames commented 9 months ago

@adamef93 Just an update. I got into the docker via VNC and was able to log in to MSG+. Sadly their player (which uses DASH streaming) won't work inside the Linux version of Chrome. I did pipe the stream into a Shaka Player-based page and it plays via the Chrome Capture URL, but stutters horribly. Could be a lack of hardware acceleration in my VM. I'm probably going to look for another way to pipe the dash stream into my Jellyfin instance.

m0ngr31 commented 9 months ago

I'm wondering if it's using Chromium instead of Chrome and that's the issue? Or it's an issue with full blown Chrome as well?

adamef93 commented 9 months ago

image

I can't even get this to work right to test with hardware acceleration. The remote keyboard input isn't accepting a period for .com in my email address. The container log shows GET /debug/keypress/ when I hit . but nothing actually shows up in the text box. It also doesn't seem to have clipboard functionality to copy/paste my login

I have a feeling hardware acceleration wouldn't make a difference on my side anyway; I'm running Docker on a NUC with a 7th gen i3. It performs admirably for its specs for pretty much everything else I've thrown at it, but it can't compensate for the container not being optimized

SoSJames commented 9 months ago

I believe it's Chrome. However, I'll need to load a user agent switcher to fool MSG+ into thinking it's not a Linux browser because their site won't even try to load the player otherwise. Unfortunately, the Chrome in the docker has plugin loading disabled.

SoSJames commented 9 months ago

Another update - It appears MSG+ still uses HLS if you access it from Safari on Mac. So, @adamef93, you can use a user agent switcher in a browser to pull the m3u8 and add it as a custom channel to channels DVR if you wish. The links used to last for about 24 hours. Not sure if that's still the case. It's not ideal, but should work.

adamef93 commented 9 months ago

Oh, excellent. Thanks @SoSJames. Who would've thought a Devils fan and a Rangers fan working together would yield such positive results

SoSJames commented 9 months ago

It's OK @adamef93. We can go back to a barely-concealed hatred for one another in a few days. For now, enjoy your MSG!

adamef93 commented 9 months ago

@SoSJames figured I'd give you a quick update, it doesn't seem like grabbing the M3U from Safari is the move, at least for me. I can get the direct stream link just fine from Safari (agent switcher in Firefox causes the video on MSG+ to not load at all), but it won't play if added to Channels as a custom source. I was able to get it working by loading it into another M3U ingested by Xteve and then pipe Xteve into Channels, but that adds a decent amount of latency to the stream and Xteve also just breaks randomly while playing. So it seems I'm consigned to plugging my laptop into my TV for the season. Will it work? Sure. But it's more than mildly irritating that the legitimate watching experience is either on par with finding a random pirate stream or having to VPN out of state to get home games through ESPN+, which may not even work anymore. All because I have a valid cable login from my parents, but don't have a set-top box. Ridiculous

adamef93 commented 9 months ago

@m0ngr31 Would this work as an alternative to PyDash2HLS? The repo is pretty old but it's in Javascript

https://github.com/huzhlei/DASH-to-HLS-Playback

SoSJames commented 9 months ago

@adamef93 Just wondering if you've tried using a browser on your FireTv to open MSG+? And, if that doesn't work, try pasting the m3u8 into a webplayer that will load it like: https://livepush.io/hls-player/index.html

I know it plays correctly in that player. If that won't load on FireTV, a basic HTML page with a Clappr player will play it no problem. Should be easy to set up, too. Let me know if any of that works as a workaround. I know there's a game tonight.

SoSJames commented 9 months ago

@adamef93 And if none of that works, you should be able to cast to your FireTV straight from an Android or Windows 10/11 device to get it on your TV. Might not be the prettiest thing, but the MSG feed is fairly awful this year from what I see (no more 60fps, just 30fps 1080p)

adamef93 commented 9 months ago

@SoSJames Using the TV's browser is more of a pain than plugging in my laptop tbh and I'm all Mac for personal devices. I've tried using an AirPlay app on the Fire TV before but it was god awful

I'm actually pretty gutted at the thought of MSG+ being 30fps now. They arguably made the product worse than MSG Go if that's the case. Guess we'll find out tonight

SoSJames commented 9 months ago

@adamef93 Yeah, the 30fps thing makes me insane, too. Especially since the cameras in every arena are capable of at least 720p 60fps (which is the feed ESPN+ always gets). I haven't found a 60fps feed in any m3u8 or dash playlist for any of the Rangers preseason games. I assume it will stay that way for the regular season. Maybe if we both chant hard enough we can get Dolan to sell MSG and hope that a new owner would like a happy audience.

adamef93 commented 9 months ago

@SoSJames FWIW, the new m3u8 links don't work in the player you linked, at least for me, which is likely the same reason why they don't work in Channels anymore. All the token information is after index.m3u8 in the URL which feels like is what's breaking things. I'm not knowledgeable enough in video streaming to know why it would still work in VLC / in Xteve with the VLC buffer and nothing else

SoSJames commented 9 months ago

@adamef93 I just tried it on my end in that player and it works here:

image

Not sure what's up. Plus, the on and off breaking in Xteve etc is because MSG injects ads in a funky way. Channels DVR uses a patched ffmpeg that can ignore the m3u8 inconsistencies coming in and out of commercials. I'm using that with streamlink to pipe MSG into a videoplayer. It loses audio sync occasionally, but that's an MSG-specific issue too.

adamef93 commented 9 months ago

@SoSJames that's really odd, it's working for me on livepush on my Mac, but didn't work on my work computer when I checked earlier. Both Firefox with the same plugins

So what's your stack for watching these games exactly? And the 30fps frame cap is atrocious. I switched to watching on what's left of my ESPN+ subscription for now (with the EPlusTV app, so thanks again for your work @m0ngr31). Oddly enough, there's no geo-blocking in effect for the stream but it might just be a preseason gift

SoSJames commented 9 months ago

@adamef93 I use a combination of Xteve and Jellyfin, on an HTPC plugged straight into the TV. When I need to use MSG, I can use the browser, but it looks muddy without the pixel shaders I use in MPV or MadVR in MPC-HC. So when I'm forced to use MSG, I use streamlink to pipe it into MPC-HC, using the ffmpeg build from Channels DVR to fix the commercial breakage. Then again, I'm not in MSG's broadcast area, so I don't have to worry about ESPN+ blackouts the majority of the time.

You might want to look into a cheap Google TV just to have a backup way to get MSG onto your TV. That's probably what I would do if I still lived in NY.

adamef93 commented 9 months ago

@SoSJames the MSG app doesn't work on Google TV either lol. I have an old Google TV box I tried this on last season. The MSG Go app never launches properly after being sideloaded because it's not in the TV compatible Play Store. I haven't tried since the rebrand, but the Play Store page for the app only mentions phones and tablets, so I have a feeling it's more of the same

I honestly don't follow most of your setup. I've got my stuff in docker and don't see anything about an ffmpeg build of Channels on their dockerhub page. I'm leaning toward giving up on all this nonsense. Adding MSG to this app will still be at 30fps and ESPN+ will still (probably) be geo-blocked and VPN blocked come the regular season

Man, finding ways to watch sports fairly and reliably really takes the fun out of watching sports

SoSJames commented 9 months ago

@adamef93 Yeah, I just lifted the ffmpeg binary from a live Channels DVR install. No other way to get it. If I knew what they patched to fix the commercial problem, I'd just add that patch to Jellyfin's ffmpeg and be done with it. All the other stuff is just various media players and tweaks to the visual appearance. I agree, however. The only option I'd have other than all of this stuff is something like FuboTV, but I don't feel like spending a fortune just to get MSG and NHL network when I don't need all the other channels. And I agree that it ruins the fun. But thanks to @m0ngr31 (who should get an award BTW), I can use ESPN+ for the majority of the games without bending over backward to make it work.

m0ngr31 commented 9 months ago

I bet it's the #EXT-X-DISCONTINUITY tag that's breaking on commercial breaks. It's been requested in the jellyfin-ffmpeg project for years now.

https://github.com/jellyfin/jellyfin-ffmpeg/issues/57

The original version of this project was using ffmpeg to rebroadcast the streams and I had to use a patched ffmpeg for it to work: https://hub.docker.com/r/m0ngr31/ffmpeg-hls-discontinuity

The easiest thing I've found is to just use Channels through Jellyfin. Then it seems to get around that issue.

m0ngr31 commented 8 months ago

I found an APK for Android TV that I'm trying to figure to figure out how it works. Would one of you guys mind sharing some credentials with me to see if I can get it working in the emulator and then go from there?

adamef93 commented 8 months ago

I'd love to but the creds I'm using aren't even mine, they're my parents' cable creds

SoSJames commented 8 months ago

Same here. I suspect that's how most people use it. I'll see if I can get a secondary set of credentials set up for you to play with.

m0ngr31 commented 7 months ago

Someone was kind enough to let me borrow their credentials, and I started work on this. Problem is that all the streams seem to be MPEG-DASH, which doesn't work with Channels (and most other IPTV clients I imagine).

adamef93 commented 7 months ago

Appreciate the update. Not sure if this helps, but the streams work in VLC. Here's some context.

Before they rebuilt the service as MSG+, you used to be able to do inspect page on the video being played in MSG Go and get the direct M3U link which would work in Channels and VLC. Since moving to MSG+, you can get a stream link by loading up a video in Safari like @SoSJames mentioned. That link will work in VLC, but not Channels, so maybe there's a way to integrate an xTeve component with its built in VLC? I actually did try loading a stream I grabbed from Safari into xTeve into Channels for tonight's game and it didn't work, but maybe something could be done by someone who knows more about this than me

I probably already mentioned most, if not all, of this before, but this has been a long thread lol

m0ngr31 commented 7 months ago

Hmm, now that you mention it, MPEG-DASH isn't supported in Safari afaik, so might be a way to force HLS (assuming there isn't DRM on it).

m0ngr31 commented 7 months ago

Only issue is that I don't have a Mac :sweat_smile:

adamef93 commented 7 months ago

I'm hoping the fact that streams work in VLC means that there isn't DRM. Sent you a message at the email address in your profile regarding getting you access to a Mac.

m0ngr31 commented 7 months ago

So I don't even need a Mac. I switched my user-agent to Safari and it gives me an HLS stream. I'll see if I can get the login flow and token refresh down from the Android TV app and then figure out how to do playback :)

adamef93 commented 7 months ago

Eeeyyy, that's great. The agent switcher for me doesn't even give me a stream, it errors out and doesn't play anything. Looking forward to seeing if this is possible

m0ngr31 commented 7 months ago

Yeah, I get a playback error as well, but it still returns the m3u8 in the network inspector which I'm able to play in VLC

m0ngr31 commented 6 months ago

Doing one final test this afternoon, but it's looking real good so far: https://github.com/m0ngr31/EPlusTV/pull/83

Only question I have is if the tokens will update properly or not. I tried to make it as seemless as possible

m0ngr31 commented 6 months ago

Okay, MSG+ and Paramount+ are added for 2.1.0!

adamef93 commented 6 months ago

Dude

This works great! Made it through the whole game tonight pretty much flawlessly! Couple stutters here and there but I'm pretty sure that's on the hardware I'm using and not the app. I wouldn't worry about the token refresh. MSG+ always makes me sign back in and even re-link the cable provider every 5 games or so. The service honestly kinda sucks lol but this makes it way better

Is there a tip jar or something I could contribute to? This is really fantastic


I gave you a shoutout on the Devils subreddit! Hopefully this will help out some other fans too https://old.reddit.com/r/devils/comments/18u5n3s/a_new_way_to_watch_msg/?