KoD 0.7.1
- A grande richiesta, è ora possibile riprodurre in automatico l'episodio successivo di una serie in libreria - aggiunta la possibilità di nascondere la lista dei server, quando si usa l'autoplay - aggiunto canale pufimovies.com - fix vari
This commit is contained in:
@@ -429,6 +429,7 @@ def limit_itemlist(itemlist):
|
||||
|
||||
|
||||
def play_from_library(item):
|
||||
itemlist=[]
|
||||
"""
|
||||
Los .strm al reproducirlos desde kodi, este espera que sea un archivo "reproducible" asi que no puede contener
|
||||
más items, como mucho se puede colocar un dialogo de seleccion.
|
||||
@@ -440,12 +441,13 @@ def play_from_library(item):
|
||||
@param item: elemento con información
|
||||
"""
|
||||
logger.info()
|
||||
#logger.debug("item: \n" + item.tostring('\n'))
|
||||
# logger.debug("item: \n" + item.tostring('\n'))
|
||||
|
||||
import xbmcgui
|
||||
import xbmcplugin
|
||||
import xbmc
|
||||
from time import sleep
|
||||
from time import sleep, time
|
||||
from specials import nextep
|
||||
|
||||
# Intentamos reproducir una imagen (esto no hace nada y ademas no da error)
|
||||
xbmcplugin.setResolvedUrl(int(sys.argv[1]), True,
|
||||
@@ -458,8 +460,10 @@ def play_from_library(item):
|
||||
|
||||
# modificamos el action (actualmente la videoteca necesita "findvideos" ya que es donde se buscan las fuentes
|
||||
item.action = "findvideos"
|
||||
check_next_ep = nextep.check(item)
|
||||
|
||||
window_type = config.get_setting("window_type", "videolibrary")
|
||||
|
||||
window_type = 1 if check_next_ep else config.get_setting("window_type", "videolibrary")
|
||||
|
||||
# y volvemos a lanzar kodi
|
||||
if xbmc.getCondVisibility('Window.IsMedia') and not window_type == 1:
|
||||
@@ -467,66 +471,85 @@ def play_from_library(item):
|
||||
xbmc.executebuiltin("Container.Update(" + sys.argv[0] + "?" + item.tourl() + ")")
|
||||
|
||||
else:
|
||||
|
||||
# Ventana emergente
|
||||
from specials import videolibrary
|
||||
item.show_server = True
|
||||
|
||||
from specials import videolibrary, autoplay
|
||||
p_dialog = platformtools.dialog_progress_bg(config.get_localized_string(20000), config.get_localized_string(70004))
|
||||
p_dialog.update(0, '')
|
||||
|
||||
itemlist = videolibrary.findvideos(item)
|
||||
|
||||
if check_next_ep and autoplay.is_active(item.contentChannel):
|
||||
p_dialog.update(100, '')
|
||||
sleep(0.5)
|
||||
p_dialog.close()
|
||||
item = nextep.return_item(item)
|
||||
if item.next_ep:
|
||||
return play_from_library(item)
|
||||
|
||||
while platformtools.is_playing():
|
||||
# Ventana convencional
|
||||
sleep(5)
|
||||
p_dialog.update(50, '')
|
||||
else:
|
||||
while platformtools.is_playing():
|
||||
# Ventana convencional
|
||||
sleep(5)
|
||||
p_dialog.update(50, '')
|
||||
|
||||
'''# Se filtran los enlaces segun la lista negra
|
||||
if config.get_setting('filter_servers', "servers"):
|
||||
itemlist = servertools.filter_servers(itemlist)'''
|
||||
it = item
|
||||
if item.show_server or not check_next_ep:
|
||||
|
||||
# Se limita la cantidad de enlaces a mostrar
|
||||
if config.get_setting("max_links", "videolibrary") != 0:
|
||||
itemlist = limit_itemlist(itemlist)
|
||||
'''# Se filtran los enlaces segun la lista negra
|
||||
if config.get_setting('filter_servers', "servers"):
|
||||
itemlist = servertools.filter_servers(itemlist)'''
|
||||
|
||||
# Se "limpia" ligeramente la lista de enlaces
|
||||
if config.get_setting("replace_VD", "videolibrary") == 1:
|
||||
itemlist = reorder_itemlist(itemlist)
|
||||
# Se limita la cantidad de enlaces a mostrar
|
||||
if config.get_setting("max_links", "videolibrary") != 0:
|
||||
itemlist = limit_itemlist(itemlist)
|
||||
|
||||
# Se "limpia" ligeramente la lista de enlaces
|
||||
if config.get_setting("replace_VD", "videolibrary") == 1:
|
||||
itemlist = reorder_itemlist(itemlist)
|
||||
|
||||
|
||||
import time
|
||||
p_dialog.update(100, '')
|
||||
time.sleep(0.5)
|
||||
p_dialog.close()
|
||||
p_dialog.update(100, '')
|
||||
sleep(0.5)
|
||||
p_dialog.close()
|
||||
|
||||
|
||||
if len(itemlist) > 0:
|
||||
while not xbmc.Monitor().abortRequested():
|
||||
# El usuario elige el mirror
|
||||
opciones = []
|
||||
for item in itemlist:
|
||||
opciones.append(item.title)
|
||||
if len(itemlist) > 0:
|
||||
while not xbmc.Monitor().abortRequested():
|
||||
# El usuario elige el mirror
|
||||
opciones = []
|
||||
for item in itemlist:
|
||||
opciones.append(item.title)
|
||||
|
||||
# Se abre la ventana de seleccion
|
||||
if (item.contentSerieName != "" and
|
||||
item.contentSeason != "" and
|
||||
item.contentEpisodeNumber != ""):
|
||||
cabecera = ("%s - %sx%s -- %s" %
|
||||
(item.contentSerieName,
|
||||
item.contentSeason,
|
||||
item.contentEpisodeNumber,
|
||||
config.get_localized_string(30163)))
|
||||
else:
|
||||
cabecera = config.get_localized_string(30163)
|
||||
# Se abre la ventana de seleccion
|
||||
if (item.contentSerieName != "" and
|
||||
item.contentSeason != "" and
|
||||
item.contentEpisodeNumber != ""):
|
||||
cabecera = ("%s - %sx%s -- %s" %
|
||||
(item.contentSerieName,
|
||||
item.contentSeason,
|
||||
item.contentEpisodeNumber,
|
||||
config.get_localized_string(30163)))
|
||||
else:
|
||||
cabecera = config.get_localized_string(30163)
|
||||
|
||||
seleccion = platformtools.dialog_select(cabecera, opciones)
|
||||
|
||||
if seleccion == -1:
|
||||
return
|
||||
else:
|
||||
item = videolibrary.play(itemlist[seleccion])[0]
|
||||
item.play_from = 'window'
|
||||
platformtools.play_video(item)
|
||||
seleccion = platformtools.dialog_select(cabecera, opciones)
|
||||
|
||||
if seleccion == -1:
|
||||
return
|
||||
else:
|
||||
item = videolibrary.play(itemlist[seleccion])[0]
|
||||
item.play_from = 'window'
|
||||
platformtools.play_video(item)
|
||||
|
||||
if (platformtools.is_playing() and item.action) or item.server == 'torrent' or autoplay.is_active(item.contentChannel):
|
||||
break
|
||||
|
||||
if it.show_server and check_next_ep:
|
||||
nextep.run(it)
|
||||
sleep(0.5)
|
||||
p_dialog.close()
|
||||
|
||||
from specials import autoplay
|
||||
if (platformtools.is_playing() and item.action) or item.server == 'torrent' or autoplay.is_active(item.contentChannel):
|
||||
break
|
||||
|
||||
@@ -12,7 +12,7 @@ import os
|
||||
import sys
|
||||
import urllib
|
||||
|
||||
import config
|
||||
# import config
|
||||
import xbmc
|
||||
import xbmcaddon
|
||||
import xbmcgui
|
||||
@@ -22,7 +22,7 @@ from channelselector import get_thumb
|
||||
from core import channeltools
|
||||
from core import trakt_tools, scrapertools
|
||||
from core.item import Item
|
||||
from platformcode import logger, keymaptools
|
||||
from platformcode import logger, keymaptools, config
|
||||
from platformcode import unify
|
||||
|
||||
addon = xbmcaddon.Addon('plugin.video.kod')
|
||||
@@ -683,8 +683,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
|
||||
# if item.play_from == 'window':
|
||||
# force_direct=True
|
||||
# logger.debug(item.tostring('\n'))
|
||||
logger.debug('item play: %s'%item)
|
||||
xbmc_player = XBMCPlayer()
|
||||
@@ -726,8 +726,8 @@ def play_video(item, strm=False, force_direct=False, autoplay=False):
|
||||
mediaurl, view, mpd = get_video_seleccionado(item, seleccion, video_urls)
|
||||
if mediaurl == "":
|
||||
return
|
||||
# no certificate verification
|
||||
mediaurl = mediaurl.replace('https://', 'http://')
|
||||
# # no certificate verification
|
||||
# mediaurl = mediaurl.replace('https://', 'http://')
|
||||
|
||||
# se obtiene la información del video.
|
||||
if not item.contentThumbnail:
|
||||
@@ -1079,7 +1079,7 @@ def get_video_seleccionado(item, seleccion, video_urls):
|
||||
|
||||
def set_player(item, xlistitem, mediaurl, view, strm):
|
||||
logger.info()
|
||||
logger.debug("item:\n" + item.tostring('\n'))
|
||||
# logger.debug("item:\n" + item.tostring('\n'))
|
||||
|
||||
# Movido del conector "torrent" aqui
|
||||
if item.server == "torrent":
|
||||
@@ -1101,7 +1101,7 @@ def set_player(item, xlistitem, mediaurl, view, strm):
|
||||
download_and_play.download_and_play(mediaurl, "download_and_play.mp4", config.get_setting("downloadpath"))
|
||||
return
|
||||
|
||||
elif config.get_setting("player_mode") == 0 or \
|
||||
elif config.get_setting("player_mode") == 0 or item.play_from == 'window' or\
|
||||
(config.get_setting("player_mode") == 3 and mediaurl.startswith("rtmp")):
|
||||
# Añadimos el listitem a una lista de reproducción (playlist)
|
||||
playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
|
||||
|
||||
@@ -251,7 +251,7 @@ def searchSubtitle(item):
|
||||
|
||||
|
||||
def saveSubtitleName(item):
|
||||
if item.show in item.title:
|
||||
if not item.show or item.show in item.title:
|
||||
title = item.title
|
||||
else:
|
||||
title = item.show + " - " + item.title
|
||||
|
||||
@@ -132,8 +132,12 @@ def check():
|
||||
urllib.urlretrieve(file['raw_url'], os.path.join(addonDir, file['filename']))
|
||||
else: # è un file NON testuale, lo devo scaricare
|
||||
# se non è già applicato
|
||||
if not (filetools.isfile(addonDir + file['filename']) and getSha(addonDir + file['filename']) == file['sha']):
|
||||
urllib.urlretrieve(file['raw_url'], os.path.join(addonDir, file['filename']))
|
||||
filename = os.path.join(addonDir, file['filename'])
|
||||
dirname = os.path.dirname(filename)
|
||||
if not (filetools.isfile(addonDir + file['filename']) and getSha(filename) == file['sha']):
|
||||
if not os.path.exists(dirname):
|
||||
os.makedirs(dirname)
|
||||
urllib.urlretrieve(file['raw_url'], filename)
|
||||
alreadyApplied = False
|
||||
elif file['status'] == 'removed':
|
||||
remove(addonDir+file["filename"])
|
||||
|
||||
Reference in New Issue
Block a user