pigskin / kodi-gamepass

NFL Game Pass add-on for Kodi
Other
122 stars 83 forks source link

Game Pass International Support #313

Closed aqw closed 2 years ago

aqw commented 7 years ago

This issue is left open for reference.

pigskin.py has now moved to aqw/pigskin and Game Pass International support should be discussed in aqw/pigskin#1


A quick background for the uninitiated:

In 2017, the Game Pass Service was split between two streaming providers:

Currently most/all developers of this addon are in Europe, so only Game Pass Europe is supported. We are very interested in developers from Game Pass International regions getting involved in development and maintenance.

In theory, it should not be too difficult to get decent support for Game Pass International. Prior to 2017, NeuLion was the only streaming provider. Version 0.10.2 and used that service. As a result, most of the current devs have a decent amount of experience with the NeuLion service, and we can help provide some pointers.

However, not all is easy. Predictably, NeuLion has changed its APIs quite a bit since the split (likely concern over the competition), so it's not as easy as a quick code-resuscitation. There will likely be some new paths to blaze.

A quick intro to the addon:

The lines blur, at times, between default.py and pigskin.py, but those should be considered bugs. Any attempt to add Game Pass International support should respect those separations, and primarily happen in pigskin.py.

For now, support for the two services should be a toggle-able add-on setting in Kodi. If we want to get fancy later and auto-detect, that's fine. But for now we'll have the user control it manually.

As a starting point, I recommend examining pigskin.py from 0.10.2 and integrating the necessary NeuLion-specific functions into pigskin.py. And then just move on from there with development and testing.

If you're interested, please let us know here in this issue. :-) But please, only if you're serious about working on this, so that this space remains a productive work-zone for those who are interested and actively working on this support.

The work will require that you're comfortable with Python, PEP8, and network captures/website dev-tool inspection.

---Alex

dav-sap commented 7 years ago

I'm trying to sniff packets from my android (nfl game pass international app) but the regular sniff packets apps are based on VPN ( no root needed) and it blocks the packets from the app, and I can't even use the app. So i need to use a different app based on something else not VPN, My phone is rooted so any app will work. Any recommendations?

kaileu commented 7 years ago

You should sniff with an external proxy. And i would recommended firefox to start with because its easier to sniff from.

Mit freundlichen Grüßen Kai Leutner

Am 14.08.2017 um 13:59 schrieb dav-sap notifications@github.com:

I'm trying to sniff packets from my android (nfl game pass international app) but the regular sniff packets apps are based on VPN ( no root needed) and it blocks the packets from the app, and I can't even use the app. So i need to use a different app based on something else not VPN, My phone is rooted so any app will work. Any recommendations?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

aqw commented 7 years ago

@dav-sap You could also use the web interface on your computer and run your network sniffer there. That's how I've captured everything.

---Alex

dav-sap commented 7 years ago

Isn't the web based on flash? Should i still use it?

kaileu commented 7 years ago

Its based on html5. So yes its okay ;-)

Mit freundlichen Grüßen Kai Leutner

Am 14.08.2017 um 14:36 schrieb dav-sap notifications@github.com:

Isn't the web based on flash? Should i still use it?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

aqw commented 7 years ago

@dav-sap @kaileu NeuLion at least used to use both HTML5 and Flash. But in any case, it's making requests over HTTP/S, so it's easy to intercept what's going on.

---Alex

dav-sap commented 7 years ago

Hey, My subscription got canceled. ( I asked a week ago, i didn't think they would do it) I prefer saving my free Trial when the season starts. So I can't help for now. Sorry guys..

seanarnold commented 7 years ago

@aqw I've come from the Plex plugin Github. I have an international subscription and can help out but have no experience setting up a Python dev environment let alone a Kodi dev environment.

Could you help me with some instructions so I can get started?

aqw commented 7 years ago

@seanarnold Great! The dev setup is very easy. Just install the latest stable Kodi (we don't hack on any Kodi internals), git clone this addon in the Kodi addons dir (location depends on your Platform), and then install the addons dependencies (listed in the README).

Launch Kodi, turn on debugging (in Kodi settings), tail the debug log (again, location varies by platform), and launch the addon. Then... just go from there.

That and the information in this issue should be enough to get you started. Let us know if you have questions or run into problems. :-)

---Alex

dav-sap commented 7 years ago

@seanarnold I can help. Send me an email and we can talk from there.

bigwoof1234 commented 7 years ago

Hi, I have a gamepass international subscription. I'll try the git master version with debugging on over the weekend and see what I find / can fix. Thanks!

aqw commented 7 years ago

@Bills51nfl Please read this issue. We /know/ we don't have support for Game Pass International subscriptions. If you have Game Pass Europe (which I believe you have, being in the UK), then please follow @kaileu's instructions, enable debugging, open a new issue, and provide the debugging log.

I will delete your posts here to keep this issue clean.

@bigwoof1234 Great that you're interested in helping out. Please read the first post in this issue, as it will describe the entry-point for work. @seanarnold also expressed interest in working on this.

---Alex

bigwoof1234 commented 7 years ago

@aqw I saw that post. is it easier to start with 0.10.2 (which has the old neulion support) and try to figure out what broke or start from the git master and backport the 0.10.2 functions? not sure how much time I have, but I have the time, i'll trace the network calls as well from a browser running on my laptop to see what is happening.

aqw commented 7 years ago

@bigwoof1234 That's all a judgment call depending on how much the API has changed. And I don't know because I can't look at it. :-/

If I were doing this work, this is where I would start:

Once support is in master, everything gets easier. I expect more International users will show up with drive-by patches, and Europe devs can help with cleanup and how to best support both services in the same library.

Of course, the reality of what you find might result in something entirely different. :-)

---Alex

bigwoof1234 commented 7 years ago

@aqw okay. let me see if I can work on this over the weekend. will be interesting to see what has changed.

aqw commented 7 years ago

@bluesbro1982 I know you were only offering to help, but: We do not support, endorse, or even talk about those who circumvent Game Pass's region restrictions. Other than to say: it's against Game Pass's ToS and don't talk about it here.

It's a great way to invite a wheelbarrow of humorless corporate lawyers into our laps. I've grown fond of this project over the years; I would hate for it to end with a tall stack of paper.

---Alex

bigwoof1234 commented 7 years ago

Hi @aqw I had a little bit of time today so I took a look. did not get too far other than the pigskin.py base url is wrong

19:07:24.397 T:140600166799104 DEBUG: [pigskin]: Request URL: https://gp.nfl.com/nflgp/servlets/simpleconsole 19:07:24.397 T:140600166799104 DEBUG: [pigskin]: Headers: None

to debug this, I ran a full wireshark capture on my laptop of a gamepass.nfl.com play (in firefox) of a game (Ravens versus someone week 2 preseason). I changed my password before making the capture. I have not analysed the file in detail yet to figure out what the new URLs are. would the pcap file be useful for you? if so, what is the best way to send it?

Thanks!

Raj

seanarnold commented 7 years ago

I again started work today. Got auth working with new URLs and starting on schedules.  Was the idea that both international and Europe sound be in the same pigskin.py file or separate?

kaileu commented 7 years ago

@bigwoof1234 I think Wireshark isn't a good tool to do this kind of job because its needed much time and ssl encrypted traffic is hard to decrypt especially if diffie hellman is used.

My Favorite tool to do such work is a reverse Proxy like Charles Web Proxy or the free alternative fiddler.

bigwoof1234 commented 7 years ago

Hi Kaileu,

okay. I can capture again using fiddler. not an issue. would that be of use?

kaileu commented 7 years ago

a charles capture would be usefull for me personally. Maybe you could ask seanarnold who is coding at the moment for the international part.

aqw commented 7 years ago

@bigwoof1234 You need to get further than changing a URL and then passing along a network capture. We could have had that weeks ago. The issue is that these APIs are not published, and the best way to develop against them is to keep poking them interactively to figure out what they do.

That is, unless one of the other devs here is willing to go through an endless ping-pong process of capture/code/repeat, but I'm sure not.

@maddes-b Are you using Game Pass International or Game Pass Europe? If the former, that is a big surprise; if the latter, you are off-topic (but thanks for the info ;-).

---Alex

aqw commented 7 years ago

@seanarnold Doh, I managed to miss your post.

Great that you've made progress!

Indeed, the goal is to have both Europe and International in the same pigskin.py file.

It doesn't have to be pretty. Once the code is in, we can help bring things together in a sane way.

---Alex

kaileu commented 7 years ago

If someone post a dump with charles Proxy with live game, archive game full/condensed, nfl network. I will looking into it the next few days.

bigwoof1234 commented 7 years ago

Hi @kaileu okay. I can install charles and try to capture the live game tomorrow morning (my time) at 10 a.m. (in an asian timezone) and the rest of the bits as well then.

@aqw yes I read the bits where the API has changed. but step 1 is capturing enough info for me to figure out what the new URLs are to even try. so checking if the capture stream is useful for anyone else. the info on using a http specific proxy capture is definitely useful. I immediately went to my old school networking capture methods -- completely forgetting about https encryption. doh!!

anyway, it looks like @seanarnold has already figured out the new URLs. so I should probably just help him figure out the protocol changes. sean, what help can I provide?

seanarnold commented 7 years ago

@aqw Cool, i'm working off 0.10.2 at the moment.

I'm wondering if I'm better to go off master in case I'm spending my time discovering things that have been done already.

bigwoof1234 commented 7 years ago

@kaileu I made the live capture using the Charles proxy. sent you email (using the email in the git commits for this repo).

aqw commented 7 years ago

@seanarnold master talks with a completely different streaming API now. So you won't be discovering anything that has been done already. They're different services. Which is why none of the devs with Game Pass Europe can easily work on Game Pass International support.

---Alex

seanarnold commented 7 years ago

Yep fair enough. I'm working in a new branch off master and am replacing the Europe code for International code.

I can't see how this is going to work nicely in the single pigskin.py file. I image each region having their own implementation of the same interface in seperate files, with pigskin.py deciding which one to choose based on a parameter than could be passed to it by default.py.

In the meantime I'm going to develop in pigskin.py for International support & we can evaluate where we go from there.

kaileu commented 7 years ago

@aqw could you create a branch on the official repo for this to work on ?

Mit freundlichen Grüßen Kai Leutner

Am 19.08.2017 um 07:33 schrieb Sean Arnold notifications@github.com:

Yep fair enough. I'm working in a new branch off master and am replacing the Europe code for International code.

I can't see how this is going to work nicely in the single pigskin.py file. I image each region having their own implementation of the same interface in seperate files, with pigskin.py deciding which one to choose based on a parameter than could be passed to it by default.py.

In the meantime I'm going to develop in pigskin.py for International support & we can evaluate where we go from there.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

seanarnold commented 7 years ago

@aqw I've started work replacing pigskin.py with an international implementation. https://github.com/seanarnold/xbmc-gamepass/commits/international-support-2017

Some of the responses from the International Gamepass are quite different than the Europe edition and I can see default.py and or pigskin.py getting messy with handling the various responses. Would be good to chat and sort a plan for that.

bluesbro1982 commented 7 years ago

Just made a Charles capture of initiating the livestream for the ATl-PIT game on international feed. Also at about 2:00 into capture I changed streaming options / bitrate every 20 seconds to observe behavior. Also changed auto options for home / away audio. How should I share the capture after I clear my user/pass info?

kaileu commented 7 years ago

@bluesbro1982 i think Sean Arnold is doing great Progress. One of the Main problems, see his post above, is the integration in the current addon because of the diffrent responses of both services.

Mit freundlichen Grüßen Kai Leutner

Am 20.08.2017 um 22:41 schrieb bluesbro1982 notifications@github.com:

Just made a Charles capture of initiating the livestream for the ATl-PIT game. Also at about 2:00 into capture I changed streaming options / bitrate every 20 seconds to observe behavior. Also changed auto options for home / away audio. How should I share the capture after I clear my user/pass info?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

bluesbro1982 commented 7 years ago

@kaileu @seanarnold I agree. I think Sean's suggestion of a new branch is great... then maybe to reintegrate a toggle slider in the preferences and pigskin.py and maybe pigskin-intl.py...oops just saw the goal is to have them in the same file. I'm still watching my Steelers get pounded, so maybe tonight I'll take a good look at the capture in depth.

emilsvennesson commented 7 years ago

I've been thinking about the best way to approach this, and my suggestion is that we make one base class (called GamePassBase or whatever) that does the normal init, holds the common ground functions like make_request, log, etc. We can then make two subclasses for each service inheriting from the base class - thus avoiding all the if/else nightmare.

Also, as @aqw said in #333, we're currently returning JSON data directly from the GP servers in some of our methods. We should make up our own format so that default.py can use the same logic for both services.

The following methods should be changed accordingly:

aqw commented 7 years ago

@emilsvennesson @kaileu @seanarnold @bluesbro1982 (I think I just @-ed half the world ;-)

I think we're reaching broad agreement that pigskin.py should hide the specifics of the format of the data returned by a service's API, and we should have our own stable API (regardless of which service is in use) that multiple front-ends can consume (Kodi, Plex, etc).

@seanarnold Proposed the above in an email to me, and it is something I've been toying with for the last couple years; we've just never had the need up until now.

The following response I sent to Sean in an email pretty much sums up our conversation:

[...] perhaps I'm coming around to this idea...

default.py (kodi) -> pigskin.py (contains API which forwards calls to appropriate calls in service-specific files) -> pigskin-europe.py/pigskin-international.py

That would allow for a stable API on the front, public API docs can be generated from pigskin.py, and the same module can be used to load all implementations. But it would also allow for the development and testing of each service to live in its own file.

Sean also proposed that pigskin should live in its own repo to make it easier for other projects to include it as a submodule in their source trees. I too think this makes a lot of sense.

I have, hopefully, one more day of this all-consuming project at work, and then I should (oh dear how I do hope) have the time to dig into this addon again.

Thoughts on the above proposals?

---Alex

kaileu commented 7 years ago

I think ist the right way but i a am not sure how intense the workload is.

emilsvennesson commented 7 years ago

@aqw @kaileu @seanarnold @bluesbro1982

That sounds like a really good plan. I think we should start working on the pigskin library first (+1 for having it in its own repository), and once we feel like the API is reasonably stable, we start integrating it in the Kodi addon.

aqw commented 7 years ago

@kaileu It will take effort. What I'm most concerned about is building a decent public API. That requires real thought, and can cause real problems for those implementing the server-specific logic if we get it wrong. Of course we can always change the API as we learn/grow, but that's something best avoided if we can.

I'm hoping the rest of the work will be effortful, but relatively straightforward.

@emilsvennesson Sounds good. If you'll permit me a day... tomorrow I'll setup the new repo and get these things rolling.

---Alex

41john commented 7 years ago

Interested in your developments on this, especially a separate repository. Would make it more viable for me to use.

I will have to consider whether it will be easier working with the respository created, or doing what I'm already doing and working with the Gamepass API directly.

Sinutok commented 7 years ago

I am a bit irritated.... as stated it doesnt work with Game Pass International, well I am in Germany, shouldnt that be GP Europe, and not International. On iPad, Android I use the GP Europe, but why does xbmc-gamepass tells me I am a GP International? Any Configuration I am missing?

kaileu commented 7 years ago

Its Because the Image is from last year^^ And last year Gamepass Europe was Gamepass International

Mit freundlichen Grüßen Kai Leutner

Am 24.08.2017 um 12:31 schrieb Sinutok notifications@github.com:

I am a bit irritated.... as stated it doesnt work with Game Pass International, well I am in Germany, shouldnt that be GP Europe, and not International. On iPad, Android I use the GP Europe, but why does xbmc-gamepass tells me I am a GP International? Any Configuration I am missing?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

Sinutok commented 7 years ago

I see ^^ and understand :-) Drove me crazy, but then I dunno get it, therefore the 0.11 should work in Germany and we "Germans" are not affected with that case. if thats GP Europe and only the title-line is old..

Auch mit freundlichen Grüssen aus Mainz Matthias Gruber

WHamilton1 commented 7 years ago

Is there a chane to run it on kodi 16 ?

Grüße aus dem Saarland

kaileu commented 7 years ago

Musst du ausprobieren. (In der addon.xml die Gui dependencies rausnehmen) Wir versuchen immer neue Features einzuführen und das führt dazu dass manche API nicht mit älteren Kodi Versionen funktionieren daher nehmen wir darauf keine Rücksicht und unterstützen immer die aktuelle Stable Version.

Mit freundlichen Grüßen Kai Leutner

Am 26.08.2017 um 03:22 schrieb WHamilton1 notifications@github.com:

Is there a chane to run it on kodi 16 ?

Grüße aus dem Saarland

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

WHamilton1 commented 7 years ago

Scheint nicht zu funktionieren. Es kommen Fehlermeldungen wie busydialog = xbmcgui.DialogBusy() AttributeError: 'module' object has no attribute 'DialogBusy'

und zieht sich wie Rattenschwanz durch.

Schade

dkoopi commented 7 years ago

Is there a Known Progress of getting the int. Version working ? I am located in Europe but sadly found myself international, due to subscription through vpn. Is there anything I can do without dev skills ?

aqw commented 7 years ago

@WHamilton1 Please don't pollute this issue, as your question/request has nothing to do with the effort to support Game Pass International.

@dkoopi There's an effort (I believe @seanarnold has made the most progress), but sadly I have had no time to help make it happen.

@emilsvennesson @kaileu I'm going on vacation starting today (10 days). I talked with a co-worker who has written quite a few Python libraries, and he suggested that I look into Python Factory functions, as they are common and seem like a good fit for our multi-service problem. I havn't had time yet to dig into them, but figured I'd throw that out there in case anyone is interested reading up and giving thought to how to best lay down this foundation.

---Alex

seanarnold commented 7 years ago

Yes I made some progress recently but since then have had no time as work projects have taken priority.

emilsvennesson commented 7 years ago

@aqw I will definitely look into Python Factory functions. Thanks for the tip! I've been struggling a bit when thinking about the best way to approach this problem, so it's certainly nice with feedback/expertise from someone experienced.

Have a great vacation! :-)