Skip to content

Commit

Permalink
Fix recommendations (#377)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelarnauts committed Feb 26, 2024
1 parent 622bfe7 commit 12993a0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 31 deletions.
4 changes: 2 additions & 2 deletions resources/lib/vtmgo/vtmgo.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def get_storefront_category(self, storefront, category):
result = json.loads(response.text)

items = []
for item in result.get('teasers'):
for item in result.get('row', {}).get('teasers'):
if item.get('target', {}).get('type') == CONTENT_TYPE_MOVIE:
items.append(self._parse_movie_teaser(item))

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

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

Expand Down
44 changes: 15 additions & 29 deletions resources/lib/vtmgo/vtmgostream.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
class VtmGoStream:
""" VTM GO Stream API """

_V5_API_KEY = '3vjmWnsxF7SUTeNCBZlnUQ4Z7GQV8f6miQ514l10'
_V6_API_KEY = 'r9EOnHOp1pPL5L4FuGzBPSIHwrQnPu5TBfW16y75'

def __init__(self, tokens=None):
Expand Down Expand Up @@ -160,34 +159,21 @@ def _get_video_info(self, strtype, stream_id, player_token):
"""
url = 'https://videoplayer-service.dpgmedia.net/config/%s/%s' % (strtype, stream_id)
_LOGGER.debug('Getting video info from %s', url)
# Live channels: Fallback to old Popcorn SDK 5 for Kodi 19 and lower, because new livestream format is not supported
if kodiutils.kodi_version_major() <= 19 and strtype == 'channels':
response = util.http_get(url,
params={
'startPosition': '0.0',
'autoPlay': 'true',
},
headers={
'Accept': 'application/json',
'x-api-key': self._V5_API_KEY,
'Popcorn-SDK-Version': '5',
})
else:
response = util.http_post(url,
params={
'startPosition': '0.0',
'autoPlay': 'true',
},
data={
'deviceType': 'android-tv',
'zone': 'vtmgo',
},
headers={
'Accept': 'application/json',
'x-api-key': self._V6_API_KEY,
'Popcorn-SDK-Version': '6',
'Authorization': 'Bearer ' + player_token,
})
response = util.http_post(url,
params={
'startPosition': '0.0',
'autoPlay': 'true',
},
data={
'deviceType': 'android-tv',
'zone': 'vtmgo',
},
headers={
'Accept': 'application/json',
'x-api-key': self._V6_API_KEY,
'Popcorn-SDK-Version': '6',
'Authorization': 'Bearer ' + player_token,
})

info = json.loads(response.text)
return info
Expand Down

0 comments on commit 12993a0

Please sign in to comment.