diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index 77b8762..e44a0d5 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -15,11 +15,11 @@ msgid "Browse through the movie-catalogue" msgstr "" msgctxt "#30005" -msgid "Series" +msgid "Shorties" msgstr "" msgctxt "#30006" -msgid "Browse through the series-catalogue" +msgid "Browse through the shorties-catalogue" msgstr "" msgctxt "#30007" diff --git a/resources/language/resource.language.nl_nl/strings.po b/resources/language/resource.language.nl_nl/strings.po index edb1eb2..3f2924f 100644 --- a/resources/language/resource.language.nl_nl/strings.po +++ b/resources/language/resource.language.nl_nl/strings.po @@ -17,12 +17,12 @@ msgid "Browse through the movie-catalogue" msgstr "Doorblader de filmcatalogus" msgctxt "#30005" -msgid "Series" -msgstr "Programma's" +msgid "Shorties" +msgstr "Shorties" msgctxt "#30006" -msgid "Browse through the series-catalogue" -msgstr "Doorblader de programmacatalogus" +msgid "Browse through the shorties-catalogue" +msgstr "Doorblader de shortiescatalogus" msgctxt "#30007" msgid "Channels" diff --git a/resources/lib/modules/catalog.py b/resources/lib/modules/catalog.py index b96c506..a3118d0 100644 --- a/resources/lib/modules/catalog.py +++ b/resources/lib/modules/catalog.py @@ -8,7 +8,7 @@ from resources.lib import kodiutils from resources.lib.modules import CHANNELS from resources.lib.modules.menu import Menu -from resources.lib.vtmgo import STOREFRONT_MAIN, STOREFRONT_MOVIES, STOREFRONT_SERIES, Category +from resources.lib.vtmgo import STOREFRONT_MAIN, STOREFRONT_MOVIES, STOREFRONT_SHORTIES, Category from resources.lib.vtmgo.exceptions import UnavailableException from resources.lib.vtmgo.vtmgo import CACHE_PREVENT, ApiUpdateRequired, VtmGo from resources.lib.vtmgo.vtmgoauth import VtmGoAuth @@ -144,8 +144,8 @@ def show_recommendations(self, storefront): else: listing.append(Menu.generate_titleitem(item)) - if storefront == STOREFRONT_SERIES: - label = 30005 # Series + if storefront == STOREFRONT_SHORTIES: + label = 30005 # Shorties elif storefront == STOREFRONT_MOVIES: label = 30003 # Movies else: @@ -174,7 +174,7 @@ def show_recommendations_category(self, storefront, category): for item in result.content: listing.append(Menu.generate_titleitem(item)) - if storefront == STOREFRONT_SERIES: + if storefront == STOREFRONT_SHORTIES: content = 'tvshows' elif storefront == STOREFRONT_MOVIES: content = 'movies' diff --git a/resources/lib/modules/menu.py b/resources/lib/modules/menu.py index afb1c7a..f1e3a25 100644 --- a/resources/lib/modules/menu.py +++ b/resources/lib/modules/menu.py @@ -7,7 +7,7 @@ from resources.lib import kodiutils from resources.lib.modules import CHANNELS -from resources.lib.vtmgo import STOREFRONT_KIDS, STOREFRONT_MAIN, STOREFRONT_MOVIES, STOREFRONT_SERIES, Episode, Movie, Program +from resources.lib.vtmgo import STOREFRONT_KIDS, STOREFRONT_MAIN, STOREFRONT_MOVIES, STOREFRONT_SHORTIES, Episode, Movie, Program from resources.lib.vtmgo.vtmgo import CONTENT_TYPE_MOVIE, CONTENT_TYPE_PROGRAM _LOGGER = logging.getLogger(__name__) @@ -61,8 +61,8 @@ def show_mainmenu(): )) listing.append(kodiutils.TitleItem( - title=kodiutils.localize(30005), # Series - path=kodiutils.url_for('show_recommendations', storefront=STOREFRONT_SERIES), + title=kodiutils.localize(30005), # Shorties + path=kodiutils.url_for('show_recommendations', storefront=STOREFRONT_SHORTIES), art_dict=dict( icon='DefaultTVShows.png', fanart=kodiutils.get_addon_info('fanart'), diff --git a/resources/lib/vtmgo/__init__.py b/resources/lib/vtmgo/__init__.py index 3195793..083e0d5 100644 --- a/resources/lib/vtmgo/__init__.py +++ b/resources/lib/vtmgo/__init__.py @@ -9,7 +9,7 @@ # These seem to be hardcoded STOREFRONT_MAIN = 'main' STOREFRONT_MOVIES = 'movies' -STOREFRONT_SERIES = 'series' +STOREFRONT_SHORTIES = 'shorties' STOREFRONT_KIDS = 'kids' diff --git a/resources/lib/vtmgo/util.py b/resources/lib/vtmgo/util.py index 21cefeb..763d2f3 100644 --- a/resources/lib/vtmgo/util.py +++ b/resources/lib/vtmgo/util.py @@ -17,11 +17,11 @@ # Setup a static session that can be reused for all calls SESSION = requests.Session() SESSION.headers = { - 'User-Agent': 'VTMGO/12.12 (be.vmma.vtm.zenderapp; build:16424; Android 24) okhttp/4.9.3', - 'x-app-version': '12', + 'User-Agent': 'VTM_GO/13.8 (be.vmma.vtm.zenderapp; build:17133; Android TV 28) okhttp/4.10.0', + 'x-app-version': '13', 'x-persgroep-mobile-app': 'true', 'x-persgroep-os': 'android', - 'x-persgroep-os-version': '24', + 'x-persgroep-os-version': '28', } PROXIES = kodiutils.get_proxies() diff --git a/resources/lib/vtmgo/vtmgo.py b/resources/lib/vtmgo/vtmgo.py index 1fab272..434fa65 100644 --- a/resources/lib/vtmgo/vtmgo.py +++ b/resources/lib/vtmgo/vtmgo.py @@ -40,7 +40,7 @@ def __init__(self, tokens): def _mode(self): """ Return the mode that should be used for API calls """ - return 'vtmgo-kids' if self.get_product() == 'VTM_GO_KIDS' else 'vtmgo' + return 'vtmgo-kids' if self.get_product() == 'VTM_GO_KIDS' else 'VTM_GO' @staticmethod def get_config(): @@ -246,7 +246,7 @@ def get_program(self, program_id, cache=CACHE_AUTO): if not program: # Fetch from API - response = util.http_get(API_ENDPOINT + '/%s/programs/%s' % (self._mode(), program_id), + response = util.http_get(API_ENDPOINT + '/%s/detail/%s' % (self._mode(), program_id), token=self._tokens.access_token if self._tokens else None, profile=self._tokens.profile if self._tokens else None) program = json.loads(response.text) @@ -259,10 +259,10 @@ def get_program(self, program_id, cache=CACHE_AUTO): episodes = {} # Fetch season - season_response = util.http_get(API_ENDPOINT + '/%s/programs/%s/seasons/%s' % (self._mode(), program_id, item_season), + season_response = util.http_get(API_ENDPOINT + '/%s/detail/%s?selectedSeasonIndex=%s' % (self._mode(), program_id, item_season), token=self._tokens.access_token if self._tokens else None, profile=self._tokens.profile if self._tokens else None) - season = json.loads(season_response.text) + season = json.loads(season_response.text).get('selectedSeason') for item_episode in season.get('episodes', []): episodes[item_episode.get('index')] = Episode( @@ -274,8 +274,8 @@ def get_program(self, program_id, cache=CACHE_AUTO): name=item_episode.get('name'), description=item_episode.get('description'), duration=item_episode.get('durationSeconds'), - thumb=item_episode.get('bigPhotoUrl'), - fanart=item_episode.get('bigPhotoUrl'), + thumb=item_episode.get('imageUrl'), + fanart=item_episode.get('imageUrl'), geoblocked=program.get('blockedFor') == 'GEO', remaining=item_episode.get('remainingDaysAvailable'), channel=channel, diff --git a/resources/lib/vtmgo/vtmgoauth.py b/resources/lib/vtmgo/vtmgoauth.py index e649392..1add415 100644 --- a/resources/lib/vtmgo/vtmgoauth.py +++ b/resources/lib/vtmgo/vtmgoauth.py @@ -118,7 +118,7 @@ def authorize_check(self): self._account.refresh_token = auth_info.get('refresh_token') # Fetch an actual token we can use - response = util.http_post('https://lfvp-api.dpgmedia.net/vtmgo/tokens', data={ + response = util.http_post('https://lfvp-api.dpgmedia.net/VTM_GO/tokens', data={ 'device': { 'id': str(uuid.uuid4()), 'name': 'VTM Go Addon on Kodi', @@ -142,7 +142,7 @@ def get_tokens(self): return self._account # We can refresh our old token so it's valid again - response = util.http_post('https://lfvp-api.dpgmedia.net/vtmgo/tokens/refresh', data={ + response = util.http_post('https://lfvp-api.dpgmedia.net/VTM_GO/tokens/refresh', data={ 'lfvpToken': self._account.access_token, }) @@ -158,9 +158,9 @@ def get_tokens(self): return self._account - def get_profiles(self, products='VTM_GO,VTM_GO_KIDS'): + def get_profiles(self): """ Returns the available profiles """ - response = util.http_get(API_ENDPOINT + '/profiles', {'products': products}, token=self._account.access_token) + response = util.http_get(API_ENDPOINT + '/VTM_GO/profiles', token=self._account.access_token) result = json.loads(response.text) profiles = [ @@ -173,7 +173,7 @@ def get_profiles(self, products='VTM_GO,VTM_GO_KIDS'): color=profile.get('color', {}).get('start'), color2=profile.get('color', {}).get('end'), ) - for profile in result + for profile in result.get('profiles') ] return profiles diff --git a/tests/test_api.py b/tests/test_api.py index 3f41b8f..7356c1d 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -11,7 +11,7 @@ from resources.lib import kodiutils from resources.lib.modules.player import Player -from resources.lib.vtmgo import STOREFRONT_MAIN, STOREFRONT_MOVIES, STOREFRONT_SERIES, Category +from resources.lib.vtmgo import STOREFRONT_MAIN, STOREFRONT_MOVIES, STOREFRONT_SHORTIES, Category from resources.lib.vtmgo.vtmgo import VtmGo from resources.lib.vtmgo.vtmgoauth import VtmGoAuth @@ -43,7 +43,7 @@ def test_recommendations(self): results = self.api.get_storefront(STOREFRONT_MOVIES) self.assertIsInstance(results, list) - results = self.api.get_storefront(STOREFRONT_SERIES) + results = self.api.get_storefront(STOREFRONT_SHORTIES) self.assertIsInstance(results, list) def test_mylist(self):