Merge branch 'master' of https://github.com/alfa-addon/addon
This commit is contained in:
@@ -139,3 +139,8 @@ def findvideos(item):
|
||||
infoLabels={'title': item.fulltitle}, fulltitle=item.fulltitle,
|
||||
extra="library"))
|
||||
return itemlist
|
||||
|
||||
|
||||
def play(item):
|
||||
item.thumbnail = item.contentThumbnail
|
||||
return [item]
|
||||
|
||||
@@ -271,7 +271,7 @@ def findvideos(item):
|
||||
|
||||
idioma = IDIOMAS.get(idiomas_videos.get(language))
|
||||
titulo = "%s [" + idioma + "] [" + calidad_videos.get(calidad) + "]"
|
||||
itemlist.append(item.clone(action="play", title=titulo, url=url, extra=idioma))
|
||||
itemlist.append(item.clone(action="play", title=titulo, url=url, language = idioma, extra=idioma))
|
||||
|
||||
# Enlace Descarga
|
||||
patron = '<span class="movie-downloadlink-list" id_movies_types="([^"]+)" id_movies_servers="([^"]+)".*?id_lang=' \
|
||||
@@ -280,7 +280,7 @@ def findvideos(item):
|
||||
for calidad, servidor_num, language, url in matches:
|
||||
idioma = IDIOMAS.get(idiomas_videos.get(language))
|
||||
titulo = "[%s] [" + idioma + "] [" + calidad_videos.get(calidad) + "]"
|
||||
itemlist.append(item.clone(action="play", title=titulo, url=url, extra=idioma))
|
||||
itemlist.append(item.clone(action="play", title=titulo, url=url, language = idioma, extra=idioma))
|
||||
|
||||
itemlist = servertools.get_servers_itemlist(itemlist, lambda i: i.title % i.server.capitalize())
|
||||
itemlist.sort(key=lambda item: (item.extra, item.server))
|
||||
@@ -401,7 +401,7 @@ def findvideostv(item):
|
||||
idioma = IDIOMAS.get(idiomas_videos.get(language))
|
||||
titulo = "%s [" + idioma + "] (" + calidad_videos.get(quality) + ")"
|
||||
|
||||
itemlist.append(item.clone(action="play", title=titulo, url=url, contentType="episode"))
|
||||
itemlist.append(item.clone(action="play", title=titulo, url=url, language = idioma, contentType="episode"))
|
||||
|
||||
# Enlace Descarga
|
||||
patron = '<span class="movie-downloadlink-list" id_movies_types="([^"]+)" id_movies_servers="([^"]+)".*?episode="%s' \
|
||||
@@ -412,7 +412,7 @@ def findvideostv(item):
|
||||
for quality, servidor_num, episode, language, url in matches:
|
||||
idioma = IDIOMAS.get(idiomas_videos.get(language))
|
||||
titulo = "%s [" + idioma + "] (" + calidad_videos.get(quality) + ")"
|
||||
itemlist.append(item.clone(action="play", title=titulo, url=url, contentType="episode", server=server))
|
||||
itemlist.append(item.clone(action="play", title=titulo, url=url, language = idioma,contentType="episode", server=server))
|
||||
|
||||
itemlist = servertools.get_servers_itemlist(itemlist, lambda i: i.title % i.server.capitalize())
|
||||
itemlist.sort(key=lambda item: (int(item.infoLabels['episode']), item.title))
|
||||
|
||||
Executable → Regular
+2
-2
@@ -162,7 +162,7 @@ def episodios(item):
|
||||
|
||||
for scrapedurl, scrapedlang, scrapedtitle in matches:
|
||||
language = scrapedlang
|
||||
title = scrapedtitle + ' (%s)' % language
|
||||
title = scrapedtitle
|
||||
url = scrapedurl
|
||||
itemlist.append(item.clone(title=title, url=url, action='findvideos', language=language))
|
||||
return itemlist
|
||||
@@ -176,7 +176,7 @@ def findvideos(item):
|
||||
itemlist.extend(servertools.find_video_items(data=data))
|
||||
|
||||
for videoitem in itemlist:
|
||||
title = item.title+' (%s)'%videoitem.server
|
||||
title = item.title
|
||||
videoitem.channel = item.channel
|
||||
videoitem.title = title
|
||||
videoitem.action = 'play'
|
||||
|
||||
Executable → Regular
+8
-7
@@ -135,18 +135,19 @@ def entradas(item):
|
||||
scrapedthumbnail = host + urllib.quote(scrapedthumbnail)
|
||||
title = scrapedtitle
|
||||
if "full_hd" in extra:
|
||||
scrapedtitle += " [COLOR gold][3D][/COLOR]"
|
||||
quality = "3D"
|
||||
elif "720" in extra:
|
||||
scrapedtitle += " [COLOR gold][720p][/COLOR]"
|
||||
quality ='720'
|
||||
else:
|
||||
scrapedtitle += " [COLOR gold][SD][/COLOR]"
|
||||
quality = 'SD'
|
||||
|
||||
year = year.replace("\xc2\xa0", "").replace(" ", "")
|
||||
if not year.isspace() and year != "":
|
||||
infolab['year'] = int(year)
|
||||
scrapedtitle += " (" + year + ")"
|
||||
itemlist.append(item.clone(action="findvideos", title=scrapedtitle, fulltitle=title,
|
||||
url=scrapedurl, thumbnail=scrapedthumbnail, infoLabels=infolab))
|
||||
|
||||
itemlist.append(item.clone(action="findvideos", title=title, fulltitle=title,
|
||||
url=scrapedurl, thumbnail=scrapedthumbnail, infoLabels=infolab, contentTitle =
|
||||
title, quality = quality))
|
||||
|
||||
next_page = scrapertools.find_single_match(data2, '<a href="([^"]+)"> ></a>')
|
||||
if next_page:
|
||||
@@ -171,7 +172,7 @@ def findvideos(item):
|
||||
url_sub = host + urllib.quote(url_sub)
|
||||
title = "Ver video en [[COLOR %s]%s[/COLOR]] Sub %s" % (color3, quality, label)
|
||||
itemlist.append(item.clone(action="play", server="directo", title=title,
|
||||
url=url, subtitle=url_sub, extra=item.url, calidad=quality))
|
||||
url=url, subtitle=url_sub, extra=item.url, quality=quality, language = label))
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
Executable → Regular
Executable → Regular
+1
-1
@@ -164,7 +164,7 @@ def findvideos(item):
|
||||
itemlist.extend(servertools.find_video_items(data=scrapedurl))
|
||||
|
||||
for videoitem in itemlist:
|
||||
videoitem.title = item.contentTitle + ' (' + videoitem.server + ')'
|
||||
videoitem.title = item.contentTitle
|
||||
videoitem.channel = item.channel
|
||||
videoitem.plot = info
|
||||
videoitem.action = "play"
|
||||
|
||||
@@ -307,6 +307,7 @@ def bloque_enlaces(data, filtro_idioma, dict_idiomas, type, item):
|
||||
patron = '(?is)#(option-[^"]+).*?png">([^<]+)'
|
||||
match = scrapertools.find_multiple_matches(data, patron)
|
||||
for scrapedoption, language in match:
|
||||
scrapedserver = ""
|
||||
lazy = ""
|
||||
if "lazy" in bloque1:
|
||||
lazy = "lazy-"
|
||||
@@ -314,7 +315,9 @@ def bloque_enlaces(data, filtro_idioma, dict_idiomas, type, item):
|
||||
url = scrapertools.find_single_match(bloque1, patron)
|
||||
if "goo.gl" in url:
|
||||
url = httptools.downloadpage(url, follow_redirects=False, only_headers=True).headers.get("location", "")
|
||||
matches.append([url, "", "", language.strip(), t_tipo])
|
||||
if "player" in url:
|
||||
scrapedserver = scrapertools.find_single_match(url, 'player/(\w+)')
|
||||
matches.append([url, scrapedserver, "", language.strip(), t_tipo])
|
||||
bloque2 = scrapertools.find_single_match(data, '(?s)box_links.*?dt_social_single')
|
||||
bloque2 = bloque2.replace("\t", "").replace("\r", "")
|
||||
patron = '(?s)optn" href="([^"]+)'
|
||||
@@ -369,7 +372,7 @@ def play(item):
|
||||
data = httptools.downloadpage(item.url).data
|
||||
scrapedurl = scrapertools.find_single_match(data, '<a href="(http[^"]+)')
|
||||
if scrapedurl == "":
|
||||
scrapedurl = scrapertools.find_single_match(data, '(?i)<frame src="(http[^"]+)')
|
||||
scrapedurl = scrapertools.find_single_match(data, '(?i)frame.*?src="(http[^"]+)')
|
||||
if scrapedurl == "":
|
||||
scrapedurl = scrapertools.find_single_match(data, 'replace."([^"]+)"')
|
||||
elif "goo.gl" in scrapedurl:
|
||||
|
||||
Executable → Regular
+1
-1
@@ -299,7 +299,7 @@ def findvideos(item):
|
||||
if "partes" in title:
|
||||
action = "extract_url"
|
||||
new_item = Item(channel=item.channel, action=action, title=title, fulltitle=title, url=url,
|
||||
thumbnail=thumbnail, plot=plot, parentContent=item)
|
||||
thumbnail=thumbnail, plot=plot, parentContent=item, server = servername)
|
||||
if comentarios.startswith("Ver en"):
|
||||
itemlist_ver.append(new_item)
|
||||
else:
|
||||
|
||||
Executable
+92
@@ -0,0 +1,92 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#------------------------------------------------------------
|
||||
# XBMC Plugin
|
||||
#------------------------------------------------------------
|
||||
|
||||
import xbmcgui
|
||||
import xbmc
|
||||
|
||||
from platformcode import config
|
||||
from core import filetools
|
||||
|
||||
main = None
|
||||
|
||||
|
||||
MAIN_MENU = {
|
||||
"news" : {"label" : "Novedades", "icon" : filetools.join(config.get_runtime_path(),"resources","media","general","default","thumb_news.png"), "order": 0},
|
||||
"channels" : {"label" : "Canales", "icon" : filetools.join(config.get_runtime_path(),"resources","media","general","default","thumb_channels.png"), "order": 1},
|
||||
"search" : {"label" : "Buscador", "icon" : filetools.join(config.get_runtime_path(),"resources","media","general","default","thumb_search.png"), "order": 2},
|
||||
"favorites" : {"label" : "Favoritos", "icon" : filetools.join(config.get_runtime_path(),"resources","media","general","default","thumb_favorites.png"), "order": 3},
|
||||
"videolibrary" : {"label" : "Videoteca", "icon" : filetools.join(config.get_runtime_path(),"resources","media","general","default","thumb_videolibrary.png"), "order": 4},
|
||||
"downloads" : {"label" : "Descargas", "icon" : filetools.join(config.get_runtime_path(),"resources","media","general","default","thumb_downloads.png"), "order": 5},
|
||||
"settings" : {"label" : "Configuración", "icon" : filetools.join(config.get_runtime_path(),"resources","media","general","default","thumb_setting_0.png"), "order": 6},
|
||||
}
|
||||
|
||||
|
||||
|
||||
class Main(xbmcgui.WindowXMLDialog):
|
||||
|
||||
def __init__( self, *args, **kwargs ):
|
||||
self.items = []
|
||||
self.open = kwargs.get("open")
|
||||
|
||||
def onInit(self):
|
||||
self.setCoordinateResolution(2)
|
||||
|
||||
|
||||
if self.open:
|
||||
for menuentry in MAIN_MENU.keys():
|
||||
item = xbmcgui.ListItem(MAIN_MENU[menuentry]["label"])
|
||||
item.setProperty("thumb",str(MAIN_MENU[menuentry]["icon"]))
|
||||
item.setProperty("identifier",str(menuentry))
|
||||
item.setProperty("order", str(MAIN_MENU[menuentry]["order"]))
|
||||
self.items.append(item)
|
||||
|
||||
self.items.sort(key=lambda it:int(it.getProperty("order")))
|
||||
self.getControl(32500).addItems(self.items)
|
||||
self.setFocusId(32500)
|
||||
self.open = False
|
||||
|
||||
def onClick(self,controlId):
|
||||
if controlId == 32500:
|
||||
identifier = self.getControl(32500).getSelectedItem().getProperty("identifier")
|
||||
if identifier == "news":
|
||||
self.close()
|
||||
xbmc.executebuiltin('ActivateWindow(10025, "plugin://plugin.video.alfa/?ew0KICAgICJhY3Rpb24iOiAibWFpbmxpc3QiLCANCiAgICAiY2hhbm5lbCI6ICJuZXdzIg0KfQ==")')
|
||||
elif identifier == "channels":
|
||||
self.close()
|
||||
xbmc.executebuiltin('ActivateWindow(10025, "plugin://plugin.video.alfa/?ew0KICAgICJhY3Rpb24iOiAiZ2V0Y2hhbm5lbHR5cGVzIiwgDQogICAgImNoYW5uZWwiOiAiY2hhbm5lbHNlbGVjdG9yIg0KfQ==")')
|
||||
elif identifier == "search":
|
||||
self.close()
|
||||
xbmc.executebuiltin('ActivateWindow(10025, "plugin://plugin.video.alfa/?ew0KICAgICJhY3Rpb24iOiAibWFpbmxpc3QiLCANCiAgICAiY2hhbm5lbCI6ICJzZWFyY2giDQp9")')
|
||||
elif identifier == "favorites":
|
||||
self.close()
|
||||
xbmc.executebuiltin('ActivateWindow(10025, "plugin://plugin.video.alfa/?ew0KICAgICJhY3Rpb24iOiAibWFpbmxpc3QiLCANCiAgICAiY2hhbm5lbCI6ICJmYXZvcml0ZXMiDQp9")')
|
||||
elif identifier == "videolibrary":
|
||||
self.close()
|
||||
xbmc.executebuiltin('ActivateWindow(10025, "plugin://plugin.video.alfa/?ew0KICAgICJhY3Rpb24iOiAibWFpbmxpc3QiLCANCiAgICAiY2hhbm5lbCI6ICJ2aWRlb2xpYnJhcnkiDQp9")')
|
||||
elif identifier == "downloads":
|
||||
self.close()
|
||||
xbmc.executebuiltin('ActivateWindow(10025, "plugin://plugin.video.alfa/?ew0KICAgICJhY3Rpb24iOiAibWFpbmxpc3QiLCANCiAgICAiY2hhbm5lbCI6ICJkb3dubG9hZHMiDQp9")')
|
||||
elif identifier == "settings":
|
||||
self.close()
|
||||
xbmc.executebuiltin('ActivateWindow(10025, "plugin://plugin.video.alfa/?ew0KICAgICJhY3Rpb24iOiAibWFpbmxpc3QiLCANCiAgICAiY2hhbm5lbCI6ICJzZXR0aW5nIg0KfQ==")')
|
||||
|
||||
|
||||
|
||||
def onAction(self,action):
|
||||
#exit
|
||||
global main
|
||||
if action.getId() == 92 or action.getId() == 10:
|
||||
main.close()
|
||||
del main
|
||||
if action.getId() == 117:
|
||||
config.open_settings()
|
||||
|
||||
|
||||
def start(item):
|
||||
global main
|
||||
main = Main('script-shortcut-menu.xml',config.get_runtime_path(),open=True)
|
||||
main.doModal()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user