Closed kaileu closed 6 years ago
@kaileu Thanks for the PR!
Merging, untested. If this works, then it probably make most sense to just give you push permissions.
---Alex
Just tested the release, seems the video duration is not always set. My quick fix was setting the duration to 0 if not set, might be more elegant ways to fix.
Request URL: https://www.nflgamepass.com/api/en/content/v1/web/games/2018/pre/1/list
default.py: game_info = '%s [CR] Duration: %s' % (game['phase'], str(timedelta(seconds=int(float(game['video']['videoDuration'].replace(',','.'))))))
sample data:
{"homeNickName":"Bengals","homeCityState":"Cincinnati","visitorNickName":"Bears","visitorCityState":"Chicago","gameId":2018080953,"backgroundImage":null,"gameDateTimeUtc":"2018-08-09T23:00:00.000Z","redZone":false,"phase":"FINAL","winner":"Bengals","videoStatus":"ONDEMAND","season":2018,"seasonType":"PRE","week":1,"weekName":"Preseason Week 1","homeTeamId":"0920","homeTeamAbbr":"CIN","homeScore":{"pointTotal":30},"homeTeamResult":"winner","visitorTeamId":"0810","visitorTeamAbbr":"CHI","visitorScore":{"pointTotal":27},"visitorTeamResult":"loser","siteId":3530,"siteCity":"Cincinnati","siteFullName":"Paul Brown Stadium","displayText":{"scheduled":"video-scheduled","live":"video-live","liveIn":"video-live-in","ondemand":"video-ondemand"},"video":{"videoId":"9e93876d-5d29-4728-a50f-e812a3f94c1e","title":"Chicago Bears @ Cincinnati Bengals","description":"","kind":"Game video","videoStatus":"ONDEMAND","videoDuration":"","trimmedVideoDuration":"","slug":"chicago-bears-cincinnati-bengals-3","videoThumbnail":{"templateUrl":"","overridenFormats":{}},"week":"week-1","season":"season-2018","seasonType":"seasontype-pre","scheduleDate":"","isGameOfTheWeek":false,"vocGameTopTag":null,"isBasic":false,"nflprogram":null,"nflprogramcode":null},"condensedVideo":{"videoId":"dfd9a181-11d9-4f13-b0c6-96896949ff56","title":"Chicago Bears @ Cincinnati Bengals - Game in 40'","description":"","kind":"Condensed game","videoStatus":"ONDEMAND","videoDuration":"","trimmedVideoDuration":"","slug":"chicago-bears-cincinnati-bengals-game-in-40","videoThumbnail":{"templateUrl":"","overridenFormats":{}},"week":"week-1","season":"season-2018","seasonType":"seasontype-pre","scheduleDate":"","isGameOfTheWeek":false,"vocGameTopTag":null,"isBasic":false,"nflprogram":null,"nflprogramcode":null},"coachfilmVideo":null,"highlightsVideo":null},