Comments (10)
@jgshier Unfortunately, there is no documentation yet. This library has grown very organically, and a lot of technical debt needs to be repaid.
My rough roadmap is to get some tests going first. and then start refactoring, to develop a more general API that isn't such an overfit to the Kodi use-case (here proper docs will start appearing), and start adding in International Support from dev-sap's fork.
Right now, the best docs are the code itself. If you have specific questions, feel free to ask and I'll do my best to explain why things are how they are.
Are you looking to add/port International Support to this addon? Just to make sure there's no confusion, we don't support International Subscriptions yet, but dev-sap does have it working, and I do plan to integrate it into this library.
Lastly, out of curiosity, what are you hoping to use this library for? I'm curios about additional use-cases that I should keep in mind when coming up with a better API. Any input you have is much appreciated.
from pigskin.
Yeah I will look at the code, to see what I can figure out. I am guessing the first call would be the "login" then from there you have to pull seasons, to get the video_id? I would love to get this it working in VLC, so maybe using streamlink.
from pigskin.
I havn't tested this, but I traced through the Kodi code and the following /should/ work. At very least it should provide a good starting point.
At the end, you should have a URL to a master m3u8 file (which will contain multiple bitrates, for adaptive streaming. If you don't want that, you can use m3u8_to_dict() to get a bitrate specific stream). This can be passed to the player of your choice.
Let me know how it works out. :-)
gp = pigskin(debug=True)
gp.login(username, password)
cur_s_w = gp.get_current_season_and_week()
# or instead look through gp.get_seasons_and_weeks()
games = gp.get_weeks_games(cur_s_w['season'], cur_s_w['season_type'], cur_s_w['week'])
game = games[0] # choose first game
game_slug = '{0}-{1}-{2}'.format(game['visitorNickName'].lower(), game['homeNickName'].lower(), str(game['gameId']))
game_versions = gp.get_game_versions(game_slug, cur_s_w['season'])
video_id = game_versions['Game video']
streams = gp.get_streams(video_id, 'game', username=username)
stream_url = streams['chromecast']
from pigskin.
Have lots to learn. I do need to pass the cookie in the header and not via the URL as it seems to break streamlink. like --http-cookie "hdntl=exp=1535163356~acl=/*~hmac=dc90efe306bb3be05bf884b758a69db5a48d3541f09d476bf8231892cf9112d; path=/; domain=livemain-i-video-nfl.akamaized.net;86400s" I also need to grab the bit rates and pick the correct URL. Once I get pass that, then I have to figure out how to clean the URL and get the correct cookie.
This works:
hlsvariant://https://livemain-i-video-nfl.akamaized.net/ch01/0fc04a5a-c836-47dd-9379-c14413ce68ea/0fc04a5a-c836-47dd-9379-c14413ce68ea.ism/QualityLevels(4749952)/Manifest(video,format=m3u8-aapl-v3,audiotrack=audio,filter=hls)
At least I am closer! thanks.
from pigskin.
So after play more, needed to add the agent header and I can leave the URL but I do need to set the cookie header, so I just split on the '?' and then add that to the cookie header. Is there a better way?
from pigskin.
@jgshier Perhaps I didn't emphasize it enough before, but it really bears repeating: this library has a lot of technical debt that needs to be repaid.
This library is only one or two weeks old, and as far as I'm aware, has never been used independent of Kodi. There's never been any tests (something I'm planning to rectify), and the fact that the the Game Pass service changes its API on a whim, it's a miracle that it even works.
I do have plans to improve the situation, but it will take time and effort. Lots of it.
Right now, we can't promise a good out-of-the-box experience. But we do offer code that has been known to work for 5 years --- albeit with it's own creaking oddities.
If you're up to it, patches are always appreciated. I encourage you to debug stuff, understand the service as much as possible, and to provide tests and patches.
I'm working on getting the test infrastructure up and running. My goal is to be able to replay mock responses from the Game Pass servers, so we can /finally/ get CI going. That will finally allow us the freedom to make the changes this library desperately needs. But it all will take time, and I don't have a whole lot of extra time at the moment.
---Alex
from pigskin.
Thank you for what you have done! I am still trying to figure out how to trace out of kodi. At least i can watch via vlc :P
from pigskin.
So I see you have really updated the API, never heard of vcrpy, but want to learn. what is the best way to figure out how to run what you have created?
from pigskin.
@jgshier The easiest way is from the docs I havn't written yet. ;-) I will be going on vacation starting in a few days with limited access to internet. I plan to write some documentation then.
The new API is /not/ complete (it's about 50% done), but that which is done should be a lot easier to use than before.
If you're looking for examples, poke around the tests or read issue #15.
But, as a quick starting point:
gp = pigskin()
gp.login(username, password)
gp.season['2018']['reg'].week['1'].games['Bears@Packers'].versions['full'].streams
That will give you a list of streams for the full version of the packers game of week one of the 2018 regular season. Though I have /not/ tested that the stream URLs actually work yet.
from pigskin.
Closing this issue, as NFL has canceled the Gamepass service
from pigskin.
Related Issues (20)
- Avoid authenticating against gigya if we don't have to HOT 1
- Retire make_request() and parse_response() HOT 1
- refactor parse_shows() HOT 1
- configure self.http_session to auto-retry with a sane timeout HOT 1
- New API HOT 1
- test for check_for_subscription() fails HOT 1
- Attach logging directly to requests session handle HOT 1
- Retire pytest-vcr
- .raw() endpoint HOT 1
- Caching HOT 1
- Swap VCR cassettes according to which service is being tested HOT 1
- Find the vcrpy equivalent of "allow_playback_repeats" HOT 4
- Parse XML responses and pretty print in cassettes HOT 1
- Allow HTTP requests to be throttled HOT 1
- Auth - Response Code check HOT 4
- errors on login from kodi/nflgamepass addon HOT 1
- Convert log() to use "logging" module HOT 1
- Cookie Issue? HOT 1
- get team games HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pigskin.