Skip to content

Instantly share code, notes, and snippets.

@henryjfry
Created January 19, 2020 13:07
Show Gist options
  • Save henryjfry/f801b1824904aef13bac91019c33a565 to your computer and use it in GitHub Desktop.
Save henryjfry/f801b1824904aef13bac91019c33a565 to your computer and use it in GitHub Desktop.
Openmeta + Context menu - TMDB Helper ~/.kodi/addons/plugin.video.openmeta/context3.py
sudo systemctl stop mediacenter
##addon.xml
<item library="context3.py">
<label>TMDB Helper - Play</label>
<visible>String.IsEqual(ListItem.dbtype,movie) | String.IsEqual(ListItem.dbtype,episode)</visible>
</item>
##addon.xml
sudo systemctl start mediacenter
###
import sys
import xbmc
#RunScript(plugin.video.themoviedb.helper,play=episode,tmdb_id=49011,season=7,episode=12)
#kodi-send --action='RunPlugin(plugin://plugin.video.themoviedb.helper?info=play&amp;tvdb_id=70726&amp;type=episode&amp;season=5&amp;episode=1)'
#kodi-send --action='RunPlugin(plugin://plugin.video.themoviedb.helper?info=play&amp;query=Mr.+Robot&amp;type=episode&amp;season=4&amp;episode=13)'
#kodi-send --action='RunPlugin(plugin://plugin.video.themoviedb.helper?info=play&amp;query=The Abyss&amp;year=1989)'
if __name__ == '__main__':
xbmc.executebuiltin('ActivateWindow(busydialognocancel)')
base = 'plugin://plugin.video.themoviedb.helper'
info = sys.listitem.getVideoInfoTag()
type = info.getMediaType()
movie_title = info.getTitle()
year = info.getYear()
tv_title = info.getTVShowTitle()
season = info.getSeason()
episode = info.getEpisode()
# xbmc.log(str(movie_title)+'===>TMDB_HELPER_3', level=xbmc.LOGNOTICE)
if type == 'episode':
url = '%s?info=play&amp;query=%s&amp;type=episode&amp;season=%s&amp;episode=%s' % (base, tv_title, season, episode)
if type == 'movie':
url = '%s?info=play&amp;query=%s&amp;type=movie&amp;year=%s' % (base, movie_title, year)
# xbmc.executebuiltin('Dialog.Close(busydialognocancel)')
xbmc.log(str(url)+'===>TMDB_HELPER_3', level=xbmc.LOGNOTICE)
xbmc.executebuiltin('RunPlugin(%s)' % url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment