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 list_play(self): | |
# xbmc.log(str(tmdb_id)+'===>TMDB_HELPER_3', level=xbmc.LOGNOTICE) | |
tmdb_id = '' | |
if self.params.get('query') and self.params.get('type') == 'episode': | |
tmdb_id = self.tmdb.get_tmdb_id(itemtype='tv', query=self.params.get('query')) | |
if self.params.get('query') and self.params.get('type') == 'movie': | |
movie_title = self.params.get('query') | |
movie_year = self.params.get('year') | |
tmdb_id = self.tmdb.get_tmdb_id(itemtype='movie', query=self.params.get('query')) |
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, itemtype, tmdb_id, season=None, episode=None): | |
self.itemtype, self.tmdb_id, self.season, self.episode = itemtype, tmdb_id, season, episode | |
self.tmdbtype = 'tv' if self.itemtype in ['episode', 'tv'] else 'movie' | |
self.details = self.tmdb.get_detailed_item(self.tmdbtype, tmdb_id, season=season, episode=episode) | |
self.item['imdb_id'] = self.details.get('infolabels', {}).get('imdbnumber') | |
self.item['originaltitle'] = self.details.get('infolabels', {}).get('originaltitle') | |
self.item['title'] = self.details.get('infolabels', {}).get('tvshowtitle') or self.details.get('infolabels', {}).get('title') | |
self.item['year'] = self.details.get('infolabels', {}).get('year') | |
is_local = False | |
# if self.details and self.itemtype == 'movie': |
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 get_recentlywatched(self, userslug, tmdbtype, limit=None, islistitem=True, months=360): | |
start_at = datetime.date.today() - datetime.timedelta(months * 365 / 12) | |
history = self.get_response_json('users', userslug, 'history', utils.type_convert(tmdbtype, 'trakt') + 's', page=1, limit=10000, start_at=start_at.strftime("%Y-%m-%d")) | |
return self.get_limitedlist(history, tmdbtype, limit, islistitem) | |
def get_inprogress(self, userslug, limit=None, episodes=False): | |
""" | |
Looks at user's most recently watched 200 episodes in last 3 years | |
Adds each unique show to list in order then checks if show has an upnext episode |
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 get_sortedlist2(self, items): | |
items = sorted(items, key=lambda x: x['infolabels']['premiered'], reverse=True) | |
# for i in items2: | |
# xbmc.log(str(i.infolabels['premiered'])+'===>TMDB HELPER', level=xbmc.LOGNOTICE) | |
if not items: | |
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
##################################### | |
LANGUAGES = [ | |
{'id': '', 'name': ''}, | |
{'id': 'bg', 'name': 'Bulgarian'}, | |
{'id': 'cs', 'name': 'Czech'}, | |
{'id': 'da', 'name': 'Danish'}, | |
{'id': 'de', 'name': 'German'}, | |
{'id': 'el', 'name': 'Greek'}, | |
{'id': 'en', 'name': 'English'}, | |
{'id': 'es', 'name': 'Spanish'}, |
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
listitems = ['Play'] | |
listitems += ['Play - Foxy Streams'] | |
selection = xbmcgui.Dialog().select(heading='Choose option', list=listitems) | |
if selection == 0: | |
url = 'plugin://plugin.video.openmeta/tv/play/%s/%s/%s' % (Utils.fetch(TheMovieDB.get_tvshow_ids(self.tvshow_id), 'tvdb_id'), self.info['season'], episode_id) | |
if self.listitem.getProperty('dbid'): | |
dbid = self.listitem.getProperty('dbid') | |
else: | |
dbid = 0 | |
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
import xbmc, xbmcgui | |
from resources.lib import Utils | |
from resources.lib.WindowManager import wm | |
####################################################################################### | |
def play_media(self, url, listitem, window=False): | |
# super(VideoPlayer, self).play(item=url, listitem=listitem, windowed=False, startpos=-1) | |
xbmc.executebuiltin('PlayMedia(%s)' % url) | |
Utils.hide_busy() |
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) |
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
results = Utils.get_JSON_response(url=url, cache_days=0.5, folder='YouTube') | |
try: | |
videos = handle_youtube_videos(results['items'], extended=extended) | |
except: | |
return {} |