Kodi Community Forum
[Discontinued] NHL Gamecenter Addon - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Video Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=154)
+---- Thread: [Discontinued] NHL Gamecenter Addon (/showthread.php?tid=118853)



RE: [RELEASE] NHL Gamecenter Addon - SparkGFX - 2014-10-10

Good to hear Carb0! Thanks for all the hard work and time you have already put forth into this add-on. It is a great one indeed for us crazy hockey fanatics out here.


RE: [RELEASE] NHL Gamecenter Addon - amd7674 - 2014-10-10

Carb0 thanks for looking into it... :-) I cannot stand browser viewing with not full screen and 30FPS ... grrrr.

For peeps with AFTV users, where did you get your apk? I think I have the latest apk but it goes vertical view on me and only see portion of the agreement which I have to agree to?
Did you change rez of AFTV to see full screen or did you get special apk build for ouya device or something. Can someone plz sent the me the link to it (perhaps via PM).


RE: [RELEASE] NHL Gamecenter Addon - mr.sparkle - 2014-10-10

Thanks, Carb0, forgot about that. Hopefully I can soon add:

SEA, Seattle, Coyotes, Seattle Coyotes, SEA Coyotes
QBC, Quebec City, Panthers, Quebec City Panthers, QBC, Panthers


RE: [RELEASE] NHL Gamecenter Addon - SparkGFX - 2014-10-10

amd7674 - If you have Google Play Store installed on your FireTV you will be able to update to the latest version of the NHL application. It is wise to use a keyboard/mouse combo to navigate quicker through the options. I use the Logitech K400 and it works great. When using the app, make sure you click and hold the left mouse button and swipe up or down on the pad to manuever the screen to select different games and what not. Remember, this app was intended for phones and tablets, so it functions like a phone or tablet. Also, as far as the resolution goes, use the FireTV's display settings to adjust your screen size. I had to do this on the projector when watching on the 100' in the theater room. Tongue

As for the streaming goes and quality for the NHL app on the Google Play Store, 1600kb was the highest it would let me view, I had no buffering and everything was in-sync. I was also able to use all the features such as goalie views, star player cam, home and away, and other various cams. Only problem I could see is that the app did not update scores on the scores page on the fly, but not a big deal.

Hope this helps anyone else trying to get the app to work on the FireTV.


RE: [RELEASE] NHL Gamecenter Addon - Suicyc0 - 2014-10-10

SparkGFX - I'm still trying to figure out how you enabled location services. I cleared data & cache for the app, relaunched, and selected enable for push & location. It still tells me that I need to enable location services for the app within system settings. I don't have the Play Store on the FTV, but sideloaded the latest version of the apk. Even the FAQ page for the Fire TV SDK states "There are no location services in Amazon Fire TV." Congrats on getting it working tho!

I saw the same experience on a Kindle Fire that you saw on the FTV. 1600 kbps was the max, but no problem with the stream or app features. I switched to a MacBook Air after the 1st period and leaving its quality set to "Best" just made for a miserable viewing experience - sync issues, terrible stuttering, etc. Setting it to "High" (4500 kbps) eliminated those problems, but didn't give me a noticeable difference in quality from the Kindle.

amd7674 - I just googled "nhl gamecenter android apk". As of last night, the first search result had v 4.1008.


RE: [RELEASE] NHL Gamecenter Addon - amd7674 - 2014-10-10

(2014-10-10, 15:50)SparkGFX Wrote: amd7674 - If you have Google Play Store installed on your FireTV you will be able to update to the latest version of the NHL application. It is wise to use a keyboard/mouse combo to navigate quicker through the options. I use the Logitech K400 and it works great. When using the app, make sure you click and hold the left mouse button and swipe up or down on the pad to manuever the screen to select different games and what not. Remember, this app was intended for phones and tablets, so it functions like a phone or tablet. Also, as far as the resolution goes, use the FireTV's display settings to adjust your screen size. I had to do this on the projector when watching on the 100' in the theater room. Tongue

As for the streaming goes and quality for the NHL app on the Google Play Store, 1600kb was the highest it would let me view, I had no buffering and everything was in-sync. I was also able to use all the features such as goalie views, star player cam, home and away, and other various cams. Only problem I could see is that the app did not update scores on the scores page on the fly, but not a big deal.

Hope this helps anyone else trying to get the app to work on the FireTV.

Great info... thank you. I will give it a try this weekend. It looks like Amazon FireTV app won't give me any advantage over el cheapo android tablet with hdmi output (720p/1080p)... Last night I got that to work and max was 1600kb (as you said). I was hopping AFTV would go to the same 3000kb max browser version supports. At least we have some options before Carb0 gets some spare cycles to look at his addon.

BTW... I'm a projector guy too.... cheap optoma hd25e pj with 110" in the basement :-)


RE: [RELEASE] NHL Gamecenter Addon - SparkGFX - 2014-10-10

Suicyc0 - I am not sure about the location services problem you are having. I did noticed once I signed in it asked me to either accept push notifications or decline them. I simply declined because I have no use for that feature on the FireTV since it is not a tablet or phone.

I am using Comcast Xfinity for my cable service, but not sure if that really makes any difference. Also I sideloaded the app from my pc and it asked me to update to the latest from selecting Google Play option. Maybe the Google Play had something to do with it working for me...unclear on that one.

Not sure if this is allowed here, but try this link to get the Google Play Store and trick it into getting all the "non-compatible" apps on the FireTV.
http://www.aftvnews.com/how-to-trick-google-play-store-into-allowing-all-apps/

QUICK SIDE NOTE: DO NOT KEEP YOUR SETTINGS TO "BEST" WHEN VIEWING A LIVE GAME...IT LOOKS LIKE SHIT. JUST CLICK THE 1600KB


RE: [RELEASE] NHL Gamecenter Addon - [brick] - 2014-10-10

FWIW, I noticed last night and Wednesday night that the NHL GCL web app was offering me (and I was getting) the 4500 stream. Just thought it worth mentioning since that's a change from last year when 3000 was the highest the web app would give. I still prefer this add-on's interface, though, by a lot.

The web app will also (this isn't new) step down the quality on the fly without stopping if there's a bandwidth choke, and then ramp it back up, as well. So, I think this years's web app is an improvement over last year, but, I still like this add-on best. No interface visual cruft to deal with = more better for hockey.


RE: [RELEASE] NHL Gamecenter Addon - Suicyc0 - 2014-10-10

Strange.. I get one screen for "Geolocation & Push Notifications" with the options of "Not Now" or "Enable" I can't selectively pick one or the other. I just tried the "Not Now" option but it didn't make a difference.

When I had the older version the other night, clicking the upgrade from Google Play button simply returned a message that the Fire TV couldn't connect to the web site and gave me a URL to load into another browser.

I agree, I wouldn't expect the ISP to make a difference. We're not part of Comcast... yet.

Your link looks interesting, but prerequisite #1 is "Your Fire TV must be rooted." I'm a bit late for that at this point. Still hoping someone releases a root for the latest OS. Out of curiosity, what version are you running?


RE: [RELEASE] NHL Gamecenter Addon - timewasted - 2014-10-10

I decided to look at this to figure out what needs to be updated to make this work. My findings so far:

Code:
Old login URL: https://gamecenter.nhl.com/nhlgc/secure/login

New login URL: https://account.nhl.com/app?service=login&siteId=34

Code:
Old login parameters: {'username': USERNAME, 'password': PASSWORD}

New login parameters: {'userType': 'REGISTERED_FAN', 'username': USERNAME, 'password': PASSWORD}

It looks like the method used to get the list of live games has changed fairly significantly. Here's what I see:

Code:
POST to http://gamecenter.nhl.com/nhlgc/servlets/games
Cookies required: none
Parameters:
    format: xml
Response:

<?xml version="1.0" encoding="UTF-8"?>
<result>
    <currentDate>2014-10-10T13:08:02.145</currentDate>
    <games>
        <game>
            <gid>NUMERIC GAME ID</gid>
            <season>2014</season>
            <type>2</type>
            <id>NUMERIC UNIQUE ID</id>
            <date>2014-10-08T19:23:00.000</date>
            <gameTimeGMT>2014-10-08T23:23:00.000</gameTimeGMT>
            <gameEndTimeGMT>2014-10-09T01:56:41.000</gameEndTimeGMT>
            <awayTeam>MON</awayTeam>
            <homeTeam>TOR</homeTeam>
            <hasProgram>true</hasProgram>
            <awayTeam>MON</awayTeam>
            <awayGoals>4</awayGoals>
            <homeTeam>TOR</homeTeam>
            <homeGoals>3</homeGoals>
            <date>2014-10-08T19:23:00.000</date>
            <program>
                <gid>10574</gid>
                <id></id>
                <publishPoint><![CDATA[adaptive:<URL removed since I'm unsure if it's an account specific URL>]]></publishPoint>
                <formats>0</formats>
            </program>
        </game>
        <game>
            <gid>NUMERIC GAME ID</gid>
            <season>2014</season>
            <type>2</type>
            <id>NUMERIC UNIQUE ID</id>
            <date>2014-10-08T19:30:23.000</date>
            <gameTimeGMT>2014-10-08T23:30:23.000</gameTimeGMT>
            <gameEndTimeGMT>2014-10-09T02:04:09.000</gameEndTimeGMT>
            <awayTeam>PHI</awayTeam>
            <homeTeam>BOS</homeTeam>
            <blocked>true</blocked>
        </game>
        // Omitted the rest of the games for brevity.
    </games>
</result>

Alternatively, you can limit the listings to (I guess?) just today's game(s) by doing:
Parameters:
    format: xml
    app: true
Response:

<?xml version="1.0" encoding="UTF-8"?>
<result>
    <currentDate>2014-10-10T12:33:57.017</currentDate>
    <games>
        <game>
            <gid>NUMERIC GAME ID</gid>
            <season>2014</season>
            <type>2</type>
            <id>NUMERIC UNIQUE ID</id>
            <date>2014-10-10T19:00:00.000</date>
            <gameTimeGMT>2014-10-10T23:00:00.000</gameTimeGMT>
            <awayTeam>NYI</awayTeam>
            <homeTeam>CAR</homeTeam>
        </game>
    </games>
</result>

I'm not terribly familiar with Python, so I haven't been able to make the required changes to see what else is actually required to get it working again. I'll probably work on it a bit more later, unless Carb0 beats me to it.

Edit: It seems that authenticated login cookies are actually required when "app: true" is not set.
Edit again: Removed a video URL.
Edit again: Removed some video IDs.


RE: [RELEASE] NHL Gamecenter Addon - Carb0 - 2014-10-10

Thank you. The login still works for me. I think only the new Rogers login doesn't work.

Also be careful what you post publicly. I don't want this to lead to piracy


RE: [RELEASE] NHL Gamecenter Addon - timewasted - 2014-10-10

You're right, it looks like this new login URL doesn't give you a session ID, so it doesn't let you grab the full list of games.

Also, I removed the video URL from my previous post. I don't think it would have allowed an unauthenticated user to watch the video, but it's easier to just remove it and not have to worry about it.


RE: [RELEASE] NHL Gamecenter Addon - timewasted - 2014-10-10

Code:
def LIVE(url,name):
    #Download live.xml
    http = httplib2.Http()
    try:
        cookies = open(os.path.join(ROOTDIR, "cookies")).readline()
    except IOError:
        login()
        cookies = open(os.path.join(ROOTDIR, "cookies")).readline()

    url = 'http://gamecenter.nhl.com/nhlgc/servlets/games'
    body = {'format': 'xml'}
    headers = {'Content-type': 'application/x-www-form-urlencoded', 'Cookie': cookies}
    response, content = http.request(url, 'POST', headers=headers, body=urllib.urlencode(body))

    #Save the xml file
    saveFile("xml/live.xml",content)

    #Load the xml file
    xmlPath = os.path.join(ROOTDIR, "xml/live.xml")
    xml = parse(xmlPath)
    games = xml.getElementsByTagName('game')

    #Get teamnames
    teams = getTeams()

    for game in games:
        #Setup variables
        awayTeam = teams[game.getElementsByTagName('awayTeam')[0].childNodes[0].nodeValue][TEAMNAME]
        homeTeam = teams[game.getElementsByTagName('homeTeam')[0].childNodes[0].nodeValue][TEAMNAME]
        program = game.getElementsByTagName('program')

        title = homeTeam + ' vs ' + awayTeam

        if len(program) != 0:
            url = program[0].getElementsByTagName('publishPoint')[0].childNodes[0].nodeValue
            url = url.replace('adaptive', 'http').replace('whole_1_pc.mp4', 'whole_1_3000.mp4')
            addLink(title, url, title, '')

Despite this being a horrible, ugly hack, it works well enough to watch videos. It has numerous issues:
  • It presents more than just live games. Adding 'app': 'true' to headers is a start to a fix.
  • Quality is hardcoded at 3000Kbps. I'm not sure if it's really possible to provide a 'best' quality option any more.
  • Only games with a video stream are shown in the list. While this makes sense, it could be confusing when a user knows a game is playing, but it is not available in their area.
  • The games list could use some love. It looks like it used to show the start time of the game, among other things.
  • I'm sure there are more issues that I'm missing at the moment.



RE: [RELEASE] NHL Gamecenter Addon - Carb0 - 2014-10-10

Very good. If NHL Vault isn't updated anymore, I'm going to use this for archived games.


RE: [RELEASE] NHL Gamecenter Addon - timewasted - 2014-10-11

Ok, now that a game is actually streaming live, I have a better view of what's going on. I'm going to omit the majority of the responses, since it seems access controls are actually somewhat lax (at least for non-live games).

First, you get a list of games:

Code:
POST to http://gamecenter.nhl.com/nhlgc/servlets/games
Cookies: none
Parameters:
  format: xml
  app: true
Important tags in XML response:
  <season>
  <type>
  <gid>

From there, you can pull up an individual game:

Code:
POST to http://gamecenter.nhl.com/nhlgc/servlets/game
Cookies: none
Parameters:
  season: <season>
  type: <type>
  app: true
  gid: <gid>
  isFlex: true
Important tags in XML response:
  <season>
  <type>
  <gid>

Then you look up the game's publish point:

Code:
POST to http://gamecenter.nhl.com/nhlgc/servlets/publishpoint
Cookies: authenticated login cookies
Parameters:
  type: game
  gs: live
  id: <season><type (with leading zero)><gid>
  ft: <type> (I think)

Now comes the fun part... the realization that the stream is encrypted. I'm sure that Python has methods to decrypt the stream, but it's at this point that the addon would enter a legally grey area. I'll look a bit more, but at this point the outlook doesn't seem great for live streaming.