From 20d589e87a4622b057c85986a259151e015c761c Mon Sep 17 00:00:00 2001
From: Intel1 <25161862+Intel11@users.noreply.github.com>
Date: Fri, 22 Sep 2017 12:39:40 -0500
Subject: [PATCH 01/11] Actualizados
---
plugin.video.alfa/core/scrapertools.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/plugin.video.alfa/core/scrapertools.py b/plugin.video.alfa/core/scrapertools.py
index dccc692e..86b97cb5 100755
--- a/plugin.video.alfa/core/scrapertools.py
+++ b/plugin.video.alfa/core/scrapertools.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
# --------------------------------------------------------------------------------
# Scraper tools for reading and processing web elements
# --------------------------------------------------------------------------------
@@ -214,6 +214,7 @@ def htmlclean(cadena):
cadena = cadena.replace("
", "")
cadena = cadena.replace("
", "")
cadena = cadena.replace("", "")
cadena = cadena.replace("
", " ")
cadena = cadena.replace("
", " ")
cadena = cadena.replace("
", " ")
From 0d89733d3ce12349ca1d86866e2935254cbd8a98 Mon Sep 17 00:00:00 2001
From: Intel1 <25161862+Intel11@users.noreply.github.com>
Date: Fri, 22 Sep 2017 12:40:23 -0500
Subject: [PATCH 02/11] Update scrapertoolsV2.py
---
plugin.video.alfa/core/scrapertoolsV2.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/plugin.video.alfa/core/scrapertoolsV2.py b/plugin.video.alfa/core/scrapertoolsV2.py
index fffa278a..dd9e1b14 100755
--- a/plugin.video.alfa/core/scrapertoolsV2.py
+++ b/plugin.video.alfa/core/scrapertoolsV2.py
@@ -81,6 +81,7 @@ def htmlclean(cadena):
cadena = cadena.replace("", "")
cadena = cadena.replace("
", "")
cadena = cadena.replace("", "")
cadena = cadena.replace("
", " ")
cadena = cadena.replace("
", " ")
cadena = cadena.replace("
", " ")
From 3598a79a84f31c598c8788092ad3442e24019d48 Mon Sep 17 00:00:00 2001
From: Intel1 <25161862+Intel11@users.noreply.github.com>
Date: Fri, 22 Sep 2017 12:41:13 -0500
Subject: [PATCH 03/11] Update yaske.json
---
plugin.video.alfa/channels/yaske.json | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/plugin.video.alfa/channels/yaske.json b/plugin.video.alfa/channels/yaske.json
index c0d02237..f0769df9 100644
--- a/plugin.video.alfa/channels/yaske.json
+++ b/plugin.video.alfa/channels/yaske.json
@@ -48,6 +48,14 @@
"movie"
],
"settings": [
+ {
+ "id": "include_in_global_search",
+ "type": "bool",
+ "label": "Incluir en busqueda global",
+ "default": true,
+ "enabled": true,
+ "visible": true
+ },
{
"id": "include_in_newest_peliculas",
"type": "bool",
From 832d6e96efa876f460f41caec82fa3d70138b919 Mon Sep 17 00:00:00 2001
From: Intel1 <25161862+Intel11@users.noreply.github.com>
Date: Fri, 22 Sep 2017 12:47:10 -0500
Subject: [PATCH 04/11] Update yaske.py
---
plugin.video.alfa/channels/yaske.py | 158 +++++++++++-----------------
1 file changed, 59 insertions(+), 99 deletions(-)
diff --git a/plugin.video.alfa/channels/yaske.py b/plugin.video.alfa/channels/yaske.py
index 22942b9e..74024bc4 100644
--- a/plugin.video.alfa/channels/yaske.py
+++ b/plugin.video.alfa/channels/yaske.py
@@ -1,11 +1,11 @@
# -*- coding: utf-8 -*-
-import base64
import re
from core import channeltools
from core import httptools
from core import scrapertoolsV2
+from core import scrapertools
from core import servertools
from core import tmdb
from core.item import Item
@@ -27,22 +27,13 @@ def mainlist(item):
thumbnail = "https://raw.githubusercontent.com/master-1970/resources/master/images/genres/4/verdes/%s.png"
itemlist.append(item.clone(title="Novedades", action="peliculas", text_bold=True, viewcontent='movies',
- url=HOST + "/ultimas-y-actualizadas",
+ url=HOST,
thumbnail=thumbnail % 'novedades', viewmode="movie_with_plot"))
itemlist.append(item.clone(title="Estrenos", action="peliculas", text_bold=True,
- url=HOST + "/genre/premieres", thumbnail=thumbnail % 'estrenos'))
- itemlist.append(item.clone(title="", folder=False))
-
- itemlist.append(Item(channel=item.channel, title="Filtrar por:", fanart=fanart_host, folder=False,
- text_color=color3, text_bold=True, thumbnail=thumbnail_host))
- itemlist.append(item.clone(title=" Género", action="menu_buscar_contenido", text_color=color1, text_italic=True,
- extra="genre", thumbnail=thumbnail % 'generos', viewmode="thumbnails"))
- itemlist.append(item.clone(title=" Idioma", action="menu_buscar_contenido", text_color=color1, text_italic=True,
- extra="audio", thumbnail=thumbnail % 'idiomas'))
- itemlist.append(item.clone(title=" Calidad", action="menu_buscar_contenido", text_color=color1, text_italic=True,
- extra="quality", thumbnail=thumbnail % 'calidad'))
- itemlist.append(item.clone(title=" Año", action="menu_buscar_contenido", text_color=color1, text_italic=True,
- extra="year", thumbnail=thumbnail % 'year'))
+ url=HOST + "/premiere", thumbnail=thumbnail % 'estrenos'))
+ itemlist.append(item.clone(title="Género", action="menu_buscar_contenido", text_bold=True,thumbnail=thumbnail % 'generos', viewmode="thumbnails",
+ url=HOST
+ ))
itemlist.append(item.clone(title="", folder=False))
itemlist.append(item.clone(title="Buscar por título", action="search", thumbnail=thumbnail % 'buscar'))
@@ -55,8 +46,7 @@ def search(item, texto):
itemlist = []
try:
- # http://www.yaske.ro/search/?q=los+pitufos
- item.url = HOST + "/search/?q=" + texto.replace(' ', '+')
+ item.url = HOST + "/search/?query=" + texto.replace(' ', '+')
item.extra = ""
itemlist.extend(peliculas(item))
if itemlist[-1].title == ">> Página siguiente":
@@ -80,9 +70,9 @@ def newest(categoria):
item = Item()
try:
if categoria == 'peliculas':
- item.url = HOST + "/ultimas-y-actualizadas"
+ item.url = HOST
elif categoria == 'infantiles':
- item.url = HOST + "/search/?q=&genre%5B%5D=animation"
+ item.url = HOST + "/genre/16/"
else:
return []
@@ -103,59 +93,46 @@ def newest(categoria):
def peliculas(item):
logger.info()
itemlist = []
- url_next_page = ""
data = httptools.downloadpage(item.url).data
data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
- patron = '.*?'
- patron += '
(.*?).*?'
- patron += '([^<]+).*?'
- patron += '([^<]+)
'
+ patron = 'class="post-item-image btn-play-item".*?'
+ patron += 'href="([^"]+)">.*?'
+ patron += '
([^<]+).*?'
+ patron += 'post-item-flags"> (.*?)(.*?) 30:
- url_next_page = item.url
- matches = matches[:30]
- next_page = 'b'
- else:
- matches = matches[30:]
- next_page = 'a'
- patron_next_page = 'Anteriores 0:
- url_next_page = matches_next_page[0]
-
- for scrapedurl, scrapedthumbnail, idiomas, year, scrapedtitle in matches:
- patronidiomas = "
0:
+ url_next_page = item.url + matches_next_page
+ for scrapedurl, scrapedthumbnail, year, idiomas, scrapedtitle in matches:
+ year = year.strip()
+ patronidiomas = '
'
- data = scrapertoolsV2.get_match(data, patron)
-
+ patron = 'Generos.*?'
+ data = scrapertools.find_single_match(data, patron)
# Extrae las entradas
- patron = ""
- matches = re.compile(patron, re.DOTALL).findall(data)
-
- itemlist = []
- for scrapedvalue, scrapedtitle in matches:
- thumbnail = ""
-
- if item.extra == 'genre':
- if scrapedtitle.strip() in ['Documental', 'Short', 'News']:
- continue
-
- url = HOST + "/search/?q=&genre%5B%5D=" + scrapedvalue
- filename = scrapedtitle.lower().replace(' ', '%20')
- if filename == "ciencia%20ficción":
- filename = "ciencia%20ficcion"
- thumbnail = "https://raw.githubusercontent.com/master-1970/resources/master/images/genres/4/verdes/%s.png" \
- % filename
-
- elif item.extra == 'year':
- url = HOST + "/search/?q=&year=" + scrapedvalue
- thumbnail = item.thumbnail
- else:
- # http://www.yaske.ro/search/?q=&quality%5B%5D=c9
- # http://www.yaske.ro/search/?q=&audio%5B%5D=es
- url = HOST + "/search/?q=&" + item.extra + "%5B%5D=" + scrapedvalue
- thumbnail = item.thumbnail
-
- itemlist.append(Item(channel=item.channel, action="peliculas", title=scrapedtitle, url=url, text_color=color1,
- thumbnail=thumbnail, contentType='movie', folder=True, viewmode="movie_with_plot"))
+ patron = 'href="([^"]+)">([^<]+)'
+ matches = scrapertools.find_multiple_matches(data, patron)
+ for scrapedurl, scrapedtitle in matches:
+ url = HOST + scrapedurl
+ itemlist.append(Item(channel = item.channel,
+ action = "peliculas",
+ title = scrapedtitle,
+ url = url,
+ text_color = color1,
+ contentType = 'movie',
+ folder = True,
+ viewmode = "movie_with_plot"
+ ))
if item.extra in ['genre', 'audio', 'year']:
return sorted(itemlist, key=lambda i: i.title.lower(), reverse=item.extra == 'year')
@@ -214,29 +175,28 @@ def menu_buscar_contenido(item):
def findvideos(item):
logger.info()
- itemlist = list()
- sublist = list()
+ itemlist = []
+ sublist = []
# Descarga la página
- data = httptools.downloadpage(item.url).data
-
+ url = "http://widget.olimpo.link/playlist/?tmdb=" + scrapertools.find_single_match(item.url, 'yaske.ro/([0-9]+)')
+ data = httptools.downloadpage(url).data
if not item.plot:
item.plot = scrapertoolsV2.find_single_match(data, '>Sinopsis ([^<]+)')
item.plot = scrapertoolsV2.decodeHtmlentities(item.plot)
- patron = '