Merge pull request #411 from lopezvg/master
EstrenosGo: canal reestructurado
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import re
|
||||||
|
|
||||||
from core import httptools
|
from core import httptools
|
||||||
from core import scrapertools
|
from core import scrapertools
|
||||||
from platformcode import logger
|
from platformcode import logger
|
||||||
@@ -9,8 +11,8 @@ def mainlist(item):
|
|||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
itemlist.append(item.clone(action="categorias", title="Categorías", url="http://dato.porn/categories_all"))
|
itemlist.append(item.clone(action="categorias", title="Categorías", url="http://dato.porn/categories_all", contentType="movie", viewmode="movie"))
|
||||||
itemlist.append(item.clone(title="Buscar...", action="search"))
|
itemlist.append(item.clone(title="Buscar...", action="search", contentType="movie", viewmode="movie"))
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
@@ -25,22 +27,27 @@ def lista(item):
|
|||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
# Descarga la pagina
|
# Descarga la pagina
|
||||||
data = httptools.downloadpage(item.url).data
|
data = re.sub(r"\n|\r|\t|\s{2}|(<!--.*?-->)", "", httptools.downloadpage(item.url).data)
|
||||||
|
|
||||||
# Extrae las entradas
|
# Extrae las entradas
|
||||||
patron = '<div class="vid_block">\s*<a href="([^"]+)".*?url\(\'([^\']+)\'.*?<span>(.*?)</span>.*?<b>(.*?)</b>'
|
patron = '<div class="videobox">\s*<a href="([^"]+)".*?url\(\'([^\']+)\'.*?<span>(.*?)<\/span><\/div><\/a>.*?class="title">(.*?)<\/a><span class="views">.*?<\/a><\/span><\/div> '
|
||||||
matches = scrapertools.find_multiple_matches(data, patron)
|
matches = scrapertools.find_multiple_matches(data, patron)
|
||||||
for scrapedurl, scrapedthumbnail, duration, scrapedtitle in matches:
|
for scrapedurl, scrapedthumbnail, duration, scrapedtitle in matches:
|
||||||
if "/embed-" not in scrapedurl:
|
if "/embed-" not in scrapedurl:
|
||||||
scrapedurl = scrapedurl.replace("dato.porn/", "dato.porn/embed-") + ".html"
|
#scrapedurl = scrapedurl.replace("dato.porn/", "dato.porn/embed-") + ".html"
|
||||||
|
scrapedurl = scrapedurl.replace("datoporn.co/", "datoporn.co/embed-") + ".html"
|
||||||
if duration:
|
if duration:
|
||||||
scrapedtitle = "%s - %s" % (duration, scrapedtitle)
|
scrapedtitle = "%s - %s" % (duration, scrapedtitle)
|
||||||
|
scrapedtitle += ' gb'
|
||||||
|
scrapedtitle = scrapedtitle.replace(":", "'")
|
||||||
|
|
||||||
|
#logger.debug(scrapedurl + ' / ' + scrapedthumbnail + ' / ' + duration + ' / ' + scrapedtitle)
|
||||||
itemlist.append(item.clone(action="play", title=scrapedtitle, url=scrapedurl, thumbnail=scrapedthumbnail,
|
itemlist.append(item.clone(action="play", title=scrapedtitle, url=scrapedurl, thumbnail=scrapedthumbnail,
|
||||||
server="datoporn", fanart=scrapedthumbnail.replace("_t.jpg", ".jpg")))
|
server="datoporn", fanart=scrapedthumbnail.replace("_t.jpg", ".jpg")))
|
||||||
|
|
||||||
# Extrae la marca de siguiente página
|
# Extrae la marca de siguiente página
|
||||||
next_page = scrapertools.find_single_match(data, '<a href=["|\']([^["|\']+)["|\']>Next')
|
#next_page = scrapertools.find_single_match(data, '<a href=["|\']([^["|\']+)["|\']>Next')
|
||||||
|
next_page = scrapertools.find_single_match(data, '<a class=["|\']page-link["|\'] href=["|\']([^["|\']+)["|\']>Next')
|
||||||
if next_page and itemlist:
|
if next_page and itemlist:
|
||||||
itemlist.append(item.clone(action="lista", title=">> Página Siguiente", url=next_page))
|
itemlist.append(item.clone(action="lista", title=">> Página Siguiente", url=next_page))
|
||||||
|
|
||||||
|
|||||||
@@ -377,6 +377,7 @@ def newest(categoria):
|
|||||||
if categoria == 'torrent':
|
if categoria == 'torrent':
|
||||||
item.url = host
|
item.url = host
|
||||||
item.extra = "peliculas"
|
item.extra = "peliculas"
|
||||||
|
item.category_new= 'newest'
|
||||||
|
|
||||||
itemlist = listado(item)
|
itemlist = listado(item)
|
||||||
if itemlist[-1].title == "Página siguiente >>":
|
if itemlist[-1].title == "Página siguiente >>":
|
||||||
|
|||||||
@@ -3,13 +3,69 @@
|
|||||||
"name": "EstrenosGo",
|
"name": "EstrenosGo",
|
||||||
"active": true,
|
"active": true,
|
||||||
"adult": false,
|
"adult": false,
|
||||||
"language": ["cast"],
|
"language": ["cast", "LAT", "VOSE", "VOS"],
|
||||||
"fanart": "https://github.com/master-1970/resources/raw/master/images/fanart/estrenosgo.png",
|
"fanart": "estrenosgo.png",
|
||||||
"thumbnail": "https://github.com/master-1970/resources/raw/master/images/squares/estrenosgo.png",
|
"thumbnail": "estrenosgo.png",
|
||||||
"banner": "estrenosgo.png",
|
"banner": "estrenosgo.png",
|
||||||
"categories": [
|
"categories": [
|
||||||
"movie",
|
"movie",
|
||||||
"tvshow",
|
"tvshow",
|
||||||
"torrent"
|
"torrent",
|
||||||
|
"direct"
|
||||||
|
],
|
||||||
|
"settings": [
|
||||||
|
{
|
||||||
|
"default": true,
|
||||||
|
"enabled": true,
|
||||||
|
"id": "include_in_global_search",
|
||||||
|
"label": "Incluir en busqueda global",
|
||||||
|
"type": "bool",
|
||||||
|
"visible": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": true,
|
||||||
|
"enabled": true,
|
||||||
|
"id": "modo_grafico",
|
||||||
|
"label": "Buscar información extra (TMDB)",
|
||||||
|
"type": "bool",
|
||||||
|
"visible": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "timeout_downloadpage",
|
||||||
|
"type": "list",
|
||||||
|
"label": "Timeout (segs.) en descarga de páginas o verificación de servidores",
|
||||||
|
"default": 5,
|
||||||
|
"enabled": true,
|
||||||
|
"visible": true,
|
||||||
|
"lvalues": [
|
||||||
|
"None",
|
||||||
|
"1",
|
||||||
|
"2",
|
||||||
|
"3",
|
||||||
|
"4",
|
||||||
|
"5",
|
||||||
|
"6",
|
||||||
|
"7",
|
||||||
|
"8",
|
||||||
|
"9",
|
||||||
|
"10"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "seleccionar_ult_temporadda_activa",
|
||||||
|
"type": "bool",
|
||||||
|
"label": "Seleccionar para Videoteca si estará activa solo la última Temporada",
|
||||||
|
"default": true,
|
||||||
|
"enabled": true,
|
||||||
|
"visible": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "include_in_newest_peliculas",
|
||||||
|
"type": "bool",
|
||||||
|
"label": "Incluir en Novedades - Peliculas",
|
||||||
|
"default": true,
|
||||||
|
"enabled": true,
|
||||||
|
"visible": false
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1008,10 +1008,11 @@ def newest(categoria):
|
|||||||
try:
|
try:
|
||||||
if categoria == 'peliculas':
|
if categoria == 'peliculas':
|
||||||
item.url = host + "peliculas/"
|
item.url = host + "peliculas/"
|
||||||
item.extra = "novedades"
|
item.extra = "peliculas"
|
||||||
item.channel = "mejortorrent1"
|
item.channel = "mejortorrent1"
|
||||||
|
item.category_new= 'newest'
|
||||||
item.tipo = False
|
item.tipo = False
|
||||||
itemlist = listado_busqueda(item)
|
itemlist = listado(item)
|
||||||
if "Pagina siguiente >>" in itemlist[-1].title:
|
if "Pagina siguiente >>" in itemlist[-1].title:
|
||||||
itemlist.pop()
|
itemlist.pop()
|
||||||
|
|
||||||
@@ -1019,6 +1020,7 @@ def newest(categoria):
|
|||||||
item.url = host + "documentales/"
|
item.url = host + "documentales/"
|
||||||
item.extra = "documentales"
|
item.extra = "documentales"
|
||||||
item.channel = "mejortorrent1"
|
item.channel = "mejortorrent1"
|
||||||
|
item.category_new= 'newest'
|
||||||
item.tipo = False
|
item.tipo = False
|
||||||
itemlist = listado(item)
|
itemlist = listado(item)
|
||||||
if "Pagina siguiente >>" in itemlist[-1].title:
|
if "Pagina siguiente >>" in itemlist[-1].title:
|
||||||
|
|||||||
@@ -534,7 +534,7 @@
|
|||||||
{
|
{
|
||||||
"id": "include_in_newest_latino",
|
"id": "include_in_newest_latino",
|
||||||
"type": "bool",
|
"type": "bool",
|
||||||
"label": "Incluir en Novedades - Documentales",
|
"label": "Incluir en Novedades - Latino",
|
||||||
"default": true,
|
"default": true,
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"visible": false
|
"visible": false
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -248,7 +248,7 @@ def post_tmdb_listado(item, itemlist):
|
|||||||
#logger.debug(item_local)
|
#logger.debug(item_local)
|
||||||
|
|
||||||
item_local.last_page = 0
|
item_local.last_page = 0
|
||||||
del item_local.last_page #Borramos restos de paginación
|
del item_local.last_page #Borramos restos de paginación
|
||||||
|
|
||||||
if item_local.contentSeason_save: #Restauramos el num. de Temporada
|
if item_local.contentSeason_save: #Restauramos el num. de Temporada
|
||||||
item_local.contentSeason = item_local.contentSeason_save
|
item_local.contentSeason = item_local.contentSeason_save
|
||||||
@@ -268,7 +268,7 @@ def post_tmdb_listado(item, itemlist):
|
|||||||
title_add = ' '
|
title_add = ' '
|
||||||
if item_local.title_subs:
|
if item_local.title_subs:
|
||||||
for title_subs in item_local.title_subs:
|
for title_subs in item_local.title_subs:
|
||||||
if "audio" in title_subs.lower(): #se restaura info de Audio
|
if "audio" in title_subs.lower(): #se restaura info de Audio
|
||||||
title_add += scrapertools.find_single_match(title_subs, r'[a|A]udio (.*?)')
|
title_add += scrapertools.find_single_match(title_subs, r'[a|A]udio (.*?)')
|
||||||
continue
|
continue
|
||||||
if scrapertools.find_single_match(title_subs, r'(\d{4})'): #Se restaura el año, s no lo ha dado TMDB
|
if scrapertools.find_single_match(title_subs, r'(\d{4})'): #Se restaura el año, s no lo ha dado TMDB
|
||||||
@@ -280,13 +280,7 @@ def post_tmdb_listado(item, itemlist):
|
|||||||
title_add = '%s -%s-' % (title_add, title_subs) #se agregan el resto de etiquetas salvadas
|
title_add = '%s -%s-' % (title_add, title_subs) #se agregan el resto de etiquetas salvadas
|
||||||
item_local.title_subs = []
|
item_local.title_subs = []
|
||||||
del item_local.title_subs
|
del item_local.title_subs
|
||||||
|
|
||||||
if item_local.from_title:
|
|
||||||
if item_local.contentType == 'movie':
|
|
||||||
item_local.contentTitle = item_local.from_title
|
|
||||||
else:
|
|
||||||
item_local.contentSerieName = item_local.from_title
|
|
||||||
|
|
||||||
#Preparamos el Rating del vídeo
|
#Preparamos el Rating del vídeo
|
||||||
rating = ''
|
rating = ''
|
||||||
try:
|
try:
|
||||||
@@ -319,6 +313,15 @@ def post_tmdb_listado(item, itemlist):
|
|||||||
if item_local.infoLabels['aired']:
|
if item_local.infoLabels['aired']:
|
||||||
item_local.infoLabels['year'] = scrapertools.find_single_match(str(item_local.infoLabels['aired']), r'\/(\d{4})')
|
item_local.infoLabels['year'] = scrapertools.find_single_match(str(item_local.infoLabels['aired']), r'\/(\d{4})')
|
||||||
|
|
||||||
|
if item_local.from_title:
|
||||||
|
if item_local.contentType == 'movie':
|
||||||
|
item_local.contentTitle = item_local.from_title
|
||||||
|
item_local.title = item_local.from_title
|
||||||
|
else:
|
||||||
|
item_local.contentSerieName = item_local.from_title
|
||||||
|
if item_local.contentType == 'season':
|
||||||
|
item_local.title = item_local.from_title
|
||||||
|
|
||||||
# Preparamos el título para series, con los núm. de temporadas, si las hay
|
# Preparamos el título para series, con los núm. de temporadas, si las hay
|
||||||
if item_local.contentType in ['season', 'tvshow', 'episode']:
|
if item_local.contentType in ['season', 'tvshow', 'episode']:
|
||||||
if item_local.contentType == "episode":
|
if item_local.contentType == "episode":
|
||||||
@@ -738,10 +741,10 @@ def post_tmdb_episodios(item, itemlist):
|
|||||||
item_local.infoLabels['year'] = scrapertools.find_single_match(str(item_local.infoLabels['aired']), r'\/(\d{4})')
|
item_local.infoLabels['year'] = scrapertools.find_single_match(str(item_local.infoLabels['aired']), r'\/(\d{4})')
|
||||||
|
|
||||||
#Preparamos el título para que sea compatible con Añadir Serie a Videoteca
|
#Preparamos el título para que sea compatible con Añadir Serie a Videoteca
|
||||||
if "Temporada" in item_local.title: #Compatibilizamos "Temporada" con Unify
|
if "Temporada" in item_local.title: #Compatibilizamos "Temporada" con Unify
|
||||||
item_local.title = '%sx%s al 99 -' % (str(item_local.contentSeason), str(item_local.contentEpisodeNumber))
|
item_local.title = '%sx%s al 99 -' % (str(item_local.contentSeason), str(item_local.contentEpisodeNumber))
|
||||||
if " al " in item_local.title: #Si son episodios múltiples, ponemos nombre de serie
|
if " al " in item_local.title: #Si son episodios múltiples, ponemos nombre de serie
|
||||||
if " al 99" in item_local.title.lower(): #Temporada completa. Buscamos num total de episodios de la temporada
|
if " al 99" in item_local.title.lower(): #Temporada completa. Buscamos num total de episodios de la temporada
|
||||||
item_local.title = item_local.title.replace("99", str(num_episodios))
|
item_local.title = item_local.title.replace("99", str(num_episodios))
|
||||||
item_local.title = '%s %s' % (item_local.title, item_local.contentSerieName)
|
item_local.title = '%s %s' % (item_local.title, item_local.contentSerieName)
|
||||||
item_local.infoLabels['episodio_titulo'] = '%s - %s [%s] [%s]' % (scrapertools.find_single_match(item_local.title, r'(al \d+)'), item_local.contentSerieName, item_local.infoLabels['year'], rating)
|
item_local.infoLabels['episodio_titulo'] = '%s - %s [%s] [%s]' % (scrapertools.find_single_match(item_local.title, r'(al \d+)'), item_local.contentSerieName, item_local.infoLabels['year'], rating)
|
||||||
@@ -886,7 +889,7 @@ def post_tmdb_findvideos(item, itemlist):
|
|||||||
En Itemlist devuelve un Item con el pseudotítulo. Ahí el canal irá agregando el resto.
|
En Itemlist devuelve un Item con el pseudotítulo. Ahí el canal irá agregando el resto.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
logger.debug(item)
|
#logger.debug(item)
|
||||||
|
|
||||||
#Creción de título general del vídeo a visualizar en Findvideos
|
#Creción de título general del vídeo a visualizar en Findvideos
|
||||||
itemlist = []
|
itemlist = []
|
||||||
@@ -900,6 +903,10 @@ def post_tmdb_findvideos(item, itemlist):
|
|||||||
item.unify = config.get_setting("unify")
|
item.unify = config.get_setting("unify")
|
||||||
except:
|
except:
|
||||||
item.unify = config.get_setting("unify")
|
item.unify = config.get_setting("unify")
|
||||||
|
|
||||||
|
if item.contentSeason_save: #Restauramos el num. de Temporada
|
||||||
|
item.contentSeason = item.contentSeason_save
|
||||||
|
del item.contentSeason_save
|
||||||
|
|
||||||
#Salvamos la información de max num. de episodios por temporada para despues de TMDB
|
#Salvamos la información de max num. de episodios por temporada para despues de TMDB
|
||||||
num_episodios = item.contentEpisodeNumber
|
num_episodios = item.contentEpisodeNumber
|
||||||
@@ -988,20 +995,26 @@ def post_tmdb_findvideos(item, itemlist):
|
|||||||
item.category = item.channel.capitalize()
|
item.category = item.channel.capitalize()
|
||||||
|
|
||||||
#Formateamos de forma especial el título para un episodio
|
#Formateamos de forma especial el título para un episodio
|
||||||
|
title = ''
|
||||||
|
title_gen = ''
|
||||||
if item.contentType == "episode": #Series
|
if item.contentType == "episode": #Series
|
||||||
title = '%sx%s' % (str(item.contentSeason), str(item.contentEpisodeNumber).zfill(2)) #Temporada y Episodio
|
title = '%sx%s' % (str(item.contentSeason), str(item.contentEpisodeNumber).zfill(2)) #Temporada y Episodio
|
||||||
if item.infoLabels['temporada_num_episodios']:
|
if item.infoLabels['temporada_num_episodios']:
|
||||||
title = '%s (de %s)' % (title, str(item.infoLabels['temporada_num_episodios'])) #Total Episodios
|
title = '%s (de %s)' % (title, str(item.infoLabels['temporada_num_episodios'])) #Total Episodios
|
||||||
|
|
||||||
#Si son episodios múltiples, y viene de Videoteca, ponemos nombre de serie
|
#Si son episodios múltiples, y viene de Videoteca, ponemos nombre de serie
|
||||||
if " al " in item.title and not " al " in item.infoLabels['episodio_titulo']:
|
if (" al " in item.title or " Al " in item.title) and not "al " in item.infoLabels['episodio_titulo']:
|
||||||
title = '%s al %s - ' % (title, scrapertools.find_single_match(item.title, 'al (\d+)'))
|
title = '%s al %s - ' % (title, scrapertools.find_single_match(item.title, '[al|Al] (\d+)'))
|
||||||
else:
|
else:
|
||||||
title = '%s %s' % (title, item.infoLabels['episodio_titulo']) #Título Episodio
|
title = '%s %s' % (title, item.infoLabels['episodio_titulo']) #Título Episodio
|
||||||
title_gen = '%s, %s [COLOR yellow][%s][/COLOR] [%s] [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR] [%s]' % (title, item.contentSerieName, item.infoLabels['year'], rating, item.quality, str(item.language), scrapertools.find_single_match(item.title, '\s\[(\d+,?\d*?\s\w[b|B])\]')) #Rating, Calidad, Idioma, Tamaño
|
title_gen = '%s, ' % title
|
||||||
|
|
||||||
|
if item.contentType == "episode" or item.contentType == "season": #Series o Temporadas
|
||||||
|
title_gen += '%s [COLOR yellow][%s][/COLOR] [%s] [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR] [%s]' % (item.contentSerieName, item.infoLabels['year'], rating, item.quality, str(item.language), scrapertools.find_single_match(item.title, '\s\[(\d+,?\d*?\s\w[b|B])\]')) #Rating, Calidad, Idioma, Tamaño
|
||||||
if item.infoLabels['status'] and item.infoLabels['status'].lower() == "ended":
|
if item.infoLabels['status'] and item.infoLabels['status'].lower() == "ended":
|
||||||
title_gen = '[TERM.] %s' % title_gen #Marca cuando la Serie está terminada y no va a haber más producción
|
title_gen = '[TERM.] %s' % title_gen #Marca cuando la Serie está terminada y no va a haber más producción
|
||||||
item.title = title_gen
|
item.title = title_gen
|
||||||
|
|
||||||
else: #Películas
|
else: #Películas
|
||||||
title = item.title
|
title = item.title
|
||||||
title_gen = item.title
|
title_gen = item.title
|
||||||
@@ -1041,10 +1054,11 @@ def post_tmdb_findvideos(item, itemlist):
|
|||||||
item.quality = '[COLOR yellow][%s][/COLOR] %s' % (channel, item.quality)
|
item.quality = '[COLOR yellow][%s][/COLOR] %s' % (channel, item.quality)
|
||||||
|
|
||||||
#agregamos la opción de Añadir a Videoteca para péliculas (no series)
|
#agregamos la opción de Añadir a Videoteca para péliculas (no series)
|
||||||
if item.contentType == 'movie' and item.contentChannel != "videolibrary":
|
if (item.contentType == 'movie' or item.contentType == 'season') and item.contentChannel != "videolibrary":
|
||||||
#Permitimos la actualización de los títulos, bien para uso inmediato, o para añadir a la videoteca
|
#Permitimos la actualización de los títulos, bien para uso inmediato, o para añadir a la videoteca
|
||||||
itemlist.append(item.clone(title="** [COLOR yelow]Actualizar Títulos - vista previa videoteca[/COLOR] **", action="actualizar_titulos", extra="películas", tmdb_stat=False, from_action=item.action, from_title_tmdb=item.title, from_update=True))
|
itemlist.append(item.clone(title="** [COLOR yelow]Actualizar Títulos - vista previa videoteca[/COLOR] **", action="actualizar_titulos", extra="películas", tmdb_stat=False, from_action=item.action, from_title_tmdb=item.title, from_update=True))
|
||||||
|
|
||||||
|
if item.contentType == 'movie' and item.contentChannel != "videolibrary":
|
||||||
itemlist.append(item.clone(title="**-[COLOR yellow] Añadir a la videoteca [/COLOR]-**", action="add_pelicula_to_library", extra="películas", from_action=item.action, from_title_tmdb=item.title))
|
itemlist.append(item.clone(title="**-[COLOR yellow] Añadir a la videoteca [/COLOR]-**", action="add_pelicula_to_library", extra="películas", from_action=item.action, from_title_tmdb=item.title))
|
||||||
|
|
||||||
#Añadimos la opción de ver trailers
|
#Añadimos la opción de ver trailers
|
||||||
@@ -1171,6 +1185,7 @@ def fail_over_newpct1(item, patron, patron2=None, timeout=None):
|
|||||||
|
|
||||||
data = ''
|
data = ''
|
||||||
channel_failed = ''
|
channel_failed = ''
|
||||||
|
url_alt = []
|
||||||
if not item.category:
|
if not item.category:
|
||||||
item.category = scrapertools.find_single_match(item.url, 'http.?\:\/\/(?:www.)?(\w+)\.\w+\/').capitalize()
|
item.category = scrapertools.find_single_match(item.url, 'http.?\:\/\/(?:www.)?(\w+)\.\w+\/').capitalize()
|
||||||
if not item.extra2:
|
if not item.extra2:
|
||||||
@@ -1226,48 +1241,78 @@ def fail_over_newpct1(item, patron, patron2=None, timeout=None):
|
|||||||
item.url_alt = channel_url_failed
|
item.url_alt = channel_url_failed
|
||||||
item.url = channel_url_failed
|
item.url = channel_url_failed
|
||||||
item.url = item.url.replace(channel_host_failed, channel_host)
|
item.url = item.url.replace(channel_host_failed, channel_host)
|
||||||
|
url_alt += [item.url] #salvamos la url para el bucle
|
||||||
item.channel_host = channel_host
|
item.channel_host = channel_host
|
||||||
|
|
||||||
#quitamos el código de series, porque puede variar entre webs
|
#quitamos el código de series, porque puede variar entre webs
|
||||||
if item.action == "episodios" or item.action == "get_seasons":
|
if item.action == "episodios" or item.action == "get_seasons":
|
||||||
item.url = re.sub(r'\/\d+\/?$', '', item.url) #parece que con el título solo ecuentra la serie, normalmente...
|
item.url = re.sub(r'\/\d+\/?$', '', item.url) #parece que con el título solo ecuentra la serie, normalmente...
|
||||||
|
url_alt = [item.url] #salvamos la url para el bucle, pero de momento ignoramos la inicial con código de serie
|
||||||
|
|
||||||
|
#si es un episodio, generalizamos la url para que se pueda encontrar en otro clone. Quitamos la calidad del final de la url
|
||||||
|
elif item.action == "findvideos" and item.contentType == "episode":
|
||||||
|
try:
|
||||||
|
#quitamos el 0 a la izquierda del episodio. Algunos clones no lo aceptan
|
||||||
|
inter1, inter2, inter3 = scrapertools.find_single_match(item.url, '(http.*?\/temporada-\d+.*?\/capitulo.?-)(\d+)(.*?\/)')
|
||||||
|
inter2 = re.sub(r'^0', '', inter2)
|
||||||
|
if inter1 + inter2 + inter3 not in url_alt:
|
||||||
|
url_alt += [inter1 + inter2 + inter3]
|
||||||
|
|
||||||
|
#en este formato solo quitamos la calidad del final de la url
|
||||||
|
if scrapertools.find_single_match(item.url, 'http.*?\/temporada-\d+.*?\/capitulo.?-\d+.*?\/') not in url_alt:
|
||||||
|
url_alt += [scrapertools.find_single_match(item.url, 'http.*?\/temporada-\d+.*?\/capitulo.?-\d+.*?\/')]
|
||||||
|
except:
|
||||||
|
logger.error("ERROR 88: " + item.action + ": Error al convertir la url: " + item.url)
|
||||||
|
logger.debug('URLs convertidas: ' + str(url_alt))
|
||||||
|
|
||||||
if patron == True: #solo nos han pedido verificar el clone
|
if patron == True: #solo nos han pedido verificar el clone
|
||||||
return (item, data) #nos vamos, con un nuevo clone
|
return (item, data) #nos vamos, con un nuevo clone
|
||||||
|
|
||||||
#Leemos la nueva url
|
#Leemos la nueva url.. Puede haber varias alternativas a la url original
|
||||||
try:
|
for url in url_alt:
|
||||||
if item.post:
|
try:
|
||||||
data = re.sub(r"\n|\r|\t|\s{2}|(<!--.*?-->)", "", httptools.downloadpage(item.url, post=item.post, timeout=timeout).data)
|
if item.post:
|
||||||
else:
|
data = re.sub(r"\n|\r|\t|\s{2}|(<!--.*?-->)", "", httptools.downloadpage(url, post=item.post, timeout=timeout).data)
|
||||||
data = re.sub(r"\n|\r|\t|\s{2}|(<!--.*?-->)", "", httptools.downloadpage(item.url, timeout=timeout).data)
|
else:
|
||||||
except:
|
data = re.sub(r"\n|\r|\t|\s{2}|(<!--.*?-->)", "", httptools.downloadpage(url, timeout=timeout).data)
|
||||||
data = ''
|
data_comillas = data.replace("'", "\"")
|
||||||
if not data: #no ha habido suerte, probamos con el siguiente canal válido
|
except:
|
||||||
logger.error("ERROR 01: " + item.action + ": La Web no responde o la URL es erronea: " + item.url)
|
data = ''
|
||||||
continue
|
if not data: #no ha habido suerte, probamos con la siguiente url
|
||||||
|
logger.error("ERROR 01: " + item.action + ": La Web no responde o la URL es erronea: " + url)
|
||||||
|
continue
|
||||||
|
|
||||||
#Hemos logrado leer la web, validamos si encontramos un línk válido en esta estructura
|
#Hemos logrado leer la web, validamos si encontramos un línk válido en esta estructura
|
||||||
#Evitar páginas engañosas que puede meter al canal en un loop infinito
|
#Evitar páginas engañosas que puede meter al canal en un loop infinito
|
||||||
if (not ".com/images/no_imagen.jpg" in data and not ".com/images/imagen-no-disponible.jpg" in data) or item.action != "episodios":
|
if (not ".com/images/no_imagen.jpg" in data and not ".com/images/imagen-no-disponible.jpg" in data) or item.action != "episodios":
|
||||||
if patron:
|
if patron:
|
||||||
data_alt = scrapertools.find_single_match(data, patron)
|
data_alt = scrapertools.find_single_match(data, patron)
|
||||||
if patron2 != None:
|
if not data_alt:
|
||||||
data_alt = scrapertools.find_single_match(data_alt, patron2)
|
data_alt = scrapertools.find_single_match(data_comillas, patron)
|
||||||
if not data_alt: #no ha habido suerte, probamos con el siguiente canal
|
if patron2 != None:
|
||||||
logger.error("ERROR 02: " + item.action + ": Ha cambiado la estructura de la Web: " + item.url + " / Patron: " + patron)
|
data_alt = scrapertools.find_single_match(data_alt, patron2)
|
||||||
|
if not data_alt: #no ha habido suerte, probamos con el siguiente canal
|
||||||
|
logger.error("ERROR 02: " + item.action + ": Ha cambiado la estructura de la Web: " + url + " / Patron: " + patron)
|
||||||
|
web_intervenida(item, data)
|
||||||
|
data = ''
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
item.url = url #guardamos la url que funciona
|
||||||
|
break #por fin !!! Este canal parece que funciona
|
||||||
|
else:
|
||||||
|
logger.error("ERROR 02: " + item.action + ": Ha cambiado la estructura de la Web: " + url + " / Patron: " + patron)
|
||||||
web_intervenida(item, data)
|
web_intervenida(item, data)
|
||||||
data = ''
|
data = ''
|
||||||
continue
|
continue
|
||||||
else:
|
|
||||||
break #por fin !!! Este canal parece que funciona
|
if not data: #no ha habido suerte, probamos con el siguiente clone
|
||||||
else:
|
url_alt = []
|
||||||
logger.error("ERROR 02: " + item.action + ": Ha cambiado la estructura de la Web: " + item.url + " / Patron: " + patron)
|
|
||||||
web_intervenida(item, data)
|
|
||||||
data = ''
|
|
||||||
continue
|
continue
|
||||||
|
else:
|
||||||
|
break
|
||||||
|
|
||||||
del item.extra2 #Borramos acción temporal excluyente
|
del item.extra2 #Borramos acción temporal excluyente
|
||||||
if not data: #Si no ha logrado encontrar nada, salimos limpiando variables
|
if not data: #Si no ha logrado encontrar nada, salimos limpiando variables
|
||||||
if item.channel == channel_py:
|
if item.channel == channel_py:
|
||||||
if item.channel_alt:
|
if item.channel_alt:
|
||||||
item.category = item.channel_alt.capitalize()
|
item.category = item.channel_alt.capitalize()
|
||||||
|
|||||||
@@ -25,7 +25,10 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
|||||||
media_urls = scrapertools.find_multiple_matches(data, 'file\:"([^"]+\.mp4)",label:"([^"]+)"')
|
media_urls = scrapertools.find_multiple_matches(data, 'file\:"([^"]+\.mp4)",label:"([^"]+)"')
|
||||||
if not media_urls:
|
if not media_urls:
|
||||||
match = scrapertools.find_single_match(data, "p,a,c,k(.*?)</script>")
|
match = scrapertools.find_single_match(data, "p,a,c,k(.*?)</script>")
|
||||||
data = jsunpack.unpack(match)
|
try:
|
||||||
|
data = jsunpack.unpack(match)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
media_urls = scrapertools.find_multiple_matches(data, 'file\:"([^"]+\.mp4)",label:"([^"]+)"')
|
media_urls = scrapertools.find_multiple_matches(data, 'file\:"([^"]+\.mp4)",label:"([^"]+)"')
|
||||||
|
|
||||||
# Extrae la URL
|
# Extrae la URL
|
||||||
@@ -41,6 +44,9 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
|||||||
|
|
||||||
sorted(calidades)
|
sorted(calidades)
|
||||||
m3u8 = scrapertools.find_single_match(data, 'file\:"([^"]+\.m3u8)"')
|
m3u8 = scrapertools.find_single_match(data, 'file\:"([^"]+\.m3u8)"')
|
||||||
|
if not m3u8:
|
||||||
|
m3u8 = str(scrapertools.find_multiple_matches(data, 'player.updateSrc\({src:.?"([^"]+\.m3u8)"')).replace("['", "").replace("']", "")
|
||||||
|
calidades = ['720p']
|
||||||
if m3u8:
|
if m3u8:
|
||||||
video_urls.insert(0, [".m3u8 %s [datoporn]" % calidades[-1], m3u8])
|
video_urls.insert(0, [".m3u8 %s [datoporn]" % calidades[-1], m3u8])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user