- Chiusura finestra server dopo standby
- Menu contestuale in finestra server - Piccoli fix deltabit e uqloads - Piccolo fix gestione viste - Fix gestione salva link
This commit is contained in:
+2
-2
@@ -355,7 +355,7 @@ class Item(object):
|
|||||||
dump = "".encode("utf8")
|
dump = "".encode("utf8")
|
||||||
return str(urllib.quote(base64.b64encode(dump)))
|
return str(urllib.quote(base64.b64encode(dump)))
|
||||||
|
|
||||||
def fromurl(self, url):
|
def fromurl(self, url, silent=False):
|
||||||
"""
|
"""
|
||||||
Generate an item from a text string. The string can be created by the tourl () function or have
|
Generate an item from a text string. The string can be created by the tourl () function or have
|
||||||
the old format: plugin: //plugin.video.kod/? channel = ... (+ other parameters)
|
the old format: plugin: //plugin.video.kod/? channel = ... (+ other parameters)
|
||||||
@@ -369,7 +369,7 @@ class Item(object):
|
|||||||
decoded = False
|
decoded = False
|
||||||
try:
|
try:
|
||||||
str_item = base64.b64decode(urllib.unquote(url))
|
str_item = base64.b64decode(urllib.unquote(url))
|
||||||
json_item = json.load(str_item, object_hook=self.toutf8)
|
json_item = json.load(str_item, object_hook=self.toutf8, silent=silent)
|
||||||
if json_item is not None and len(json_item) > 0:
|
if json_item is not None and len(json_item) > 0:
|
||||||
self.__dict__.update(json_item)
|
self.__dict__.update(json_item)
|
||||||
decoded = True
|
decoded = True
|
||||||
|
|||||||
+8
-1
@@ -16,15 +16,22 @@ if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int
|
|||||||
|
|
||||||
|
|
||||||
def load(*args, **kwargs):
|
def load(*args, **kwargs):
|
||||||
|
silent = False
|
||||||
|
if 'silent' in kwargs:
|
||||||
|
silent = kwargs['silent']
|
||||||
|
kwargs.pop('silent')
|
||||||
|
|
||||||
if "object_hook" not in kwargs:
|
if "object_hook" not in kwargs:
|
||||||
kwargs["object_hook"] = to_utf8
|
kwargs["object_hook"] = to_utf8
|
||||||
|
|
||||||
try:
|
try:
|
||||||
value = json.loads(*args, **kwargs)
|
value = json.loads(*args, **kwargs)
|
||||||
except:
|
except:
|
||||||
|
if not silent:
|
||||||
logger.error("**NOT** able to load the JSON")
|
logger.error("**NOT** able to load the JSON")
|
||||||
logger.error(traceback.format_exc())
|
logger.error(traceback.format_exc())
|
||||||
logger.error('ERROR STACK ' + str(stack()[1][3]))
|
if len(stack()) > 1:
|
||||||
|
logger.error('ERROR STACK {}'.format(stack()[2]) )
|
||||||
value = {}
|
value = {}
|
||||||
|
|
||||||
return value
|
return value
|
||||||
|
|||||||
@@ -381,7 +381,7 @@ def actions(item):
|
|||||||
else:
|
else:
|
||||||
config.set_setting('install_trakt', True)
|
config.set_setting('install_trakt', True)
|
||||||
|
|
||||||
if len([s for s in itemlist if s.server]) > 0:
|
if len([s for s in itemlist if s.server]) > 0 and item.action in ['findvideos']:
|
||||||
findvideos(item, itemlist)
|
findvideos(item, itemlist)
|
||||||
else:
|
else:
|
||||||
platformtools.render_items(itemlist, item)
|
platformtools.render_items(itemlist, item)
|
||||||
|
|||||||
@@ -343,8 +343,6 @@ def render_items(itemlist, parent_item):
|
|||||||
item.folder = False
|
item.folder = False
|
||||||
if item.fanart == "":
|
if item.fanart == "":
|
||||||
item.fanart = parent_item.fanart
|
item.fanart = parent_item.fanart
|
||||||
if item.action == 'play' and thumb_type == 1 and not item.forcethumb:
|
|
||||||
item.thumbnail = config.get_online_server_thumb(item.server)
|
|
||||||
|
|
||||||
icon_image = "DefaultFolder.png" if item.folder else "DefaultVideo.png"
|
icon_image = "DefaultFolder.png" if item.folder else "DefaultVideo.png"
|
||||||
|
|
||||||
@@ -397,7 +395,6 @@ def render_items(itemlist, parent_item):
|
|||||||
r_list.sort(key=lambda it: it[0].itemlistPosition)
|
r_list.sort(key=lambda it: it[0].itemlistPosition)
|
||||||
|
|
||||||
|
|
||||||
# from core.support import dbg;dbg()
|
|
||||||
for item, item_url, listitem in r_list:
|
for item, item_url, listitem in r_list:
|
||||||
dirItems.append(('{}?{}'.format(sys.argv[0], item_url), listitem, item.folder, len(r_list)))
|
dirItems.append(('{}?{}'.format(sys.argv[0], item_url), listitem, item.folder, len(r_list)))
|
||||||
xbmcplugin.addDirectoryItems(_handle, dirItems)
|
xbmcplugin.addDirectoryItems(_handle, dirItems)
|
||||||
@@ -430,17 +427,17 @@ def viewmodeMonitor():
|
|||||||
if get_window() == 'WINDOW_VIDEO_NAV':
|
if get_window() == 'WINDOW_VIDEO_NAV':
|
||||||
try:
|
try:
|
||||||
parent_info = xbmc.getInfoLabel('Container.FolderPath')
|
parent_info = xbmc.getInfoLabel('Container.FolderPath')
|
||||||
parent = Item().fromurl(parent_info)
|
|
||||||
if 'plugin.video.kod' in parent_info:
|
if 'plugin.video.kod' in parent_info:
|
||||||
first_item_url = xbmc.getInfoLabel('Container.ListItemAbsolute(1).FileNameAndPath')
|
parent = Item().fromurl(parent_info, silent=True)
|
||||||
if first_item_url:
|
item = Item().fromurl(xbmc.getInfoLabel('ListItem.FileNameAndPath'), silent=True)
|
||||||
item = Item().fromurl(first_item_url)
|
|
||||||
currentModeName = xbmc.getInfoLabel('Container.Viewmode')
|
currentModeName = xbmc.getInfoLabel('Container.Viewmode')
|
||||||
currentMode = int(xbmcgui.Window(10025).getFocusId())
|
currentMode = int(xbmcgui.Window(10025).getFocusId())
|
||||||
# logger.debug('SAVE VIEW 1', currentMode, parent.action, item.action)
|
# logger.debug('SAVE VIEW 1', currentMode, parent.action, item.action)
|
||||||
if 50 <= currentMode < 600 and parent.action != item.action:
|
if 50 <= currentMode < 600 and parent and parent.action != item.action:
|
||||||
content, Type = getCurrentView(item, parent)
|
content, Type = getCurrentView(item, parent)
|
||||||
defaultMode = int(config.get_setting('view_mode_%s' % content).split(',')[-1])
|
view_mode_type = config.get_setting('view_mode_%s' % content)
|
||||||
|
if view_mode_type:
|
||||||
|
defaultMode = int(view_mode_type.split(',')[-1])
|
||||||
if content and currentMode != defaultMode:
|
if content and currentMode != defaultMode:
|
||||||
config.set_setting('view_mode_%s' % content, currentModeName + ', ' + str(currentMode))
|
config.set_setting('view_mode_%s' % content, currentModeName + ', ' + str(currentMode))
|
||||||
# logger.debug('SAVE VIEW 2', defaultMode, '->', currentMode)
|
# logger.debug('SAVE VIEW 2', defaultMode, '->', currentMode)
|
||||||
@@ -455,11 +452,12 @@ def viewmodeMonitor():
|
|||||||
|
|
||||||
|
|
||||||
def getCurrentView(item=None, parent_item=None):
|
def getCurrentView(item=None, parent_item=None):
|
||||||
|
|
||||||
if not item:
|
if not item:
|
||||||
item = Item()
|
item = Item()
|
||||||
# if not parent_item:
|
if not parent_item:
|
||||||
# logger.debug('ESCO')
|
logger.debug('ESCO')
|
||||||
# return None, None
|
return None, None
|
||||||
|
|
||||||
parent_actions = ['peliculas', 'novedades', 'search', 'get_from_temp', 'newest', 'discover_list', 'new_search', 'channel_search']
|
parent_actions = ['peliculas', 'novedades', 'search', 'get_from_temp', 'newest', 'discover_list', 'new_search', 'channel_search']
|
||||||
|
|
||||||
@@ -491,7 +489,7 @@ def getCurrentView(item=None, parent_item=None):
|
|||||||
return 'season', 'tvshows'
|
return 'season', 'tvshows'
|
||||||
|
|
||||||
elif parent_item.action in ['getmainlist', '', 'getchanneltypes']:
|
elif parent_item.action in ['getmainlist', '', 'getchanneltypes']:
|
||||||
return 'home', addons
|
return None, None
|
||||||
|
|
||||||
elif parent_item.action in ['filterchannels']:
|
elif parent_item.action in ['filterchannels']:
|
||||||
return 'channels', addons
|
return 'channels', addons
|
||||||
@@ -622,39 +620,16 @@ def set_context_commands(item, item_url, parent_item, **kwargs):
|
|||||||
else:
|
else:
|
||||||
context_commands.append((command["title"], "RunPlugin(%s?%s)" % (sys.argv[0], item.clone(**command).tourl())))
|
context_commands.append((command["title"], "RunPlugin(%s?%s)" % (sys.argv[0], item.clone(**command).tourl())))
|
||||||
# Do not add more predefined options if you are inside kodfavoritos
|
# Do not add more predefined options if you are inside kodfavoritos
|
||||||
# if parent_item.channel == 'kodfavorites':
|
if parent_item.channel == 'kodfavorites':
|
||||||
# return context_commands
|
if config.dev_mode():
|
||||||
|
context_commands.insert(0, ("item info", "Container.Update (%s?%s)" % (sys.argv[0], Item(action="itemInfo", parent=item.tojson()).tourl())))
|
||||||
|
return context_commands
|
||||||
# Options according to criteria, only if the item is not a tag, nor is it "Add to the video library", etc...
|
# Options according to criteria, only if the item is not a tag, nor is it "Add to the video library", etc...
|
||||||
if item.action and item.action not in ["add_pelicula_to_library", "add_serie_to_library", "buscartrailer", "actualizar_titulos"]:
|
if item.action and item.action not in ["add_pelicula_to_library", "add_serie_to_library", "buscartrailer", "actualizar_titulos"]:
|
||||||
# Show information: if the item has a plot, we assume that it is a series, season, chapter or movie
|
# Show information: if the item has a plot, we assume that it is a series, season, chapter or movie
|
||||||
# if item.infoLabels['plot'] and (num_version_xbmc < 17.0 or item.contentType == 'season'):
|
# if item.infoLabels['plot'] and (num_version_xbmc < 17.0 or item.contentType == 'season'):
|
||||||
# context_commands.append((config.get_localized_string(60348), "Action(Info)"))
|
# context_commands.append((config.get_localized_string(60348), "Action(Info)"))
|
||||||
|
|
||||||
if item.channel != "videolibrary" and item.videolibrary != False and not item.disable_videolibrary:
|
|
||||||
# Add Series to the video library
|
|
||||||
if item.action in ["episodios", "get_episodios", "get_seasons"] and item.contentSerieName:
|
|
||||||
context_commands.append((config.get_localized_string(60352), "RunPlugin(%s?%s&%s)" % (
|
|
||||||
sys.argv[0], item_url, 'action=add_serie_to_library&from_action=' + item.action)))
|
|
||||||
# Add Movie to Video Library
|
|
||||||
elif item.action in ["detail", "findvideos"] and item.contentType == 'movie' and item.contentTitle:
|
|
||||||
context_commands.append((config.get_localized_string(60353), "RunPlugin(%s?%s&%s)" % (
|
|
||||||
sys.argv[0], item_url, 'action=add_pelicula_to_library&from_action=' + item.action)))
|
|
||||||
# Add to Video Library
|
|
||||||
elif item.action in ['check'] and item.contentTitle:
|
|
||||||
context_commands.append((config.get_localized_string(30161), "RunPlugin(%s?%s&%s)" % (
|
|
||||||
sys.argv[0], item_url, 'action=add_to_library&from_action=' + item.action)))
|
|
||||||
|
|
||||||
# Search trailer...
|
|
||||||
if (item.contentTitle and item.contentType in ['movie', 'tvshow']) or "buscar_trailer" in context:
|
|
||||||
context_commands.append((config.get_localized_string(60359), "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, urllib.urlencode({ 'channel': "trailertools", 'action': "buscartrailer", 'search_title': item.contentTitle if item.contentTitle else item.fulltitle, 'contextual': True}))))
|
|
||||||
|
|
||||||
# Add to kodfavoritos (My links)
|
|
||||||
if item.channel not in ["favorites", "videolibrary", "help", ""] and parent_item.channel != "kodfavorites":
|
|
||||||
context_commands.append( (config.get_localized_string(70557), "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, urllib.urlencode({'channel': "kodfavorites", 'action': "addFavourite", 'from_channel': item.channel, 'from_action': item.action}))))
|
|
||||||
# Add to kodfavoritos
|
|
||||||
if parent_item.channel == 'globalsearch':
|
|
||||||
context_commands.append( (config.get_localized_string(30155), "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, urllib.urlencode({'channel': "favorites", 'action': "addFavourite", 'from_channel': item.channel, 'from_action': item.action}))))
|
|
||||||
|
|
||||||
# InfoPlus
|
# InfoPlus
|
||||||
if config.get_setting("infoplus"):
|
if config.get_setting("infoplus"):
|
||||||
#if item.infoLabels['tmdb_id'] or item.infoLabels['imdb_id'] or item.infoLabels['tvdb_id'] or \
|
#if item.infoLabels['tmdb_id'] or item.infoLabels['imdb_id'] or item.infoLabels['tvdb_id'] or \
|
||||||
@@ -662,8 +637,19 @@ def set_context_commands(item, item_url, parent_item, **kwargs):
|
|||||||
if item.infoLabels['tmdb_id'] or item.infoLabels['imdb_id'] or item.infoLabels['tvdb_id']:
|
if item.infoLabels['tmdb_id'] or item.infoLabels['imdb_id'] or item.infoLabels['tvdb_id']:
|
||||||
context_commands.append(("InfoPlus", "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, 'channel=infoplus&action=Main&from_channel=' + item.channel)))
|
context_commands.append(("InfoPlus", "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, 'channel=infoplus&action=Main&from_channel=' + item.channel)))
|
||||||
|
|
||||||
|
# Open in browser and previous menu
|
||||||
|
if parent_item.channel not in ["news", "channelselector", "downloads", "search"] and item.action != "mainlist":
|
||||||
|
context_commands.insert(1, (config.get_localized_string(70739), "Container.Update (%s?%s)" % (sys.argv[0], Item(action="open_browser", url=item.url).tourl())))
|
||||||
|
|
||||||
|
# Add to kodfavoritos (My links)
|
||||||
|
|
||||||
|
if item.channel not in ["favorites", "videolibrary", "help", ""] and parent_item.channel != "favorites" and parent_item.from_channel != "kodfavorites":
|
||||||
|
context_commands.append( (config.get_localized_string(70557), "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, urllib.urlencode({'channel': "kodfavorites", 'action': "addFavourite", 'from_channel': item.channel, 'from_action': item.action}))))
|
||||||
|
# Add to kodfavoritos
|
||||||
|
if parent_item.channel == 'globalsearch':
|
||||||
|
context_commands.append( (config.get_localized_string(30155), "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, urllib.urlencode({'channel': "favorites", 'action': "addFavourite", 'from_channel': item.channel, 'from_action': item.action}))))
|
||||||
# Search in other channels
|
# Search in other channels
|
||||||
if item.contentTitle and item.contentType in ['movie', 'tvshow'] and parent_item.channel not in ['search', 'globalsearch'] and item.action not in ['play']: #and parent_item.action != 'mainlist':
|
if item.contentTitle and item.contentType in ['movie', 'tvshow'] and parent_item.channel not in ['search', 'globalsearch'] and item.action not in ['play'] and parent_item.action != 'mainlist':
|
||||||
|
|
||||||
# Search in other channels
|
# Search in other channels
|
||||||
if item.contentSerieName != '':
|
if item.contentSerieName != '':
|
||||||
@@ -682,10 +668,16 @@ def set_context_commands(item, item_url, parent_item, **kwargs):
|
|||||||
context_commands.append((config.get_localized_string(60350), "Container.Refresh (%s?%s&%s)" % (sys.argv[0], item_url, urllib.urlencode({'channel': 'search', 'action': "from_context", 'from_channel': item.channel, 'contextual': True, 'text': item.wanted}))))
|
context_commands.append((config.get_localized_string(60350), "Container.Refresh (%s?%s&%s)" % (sys.argv[0], item_url, urllib.urlencode({'channel': 'search', 'action': "from_context", 'from_channel': item.channel, 'contextual': True, 'text': item.wanted}))))
|
||||||
context_commands.append( (config.get_localized_string(70561), "Container.Update (%s?%s&%s)" % (sys.argv[0], item_url, 'channel=search&action=from_context&search_type=list&page=1&list_type=%s/%s/similar' % (mediatype, item.infoLabels['tmdb_id']))))
|
context_commands.append( (config.get_localized_string(70561), "Container.Update (%s?%s&%s)" % (sys.argv[0], item_url, 'channel=search&action=from_context&search_type=list&page=1&list_type=%s/%s/similar' % (mediatype, item.infoLabels['tmdb_id']))))
|
||||||
|
|
||||||
|
if item.channel != "videolibrary" and item.videolibrary != False and not item.disable_videolibrary:
|
||||||
# Open in browser and previous menu
|
# Add Series to the video library
|
||||||
if parent_item.channel not in ["news", "channelselector", "downloads", "search"] and item.action != "mainlist" and not parent_item.noMainMenu:
|
if item.action in ["episodios", "get_episodios", "get_seasons"] and item.contentSerieName:
|
||||||
context_commands.append((config.get_localized_string(70739), "Container.Update (%s?%s)" % (sys.argv[0], Item(action="open_browser", url=item.url).tourl())))
|
context_commands.append((config.get_localized_string(60352), "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, 'action=add_serie_to_library&from_action=' + item.action)))
|
||||||
|
# Add Movie to Video Library
|
||||||
|
elif item.action in ["detail", "findvideos"] and item.contentType == 'movie' and item.contentTitle:
|
||||||
|
context_commands.append((config.get_localized_string(60353), "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, 'action=add_pelicula_to_library&from_action=' + item.action)))
|
||||||
|
# Add to Video Library
|
||||||
|
elif item.action in ['check'] and item.contentTitle:
|
||||||
|
context_commands.append((config.get_localized_string(30161), "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, 'action=add_to_library&from_action=' + item.action)))
|
||||||
|
|
||||||
if not item.local and item.channel not in ["downloads", "filmontv", "search"] and item.server != 'torrent' and parent_item.action != 'mainlist' and config.get_setting('downloadenabled') and not item.disable_videolibrary:
|
if not item.local and item.channel not in ["downloads", "filmontv", "search"] and item.server != 'torrent' and parent_item.action != 'mainlist' and config.get_setting('downloadenabled') and not item.disable_videolibrary:
|
||||||
# Download movie
|
# Download movie
|
||||||
@@ -706,6 +698,10 @@ def set_context_commands(item, item_url, parent_item, **kwargs):
|
|||||||
elif item.contentType == "season":
|
elif item.contentType == "season":
|
||||||
context_commands.append((config.get_localized_string(60357), "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, 'channel=downloads&action=save_download&download=season&from_channel=' + item.channel + '&from_action=' + item.action)))
|
context_commands.append((config.get_localized_string(60357), "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, 'channel=downloads&action=save_download&download=season&from_channel=' + item.channel + '&from_action=' + item.action)))
|
||||||
|
|
||||||
|
# Search trailer...
|
||||||
|
if (item.contentTitle and item.contentType in ['movie', 'tvshow']) or "buscar_trailer" in context:
|
||||||
|
context_commands.append((config.get_localized_string(60359), "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, urllib.urlencode({ 'channel': "trailertools", 'action': "buscartrailer", 'search_title': item.contentTitle if item.contentTitle else item.fulltitle, 'contextual': True}))))
|
||||||
|
|
||||||
if item.nextPage:
|
if item.nextPage:
|
||||||
context_commands.append((config.get_localized_string(70511), "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, 'action=gotopage&real_action='+item.action)))
|
context_commands.append((config.get_localized_string(70511), "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, 'action=gotopage&real_action='+item.action)))
|
||||||
if config.dev_mode():
|
if config.dev_mode():
|
||||||
@@ -977,8 +973,6 @@ def get_window():
|
|||||||
|
|
||||||
|
|
||||||
def play_video(item, strm=False, force_direct=False, autoplay=False):
|
def play_video(item, strm=False, force_direct=False, autoplay=False):
|
||||||
from core import httptools
|
|
||||||
|
|
||||||
logger.debug()
|
logger.debug()
|
||||||
logger.debug(item.tostring('\n'))
|
logger.debug(item.tostring('\n'))
|
||||||
|
|
||||||
@@ -996,6 +990,7 @@ def play_video(item, strm=False, force_direct=False, autoplay=False):
|
|||||||
|
|
||||||
# pass referer
|
# pass referer
|
||||||
if item.referer:
|
if item.referer:
|
||||||
|
from core import httptools
|
||||||
httptools.default_headers['Referer'] = item.referer
|
httptools.default_headers['Referer'] = item.referer
|
||||||
|
|
||||||
# Open the selection dialog to see the available options
|
# Open the selection dialog to see the available options
|
||||||
@@ -1038,6 +1033,7 @@ def play_video(item, strm=False, force_direct=False, autoplay=False):
|
|||||||
# headers['Host'] = domain
|
# headers['Host'] = domain
|
||||||
# except:
|
# except:
|
||||||
# logger.error('Failed to resolve hostname, fallback to normal dns')
|
# logger.error('Failed to resolve hostname, fallback to normal dns')
|
||||||
|
if not '|' in mediaurl:
|
||||||
mediaurl = mediaurl + '|' + urllib.urlencode(headers)
|
mediaurl = mediaurl + '|' + urllib.urlencode(headers)
|
||||||
|
|
||||||
# video information is obtained.
|
# video information is obtained.
|
||||||
@@ -1736,6 +1732,7 @@ def channelImport(channelId):
|
|||||||
return channel
|
return channel
|
||||||
|
|
||||||
def serverWindow(item, itemlist):
|
def serverWindow(item, itemlist):
|
||||||
|
from core import db
|
||||||
LEFT = 1
|
LEFT = 1
|
||||||
RIGHT = 2
|
RIGHT = 2
|
||||||
UP = 3
|
UP = 3
|
||||||
@@ -1744,6 +1741,8 @@ def serverWindow(item, itemlist):
|
|||||||
EXIT = 10
|
EXIT = 10
|
||||||
BACKSPACE = 92
|
BACKSPACE = 92
|
||||||
|
|
||||||
|
CONTEXT = 117
|
||||||
|
|
||||||
class ServerWindow(xbmcgui.WindowXMLDialog):
|
class ServerWindow(xbmcgui.WindowXMLDialog):
|
||||||
def start(self, item, itemlist):
|
def start(self, item, itemlist):
|
||||||
prevent_busy()
|
prevent_busy()
|
||||||
@@ -1797,6 +1796,11 @@ def serverWindow(item, itemlist):
|
|||||||
self.setFocusId(100)
|
self.setFocusId(100)
|
||||||
# from core.support import dbg;dbg()
|
# from core.support import dbg;dbg()
|
||||||
|
|
||||||
|
def onFocus(self, control):
|
||||||
|
if is_playing() and db['controls'].get('reopen', False):
|
||||||
|
self.close()
|
||||||
|
serverWindow(self.item, self.itemlist)
|
||||||
|
|
||||||
def onAction(self, action):
|
def onAction(self, action):
|
||||||
action = action.getId()
|
action = action.getId()
|
||||||
focus = self.getFocusId()
|
focus = self.getFocusId()
|
||||||
@@ -1804,6 +1808,8 @@ def serverWindow(item, itemlist):
|
|||||||
self.setFocusId(100)
|
self.setFocusId(100)
|
||||||
elif action in [EXIT, BACKSPACE]:
|
elif action in [EXIT, BACKSPACE]:
|
||||||
self.close()
|
self.close()
|
||||||
|
if action in [CONTEXT]:
|
||||||
|
context(self)
|
||||||
|
|
||||||
def onClick(self, control):
|
def onClick(self, control):
|
||||||
if control == 100:
|
if control == 100:
|
||||||
@@ -1878,11 +1884,24 @@ def serverWindow(item, itemlist):
|
|||||||
else:
|
else:
|
||||||
it.setLabel2(videoitem.fulltitle)
|
it.setLabel2(videoitem.fulltitle)
|
||||||
it.setArt({'thumb': videoitem.thumbnail})
|
it.setArt({'thumb': videoitem.thumbnail})
|
||||||
|
|
||||||
items.append(it)
|
items.append(it)
|
||||||
self.list.reset()
|
self.list.reset()
|
||||||
self.list.addItems(items)
|
self.list.addItems(items)
|
||||||
self.setFocus(self.list)
|
self.setFocus(self.list)
|
||||||
|
|
||||||
|
def onFocus(self, control):
|
||||||
|
if is_playing() and db['controls'].get('reopen', False):
|
||||||
|
self.close()
|
||||||
|
serverWindow(self.item, self.itemlist)
|
||||||
|
|
||||||
|
def onAction(self, action):
|
||||||
|
action = action.getId()
|
||||||
|
if action in [CONTEXT]:
|
||||||
|
context(self)
|
||||||
|
if action in [EXIT, BACKSPACE]:
|
||||||
|
self.close()
|
||||||
|
|
||||||
def onClick(self, control):
|
def onClick(self, control):
|
||||||
if control == 6:
|
if control == 6:
|
||||||
self.selection = self.itemlist[self.list.getSelectedPosition()]
|
self.selection = self.itemlist[self.list.getSelectedPosition()]
|
||||||
@@ -1902,10 +1921,20 @@ def serverWindow(item, itemlist):
|
|||||||
run(self.actions[0])
|
run(self.actions[0])
|
||||||
|
|
||||||
|
|
||||||
|
def context(self):
|
||||||
|
pos = self.list.getSelectedPosition()
|
||||||
|
parent = self.item
|
||||||
|
item = self.itemlist[pos]
|
||||||
|
commands = set_context_commands(item, item.tourl(), parent)
|
||||||
|
context = [c[0] for c in commands]
|
||||||
|
context_commands = [c[1].replace('Container.Refresh', 'RunPlugin').replace('Container.Update', 'RunPlugin') for c in commands]
|
||||||
|
index = xbmcgui.Dialog().contextmenu(context)
|
||||||
|
if index > 0: xbmc.executebuiltin(context_commands[index])
|
||||||
|
|
||||||
|
|
||||||
if itemlist:
|
if itemlist:
|
||||||
def monitor(itemlist):
|
def monitor(itemlist):
|
||||||
reopen = False
|
reopen = False
|
||||||
from core import db
|
|
||||||
while not xbmc.Monitor().abortRequested():
|
while not xbmc.Monitor().abortRequested():
|
||||||
if not is_playing():
|
if not is_playing():
|
||||||
if reopen:
|
if reopen:
|
||||||
|
|||||||
+1
-1
@@ -14,7 +14,7 @@ def test_video_exists(page_url):
|
|||||||
data = page.data.replace('"', "'")
|
data = page.data.replace('"', "'")
|
||||||
real_url = page.url
|
real_url = page.url
|
||||||
|
|
||||||
if "Not Found" in data or "File Does not Exist" in data:
|
if "Not Found" in data or "File Does not Exist" in data or "File doesn't exits" in data:
|
||||||
return False, config.get_localized_string(70449) % "DeltaBit"
|
return False, config.get_localized_string(70449) % "DeltaBit"
|
||||||
return True, ""
|
return True, ""
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -30,7 +30,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
|||||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||||
|
|
||||||
for url in matches:
|
for url in matches:
|
||||||
url = url+'|Referer='+page_url
|
# url = url+'|Referer='+page_url
|
||||||
video_urls.append(["[uqload]", url])
|
video_urls.append(["[uqload]", url])
|
||||||
|
|
||||||
return video_urls
|
return video_urls
|
||||||
|
|||||||
@@ -224,6 +224,7 @@ def mostrar_perfil(item):
|
|||||||
for i_enlace, enlace in enumerate(alfav.user_favorites[i_perfil]['items']):
|
for i_enlace, enlace in enumerate(alfav.user_favorites[i_perfil]['items']):
|
||||||
|
|
||||||
it = Item().fromurl(enlace)
|
it = Item().fromurl(enlace)
|
||||||
|
it.from_channel = 'kodfavorites'
|
||||||
it.context = [ {'title': config.get_localized_string(70617), 'channel': item.channel, 'action': 'acciones_enlace',
|
it.context = [ {'title': config.get_localized_string(70617), 'channel': item.channel, 'action': 'acciones_enlace',
|
||||||
'i_enlace': i_enlace, 'i_perfil': i_perfil} ]
|
'i_enlace': i_enlace, 'i_perfil': i_perfil} ]
|
||||||
|
|
||||||
@@ -232,6 +233,10 @@ def mostrar_perfil(item):
|
|||||||
it.plot += '[CR]Url: ' + it.url if isinstance(it.url, str) else '...'
|
it.plot += '[CR]Url: ' + it.url if isinstance(it.url, str) else '...'
|
||||||
if it.date_added != '': it.plot += '[CR]' + config.get_localized_string(70469) + ': ' + it.date_added
|
if it.date_added != '': it.plot += '[CR]' + config.get_localized_string(70469) + ': ' + it.date_added
|
||||||
|
|
||||||
|
if it.server:
|
||||||
|
it.thumbnail = it.contentThumbnail
|
||||||
|
it.title += ' [{}]'.format(it.serverName)
|
||||||
|
|
||||||
# If it is not a url, nor does it have the system path, convert the path since it will have been copied from another device.
|
# If it is not a url, nor does it have the system path, convert the path since it will have been copied from another device.
|
||||||
# It would be more optimal if the conversion was done with an import menu, but at the moment it is controlled in run-time.
|
# It would be more optimal if the conversion was done with an import menu, but at the moment it is controlled in run-time.
|
||||||
if it.thumbnail and '://' not in it.thumbnail and not it.thumbnail.startswith(ruta_runtime):
|
if it.thumbnail and '://' not in it.thumbnail and not it.thumbnail.startswith(ruta_runtime):
|
||||||
|
|||||||
Reference in New Issue
Block a user