.*?href="(.*?)" title="(.*?)".*?under-title">(.*?)<.*?src="(.*?)"'
- matches = re.compile(patron,re.DOTALL).findall(data)
-
+ patron = '
.*?href="(.*?)" title="(.*?)".*?under-title">(.*?)<.*?src="(.*?)"'
+ matches = scrapertools.find_multiple_matches(data, patron)
for scrapedurl, scrapedyear, scrapedtitle, scrapedthumbnail in matches:
-
- url = scrapedurl
- title = scrapedtitle
year = scrapertools.find_single_match(scrapedyear, r'.*?\((\d{4})\)')
- thumbnail = scrapedthumbnail
- new_item =Item (channel = item.channel, action="findvideos", title=title, contentTitle=title, url=url,
- thumbnail=thumbnail, infoLabels = {'year':year})
- if year:
- tmdb.set_infoLabels_item(new_item)
+ itemlist.append(Item(channel=item.channel, action="findvideos", title=scrapedtitle, fulltitle = scrapedtitle, url=scrapedurl,
+ thumbnail=scrapedthumbnail, infoLabels={'year': year}))
- itemlist.append(new_item)
-
- next_page_url = scrapertools.find_single_match(data,'
')
- if next_page_url!="":
- next_page_url = urlparse.urljoin(item.url,next_page_url)
+ tmdb.set_infoLabels(itemlist, True)
+ next_page_url = scrapertools.find_single_match(data, '
([^<]+)'
+ matches = scrapertools.find_multiple_matches(data, patron)
+ for url, language in matches:
+ url = url.replace("&", "&")
+ response = httptools.downloadpage(url, follow_redirects=False, add_referer=True)
+ if response.data:
+ url = scrapertools.find_single_match(response.data, 'src="([^"]+)"')
+ else:
+ url = response.headers.get("location", "")
+ url = url.replace(""","")
+ titulo = "Ver en %s (" + language + ")"
+ itemlist.append(item.clone(
+ action = "play",
+ title = titulo,
+ url = url,
+ language = language))
+ tmdb.set_infoLabels(itemlist, True)
+ itemlist = servertools.get_servers_itemlist(itemlist, lambda i: i.title % i.server.capitalize())
+ return itemlist
+
+
+def play(item):
+ item.thumbnail = item.contentThumbnail
+ return [item]
diff --git a/plugin.video.alfa/channels/hdfull.py b/plugin.video.alfa/channels/hdfull.py
index bc2d90af..76b6375f 100644
--- a/plugin.video.alfa/channels/hdfull.py
+++ b/plugin.video.alfa/channels/hdfull.py
@@ -634,7 +634,7 @@ def findvideos(item):
title_label = bbcode_kodi2html(" ( [COLOR green][B]Tráiler[/B][/COLOR] )")
itemlist.append(
- Item(channel=item.channel, action="trailer", title=title_label, fulltitle=title_label, url=url_targets,
+ Item(channel=item.channel, action="buscartrailer", title=title_label, fulltitle=title_label, url=url_targets,
thumbnail=item.thumbnail, show=item.show))
itemlist.append(Item(channel=item.channel, action="set_status", title=title, fulltitle=title, url=url_targets,
@@ -676,93 +676,39 @@ def findvideos(item):
matches.append([match["lang"], match["quality"], url, embed])
- enlaces = []
for idioma, calidad, url, embed in matches:
- servername = scrapertools.find_single_match(url, "(?:http:|https:)//(?:www.|)([^.]+).")
- if servername == "streamin": servername = "streaminto"
- if servername == "waaw": servername = "netutv"
- if servername == "uploaded" or servername == "ul": servername = "uploadedto"
mostrar_server = True
- if config.get_setting("hidepremium") == True:
- mostrar_server = servertools.is_server_enabled(servername)
- if mostrar_server:
- option = "Ver"
- if re.search(r'return ([\'"]{2,}|\})', embed):
- option = "Descargar"
- calidad = unicode(calidad, "utf8").upper().encode("utf8")
- servername_c = unicode(servername, "utf8").capitalize().encode("utf8")
- title = option + ": " + servername_c + " (" + calidad + ")" + " (" + idioma + ")"
- thumbnail = item.thumbnail
- plot = item.title + "\n\n" + scrapertools.find_single_match(data,
- '
> Añadir a la videoteca..."
- try:
- itemlist.extend(file_cine_library(item, url_targets))
- except:
- pass
+ if config.get_videolibrary_support():
+ itemlist.append(Item(channel=item.channel, title="Añadir a la videoteca", text_color="green",
+ action="add_pelicula_to_library", url=url_targets, thumbnail = item.thumbnail,
+ fulltitle = item.contentTitle
+ ))
return itemlist
-def trailer(item):
- import youtube
- itemlist = []
- item.url = "https://www.googleapis.com/youtube/v3/search" + \
- "?q=" + item.show.replace(" ", "+") + "+trailer+HD+Español" \
- "®ionCode=ES" + \
- "&part=snippet" + \
- "&hl=es_ES" + \
- "&key=AIzaSyAd-YEOqZz9nXVzGtn3KWzYLbLaajhqIDA" + \
- "&type=video" + \
- "&maxResults=50" + \
- "&pageToken="
- itemlist.extend(youtube.fichas(item))
- # itemlist.pop(-1)
- return itemlist
-
-
-def file_cine_library(item, url_targets):
- import os
- from core import filetools
- videolibrarypath = os.path.join(config.get_videolibrary_path(), "CINE")
- archivo = item.show.strip()
- strmfile = archivo + ".strm"
- strmfilepath = filetools.join(videolibrarypath, strmfile)
-
- if not os.path.exists(strmfilepath):
- itemlist = []
- itemlist.append(Item(channel=item.channel, title=">> Añadir a la videoteca...", url=url_targets,
- action="add_file_cine_library", extra="episodios", show=archivo))
-
- return itemlist
-
-
-def add_file_cine_library(item):
- from core import videolibrarytools
- new_item = item.clone(title=item.show, action="play_from_library")
- videolibrarytools.save_movie(new_item)
- itemlist = []
- itemlist.append(Item(title='El vídeo ' + item.show + ' se ha añadido a la videoteca'))
- # xbmctools.renderItems(itemlist, "", "", "")
- platformtools.render_items(itemlist, "")
-
- return
-
def play(item):
if "###" in item.url:
@@ -780,13 +726,11 @@ def play(item):
if devuelve:
item.url = devuelve[0][1]
item.server = devuelve[0][2]
-
+ item.thumbnail = item.contentThumbnail
+ item.fulltitle = item.contentTitle
return [item]
-## --------------------------------------------------------------------------------
-## --------------------------------------------------------------------------------
-
def agrupa_datos(data):
## Agrupa los datos
data = re.sub(r'\n|\r|\t| |
|', '', data)
diff --git a/plugin.video.alfa/channels/peliculasrey.py b/plugin.video.alfa/channels/peliculasrey.py
index bcaa5abd..ebd7c362 100755
--- a/plugin.video.alfa/channels/peliculasrey.py
+++ b/plugin.video.alfa/channels/peliculasrey.py
@@ -1,11 +1,11 @@
# -*- coding: utf-8 -*-
import re
-import urlparse
from core import httptools
from core import scrapertools
from core import servertools
+from core import tmdb
from core.item import Item
from platformcode import logger, config
@@ -16,117 +16,54 @@ def mainlist(item):
itemlist = []
itemlist.append(Item(channel=item.channel, action="peliculas", title="Recientes", url=host))
- itemlist.append(Item(channel=item.channel, action="PorFecha", title="Año de Lanzamiento", url=host))
- itemlist.append(Item(channel=item.channel, action="Idiomas", title="Idiomas", url=host))
- itemlist.append(Item(channel=item.channel, action="calidades", title="Por calidad", url=host))
- itemlist.append(Item(channel=item.channel, action="generos", title="Por género", url=host))
+ itemlist.append(Item(channel = item.channel,
+ action = "filtro",
+ title = "Año de Lanzamiento",
+ category = "lanzamiento"
+ ))
+ itemlist.append(Item(channel = item.channel,
+ action = "filtro",
+ title = "Idiomas",
+ category = "idioma"
+ ))
+ itemlist.append(Item(channel = item.channel,
+ action = "filtro",
+ title = "Por calidad",
+ category = "calidades"
+ ))
+ itemlist.append(Item(channel = item.channel,
+ action = "filtro",
+ title = "Por género",
+ category = "generos"
+ ))
itemlist.append(Item(channel=item.channel, action="search", title="Buscar...", url=host))
return itemlist
-def PorFecha(item):
- logger.info()
-
- # Descarga la pagina
- data = httptools.downloadpage(item.url).data
- data = scrapertools.find_single_match(data, '
')
-
- # Extrae las entradas (carpetas)
- patron = '
(.*?)')
-
- # Extrae las entradas (carpetas)
- patron = '(.*?)')
-
- # Extrae las entradas (carpetas)
- patron = '(.*?)')
- patron = '(.*?)