Skip to content

Instantly share code, notes, and snippets.

@henryjfry
Created February 19, 2020 18:40
Show Gist options
  • Save henryjfry/06c3b42c59381572f24a99eed9876ebc to your computer and use it in GitHub Desktop.
Save henryjfry/06c3b42c59381572f24a99eed9876ebc to your computer and use it in GitHub Desktop.
Playlist/STRM better play command - TMDBHelper => /home/osmc/.kodi/addons/plugin.video.themoviedb.helper/resources/lib/container.py
##kodi-send --action='RunPlugin(plugin://plugin.video.themoviedb.helper?info=play2&type=episode&tmdb_id=95&season=1&episode=1)'
###/home/osmc/.kodi/addons/plugin.video.themoviedb.helper/resources/lib/container.py
if self.params.get('info') == 'play2':
import os
addon_handle = self.handle
xbmc.log(str(xbmcgui.getCurrentWindowDialogId())+'===>TMDBHelper', level=xbmc.LOGNOTICE)
if os.path.exists('/home/osmc/' + self.paramstring):
xbmc.log('File Exists Exiting '+'===>TMDBHelper', level=xbmc.LOGNOTICE)
xbmcplugin.endOfDirectory(addon_handle, updateListing=False, cacheToDisc=False)
exit()
xbmc.executebuiltin('ActivateWindow(busydialognocancel)')
type = self.params.get('type')
episode = self.params.get('episode')
season = self.params.get('season')
year = self.params.get('year')
params = self.params
if self.params.get('type') == 'episode':
params = self.params.copy()
params['type'] = 'tv'
tmdb_id_no = self.get_tmdb_id(**params)
xbmc.log(str('/home/osmc/' + self.paramstring)+'===>TMDBHelper', level=xbmc.LOGNOTICE)
if not os.path.exists('/home/osmc/' + self.paramstring):
from resources.lib.player import Player
f= open('/home/osmc/' + self.paramstring,"w+")
xbmcplugin.endOfDirectory(addon_handle, updateListing=False, cacheToDisc=False)
if type == 'episode':
Player().play(itemtype='episode', tmdb_id=tmdb_id_no, season=season, episode=episode)
if type == 'movie':
Player().play(itemtype='movie', tmdb_id=tmdb_id_no)
"""
xbmc.log(str('While...')+'===>TMDBHelper', level=xbmc.LOGNOTICE)
while not 'Play with ' in xbmc.getInfoLabel('System.CurrentControl') or not 'Search ' in xbmc.getInfoLabel('System.CurrentControl'):
xbmc.sleep(1000)
xbmc.log(str(xbmc.getInfoLabel('System.CurrentControl'))+'===>TMDBHelper', level=xbmc.LOGNOTICE)
if 'Play with ' in xbmc.getInfoLabel('System.CurrentControl'):
break
if 'Search ' in xbmc.getInfoLabel('System.CurrentControl'):
break
xbmc.log(str('After While ')+'===>TMDBHelper', level=xbmc.LOGNOTICE)
"""
f.close
try:
os.remove('/home/osmc/' + self.paramstring)
except:
pass
xbmc.executebuiltin('Dialog.Close(busydialognocancel)')
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment