Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -28,7 +28,7 @@ def findhost():
|
|||||||
host = config.get_channel_url(findhost)
|
host = config.get_channel_url(findhost)
|
||||||
headers = [['Referer', host]]
|
headers = [['Referer', host]]
|
||||||
|
|
||||||
list_servers = ['verystream','openload','rapidvideo','streamango']
|
list_servers = ['mixdrop','vidoza','cloudvideo','vup','supervideo','gounlimited']
|
||||||
list_quality = ['default']
|
list_quality = ['default']
|
||||||
|
|
||||||
@support.menu
|
@support.menu
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ __channel__ = "altadefinizione01_link"
|
|||||||
host = config.get_channel_url()
|
host = config.get_channel_url()
|
||||||
headers = [['Referer', host]]
|
headers = [['Referer', host]]
|
||||||
|
|
||||||
list_servers = ['supervideo', 'streamcherry','rapidvideo', 'streamango', 'openload']
|
list_servers = ['mixdrop', 'vup', 'supervideo']
|
||||||
list_quality = ['default']
|
list_quality = ['default']
|
||||||
|
|
||||||
# =========== home menu ===================
|
# =========== home menu ===================
|
||||||
|
|||||||
@@ -28,9 +28,8 @@ def findhost():
|
|||||||
|
|
||||||
host = config.get_channel_url(findhost)
|
host = config.get_channel_url(findhost)
|
||||||
headers = [['Referer', host]]
|
headers = [['Referer', host]]
|
||||||
list_servers = ['verystream', 'rapidvideo', 'openload', 'streamango', 'vidoza',
|
list_servers = ['mixdrop', 'vidcloud', 'vidoza', 'supervideo', 'hdload', 'mystream']
|
||||||
'vidcloud', 'thevideo', 'okru', 'hdload', 'youtube']
|
list_quality = ['1080p', '720p', '360p']
|
||||||
list_quality = ['1080p', '720', '360']
|
|
||||||
|
|
||||||
@support.menu
|
@support.menu
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ def findhost():
|
|||||||
host = config.get_channel_url(findhost)
|
host = config.get_channel_url(findhost)
|
||||||
headers = [['Referer', host]]
|
headers = [['Referer', host]]
|
||||||
|
|
||||||
list_servers = ['verystream', 'openload', 'streamango', 'wstream']
|
list_servers = ['mixdrop', 'akstream', 'wstream', 'backin']
|
||||||
list_quality = ['HD', 'SD', 'default']
|
list_quality = ['HD', 'SD', 'default']
|
||||||
|
|
||||||
checklinks = config.get_setting('checklinks', 'cineblog01')
|
checklinks = config.get_setting('checklinks', 'cineblog01')
|
||||||
|
|||||||
+58
-42
@@ -448,6 +448,7 @@ def play_from_library(item):
|
|||||||
import xbmcplugin
|
import xbmcplugin
|
||||||
import xbmc
|
import xbmc
|
||||||
from time import sleep, time
|
from time import sleep, time
|
||||||
|
from specials import nextep
|
||||||
|
|
||||||
# Intentamos reproducir una imagen (esto no hace nada y ademas no da error)
|
# Intentamos reproducir una imagen (esto no hace nada y ademas no da error)
|
||||||
xbmcplugin.setResolvedUrl(int(sys.argv[1]), True,
|
xbmcplugin.setResolvedUrl(int(sys.argv[1]), True,
|
||||||
@@ -460,8 +461,10 @@ def play_from_library(item):
|
|||||||
|
|
||||||
# modificamos el action (actualmente la videoteca necesita "findvideos" ya que es donde se buscan las fuentes
|
# modificamos el action (actualmente la videoteca necesita "findvideos" ya que es donde se buscan las fuentes
|
||||||
item.action = "findvideos"
|
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
|
# y volvemos a lanzar kodi
|
||||||
if xbmc.getCondVisibility('Window.IsMedia') and not window_type == 1:
|
if xbmc.getCondVisibility('Window.IsMedia') and not window_type == 1:
|
||||||
@@ -472,60 +475,69 @@ def play_from_library(item):
|
|||||||
|
|
||||||
# Ventana emergente
|
# Ventana emergente
|
||||||
item.play_from = 'window'
|
item.play_from = 'window'
|
||||||
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 = platformtools.dialog_progress_bg(config.get_localized_string(20000), config.get_localized_string(70004))
|
||||||
p_dialog.update(0, '')
|
p_dialog.update(0, '')
|
||||||
|
|
||||||
itemlist = videolibrary.findvideos(item)
|
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():
|
else:
|
||||||
# Ventana convencional
|
while platformtools.is_playing():
|
||||||
sleep(5)
|
# Ventana convencional
|
||||||
p_dialog.update(50, '')
|
sleep(5)
|
||||||
|
p_dialog.update(50, '')
|
||||||
|
|
||||||
'''# Se filtran los enlaces segun la lista negra
|
it = item
|
||||||
if config.get_setting('filter_servers', "servers"):
|
if item.show_server or not check_next_ep:
|
||||||
itemlist = servertools.filter_servers(itemlist)'''
|
|
||||||
|
|
||||||
# Se limita la cantidad de enlaces a mostrar
|
'''# Se filtran los enlaces segun la lista negra
|
||||||
if config.get_setting("max_links", "videolibrary") != 0:
|
if config.get_setting('filter_servers', "servers"):
|
||||||
itemlist = limit_itemlist(itemlist)
|
itemlist = servertools.filter_servers(itemlist)'''
|
||||||
|
|
||||||
# Se "limpia" ligeramente la lista de enlaces
|
# Se limita la cantidad de enlaces a mostrar
|
||||||
if config.get_setting("replace_VD", "videolibrary") == 1:
|
if config.get_setting("max_links", "videolibrary") != 0:
|
||||||
itemlist = reorder_itemlist(itemlist)
|
itemlist = limit_itemlist(itemlist)
|
||||||
|
|
||||||
|
# Se "limpia" ligeramente la lista de enlaces
|
||||||
|
if config.get_setting("replace_VD", "videolibrary") == 1:
|
||||||
|
itemlist = reorder_itemlist(itemlist)
|
||||||
|
|
||||||
|
|
||||||
p_dialog.update(100, '')
|
p_dialog.update(100, '')
|
||||||
sleep(0.5)
|
sleep(0.5)
|
||||||
p_dialog.close()
|
p_dialog.close()
|
||||||
|
|
||||||
|
|
||||||
if len(itemlist) > 0:
|
if len(itemlist) > 0:
|
||||||
while not xbmc.Monitor().abortRequested():
|
while not xbmc.Monitor().abortRequested():
|
||||||
# El usuario elige el mirror
|
# El usuario elige el mirror
|
||||||
opciones = []
|
opciones = []
|
||||||
for item in itemlist:
|
for item in itemlist:
|
||||||
opciones.append(item.title)
|
opciones.append(item.title)
|
||||||
|
|
||||||
# Se abre la ventana de seleccion
|
# Se abre la ventana de seleccion
|
||||||
if (item.contentSerieName != "" and
|
if (item.contentSerieName != "" and
|
||||||
item.contentSeason != "" and
|
item.contentSeason != "" and
|
||||||
item.contentEpisodeNumber != ""):
|
item.contentEpisodeNumber != ""):
|
||||||
cabecera = ("%s - %sx%s -- %s" %
|
cabecera = ("%s - %sx%s -- %s" %
|
||||||
(item.contentSerieName,
|
(item.contentSerieName,
|
||||||
item.contentSeason,
|
item.contentSeason,
|
||||||
item.contentEpisodeNumber,
|
item.contentEpisodeNumber,
|
||||||
config.get_localized_string(30163)))
|
config.get_localized_string(30163)))
|
||||||
else:
|
else:
|
||||||
cabecera = config.get_localized_string(30163)
|
cabecera = config.get_localized_string(30163)
|
||||||
|
|
||||||
SHOW = True
|
|
||||||
if config.get_setting('autoplay') and config.get_setting('hide_servers'):
|
|
||||||
SHOW = False
|
|
||||||
|
|
||||||
if SHOW:
|
|
||||||
seleccion = platformtools.dialog_select(cabecera, opciones)
|
seleccion = platformtools.dialog_select(cabecera, opciones)
|
||||||
|
|
||||||
if seleccion == -1:
|
if seleccion == -1:
|
||||||
@@ -534,8 +546,12 @@ def play_from_library(item):
|
|||||||
item = videolibrary.play(itemlist[seleccion])[0]
|
item = videolibrary.play(itemlist[seleccion])[0]
|
||||||
platformtools.play_video(item)
|
platformtools.play_video(item)
|
||||||
|
|
||||||
from specials import autoplay
|
if (platformtools.is_playing() and item.action) or item.server == 'torrent' or autoplay.is_active(item.contentChannel):
|
||||||
if (platformtools.is_playing() and item.action) or item.server == 'torrent' or autoplay.is_active(item.contentChannel):
|
break
|
||||||
break
|
|
||||||
|
|
||||||
|
if it.show_server and check_next_ep:
|
||||||
|
logger.info('PARTITO')
|
||||||
|
nextep.run(it)
|
||||||
|
sleep(0.5)
|
||||||
|
p_dialog.close()
|
||||||
|
|
||||||
|
|||||||
@@ -1140,10 +1140,6 @@ def set_player(item, xlistitem, mediaurl, view, strm):
|
|||||||
from platformcode import xbmc_videolibrary
|
from platformcode import xbmc_videolibrary
|
||||||
xbmc_videolibrary.mark_auto_as_watched(item)
|
xbmc_videolibrary.mark_auto_as_watched(item)
|
||||||
|
|
||||||
if (strm or item.strm_path) and config.get_setting('next_ep') > 0 and item.contentType != 'movie' and item.play_from != 'window':
|
|
||||||
from specials.nextep import afther_stop
|
|
||||||
afther_stop(item)
|
|
||||||
|
|
||||||
|
|
||||||
def torrent_client_installed(show_tuple=False):
|
def torrent_client_installed(show_tuple=False):
|
||||||
# Plugins externos se encuentra en servers/torrent.json nodo clients
|
# Plugins externos se encuentra en servers/torrent.json nodo clients
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
<setting id="videolibrary_kodi" type="bool" label="70120" enable="lt(-1,2)+eq(0,false)" default="false"/>
|
<setting id="videolibrary_kodi" type="bool" label="70120" enable="lt(-1,2)+eq(0,false)" default="false"/>
|
||||||
<setting id="videolibrary_max_quality" type="bool" label="70729" default="false" visible="true"/>
|
<setting id="videolibrary_max_quality" type="bool" label="70729" default="false" visible="true"/>
|
||||||
<setting id="next_ep" type="enum" label="70746" lvalues="70752|70747|70748" default="0"/>
|
<setting id="next_ep" type="enum" label="70746" lvalues="70752|70747|70748" default="0"/>
|
||||||
<setting id="next_ep_seconds" type="enum" values="20|30|40|50|60" label="secondi prima della finestra" default="3" visible="eq(-1,2)"/>
|
<setting id="next_ep_seconds" type="enum" values="20|30|40|50|60" label="70749" default="2" visible="!eq(-1,0)"/>
|
||||||
</category>
|
</category>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+96
-83
@@ -1,30 +1,73 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import xbmc, os, urlparse
|
import xbmc, xbmcgui, os
|
||||||
from platformcode import config, platformtools, logger
|
from platformcode import config, platformtools, logger
|
||||||
from time import time, sleep
|
from time import time, sleep
|
||||||
from core import scrapertools
|
from core import scrapertools
|
||||||
from core import jsontools, filetools
|
from core import jsontools, filetools
|
||||||
import threading
|
from lib.concurrent import futures
|
||||||
|
|
||||||
|
PLAYER_STOP = 13
|
||||||
|
|
||||||
|
def check(item):
|
||||||
|
return True if config.get_setting('next_ep') > 0 and item.contentType != 'movie' else False
|
||||||
|
|
||||||
|
|
||||||
def afther_stop(item):
|
def return_item(item):
|
||||||
logger.info('AS ITEM\n'+str(item))
|
logger.info('AS ITEM\n'+str(item))
|
||||||
def next_ep(item):
|
with futures.ThreadPoolExecutor() as executor:
|
||||||
logger.info()
|
future = executor.submit(next_ep, item)
|
||||||
condition = config.get_setting('next_ep')
|
item = future.result()
|
||||||
# from core.support import dbg; dbg()
|
return item
|
||||||
|
|
||||||
if condition == 1: # Hide servers afther stop video
|
def run(item):
|
||||||
while not platformtools.is_playing():
|
logger.info('AS ITEM\n'+str(item))
|
||||||
pass
|
with futures.ThreadPoolExecutor() as executor:
|
||||||
while platformtools.is_playing():
|
future = executor.submit(next_ep, item)
|
||||||
pass
|
item = future.result()
|
||||||
sleep(0.5)
|
if item.next_ep:
|
||||||
xbmc.executebuiltin('Action(Back)')
|
from platformcode.launcher import play_from_library
|
||||||
|
return play_from_library(item)
|
||||||
|
|
||||||
elif condition == 2: # Bring servers afther stop video
|
|
||||||
from platformcode.launcher import play_from_library
|
def videolibrary(item):
|
||||||
# Check if next episode exist
|
from threading import Thread
|
||||||
|
item.videolibrary = True
|
||||||
|
Thread(target=next_ep, args=[item]).start()
|
||||||
|
|
||||||
|
|
||||||
|
def next_ep(item):
|
||||||
|
logger.info()
|
||||||
|
condition = config.get_setting('next_ep')
|
||||||
|
item.next_ep = False
|
||||||
|
item.show_server = True
|
||||||
|
|
||||||
|
VL = True if item.videolibrary else False
|
||||||
|
|
||||||
|
time_over = False
|
||||||
|
time_limit = time() + 30
|
||||||
|
time_steps = [20,30,40,50,60]
|
||||||
|
TimeFromEnd = time_steps[config.get_setting('next_ep_seconds')]
|
||||||
|
|
||||||
|
# wait until the video plays
|
||||||
|
while not platformtools.is_playing() and time() < time_limit:
|
||||||
|
sleep(1)
|
||||||
|
|
||||||
|
while platformtools.is_playing() and time_over == False:
|
||||||
|
try:
|
||||||
|
Total = xbmc.Player().getTotalTime()
|
||||||
|
Actual = xbmc.Player().getTime()
|
||||||
|
Difference = Total - Actual
|
||||||
|
if Total > TimeFromEnd >= Difference:
|
||||||
|
time_over = True
|
||||||
|
except:
|
||||||
|
break
|
||||||
|
|
||||||
|
if time_over:
|
||||||
|
if condition == 1: # hide server afther x second
|
||||||
|
item.show_server = False
|
||||||
|
elif condition == 2: # play next fileif exist
|
||||||
|
|
||||||
|
# check i next file exist
|
||||||
current_filename = os.path.basename(item.strm_path)
|
current_filename = os.path.basename(item.strm_path)
|
||||||
base_path = os.path.basename(os.path.normpath(os.path.dirname(item.strm_path)))
|
base_path = os.path.basename(os.path.normpath(os.path.dirname(item.strm_path)))
|
||||||
logger.info('PATH:' + base_path)
|
logger.info('PATH:' + base_path)
|
||||||
@@ -34,7 +77,7 @@ def afther_stop(item):
|
|||||||
for file in os.listdir(path):
|
for file in os.listdir(path):
|
||||||
if file.endswith('.strm'):
|
if file.endswith('.strm'):
|
||||||
fileList.append(file)
|
fileList.append(file)
|
||||||
# from core.support import dbg; dbg()
|
|
||||||
nextIndex = fileList.index(current_filename) + 1
|
nextIndex = fileList.index(current_filename) + 1
|
||||||
if nextIndex == 0 or nextIndex == len(fileList):
|
if nextIndex == 0 or nextIndex == len(fileList):
|
||||||
next_file = None
|
next_file = None
|
||||||
@@ -43,82 +86,52 @@ def afther_stop(item):
|
|||||||
|
|
||||||
# start next episode window afther x time
|
# start next episode window afther x time
|
||||||
if next_file:
|
if next_file:
|
||||||
play_next = False
|
from core.item import Item
|
||||||
time_limit = time() + 30
|
season_ep = next_file.split('.')[0]
|
||||||
time_steps = [20,30,40,50,60]
|
season = season_ep.split('x')[0]
|
||||||
TimeFromEnd = time_steps[config.get_setting('next_ep_seconds')]
|
episode = season_ep.split('x')[1]
|
||||||
logger.info('TEMPO: '+str(TimeFromEnd))
|
next_ep = '%sx%s' % (season, episode)
|
||||||
while not platformtools.is_playing() and time() < time_limit:
|
item = Item(
|
||||||
sleep(1)
|
action= 'play_from_library',
|
||||||
|
channel= 'videolibrary',
|
||||||
|
contentEpisodeNumber= episode,
|
||||||
|
contentSeason= season,
|
||||||
|
contentTitle= next_ep,
|
||||||
|
contentType= 'tvshow',
|
||||||
|
infoLabels= {'episode': episode, 'mediatype': 'tvshow', 'season': season, 'title': next_ep},
|
||||||
|
strm_path= filetools.join(base_path, next_file))
|
||||||
|
|
||||||
sleep(1)
|
global ITEM
|
||||||
|
ITEM = item
|
||||||
|
|
||||||
while platformtools.is_playing() and play_next == False:
|
nextDialog = NextDialog('NextDialog.xml', config.get_runtime_path())
|
||||||
try:
|
nextDialog.show()
|
||||||
Total = xbmc.Player().getTotalTime()
|
while platformtools.is_playing() and not nextDialog.is_still_watching():
|
||||||
Actual = xbmc.Player().getTime()
|
xbmc.sleep(100)
|
||||||
Difference = Total - Actual
|
pass
|
||||||
if Total > TimeFromEnd >= Difference:
|
|
||||||
play_next = True
|
|
||||||
except:
|
|
||||||
break
|
|
||||||
|
|
||||||
# from core.support import dbg; dbg()
|
nextDialog.close()
|
||||||
if play_next:
|
logger.info('CONTINUE: ' +str(nextDialog.stillwatching))
|
||||||
from core.item import Item
|
|
||||||
play_next = False
|
|
||||||
season_ep = next_file.split('.')[0]
|
|
||||||
season = season_ep.split('x')[0]
|
|
||||||
episode = season_ep.split('x')[1]
|
|
||||||
next_ep = '%sx%s' % (season, episode)
|
|
||||||
item = Item(
|
|
||||||
action= 'play_from_library',
|
|
||||||
channel= 'videolibrary',
|
|
||||||
contentEpisodeNumber= episode,
|
|
||||||
contentSeason= season,
|
|
||||||
contentTitle= next_ep,
|
|
||||||
contentType= 'tvshow',
|
|
||||||
infoLabels= {'episode': episode, 'mediatype': 'tvshow', 'season': season, 'title': next_ep},
|
|
||||||
strm_path= filetools.join(base_path, next_file))
|
|
||||||
|
|
||||||
# item.contentSeason = item.infoLabels['season'] = season
|
|
||||||
# item.contentEpisodeNumber = item.infoLabels['episode'] = episode
|
|
||||||
# item.contentTitle = item.infoLabels['title'] = next_ep
|
|
||||||
# item.strm_path = filetools.join(base_path, next_file)
|
|
||||||
# logger.info('ITEM SUBMITTED:\n'+str(item))
|
|
||||||
|
|
||||||
global ITEM
|
if nextDialog.stillwatching or nextDialog.continuewatching:
|
||||||
ITEM = item
|
item.next_ep = True
|
||||||
nextDialog = NextDialog('NextDialog.xml', config.get_runtime_path())
|
xbmc.Player().stop()
|
||||||
nextDialog.show()
|
if VL:
|
||||||
while platformtools.is_playing() and not nextDialog.is_still_watching():
|
|
||||||
xbmc.sleep(100)
|
|
||||||
pass
|
|
||||||
|
|
||||||
nextDialog.close()
|
|
||||||
logger.info('CONTINUA: ' +str(nextDialog.stillwatching))
|
|
||||||
|
|
||||||
if nextDialog.stillwatching or nextDialog.continuewatching:
|
|
||||||
xbmc.Player().stop()
|
|
||||||
sleep(1)
|
|
||||||
logger.info('BACK STILL')
|
logger.info('BACK STILL')
|
||||||
|
sleep(1)
|
||||||
xbmc.executebuiltin('Action(Back)')
|
xbmc.executebuiltin('Action(Back)')
|
||||||
sleep(0.5)
|
sleep(0.5)
|
||||||
|
from platformcode.launcher import play_from_library
|
||||||
return play_from_library(item)
|
return play_from_library(item)
|
||||||
else:
|
else:
|
||||||
|
item.show_server = False
|
||||||
|
if VL:
|
||||||
sleep(1)
|
sleep(1)
|
||||||
logger.info('BACK NOT STILL')
|
|
||||||
xbmc.executebuiltin('Action(Back)')
|
xbmc.executebuiltin('Action(Back)')
|
||||||
|
sleep(0.5)
|
||||||
|
return None
|
||||||
|
|
||||||
else:
|
return item
|
||||||
return None
|
|
||||||
|
|
||||||
thread = threading.Thread(target = next_ep, args = [item])
|
|
||||||
thread.start()
|
|
||||||
|
|
||||||
import xbmcgui
|
|
||||||
|
|
||||||
PLAYER_STOP = 13
|
|
||||||
|
|
||||||
|
|
||||||
class NextDialog(xbmcgui.WindowXMLDialog):
|
class NextDialog(xbmcgui.WindowXMLDialog):
|
||||||
|
|||||||
@@ -577,7 +577,11 @@ def findvideos(item):
|
|||||||
|
|
||||||
# return sorted(itemlist, key=lambda it: it.title.lower())
|
# return sorted(itemlist, key=lambda it: it.title.lower())
|
||||||
autoplay.play_multi_channel(item, itemlist)
|
autoplay.play_multi_channel(item, itemlist)
|
||||||
|
from inspect import stack
|
||||||
|
from specials import nextep
|
||||||
|
logger.info('STACK= ' + stack()[1][3])
|
||||||
|
if nextep.check(item) and stack()[1][3] == 'run':
|
||||||
|
nextep.videolibrary(item)
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user