KoD 0.5
-Ridefinito il modo in cui vengono scritti i canali, per assicurare migliore stabilità, debuggabilità e coerenza -Riscritti di conseguenza molti canali, corregendo di fatto moltissimi problemi che avete segnalato -Quando aggiungi in videoteca da fonti in più lingue (ita/sub ita) o più qualità, ti viene chiesto quale tipo di fonte vuoi. -Per gli amanti degli anime, aggiunto VVVVID (senza bisogno di account!) -Aggiunti i server supervideo e hdload, fixato wstream -migliorie varie
This commit is contained in:
@@ -20,15 +20,12 @@ def get_addon_core():
|
||||
|
||||
def get_addon_version(with_fix=True):
|
||||
'''
|
||||
Trova la versione dell'addon, senza usare le funzioni di kodi perchè non si aggiornano fino al riavvio
|
||||
Devuelve el número de versión del addon, y opcionalmente número de fix si lo hay
|
||||
'''
|
||||
info = open(os.path.join(get_runtime_path(), 'addon.xml')).read()
|
||||
ver = re.search('plugin.video.kod.*?version="([^"]+)"', info).group(1)
|
||||
|
||||
if with_fix:
|
||||
return ver + " " + get_addon_version_fix()
|
||||
return __settings__.getAddonInfo('version') + " " + get_addon_version_fix()
|
||||
else:
|
||||
return ver
|
||||
return __settings__.getAddonInfo('version')
|
||||
|
||||
|
||||
def get_addon_version_fix():
|
||||
@@ -94,31 +91,15 @@ def get_videolibrary_support():
|
||||
return True
|
||||
|
||||
def get_channel_url(name):
|
||||
def json():
|
||||
try:
|
||||
try:
|
||||
import json
|
||||
except:
|
||||
import simplejson as json
|
||||
ROOT_DIR = xbmc.translatePath(__settings__.getAddonInfo('Path'))
|
||||
LOCAL_FILE = os.path.join(ROOT_DIR, "channels.json")
|
||||
with open(LOCAL_FILE) as f:
|
||||
data = json.load(f)
|
||||
if data[name] is not None:
|
||||
return data[name]
|
||||
else:
|
||||
return get_setting("channel_host", name)
|
||||
except:
|
||||
return get_setting("channel_host", name)
|
||||
|
||||
if __settings__.getSetting("use_custom_url") == "true":
|
||||
host = get_setting("channel_host", name)
|
||||
if host:
|
||||
return host
|
||||
else:
|
||||
return json()
|
||||
else:
|
||||
return json()
|
||||
try:
|
||||
import json
|
||||
except:
|
||||
import simplejson as json
|
||||
ROOT_DIR = xbmc.translatePath(__settings__.getAddonInfo('Path'))
|
||||
LOCAL_FILE = os.path.join(ROOT_DIR, "channels.json")
|
||||
with open(LOCAL_FILE) as f:
|
||||
data = json.load(f)
|
||||
return data[name]
|
||||
|
||||
def get_system_platform():
|
||||
""" fonction: pour recuperer la platform que xbmc tourne """
|
||||
@@ -366,7 +347,7 @@ def get_localized_string(code):
|
||||
def get_localized_category(categ):
|
||||
categories = {'movie': get_localized_string(30122), 'tvshow': get_localized_string(30123),
|
||||
'anime': get_localized_string(30124), 'documentary': get_localized_string(30125),
|
||||
'vos': get_localized_string(30136), 'vosi': get_localized_string(70566), 'adult': get_localized_string(30126),
|
||||
'vos': get_localized_string(30136), 'sub-ita': get_localized_string(70566), 'adult': get_localized_string(30126),
|
||||
'direct': get_localized_string(30137), 'torrent': get_localized_string(70015)}
|
||||
return categories[categ] if categ in categories else categ
|
||||
|
||||
|
||||
@@ -37,6 +37,8 @@ def start():
|
||||
from specials.checkhost import test_conn
|
||||
import threading
|
||||
threading.Thread(target=test_conn, args=(True, True, True, [], [], True)).start()
|
||||
# check_adsl = test_conn(is_exit = True, check_dns = True, view_msg = True,
|
||||
# lst_urls = [], lst_site_check_dns = [], in_addon = True)
|
||||
|
||||
|
||||
def run(item=None):
|
||||
@@ -58,10 +60,12 @@ def run(item=None):
|
||||
config.get_localized_string(70018): 'infantiles',
|
||||
config.get_localized_string(60513): 'documentales',
|
||||
config.get_localized_string(70013): 'terror',
|
||||
config.get_localized_string(30124): 'castellano',
|
||||
config.get_localized_string(70014): 'castellano',
|
||||
config.get_localized_string(59976): 'latino',
|
||||
config.get_localized_string(70171): 'torrent',
|
||||
}
|
||||
if not config.get_setting("category") in dictCategory.keys():
|
||||
config.set_setting('category', config.get_localized_string(70137))
|
||||
category = dictCategory[config.get_setting("category")]
|
||||
item = Item(channel="news", action="novedades", extra=category, mode = 'silent')
|
||||
else:
|
||||
@@ -129,7 +133,9 @@ def run(item=None):
|
||||
from core import tmdb
|
||||
if tmdb.drop_bd():
|
||||
platformtools.dialog_notification(config.get_localized_string(20000), config.get_localized_string(60011), time=2000, sound=False)
|
||||
|
||||
elif item.action == "itemInfo":
|
||||
import base64
|
||||
platformtools.dialog_textviewer('Item info', item.parent)
|
||||
# Action in certain channel specified in "action" and "channel" parameters
|
||||
else:
|
||||
# Entry point for a channel is the "mainlist" action, so here we check parental control
|
||||
@@ -151,11 +157,17 @@ def run(item=None):
|
||||
# Checks if channel exists
|
||||
if os.path.isfile(os.path.join(config.get_runtime_path(), 'channels', item.channel + ".py")):
|
||||
CHANNELS = 'channels'
|
||||
elif os.path.isfile(os.path.join(config.get_runtime_path(), 'channels', 'porn', item.channel + ".py")):
|
||||
CHANNELS = 'channels.porn'
|
||||
else:
|
||||
CHANNELS ='specials'
|
||||
channel_file = os.path.join(config.get_runtime_path(), CHANNELS, item.channel + ".py")
|
||||
|
||||
logger.info("channel_file= " + channel_file)
|
||||
|
||||
if CHANNELS != 'channels.porn':
|
||||
channel_file = os.path.join(config.get_runtime_path(), CHANNELS, item.channel + ".py")
|
||||
else:
|
||||
channel_file = os.path.join(config.get_runtime_path(), 'channels', 'porn', item.channel + ".py")
|
||||
|
||||
logger.info("channel_file= " + channel_file + ' - ' + CHANNELS +' - ' + item.channel)
|
||||
|
||||
channel = None
|
||||
|
||||
@@ -163,7 +175,8 @@ def run(item=None):
|
||||
try:
|
||||
channel = __import__(CHANNELS + item.channel, None, None, [CHANNELS + item.channel])
|
||||
except ImportError:
|
||||
importer = "import " + CHANNELS + "." + item.channel + " as channel"
|
||||
importer = "import " + CHANNELS + "." + item.channel + " as channel "
|
||||
|
||||
exec(importer)
|
||||
|
||||
logger.info("Running channel %s | %s" % (channel.__name__, channel.__file__))
|
||||
@@ -260,13 +273,17 @@ def run(item=None):
|
||||
from specials import search
|
||||
search.save_search(tecleado)
|
||||
|
||||
itemlist = channel.search(item, tecleado)
|
||||
if 'search' in dir(channel):
|
||||
itemlist = channel.search(item, tecleado)
|
||||
else:
|
||||
from core import support
|
||||
itemlist = support.search(channel, item, tecleado)
|
||||
else:
|
||||
return
|
||||
|
||||
platformtools.render_items(itemlist, item)
|
||||
|
||||
# For all other actions
|
||||
# For all other actions
|
||||
else:
|
||||
# import web_pdb; web_pdb.set_trace()
|
||||
logger.info("Executing channel '%s' method" % item.action)
|
||||
@@ -420,7 +437,7 @@ def play_from_library(item):
|
||||
import xbmcplugin
|
||||
import xbmc
|
||||
from time import sleep
|
||||
|
||||
|
||||
# Intentamos reproducir una imagen (esto no hace nada y ademas no da error)
|
||||
xbmcplugin.setResolvedUrl(int(sys.argv[1]), True,
|
||||
xbmcgui.ListItem(
|
||||
@@ -498,6 +515,7 @@ def play_from_library(item):
|
||||
return
|
||||
else:
|
||||
item = videolibrary.play(itemlist[seleccion])[0]
|
||||
item.play_from = 'window'
|
||||
platformtools.play_video(item)
|
||||
|
||||
from specials import autoplay
|
||||
|
||||
@@ -22,7 +22,7 @@ from channelselector import get_thumb
|
||||
from core import channeltools
|
||||
from core import trakt_tools, scrapertoolsV2
|
||||
from core.item import Item
|
||||
from platformcode import logger
|
||||
from platformcode import logger, keymaptools
|
||||
from platformcode import unify
|
||||
|
||||
addon = xbmcaddon.Addon('plugin.video.kod')
|
||||
@@ -549,7 +549,7 @@ def set_context_commands(item, parent_item):
|
||||
from_action=item.action).tourl())))
|
||||
# Añadir a Alfavoritos (Mis enlaces)
|
||||
if item.channel not in ["favorites", "videolibrary", "help", ""] and parent_item.channel != "favorites":
|
||||
context_commands.append(('[COLOR blue]%s[/COLOR]' % config.get_localized_string(70557), "XBMC.RunPlugin(%s?%s)" %
|
||||
context_commands.append(("[B]%s[/B]" % config.get_localized_string(70557), "XBMC.RunPlugin(%s?%s)" %
|
||||
(sys.argv[0], item.clone(channel="kodfavorites", action="addFavourite",
|
||||
from_channel=item.channel,
|
||||
from_action=item.action).tourl())))
|
||||
@@ -571,7 +571,7 @@ def set_context_commands(item, parent_item):
|
||||
mediatype = 'tv'
|
||||
else:
|
||||
mediatype = item.contentType
|
||||
context_commands.append(("[COLOR yellow]%s[/COLOR]" % config.get_localized_string(70561), "XBMC.Container.Update (%s?%s)" % (
|
||||
context_commands.append(("[B]%s[/B]" % config.get_localized_string(70561), "XBMC.Container.Update (%s?%s)" % (
|
||||
sys.argv[0], item.clone(channel='search', action='discover_list', search_type='list', page='1',
|
||||
list_type='%s/%s/similar' % (mediatype,item.infoLabels['tmdb_id'])).tourl())))
|
||||
|
||||
@@ -584,9 +584,10 @@ def set_context_commands(item, parent_item):
|
||||
action="set_custom_start",
|
||||
parent=item.tourl()).tourl())))
|
||||
|
||||
if item.channel != "videolibrary":
|
||||
if (item.channel != "videolibrary" and not config.get_localized_string(70585) in str(item.context)) \
|
||||
or (item.channel != "videolibrary" and config.get_localized_string(70585) in str(item.context) and config.get_localized_string(70714) in str(item.context)):
|
||||
# Añadir Serie a la videoteca
|
||||
if item.action in ["episodios", "get_episodios"] and item.contentSerieName:
|
||||
if item.action in ["episodios", "get_episodios", "get_seasons"] and item.contentSerieName:
|
||||
context_commands.append((config.get_localized_string(60352), "XBMC.RunPlugin(%s?%s)" %
|
||||
(sys.argv[0], item.clone(action="add_serie_to_library",
|
||||
from_action=item.action).tourl())))
|
||||
@@ -596,7 +597,8 @@ def set_context_commands(item, parent_item):
|
||||
(sys.argv[0], item.clone(action="add_pelicula_to_library",
|
||||
from_action=item.action).tourl())))
|
||||
|
||||
if item.channel != "downloads" and downloadenabled != "false":
|
||||
if (item.channel != "downloads" and item.channel != "videolibrary" and downloadenabled != "false" and not config.get_localized_string(70585) in str(item.context))\
|
||||
or (item.channel != "downloads" and item.channel != "videolibrary" and downloadenabled != "false" and config.get_localized_string(70585) in str(item.context) and config.get_localized_string(70714) in str(item.context)):
|
||||
# Descargar pelicula
|
||||
if item.contentType == "movie":
|
||||
context_commands.append((config.get_localized_string(60354), "XBMC.RunPlugin(%s?%s)" %
|
||||
@@ -606,12 +608,18 @@ def set_context_commands(item, parent_item):
|
||||
|
||||
# elif item.contentSerieName:
|
||||
# Descargar serie
|
||||
elif item.contentType == "tvshow" and item.action in ["episodios"]:
|
||||
elif (item.contentType == "tvshow" and item.action in ["episodios"]) or \
|
||||
(item.contentType == "tvshow" and item.action in ['get_seasons'] and config.get_setting('show_seasons',item.channel) == False):
|
||||
item.contentType == "tvshow"
|
||||
context_commands.append((config.get_localized_string(60355), "XBMC.RunPlugin(%s?%s)" %
|
||||
(sys.argv[0], item.clone(channel="downloads", action="save_download",
|
||||
from_channel=item.channel,
|
||||
from_action=item.action).tourl())))
|
||||
context_commands.append((config.get_localized_string(60357), "XBMC.RunPlugin(%s?%s)" %
|
||||
(sys.argv[0], item.clone(channel="downloads", action="save_download",
|
||||
from_channel=item.channel,
|
||||
from_action=item.action,
|
||||
download='season').tourl())))
|
||||
|
||||
# Descargar episodio
|
||||
elif item.contentType == 'episode' and item.action in ["findvideos"]:
|
||||
@@ -626,7 +634,8 @@ def set_context_commands(item, parent_item):
|
||||
context_commands.append((config.get_localized_string(60357), "XBMC.RunPlugin(%s?%s)" %
|
||||
(sys.argv[0], item.clone(channel="downloads", action="save_download",
|
||||
from_channel=item.channel,
|
||||
from_action=item.action).tourl())))
|
||||
from_action=item.action,
|
||||
download='season').tourl())))
|
||||
|
||||
# Abrir configuración
|
||||
if parent_item.channel not in ["setting", "news", "search"]:
|
||||
@@ -648,10 +657,19 @@ def set_context_commands(item, parent_item):
|
||||
context_commands = sorted(context_commands, key=lambda comand: comand[0])
|
||||
# Menu Rapido
|
||||
context_commands.insert(0, (config.get_localized_string(60360),
|
||||
"XBMC.RunPlugin(%s?%s)" % (sys.argv[0], Item(channel='side_menu',
|
||||
action="open_shortcut_menu",
|
||||
parent=parent_item.tourl()).tourl(
|
||||
))))
|
||||
context_commands.insert(1, (config.get_localized_string(70737),
|
||||
"XBMC.Container.Update (%s?%s)" % (sys.argv[0], Item(channel='side_menu',
|
||||
action="open_menu",
|
||||
parent=parent_item.tourl()).tourl(
|
||||
))))
|
||||
if config.dev_mode():
|
||||
context_commands.insert(2, ("item info",
|
||||
"XBMC.Container.Update (%s?%s)" % (sys.argv[0], Item(action="itemInfo",
|
||||
parent=item.tojson()).tourl())))
|
||||
return context_commands
|
||||
|
||||
|
||||
@@ -661,6 +679,8 @@ def is_playing():
|
||||
|
||||
def play_video(item, strm=False, force_direct=False, autoplay=False):
|
||||
logger.info()
|
||||
if item.play_from == 'window':
|
||||
force_direct=True
|
||||
# logger.debug(item.tostring('\n'))
|
||||
logger.debug('item play: %s'%item)
|
||||
xbmc_player = XBMCPlayer()
|
||||
@@ -673,7 +693,8 @@ def play_video(item, strm=False, force_direct=False, autoplay=False):
|
||||
xlistitem.setThumbnailImage(item.thumbnail)
|
||||
|
||||
set_infolabels(xlistitem, item, True)
|
||||
xbmc_player.play(item.url, xlistitem)
|
||||
set_player(item, xlistitem, item.url, True, None) # Fix Play From Download Section
|
||||
# xbmc_player.play(item.url, xlistitem)
|
||||
return
|
||||
|
||||
default_action = config.get_setting("default_action")
|
||||
@@ -903,10 +924,10 @@ def get_dialogo_opciones(item, default_action, strm, autoplay):
|
||||
# "Descargar"
|
||||
import xbmcaddon
|
||||
addon = xbmcaddon.Addon('plugin.video.kod')
|
||||
downloadenabled = addon.getSetting('downloadenabled')
|
||||
if downloadenabled != "false":
|
||||
opcion = config.get_localized_string(30153)
|
||||
opciones.append(opcion)
|
||||
# downloadenabled = addon.getSetting('downloadenabled')
|
||||
# if downloadenabled != "false":
|
||||
# opcion = config.get_localized_string(30153)
|
||||
# opciones.append(opcion)
|
||||
|
||||
if item.isFavourite:
|
||||
# "Quitar de favoritos"
|
||||
@@ -1069,7 +1090,7 @@ def set_player(item, xlistitem, mediaurl, view, strm):
|
||||
logger.info("mediaurl=" + mediaurl)
|
||||
if config.get_setting("player_mode") == 3 or "megacrypter.com" in mediaurl:
|
||||
import download_and_play
|
||||
download_and_play.download_and_play(mediaurl, "download_and_play.tmp", config.get_setting("downloadpath"))
|
||||
download_and_play.download_and_play(mediaurl, "download_and_play.mp4", config.get_setting("downloadpath"))
|
||||
return
|
||||
|
||||
elif config.get_setting("player_mode") == 0 or \
|
||||
|
||||
@@ -253,9 +253,9 @@ def set_lang(language):
|
||||
lat=['latino','lat','la', 'espanol latino', 'espaol latino', 'zl', 'mx', 'co', 'vl']
|
||||
vose=['subtitulado','subtitulada','sub','sub espanol','vose','espsub','su','subs castellano',
|
||||
'sub: español', 'vs', 'zs', 'vs', 'english-spanish subs', 'ingles sub espanol']
|
||||
vosi=['sottotitolato','sottotitolata','sub','sub ita','vosi','sub-ita','subs italiano',
|
||||
sub_ita=['sottotitolato','sottotitolata','sub','sub ita','subs italiano',
|
||||
'sub: italiano', 'inglese sottotitolato']
|
||||
vos=['vos', 'sub ingles', 'engsub', 'vosi','ingles subtitulado', 'sub: ingles']
|
||||
vos=['vos', 'sub ingles', 'engsub','ingles subtitulado', 'sub: ingles']
|
||||
vo=['ingles', 'en','vo', 'ovos', 'eng','v.o', 'english']
|
||||
dual=['dual']
|
||||
|
||||
@@ -271,7 +271,9 @@ def set_lang(language):
|
||||
elif language in lat:
|
||||
language = 'lat'
|
||||
elif language in ita:
|
||||
language = 'ita'
|
||||
language = 'ita'
|
||||
elif language in sub_ita:
|
||||
language = 'sub-ita'
|
||||
elif language in vose:
|
||||
language = 'vose'
|
||||
elif language in vos:
|
||||
@@ -280,8 +282,6 @@ def set_lang(language):
|
||||
language = 'vo'
|
||||
elif language in dual:
|
||||
language = 'dual'
|
||||
elif language in dual:
|
||||
language = 'vosi'
|
||||
else:
|
||||
language = 'otro'
|
||||
|
||||
|
||||
0
platformcode/updater.py
Executable file → Normal file
0
platformcode/updater.py
Executable file → Normal file
Reference in New Issue
Block a user