From cf4d838a9edbe9fcb65994b11f80c519530ec38e Mon Sep 17 00:00:00 2001 From: sculkurt <44222714+sculkurt@users.noreply.github.com> Date: Mon, 29 Oct 2018 16:55:45 +0100 Subject: [PATCH 01/12] fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit arreglo patron género --- plugin.video.alfa/channels/sleazemovies.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.video.alfa/channels/sleazemovies.py b/plugin.video.alfa/channels/sleazemovies.py index 904c6bb0..58243073 100644 --- a/plugin.video.alfa/channels/sleazemovies.py +++ b/plugin.video.alfa/channels/sleazemovies.py @@ -30,7 +30,7 @@ def genero(item): itemlist = list() data = httptools.downloadpage(host).data data = re.sub(r"\n|\r|\t|\s{2}| ", "", data) - patron = '
Resultados encontrados:(.*?)genres')
+ patron = '([^<]+)
' matches = re.compile(patron, re.DOTALL).findall(data) for scrapedurl, scrapedthumbnail, scrapedtitle, year, scrapedplot in matches: diff --git a/plugin.video.alfa/channels/tupelicula.json b/plugin.video.alfa/channels/tupelicula.json new file mode 100644 index 00000000..48edd0bc --- /dev/null +++ b/plugin.video.alfa/channels/tupelicula.json @@ -0,0 +1,77 @@ +{ + "id": "tupelicula", + "name": "TuPelicula", + "active": true, + "adult": false, + "language": ["lat", "cast", "*"], + "thumbnail": "https://i.postimg.cc/W4TbdCDP/tupelicula.png", + "banner": "", + "categories": [ + "movie", + "vos" + ], + "settings": [ + { + "id": "include_in_global_search", + "type": "bool", + "label": "Incluir en busqueda global", + "default": false, + "enabled": false, + "visible": false + }, + { + "id": "include_in_newest_peliculas", + "type": "bool", + "label": "Incluir en Novedades - Peliculas", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_latino", + "type": "bool", + "label": "Incluir en Novedades - Latino", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_castellano", + "type": "bool", + "label": "Incluir en Novedades - Castellano", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_infantiles", + "type": "bool", + "label": "Incluir en Novedades - Infantiles", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_terror", + "type": "bool", + "label": "Incluir en Novedades - terror", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "filter_languages", + "type": "list", + "label": "Mostrar enlaces en idioma...", + "default": 0, + "enabled": true, + "visible": true, + "lvalues": [ + "No filtrar", + "LAT", + "CAST", + "VOSE" + ] + } + ] +} diff --git a/plugin.video.alfa/channels/tupelicula.py b/plugin.video.alfa/channels/tupelicula.py new file mode 100644 index 00000000..592d4710 --- /dev/null +++ b/plugin.video.alfa/channels/tupelicula.py @@ -0,0 +1,205 @@ +# -*- coding: utf-8 -*- +# -*- Channel TuPelicula -*- +# -*- Created for Alfa-addon -*- +# -*- By the Alfa Develop Group -*- + +import re + +from channels import autoplay +from channels import filtertools +from core import httptools +from core import scrapertools +from core import servertools +from core import tmdb +from core.item import Item +from platformcode import config, logger +from channelselector import get_thumb + +host = 'http://www.tupelicula.tv/' + +IDIOMAS = {'la_la': 'LAT', 'es_es':'CAST', 'en_es':'VOSE', 'en_en':'VO'} +list_language = IDIOMAS.values() +list_quality = [] +list_servers = ['xdrive', 'bitertv', 'okru'] + +def get_source(url, referer=None): + logger.info() + if referer is None: + data = httptools.downloadpage(url).data + else: + data = httptools.downloadpage(url, headers={'Referer':referer}).data + data = re.sub(r'\n|\r|\t| |([^<]+).*?'
- patron += '([^<]+)'
- matches = scrapertools.find_multiple_matches(data, patron)
- for scrapedurl, scrapedthumbnail, scrapedtitle, scrapedyear in matches:
- scrapedtitle = scrapedtitle.replace("Película ","")
- itemlist.append(Item(channel = item.channel,
- action = "findvideos",
- contentTitle = scrapedtitle,
- infoLabels = {'year':scrapedyear},
- thumbnail = scrapedthumbnail,
- title = scrapedtitle + " (%s)" %scrapedyear,
- url = scrapedurl
- ))
- tmdb.set_infoLabels(itemlist)
- return itemlist
-
-
def search(item, texto):
logger.info()
item.url = host + "/suggest?que=" + texto
@@ -104,9 +81,7 @@ def sub_search(item):
data = httptools.downloadpage(item.url).data
token = scrapertools.find_single_match(data, 'csrf-token" content="([^"]+)')
data = httptools.downloadpage(item.url + "&_token=" + token, headers=headers).data
- #logger.info("Intel33 %s" %data)
data_js = jsontools.load(data)["data"]["m"]
- #logger.info("Intel44 %s" %data_js)
for js in data_js:
itemlist.append(Item(channel = item.channel,
action = "findvideos",
@@ -128,6 +103,51 @@ def sub_search(item):
return itemlist
+def peliculas_gen(item):
+ logger.info()
+ itemlist = []
+ data = httptools.downloadpage(item.url).data
+ patron = 'item-pelicula.*?href="([^"]+)".*?'
+ patron += 'src="([^"]+)".*?'
+ patron += 'text-center">([^<]+).*?'
+ patron += ' ([^<]+)'
+ matches = scrapertools.find_multiple_matches(data, patron)
+ for scrapedurl, scrapedthumbnail, scrapedyear, scrapedtitle in matches:
+ itemlist.append(Item(channel = item.channel,
+ action = "findvideos",
+ contentTitle = scrapedtitle,
+ infoLabels = {'year':scrapedyear},
+ thumbnail = scrapedthumbnail,
+ title = scrapedtitle + " (%s)" %scrapedyear,
+ url = scrapedurl
+ ))
+ tmdb.set_infoLabels(itemlist)
+ return itemlist
+
+
+def estrenos(item):
+ logger.info()
+ itemlist = []
+ data = httptools.downloadpage(item.url).data
+ patron = 'item-pelicula.*?href="([^"]+).*?'
+ patron += 'src="([^"]+).*?'
+ patron += 'text-center">([^<]+).*?'
+ patron += ' ([^<]+)'
+ matches = scrapertools.find_multiple_matches(data, patron)
+ for scrapedurl, scrapedthumbnail, scrapedyear, scrapedtitle in matches:
+ scrapedtitle = scrapedtitle.replace("Película ","")
+ itemlist.append(Item(channel = item.channel,
+ action = "findvideos",
+ contentTitle = scrapedtitle,
+ infoLabels = {'year':scrapedyear},
+ thumbnail = scrapedthumbnail,
+ title = scrapedtitle + " (%s)" %scrapedyear,
+ url = scrapedurl
+ ))
+ tmdb.set_infoLabels(itemlist)
+ return itemlist
+
+
def peliculas(item):
logger.info()
itemlist = []
@@ -139,9 +159,7 @@ def peliculas(item):
post = "page=%s&type=%s&_token=%s" %(item.page, item.type, token)
if item.slug:
post += "&slug=%s" %item.slug
- #logger.info("Intel11 %s" %post)
data = httptools.downloadpage(host + "/pagination", post=post, headers=headers).data
- #logger.info("Intel11 %s" %data)
patron = '(?s)href="([^"]+)".*?'
patron += 'src="([^"]+)".*?'
patron += 'text-center">([^<]+).*?'
@@ -215,28 +233,6 @@ def generos(item):
return itemlist
-def peliculas_gen(item):
- logger.info()
- itemlist = []
- data = httptools.downloadpage(item.url).data
- patron = 'item-pelicula.*?href="([^"]+)".*?'
- patron += 'src="([^"]+)".*?'
- patron += ' ([^<]+).*?'
- patron += '([^<]+)'
- matches = scrapertools.find_multiple_matches(data, patron)
- for scrapedurl, scrapedthumbnail, scrapedtitle , scrapedyear in matches:
- itemlist.append(Item(channel = item.channel,
- action = "findvideos",
- contentTitle = scrapedtitle,
- infoLabels = {'year':scrapedyear},
- thumbnail = scrapedthumbnail,
- title = scrapedtitle + " (%s)" %scrapedyear,
- url = scrapedurl
- ))
- tmdb.set_infoLabels(itemlist)
- return itemlist
-
-
def annos(item):
logger.info()
itemlist = []
@@ -260,18 +256,18 @@ def annos(item):
def findvideos(item):
itemlist = []
data = httptools.downloadpage(item.url).data
- patron = '(?i)