Created
January 19, 2020 13:07
-
-
Save henryjfry/f801b1824904aef13bac91019c33a565 to your computer and use it in GitHub Desktop.
Openmeta + Context menu - TMDB Helper ~/.kodi/addons/plugin.video.openmeta/context3.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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&tvdb_id=70726&type=episode&season=5&episode=1)' | |
#kodi-send --action='RunPlugin(plugin://plugin.video.themoviedb.helper?info=play&query=Mr.+Robot&type=episode&season=4&episode=13)' | |
#kodi-send --action='RunPlugin(plugin://plugin.video.themoviedb.helper?info=play&query=The Abyss&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&query=%s&type=episode&season=%s&episode=%s' % (base, tv_title, season, episode) | |
if type == 'movie': | |
url = '%s?info=play&query=%s&type=movie&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