diff --git a/plugin.video.alfa/addon.xml b/plugin.video.alfa/addon.xml index 1c319169..b8bd9379 100755 --- a/plugin.video.alfa/addon.xml +++ b/plugin.video.alfa/addon.xml @@ -1,5 +1,5 @@ - + @@ -11,7 +11,7 @@ Navega con Kodi por páginas web. logo-cumple.png - fanart.jpg + fanart1.jpg resources/media/themes/ss/1.jpg resources/media/themes/ss/2.jpg resources/media/themes/ss/3.jpg @@ -19,15 +19,15 @@ [B]Estos son los cambios para esta versión:[/B] [COLOR green][B]Arreglos[/B][/COLOR] - ¤ cinetux ¤ porntrex ¤ repelis - ¤ fembed ¤ uptobox ¤ vivo - ¤ seriesmetro ¤ DivxTotal ¤ EliteTorrent - ¤ EstrenosGo ¤ GranTorrent - + ¤ Todopeliculas ¤ Maxipelis24 ¤ allcalidad + ¤ descargacineclasico ¤ porntrex ¤ seriesmetro + ¤ pedropolis ¤ thumzilla ¤ xms + [COLOR green][B]Novedades[/B][/COLOR] - ¤ Pack canales +18 + ¤ cine24h ¤ hdfilmologia ¤ pelis24 + ¤ pelishd24 ¤ pelisplay - Agradecimientos a @paeznet por colaborar en ésta versión + ¤ Agradecimientos a @chivmalev por colaborar con ésta versión Navega con Kodi por páginas web para ver sus videos de manera fácil. diff --git a/plugin.video.alfa/channels/LIKUOO.py b/plugin.video.alfa/channels/LIKUOO.py index a293fed5..20925e3c 100644 --- a/plugin.video.alfa/channels/LIKUOO.py +++ b/plugin.video.alfa/channels/LIKUOO.py @@ -42,7 +42,6 @@ def categorias(item): data = re.sub(r"\n|\r|\t| |
", "", data) patron = '
.*?", "", data) + patron = '
.*?(.*?)' + matches = re.compile(patron,re.DOTALL).findall(data) + for scrapedurl,scrapedtitle,scrapedthumbnail,num in matches: + scrapedplot = "" + scrapedurl = host + scrapedurl + title = scrapedtitle + "[COLOR yellow] " + num + "[/COLOR]" + itemlist.append( Item(channel=item.channel, action="peliculas", title=title , url=scrapedurl , thumbnail=scrapedthumbnail , plot=scrapedplot , folder=True) ) + next_page_url = scrapertools.find_single_match(data,'", "", data) + patron = 'data-video-id="\d+">.*?(.*?)' + matches = re.compile(patron,re.DOTALL).findall(data) + for scrapedurl,scrapedthumbnail,scrapedtitle,time in matches: + contentTitle = scrapedtitle + title = "[COLOR yellow]" + time + " [/COLOR]" + scrapedtitle + thumbnail = scrapedthumbnail + plot = "" + year = "" + itemlist.append( Item(channel=item.channel, action="play" , title=title , url=scrapedurl, thumbnail=thumbnail, plot=plot, contentTitle=contentTitle, infoLabels={'year':year} )) + next_page_url = scrapertools.find_single_match(data,'> 4 + b = (b & 15) << 4 | c >> 2 + e = (c & 3) << 6 | d + reto += chr(a) + if c != 64: reto += chr(b) + if d != 64: reto += chr(e) + + return urllib.unquote(reto) + diff --git a/plugin.video.alfa/channels/absoluporn.py b/plugin.video.alfa/channels/absoluporn.py index 31b7a1bf..cb79c516 100644 --- a/plugin.video.alfa/channels/absoluporn.py +++ b/plugin.video.alfa/channels/absoluporn.py @@ -47,7 +47,6 @@ def categorias(item): data = httptools.downloadpage(item.url).data patron = ' ([^"]+)' matches = re.compile(patron,re.DOTALL).findall(data) - scrapertools.printMatches(matches) for scrapedurl,scrapedtitle in matches: scrapedplot = "" scrapedthumbnail = "" diff --git a/plugin.video.alfa/channels/allcalidad.py b/plugin.video.alfa/channels/allcalidad.py index 6c5930d8..acce6a51 100755 --- a/plugin.video.alfa/channels/allcalidad.py +++ b/plugin.video.alfa/channels/allcalidad.py @@ -124,12 +124,12 @@ def peliculas(item): logger.info() itemlist = [] data = httptools.downloadpage(item.url).data - patron = '(?s)short_overlay.*?([^<]+)').strip() + datapostid = scrapertools.find_single_match(datos, 'data-postid="([^"]+)') + thumbnail = scrapertools.find_single_match(datos, 'img w.*?src="([^"]+)') post = 'action=get_movie_details&postID=%s' %datapostid data1 = httptools.downloadpage(host + "wp-admin/admin-ajax.php", post=post).data idioma = "Latino" diff --git a/plugin.video.alfa/channels/alsoporn.py b/plugin.video.alfa/channels/alsoporn.py index 3cbc2a9d..d388775b 100644 --- a/plugin.video.alfa/channels/alsoporn.py +++ b/plugin.video.alfa/channels/alsoporn.py @@ -43,7 +43,6 @@ def catalogo(item): data = re.sub(r"\n|\r|\t| |
", "", data) patron = '
  • .*?([^"]+)([^"]+)' matches = re.compile(patron,re.DOTALL).findall(data) - scrapertools.printMatches(matches) for scrapedurl,cantidad,scrapedtitle in matches: scrapedplot = "" scrapedthumbnail = "" @@ -59,7 +58,6 @@ def categorias(item): patron = '.*?' patron += '([^' matches = re.compile(patron,re.DOTALL).findall(data) - scrapertools.printMatches(matches) for scrapedurl,scrapedthumbnail,scrapedtitle in matches: scrapedplot = "" scrapedurl = scrapedurl.replace("top", "new") diff --git a/plugin.video.alfa/channels/analdin.py b/plugin.video.alfa/channels/analdin.py index c5c2a66a..0eff8b13 100644 --- a/plugin.video.alfa/channels/analdin.py +++ b/plugin.video.alfa/channels/analdin.py @@ -45,7 +45,6 @@ def catalogo(item): data = re.sub(r"\n|\r|\t| |
    ", "", data) patron = '
  • ' matches = re.compile(patron,re.DOTALL).findall(data) - scrapertools.printMatches(matches) for scrapedurl,scrapedtitle in matches: scrapedplot = "" scrapedthumbnail = "" @@ -66,7 +65,6 @@ def categorias(item): patron += 'src="([^"]+)".*?' patron += '
    ([^"]+)
    ' matches = re.compile(patron,re.DOTALL).findall(data) - scrapertools.printMatches(matches) for scrapedurl,scrapedtitle,scrapedthumbnail,cantidad in matches: scrapedplot = "" scrapedtitle = scrapedtitle + " (" + cantidad + ")" @@ -105,7 +103,6 @@ def play(item): data = httptools.downloadpage(item.url).data patron = 'video_url: \'([^\']+)\'' matches = re.compile(patron,re.DOTALL).findall(data) - scrapertools.printMatches(matches) for scrapedurl in matches: url = scrapedurl itemlist.append(item.clone(action="play", title=url, fulltitle = item.title, url=url)) diff --git a/plugin.video.alfa/channels/bloghorror.py b/plugin.video.alfa/channels/bloghorror.py index 210c62bb..bbbda1d2 100644 --- a/plugin.video.alfa/channels/bloghorror.py +++ b/plugin.video.alfa/channels/bloghorror.py @@ -47,11 +47,11 @@ def list_all(item): itemlist = [] data = get_source(item.url) - patron = '.?<.*?href="([^"]+)" title="([^"]+)".*?src="([^"]+)".*?' + patron = '
    ([^<]+)' matches = re.compile(patron, re.DOTALL).findall(data) - for scrapedurl, scrapedtitle, scrapedthumbnail in matches: + for scrapedthumbnail, scrapedurl, scrapedtitle in matches: url = scrapedurl title = scrapertools.find_single_match(scrapedtitle, '(.*?)(?:|\(|\| )\d{4}').strip() year = scrapertools.find_single_match(scrapedtitle, '(\d{4})') @@ -68,7 +68,7 @@ def list_all(item): if itemlist != []: - next_page = scrapertools.find_single_match(data, '.*?([^"]+)\s*(\d+) movies.*?' matches = re.compile(patron,re.DOTALL).findall(data) - scrapertools.printMatches(matches) for scrapedurl,scrapedthumbnail,scrapedtitle,cantidad in matches: scrapedplot = "" scrapedtitle = scrapedtitle + " (" + cantidad + ")" diff --git a/plugin.video.alfa/channels/cine24h.json b/plugin.video.alfa/channels/cine24h.json new file mode 100644 index 00000000..b679159c --- /dev/null +++ b/plugin.video.alfa/channels/cine24h.json @@ -0,0 +1,63 @@ +{ + "id": "cine24h", + "name": "Cine24H", + "active": true, + "adult": false, + "language": ["lat", "cast", "eng"], + "fanart": "https://i.postimg.cc/WpqD2n77/cine24bg.jpg", + "thumbnail": "https://cine24h.net/wp-content/uploads/2018/06/cine24hv2.png", + "banner": "", + "categories": [ + "movie", + "tvshow", + "vose" + ], + "settings": [ + { + "id": "filter_languages", + "type": "list", + "label": "Mostrar enlaces en idioma...", + "default": 0, + "enabled": true, + "visible": true, + "lvalues": [ + "No filtrar", + "Latino", + "Castellano", + "English" + ] + }, + { + "id": "modo_grafico", + "type": "bool", + "label": "Buscar información extra", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "perfil", + "type": "list", + "label": "Perfil de color", + "default": 3, + "enabled": true, + "visible": true, + "lvalues": [ + "Sin color", + "Perfil 5", + "Perfil 4", + "Perfil 3", + "Perfil 2", + "Perfil 1" + ] + }, + { + "id": "orden_episodios", + "type": "bool", + "label": "Mostrar los episodios de las series en orden descendente", + "default": false, + "enabled": true, + "visible": true + } + ] +} diff --git a/plugin.video.alfa/channels/cine24h.py b/plugin.video.alfa/channels/cine24h.py new file mode 100644 index 00000000..e5edfed9 --- /dev/null +++ b/plugin.video.alfa/channels/cine24h.py @@ -0,0 +1,382 @@ +# -*- coding: utf-8 -*- +# -*- Channel CanalPelis -*- +# -*- Created for Alfa-addon -*- +# -*- By the Alfa Develop Group -*- + +import re +import sys +import urlparse + +from channels import autoplay +from channels import filtertools +from core import httptools +from core import scrapertools +from core import servertools +from core.item import Item +from core import channeltools +from core import tmdb +from platformcode import config, logger +from channelselector import get_thumb + +__channel__ = "cine24h" + +host = "https://cine24h.net/" + +try: + __modo_grafico__ = config.get_setting('modo_grafico', __channel__) + __perfil__ = int(config.get_setting('perfil', __channel__)) +except: + __modo_grafico__ = True + __perfil__ = 0 + +# Fijar perfil de color +perfil = [['0xFFFFE6CC', '0xFFFFCE9C', '0xFF994D00', '0xFFFE2E2E', '0xFFFFD700'], + ['0xFFA5F6AF', '0xFF5FDA6D', '0xFF11811E', '0xFFFE2E2E', '0xFFFFD700'], + ['0xFF58D3F7', '0xFF2E9AFE', '0xFF2E64FE', '0xFFFE2E2E', '0xFFFFD700']] +if __perfil__ < 3: + color1, color2, color3, color4, color5 = perfil[__perfil__] +else: + color1 = color2 = color3 = color4 = color5 = "" + +headers = [['User-Agent', 'Mozilla/50.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0'], + ['Referer', host]] + + +parameters = channeltools.get_channel_parameters(__channel__) +fanart_host = parameters['fanart'] +thumbnail_host = parameters['thumbnail'] + +IDIOMAS = {'Latino': 'LAT', 'Castellano': 'CAST'} +list_language = IDIOMAS.values() +list_quality = [] +list_servers = ['rapidvideo', 'streamango', 'openload', 'streamcherry'] + + +def mainlist(item): + logger.info() + autoplay.init(item.channel, list_servers, list_quality) + itemlist = [item.clone(title="Peliculas", action="menumovies", text_blod=True, + viewcontent='movies', viewmode="movie_with_plot", thumbnail=get_thumb('movies', auto=True)), + + item.clone(title="Series", action="series", extra='serie', url=host + 'series/', + viewmode="movie_with_plot", text_blod=True, viewcontent='movies', + thumbnail=get_thumb('tvshows', auto=True), page=0), + + item.clone(title="Buscar", action="search", thumbnail=get_thumb('search', auto=True), + text_blod=True, url=host, page=0)] + + autoplay.show_option(item.channel, itemlist) + return itemlist + + +def menumovies(item): + logger.info() + itemlist = [item.clone(title="Novedades", action="peliculas", thumbnail=get_thumb('newest', auto=True), + text_blod=True, page=0, viewcontent='movies', + url=host + 'peliculas/', viewmode="movie_with_plot"), + + item.clone(title="Estrenos", action="peliculas", thumbnail=get_thumb('estrenos', auto=True), + text_blod=True, page=0, viewcontent='movies', + url=host + '?s=trfilter&trfilter=1&years%5B%5D=2018', viewmode="movie_with_plot"), + + item.clone(title="Más Vistas", action="peliculas", thumbnail=get_thumb('more watched', auto=True), + text_blod=True, page=0, viewcontent='movies', + url=host + 'peliculas-mas-vistas/', viewmode="movie_with_plot"), + + item.clone(title="Géneros", action="genresYears", thumbnail=get_thumb('genres', auto=True), + text_blod=True, page=0, viewcontent='movies', + url=host, viewmode="movie_with_plot"), + + item.clone(title="Estrenos por Año", action="genresYears", thumbnail=get_thumb('year', auto=True), + text_blod=True, page=0, viewcontent='movies', url=host, + viewmode="movie_with_plot"), + + item.clone(title="Buscar", action="search", thumbnail=get_thumb('search', auto=True), + text_blod=True, url=host, page=0, extra='buscarP')] + + return itemlist + + +def search(item, texto): + logger.info() + + texto = texto.replace(" ", "+") + item.url = urlparse.urljoin(item.url, "?s={0}".format(texto)) + + try: + return peliculas(item) + + # Se captura la excepción, para no interrumpir al buscador global si un canal falla + except: + import sys + for line in sys.exc_info(): + logger.error("{0}".format(line)) + return [] + + +def peliculas(item): + logger.info() + itemlist = [] + data = httptools.downloadpage(item.url).data + data = re.sub(r"\n|\r|\t|\(.*?\)|\s{2}| ", "", data) + data = scrapertools.decodeHtmlentities(data) + patron = '
  • ' + + data = scrapertools.find_single_match(data, patron_todas) + patron = '([^<]+)' # url, title + matches = scrapertools.find_multiple_matches(data, patron) + + for scrapedurl, scrapedtitle in matches: + + itemlist.append(item.clone(title=scrapedtitle, url=scrapedurl, action="peliculas")) + + return itemlist + + +def year_release(item): + logger.info() + itemlist = [] + + data = scrapertools.cache_page(item.url) + data = re.sub(r"\n|\r|\t|\s{2}| ", "", data) + patron = '
  • ([^<]+)
  • ' # url, title + matches = re.compile(patron, re.DOTALL).findall(data) + + for scrapedurl, scrapedtitle in matches: + + itemlist.append(item.clone(channel=item.channel, action="peliculas", title=scrapedtitle, page=0, + url=scrapedurl, text_color=color3, viewmode="movie_with_plot", extra='next')) + + return itemlist + + +def series(item): + logger.info() + itemlist = [] + + data = httptools.downloadpage(item.url).data + data = re.sub(r"\n|\r|\t|\(.*?\)| |
    ", "", data) + patron = '
    \s*.*?' # url + patron += '') + + if next_page: + itemlist.append(item.clone(url=next_page, page=0, + title="» Siguiente »", text_color=color3)) + + return itemlist + + +def temporadas(item): + logger.info() + itemlist = [] + + data = httptools.downloadpage(item.url).data + data = re.sub(r"\n|\r|\t| |
    ", "", data) + patron = '
    0: + itemlist.append(Item(channel=__channel__, title="Añadir esta serie a la videoteca", url=item.url, + action="add_serie_to_library", extra="episodios", show=item.show, category="Series", + text_color=color1, thumbnail=thumbnail_host, fanart=fanart_host)) + + return itemlist + else: + return episodios(item) + + +def episodios(item): + logger.info() + itemlist = [] + + data = httptools.downloadpage(item.url).data + data = re.sub(r"\n|\r|\t| |
    ", "", data) + patron = '
    0: + itemlist.append(Item(channel=__channel__, title="Añadir esta serie a la videoteca", url=item.url, + action="add_serie_to_library", extra="episodios", show=item.show, category="Series", + text_color=color1, thumbnail=thumbnail_host, fanart=fanart_host)) + + return itemlist + + +def findvideos(item): + logger.info() + itemlist = [] + + data = httptools.downloadpage(item.url).data + data = re.sub(r"\n|\r|\t|amp;|#038;|\(.*?\)|\s{2}| ", "", data) + data = scrapertools.decodeHtmlentities(data) + patron = 'data-tplayernv="Opt(.*?)">(.*?)(.*?)' # option, server, lang - quality + matches = re.compile(patron, re.DOTALL).findall(data) + + for option, servername, quote in matches: + patron = '(.*?) -([^<]+)';return embedCode;}document.getElementById('share_embed').value = getEmbed();var adList = [];if(fluidPlayerClass.getCookie('pb_vast')==1) {adList.push({roll: 'preRoll',vastTag: "https://syndication.exosrv.com/splash.php?idzone=3180702",});} else {adList.push({roll: 'preRoll',vastTag: "https://syndication.exosrv.com/splash.php?idzone=2946968",});}adList.push({roll: 'midRoll',vastTag: 'https://syndication.exosrv.com/splash.php?idzone=2947082',size : '728x90',cookieTime : 1,timer:10,});htmlOnPauseBlock = {html : '
    Advertisement
    ',height: 277,width:304,onBeforeShow : function() {}};var myFP = fluidPlayer('main_video',{layoutControls: {timelinePreview: {file: 'https://fapality.com/thumbnails.vtt?id=23869&i=5&d=420&format=inplayer',type: 'VTT'},allowTheatre: true,allowDownload: allow_download,primaryColor:'#fb5350',shareCs:{url : 'https://fapality.com/cs/nubiles-porn/',title : 'View full video at Nubiles-Porn',},playbackRateEnabled: true,htmlOnPauseBlock: htmlOnPauseBlock,controlBar: {autoHide: true,autoHideTimeout: 3,animated: true,},},vastOptions: {adList: adList,vastAdvanced: {vastLoadedCallback: (function() {if(fluidPlayerClass.getCookie('pb_source')=="1") {fluidPlayerClass.setCookie('pb_vast',1,6);}}),noVastVideoCallback: (function() {}),vastVideoSkippedCallback: (function() {}),vastVideoEndedCallback: (function() {})},adCTAText: false,vastTimeout: 5000,}});var player_obj = myFP;
    Nubiles-Porn
    0
    - - patron = '", "", data) patron = '.*?([^"]+)' matches = re.compile(patron,re.DOTALL).findall(data) - scrapertools.printMatches(matches) for scrapedurl,scrapedtitle,scrapedthumbnail,cantidad in matches: scrapedplot = "" scrapedtitle = scrapedtitle + " (" + cantidad + ")" diff --git a/plugin.video.alfa/channels/filmoviXXX.py b/plugin.video.alfa/channels/filmoviXXX.py index 5bf7eb4c..44b952c4 100644 --- a/plugin.video.alfa/channels/filmoviXXX.py +++ b/plugin.video.alfa/channels/filmoviXXX.py @@ -27,10 +27,23 @@ def mainlist(item): thumbnail = scrapedthumbnail plot = "" year = "" - itemlist.append( Item(channel=item.channel, action="findvideos" , title=title , url=scrapedurl, thumbnail=thumbnail, plot=plot, contentTitle=contentTitle, infoLabels={'year':year} )) + itemlist.append( Item(channel=item.channel, action="play" , title=title , url=scrapedurl, thumbnail=thumbnail, plot=plot, contentTitle=contentTitle, infoLabels={'year':year} )) next_page_url = scrapertools.find_single_match(data,'
  • .*?.*?
    ([^"]+)
    .*?
    (\d+)
    ' matches = re.compile(patron,re.DOTALL).findall(data) - scrapertools.printMatches(matches) for scrapedurl,scrapedthumbnail,scrapedtitle,cantidad in matches: scrapedplot = "" scrapedtitle = scrapedtitle + " (" + cantidad + ")" diff --git a/plugin.video.alfa/channels/freepornstreams.py b/plugin.video.alfa/channels/freepornstreams.py index a6d5e464..c1cee64b 100644 --- a/plugin.video.alfa/channels/freepornstreams.py +++ b/plugin.video.alfa/channels/freepornstreams.py @@ -46,7 +46,6 @@ def catalogo(item): data = re.sub(r"\n|\r|\t| |
    ", "", data) patron = '
  • (.*?)' matches = re.compile(patron,re.DOTALL).findall(data) - scrapertools.printMatches(matches) for scrapedurl,scrapedtitle in matches: scrapedplot = "" scrapedthumbnail = "" @@ -75,25 +73,26 @@ def peliculas(item): patron = '
    (.*?).*?') - # next_page = next_page[0] - #next_page = host + next_page - # itemlist.append( Item(channel=item.channel, action="peliculas", title=next_page , text_color="blue", url=next_page ) ) return itemlist + +def play(item): + logger.info() + data = scrapertools.cachePage(item.url) + itemlist = servertools.find_video_items(data=data) + for videoitem in itemlist: + videoitem.title = item.fulltitle + videoitem.fulltitle = item.fulltitle + videoitem.thumbnail = item.thumbnail + videochannel=item.channel + return itemlist + \ No newline at end of file diff --git a/plugin.video.alfa/channels/hclips.py b/plugin.video.alfa/channels/hclips.py index ce16f24f..b071e9c2 100644 --- a/plugin.video.alfa/channels/hclips.py +++ b/plugin.video.alfa/channels/hclips.py @@ -43,7 +43,6 @@ def categorias(item): data = re.sub(r"\n|\r|\t| |
    ", "", data) patron = '
    .*?src="([^"]+)".*?([^"]+).*?(.*?)' matches = re.compile(patron,re.DOTALL).findall(data) - scrapertools.printMatches(matches) for scrapedurl,scrapedthumbnail,scrapedtitle,vidnum in matches: scrapedplot = "" title = scrapedtitle + " \(" + vidnum + "\)" diff --git a/plugin.video.alfa/channels/hdfilmologia.json b/plugin.video.alfa/channels/hdfilmologia.json new file mode 100644 index 00000000..eb3846b5 --- /dev/null +++ b/plugin.video.alfa/channels/hdfilmologia.json @@ -0,0 +1,48 @@ +{ + "id": "hdfilmologia", + "name": "HDFilmologia", + "active": true, + "adult": false, + "language": ["cast", "lat"], + "fanart": "https://i.postimg.cc/qvFCZNKT/Alpha-652355392-large.jpg", + "thumbnail": "https://hdfilmologia.com/templates/gorstyle/images/logo.png", + "banner": "", + "categories": [ + "movie", + "vos" + ], + "settings": [ + { + "id": "modo_grafico", + "type": "bool", + "label": "Buscar información extra", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "perfil", + "type": "list", + "label": "Perfil de color", + "default": 3, + "enabled": true, + "visible": true, + "lvalues": [ + "Sin color", + "Perfil 5", + "Perfil 4", + "Perfil 3", + "Perfil 2", + "Perfil 1" + ] + }, + { + "id": "orden_episodios", + "type": "bool", + "label": "Mostrar los episodios de las series en orden descendente", + "default": false, + "enabled": true, + "visible": true + } + ] +} diff --git a/plugin.video.alfa/channels/hdfilmologia.py b/plugin.video.alfa/channels/hdfilmologia.py new file mode 100644 index 00000000..6d0952a2 --- /dev/null +++ b/plugin.video.alfa/channels/hdfilmologia.py @@ -0,0 +1,262 @@ +# -*- coding: utf-8 -*- +# -*- Channel HDFilmologia -*- +# -*- Created for Alfa-addon -*- +# -*- By the Alfa Develop Group -*- + +import re +import sys +import urllib +import urlparse + +from core import httptools +from core import scrapertools +from core import servertools +from core.item import Item +from core import channeltools +from core import tmdb +from platformcode import config, logger +from channelselector import get_thumb + +__channel__ = "hdfilmologia" + +host = "https://hdfilmologia.com/" + +try: + __modo_grafico__ = config.get_setting('modo_grafico', __channel__) + __perfil__ = int(config.get_setting('perfil', __channel__)) +except: + __modo_grafico__ = True + __perfil__ = 0 + +# Fijar perfil de color +perfil = [['0xFFFFE6CC', '0xFFFFCE9C', '0xFF994D00', '0xFFFE2E2E', '0xFFFFD700'], + ['0xFFA5F6AF', '0xFF5FDA6D', '0xFF11811E', '0xFFFE2E2E', '0xFFFFD700'], + ['0xFF58D3F7', '0xFF2E9AFE', '0xFF2E64FE', '0xFFFE2E2E', '0xFFFFD700']] +if __perfil__ < 3: + color1, color2, color3, color4, color5 = perfil[__perfil__] +else: + color1 = color2 = color3 = color4 = color5 = "" + +headers = [['User-Agent', 'Mozilla/50.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0'], + ['Referer', host]] + + +parameters = channeltools.get_channel_parameters(__channel__) +fanart_host = parameters['fanart'] +thumbnail_host = parameters['thumbnail'] + + +def mainlist(item): + logger.info() + itemlist = [] + + itemlist.append(item.clone(title="Últimas Agregadas", action="movies",thumbnail=get_thumb('last', auto=True), + text_blod=True, page=0, viewcontent='movies', + url=host + 'index.php?do=lastnews', viewmode="movie_with_plot")) + + itemlist.append(item.clone(title="Estrenos", action="movies", thumbnail=get_thumb('premieres', auto=True), + text_blod=True, page=0, viewcontent='movies', url=host + 'estrenos', + viewmode="movie_with_plot")) + + itemlist.append(item.clone(title="Más Vistas", action="movies",thumbnail=get_thumb('more watched', auto=True), + text_blod=True, page=0, viewcontent='movies', + url=host + 'mas-vistas/', viewmode="movie_with_plot")) + + itemlist.append(item.clone(title="Películas Por País", action="countriesYears",thumbnail=get_thumb('country', auto=True), + text_blod=True, page=0, viewcontent='movies', + url=host, viewmode="movie_with_plot")) + + itemlist.append(item.clone(title="Películas Por Año", action="countriesYears",thumbnail=get_thumb('year', auto=True), + text_blod=True, page=0, viewcontent='movies', + url=host, viewmode="movie_with_plot")) + + itemlist.append(item.clone(title="Géneros", action="genres",thumbnail=get_thumb('genres', auto=True), + text_blod=True, page=0, viewcontent='movies', + url=host, viewmode="movie_with_plot")) + + + + itemlist.append(item.clone(title="Buscar", action="search",thumbnail=get_thumb('search', auto=True), + text_blod=True, url=host, page=0)) + + + return itemlist + + +def search(item, texto): + logger.info() + + texto = texto.replace(" ", "+") + item.url = urlparse.urljoin(item.url, "?do=search&mode=advanced&subaction=search&story={0}".format(texto)) + # 'https://hdfilmologia.com/?do=search&mode=advanced&subaction=search&story=la+sombra' + + try: + return sub_search(item) + + # Se captura la excepción, para no interrumpir al buscador global si un canal falla + except: + import sys + for line in sys.exc_info(): + logger.error("{0}".format(line)) + return [] + + +def sub_search(item): + logger.info() + + itemlist = [] + data = httptools.downloadpage(item.url).data + data = re.sub(r"\n|\r|\t| |
    ", "", data) + patron = '
    ' #url + patron += '
    ([^.*?' # img, title + patron += '
    (.*?)
    ' # plot + + matches = re.compile(patron, re.DOTALL).findall(data) + + for scrapedurl, scrapedthumbnail, scrapedtitle, plot in matches: + + itemlist.append(item.clone(title=scrapedtitle, url=scrapedurl, contentTitle=scrapedtitle, + action="findvideos", text_color=color3, page=0, plot=plot, + thumbnail=host+scrapedthumbnail)) + + pagination = scrapertools.find_single_match(data, 'class="pnext">
    ') + + if pagination: + itemlist.append(Item(channel=__channel__, action="sub_search", + title="» Siguiente »", url=pagination)) + + tmdb.set_infoLabels(itemlist) + + return itemlist + + +def movies(item): + logger.info() + itemlist = [] + + data = httptools.downloadpage(item.url).data + data = re.sub(r"\n|\r|\t|\(.*?\)|\s{2}| ", "", data) + patron = '
    .*?

    ([^<]+)

    .*?' # url, title + patron += '
    ') + + if next_page: + itemlist.append(item.clone(url=next_page, page=0, + title="» Siguiente »", text_color=color3)) + + + return itemlist + + +def genres(item): + logger.info() + itemlist = [] + + data = scrapertools.cache_page(item.url) + data = re.sub(r"\n|\r|\t|\s{2}| ", "", data) + + patron = '
  • ([^<]+)' + matches = re.compile(patron, re.DOTALL).findall(data) + + for scrapedurl, scrapedtitle in matches: + + itemlist.append(item.clone(channel=__channel__, action="movies", title=scrapedtitle, + url=host+scrapedurl, text_color=color3, viewmode="movie_with_plot")) + + return itemlist + + +def countriesYears(item): + logger.info() + itemlist = [] + data = httptools.downloadpage(item.url).data + data = re.sub(r"\n|\r|\t|\(.*?\)| |
    ", "", data) + + if item.title == "Películas Por País": + patron_todas = 'Por País(.*?)' + else: + patron_todas = 'Por Año(.*?)' # url, title + matches = scrapertools.find_multiple_matches(data, patron) + + for scrapedurl, scrapedtitle in matches: + + itemlist.append(item.clone(title=scrapedtitle, url=host+scrapedurl, action="movies")) + + + return itemlist + + +def findvideos(item): + logger.info() + itemlist = [] + + data = httptools.downloadpage(item.url).data + data = re.sub(r"\n|\r|\t|amp;|#038;|\(.*?\)|\s{2}| ", "", data) + + patron = '(\w+)src\d+="([^"]+)"' + matches = re.compile(patron, re.DOTALL).findall(data) + + for lang, url in matches: + + server = servertools.get_server_from_url(url) + if 'dropbox' in url: + server = 'dropbox' + if '/drive/' in url: + data = httptools.downloadpage(url).data + url = scrapertools.find_single_match(data, '' + patron = '