kompot / nhl-tv-geeky-streams

Best way to download NHL games. NHL.TV, NHL LIVE, or WatchESPN account is required.
MIT License
36 stars 7 forks source link

Nhl.tv streams not showing (only ESPN streams available) #59

Closed stephenhoult closed 2 years ago

stephenhoult commented 2 years ago

Only ESPN/ESPN+ streams are available for the game.

I've pulled the latest master branch.

Correct email and password added to config.

image

I'd expect to see the Nhl.tv streams - I have a subscription to Nhl.tv which does have the game via the website, but not an ESPN subscription so can't watch the stream.

Edit: This may be a "feature" of Nhl.tv this season.

The full game is available through the website, but the PS5 app doesn't show the full game stream.

Edit 2: Looks like the whole nhl.tv service is plagued with issues at the moment.

chiroptical commented 2 years ago

https://www.nhl.com/news/nhl-deal-with-espn-disney-takes-hockey-into-the-future/c-322354090 I am pretty sure nhl.tv is dead?

rseanhall commented 2 years ago

The full game is available through the website, but the PS5 app doesn't show the full game stream.

I will have to look into this. This is a sign that they have changed their API. It is surprising that they would not have updated their app before doing this, though.

Note that the games from 2022-10-11 are special right now because their (original) API is not returning any stream information. All other games show that the NHL.TV streams are not available.

I am pretty sure nhl.tv is dead?

It's not dead, it's available only in certain countries. See https://www.nhl.com/info/where-to-stream.

rseanhall commented 2 years ago

It's going to be hard for me to get this working. I'm not in the service area for NHL.TV so when I go to https://nhltv.nhl.com, it doesn't let me do anything. When I use a VPN into the service area, I can login but can't access any games since I don't have a current subscription. And even if I did have a current subscription, I'm not sure if it would work because it seems to be detecting that I'm on a VPN. In the past, I was able to use my login from prior seasons and stream a game from an old season but currently they don't appear to be giving access to prior seasons. On top of all that, normally I would use the app on an Android TV to see the API calls but I can't do that until they release a new version of the app that works with the new APIs.

Based on the schedule API (nhltv.nhl.com/api/v2/events) and login API (nhltv.nhl.com/api/v3/sso/nhl/sign-in), it looks like they really have changed their APIs. I probably should just pull the existing NHL.TV and NHL LIVE providers because they aren't working anymore and this will require implementing a brand new provider. The Canadian NHL LIVE was replaced with Sportsnet NOW which uses DRM. Hopefully the new NHL.TV platform doesn't do that.

There are other projects facing this problem, for example https://github.com/eracknaphobia/plugin.video.nhlgcl/issues/37. If another project figures out the APIs it should be fairly easy to bring their changes here.

stephenhoult commented 2 years ago

@rseanhall How did you see the API calls on your android tv?

I'm wondering if I can do something via an emulator / raspberry pi / fire stick to view the API calls and have a poke around to see if I can get anywhere with it.

rseanhall commented 2 years ago

Looks like that project just got updated to work with the new APIs so I'm not sure that will be necessary - https://github.com/eracknaphobia/plugin.video.nhlgcl/pull/38.

rseanhall commented 2 years ago

I just pushed the new NHL.TV provider to the master branch. I don't have an active subscription so I couldn't verify that it works. Please let me know if it works and/or email me credentials so I can test it myself.

plandolt commented 2 years ago

Hi @rseanhall

I have a nhl.tv subscription but get this:

[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "AxiosError: Request failed with status code 422".] {
  code: 'ERR_UNHANDLED_REJECTION'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
rseanhall commented 2 years ago

I'm having trouble with the login endpoint with that error. Is that the one for you, too? Is there a login token in tmp/session.nhltv.cleeng.json?

plandolt commented 2 years ago

This file is not present.

rseanhall commented 2 years ago

If you're a technical person, you might be able to workaround this by logging into the website and using the browser's Dev Tools to grab the token and store it in there manually:

{
  token: "<insert token here>"
}
rseanhall commented 2 years ago

@scuben I pushed a new commit to master that fixed the login issue for me. I'm still unable to test anything past that without a subscription.

plandolt commented 2 years ago

@rseanhall thank you, the login works now. There are two more issues currently:

selecting the quality:

beginFetch https://spottnhl.akamaized.net/hls/live/2043587/2431717_2701275/master-archive.m3u8?cid=36306&mid=34542179&ecid=2701275&pid=5&dtid=1&ident=556398921262&hdnea=exp=1666939029~acl=*/hls/live/2043587/2431717_2701275/*~hmac=e57808077fac368a4e2076912e11160e2cfdcda09faddbc515d7eac494e5c27f&startTime=1666909800&endTime=1666923780&partnerid=1&content=1530523 2022-10-28T06:32:09.306Z
endFetch https://spottnhl.akamaized.net/hls/live/2043587/2431717_2701275/master-archive.m3u8?cid=36306&mid=34542179&ecid=2701275&pid=5&dtid=1&ident=556398921262&hdnea=exp=1666939029~acl=*/hls/live/2043587/2431717_2701275/*~hmac=e57808077fac368a4e2076912e11160e2cfdcda09faddbc515d7eac494e5c27f&startTime=1666909800&endTime=1666923780&partnerid=1&content=1530523 2022-10-28T06:32:09.571Z 265
? Choose stream quality (Use arrow keys)
❯ 720p   6258.299k
  720p   6258.299k
  720p   2635.8k
  720p   2635.8k
  360p   1186.8k
  360p   1186.8k
  288p   761.759k
  288p   761.759k
  180p   522.674k
  180p   522.674k

next up error is when starting to fetch the stream (tried with the two 720p with 6m bitstream):

streamlink: error: Unable to open URL: https://spottnhl.akamaized.net/hls/live/2043580/2431565_2701123/master-archive.m3u8?cid=36306&mid=34542187&ecid=2701123&pid=5&dtid=1&ident=902797184563&hdnea=exp=1666938910~acl=*/hls/live/2043580/2431565_2701123/https://spottnhl.akamaized.net/hls/live/2043580-b/2431565_2701123/hdntl=exp=1667025010~acl=*%2fhls%2flive%2f2043580%2f2431565_2701123%2f*~data=hdntl~hmac=577b10f9e951d287f14744269403ad7c1781ee8be0056ea67ec4e0b00ee0b11d/2701123_5000-archive.m3u8?startTime=1666915200&endTime=1666927320&cid=36306&mid=34542187&ecid=2701123&pid=5&dtid=1&ident=902797184563&partnerid=1&content=1530387 (403 Client Error: Forbidden for url: https://spottnhl.akamaized.net/hls/live/2043580/2431565_2701123/master-archive.m3u8?cid=36306&mid=34542187&ecid=2701123&pid=5&dtid=1&ident=902797184563&hdnea=exp=1666938910~acl=*/hls/live/2043580/2431565_2701123/https://spottnhl.akamaized.net/hls/live/2043580-b/2431565_2701123/hdntl=exp=1667025010~acl=*%2fhls%2flive%2f2043580%2f2431565_2701123%2f*~data=hdntl~hmac=577b10f9e951d287f14744269403ad7c1781ee8be0056ea67ec4e0b00ee0b11d/2701123_5000-archive.m3u8?startTime=1666915200&endTime=1666927320&cid=36306&mid=34542187&ecid=2701123&pid=5&dtid=1&ident=902797184563&partnerid=1&content=1530387)
rseanhall commented 2 years ago

@scuben I pushed a new commit that probably fixed the second error. It might have also fixed the first error but I can't be sure since I can't look at what was in the HLS manifest.

plandolt commented 2 years ago

@rseanhall your latest commit has no effect as the url is not the same.

example: https://spottnhl.akamaized.net/hls/live/2043579/2431541_2701099/hdntl=exp=1667212602~acl=*%2fhls%2flive%2f2043579%2f2431541_2701099%2f*~data=hdntl~hmac=0434ec423e766cfc370be71b18d2792959e36eb58750c87763170f3d046b1686/2701099_5000-archive.m3u8?startTime=1667082600&endTime=1667102400&cid=36306&mid=34542221&ecid=2701099&pid=5&dtid=1&ident=517492461082&partnerid=1&content=1530362

https://spottnhl.akamaized.net/hls/live/2043579-b/2431541_2701099/hdntl=exp=1667212602~acl=*%2fhls%2flive%2f2043579%2f2431541_2701099%2f*~data=hdntl~hmac=0434ec423e766cfc370be71b18d2792959e36eb58750c87763170f3d046b1686/2701099_5000-archive.m3u8?startTime=1667082600&endTime=1667102400&cid=36306&mid=34542221&ecid=2701099&pid=5&dtid=1&ident=517492461082&partnerid=1&content=1530362

There is a 2043579 vs 2043579-b. The same is for the other ones. Not sure why though.

rseanhall commented 2 years ago

@scuben Ok, maybe I didn't fix the first error. We need to figure out why there are two different streams with the same bitrate. But it should have fixed at least fixed part of the second one because it was creating a bad URL:

...~acl=*/hls/live/2043580/2431565_2701123/https://spottnhl.akamaized.net...

It was appending an absolute URL to the end of an absolute URL. If it is still getting 403 errors then I'll need an active subscription to see what the mobile app is doing. It could be as simple as sending the mediaAuth to streamlink in the Authorization header similar to the ESPN provider.

https://github.com/kompot/nhl-tv-geeky-streams/blob/341eab8c7d6455f5d1d05c82cdf866108db79506/src/espnProvider.ts#L222-L228

https://github.com/kompot/nhl-tv-geeky-streams/blob/341eab8c7d6455f5d1d05c82cdf866108db79506/src/nhltvCleengProvider.ts#L133-L135

plandolt commented 2 years ago

I currently try to fix it and then create a pr. But the desktop way does not work because of the recaptcha. How do you track the http requests by your phone? iOS preferred.