Skip to content

Instantly share code, notes, and snippets.

@henryjfry
henryjfry / DialogBaseList.py
Last active June 19, 2020 19:11
~/.kodi/addons/script.extendedinfo/resources/lib/DialogBaseList.py => urllib error
import xbmc, xbmcgui, xbmcaddon, urllib
#########
def add_filter(self, key, value, typelabel, label, force_overwrite=False):
index = -1
new_filter = {
'id': value,
'type': key,
'typelabel': typelabel,
@henryjfry
henryjfry / DialogVideoList.py
Last active October 25, 2019 12:59
~/.kodi/addons/script.extendedinfo/resources/lib/DialogVideoList.py => Genre Multi Select
###########################
#change play behaviour for movies for greater speed + show_busy/hide_busy
###########################
@ch.action('contextmenu', 500)
def context_menu(self):
if self.listitem.getProperty('dbid') and self.listitem.getProperty('dbid') != 0:
dbid = self.listitem.getProperty('dbid')
else:
dbid = 0
@henryjfry
henryjfry / DialogVideoInfo.py
Created October 25, 2019 13:01
~/.kodi/addons/script.extendedinfo/resources/lib/DialogVideoInfo.py => change movie play behaviour for speed + show_busy/hide_busy
@ch.click(8)
def play_movie(self):
Utils.show_busy()
url = 'plugin://plugin.video.openmeta/movies/play/tmdb/%s' % self.info.get('id', '')
Utils.hide_busy()
xbmc.executebuiltin('RunPlugin(%s)' % url)
# if self.dbid and int(self.dbid) > 0:
# dbid = self.dbid
# url = ''
# PLAYER.play_from_button(url, listitem=None, window=self, type='movieid', dbid=dbid)
@henryjfry
henryjfry / DialogEpisodeInfo.py
Created October 25, 2019 13:02
/home/osmc/.kodi/addons/script.extendedinfo/resources/lib/DialogEpisodeInfo.py => change episode play behaviour for speed + show_busy/hide_busy
@ch.click(8)
def play_episode(self):
Utils.show_busy()
url = 'plugin://plugin.video.openmeta/tv/play/%s/%s/%s' % (Utils.fetch(TheMovieDB.get_tvshow_ids(self.tvshow_id), 'tvdb_id'), self.info['season'], self.info['episode'])
Utils.hide_busy()
xbmc.executebuiltin('RunPlugin(%s)' % url)
# if self.dbid and int(self.dbid) > 0:
# dbid = self.dbid
# url = ''
# PLAYER.play_from_button(url, listitem=None, window=self, type='episodeid', dbid=dbid)
@henryjfry
henryjfry / VideoPlayer.py
Created October 28, 2019 21:20
/home/osmc/.kodi/addons/script.extendedinfo/resources/lib/VideoPlayer.py
def play(self, url, listitem, window=False):
super(VideoPlayer, self).play(item=url, listitem=listitem, windowed=False, startpos=-1)
for i in range(30):
if xbmc.getCondVisibility('VideoPlayer.IsFullscreen'):
if window and window.window_type == 'dialog':
wm.add_to_stack(window)
window.close()
self.wait_for_video_end()
return wm.pop_stack()
xbmc.sleep(1000)
@henryjfry
henryjfry / DialogSeasonInfo.py
Created October 28, 2019 21:22
/home/osmc/.kodi/addons/script.extendedinfo/resources/lib/DialogSeasonInfo.py
@ch.action('contextmenu', 2000)
def context_menu(self):
Utils.show_busy()
if self.listitem.getProperty('dbid') and self.listitem.getProperty('dbid') != 0:
dbid = self.listitem.getProperty('dbid')
else:
dbid = 0
item_id = self.listitem.getProperty('id')
episode_id = self.listitem.getProperty('episode')
# xbmc.log(str(dbid)+'===>OPENINFO', level=xbmc.LOGNOTICE)
@henryjfry
henryjfry / DialogVideoList.py
Created October 28, 2019 21:23
/home/osmc/.kodi/addons/script.extendedinfo/resources/lib/DialogVideoList.py
@ch.action('contextmenu', 500)
def context_menu(self):
Utils.show_busy()
if self.listitem.getProperty('dbid') and self.listitem.getProperty('dbid') != 0:
dbid = self.listitem.getProperty('dbid')
else:
dbid = 0
item_id = self.listitem.getProperty('id')
if self.type == 'tv':
imdb_id = Utils.fetch(TheMovieDB.get_tvshow_ids(item_id), 'imdb_id')
@henryjfry
henryjfry / YouTube.py
Created December 8, 2019 15:49
OPENINFO Youtube error - /home/osmc/.kodi/addons/script.extendedinfo/resources/lib/YouTube.py
results = Utils.get_JSON_response(url=url, cache_days=0.5, folder='YouTube')
try:
videos = handle_youtube_videos(results['items'], extended=extended)
except:
return {}
@henryjfry
henryjfry / DialogEpisodeInfo.py
Created December 18, 2019 21:49
script.extendedinfo/resources/lib/DialogEpisodeInfo.py MODAL
@ch.click(8)
def play_episode(self):
Utils.show_busy()
url = 'plugin://plugin.video.openmeta/tv/play/%s/%s/%s' % (Utils.fetch(TheMovieDB.get_tvshow_ids(self.tvshow_id), 'tvdb_id'), self.info['season'], self.info['episode'])
Utils.hide_busy()
xbmc.executebuiltin('RunPlugin(%s)' % url)
# if self.dbid and int(self.dbid) > 0:
# dbid = self.dbid
# url = ''
# PLAYER.play(url, listitem=None, window=self, type='episodeid', dbid=dbid)
@henryjfry
henryjfry / play_tvshows.py + TheTVDB.py
Created December 21, 2019 11:34
OPENMETA - Missing Durtation? (/home/osmc/.kodi/addons/plugin.video.openmeta/resources/lib)
TheTVDB.py
#############################################
def __getitem__(self, key):
if key in self:
return dict.__getitem__(self, key)
if key in self.data:
try:
return dict.__getitem__(self.data, key)