summaryrefslogtreecommitdiff
path: root/plugin.video.nfl.gamepass
diff options
context:
space:
mode:
authorAlex Waite <alex@waite.eu>2017-08-24 21:58:28 +0200
committerenen92 <enen92@users.noreply.github.com>2017-08-24 21:58:28 +0200
commita8950765f637efe3cd3306f9ec2627b268837f9f (patch)
tree5b6a0a5d867fc50996d9ba8c71167e9f7931bf7f /plugin.video.nfl.gamepass
parent5d8837258f83e861e12d1c2363c568092bd35785 (diff)
[plugin.video.nfl.gamepass] 0.11.1 (#1380)
Diffstat (limited to 'plugin.video.nfl.gamepass')
-rw-r--r--plugin.video.nfl.gamepass/README.md2
-rw-r--r--plugin.video.nfl.gamepass/addon.xml24
-rw-r--r--plugin.video.nfl.gamepass/changelog.txt8
-rw-r--r--plugin.video.nfl.gamepass/default.py108
-rw-r--r--plugin.video.nfl.gamepass/resources/language/resource.language.de_de/strings.po (renamed from plugin.video.nfl.gamepass/resources/language/German/strings.po)60
-rw-r--r--plugin.video.nfl.gamepass/resources/language/resource.language.en_gb/strings.po (renamed from plugin.video.nfl.gamepass/resources/language/English/strings.po)6
-rw-r--r--plugin.video.nfl.gamepass/resources/language/resource.language.ja_jp/strings.po (renamed from plugin.video.nfl.gamepass/resources/language/Japanese/strings.po)6
-rw-r--r--plugin.video.nfl.gamepass/resources/language/resource.language.nl_nl/strings.po (renamed from plugin.video.nfl.gamepass/resources/language/Dutch/strings.po)6
-rw-r--r--plugin.video.nfl.gamepass/resources/language/resource.language.ru_ru/strings.po (renamed from plugin.video.nfl.gamepass/resources/language/Russian/strings.po)6
-rw-r--r--plugin.video.nfl.gamepass/resources/language/resource.language.uk_ua/strings.po (renamed from plugin.video.nfl.gamepass/resources/language/Ukrainian/strings.po)6
-rw-r--r--plugin.video.nfl.gamepass/resources/lib/pigskin.py67
-rw-r--r--plugin.video.nfl.gamepass/resources/settings.xml2
12 files changed, 171 insertions, 130 deletions
diff --git a/plugin.video.nfl.gamepass/README.md b/plugin.video.nfl.gamepass/README.md
index c77ef93..3ae1335 100644
--- a/plugin.video.nfl.gamepass/README.md
+++ b/plugin.video.nfl.gamepass/README.md
@@ -9,7 +9,7 @@ with a Game Pass International subscription and are interested in helping out,
check out issue #313. It'd be great to get those subscriptions working again.
# NFL Game Pass Kodi Plugin #
-**version 0.11.0 — Jay Cutler Edition**
+**version 0.11.1 — Kenny Easley Edition**
Before reading any further, please understand that this addon is unofficial and
is not endorsed or supported by the NFL in any way. Not all features are
diff --git a/plugin.video.nfl.gamepass/addon.xml b/plugin.video.nfl.gamepass/addon.xml
index 55f7f73..3bb654c 100644
--- a/plugin.video.nfl.gamepass/addon.xml
+++ b/plugin.video.nfl.gamepass/addon.xml
@@ -5,7 +5,7 @@
marooned on an old version. -->
<addon id="plugin.video.nfl.gamepass"
name="NFL Game Pass"
- version="0.11.0"
+ version="0.11.1"
provider-name="Alexqw,divingmule,BaumSchorle,eriksoderblom,kaileu,emilsvennesson">
<requires>
<import addon="xbmc.python" version="2.25.0"/>
@@ -17,23 +17,21 @@
<provides>video</provides>
</extension>
<extension point="xbmc.addon.metadata">
- <summary lang="en">NFL Game Pass</summary>
- <description lang="en">Watch NFL Game Pass streams.</description>
+ <summary lang="en_GB">NFL Game Pass</summary>
+ <description lang="en_GB">Watch NFL Game Pass streams.</description>
<platform>all</platform>
<language>en</language>
<license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991</license>
<source>https://github.com/aqw/xbmc-gamepass</source>
<forum></forum>
- <disclaimer lang="en">This addon requires you to have a subscription to NFL Game Pass.[CR]Please note that these subscriptions are region restricted by the NFL.[CR]This addon is completely unofficial and is /not/ endorsed by the NFL in any way.</disclaimer>
- <news>2017.08.17 v0.11.0 -- Jay Cutler Edition
- + NOTE: This addon currently does not support Game Pass International.
- + NOTE: Game Pass Europe moved to a new streaming partner. Not all features
- + are available yet or supported.
- + Support for Game Pass Europe (kaileu and emilsvennesson)
- + Updated Dutch translation (pyrocumulus)
- + Optional support for inputstream.adaptive plugin, but (contrary to the
- + name) no support yet for adaptive streaming (emilsvennesson)
- + Lots of cleanup (emilsvennesson, aqw, pyrocumulus)
+ <disclaimer lang="en_GB">This addon requires you to have a subscription to NFL Game Pass.[CR]Please note that these subscriptions are region restricted by the NFL.[CR]This addon is completely unofficial and is /not/ endorsed by the NFL in any way.</disclaimer>
+ <news>2017.08.24 v0.11.1 -- Kenny Easley Edition
+ + Fix "everything is broken"; Game Pass broke their API again (emilsvennesson)
+ + Add groundwork for what will become a Team View (kaileu)
+ + Open Settings when login info is missing (pyrocumulus)
+ + Restore show/episode thumbnails (emilsvennesson)
+ + Updated German translation (sieversMartin)
+ + Code cleanup (emilsvennesson)
</news>
<assets>
<icon>resources/art/icon.png</icon>
diff --git a/plugin.video.nfl.gamepass/changelog.txt b/plugin.video.nfl.gamepass/changelog.txt
index 55ee425..774c7bc 100644
--- a/plugin.video.nfl.gamepass/changelog.txt
+++ b/plugin.video.nfl.gamepass/changelog.txt
@@ -1,3 +1,11 @@
+2017.08.24 v0.11.1 -- Kenny Easley Edition
++ Fix "everything is broken"; Game Pass broke their API again (emilsvennesson)
++ Add groundwork for what will become a Team View (kaileu)
++ Open Settings when login info is missing (pyrocumulus)
++ Restore show/episode thumbnails (emilsvennesson)
++ Updated German translation (sieversMartin)
++ Code cleanup (emilsvennesson)
+
2017.08.17 v0.11.0 -- Jay Cutler Edition
+ NOTE: This addon currently does not support Game Pass International.
+ NOTE: Game Pass Europe moved to a new streaming partner. Not all features
diff --git a/plugin.video.nfl.gamepass/default.py b/plugin.video.nfl.gamepass/default.py
index 1b41231..7cb98d6 100644
--- a/plugin.video.nfl.gamepass/default.py
+++ b/plugin.video.nfl.gamepass/default.py
@@ -49,15 +49,18 @@ def addon_log(string):
msg = '%s: %s' % (LOGGING_PREFIX, string)
xbmc.log(msg=msg, level=xbmc.LOGDEBUG)
+
def show_busy_dialog():
busydialog.create()
+
def hide_busy_dialog():
try:
busydialog.close()
- except RuntimeError,e:
+ except RuntimeError, e:
addon_log('Error closing busy dialog: %s' % e.message)
+
class GamepassGUI(xbmcgui.WindowXML):
def __init__(self, *args, **kwargs):
self.season_list = None
@@ -163,7 +166,7 @@ class GamepassGUI(xbmcgui.WindowXML):
if game['phase'] == 'FINAL' or game['phase'] == 'FINAL_OVERTIME':
# show game duration only if user wants to see it
- if addon.getSetting('hide_game_length') == 'false':
+ if addon.getSetting('hide_game_length') == 'false' and game['video']:
game_info = '%s [CR] Duration: %s' % (game['phase'], str(timedelta(seconds=int(float(game['video']['videoDuration'])))))
else:
game_info = game['phase']
@@ -184,13 +187,10 @@ class GamepassGUI(xbmcgui.WindowXML):
video_id = str(game['video']['videoId'])
isPlayable = 'true'
isBlackedOut = 'false'
- listitem.setProperty('video_id', video_id)
- listitem.setProperty('game_versions', 'Live')
+ listitem.setProperty('live_video_id', video_id)
else: # ONDEMAND
- video_id = str(game['video']['videoId'])
isPlayable = 'true'
isBlackedOut = 'false'
- listitem.setProperty('video_id', video_id)
listitem.setProperty('isPlayable', isPlayable)
listitem.setProperty('isBlackedOut', isBlackedOut)
@@ -233,10 +233,11 @@ class GamepassGUI(xbmcgui.WindowXML):
listitem.setProperty('is_game', 'false')
listitem.setProperty('is_show', 'true')
listitem.setProperty('isPlayable', 'true')
+ listitem.setProperty('away_thumb', episode['videoThumbnail']['templateUrl'].replace('{formatInstructions}', 'c_thumb,q_auto,f_png'))
self.games_items.append(listitem)
except:
addon_log('Exception adding archive directory: %s' % format_exc())
- addon_log('Directory name: %s' % i['title'])
+ addon_log('Directory name: %s' % episode['title'])
self.games_list.addItems(self.games_items)
def play_url(self, url):
@@ -322,33 +323,32 @@ class GamepassGUI(xbmcgui.WindowXML):
return self.ask_bitrate(bitrate_values)
def select_version(self, game_versions):
- """Returns a game version, while honoring the user's /preference/.
- Note: the full version is always available but not always the condensed.
- """
+ """Selects a game version and returns the video ID while honoring the user's /preference/."""
preferred_version = int(addon.getSetting('preferred_game_version'))
+ if preferred_version == 0:
+ selected_version = 'Game video'
+ elif preferred_version == 1:
+ selected_version = 'Condensed game'
+ elif preferred_version == 2:
+ selected_version = 'Coach film'
+ else:
+ selected_version = None
# user wants to be asked to select version
- if preferred_version == 2:
- versions = [language(30014)]
- if 'Condensed' in game_versions:
- versions.append(language(30015))
- if 'Coach' in game_versions:
- versions.append(language(30032))
+ # bring up selection when preferred game version is unavailable
+ if not selected_version or selected_version not in game_versions:
+ versions = game_versions.keys()
dialog = xbmcgui.Dialog()
hide_busy_dialog()
- preferred_version = dialog.select(language(30016), versions)
+ answer = dialog.select(language(30016), versions)
+ if answer > -1:
+ selected_version = versions[answer]
+ addon_log('Selected version: %s' % selected_version)
+ else:
+ addon_log('Select version dialog was cancelled.')
+ return None
- if preferred_version == 1 and 'Condensed' in game_versions:
- game_version = 'condensed'
- elif preferred_version == 2 and 'Coach' in game_versions:
- game_version = 'coach'
- else:
- game_version = 'archive'
-
- if preferred_version > -1:
- return game_version
- else:
- return None
+ return game_versions[selected_version]
def has_inputstream_adaptive(self):
"""Checks if InputStream Adaptive is installed and enabled."""
@@ -457,38 +457,19 @@ class GamepassGUI(xbmcgui.WindowXML):
self.display_weeks_games()
elif controlId == 230: # game is clicked
- selectedGame = self.games_list.getSelectedItem()
- if selectedGame.getProperty('isPlayable') == 'true':
+ selected_game = self.games_list.getSelectedItem()
+ if selected_game.getProperty('isPlayable') == 'true':
self.init('game/episode')
- game_id = selectedGame.getProperty('game_id')
- video_id = selectedGame.getProperty('video_id')
- game_versions = selectedGame.getProperty('game_versions')
-
- if 'Live' in game_versions:
- if 'Final' in selectedGame.getProperty('game_info'):
- game_version = self.select_version(game_versions)
- if game_version == 'archive':
- game_version = 'dvr'
- else:
- game_version = 'live'
+ game_id = selected_game.getProperty('game_id')
+
+ if selected_game.getProperty('live_video_id'):
+ video_id = selected_game.getProperty('live_video_id')
else:
- # check for coaches film availability
- if gp.has_coaches_tape(game_id, self.selected_season):
- game_versions = game_versions + ' Coach'
- coach_id = gp.has_coaches_tape(game_id, self.selected_season)
- # check for condensed film availability
- if gp.has_condensed_game(game_id, self.selected_season):
- game_versions = game_versions + ' Condensed'
- condensed_id = gp.has_condensed_game(game_id, self.selected_season)
-
- game_version = self.select_version(game_versions)
- if game_version:
- if game_version == 'condensed':
- stream_url = self.select_stream_url(gp.get_stream(condensed_id, 'game', username=username))
- elif game_version == 'coach':
- stream_url = self.select_stream_url(gp.get_stream(coach_id, 'game', username=username))
- else:
- stream_url = self.select_stream_url(gp.get_stream(video_id, 'game', username=username))
+ game_versions = gp.get_game_versions(game_id, self.selected_season)
+ video_id = self.select_version(game_versions)
+
+ if video_id:
+ stream_url = self.select_stream_url(gp.get_stream(video_id, 'game', username=username))
if stream_url:
self.play_url(stream_url)
elif stream_url is False:
@@ -575,6 +556,17 @@ if __name__ == '__main__':
addon_log('script starting')
hide_busy_dialog()
+ if not username or not password:
+ dialog = xbmcgui.Dialog()
+ answer = dialog.ok(language(30021), language(30050))
+
+ if answer:
+ addon.openSettings()
+ username = addon.getSetting('email')
+ password = addon.getSetting('password')
+ else:
+ sys.exit(0)
+
try:
gp.login(username, password)
except gp.GamePassError as error:
diff --git a/plugin.video.nfl.gamepass/resources/language/German/strings.po b/plugin.video.nfl.gamepass/resources/language/resource.language.de_de/strings.po
index e630cc0..a51b62d 100644
--- a/plugin.video.nfl.gamepass/resources/language/German/strings.po
+++ b/plugin.video.nfl.gamepass/resources/language/resource.language.de_de/strings.po
@@ -23,7 +23,7 @@ msgstr "Passwort"
msgctxt "#30003"
msgid "Preferred Stream Quality"
-msgstr "Bevorzugte Stream Qualität"
+msgstr "Bevorzugte Streamqualität"
msgctxt "#30004"
msgid "Always Use Highest Bitrate"
@@ -63,7 +63,7 @@ msgstr "Vorher fragen"
msgctxt "#30013"
msgid "Preferred Game Version"
-msgstr "Bevorzugte Spiel Version"
+msgstr "Bevorzugte Spielversion"
msgctxt "#30014"
msgid "Full"
@@ -75,51 +75,51 @@ msgstr "Zusammengefasst"
msgctxt "#30016"
msgid "Choose a game version"
-msgstr "Wähle eine Spiel Version"
+msgstr "Wählen Sie eine Spielversion"
msgctxt "#30020"
msgid "Time Notation"
-msgstr ""
+msgstr "Zeitformat"
msgctxt "#30021"
msgid "Error"
-msgstr ""
+msgstr "Fehler"
msgctxt "#30022"
msgid "Due to broadcast restrictions, NFL Game Pass Domestic is currently unavailable. Please try again later."
-msgstr ""
+msgstr "Aufgrund rechtlicher Einschränkungen steht NFL Game Pass Domestic zur Zeit nicht zur Verfügung. Bitte versuchen Sie es später noch einmal."
msgctxt "#30023"
msgid "Logging into NFL Game Pass failed. Make sure that your account information is correct and your subscription is valid."
-msgstr ""
+msgstr "Einloggen nicht erfolgreich. Bitte stellen Sie sicher, dass Ihre Accountangaben korrekt sind und Ihr Abo gültig ist."
msgctxt "#30024"
-msgid "Unexpected error ='(. Please enable debuging for both the addon and Kodi, and submit a bug report."
-msgstr ""
+msgid "Unexpected error ='(. Please enable debugging in Kodi and submit a bug report."
+msgstr "Unerwarteter Fehler ='(. Bitte schalten Sie den Debugmodus in Kodi ein und melden Sie den Fehler samt Bericht."
msgctxt "#30025"
msgid "Hide game length"
-msgstr ""
+msgstr "Spiellänge nicht anzeigen"
msgctxt "#30026"
msgid "No"
-msgstr ""
+msgstr "Nein"
msgctxt "#30027"
msgid "12-hour clock (AM/PM)"
-msgstr ""
+msgstr "12-Stunden-Uhr (AM/PM)"
msgctxt "#30028"
msgid "24-hour clock"
-msgstr ""
+msgstr "24-Stunden-Uhr"
msgctxt "#30029"
msgid "General"
-msgstr ""
+msgstr "Allgemein"
msgctxt "#30030"
msgid "Display/Video"
-msgstr ""
+msgstr "Anzeige"
msgctxt "#30032"
msgid "Coaches Film"
@@ -127,15 +127,15 @@ msgstr ""
msgctxt "#30033"
msgid "Proxy Settings"
-msgstr ""
+msgstr "Proxyeinstellungen"
msgctxt "#30034"
msgid "Use an HTTP proxy to access Game Pass"
-msgstr ""
+msgstr "HTTP-Proxy für Zugang zum Game Pass nutzen"
msgctxt "#30035"
msgid "Protocol"
-msgstr ""
+msgstr "Protokoll"
msgctxt "#30036"
msgid "Server"
@@ -147,40 +147,44 @@ msgstr ""
msgctxt "#30038"
msgid "Username"
-msgstr ""
+msgstr "Benutzername"
msgctxt "#30039"
msgid "Password"
-msgstr ""
+msgstr "Passwort"
msgctxt "#30042"
msgid "Enable 'Basic' Authentication"
-msgstr ""
+msgstr "Schalte 'Basic'-Authentifizierung ein"
msgctxt "#30043"
msgid "There was a problem playing that stream"
-msgstr ""
+msgstr "Es gab ein Problem beim Abspielen des Streams"
msgctxt "#30044"
msgid "Some shows are known to not work. Please file a bug if the show is available and works in the official app."
-msgstr ""
+msgstr "Einige Sendungen laufen leider nicht. Bitte senden Sie einen Bugreport, sofern die Sendung verfügbar ist und in der offiziellen App funktioniert."
msgctxt "#30045"
msgid "No valid stream URL was found."
-msgstr ""
+msgstr "Es wurde keine gültige URL für den Stream gefunden."
msgctxt "#30046"
msgid "There is currently no data available for this week."
-msgstr ""
+msgstr "Es stehen zur Zeit keine Daten für diese Woche zur Verfügung."
msgctxt "#30047"
msgid "PRESEASON WEEK {0}"
-msgstr ""
+msgstr "PRESEASON WOCHE {0}"
msgctxt "#30048"
msgid "WEEK {0}"
-msgstr ""
+msgstr "WOCHE {0}"
msgctxt "#30049"
msgid "Use InputStream Adaptive"
-msgstr ""
+msgstr "Nutze InputStream Adaptive"
+
+msgctxt "#30050"
+msgid "Please enter the username and password for your NFL Game Pass subscription."
+msgstr "Bitte geben Sie Benutzernamen und Passwort für Ihr NFL Game Pass Abo ein."
diff --git a/plugin.video.nfl.gamepass/resources/language/English/strings.po b/plugin.video.nfl.gamepass/resources/language/resource.language.en_gb/strings.po
index 1f0afc6..071b2c9 100644
--- a/plugin.video.nfl.gamepass/resources/language/English/strings.po
+++ b/plugin.video.nfl.gamepass/resources/language/resource.language.en_gb/strings.po
@@ -94,7 +94,7 @@ msgid "Logging into NFL Game Pass failed. Make sure that your account informatio
msgstr ""
msgctxt "#30024"
-msgid "Unexpected error ='(. Please enable debuging for both the addon and Kodi, and submit a bug report."
+msgid "Unexpected error ='(. Please enable debugging in Kodi and submit a bug report."
msgstr ""
msgctxt "#30025"
@@ -184,3 +184,7 @@ msgstr ""
msgctxt "#30049"
msgid "Use InputStream Adaptive"
msgstr ""
+
+msgctxt "#30050"
+msgid "Please enter the username and password for your NFL Game Pass subscription."
+msgstr ""
diff --git a/plugin.video.nfl.gamepass/resources/language/Japanese/strings.po b/plugin.video.nfl.gamepass/resources/language/resource.language.ja_jp/strings.po
index 77b15d7..55f8ebd 100644
--- a/plugin.video.nfl.gamepass/resources/language/Japanese/strings.po
+++ b/plugin.video.nfl.gamepass/resources/language/resource.language.ja_jp/strings.po
@@ -95,7 +95,7 @@ msgid "Logging into NFL Game Pass failed. Make sure that your account informatio
msgstr "NFL Game Passにログインできませんでした。アカウントの確認、または契約が有効か確認ください。"
msgctxt "#30024"
-msgid "Unexpected error ='(. Please enable debuging for both the addon and Kodi, and submit a bug report."
+msgid "Unexpected error ='(. Please enable debugging in Kodi and submit a bug report."
msgstr "予測不可エラー発生 ( T o T ) このアプリとKodiのデバッグを有効にして、バグをレポートしてください。"
msgctxt "#30025"
@@ -185,3 +185,7 @@ msgstr ""
msgctxt "#30049"
msgid "Use InputStream Adaptive"
msgstr ""
+
+msgctxt "#30050"
+msgid "Please enter the username and password for your NFL Game Pass subscription."
+msgstr ""
diff --git a/plugin.video.nfl.gamepass/resources/language/Dutch/strings.po b/plugin.video.nfl.gamepass/resources/language/resource.language.nl_nl/strings.po
index 7164f27..19ae8c8 100644
--- a/plugin.video.nfl.gamepass/resources/language/Dutch/strings.po
+++ b/plugin.video.nfl.gamepass/resources/language/resource.language.nl_nl/strings.po
@@ -94,7 +94,7 @@ msgid "Logging into NFL Game Pass failed. Make sure that your account informatio
msgstr "Inloggen bij NFL Game Pass is mislukt. Zorg ervoor dat uw accountgegevens correct zijn en uw abonnement geldig is."
msgctxt "#30024"
-msgid "Unexpected error ='(. Please enable debuging for both the addon and Kodi, and submit a bug report."
+msgid "Unexpected error ='(. Please enable debugging in Kodi and submit a bug report."
msgstr "Onverwachte fout ='(. Schakel debug logging in voor zowel de addon als Kodi en verstuur een bug report."
msgctxt "#30025"
@@ -184,3 +184,7 @@ msgstr "WEEK {0}"
msgctxt "#30049"
msgid "Use InputStream Adaptive"
msgstr "Gebruik Inputstream Adaptive"
+
+msgctxt "#30050"
+msgid "Please enter the username and password for your NFL Game Pass subscription."
+msgstr "Vul de gebruikersnaam en wachtwoord in van uw NFL Game Pass abonnement."
diff --git a/plugin.video.nfl.gamepass/resources/language/Russian/strings.po b/plugin.video.nfl.gamepass/resources/language/resource.language.ru_ru/strings.po
index 7f5f6b1..426f2d6 100644
--- a/plugin.video.nfl.gamepass/resources/language/Russian/strings.po
+++ b/plugin.video.nfl.gamepass/resources/language/resource.language.ru_ru/strings.po
@@ -94,7 +94,7 @@ msgid "Logging into NFL Game Pass failed. Make sure that your account informatio
msgstr "Не удалось зайти на NFL Game Pass. Убедитесь, что информация про аккаунт верна и ваша подписка действительна."
msgctxt "#30024"
-msgid "Unexpected error ='(. Please enable debuging for both the addon and Kodi, and submit a bug report."
+msgid "Unexpected error ='(. Please enable debugging in Kodi and submit a bug report."
msgstr "Неожиданная ошибка ='(. Пожалуйста включите дебаг для аддона и Kodi и отправьте баг репорт."
msgctxt "#30025"
@@ -188,3 +188,7 @@ msgstr ""
msgctxt "#30049"
msgid "Use InputStream Adaptive"
msgstr ""
+
+msgctxt "#30050"
+msgid "Please enter the username and password for your NFL Game Pass subscription."
+msgstr ""
diff --git a/plugin.video.nfl.gamepass/resources/language/Ukrainian/strings.po b/plugin.video.nfl.gamepass/resources/language/resource.language.uk_ua/strings.po
index 5de8e67..0b28a25 100644
--- a/plugin.video.nfl.gamepass/resources/language/Ukrainian/strings.po
+++ b/plugin.video.nfl.gamepass/resources/language/resource.language.uk_ua/strings.po
@@ -94,7 +94,7 @@ msgid "Logging into NFL Game Pass failed. Make sure that your account informatio
msgstr "Неможливо увійти до NFL Game Pass. Переконайтесь що інформація про аккаунт корректа і ваша підписка дійсна."
msgctxt "#30024"
-msgid "Unexpected error ='(. Please enable debuging for both the addon and Kodi, and submit a bug report."
+msgid "Unexpected error ='(. Please enable debugging in Kodi and submit a bug report."
msgstr "Неочікувана помилка ='(. Будь ласка ввімкніть дебаг для аддону та Kodi і відправте баг репорт."
msgctxt "#30025"
@@ -188,3 +188,7 @@ msgstr ""
msgctxt "#30049"
msgid "Use InputStream Adaptive"
msgstr ""
+
+msgctxt "#30050"
+msgid "Please enter the username and password for your NFL Game Pass subscription."
+msgstr ""
diff --git a/plugin.video.nfl.gamepass/resources/lib/pigskin.py b/plugin.video.nfl.gamepass/resources/lib/pigskin.py
index 0432993..ac2fe78 100644
--- a/plugin.video.nfl.gamepass/resources/lib/pigskin.py
+++ b/plugin.video.nfl.gamepass/resources/lib/pigskin.py
@@ -221,38 +221,53 @@ class pigskin(object):
try:
url = self.config['modules']['ROUTES_DATA_PROVIDERS']['games_detail'].replace(':seasonType', season_type).replace(':season', season).replace(':week', week)
games_data = self.make_request(url, 'get')
- # collect the games from all keys in 'modules'
- games = [g for x in games_data['modules'].keys() for g in games_data['modules'][x]['content']]
+ # collect the games from all keys in 'modules' that has 'content' as a key
+ games = [g for x in games_data['modules'].keys() if 'content' in games_data['modules'][x] for g in games_data['modules'][x]['content']]
except:
self.log('Acquiring games data failed.')
raise
return sorted(games, key=lambda x: x['gameDateTimeUtc'])
- def has_coaches_tape(self, game_id, season):
- """Return whether coaches tape is available for a given game."""
- url = self.config['modules']['ROUTES_DATA_PROVIDERS']['game_page'].replace(':season', season).replace(':gameslug', game_id)
- response = self.make_request(url, 'get')
- coaches_tape = response['modules']['singlegame']['content'][0]['coachfilmVideo']
- if coaches_tape:
- self.log('Coaches Tape found.')
- return coaches_tape['videoId']
- else:
- self.log('No Coaches Tape found for this game.')
- return False
+ def get_team_games(self, season, team=None):
+ try:
+ url = self.config['modules']['ROUTES_DATA_PROVIDERS']['teams']
+ teams = self.make_request(url, 'get')
+ if team is None:
+ return teams
+ else:
+ # look for the team name
+ for conference in teams['modules']:
+ if 'content' in teams['modules'][conference]:
+ for teamname in teams['modules'][conference]['content']:
+ if team == teamname['fullName']:
+ team = teamname['seoname']
+ break;
+ else:
+ return None
+
+ url = self.config['modules']['ROUTES_DATA_PROVIDERS']['team_detail'].replace(':team', team)
+ games_data = self.make_request(url, 'get')
+ # collect games from all keys in 'modules' for a specific season
+ games = [g for x in games_data['modules'].keys() if x == 'videos'+season for g in games_data['modules'][x]['content']]
+
+ except:
+ self.log('Acquiring Team games data failed.')
+ raise
+ return sorted(games, key=lambda x: x['gameDateTimeUtc'])
- def has_condensed_game(self, game_id, season):
- """Return whether condensed game version is available."""
+ def get_game_versions(self, game_id, season):
+ """Return a dict of available game versions for a single game."""
+ game_versions = {}
url = self.config['modules']['ROUTES_DATA_PROVIDERS']['game_page'].replace(':season', season).replace(':gameslug', game_id)
- response = self.make_request(url, 'get')
- condensed = response['modules']['singlegame']['content'][0]['condensedVideo']
- if condensed:
- self.log('Condensed game found.')
- return condensed['videoId']
- else:
- self.log('No condensed version was found for this game.')
- return False
+ data = self.make_request(url, 'get')['modules']['singlegame']['content'][0]
+ for key in data.keys():
+ if isinstance(data[key], dict) and 'videoId' in data[key]:
+ game_versions[data[key]['kind']] = data[key]['videoId']
+
+ self.log('Game versions found for {0}: {1}'.format(game_id, ', '.join(game_versions.keys())))
+ return game_versions
def get_stream(self, video_id, game_type=None, username=None):
"""Return the URL for a stream."""
@@ -365,8 +380,12 @@ class pigskin(object):
season_slug = [x['slug'] for x in selected_show['seasons'] if season == x['value']][0]
request_url = self.config['modules']['API']['NETWORK_EPISODES']
episodes_url = request_url.replace(':seasonSlug', season_slug).replace(':tvShowSlug', selected_show['slug'])
+ episodes_data = self.make_request(episodes_url, 'get')['modules']['archive']['content']
+ for episode in episodes_data:
+ if not episode['videoThumbnail']['templateUrl']: # set programs thumbnail as episode thumbnail
+ episode['videoThumbnail']['templateUrl'] = [x['thumbnail']['templateUrl'] for x in programs if x['slug'] == episode['nflprogram']][0]
- return self.make_request(episodes_url, 'get')['modules']['archive']['content']
+ return episodes_data
def parse_datetime(self, date_string, localize=False):
"""Parse NFL Game Pass date string to datetime object."""
diff --git a/plugin.video.nfl.gamepass/resources/settings.xml b/plugin.video.nfl.gamepass/resources/settings.xml
index 0b0a6a3..dbbc5b7 100644
--- a/plugin.video.nfl.gamepass/resources/settings.xml
+++ b/plugin.video.nfl.gamepass/resources/settings.xml
@@ -6,7 +6,7 @@
<category label="30030">
<setting id="use_inputstream_adaptive" type="bool" label="30049" default="false"/>
<setting id="preferred_bitrate" type="select" label="30003" lvalues="30004|30005|30006|30007|30008|30009|30010|30011|30012" visible="eq(-1,false)" default="8"/>
- <setting id="preferred_game_version" type="select" label="30013" lvalues="30014|30015|30012" default="0"/>
+ <setting id="preferred_game_version" type="select" label="30013" lvalues="30014|30015|30032|30012" default="3"/>
<setting id="time_notation" type="enum" label="30020" lvalues="30027|30028" default="1"/>
<setting id="hide_game_length" type="bool" label="30025" default="false"/>
</category>