Skip to content

Commit 12993a0

Browse files
Fix recommendations (#377)
1 parent 622bfe7 commit 12993a0

2 files changed

Lines changed: 17 additions & 31 deletions

File tree

resources/lib/vtmgo/vtmgo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def get_storefront_category(self, storefront, category):
107107
result = json.loads(response.text)
108108

109109
items = []
110-
for item in result.get('teasers'):
110+
for item in result.get('row', {}).get('teasers'):
111111
if item.get('target', {}).get('type') == CONTENT_TYPE_MOVIE:
112112
items.append(self._parse_movie_teaser(item))
113113

@@ -129,7 +129,7 @@ def get_mylist(self, content_filter=None, cache=CACHE_ONLY):
129129
result = json.loads(response.text)
130130

131131
items = []
132-
for item in result.get('teasers'):
132+
for item in result.get('teasers', []):
133133
if item.get('target', {}).get('type') == CONTENT_TYPE_MOVIE and content_filter in [None, Movie]:
134134
items.append(self._parse_movie_teaser(item, cache=cache))
135135

resources/lib/vtmgo/vtmgostream.py

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
class VtmGoStream:
1919
""" VTM GO Stream API """
2020

21-
_V5_API_KEY = '3vjmWnsxF7SUTeNCBZlnUQ4Z7GQV8f6miQ514l10'
2221
_V6_API_KEY = 'r9EOnHOp1pPL5L4FuGzBPSIHwrQnPu5TBfW16y75'
2322

2423
def __init__(self, tokens=None):
@@ -160,34 +159,21 @@ def _get_video_info(self, strtype, stream_id, player_token):
160159
"""
161160
url = 'https://videoplayer-service.dpgmedia.net/config/%s/%s' % (strtype, stream_id)
162161
_LOGGER.debug('Getting video info from %s', url)
163-
# Live channels: Fallback to old Popcorn SDK 5 for Kodi 19 and lower, because new livestream format is not supported
164-
if kodiutils.kodi_version_major() <= 19 and strtype == 'channels':
165-
response = util.http_get(url,
166-
params={
167-
'startPosition': '0.0',
168-
'autoPlay': 'true',
169-
},
170-
headers={
171-
'Accept': 'application/json',
172-
'x-api-key': self._V5_API_KEY,
173-
'Popcorn-SDK-Version': '5',
174-
})
175-
else:
176-
response = util.http_post(url,
177-
params={
178-
'startPosition': '0.0',
179-
'autoPlay': 'true',
180-
},
181-
data={
182-
'deviceType': 'android-tv',
183-
'zone': 'vtmgo',
184-
},
185-
headers={
186-
'Accept': 'application/json',
187-
'x-api-key': self._V6_API_KEY,
188-
'Popcorn-SDK-Version': '6',
189-
'Authorization': 'Bearer ' + player_token,
190-
})
162+
response = util.http_post(url,
163+
params={
164+
'startPosition': '0.0',
165+
'autoPlay': 'true',
166+
},
167+
data={
168+
'deviceType': 'android-tv',
169+
'zone': 'vtmgo',
170+
},
171+
headers={
172+
'Accept': 'application/json',
173+
'x-api-key': self._V6_API_KEY,
174+
'Popcorn-SDK-Version': '6',
175+
'Authorization': 'Bearer ' + player_token,
176+
})
191177

192178
info = json.loads(response.text)
193179
return info

0 commit comments

Comments
 (0)