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
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, |
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
########################### | |
#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 |
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
@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) |
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
@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) |
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
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) |
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
@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) |
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
@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') |
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
results = Utils.get_JSON_response(url=url, cache_days=0.5, folder='YouTube') | |
try: | |
videos = handle_youtube_videos(results['items'], extended=extended) | |
except: | |
return {} |
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
@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) |
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
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) |