Skip to content

Commit

Permalink
Add more metadata to stream (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelarnauts authored Sep 18, 2019
1 parent ab4edab commit 1de4173
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 13 deletions.
38 changes: 25 additions & 13 deletions resources/lib/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,27 +681,39 @@ def _stream(strtype, strid):
if resolved_stream is None: # If no stream is available (i.e. geo-blocked)
return

# Create listitem
listitem = ListItem(path=resolved_stream.url, offscreen=True)

# Lookup metadata
_vtmgo = VtmGo()
if strtype == 'movies':
details = _vtmgo.get_movie(strid)
description = details.description
listitem.setInfo('video', {
'tvshowtitle': resolved_stream.program,
'title': resolved_stream.title,
'duration': resolved_stream.duration,
'subtitle': details.description,
'plot': details.description,
'mediatype': details.mediatype
})
elif strtype == 'episodes':
details = _vtmgo.get_episode(strid)
description = details.description
listitem.setInfo('video', {
'tvshowtitle': resolved_stream.program,
'title': resolved_stream.title,
'duration': resolved_stream.duration,
'subtitle': details.description,
'plot': details.description,
'season': details.season,
'episode': details.number,
'mediatype': details.mediatype
})
else:
description = None

# Create listitem
listitem = ListItem(path=resolved_stream.url, offscreen=True)
listitem.setInfo('video', {
'title': resolved_stream.title,
'tvshowtitle': resolved_stream.program,
})

# Add video info
listitem.setInfo('video', {
'title': resolved_stream.title,
'tvshowtitle': resolved_stream.program,
'plot': description,
'duration': resolved_stream.duration,
})
listitem.addStreamInfo('video', {
'duration': resolved_stream.duration,
})
Expand Down
3 changes: 3 additions & 0 deletions resources/lib/vtmgostream.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ def __init__(self, program=None, title=None, duration=None, url=None, license_ur
self.subtitles = subtitles
self.cookies = cookies

def __repr__(self):
return "%r" % self.__dict__


class VtmGoStream:
_VTM_API_KEY = 'zTxhgTEtb055Ihgw3tN158DZ0wbbaVO86lJJulMl'
Expand Down

0 comments on commit 1de4173

Please sign in to comment.