diff --git a/mediaserver/datos.txt b/mediaserver/datos.txt new file mode 100644 index 00000000..600cf24d --- /dev/null +++ b/mediaserver/datos.txt @@ -0,0 +1,3 @@ +TempMode +Silent=1 +setup=alfa.exe diff --git a/mediaserver/genera.bat b/mediaserver/genera.bat index 648884ce..b4196419 100644 --- a/mediaserver/genera.bat +++ b/mediaserver/genera.bat @@ -1,5 +1,9 @@ REM Genera los archivos para el ejecutable en windows de Alfa Mediaserver +REM Y tambien genera el zip para Mediaserver +REM Los 2 los genera en la raiz del disco +winrar a -r \Alfa-Mediaserver-.zip \plugin.video.alfa\ python setup.py py2exe -p channels,servers,lib,platformcode xcopy lib dist\lib /y /s /i xcopy platformcode dist\platformcode /y /s /i xcopy resources dist\resources /y /s /i +winrar a -ep1 -r -iiconplatformcode\template\favicon.ico -sfx -zdatos.txt \Alfa-Mediaserver--win dist\ diff --git a/mediaserver/platformcode/controllers/__init__.py b/mediaserver/platformcode/controllers/__init__.py index 41b7e8ae..9dc96fa4 100644 --- a/mediaserver/platformcode/controllers/__init__.py +++ b/mediaserver/platformcode/controllers/__init__.py @@ -12,7 +12,7 @@ from platformcode import config, logger def load_controllers(): controllers = [] - path = os.path.join(config.get_runtime_path(),"platformcode\controllers") + path = os.path.join(config.get_runtime_path(),"platformcode", "controllers") for fname in os.listdir(path): mod, ext = os.path.splitext(fname) fname = os.path.join(path, fname) diff --git a/plugin.video.alfa/addon.xml b/plugin.video.alfa/addon.xml index 37d3ce29..2418398b 100755 --- a/plugin.video.alfa/addon.xml +++ b/plugin.video.alfa/addon.xml @@ -1,5 +1,5 @@ - + @@ -19,15 +19,15 @@ [B]Estos son los cambios para esta versión:[/B] [COLOR green][B]Canales agregados y arreglos[/B][/COLOR] - ¤ elitetorrent ¤ grantorrent - ¤ newpct1 ¤ seriesanimadas - ¤ seriesblanco ¤ rapidvideo - ¤ watchvideo ¤ pelispedia - ¤ beeg + ¤ cuevana3 ¤ clipwatching + ¤ estrenosgo ¤ datoporn + ¤ elitetorrent ¤ mejortorrent1 + ¤ newpct1 ¤ seriespapaya + ¤ cinetux ¤ pelisplusco ¤ arreglos internos - ¤ Agradecimientos a @angedam por colaborar en ésta versión + ¤ Agradecimientos a @angedam y @alaquepasa por colaborar en é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/animeflv_me.py b/plugin.video.alfa/channels/animeflv_me.py deleted file mode 100644 index 1644edd6..00000000 --- a/plugin.video.alfa/channels/animeflv_me.py +++ /dev/null @@ -1,315 +0,0 @@ -# -*- coding: utf-8 -*- - -import re -import urlparse -from os import path - -from channels import renumbertools -from core import filetools -from core import httptools -from core import scrapertools -from core import servertools -from core.item import Item -from platformcode import config, logger -from channels import autoplay - -list_servers = ['openload', - 'directo' - ] -list_quality = ['default'] - -CHANNEL_HOST = "http://animeflv.co" -CHANNEL_DEFAULT_HEADERS = [ - ["User-Agent", "Mozilla/5.0"], - ["Accept-Encoding", "gzip, deflate"], - ["Referer", CHANNEL_HOST] -] - -REGEX_NEXT_PAGE = "class='current'>\d+?
  • )(.+?)(?:)' -REGEX_THUMB = r'src="(http://media.animeflv\.co/uploads/thumbs/[^"]+?)"' -REGEX_PLOT = r'Línea de historia:

    (.*?)' -REGEX_URL = r'href="(http://animeflv\.co/Anime/[^"]+)">' -REGEX_SERIE = r'%s.+?%s([^<]+?)

    (.+?)

    ' % (REGEX_THUMB, REGEX_URL) -REGEX_EPISODE = r'href="(http://animeflv\.co/Ver/[^"]+?)">(?:)?(.+?)(\d+/\d+/\d+)' -REGEX_GENERO = r'([^<]+)' - - -def get_url_contents(url): - html = httptools.downloadpage(url, headers=CHANNEL_DEFAULT_HEADERS).data - # Elimina los espacios antes y despues de aperturas y cierres de etiquetas - html = re.sub(r'>\s+<', '><', html) - html = re.sub(r'>\s+', '>', html) - html = re.sub(r'\s+<', '<', html) - - return html - - -def get_cookie_value(): - """ - Obtiene las cookies de cloudflare - """ - - cookie_file = path.join(config.get_data_path(), 'cookies.dat') - cookie_data = filetools.read(cookie_file) - - cfduid = scrapertools.find_single_match( - cookie_data, r"animeflv.*?__cfduid\s+([A-Za-z0-9\+\=]+)") - cfduid = "__cfduid=" + cfduid + ";" - cf_clearance = scrapertools.find_single_match( - cookie_data, r"animeflv.*?cf_clearance\s+([A-Za-z0-9\+\=\-]+)") - cf_clearance = " cf_clearance=" + cf_clearance - cookies_value = cfduid + cf_clearance - - return cookies_value - - -header_string = "|User-Agent=Mozilla/5.0&Referer=http://animeflv.co&Cookie=" + \ - get_cookie_value() - -def __extract_info_from_serie(html): - title = scrapertools.find_single_match(html, REGEX_TITLE) - title = clean_title(title) - url = scrapertools.find_single_match(html, REGEX_URL) - thumbnail = scrapertools.find_single_match( - html, REGEX_THUMB) + header_string - plot = scrapertools.find_single_match(html, REGEX_PLOT) - - return [title, url, thumbnail, plot] - - -def __sort_by_quality(items): - """ - Ordena los items por calidad en orden decreciente - """ - - def func(item): - return int(scrapertools.find_single_match(item.title, r'\[(.+?)\]')) - - return sorted(items, key=func, reverse=True) - - -def clean_title(title): - """ - Elimina el año del nombre de las series o peliculas - """ - year_pattern = r'\([\d -]+?\)' - - return re.sub(year_pattern, '', title).strip() - - -def __find_series(html): - """ - Busca series en un listado, ejemplo: resultados de busqueda, categorias, etc - """ - series = [] - - # Limitamos la busqueda al listado de series - list_start = html.find('') - list_end = html.find('
    ', list_start) - - list_html = html[list_start:list_end] - - for serie in re.finditer(REGEX_SERIE, list_html, re.S): - thumbnail, url, title, plot = serie.groups() - title = clean_title(title) - thumbnail = thumbnail + header_string - plot = scrapertools.htmlclean(plot) - - series.append([title, url, thumbnail, plot]) - - return series - - -def mainlist(item): - logger.info() - - autoplay.init(item.channel, list_servers, list_quality) - itemlist = list() - - itemlist.append(Item(channel=item.channel, action="letras", - title="Por orden alfabético")) - itemlist.append(Item(channel=item.channel, action="generos", title="Por géneros", - url= CHANNEL_HOST + "/ListadeAnime")) - itemlist.append(Item(channel=item.channel, action="series", title="Por popularidad", - url=CHANNEL_HOST + "/ListadeAnime/MasVisto")) - itemlist.append(Item(channel=item.channel, action="series", title="Novedades", - url=CHANNEL_HOST + "/ListadeAnime/Nuevo")) - itemlist.append(Item(channel=item.channel, action="series", title="Últimos", - url=CHANNEL_HOST + "/ListadeAnime/LatestUpdate")) - itemlist.append(Item(channel=item.channel, action="search", title="Buscar...", - url=CHANNEL_HOST + "/Buscar?s=")) - - itemlist = renumbertools.show_option(item.channel, itemlist) - autoplay.show_option(item.channel, itemlist) - - return itemlist - - -def letras(item): - logger.info() - base_url = 'http://animeflv.co/ListadeAnime?c=' - itemlist = list() - itemlist.append(Item(channel=item.channel, action="series", title="#", url=base_url + "#")) - - for letter in "ABCDEFGHIJKLMNOPQRSTUVWXYZ": - itemlist.append(Item(channel=item.channel, action="series", title=letter, url=base_url + letter)) - - return itemlist - - -def generos(item): - logger.info() - - itemlist = [] - - html = get_url_contents(item.url) - - list_genre = re.findall(REGEX_GENERO, html) - - for url, genero in list_genre: - itemlist.append(Item(channel=item.channel, action="series", title=genero, url=url)) - - return itemlist - - -def search(item, texto): - logger.info() - texto = texto.replace(" ", "%20") - item.url = "%s%s" % (item.url, texto) - html = get_url_contents(item.url) - try: - # Se encontro un solo resultado y se redicciono a la página de la serie - if html.find('Ver') >= 0: - show_list = [__extract_info_from_serie(html)] - # Se obtuvo una lista de resultados - else: - show_list = __find_series(html) - - items = [] - context = renumbertools.context(item) - context2 = autoplay.context - context.extend(context2) - for show in show_list: - title, url, thumbnail, plot = show - items.append(Item(channel=item.channel, action="episodios", title=title, url=url, thumbnail=thumbnail, - plot=plot, show=title, viewmode="movies_with_plot", context=context)) - except: - import sys - for line in sys.exc_info(): - logger.error("%s" % line) - return [] - - return items - - -def series(item): - logger.info() - page_html = get_url_contents(item.url) - show_list = __find_series(page_html) - items = [] - context = renumbertools.context(item) - context2 = autoplay.context - context.extend(context2) - for show in show_list: - title, url, thumbnail, plot = show - items.append(Item(channel=item.channel, action="episodios", title=title, url=url, thumbnail=thumbnail, contentSerieName=title, - plot=plot, show=title, viewmode="movies_with_plot", context=context)) - - url_next_page = scrapertools.find_single_match(page_html, REGEX_NEXT_PAGE) - if url_next_page: - items.append(Item(channel=item.channel, action="series", title=">> Página Siguiente", url= CHANNEL_HOST + url_next_page)) - - return items - - -def episodios(item): - logger.info() - itemlist = [] - html_serie = get_url_contents(item.url) - info_serie = __extract_info_from_serie(html_serie) - if info_serie[3]: - plot = info_serie[3] - else: - plot = '' - - episodes = re.findall(REGEX_EPISODE, html_serie, re.DOTALL) - es_pelicula = False - for url, title, date in episodes: - episode = scrapertools.find_single_match(title, r'Episodio (\d+)') - new_item=itemlist.append(Item(channel=item.channel, action="findvideos", - url=url, thumbnail=item.thumbnail, plot=plot, show=item.show)) - # El enlace pertenece a un episodio - if episode: - season = 1 - episode = int(episode) - season, episode = renumbertools.numbered_for_tratk( - item.channel, item.contentSerieName, season, episode) - new_item.infoLabels["episode"] = episode - new_item.infoLabels["season"] = season - new_item.contentSerieName = item.contentSerieName - title = "%sx%s %s (%s)" % (season, str(episode).zfill(2), "Episodio %s" % episode, date) - # El enlace pertenece a una pelicula - else: - title = "%s (%s)" % (title, date) - item.url = url - es_pelicula = True - new_item.title=title - new_item.fulltitle="%s %s" % (item.show, title) - itemlist.append(new_item) - - # El sistema soporta la videoteca y se encontro por lo menos un episodio - # o pelicula - if config.get_videolibrary_support() and len(itemlist) > 0: - if es_pelicula: - item_title = "Añadir película a la videoteca" - item_action = "add_pelicula_to_library" - item_extra = "" - else: - item_title = "Añadir serie a la videoteca" - item_action = "add_serie_to_library" - item_extra = "episodios" - - itemlist.append(Item(channel=item.channel, title=item_title, url=item.url, - action=item_action, extra=item_extra, show=item.show)) - - if not es_pelicula: - itemlist.append(Item(channel=item.channel, title="Descargar todos los episodios", - url=item.url, action="download_all_episodes", extra="episodios", - show=item.show)) - return itemlist - - -def findvideos(item): - logger.info() - itemlist = [] - encontrados = [] - page_html = get_url_contents(item.url) - regex_api = r'http://player\.animeflv\.co/[^\"]+' - iframe_url = scrapertools.find_single_match(page_html, regex_api) - - iframe_html = get_url_contents(iframe_url) - itemlist.extend(servertools.find_video_items(data=iframe_html)) - - qualities = ["360", "480", "720", "1080"] - for videoitem in itemlist: - if videoitem.url in encontrados: - continue - encontrados.append(videoitem.url) - videoitem.fulltitle = item.fulltitle - videoitem.title = "%s en calidad [%s]" % (videoitem.server, qualities[1]) - videoitem.channel = item.channel - videoitem.thumbnail = item.thumbnail - - regex_video_list = r'var part = \[([^\]]+)' - videos_html = scrapertools.find_single_match(iframe_html, regex_video_list) - videos = re.findall('"([^"]+)"', videos_html, re.DOTALL) - for quality_id, video_url in enumerate(videos): - if video_url in encontrados: - continue - encontrados.append(video_url) - itemlist.append(Item(channel=item.channel, action="play", url=video_url, show=re.escape(item.show), - title="Ver en calidad [%s]" % (qualities[quality_id]), plot=item.plot, - fulltitle=item.title)) - autoplay.start(__sort_by_quality(itemlist), item) - return __sort_by_quality(itemlist) diff --git a/plugin.video.alfa/channels/animeflv_ru.json b/plugin.video.alfa/channels/animeflv_ru.json deleted file mode 100755 index 9a9d9a27..00000000 --- a/plugin.video.alfa/channels/animeflv_ru.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "id": "animeflv_ru", - "name": "AnimeFLV.RU", - "active": true, - "adult": false, - "language": ["cast", "lat"], - "thumbnail": "http://i.imgur.com/5nRR9qq.png", - "banner": "animeflv_ru.png", - "compatible": { - "python": "2.7.9" - }, - "categories": [ - "anime" - ], - "settings": [ - { - "id": "include_in_global_search", - "type": "bool", - "label": "Incluir en busqueda global", - "default": false, - "enabled": true, - "visible": true - }, - { - "id": "include_in_newest_anime", - "type": "bool", - "label": "Incluir en Novedades - Episodios de anime", - "default": true, - "enabled": true, - "visible": true - } - ] -} \ No newline at end of file diff --git a/plugin.video.alfa/channels/autoplay.py b/plugin.video.alfa/channels/autoplay.py index 90e79826..7d309efc 100644 --- a/plugin.video.alfa/channels/autoplay.py +++ b/plugin.video.alfa/channels/autoplay.py @@ -27,7 +27,7 @@ def context(): _context = "" if config.is_xbmc(): - _context = [{"title": "Configurar AutoPlay", + _context = [{"title": config.get_localized_string(60071), "action": "autoplay_config", "channel": "autoplay"}] return _context @@ -60,7 +60,7 @@ def show_option(channel, itemlist, text_color='yellow', thumbnail=None, fanart=N 'servidores y calidades favoritas. ' itemlist.append( Item(channel=__channel__, - title="Configurar AutoPlay", + title=config.get_localized_string(60071), action="autoplay_config", text_color=text_color, thumbnail=thumbnail, @@ -102,7 +102,12 @@ def start(itemlist, item): if item.channel == 'videolibrary': autoplay_node = jsontools.get_node_from_file('autoplay', 'AUTOPLAY') channel_id = item.contentChannel - if not channel_id in autoplay_node or not autoplay_node['status']: + try: + active = autoplay_node['status'] + except: + active = is_active(item.channel) + + if not channel_id in autoplay_node or not active: return itemlist # Agrega servidores y calidades que no estaban listados a autoplay_node @@ -176,7 +181,7 @@ def start(itemlist, item): if 'context' not in item: item.context = list() if not filter(lambda x: x['action'] == 'autoplay_config', context): - item.context.append({"title": "Configurar AutoPlay", + item.context.append({"title": config.get_localized_string(60071), "action": "autoplay_config", "channel": "autoplay", "from_channel": channel_id}) @@ -330,20 +335,19 @@ def start(itemlist, item): # Si se han alcanzado el numero maximo de intentos de este servidor # preguntar si queremos seguir probando o lo ignoramos if max_intentos_servers[videoitem.server.lower()] == 0: - text = "Parece que los enlaces de %s no estan funcionando." % videoitem.server.upper() + text = config.get_localized_string(60072) % videoitem.server.upper() if not platformtools.dialog_yesno("AutoPlay", text, - "¿Desea ignorar todos los enlaces de este servidor?"): + config.get_localized_string(60073)): max_intentos_servers[videoitem.server.lower()] = max_intentos # Si no quedan elementos en la lista se informa if autoplay_elem == autoplay_list[-1]: - platformtools.dialog_notification('AutoPlay', 'No hubo enlaces funcionales') + platformtools.dialog_notification('AutoPlay', config.get_localized_string(60072)) else: - platformtools.dialog_notification('AutoPlay No Fue Posible', 'No Hubo Coincidencias') + platformtools.dialog_notification(config.get_localized_string(60074), config.get_localized_string(60075)) if new_options: - platformtools.dialog_notification("AutoPlay", "Nueva Calidad/Servidor disponible en la " - "configuracion", sound=False) + platformtools.dialog_notification("AutoPlay", config.get_localized_string(60076), sound=False) # Restaura si es necesario el valor previo de "Accion y Player Mode" en preferencias if user_config_setting_action != 2: @@ -408,15 +412,14 @@ def init(channel, list_servers, list_quality, reset=False): channel_node["settings"]["server_%s" % n] = s channel_node["settings"]["quality_%s" % n] = c - autoplay_node[channel] = channel_node if change: result, json_data = jsontools.update_node(autoplay_node, 'autoplay', 'AUTOPLAY') if not result: - heading = "Error al iniciar AutoPlay" - msj = "Consulte su log para obtener mas información." + heading = config.get_localized_string(60077) + msj = config.get_localized_string(60078) icon = 1 platformtools.dialog_notification(heading, msj, icon, sound=False) @@ -482,7 +485,7 @@ def autoplay_config(item): allow_option = True - active_settings = {"id": "active", "label": "AutoPlay (activar/desactivar la auto-reproduccion)", + active_settings = {"id": "active", "label": config.get_localized_string(60079), "color": "0xffffff99", "type": "bool", "default": False, "enabled": allow_option, "visible": allow_option} list_controls.append(active_settings) @@ -493,7 +496,7 @@ def autoplay_config(item): if not status_language: status_language = 0 - set_language = {"id": "language", "label": "Idioma para AutoPlay (Opcional)", "color": "0xffffff99", + set_language = {"id": "language", "label": config.get_localized_string(60080), "color": "0xffffff99", "type": "list", "default": 0, "enabled": "eq(-1,true)", "visible": True, "lvalues": get_languages(item.from_channel)} @@ -513,7 +516,7 @@ def autoplay_config(item): else: enabled = "eq(-3,true)" - custom_servers_settings = {"id": "custom_servers", "label": " Servidores favoritos", "color": "0xff66ffcc", + custom_servers_settings = {"id": "custom_servers", "label": config.get_localized_string(60081), "color": "0xff66ffcc", "type": "bool", "default": False, "enabled": enabled, "visible": True} list_controls.append(custom_servers_settings) if dict_values['active'] and enabled: @@ -526,7 +529,7 @@ def autoplay_config(item): default = num - 1 if default > len(server_list) - 1: default = 0 - set_servers = {"id": "server_%s" % num, "label": u" \u2665 Servidor Favorito %s" % num, + set_servers = {"id": "server_%s" % num, "label": u" \u2665" + config.get_localized_string(60082) % num, "color": "0xfffcab14", "type": "list", "default": default, "enabled": "eq(-%s,true)+eq(-%s,true)" % (pos1, num), "visible": True, "lvalues": server_list} @@ -544,7 +547,7 @@ def autoplay_config(item): else: enabled = "eq(-7,true)" - custom_quality_settings = {"id": "custom_quality", "label": " Calidades Favoritas", "color": "0xff66ffcc", + custom_quality_settings = {"id": "custom_quality", "label": config.get_localized_string(60083), "color": "0xff66ffcc", "type": "bool", "default": False, "enabled": enabled, "visible": True} list_controls.append(custom_quality_settings) if dict_values['active'] and enabled: @@ -570,15 +573,15 @@ def autoplay_config(item): # Plan B dict_values['plan_b'] = settings_node.get('plan_b', False) enabled = "eq(-4,true)|eq(-8,true)" - plan_b = {"id": "plan_b", "label": " Plan B (Si fallan los favoritos prueba otros enlaces)", + plan_b = {"id": "plan_b", "label": config.get_localized_string(70172), "color": "0xffffff99", "type": "bool", "default": False, "enabled": enabled, "visible": True} list_controls.append(plan_b) # Seccion Prioridades - priority_list = ["Servidor y Calidad", "Calidad y Servidor"] - set_priority = {"id": "priority", "label": " Prioridad (Indica el orden para Auto-Reproducir)", + priority_list = [config.get_localized_string(70174), config.get_localized_string(70175)] + set_priority = {"id": "priority", "label": config.get_localized_string(60085), "color": "0xffffff99", "type": "list", "default": 0, "enabled": True, "visible": "eq(-5,true)+eq(-9,true)+eq(-12,true)", "lvalues": priority_list} list_controls.append(set_priority) @@ -681,7 +684,7 @@ def reset(item, dict): list_quality = channel.list_quality init(channel_name, list_servers, list_quality, reset=True) - platformtools.dialog_notification('AutoPlay', '%s: Los datos fueron reiniciados' % item.category) + platformtools.dialog_notification('AutoPlay', config.get_localized_string(70523) % item.category) return diff --git a/plugin.video.alfa/channels/cinetux.json b/plugin.video.alfa/channels/cinetux.json index b3e3a7bd..c0de82c3 100755 --- a/plugin.video.alfa/channels/cinetux.json +++ b/plugin.video.alfa/channels/cinetux.json @@ -12,6 +12,21 @@ "movie" ], "settings": [ + { + "id": "filter_languages", + "type": "list", + "label": "Mostrar enlaces en idioma...", + "default": 0, + "enabled": true, + "visible": true, + "lvalues": [ + "No filtrar", + "Latino", + "Subtitulado", + "Español", + "SUB" + ] + }, { "id": "include_in_global_search", "type": "bool", @@ -89,20 +104,6 @@ "Perfil 1" ] }, - { - "id": "filterlanguages", - "type": "list", - "label": "Mostrar enlaces en idioma...", - "default": 3, - "enabled": true, - "visible": true, - "lvalues": [ - "VOSE", - "Latino", - "Español", - "No filtrar" - ] - }, { "id": "filterlinks", "type": "list", @@ -117,6 +118,19 @@ ] }, { + "id": "filterlanguages", + "type": "list", + "label": "Mostrar enlaces del canal en idioma...", + "default": 3, + "enabled": true, + "visible": true, + "lvalues": [ + "VOSE", + "Latino", + "Español", + "No filtrar" + ] + }, { "id": "viewmode", "type": "list", "label": "Elegir vista por defecto (Confluence)...", diff --git a/plugin.video.alfa/channels/cinetux.py b/plugin.video.alfa/channels/cinetux.py index 578bb373..8776effd 100644 --- a/plugin.video.alfa/channels/cinetux.py +++ b/plugin.video.alfa/channels/cinetux.py @@ -1,5 +1,7 @@ # -*- coding: utf-8 -*- +from channels import autoplay +from channels import filtertools from core import httptools from core import scrapertools from core import servertools @@ -8,7 +10,13 @@ from core.item import Item from platformcode import config, logger from channelselector import get_thumb -CHANNEL_HOST = "http://www.cinetux.io/" +IDIOMAS = {'Latino': 'Latino', 'Subtitulado': 'Subtitulado', 'Español': 'Español', 'SUB': 'SUB' } +list_language = IDIOMAS.values() +list_quality = [] +list_servers = ['rapidvideo', 'streamango', 'okru', 'vidoza', 'openload', 'powvideo', 'netutv','gvideo'] + + +CHANNEL_HOST = "http://www.cinetux.to/" # Configuracion del canal __modo_grafico__ = config.get_setting('modo_grafico', 'cinetux') @@ -26,6 +34,7 @@ viewmode = viewmode_options[config.get_setting('viewmode', 'cinetux')] def mainlist(item): logger.info() + autoplay.init(item.channel, list_servers, list_quality) itemlist = [] item.viewmode = viewmode data = httptools.downloadpage(CHANNEL_HOST + "pelicula").data @@ -53,6 +62,7 @@ def mainlist(item): itemlist.append(item.clone(action="search", title="Buscar...", text_color=color3, thumbnail=get_thumb('search', auto=True))) itemlist.append(item.clone(action="configuracion", title="Configurar canal...", text_color="gold", folder=False)) + autoplay.show_option(item.channel, itemlist) return itemlist @@ -129,13 +139,13 @@ def peliculas(item): patron += '.*?alt="([^"]+)"' patron += '(.*?)' patron += 'href="([^"]+)"' - patron += '.*?(?:<span>|<span class="year">)([^<]+)' + patron += '.*?(?:<span>|<span class="year">)(.+?)<' matches = scrapertools.find_multiple_matches(data, patron) for scrapedthumbnail, scrapedtitle, quality, scrapedurl, scrapedyear in matches: quality = scrapertools.find_single_match(quality, '.*?quality">([^<]+)') try: fulltitle = scrapedtitle - year = scrapedyear.replace(" ", "") + year = scrapertools.find_single_match(scrapedyear,'\d{4}') if "/" in fulltitle: fulltitle = fulltitle.split(" /", 1)[0] scrapedtitle = "%s (%s)" % (fulltitle, year) @@ -219,8 +229,6 @@ def findvideos(item): filtro_enlaces = 2 dict_idiomas = {'Español': 2, 'Latino': 1, 'Subtitulado': 0} data = httptools.downloadpage(item.url).data - if item.infoLabels["year"]: - tmdb.set_infoLabels(item, __modo_grafico__) if filtro_enlaces != 0: list_enlaces = bloque_enlaces(data, filtro_idioma, dict_idiomas, "online", item) if list_enlaces: @@ -233,6 +241,14 @@ def findvideos(item): itemlist.append(item.clone(action="", title="Enlaces Descarga", text_color=color1, text_bold=True)) itemlist.extend(list_enlaces) + tmdb.set_infoLabels(item, __modo_grafico__) + + # Requerido para FilterTools + itemlist = filtertools.get_links(itemlist, item, list_language) + + # Requerido para AutoPlay + + autoplay.start(itemlist, item) if itemlist: itemlist.append(item.clone(channel="trailertools", title="Buscar Tráiler", action="buscartrailer", context="", text_color="magenta")) diff --git a/plugin.video.alfa/channels/cuevana3.py b/plugin.video.alfa/channels/cuevana3.py index 8265426b..9c4d64b3 100644 --- a/plugin.video.alfa/channels/cuevana3.py +++ b/plugin.video.alfa/channels/cuevana3.py @@ -30,19 +30,27 @@ def mainlist(item): autoplay.init(item.channel, list_servers, list_quality) itemlist = list() - itemlist.append(item.clone(title="Ultimas", action="list_all", url=host, thumbnail=get_thumb('last', auto=True))) - itemlist.append(item.clone(title="Generos", action="section", section='genre', - thumbnail=get_thumb('genres', auto=True))) - itemlist.append(item.clone(title="Castellano", action="list_all", url= host+'?s=Español', - thumbnail=get_thumb('audio', auto=True))) - itemlist.append(item.clone(title="Latino", action="list_all", url=host + '?s=Latino', - thumbnail=get_thumb('audio', auto=True))) - itemlist.append(item.clone(title="VOSE", action="list_all", url=host + '?s=Subtitulado', - thumbnail=get_thumb('audio', auto=True))) - itemlist.append(item.clone(title="Alfabetico", action="section", section='alpha', - thumbnail=get_thumb('alphabet', auto=True))) - itemlist.append(item.clone(title="Buscar", action="search", url=host+'?s=', - thumbnail=get_thumb('search', auto=True))) + + itemlist.append(Item(channel=item.channel, title="Ultimas", action="list_all", url=host, + thumbnail=get_thumb('last', auto=True))) + + itemlist.append(Item(channel=item.channel, title="Generos", action="section", section='genre', + thumbnail=get_thumb('genres', auto=True))) + + itemlist.append(Item(channel=item.channel, title="Castellano", action="list_all", url= host+'espanol', + thumbnail=get_thumb('audio', auto=True))) + + itemlist.append(Item(channel=item.channel, title="Latino", action="list_all", url=host + 'latino', + thumbnail=get_thumb('audio', auto=True))) + + itemlist.append(Item(channel=item.channel, title="VOSE", action="list_all", url=host + 'subtitulado', + thumbnail=get_thumb('audio', auto=True))) + + itemlist.append(Item(channel=item.channel, title="Alfabetico", action="section", section='alpha', + thumbnail=get_thumb('alphabet', auto=True))) + + itemlist.append(Item(channel=item.channel, title="Buscar", action="search", url=host+'?s=', + thumbnail=get_thumb('search', auto=True))) autoplay.show_option(item.channel, itemlist) @@ -52,7 +60,7 @@ def mainlist(item): def get_source(url): logger.info() data = httptools.downloadpage(url).data - data = re.sub(r'"|\n|\r|\t| |<br>|\s{2,}', "", data) + data = re.sub(r'\n|\r|\t| |<br>|\s{2,}', "", data) return data @@ -63,11 +71,11 @@ def list_all(item): try: data = get_source(item.url) if item.section == 'alpha': - patron = '<span class=Num>\d+.*?<a href=(.*?) class.*?' - patron += 'src=(.*?) class.*?<strong>(.*?)</strong>.*?<td>(\d{4})</td>' + patron = '<span class="Num">\d+.*?<a href="([^"]+)" class.*?' + patron += 'src="([^"]+)" class.*?<strong>([^<]+)</strong>.*?<td>(\d{4})</td>' else: - patron = '<article id=post-.*?<a href=(.*?)>.*?src=(.*?) alt=.*?' - patron += '<h2 class=Title>(.*?)<\/h2>.*?<span class=Year>(.*?)<\/span>' + patron = '<article id="post-\d+".*?<a href="([^"]+)">.*?' + patron += 'src="([^"]+)".*?<h2 class="Title">([^<]+)<\/h2>.*?<span class="Year">([^<]+)<\/span>' data = get_source(item.url) matches = re.compile(patron, re.DOTALL).findall(data) @@ -84,7 +92,7 @@ def list_all(item): title = '%s [%s]'%(contentTitle, year) thumbnail = 'http:'+scrapedthumbnail - itemlist.append(item.clone(action='findvideos', + itemlist.append(Item(channel=item.channel, action='findvideos', title=title, url=url, thumbnail=thumbnail, @@ -95,9 +103,10 @@ def list_all(item): # Paginación - url_next_page = scrapertools.find_single_match(data,'<a class=next.*?href=(.*?)>') + url_next_page = scrapertools.find_single_match(data,'<a class="next.*?" rel="next" href="([^"]+)"') if url_next_page: - itemlist.append(item.clone(title="Siguiente >>", url=url_next_page, action='list_all', section=item.section)) + itemlist.append(Item(channel=item.channel, title="Siguiente >>", url=url_next_page, action='list_all', + section=item.section)) except: pass return itemlist @@ -107,17 +116,13 @@ def section(item): itemlist = [] data = get_source(host) - action = 'list_all' - if item.section == 'quality': - patron = 'menu-item-object-category.*?menu-item-\d+><a href=(.*?)>(.*?)<\/a>' - elif item.section == 'genre': - patron = 'category menu-item-\d+><a href=(http:.*?)>(.*?)</a>' - elif item.section == 'year': - patron = 'custom menu-item-15\d+><a href=(.*?\?s.*?)>(\d{4})<\/a><\/li>' + + if item.section == 'genre': + data = scrapertools.find_single_match(data, '>Géneros</a>.*?</ul>') elif item.section == 'alpha': - patron = '<li><a href=(.*?letter.*?)>(.*?)</a>' - action = 'list_all' + data = scrapertools.find_single_match(data, '<ul class="AZList"><li>.*?</ul>') + patron = '<a href="([^"]+)">([^<]+)</a>' matches = re.compile(patron, re.DOTALL).findall(data) for data_one, data_two in matches: @@ -136,11 +141,17 @@ def findvideos(item): itemlist = [] data = get_source(item.url) - patron = 'domain=(.*?) class=.*?><span>.*?</span>.*?<span>\d+ - (.*?) - (.*?)</span>' + patron = 'TPlayerNv="Opt(\w\d+)".*?img src="(.*?)<span>\d+ - (.*?) - ([^<]+)<' matches = re.compile(patron, re.DOTALL).findall(data) - for url, language, quality in matches: + for option, url_data, language, quality in matches: + if 'domain' in url_data: + url = scrapertools.find_single_match(url_data, 'domain=([^"]+)"') + else: + url = scrapertools.find_single_match(data, 'id="Opt%s">.*?file=([^"]+)"' % option) + if url != '' and 'youtube' not in url: - itemlist.append(item.clone(title='%s', url=url, language=IDIOMAS[language], quality=quality, action='play')) + itemlist.append(Item(channel=item.channel, title='%s', url=url, language=IDIOMAS[language], + quality=quality, action='play')) itemlist = servertools.get_servers_itemlist(itemlist, lambda i: i.title % '%s [%s] [%s]'%(i.server.capitalize(), i.language, i.quality)) diff --git a/plugin.video.alfa/channels/datoporn.py b/plugin.video.alfa/channels/datoporn.py index a63ebc25..b70f37af 100755 --- a/plugin.video.alfa/channels/datoporn.py +++ b/plugin.video.alfa/channels/datoporn.py @@ -1,5 +1,7 @@ # -*- coding: utf-8 -*- +import re + from core import httptools from core import scrapertools from platformcode import logger @@ -9,8 +11,8 @@ def mainlist(item): logger.info() itemlist = [] - itemlist.append(item.clone(action="categorias", title="Categorías", url="http://dato.porn/categories_all")) - itemlist.append(item.clone(title="Buscar...", action="search")) + 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", contentType="movie", viewmode="movie")) return itemlist @@ -25,22 +27,27 @@ def lista(item): itemlist = [] # 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 - 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) for scrapedurl, scrapedthumbnail, duration, scrapedtitle in matches: 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: 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, server="datoporn", fanart=scrapedthumbnail.replace("_t.jpg", ".jpg"))) - # Extrae la marca de siguiente página - next_page = scrapertools.find_single_match(data, '<a href=["|\']([^["|\']+)["|\']>Next') + # 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 class=["|\']page-link["|\'] href=["|\']([^["|\']+)["|\']>Next') if next_page and itemlist: itemlist.append(item.clone(action="lista", title=">> Página Siguiente", url=next_page)) diff --git a/plugin.video.alfa/channels/descargasmix.json b/plugin.video.alfa/channels/descargasmix.json deleted file mode 100644 index a7635136..00000000 --- a/plugin.video.alfa/channels/descargasmix.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "id": "descargasmix", - "name": "DescargasMIX", - "language": ["cast", "lat"], - "active": false, - "adult": false, - "thumbnail": "descargasmix.png", - "banner": "descargasmix.png", - "categories": [ - "movie", - "vos", - "torrent", - "documentary", - "anime", - "tvshow" - ], - "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": 2, - "enabled": true, - "visible": true, - "lvalues": [ - "Perfil 3", - "Perfil 2", - "Perfil 1" - ] - }, - { - "id": "include_in_global_search", - "type": "bool", - "label": "Incluir en busqueda global", - "default": false, - "enabled": true, - "visible": true - }, - { - "id": "include_in_newest_torrent", - "type": "bool", - "label": "Incluir en Novedades - Torrent", - "default": true, - "enabled": true, - "visible": true - }, - { - "id": "include_in_newest_series", - "type": "bool", - "label": "Incluir en Novedades - series", - "default": true, - "enabled": true, - "visible": true - }, - { - "id": "include_in_newest_anime", - "type": "bool", - "label": "Incluir en Novedades - anime", - "default": true, - "enabled": true, - "visible": true - }, - { - "id": "include_in_newest_4k", - "type": "bool", - "label": "Incluir en Novedades - 4K", - "default": true, - "enabled": true, - "visible": true - } - ] -} diff --git a/plugin.video.alfa/channels/descargasmix.py b/plugin.video.alfa/channels/descargasmix.py deleted file mode 100644 index 828a4725..00000000 --- a/plugin.video.alfa/channels/descargasmix.py +++ /dev/null @@ -1,582 +0,0 @@ -# -*- coding: utf-8 -*- - -import re -import urllib - -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 -__modo_grafico__ = config.get_setting("modo_grafico", "descargasmix") -__perfil__ = config.get_setting("perfil", "descargasmix") - -# Fijar perfil de color -perfil = [['0xFFFFE6CC', '0xFFFFCE9C', '0xFF994D00'], - ['0xFFA5F6AF', '0xFF5FDA6D', '0xFF11811E'], - ['0xFF58D3F7', '0xFF2E9AFE', '0xFF2E64FE']] -color1, color2, color3 = perfil[__perfil__] -host = config.get_setting("host", "descargasmix") - - -def mainlist(item): - logger.info() - itemlist = [] - item.text_color = color1 - - # Resetear host y comprobacion de error en https (por si se actualiza Kodi) - config.set_setting("url_error", False, "descargasmix") - host = config.set_setting("host", "https://ddmix.net", "descargasmix") - host_check = get_data(host, True) - if host_check and host_check.startswith("http"): - config.set_setting("host", host_check, "descargasmix") - - itemlist.append(item.clone(title="Películas", action="lista", fanart="http://i.imgur.com/c3HS8kj.png", - thumbnail=get_thumb('movies', auto=True))) - itemlist.append(item.clone(title="Series", action="lista_series", fanart="http://i.imgur.com/9loVksV.png", - thumbnail=get_thumb('tvshows', auto=True))) - itemlist.append(item.clone(title="Documentales", action="entradas", url="%s/documentales/" % host, - fanart="http://i.imgur.com/Q7fsFI6.png", - thumbnail=get_thumb('documentaries', auto=True))) - itemlist.append(item.clone(title="Anime", action="entradas", url="%s/anime/" % host, - fanart="http://i.imgur.com/whhzo8f.png", - thumbnail=get_thumb('anime', auto=True))) - itemlist.append(item.clone(title="Deportes", action="entradas", url="%s/deportes/" % host, - fanart="http://i.imgur.com/ggFFR8o.png", - thumbnail=get_thumb('deporte', auto=True))) - itemlist.append(item.clone(title="Programas de tv", action="entradas", url="%s/otros/programas-de-tv/" % host, - thumbnail=get_thumb('de la tv', auto=True))) - itemlist.append(item.clone(title="", action="")) - itemlist.append(item.clone(title="Buscar...", action="search", thumbnail=get_thumb('search', auto=True))) - itemlist.append(item.clone(action="setting_channel", title="Configurar canal...", text_color="gold", folder=False)) - - return itemlist - - -def setting_channel(item): - from platformcode import platformtools - ret = platformtools.show_channel_settings() - platformtools.itemlist_refresh() - return ret - - -def search(item, texto): - logger.info() - try: - item.url = "%s/?s=%s" % (host, texto) - return busqueda(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("%s" % line) - return [] - - -def busqueda(item): - logger.info() - itemlist = [] - - data = get_data(item.url) - - contenido = ['Películas', 'Series', 'Documentales', 'Anime', 'Deportes', 'Miniseries', 'Vídeos'] - bloque = scrapertools.find_single_match(data, '<div id="content" role="main">(.*?)<div id="sidebar" ' - 'role="complementary">') - patron = '<a class="clip-link".*?href="([^"]+)".*?<img alt="([^"]+)" src="([^"]+)"' \ - '.*?<span class="overlay.*?>(.*?)<.*?<p class="stats">(.*?)</p>' - matches = scrapertools.find_multiple_matches(bloque, patron) - for scrapedurl, scrapedtitle, scrapedthumbnail, info, scrapedcat in matches: - if not [True for c in contenido if c in scrapedcat]: - continue - scrapedurl = urllib.unquote(re.sub(r'&b=4|/go\.php\?u=', '', scrapedurl)) - scrapedthumbnail = urllib.unquote(re.sub(r'&b=4|/go\.php\?u=', '', scrapedthumbnail)) - if not scrapedthumbnail.startswith("http"): - scrapedthumbnail = "http:" + scrapedthumbnail - scrapedthumbnail = scrapedthumbnail.replace("-129x180", "") - if ("Películas" in scrapedcat or "Documentales" in scrapedcat) and "Series" not in scrapedcat: - titulo = scrapedtitle.split("[")[0] - if info: - scrapedtitle += " [%s]" % unicode(info, "utf-8").capitalize().encode("utf-8") - itemlist.append(item.clone(action="findvideos", title=scrapedtitle, url=scrapedurl, contentTitle=titulo, - thumbnail=scrapedthumbnail, fulltitle=titulo, contentType="movie")) - else: - itemlist.append(item.clone(action="episodios", title=scrapedtitle, url=scrapedurl, - thumbnail=scrapedthumbnail, fulltitle=scrapedtitle, contentTitle=scrapedtitle, - show=scrapedtitle, contentType="tvshow")) - - next_page = scrapertools.find_single_match(data, '<a class="nextpostslink".*?href="([^"]+)"') - if next_page: - next_page = urllib.unquote(re.sub(r'&b=4|/go\.php\?u=', '', next_page)) - itemlist.append(item.clone(action="busqueda", title=">> Siguiente", url=next_page)) - - return itemlist - - -def lista(item): - logger.info() - itemlist = list() - - itemlist.append(item.clone(title="Novedades", action="entradas", url="%s/peliculas" % host)) - itemlist.append(item.clone(title="Estrenos", action="entradas", url="%s/peliculas/estrenos" % host)) - itemlist.append(item.clone(title="Dvdrip", action="entradas", url="%s/peliculas/dvdrip" % host)) - itemlist.append(item.clone(title="HD (720p/1080p)", action="entradas", url="%s/peliculas/hd" % host)) - itemlist.append(item.clone(title="4K", action="entradas", url="%s/peliculas/4k" % host)) - itemlist.append(item.clone(title="HDRIP", action="entradas", url="%s/peliculas/hdrip" % host)) - - itemlist.append(item.clone(title="Latino", action="entradas", - url="%s/peliculas/latino-peliculas" % host)) - itemlist.append(item.clone(title="VOSE", action="entradas", url="%s/peliculas/subtituladas" % host)) - itemlist.append(item.clone(title="3D", action="entradas", url="%s/peliculas/3d" % host)) - - return itemlist - - -def lista_series(item): - logger.info() - itemlist = list() - itemlist.append(item.clone(title="Novedades", action="entradas", url="%s/series/" % host)) - itemlist.append(item.clone(title="Miniseries", action="entradas", url="%s/series/miniseries" % host)) - return itemlist - - -def entradas(item): - logger.info() - itemlist = [] - item.text_color = color2 - - data = get_data(item.url) - bloque = scrapertools.find_single_match(data, '<div id="content" role="main">(.*?)<div id="sidebar" ' - 'role="complementary">') - contenido = ["series", "deportes", "anime", 'miniseries', 'programas'] - c_match = [True for match in contenido if match in item.url] - # Patron dependiendo del contenido - if True in c_match: - patron = '<a class="clip-link".*?href="([^"]+)".*?<img alt="([^"]+)" src="([^"]+)"' \ - '.*?<span class="overlay(|[^"]+)">' - matches = scrapertools.find_multiple_matches(bloque, patron) - for scrapedurl, scrapedtitle, scrapedthumbnail, scrapedinfo in matches: - scrapedurl = urllib.unquote(re.sub(r'&b=4|/go\.php\?u=', '', scrapedurl)) - if scrapedinfo != "": - scrapedinfo = scrapedinfo.replace(" ", "").replace("-", " ") - - scrapedinfo = " [%s]" % unicode(scrapedinfo, "utf-8").capitalize().encode("utf-8") - titulo = scrapedtitle + scrapedinfo - titulo = scrapertools.decodeHtmlentities(titulo) - scrapedtitle = scrapertools.decodeHtmlentities(scrapedtitle) - - scrapedthumbnail = urllib.unquote(re.sub(r'&b=4|/go\.php\?u=', '', scrapedthumbnail)) - if not scrapedthumbnail.startswith("http"): - scrapedthumbnail = "http:" + scrapedthumbnail - scrapedthumbnail = scrapedthumbnail.replace("-129x180", "") - scrapedthumbnail = scrapedthumbnail.rsplit("/", 1)[0] + "/" + \ - urllib.quote(scrapedthumbnail.rsplit("/", 1)[1]) - if "series" in item.url or "anime" in item.url: - item.show = scrapedtitle - itemlist.append(item.clone(action="episodios", title=titulo, url=scrapedurl, thumbnail=scrapedthumbnail, - fulltitle=scrapedtitle, contentTitle=scrapedtitle, contentType="tvshow")) - else: - patron = '<a class="clip-link".*?href="([^"]+)".*?<img alt="([^"]+)" src="([^"]+)"' \ - '.*?<span class="overlay.*?>(.*?)<.*?<p class="stats">(.*?)</p>' - matches = scrapertools.find_multiple_matches(bloque, patron) - for scrapedurl, scrapedtitle, scrapedthumbnail, info, categoria in matches: - scrapedurl = urllib.unquote(re.sub(r'&b=4|/go\.php\?u=', '', scrapedurl)) - titulo = scrapertools.decodeHtmlentities(scrapedtitle) - scrapedtitle = scrapertools.decodeHtmlentities(scrapedtitle.split("[")[0]) - action = "findvideos" - show = "" - if "Series" in categoria: - action = "episodios" - show = scrapedtitle - elif categoria and categoria != "Películas" and categoria != "Documentales": - try: - titulo += " [%s]" % categoria.rsplit(", ", 1)[1] - except: - titulo += " [%s]" % categoria - if 'l-espmini' in info: - titulo += " [ESP]" - if 'l-latmini' in info: - titulo += " [LAT]" - if 'l-vosemini' in info: - titulo += " [VOSE]" - - if info: - titulo += " [%s]" % unicode(info, "utf-8").capitalize().encode("utf-8") - year = scrapertools.find_single_match(titulo,'\[\d{4}\]') - scrapedthumbnail = urllib.unquote(re.sub(r'&b=4|/go\.php\?u=', '', scrapedthumbnail)) - if not scrapedthumbnail.startswith("http"): - scrapedthumbnail = "http:" + scrapedthumbnail - scrapedthumbnail = scrapedthumbnail.replace("-129x180", "") - scrapedthumbnail = scrapedthumbnail.rsplit("/", 1)[0] + "/" + \ - urllib.quote(scrapedthumbnail.rsplit("/", 1)[1]) - - itemlist.append(item.clone(action=action, title=titulo, url=scrapedurl, thumbnail=scrapedthumbnail, - fulltitle=scrapedtitle, contentTitle=scrapedtitle, viewmode="movie_with_plot", - show=show, contentType="movie", infoLabels={'year':year})) - tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) - # Paginación - next_page = scrapertools.find_single_match(data, '<a class="nextpostslink".*?href="([^"]+)"') - if next_page: - next_page = urllib.unquote(re.sub(r'&b=4|/go\.php\?u=', '', next_page)) - itemlist.append(item.clone(title=">> Siguiente", url=next_page, text_color=color3)) - - return itemlist - - -def episodios(item): - logger.info() - itemlist = [] - - data = get_data(item.url) - patron = '(<ul class="menu ses" id="seasons-list">.*?<div class="section-box related-posts">)' - bloque = scrapertools.find_single_match(data, patron) - matches = scrapertools.find_multiple_matches(bloque, '<div class="polo".*?>(.*?)</div>') - for scrapedtitle in matches: - scrapedtitle = scrapedtitle.strip() - new_item = item.clone() - new_item.infoLabels['season'] = scrapedtitle.split(" ", 1)[0].split("x")[0] - new_item.infoLabels['episode'] = scrapedtitle.split(" ", 1)[0].split("x")[1] - if item.fulltitle != "Añadir esta serie a la videoteca": - title = item.fulltitle + " " + scrapedtitle.strip() - else: - title = scrapedtitle.strip() - itemlist.append(new_item.clone(action="findvideos", title=title, extra=scrapedtitle, fulltitle=title, - contentType="episode")) - - itemlist.sort(key=lambda it: it.title, reverse=True) - item.plot = scrapertools.find_single_match(data, '<strong>SINOPSIS</strong>:(.*?)</p>') - if item.show != "" and item.extra == "": - itemlist.append(item.clone(channel="trailertools", title="Buscar Tráiler", action="buscartrailer", context="", - text_color="magenta")) - if config.get_videolibrary_support(): - itemlist.append(Item(channel=item.channel, title="Añadir esta serie a la videoteca", url=item.url, - action="add_serie_to_library", extra="episodios", show=item.show, - text_color="green")) - - try: - from core import tmdb - tmdb.set_infoLabels_itemlist(itemlist[:-2], __modo_grafico__) - except: - pass - - return itemlist - - -def episode_links(item): - logger.info() - itemlist = [] - item.text_color = color3 - - data = get_data(item.url) - data = data.replace("\n", "").replace("\t", "") - - # Bloque de enlaces - patron = '<div class="polo".*?>%s(.*?)(?:<div class="polo"|</li>)' % item.extra.strip() - bloque = scrapertools.find_single_match(data, patron) - - patron = '<div class="episode-server">.*?data-sourcelk="([^"]+)"' \ - '.*?data-server="([^"]+)"' \ - '.*?<div class="caliycola">(.*?)</div>' - matches = scrapertools.find_multiple_matches(bloque, patron) - - itemlist.append(item.clone(action="", title="Enlaces Online/Descarga", text_color=color1)) - lista_enlaces = [] - for scrapedurl, scrapedserver, scrapedcalidad in matches: - if scrapedserver == "ul": - scrapedserver = "uploadedto" - if scrapedserver == "streamin": - scrapedserver = "streaminto" - titulo = " %s [%s]" % (unicode(scrapedserver, "utf-8").capitalize().encode("utf-8"), scrapedcalidad) - # Enlaces descarga - if scrapedserver == "magnet": - itemlist.insert(0, - item.clone(action="play", title=titulo, server="torrent", url=scrapedurl, extra=item.url)) - else: - if servertools.is_server_enabled(scrapedserver): - try: - # servers_module = __import__("servers." + scrapedserver) - lista_enlaces.append(item.clone(action="play", title=titulo, server=scrapedserver, url=scrapedurl, - extra=item.url)) - except: - pass - lista_enlaces.reverse() - itemlist.extend(lista_enlaces) - - if itemlist[0].server == "torrent": - itemlist.insert(0, item.clone(action="", title="Enlaces Torrent", text_color=color1)) - - return itemlist - - -def findvideos(item): - logger.info() - if item.contentSeason != '': - return episode_links(item) - - itemlist = [] - item.text_color = color3 - - data = get_data(item.url) - - item.plot = scrapertools.find_single_match(data, 'SINOPSIS(?:</span>|</strong>):(.*?)</p>') - year = scrapertools.find_single_match(data, '(?:<span class="bold">|<strong>)AÑO(?:</span>|</strong>):\s*(\d+)') - if year: - try: - from core import tmdb - item.infoLabels['year'] = year - tmdb.set_infoLabels_item(item, __modo_grafico__) - except: - pass - - old_format = False - # Patron torrent antiguo formato - if "Enlaces de descarga</div>" in data: - old_format = True - matches = scrapertools.find_multiple_matches(data, 'class="separate3 magnet".*?href="([^"]+)"') - for scrapedurl in matches: - scrapedurl = scrapertools.find_single_match(scrapedurl, '(magnet.*)') - scrapedurl = urllib.unquote(re.sub(r'&b=4', '', scrapedurl)) - title = "[Torrent] " - title += urllib.unquote(scrapertools.find_single_match(scrapedurl, 'dn=(.*?)(?i)WWW.DescargasMix')) - itemlist.append(item.clone(action="play", server="torrent", title=title, url=scrapedurl, - text_color="green")) - - # Patron online - data_online = scrapertools.find_single_match(data, 'Ver online</div>(.*?)<div class="section-box related-posts">') - if data_online: - title = "Enlaces Online" - if '"l-latino2"' in data_online: - title += " [LAT]" - elif '"l-esp2"' in data_online: - title += " [ESP]" - elif '"l-vose2"' in data_online: - title += " [VOSE]" - - patron = 'make_links.*?,[\'"]([^"\']+)["\']' - matches = scrapertools.find_multiple_matches(data_online, patron) - for i, code in enumerate(matches): - enlace = show_links(code) - links = servertools.findvideos(data=enlace[0]) - if links and "peliculas.nu" not in links: - if i == 0: - extra_info = scrapertools.find_single_match(data_online, '<span class="tooltiptext">(.*?)</span>') - size = scrapertools.find_single_match(data_online, '(?i)TAMAÑO:\s*(.*?)<').strip() - - if size: - title += " [%s]" % size - new_item = item.clone(title=title, action="", text_color=color1) - if extra_info: - extra_info = scrapertools.htmlclean(extra_info) - new_item.infoLabels["plot"] = extra_info - new_item.title += " +INFO" - itemlist.append(new_item) - - title = " Ver vídeo en " + links[0][2] - itemlist.append(item.clone(action="play", server=links[0][2], title=title, url=links[0][1])) - scriptg = scrapertools.find_single_match(data, "<script type='text/javascript'>str='([^']+)'") - if scriptg: - gvideo = urllib.unquote_plus(scriptg.replace("@", "%")) - url = scrapertools.find_single_match(gvideo, 'src="([^"]+)"') - if url: - itemlist.append(item.clone(action="play", server="directo", url=url, extra=item.url, - title=" Ver vídeo en Googlevideo (Máxima calidad)")) - - # Patron descarga - patron = '<div class="(?:floatLeft |)double(?:nuevo|)">(.*?)</div>(.*?)' \ - '(?:<div(?: id="mirrors"|) class="(?:contentModuleSmall |)mirrors">|<div class="section-box related-' \ - 'posts">)' - bloques_descarga = scrapertools.find_multiple_matches(data, patron) - for title_bloque, bloque in bloques_descarga: - if title_bloque == "Ver online": - continue - if '"l-latino2"' in bloque: - title_bloque += " [LAT]" - elif '"l-esp2"' in bloque: - title_bloque += " [ESP]" - elif '"l-vose2"' in bloque: - title_bloque += " [VOSE]" - - extra_info = scrapertools.find_single_match(bloque, '<span class="tooltiptext">(.*?)</span>') - size = scrapertools.find_single_match(bloque, '(?i)TAMAÑO:\s*(.*?)<').strip() - - if size: - title_bloque += " [%s]" % size - new_item = item.clone(title=title_bloque, action="", text_color=color1) - if extra_info: - extra_info = scrapertools.htmlclean(extra_info) - new_item.infoLabels["plot"] = extra_info - new_item.title += " +INFO" - itemlist.append(new_item) - - if '<div class="subiendo">' in bloque: - itemlist.append(item.clone(title=" Los enlaces se están subiendo", action="")) - continue - patron = 'class="separate.*? ([^"]+)".*?(?:make_links.*?,|href=)[\'"]([^"\']+)["\']' - matches = scrapertools.find_multiple_matches(bloque, patron) - for scrapedserver, scrapedurl in matches: - if (scrapedserver == "ul") | (scrapedserver == "uploaded"): - scrapedserver = "uploadedto" - titulo = unicode(scrapedserver, "utf-8").capitalize().encode("utf-8") - if titulo == "Magnet" and old_format: - continue - elif titulo == "Magnet" and not old_format: - title = " Enlace Torrent" - scrapedurl = scrapertools.find_single_match(scrapedurl, '(magnet.*)') - scrapedurl = urllib.unquote(re.sub(r'&b=4', '', scrapedurl)) - itemlist.append(item.clone(action="play", server="torrent", title=title, url=scrapedurl, - text_color="green")) - continue - if servertools.is_server_enabled(scrapedserver): - try: - # servers_module = __import__("servers." + scrapedserver) - # Saca numero de enlaces - urls = show_links(scrapedurl) - numero = str(len(urls)) - titulo = " %s - Nº enlaces: %s" % (titulo, numero) - itemlist.append(item.clone(action="enlaces", title=titulo, extra=scrapedurl, server=scrapedserver)) - except: - pass - - itemlist.append(item.clone(channel="trailertools", title="Buscar Tráiler", action="buscartrailer", context="", - text_color="magenta")) - if item.extra != "findvideos" and config.get_videolibrary_support(): - itemlist.append(Item(channel=item.channel, title="Añadir a la videoteca", action="add_pelicula_to_library", - extra="findvideos", url=item.url, infoLabels={'title': item.fulltitle}, - fulltitle=item.fulltitle, text_color="green")) - - return itemlist - - -def play(item): - logger.info() - itemlist = [] - - if not item.url.startswith("http") and not item.url.startswith("magnet"): - post = "source=%s&action=obtenerurl" % urllib.quote(item.url) - headers = {'X-Requested-With': 'XMLHttpRequest'} - data = httptools.downloadpage("%s/wp-admin/admin-ajax.php" % host.replace("https", "http"), post=post, - headers=headers, follow_redirects=False).data - - url = scrapertools.find_single_match(data, 'url":"([^"]+)"').replace("\\", "") - - if "enlacesmix" in url or "enlacesws.com" in url: - data = httptools.downloadpage(url, headers={'Referer': item.extra}, follow_redirects=False).data - url = scrapertools.find_single_match(data, '<iframe.*?src="([^"]+)"') - links = servertools.findvideosbyserver(url, item.server) - if links: - itemlist.append(item.clone(action="play", server=links[0][2], url=links[0][1])) - else: - itemlist.append(item.clone()) - - return itemlist - - -def enlaces(item): - logger.info() - itemlist = [] - - urls = show_links(item.extra) - numero = len(urls) - for url in urls: - links = servertools.findvideos(data=url) - if links: - for link in links: - if "/folder/" in url: - titulo = link[0] - else: - titulo = "%s - Enlace %s" % (item.title.split("-")[0], str(numero)) - numero -= 1 - itemlist.append(item.clone(action="play", server=link[2], title=titulo, url=link[1])) - - itemlist.sort(key=lambda it: it.title) - return itemlist - - -def show_links(data): - import base64 - data = data.split(",") - len_data = len(data) - urls = [] - for i in range(0, len_data): - url = [] - value1 = base64.b64decode(data[i]) - value2 = value1.split("-") - for j in range(0, len(value2)): - url.append(chr(int(value2[j]))) - - urls.append("".join(url)) - - return urls - - -def get_data(url_orig, get_host=False): - try: - if config.get_setting("url_error", "descargasmix"): - raise Exception - response = httptools.downloadpage(url_orig) - if not response.data or "urlopen error [Errno 1]" in str(response.code): - raise Exception - if get_host: - if response.url.endswith("/"): - response.url = response.url[:-1] - return response.url - except: - config.set_setting("url_error", True, "descargasmix") - import random - server_random = ['nl', 'de', 'us'] - server = server_random[random.randint(0, 2)] - url = "https://%s.hideproxy.me/includes/process.php?action=update" % server - post = "u=%s&proxy_formdata_server=%s&allowCookies=1&encodeURL=0&encodePage=0&stripObjects=0&stripJS=0&go=" \ - % (url_orig, server) - while True: - response = httptools.downloadpage(url, post, follow_redirects=False) - if response.headers.get("location"): - url = response.headers["location"] - post = "" - else: - if get_host: - target = urllib.unquote(scrapertools.find_single_match(url, 'u=([^&]+)&')) - if target.endswith("/"): - target = target[:-1] - if target and target != host: - return target - else: - return "" - break - - return response.data - - -def newest(categoria): - logger.info() - itemlist = [] - item = Item() - try: - if categoria == 'torrent': - item.url = host+'/peliculas' - itemlist = entradas(item) - - if categoria == 'series': - item.url = host + '/series' - itemlist.extend(entradas(item)) - - if categoria == '4k': - item.url = host + '/peliculas/4k' - itemlist.extend(entradas(item)) - - if categoria == 'anime': - item.url = host + '/anime' - itemlist.extend(entradas(item)) - - if itemlist[-1].title == ">> Siguiente": - itemlist.pop() - - # Se captura la excepción, para no interrumpir al canal novedades si un canal falla - except: - import sys - for line in sys.exc_info(): - logger.error("%s" % line) - return [] - - return itemlist diff --git a/plugin.video.alfa/channels/elitetorrent.py b/plugin.video.alfa/channels/elitetorrent.py index c4b74f07..0faf759c 100644 --- a/plugin.video.alfa/channels/elitetorrent.py +++ b/plugin.video.alfa/channels/elitetorrent.py @@ -377,6 +377,7 @@ def newest(categoria): if categoria == 'torrent': item.url = host item.extra = "peliculas" + item.category_new= 'newest' itemlist = listado(item) if itemlist[-1].title == "Página siguiente >>": diff --git a/plugin.video.alfa/channels/estrenosgo.json b/plugin.video.alfa/channels/estrenosgo.json index de9ace77..5e335051 100755 --- a/plugin.video.alfa/channels/estrenosgo.json +++ b/plugin.video.alfa/channels/estrenosgo.json @@ -3,13 +3,69 @@ "name": "EstrenosGo", "active": true, "adult": false, - "language": ["cast"], - "fanart": "https://github.com/master-1970/resources/raw/master/images/fanart/estrenosgo.png", - "thumbnail": "https://github.com/master-1970/resources/raw/master/images/squares/estrenosgo.png", + "language": ["cast", "LAT", "VOSE", "VOS"], + "fanart": "estrenosgo.png", + "thumbnail": "estrenosgo.png", "banner": "estrenosgo.png", "categories": [ "movie", "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 + } ] } \ No newline at end of file diff --git a/plugin.video.alfa/channels/estrenosgo.py b/plugin.video.alfa/channels/estrenosgo.py index f5f52bd0..5fc11c5f 100644 --- a/plugin.video.alfa/channels/estrenosgo.py +++ b/plugin.video.alfa/channels/estrenosgo.py @@ -1,205 +1,1161 @@ # -*- coding: utf-8 -*- import re +import sys +import urllib +import urlparse +import time + from channelselector import get_thumb -from core import channeltools 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 core import tmdb +from lib import generictools -HOST = 'http://estrenosby.net/' # 'http://estrenosli.org/' -parameters = channeltools.get_channel_parameters('estrenosgo') -fanart_host = parameters['fanart'] -thumbnail_host = parameters['thumbnail'] +host = 'http://estrenosby.net/' # 'http://estrenosli.org/' color1, color2, color3 = ['0xFF58D3F7', '0xFF2E64FE', '0xFF0404B4'] +__modo_grafico__ = config.get_setting('modo_grafico', 'estrenosgo') +modo_ultima_temp = config.get_setting('seleccionar_ult_temporadda_activa', 'estrenosgo') #Actualización sólo últ. Temporada? +timeout = config.get_setting('timeout_downloadpage', 'estrenosgo') def mainlist(item): logger.info() itemlist = [] - item.url = HOST - item.text_color = color2 - item.fanart = fanart_host + item.url = host + + thumb_cartelera = get_thumb("now_playing.png") + thumb_pelis = get_thumb("channels_movie.png") + thumb_pelis_hd = get_thumb("channels_movie_hd.png") + thumb_pelis_VO = get_thumb("channels_vos.png") + thumb_series = get_thumb("channels_tvshow.png") + thumb_series_hd = get_thumb("channels_tvshow_hd.png") + thumb_series_VOD = get_thumb("videolibrary_tvshow.png") + thumb_buscar = get_thumb("search.png") + thumb_separador = get_thumb("next.png") + thumb_cabecera = get_thumb("nofolder.png") - item.thumbnail = "https://github.com/master-1970/resources/raw/master/images/genres/0/Directors%20Chair.png" - itemlist.append(item.clone(title="Películas:", folder=False, text_color=color3, text_bold=True)) - itemlist.append(item.clone(title=" Cartelera", action="listado", url=HOST + "descarga-0-58126-0-0-fx-1-1-.fx")) - itemlist.append(item.clone(title=" DVD-RIP", action="listado", url=HOST + "descarga-0-581210-0-0-fx-1-1.fx")) - itemlist.append(item.clone(title=" HD-RIP", action="listado", url=HOST + "descarga-0-58128-0-0-fx-1-1-.fx")) + itemlist.append(Item(channel=item.channel, url=host, title="PELÍCULAS: ", folder=False, thumbnail=thumb_pelis)) + itemlist.append(Item(channel=item.channel, title=" - Cartelera", action="categorias", url=item.url + "descarga-0-58126", thumbnail=thumb_cartelera, extra="cartelera")) + itemlist.append(Item(channel=item.channel, title=" - DVD-RIP", action="categorias", url=item.url + "descarga-0-581210", thumbnail=thumb_pelis, extra="DVD-RIP")) + itemlist.append(Item(channel=item.channel, title=" - HD-RIP", action="categorias", url=item.url + "descarga-0-58128", thumbnail=thumb_pelis_hd, extra="HD-RIP")) + itemlist.append(Item(channel=item.channel, title=" - Subtituladas", action="categorias", url=item.url + "descarga-0-58127", thumbnail=thumb_pelis_VO, extra="VOSE")) + itemlist.append(Item(channel=item.channel, title=" - Versión Original", action="categorias", url=item.url + "descarga-0-5812255", thumbnail=thumb_pelis_VO, extra="VO")) + + itemlist.append(Item(channel=item.channel, url=host, title="", folder=False, thumbnail=thumb_separador)) + + itemlist.append(Item(channel=item.channel, url=host, title="Series", action="submenu", thumbnail=thumb_series, extra="series")) - itemlist.append(item.clone(title="", folder=False, thumbnail=thumbnail_host)) - - item.thumbnail = "https://github.com/master-1970/resources/raw/master/images/genres/0/TV%20Series.png" - itemlist.append(item.clone(title="Series:", folder=False, text_color=color3, text_bold=True)) - itemlist.append(item.clone(title=" Nuevos episodios", action="listado", - url=HOST + "descarga-0-58122-0-0-fx-1-1.fx")) + itemlist.append(Item(channel=item.channel, url=host, title="", folder=False, thumbnail=thumb_separador)) + + itemlist.append(Item(channel=item.channel, title="Buscar...", action="search", url=host + "descarga-0-0-0-0-fx-1-%s-sch-titulo-", thumbnail=thumb_buscar, extra="search")) return itemlist + +def submenu(item): + logger.info() + itemlist = [] + + thumb_cartelera = get_thumb("now_playing.png") + thumb_pelis = get_thumb("channels_movie.png") + thumb_pelis_hd = get_thumb("channels_movie_hd.png") + thumb_pelis_VO = get_thumb("channels_vos.png") + thumb_series = get_thumb("channels_tvshow.png") + thumb_series_hd = get_thumb("channels_tvshow_hd.png") + thumb_series_VOD = get_thumb("videolibrary_tvshow.png") + thumb_buscar = get_thumb("search.png") + thumb_separador = get_thumb("next.png") + thumb_cabecera = get_thumb("nofolder.png") + if item.extra == "series": + + itemlist.append(item.clone(title="Series completas:", action="listado", url=item.url + "descarga-0-58122-0-0-fx-1-1-.fx", thumbnail=thumb_series_VOD, extra="series")) + itemlist.append(item.clone(title="Nuevos episodios", action="listado", url=item.url + "descarga-0-58122-0-0-fx-1-1-.fx", thumbnail=thumb_series, extra="episodios")) + itemlist.append(item.clone(title=" - Año", action="search", url=item.url + "descarga-0-58122-0-%s-fx-1-1-.fx", thumbnail=thumb_series, extra="episodios")) + itemlist.append(item.clone(title=" - Alfabético A-Z", action="alfabeto", url=item.url + "descarga-0-58122-0-0-%s-1-1-.fx", thumbnail=thumb_series, extra="episodios")) + + return itemlist + + +def categorias(item): + logger.info() + + itemlist = [] + + if item.extra3: + extra3 = item.extra3 + del item.extra3 + else: + extra3 = False + + data = '' + try: + data = re.sub(r"\n|\r|\t|\s{2}|(<!--.*?-->)", "", httptools.downloadpage(item.url + '-0-0-fx-1-1-.fx', timeout=timeout).data) + except: + pass + + patron = '<div class="subitem"><a href="([^"]+)" class="[^"]+">(.*?)<\/a><\/div>' + #Verificamos si se ha cargado una página, y si además tiene la estructura correcta + if not data or not scrapertools.find_single_match(data, patron): + item = generictools.web_intervenida(item, data) #Verificamos que no haya sido clausurada + if item.intervencion: #Sí ha sido clausurada judicialmente + for clone_inter, autoridad in item.intervencion: + thumb_intervenido = get_thumb(autoridad) + itemlist.append(item.clone(action='', title="[COLOR yellow]" + clone_inter.capitalize() + ': [/COLOR]' + intervenido_judicial + '. Reportar el problema en el foro', thumbnail=thumb_intervenido)) + return itemlist #Salimos + + logger.error("ERROR 01: SUBMENU: La Web no responde o ha cambiado de URL: " + item.url + data) + #Si no hay datos consistentes, llamamos al método de fail_over para que encuentre un canal que esté activo y pueda gestionar el submenú + + if not data: #Si no ha logrado encontrar nada, salimos + itemlist.append(item.clone(action='', title=item.category + ': ERROR 01: SUBMENU: La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + + data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8") + matches = re.compile(patron, re.DOTALL).findall(data) + + if not matches: + logger.error("ERROR 02: SUBMENU: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) + itemlist.append(item.clone(action='', title=item.category + ': ERROR 02: SUBMENU: Ha cambiado la estructura de la Web. Reportar el error con el log')) + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + + #logger.debug(matches) + + #Insertamos las cabeceras para todas las peliculas de la Aalidad, por Año, Alfabético, por Género, y Otras Calidades + if not extra3: + itemlist.append(item.clone(title=item.extra.upper(), action="listado", url=item.url + '-0-0-fx-1-1-.fx')) + itemlist.append(item.clone(title="Año", action="search", url=item.url + '-0-%s-fx-1-1-.fx')) + itemlist.append(item.clone(title="Alfabético A-Z", action="alfabeto", url=item.url + '-0-0-%s-1-1-.fx')) + itemlist.append(item.clone(title="Géneros", url=item.url + '-0-0-fx-1-1-.fx')) + + for scrapedurl, scrapedtitle in matches: + title = scrapedtitle.strip() + + #Preguntamos por las entradas que corresponden al "extra" + if extra3 == 'now': + if scrapedtitle.lower() in ['ac3 51', 'bluray rip', 'series', 'serie', 'subtitulada', 'vose', 'bdrip', 'dvdscreener', 'brscreener r6', 'brscreener', 'webscreener', 'dvd', 'hdrip', 'screener', 'screeer', 'webrip', 'brrip', 'dvb', 'dvdrip', 'dvdsc', 'dvdsc - r6', 'hdts', 'hdtv', 'kvcd', 'line', 'ppv', 'telesync', 'ts hq', 'ts hq proper', '480p', '720p', 'ac3', 'bluray', 'camrip', 'ddc', 'hdtv - screener', 'tc screener', 'ts screener', 'ts screener alto', 'ts screener medio', 'vhs screener']: + itemlist.append(item.clone(action="listado", title=title, url=scrapedurl, extra2="categorias")) + + elif scrapedtitle.lower() in ['ac3 51', 'bluray rip', 'series', 'serie', 'subtitulada', 'vose', 'bdrip', 'dvdscreener', 'brscreener r6', 'brscreener', 'webscreener', 'dvd', 'hdrip', 'screener', 'screeer', 'webrip', 'brrip', 'dvb', 'dvdrip', 'dvdsc', 'dvdsc - r6', 'hdts', 'hdtv', 'kvcd', 'line', 'ppv', 'telesync', 'ts hq', 'ts hq proper', '480p', '720p', 'ac3', 'bluray', 'camrip', 'ddc', 'hdtv - screener', 'tc screener', 'ts screener', 'ts screener alto', 'ts screener medio', 'vhs screener']: + extra3 = 'next' + + else: + itemlist.append(item.clone(action="listado", title=" " + title.title(), url=scrapedurl, extra2="categorias")) + + if extra3 == 'next': + itemlist.append(item.clone(action="categorias", title="Otras Calidades", url=item.url + '-0-0-fx-1-1-.fx', extra2="categorias", extra3='now')) + + return itemlist + + +def alfabeto(item): + logger.info() + itemlist = [] + + itemlist.append(item.clone(action="listado", title="0-9", url=item.url % "_")) + + for letra in ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']: + itemlist.append(item.clone(action="listado", title=letra, url=item.url % letra)) + + return itemlist + + def listado(item): logger.info() itemlist = [] - data = httptools.downloadpage(item.url).data - data = re.sub(r"\n|\r|\t|\s{2}| ", "", data) + #logger.debug(item) + + curr_page = 1 # Página inicial + last_page = 99999 # Última página inicial + if item.curr_page: + curr_page = int(item.curr_page) # Si viene de una pasada anterior, lo usamos + del item.curr_page # ... y lo borramos + if item.last_page: + last_page = int(item.last_page) # Si viene de una pasada anterior, lo usamos + del item.last_page # ... y lo borramos + item.url = item.url.replace('-1-.fx', '-%s-.fx') + + cnt_tot = 40 # Poner el num. máximo de items por página + cnt_title = 0 # Contador de líneas insertadas en Itemlist + inicio = time.time() # Controlaremos que el proceso no exceda de un tiempo razonable + fin = inicio + 10 # Después de este tiempo pintamos (segundos) + timeout_search = timeout # Timeout para descargas + if item.extra == 'search': + timeout_search = timeout * 2 # Timeout un poco más largo para las búsquedas + if timeout_search < 5: + timeout_search = 5 # Timeout un poco más largo para las búsquedas - patron = '<div class="MiniFicha">.*?' - patron += '<img src="([^"]+).*?' - patron += '<div class="MiniF_TitleSpecial">[^>]+>([^<]+).*?' - patron += '<b>Categoria:\s*</b>([^&]+)»\s*([^<]+).*?' - patron += '<div class="OpcionesDescargasMini">(.*?)</div>' + #Sistema de paginado para evitar páginas vacías o semi-vacías en casos de búsquedas con series con muchos episodios + title_lista = [] # Guarda la lista de series que ya están en Itemlist, para no duplicar lineas + if item.title_lista: # Si viene de una pasada anterior, la lista ya estará guardada + title_lista.extend(item.title_lista) # Se usa la lista de páginas anteriores en Item + del item.title_lista # ... limpiamos + + if not item.extra2: # Si viene de Catálogo o de Alfabeto + item.extra2 = '' + + #Máximo num. de líneas permitidas por TMDB. Máx de 10 segundos por Itemlist para no degradar el rendimiento + while cnt_title <= cnt_tot * 0.45 and curr_page <= last_page and fin > time.time(): + + # Descarga la página + data = '' + url = item.url % curr_page #Inserto en num de página en la url + try: + data = re.sub(r"\n|\r|\t|\s{2}|(<!--.*?-->)| ", "", httptools.downloadpage(url, timeout=timeout_search).data) + data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8") + except: + pass + + curr_page += 1 #Apunto ya a la página siguiente + if not data: #Si la web está caída salimos sin dar error + logger.error("ERROR 01: LISTADO: La Web no responde o ha cambiado de URL: " + url + " / DATA: " + data) + itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: LISTADO:. La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos - matches = scrapertools.find_multiple_matches(data, patron) - for thumbnail, title, cat_padres, cat_hijos, opciones in matches: - # logger.debug(thumbnail + "\n" + title + "\n" + cat_padres + "\n" + cat_hijos + "\n" + opciones) - # Obtenemos el año del titulo y eliminamos lo q sobre - patron = '\d{4}$' - year = scrapertools.find_single_match(title, patron) - if year: - title = re.sub(patron, "", title) - patron = '\s?-?\s?(line)?\s?-\s?$' - regex = re.compile(patron, re.I) - title = regex.sub("", title) + #Patrón para todo menos para Series completas + patron = '<div class="MiniFicha"><a href="([^"]+)" title="([^"]+)">' + patron += '<img src="([^"]+).*?' + patron += '<div class="MiniF_TitleSpecial">[^>]+>([^<]+).*?' + patron += '<b>Categoria:\s*<\/b>([^&]+)»\s*([^<]+).*?' + patron += '<div class="OpcionesDescargasMini">(.*?)<\/div>' + + #Si son series completas, ponemos un patrón especializado, de categorías, y luego llamamos a un método especializado + if item.extra == 'series': + patron = '<div class="subitem"><a href="([^"]+)" class="[^"]+">(.*?)<\/a><\/div>' + + matches = re.compile(patron, re.DOTALL).findall(data) + if not matches and not 'En Total 0 Paginas y un total de 0 de Fichas' in data: #error + item = generictools.web_intervenida(item, data) #Verificamos que no haya sido clausurada + if item.intervencion: #Sí ha sido clausurada judicialmente + item, itemlist = generictools.post_tmdb_episodios(item, itemlist) #Llamamos al método para el pintado del error + return itemlist #Salimos + + logger.error("ERROR 02: LISTADO: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) + itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: LISTADO: Ha cambiado la estructura de la Web. Reportar el error con el log')) + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + + #logger.debug("PATRON: " + patron) + #logger.debug(matches) + #logger.debug(data) + + #Buscamos la última página, pero solo en la primera pasada, porque en búsquedan deja de funcionar a partir de la seguna página + if last_page == 99999: #Si es el valor inicial, buscamos + patron = '<div class="sPages">.*?' + patron += '<a href="[^"]+">Siguiente' + patron += ' »<\/a><br> En Total (\d+) Pagina?' #Esta es la parte que vale + try: + last_page = int(scrapertools.find_single_match(data, patron)) #lo cargamos como entero + except: + last_page = 1 #Si no lo encuentra, lo ponemos a 1 - # Obtenemos la imagen b por q es mayor - thumbnail = HOST + thumbnail[:-5] + 'b' + thumbnail[-4:] - - # Buscamos opcion de ver online - patron = '<a href="http://estrenos.*?/ver-online-([^"]+)' - url_ver = scrapertools.find_single_match(opciones, patron) - if url_ver: - new_item = Item(channel=item.channel, action="findvideos", title=title, - thumbnail=thumbnail, url=url_ver, - infoLabels={"year": year}, text_color=color1) - - cat_padres = cat_padres.strip() - if cat_padres in ["peliculas-dvdrip", "HDRIP", "cartelera"]: - # if item.extra == 'movie': - new_item.contentTitle = title - new_item.extra = "movie" - # Filtramos nombres validos para la calidad - patron = ("rip|dvd|screener|hd|ts|Telesync") - if re.search(patron, cat_hijos, flags=re.IGNORECASE): - new_item.contentQuality = cat_hijos - new_item.title = "%s [%s]" % (title, cat_hijos) - elif cat_padres == "peliculas-dvdrip": - new_item.contentQuality = "DVDRIP" - new_item.title = "%s [DVDRIP]" % title - elif cat_padres == "HDRIP": - new_item.contentQuality = "HDRIP" - new_item.title = "%s [HDRIP]" % title - - elif cat_padres == "series": - new_item.contentSerieName = cat_hijos - patron = re.compile('(\d+)x(\d+)') - matches = patron.findall(title) - if len(matches) == 1: - new_item.contentSeason = matches[0][0] - new_item.contentEpisodeNumber = matches[0][1].zfill(2) - new_item.extra = "episodie" - else: - # matches == [('1', '01'), ('1', '02'), ('1', '03')] - new_item.extra = "multi-episodie" - - else: # Otras categorias q de momento no nos interesan + if item.extra == 'series': #Si son series completas, vamos a un listado especializado + item.matches = matches #salvamos todas las matches, no hay paginación + return listado_series(item) #llamamos a un método especializado + + #Empezamos el procesado de matches + for scrapedurl, scrapedenlace, scrapedthumbnail, scrapedtitle, cat_ppal, cat_sec, opciones in matches: + if "musica" in cat_ppal or "juegos" in cat_ppal or "juegos" in cat_ppal or "software" in cat_ppal: continue - ''' Opcionalmente podriamos obtener los enlaces torrent y descargas directas - patron = '<a href="http://estrenosli.org/descarga-directa-([^"]+)' - new_item.url_descarga = scrapertools.find_single_match(opciones,patron) - patron = '<a href="http://estrenosli.org/descargar-torrent-([^"]+).*?' - new_item.url_torrent = scrapertools.find_single_match(opciones,patron)''' + url = scrapedurl + title = scrapedtitle + title = title.replace("á", "a").replace("é", "e").replace("í", "i").replace("ó", "o").replace("ú", "u").replace("ü", "u").replace("�", "ñ").replace("ñ", "ñ").replace("ã", "a").replace("&etilde;", "e").replace("ĩ", "i").replace("õ", "o").replace("ũ", "u").replace("ñ", "ñ") + extra = item.extra - itemlist.append(new_item) + #Si es una búsqueda, convierte los episodios en Series completas, aptas para la Videoteca + if extra == 'search' and 'series' in cat_ppal and not "Temp" in title and not "emporada" in title: + if cat_sec in title_lista: #Si ya hemos procesado la serie, pasamos de los episodios adicionales + continue - if itemlist: - # Obtenemos los datos basicos de todas las peliculas mediante multihilos - tmdb.set_infoLabels(itemlist) + # Descarga la página del episodio, buscando el enlace a la serie completa + data_serie = '' + try: + data_serie = re.sub(r"\n|\r|\t|\s{2}|(<!--.*?-->)| ", "", httptools.downloadpage(scrapedurl, timeout=timeout).data) + data_serie = unicode(data_serie, "iso-8859-1", errors="replace").encode("utf-8") + except: + pass + + if not data_serie: #Si la web está caída salimos sin dar error. Pintamos el episodio + logger.error("ERROR 01: LISTADO: La Web no responde o ha cambiado de URL: " + scrapedurl + " / SERIE: " + cat_sec) + else: + patron_serie = '<div id="where_i_am">.*?<a href="[^"]+">.*?<\/a>.*?<a href="([^"]+)">' + url = scrapertools.find_single_match(data_serie, patron_serie) #buscamos la url de la serie completa + if url: + url = host + url + extra = 'series' #es una serie completa + title_lista += [cat_sec] #la añadimos a la lista de series completas procesadas + title = cat_sec #salvamos el título de la serie completa + else: + url = scrapedurl #No se encuentra la Serie, se trata como Episodio suelto - # Si es necesario añadir paginacion - patron = '<div class="sPages">.*?' - patron += '<a href="([^"]+)">Siguiente' - url_next_page = scrapertools.find_single_match(data, patron) - if url_next_page: - itemlist.append(Item(channel=item.channel, action="listado", title=">> Página siguiente", - thumbnail=thumbnail_host, url=HOST + url_next_page, folder=True, - text_color=color3, text_bold=True)) + elif "Archivo Torrent" not in scrapedenlace and "Video Online" not in scrapedenlace: #Si no tiene enlaces pasamos + continue + + cnt_title += 1 + item_local = item.clone() #Creamos copia de Item para trabajar + if item_local.tipo: #... y limpiamos + del item_local.tipo + if item_local.totalItems: + del item_local.totalItems + if item_local.post_num: + del item_local.post_num + if item_local.category: + del item_local.category + if item_local.intervencion: + del item_local.intervencion + if item_local.viewmode: + del item_local.viewmode + item_local.extra2 = True + del item_local.extra2 + item_local.text_bold = True + del item_local.text_bold + item_local.text_color = True + del item_local.text_color + + title_subs = [] #creamos una lista para guardar info importante + item_local.language = [] #creamos lista para los idiomas + item_local.quality = '' #iniciamos calidad + quality_alt = '' + if 'series' not in cat_ppal: #si no son series, contiene la calidad + quality_alt = cat_sec.lower().strip() + item_local.extra = extra #guardamos el extra procesado + item_local.url = url #guardamos la url final + item_local.thumbnail = host[:-1] + scrapedthumbnail #guardamos el thumb + item_local.context = "['buscar_trailer']" + + item_local.contentType = "movie" #por defecto, son películas + item_local.action = "findvideos" + + #Analizamos los formatos de la películas + if ('cartelera' in cat_ppal or item.extra == "cartelera") and not item.extra2: + item_local.quality = cat_sec.lower().capitalize() + if 'peliculas-dvdrip' in cat_ppal or item_local.extra == 'DVD-RIP': + item_local.quality = 'DVD-RIP' + elif 'HDRIP' in cat_ppal or item_local.extra == 'HD-RIP': + item_local.quality = 'HD-RIP' + elif 'subtituladas' in cat_ppal or item_local.extra == 'VOSE': + item_local.language += ['VOSE'] + elif 'Version Original' in cat_ppal or item_local.extra == 'VO': + item_local.language += ['VO'] + + #Analizamos los formatos de series, temporadas y episodios + elif item_local.extra == 'series': + item_local.contentType = "tvshow" + item_local.action = "episodios" + item_local.season_colapse = True #Muestra las series agrupadas por temporadas + elif 'series' in cat_ppal or item_local.extra == 'episodios': + item_local.contentType = "episode" + item_local.extra = "episodios" + if "Temp" in title or "emporada" in title: + try: + item_local.contentSeason = int(scrapertools.find_single_match(title, '[t|T]emp.*?(\d+)')) + except: + item_local.contentSeason = 1 + title = re.sub(r'[t|T]emp.*?\d+', '', title) + title_subs += ["Temporada"] + item_local.contentType = "season" + item_local.extra = "season" + + if item_local.contentType == "movie": #para las peliculas ponemos el mismo extra + item_local.extra = "peliculas" + + #Detectamos idiomas + if "Latino" in cat_sec or "latino" in cat_sec or "Latino" in title or "latino" in title or "LATINO" in title: + item_local.language += ['LAT'] + elif "VOSE" in cat_sec or "VOS" in cat_sec or "VOSE" in title or "VOS" in title: + item_local.language += ['VOSE'] + + if item_local.language == []: + item_local.language = ['CAST'] + + #Procesamos calidades + if not item_local.quality: + if quality_alt in ['dvdscreener', 'brscreener r6', 'brscreener', 'webscreener', 'dvd', 'hdrip', 'screener', 'screeer', 'webrip', 'brrip', 'dvb', 'dvdrip', 'dvdsc', 'dvdsc - r6', 'hdts', 'hdtv', 'kvcd', 'line', 'ppv', 'telesync', 'ts hq', 'ts hq proper', '480p', '720p', 'ac3', 'bluray', 'camrip', 'ddc', 'hdtv - screener', 'tc screener', 'ts screener', 'ts screener alto', 'ts screener medio', 'vhs screener']: + item_local.quality = quality_alt.capitalize() + + #Detectamos el año + patron = '(\d{4})\s*?(?:\)|\])?$' + item_local.infoLabels["year"] = '-' + year = '' + year = scrapertools.find_single_match(title, patron) + if year: + title_alt = re.sub(patron, "", title) + title_alt = title_alt.strip() + if title_alt: + title = title_alt + try: + year = int(year) + if year >= 1970 and year <= 2040: + item_local.infoLabels["year"] = year + except: + pass + + #Detectamos info importante a guardar para después de TMDB + if scrapertools.find_single_match(title, '[m|M].*?serie'): + title = re.sub(r'[m|M]iniserie', '', title) + title_subs += ["Miniserie"] + if scrapertools.find_single_match(title, '[s|S]aga'): + title = re.sub(r'[s|S]aga', '', title) + title_subs += ["Saga"] + if scrapertools.find_single_match(title, '[c|C]olecc'): + title = re.sub(r'[c|C]olecc...', '', title) + title_subs += ["Colección"] + + #Empezamos a limpiar el título en varias pasadas + patron = '\s?-?\s?(line)?\s?-\s?$' + regex = re.compile(patron, re.I) + title = regex.sub("", title) + title = re.sub(r'\(\d{4}\s*?\)', '', title) + title = re.sub(r'\[\d{4}\s*?\]', '', title) + title = re.sub(r'- $', '', title) + title = re.sub(r'\d+[M|m|G|g][B|b]', '', title) + + #Limpiamos el título de la basura innecesaria + title = title.replace("Dual", "").replace("dual", "").replace("Subtitulada", "").replace("subtitulada", "").replace("Subt", "").replace("subt", "").replace("Sub", "").replace("sub", "").replace("(Proper)", "").replace("(proper)", "").replace("Proper", "").replace("proper", "").replace("#", "").replace("(Latino)", "").replace("Latino", "").replace("LATINO", "").replace("Spanish", "").replace("Esp", "").replace("Trailer", "").replace("Audio", "") + title = title.replace("HDTV-Screener", "").replace("DVDSCR", "").replace("TS ALTA", "").replace("- HDRip", "").replace("(HDRip)", "").replace("- Hdrip", "").replace("(microHD)", "").replace("(DVDRip)", "").replace("HDRip", "").replace("(BR-LINE)", "").replace("(HDTS-SCREENER)", "").replace("(BDRip)", "").replace("(BR-Screener)", "").replace("(DVDScreener)", "").replace("TS-Screener", "").replace(" TS", "").replace(" Ts", "").replace(" 480p", "").replace(" 480P", "").replace(" 720p", "").replace(" 720P", "").replace(" 1080p", "").replace(" 1080P", "").replace("DVDRip", "").replace(" Dvd", "").replace(" DVD", "").replace(" V.O", "").replace(" Unrated", "").replace(" UNRATED", "").replace(" unrated", "").replace("screener", "").replace("TS-SCREENER", "").replace("TSScreener", "").replace("HQ", "").replace("AC3 5.1", "").replace("Telesync", "").replace("Line Dubbed", "").replace("line Dubbed", "").replace("LineDuB", "").replace("Line", "").replace("XviD", "").replace("xvid", "").replace("XVID", "").replace("Mic Dubbed", "").replace("HD", "").replace("V2", "").replace("CAM", "").replace("VHS.SCR", "") + + #Obtenemos temporada y episodio si se trata de Episodios + if item_local.contentType == "episode": + patron = '(\d+)[x|X](\d+)' + try: + item_local.contentSeason, item_local.contentEpisodeNumber = scrapertools.find_single_match(title, patron) + except: + item_local.contentSeason = 1 + item_local.contentEpisodeNumber = 0 + + #Si son eisodios múltiples, lo extraemos + patron1 = '\d+[x|X]\d+.?(?:y|Y|al|Al)?.?\d+[x|X](\d+)' + epi_rango = scrapertools.find_single_match(title, patron1) + if epi_rango: + item_local.infoLabels['episodio_titulo'] = 'al %s' % epi_rango + title = re.sub(patron1, '', title) + else: + title = re.sub(patron, '', title) + + #Terminamos de limpiar el título + title = re.sub(r'\??\s?\d*?\&.*', '', title) + title = re.sub(r'[\(|\[]\s+[\)|\]]', '', title) + title = title.replace('()', '').replace('[]', '').strip().lower().title() + item_local.from_title = title.strip().lower().title() #Guardamos esta etiqueta para posible desambiguación de título + + #Salvamos el título según el tipo de contenido + if item_local.contentType == "movie": + item_local.contentTitle = title + else: + item_local.contentSerieName = title.strip().lower().title() + + if item_local.contentType == "episode": + item_local.title = '%sx%s ' % (str(item_local.contentSeason), str(item_local.contentEpisodeNumber).zfill(2)) + item_local.extra3 = 'completa' + else: + item_local.title = title.strip().lower().title() + + #Guarda la variable temporal que almacena la info adicional del título a ser restaurada después de TMDB + item_local.title_subs = title_subs + + #Salvamos y borramos el número de temporadas porque TMDB a veces hace tonterias. Lo pasamos como serie completa + if item_local.contentSeason and (item_local.contentType == "season" or item_local.contentType == "tvshow"): + item_local.contentSeason_save = item_local.contentSeason + del item_local.infoLabels['season'] + + itemlist.append(item_local.clone()) #Pintar pantalla + + #logger.debug(item_local) + + #Pasamos a TMDB la lista completa Itemlist + tmdb.set_infoLabels(itemlist, __modo_grafico__) + + #Llamamos al método para el maquillaje de los títulos obtenidos desde TMDB + item, itemlist = generictools.post_tmdb_listado(item, itemlist) + + # Si es necesario añadir paginacion + if curr_page <= last_page: + if last_page: + title = '%s de %s' % (curr_page-1, last_page) + else: + title = '%s' % curr_page-1 + + itemlist.append(Item(channel=item.channel, action="listado", title=">> Página siguiente " + title, title_lista=title_lista, url=item.url, extra=item.extra, extra2=item.extra2, last_page=str(last_page), curr_page=str(curr_page))) return itemlist + +def listado_series(item): + logger.info() + itemlist = [] + matches = [] + matches_current = 0 + pag = 30 + + #logger.debug(item) + + #Control de paginación + matches = item.matches #Restauramos la matches de la primera pasada + del item.matches + matches_tot = len(matches) #La web no pagina las Series, lo tenemos que controlar + if item.matches_current: #Llevamos los contadores de cuánto hemos pintado y cuánto queda + matches_current = item.matches_current + if matches_tot >= matches_current + pag: + item.matches_current = matches_current + pag #Establecemos el bloque a pintar en este pasada + else: + item.matches_current = matches_tot + #logger.debug(matches[matches_current:item.matches_current]) + + #procesamos una página + for scrapedurl, scrapedtitle in matches[matches_current:item.matches_current]: + item_local = item.clone() #Creamos copia de Item para trabajar + + if scrapertools.find_single_match(scrapedtitle, '\d+[x|X]\d+'): #Si es episodio suelto, pasamos + continue + + if item_local.tipo: + del item_local.tipo + if item_local.totalItems: + del item_local.totalItems + if item_local.post_num: + del item_local.post_num + if item_local.category: + del item_local.category + if item_local.intervencion: + del item_local.intervencion + if item_local.viewmode: + del item_local.viewmode + if item_local.matches_current: + del item_local.matches_current + item_local.extra2 = True + del item_local.extra2 + item_local.text_bold = True + del item_local.text_bold + item_local.text_color = True + del item_local.text_color + + #Iniciamos variables + title_subs = [] + item_local.language = [] + item_local.quality = '' + title = scrapedtitle + + #Empezamos a construir el Item de salida + item_local.url = scrapedurl + item_local.context = "['buscar_trailer']" + item_local.contentType = "tvshow" + item_local.action = "episodios" + item_local.season_colapse = True #Muestra las series agrupadas por temporadas + + #Tratamos idiomas, aunque hay poco... + if "Latino" in title or "latino" in title: + item_local.language += ['LAT'] + elif "VOSE" in title or "VOS" in title: + item_local.language += ['VOSE'] + + if item_local.language == []: + item_local.language = ['CAST'] + + #Establecemos el título + item_local.contentSerieName = title.strip().lower().title() + item_local.title = title.strip().lower().title() + item_local.from_title = title.strip().lower().title() + + itemlist.append(item_local.clone()) #Pintar pantalla + + #logger.debug(item_local) + + #if not item.category: #Si este campo no existe es que viene de la primera pasada de una búsqueda global + # return itemlist #Retornamos sin pasar por la fase de maquillaje para ahorra tiempo + + #Pasamos a TMDB la lista completa Itemlist + tmdb.set_infoLabels(itemlist, __modo_grafico__) + + #Llamamos al método para el maquillaje de los títulos obtenidos desde TMDB + item, itemlist = generictools.post_tmdb_listado(item, itemlist) + + #Control de siguiente página + if matches_tot > item.matches_current: + pag_tot = matches_tot / pag + pag_cur = item.matches_current / pag + + itemlist.append(Item(channel=item.channel, action="listado_series", title=">> Página siguiente (" + str(pag_cur) + " de " + str(pag_tot) + ")", url=item.url, text_color=color3, text_bold=True, extra=item.extra, matches_current=item.matches_current, matches=matches)) + + return itemlist + + def findvideos(item): logger.info() itemlist = [] - list_opciones = [] - IDIOMAS = {"banderita1": "Español", "banderita2": "VOSE", "banderita3": "Latino"} + + #logger.debug(item) + + IDIOMAS = {"banderita1": "CAST", "banderita2": "VOSE", "banderita3": "LAT"} - url = HOST + "ver-online-" + item.url - - data = httptools.downloadpage(url).data - data = re.sub(r"\n|\r|\t|\s{2}| ", "", data) + #Bajamos los datos de la página + data_torrent = '' + data_directo = '' + try: + url = item.url.replace('/descargar-', '/descargar-torrent-').replace('.fx', '-aportes.fx') + data_torrent = re.sub(r"\n|\r|\t|\s{2}|(<!--.*?-->)", "", httptools.downloadpage(url, timeout=timeout).data) + url = item.url.replace('/descargar-', '/ver-online-').replace('.fx', '-aportes.fx') + data_directo = re.sub(r"\n|\r|\t|\s{2}|(<!--.*?-->)", "", httptools.downloadpage(url, timeout=timeout).data) + except: + pass + + if not data_torrent and not data_directo: + logger.error("ERROR 01: FINDVIDEOS: La Web no responde o la URL es erronea: " + item.url) + itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: FINDVIDEOS:. La Web no responde o la URL es erronea. Si la Web está activa, reportar el error con el log')) + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos patron = '<div class="content"><a href="([^"]+).*?' + patron += '(?:<div class="content_medium">(.*?)<\/div>.*?)?' patron += '<div class="content_mini"><span class="([^"]+)' - matches = re.compile(patron, re.DOTALL).findall(data) + matches_torrent = re.compile(patron, re.DOTALL).findall(data_torrent) + matches_directo = re.compile(patron, re.DOTALL).findall(data_directo) + if not matches_torrent and not matches_directo and scrapertools.find_single_match(data_directo, '<div id="where_i_am".*?<a href="[^"]+">Ver Online<\/a>.*?href="([^"]+)">') != url: #error + logger.error("ERROR 02: FINDVIDEOS: No hay enlaces o ha cambiado la estructura de la Web " + " / PATRON: " + patron) + itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: FINDVIDEOS: No hay enlaces o ha cambiado la estructura de la Web. Verificar en la Web esto último y reportar el error con el log')) + if data_torrent: + logger.error(data_torrent) + if data_directo: + logger.error(data_directo) + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + + #logger.debug("PATRON: " + patron) + #logger.debug(matches_torrent) + #logger.debug(matches_directo) + #logger.debug(data_torrent) + #logger.debug(data_directo) + + #Llamamos al método para crear el título general del vídeo, con toda la información obtenida de TMDB + item, itemlist = generictools.post_tmdb_findvideos(item, itemlist) + + #Si es un Episodio suelto, tratamos de poner un enlace a la Serie completa + if item.extra3 == 'completa': + del item.extra3 + item_local = item.clone() + + #Salvamos lo imprescindible y reinicialmos InfoLabels + tmdb_id = item.infoLabels['tmdb_id'] + item_local.infoLabels = {} + item_local.unify = True + del item_local.unify + + #Restauramos lo básico + item.infoLabels['tmdb_id'] = tmdb_id + item_local.contentSerieName = item_local.from_title + item_local.title = item_local.from_title + item_local.quality = '' + item.infoLabels['year'] = '-' + item_local.contentType = 'tvshow' + item_local.extra = 'series' + item_local.action = 'episodios' + item_local.season_colapse = True #Muestra las series agrupadas por temporadas + + #Buscamos la url de la serie y verificamos que existe + patron_serie = '<div class="linkMoreMovies"><div class="linkMore"><a href="([^"]+)">' + item_local.url = scrapertools.find_single_match(data_torrent, patron_serie) #buscamos la url de la serie completa + if not item_local.url: + item_local.url = scrapertools.find_single_match(data_directo, patron_serie) #buscamos la url de la serie completa + if item_local.url: + item_local.url = item_local.url.replace('descargar-torrent', 'descarga').replace('-0-0-0-0-fx-', '-0-0-fx-') + try: + tmdb.set_infoLabels(item_local, True) #TMDB de la serie completa + except: + pass + + #Solo si hay url de Serie lo pintamos + itemlist.append(item_local.clone(title="** [COLOR yelow]Ver la Serie COMPLETA[/COLOR] **")) - for url, banderita in matches: - idioma = "" - if banderita in IDIOMAS: - idioma = " [%s]" % IDIOMAS[banderita] + #Ahora tratamos los enlaces .torrent + itemlist_alt = [] #Usamos una lista intermedia para poder ordenar los episodios + if matches_torrent: + for scrapedurl, scrapedquality, scrapedlang in matches_torrent: #leemos los torrents con la diferentes calidades + #Generamos una copia de Item para trabajar sobre ella + item_local = item.clone() + + item_local.url = scrapedurl #Guardamos la url intermedia + + if scrapedquality and not '--' in scrapedquality: #Salvamos la calidad, si la hay + item_local.quality = scrapedquality.lower().capitalize() + + if scrapertools.find_single_match(item.quality, '(\[\d+:\d+ h\])'): #Salvamos la duración + item_local.quality += ' [COLOR white]%s' % scrapertools.find_single_match(item.quality, '(\[\d+:\d+ h\])') #Copiamos la duración - data = httptools.downloadpage(url).data - data = re.sub(r"\n|\r|\t|\s{2}| ", "", data) - - if item.extra == 'multi-episodie': - patron = '<div class="linksDescarga"><span class="titulo">Video Online:([^<]+).*?<a href="([^"]+)' + if scrapedlang in IDIOMAS: #Salvamos el idioma, si lo hay + item_local.language = ["%s" % IDIOMAS[scrapedlang]] + + #Leemos la página definitiva para el enlace al .torrent + try: + data = re.sub(r"\n|\r|\t|\s{2}|(<!--.*?-->)", "", httptools.downloadpage(item_local.url, timeout=timeout).data) + except: + pass + + patron = '<div class="linksDescarga"><span class="titulo">Descargar Torrent: <\/span><br><a href="([^"]+)" class="TTlink">»\s?(.*?)\s?«<\/a>' matches = re.compile(patron, re.DOTALL).findall(data) - for capitulo, url in matches: - s = servertools.findvideos(url, skip=True) - if s: - itemlist.append(item.clone(url=s[0][1], action="play", folder=False, server=s[0][2], - title="Ver %s en %s%s" % ( - capitulo.strip(), s[0][2].capitalize(), idioma), - thumbnail2=item.thumbnail, - thumbnail=get_thumb("server_" + s[0][2] + ".png"), - language = idioma)) - else: - import os - for s in servertools.findvideos(data): - itemlist.append(item.clone(url=s[1], action="play", folder=False, server=s[2], - title="Ver en %s%s" % (s[2].capitalize(), idioma), - thumbnail2=item.thumbnail, - thumbnail=os.path.join(config.get_runtime_path(), "resources", "media", - "servers", "server_" + s[2] + ".png"), - language = idioma)) + + if not data or not matches: + logger.error("ERROR 02: FINDVIDEOS: El archivo Torrent no existe o ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / URL: " + item_local.url + " / DATA: " + data) + continue #si no hay más datos, algo no funciona, pasamos a Ver Online + + #logger.debug(patron) + #logger.debug(matches) + #logger.debug(data) + + for scrapedtorrent, scrapedtitle in matches: + quality = item_local.quality + qualityscraped = '' + if not item_local.contentEpisodeNumber and item_local.contentType == 'episode': + item_local.contentEpisodeNumber = 0 + + #Si son episodios múltiples, los listamos con sus títulos + if len(matches) > 1 or len(itemlist_alt) > 1: + if item_local.contentType == 'episode' or item_local.contentType == 'season': + if scrapertools.find_single_match(scrapedtitle, '(\d+[x|X]\d+(?:-\d{1,2})?)'): + qualityscraped = '%s' % scrapertools.find_single_match(scrapedtitle, '(\d+[x|X]\d+(?:-\d{1,2})?)') + if scrapertools.find_single_match(scrapedtitle, '\d+[x|X](\d+)'): + item_local.contentEpisodeNumber = int(scrapertools.find_single_match(scrapedtitle, '\d+[x|X](\d+)')) + elif scrapertools.find_single_match(scrapedtitle, '[c|C]ap.*?(\d+)'): + item_local.contentEpisodeNumber = int(scrapertools.find_single_match(scrapedtitle, '[c|C]ap.*?(\d+)')) + elif scrapertools.find_single_match(scrapedtorrent, '[s|S]\d{1,2}[e|E](\d{1,2})'): + item_local.contentEpisodeNumber = int(scrapertools.find_single_match(scrapedtorrent, '[s|S]\d{1,2}[e|E](\d{1,2})')) + if not qualityscraped: + qualityscraped = '%sx%s' % (str(item_local.contentSeason), str(item_local.contentEpisodeNumber).zfill(2)) + else: + qualityscraped = '%s' % scrapedtitle + + #Si todavía no sabemos el num de Episodio, lo buscamos + if not item_local.contentEpisodeNumber and item_local.contentType == 'episode': + try: + if scrapertools.find_single_match(scrapedtitle, '(\d+)[x|X](\d+)'): + item_local.contentSeason, item_local.contentEpisodeNumber = scrapertools.find_single_match(scrapedtitle, '(\d+)[x|X](\d+)') + qualityscraped = '%sx%s' % (str(item_local.contentSeason), str(item_local.contentEpisodeNumber).zfill(2)) + except: + pass + + #Buscamos calidades + if scrapertools.find_single_match(scrapedtitle, '(\d+p)'): + qualityscraped += ' ' + scrapertools.find_single_match(scrapedtitle, '(\d+p)') + if qualityscraped: + quality = '[%s] %s' % (qualityscraped, item_local.quality) - # Insertar items "Buscar trailer" y "Añadir a la videoteca" - if itemlist and item.extra == "movie": - if item.contentQuality: - title = "%s [%s]" % (item.contentTitle, item.contentQuality) - else: - title = item.contentTitle + #Ahora pintamos el link del Torrent + item_local.url = host + scrapedtorrent + item_local.title = '[COLOR yellow][?][/COLOR] [COLOR yellow][Torrent][/COLOR] [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR]' % (quality, str(item_local.language)) #Preparamos título de Torrent + item_local.title = re.sub(r'\s\[COLOR \w+\]\[\[?\]?\]\[\/COLOR\]', '', item_local.title) #Quitamos etiquetas vacías + item_local.title = re.sub(r'\s\[COLOR \w+\]\[\/COLOR\]', '', item_local.title) #Quitamos colores vacíos + item_local.alive = "??" #Calidad del link sin verificar + item_local.action = "play" #Visualizar vídeo + item_local.server = "torrent" #Seridor Torrent + + itemlist_alt.append(item_local.clone(quality=quality)) #Pintar pantalla - itemlist.insert(0, item.clone(channel="trailertools", action="buscartrailer", - text_color=color3, title=title, viewmode="list")) + #logger.debug("TORRENT: " + scrapedtorrent + " / title gen/torr: " + item.title + " / " + item_local.title + " / calidad: " + item_local.quality + " / tamaño: " + scrapedsize + " / content: " + item_local.contentTitle + " / " + item_local.contentSerieName) + #logger.debug(item_local) + + #Si son múltiples episodios, ordenamos + if len(itemlist_alt) > 1 and (item.contentType == 'episode' or item.contentType == 'season'): + itemlist_alt = sorted(itemlist_alt, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) #clasificamos + tmdb.set_infoLabels(itemlist_alt, True) #TMDB de la lista de episodios + itemlist.extend(itemlist_alt) - if config.get_videolibrary_support(): - itemlist.append(Item(channel=item.channel, title="Añadir película a la videoteca", - action="add_pelicula_to_library", url=item.url, text_color="green", - contentTitle=item.contentTitle, extra="library", thumbnail=thumbnail_host)) + #Ahora tratamos los servidores directo + itemlist_alt = [] + if matches_directo: + for scrapedurl, scrapedquality, scrapedlang in matches_directo: #leemos los torrents con la diferentes calidades + #Generamos una copia de Item para trabajar sobre ella + item_local = item.clone() + + item_local.url = scrapedurl #Guardamos la url intermedia + + if scrapedquality: + item_local.quality = scrapedquality + + if scrapertools.find_single_match(item.quality, '(\[\d+:\d+ h\])'): #Salvamos la duración + item_local.quality += ' [COLOR white]%s' % scrapertools.find_single_match(item.quality, '(\[\d+:\d+ h\])') #Copiamos la duración + + if scrapedlang in IDIOMAS: + item_local.language = ["%s" % IDIOMAS[scrapedlang]] #Salvamos el idioma, si lo hay + + #Leemos la página con el enlace al Servidor + try: + data = re.sub(r"\n|\r|\t|\s{2}|(<!--.*?-->)", "", httptools.downloadpage(item_local.url, timeout=timeout).data) + except: + pass + + patron = '<div class="linksDescarga"><span class="titulo">Video Online:\s?([^<]+)?<\/span><br><br><a href="([^"]+)' + matches = re.compile(patron, re.DOTALL).findall(data) + + if not data or not matches: + logger.error("ERROR 02: FINDVIDEOS: El enlace no existe o ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) + itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: FINDVIDEOS: El enlace no existe o ha cambiado la estructura de la Web. Verificar en la Web y reportar el error con el log')) + break #si no hay más datos, algo no funciona, pasamos a Ver Online + + #logger.debug(patron) + #logger.debug(matches) + #logger.debug(data) + + for scrapedtitle, scrapedenlace in matches: + enlace = '' + devuelve = '' + mostrar_server = '' + capitulo = '' + + servidor = scrapedtitle.strip() + servidor = servidor.replace("streamin", "streaminto") + if not servidor or "Capituo" in servidor or "Capitulo" in servidor or scrapertools.find_single_match(servidor, '(\d+[x|X]\d+)'): + capitulo = scrapertools.find_single_match(servidor, '(\d+[x|X]\d+)') + servidor = scrapertools.find_single_match(scrapedenlace, ':\/\/(.*?)\.') + quality = item_local.quality + + qualityscraped = '' + if not item_local.contentEpisodeNumber and item_local.contentType == 'episode': + item_local.contentEpisodeNumber = 0 + + #Si son episodios múltiples, los listamos con sus títulos + if (len(matches) > 1 or len(itemlist_alt) > 1) and not servidor in scrapedtitle: + if not capitulo and (item_local.contentType == 'episode' or item_local.contentType == 'season'): + if scrapertools.find_single_match(scrapedtitle, '(\d+[x|X]\d+(?:-\d{1,2})?)'): + qualityscraped = '%s' % scrapertools.find_single_match(scrapedtitle, '(\d+[x|X]\d+(?:-\d{1,2})?)') + if scrapertools.find_single_match(scrapedtitle, '\d+[x|X](\d+)'): + item_local.contentEpisodeNumber = int(scrapertools.find_single_match(scrapedtitle, '\d+[x|X](\d+)')) + elif scrapertools.find_single_match(scrapedtitle, '[c|C]ap.*?(\d+)'): + item_local.contentEpisodeNumber = int(scrapertools.find_single_match(scrapedtitle, '[c|C]ap.*?(\d+)')) + elif scrapertools.find_single_match(scrapedtorrent, '[s|S]\d{1,2}[e|E](\d{1,2})'): + item_local.contentEpisodeNumber = int(scrapertools.find_single_match(scrapedtorrent, '[s|S]\d{1,2}[e|E](\d{1,2})')) + if not qualityscraped: + qualityscraped = '%sx%s' % (str(item_local.contentSeason), str(item_local.contentEpisodeNumber).zfill(2)) + elif capitulo: + if scrapertools.find_single_match(capitulo, '\d+[x|X](\d+)'): + item_local.contentEpisodeNumber = int(scrapertools.find_single_match(scrapedtitle, '\d+[x|X](\d+)')) + qualityscraped = '%s' % capitulo + else: + qualityscraped = '%s' % scrapedtitle + + #Si todavía no sabemos el num de Episodio, lo buscamos + if not item_local.contentEpisodeNumber and item_local.contentType == 'episode': + try: + if scrapertools.find_single_match(scrapedtitle, '(\d+)[x|X](\d+)'): + item_local.contentSeason, item_local.contentEpisodeNumber = scrapertools.find_single_match(scrapedtitle, '(\d+)[x|X](\d+)') + qualityscraped = '%sx%s' % (str(item_local.contentSeason), str(item_local.contentEpisodeNumber).zfill(2)) + except: + pass + + #Buscamos calidades + if scrapertools.find_single_match(scrapedenlace, '(\d+p)'): + qualityscraped += ' ' + scrapertools.find_single_match(scrapedenlace, '(\d+p)') + if qualityscraped: + quality = '[%s] %s' % (qualityscraped, item_local.quality) + + if scrapertools.find_single_match(item.url, '(\d+x\d+.*?\d+x\d+)') and not capitulo and not qualityscraped: + quality = '[%s] %s' % (scrapertools.find_single_match(scrapedenlace, '(\d+x\d+)'), quality) + elif capitulo and not qualityscraped: + quality = '[%s] %s' % (capitulo, quality) + + #Verificamos el si el enlace del servidor está activo + if config.get_setting("hidepremium"): #Si no se aceptan servidore premium, se ignoran + mostrar_server = servertools.is_server_enabled(servidor) + + try: #Obtenemos el enlace + if mostrar_server: + devuelve = servertools.findvideosbyserver(scrapedenlace, servidor) #existe el link ? + if devuelve: + enlace = devuelve[0][1] #Se guarda el link + if not enlace: + continue + + item_local.alive = servertools.check_video_link(enlace, servidor, timeout=timeout) #activo el link ? + #Si el link no está activo se ignora + if item_local.alive == "??": #dudoso + item_local.title = '[COLOR yellow][?][/COLOR] [COLOR yellow][%s][/COLOR] [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR]' % (servidor.capitalize(), quality, str(item_local.language)) + elif item_local.alive.lower() == "no": #No está activo. Lo preparo, pero no lo pinto + item_local.title = '[COLOR red][%s][/COLOR] [COLOR yellow][%s][/COLOR] [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR]' % (item_local.alive, servidor.capitalize(), quality, str(item_local.language)) + logger.debug(item_local.alive + ": ALIVE / " + servidor + " / " + enlace) + raise + else: #Sí está activo + item_local.title = '[COLOR yellow][%s][/COLOR] [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR]' % (servidor.capitalize(), quality, str(item_local.language)) + + #Ahora pintamos el link Directo + item_local.url = enlace + item_local.title = '[COLOR yellow][%s][/COLOR] [COLOR yellow][%s][/COLOR] [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR]' % (item_local.alive, servidor.capitalize(), quality, str(item_local.language)) #Preparamos título de Directo + item_local.title = re.sub(r'\s\[COLOR \w+\]\[\[?\]?\]\[\/COLOR\]', '', item_local.title) #Quitamos etiquetas vacías + item_local.title = re.sub(r'\s\[COLOR \w+\]\[\/COLOR\]', '', item_local.title) #Quitamos colores vacíos + item_local.action = "play" #Visualizar vídeo + item_local.server = servidor #Seridor Directo + + itemlist_alt.append(item_local.clone(quality=quality)) #Pintar pantalla + except: + pass + + #logger.debug("DIRECTO: " + scrapedenlace + " / title gen/torr: " + item.title + " / " + item_local.title + " / calidad: " + item_local.quality + " / tamaño: " + scrapedsize + " / content: " + item_local.contentTitle + " / " + item_local.contentSerieName) + #logger.debug(item_local) + + #Si son múltiples episodios, ordenamos + if len(itemlist_alt) > 1 and (item.contentType == 'episode' or item.contentType == 'season'): + itemlist_alt = sorted(itemlist_alt, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) #clasificamos + tmdb.set_infoLabels(itemlist_alt, True) #TMDB de la lista de episodios + itemlist.extend(itemlist_alt) return itemlist - -def play(item): + +def episodios(item): logger.info() itemlist = [] + + #logger.debug(item) + + curr_page = 1 # Página inicial + last_page = 99999 # Última página inicial + if item.curr_page: + curr_page = int(item.curr_page) # Si viene de una pasada anterior, lo usamos + del item.curr_page # ... y lo borramos + if item.last_page: + last_page = int(item.last_page) # Si viene de una pasada anterior, lo usamos + del item.last_page # ... y lo borramos + url_item = item.url.replace('1-.fx', '%s-.fx').replace('-1.fx', '-%s.fx') + if item.from_title: + item.title = item.from_title + + #Limpiamos num. Temporada y Episodio que ha podido quedar por Novedades + season_display = 0 + if item.contentSeason: + if item.season_colapse: #Si viene del menú de Temporadas... + season_display = item.contentSeason #... salvamos el num de sesión a pintar + item.from_num_season_colapse = season_display + del item.season_colapse + item.contentType = "tvshow" + if item.from_title_season_colapse: + item.title = item.from_title_season_colapse + del item.from_title_season_colapse + if item.infoLabels['title']: + del item.infoLabels['title'] + del item.infoLabels['season'] + if item.contentEpisodeNumber: + del item.infoLabels['episode'] + if season_display == 0 and item.from_num_season_colapse: + season_display = item.from_num_season_colapse - # Cambiamos el thumbnail del server por el de la pelicula - itemlist.append(item.clone(thumbnail=item.thumbnail2)) + # Obtener la información actualizada de la Serie. TMDB es imprescindible para Videoteca + if not item.infoLabels['tmdb_id']: + tmdb.set_infoLabels(item, True) + + modo_ultima_temp_alt = modo_ultima_temp + if item.ow_force == "1": #Si hay un traspaso de canal o url, se actualiza todo + modo_ultima_temp_alt = False + + max_temp = 1 + if item.infoLabels['number_of_seasons']: + max_temp = item.infoLabels['number_of_seasons'] + y = [] + if modo_ultima_temp_alt and item.library_playcounts: #Averiguar cuantas temporadas hay en Videoteca + patron = 'season (\d+)' + matches = re.compile(patron, re.DOTALL).findall(str(item.library_playcounts)) + for x in matches: + y += [int(x)] + max_temp = max(y) + + while curr_page <= last_page: + + # Descarga la página + data = '' + url = url_item % curr_page #Inserto en num de página en la url + try: + data = re.sub(r"\n|\r|\t|\s{2}|(<!--.*?-->)| ", "", httptools.downloadpage(url, timeout=timeout).data) + data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8") + except: #Algún error de proceso, salimos + pass + + if not data: + logger.error("ERROR 01: EPISODIOS: La Web no responde o la URL es erronea" + item.url) + itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: EPISODIOS:. La Web no responde o la URL es erronea. Si la Web está activa, reportar el error con el log')) + return itemlist + + curr_page += 1 #Apunto ya a la página siguiente + + #Usamos el mismo patrón que en listado + patron = '<div class="MiniFicha"><a href="([^"]+)" title="([^"]+)">' + patron += '<img src="([^"]+).*?' + patron += '<div class="MiniF_TitleSpecial">[^>]+>([^<]+).*?' + patron += '<b>Categoria:\s*<\/b>([^&]+)»\s*([^<]+).*?' + patron += '<div class="OpcionesDescargasMini">(.*?)<\/div>' + matches = re.compile(patron, re.DOTALL).findall(data) + if not matches: #error + item = generictools.web_intervenida(item, data) #Verificamos que no haya sido clausurada + if item.intervencion: #Sí ha sido clausurada judicialmente + item, itemlist = generictools.post_tmdb_episodios(item, itemlist) #Llamamos al método para el pintado del error + return itemlist #Salimos + + logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) + itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web. Reportar el error con el log')) + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + + #logger.debug("PATRON: " + patron) + #logger.debug(matches) + #logger.debug(data) + + #Buscamos la última página, pero solo en la primera pasada, porque en búsquedan deja de funcionar a partir de la seguna página + if last_page == 99999: #Si es el valor inicial, buscamos + patron = '<div class="sPages">.*?' + patron += '<a href="[^"]+">Siguiente' + patron += ' »<\/a><br> En Total (\d+) Pagina?' #Esta es la parte que vale + try: + last_page = int(scrapertools.find_single_match(data, patron)) #lo cargamos como entero + except: + last_page = 1 #Si no lo encuentra, lo ponemos a 1 + + season = max_temp + #Comprobamos si realmente sabemos el num. máximo de temporadas + if item.library_playcounts or (item.infoLabels['number_of_seasons'] and item.tmdb_stat): + num_temporadas_flag = True + else: + num_temporadas_flag = False + + # Recorremos todos los episodios generando un Item local por cada uno en Itemlist + for scrapedurl, scrapedenlace, scrapedthumbnail, scrapedtitle, cat_ppal, cat_sec, opciones in matches: + item_local = item.clone() + item_local.action = "findvideos" + item_local.contentType = "episode" + item_local.extra = "episodios" + if item_local.library_playcounts: + del item_local.library_playcounts + if item_local.library_urls: + del item_local.library_urls + if item_local.path: + del item_local.path + if item_local.update_last: + del item_local.update_last + if item_local.update_next: + del item_local.update_next + if item_local.channel_host: + del item_local.channel_host + if item_local.active: + del item_local.active + if item_local.contentTitle: + del item_local.infoLabels['title'] + if item_local.season_colapse: + del item_local.season_colapse + + item_local.title = '' + item_local.context = "['buscar_trailer']" + item_local.url = scrapedurl + title = scrapedtitle + + if 'VO' in title or 'V.O' in title: + item_local.language = ['VO'] + title = title.replace('VO', '').replace('V.O', '') + + try: + item_local.contentEpisodeNumber = 0 + if 'miniserie' in title.lower(): + item_local.contentSeason = 1 + title = title.replace('miniserie', '').replace('MiniSerie', '') + elif 'completa' in title.lower(): + patron = '[t|T]emporada (\d+) [c|C]ompleta' + item_local.contentSeason = int(scrapertools.find_single_match(title, patron)) + else: + #Extraemos los episodios + patron = '(\d+)[x|X](\d{1,2})' + item_local.contentSeason, item_local.contentEpisodeNumber = scrapertools.find_single_match(title, patron) + item_local.contentSeason = int(item_local.contentSeason) + item_local.contentEpisodeNumber = int(item_local.contentEpisodeNumber) + except: + item_local.contentSeason = 1 + item_local.contentEpisodeNumber = 0 + + #Si son eisodios múltiples, lo extraemos + patron1 = '\d+[x|X]\d{1,2}.?(?:y|Y|al|Al)?(?:\d+[x|X]\d{1,2})?.?(?:y|Y|al|Al)?.?\d+[x|X](\d{1,2})' + epi_rango = scrapertools.find_single_match(title, patron1) + if epi_rango: + item_local.infoLabels['episodio_titulo'] = 'al %s' % epi_rango + item_local.title = '%sx%s al %s -' % (str(item_local.contentSeason), str(item_local.contentEpisodeNumber).zfill(2), str(epi_rango).zfill(2)) + else: + item_local.title = '%sx%s -' % (str(item_local.contentSeason), str(item_local.contentEpisodeNumber).zfill(2)) + + if modo_ultima_temp_alt and item.library_playcounts: #Si solo se actualiza la última temporada de Videoteca + if item_local.contentSeason < max_temp: + curr_page = 999999 #Sale del bucle de leer páginas + break #Sale del bucle actual del WHILE de episodios por página + + if season_display > 0: + if item_local.contentSeason > season_display: + continue + elif item_local.contentSeason < season_display: + break + + itemlist.append(item_local.clone()) + + #logger.debug(item_local) + + if len(itemlist) > 1: + itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) #clasificamos + + if item.season_colapse and not item.add_videolibrary: #Si viene de listado, mostramos solo Temporadas + item, itemlist = generictools.post_tmdb_seasons(item, itemlist) + + if not item.season_colapse: #Si no es pantalla de Temporadas, pintamos todo + # Pasada por TMDB y clasificación de lista por temporada y episodio + tmdb.set_infoLabels(itemlist, True) + + #Llamamos al método para el maquillaje de los títulos obtenidos desde TMDB + item, itemlist = generictools.post_tmdb_episodios(item, itemlist) + + #logger.debug(item) + + return itemlist + + +def actualizar_titulos(item): + logger.info() + + item = generictools.update_title(item) #Llamamos al método que actualiza el título con tmdb.find_and_set_infoLabels + + #Volvemos a la siguiente acción en el canal + return item + + +def search(item, texto): + logger.info() + #texto = texto.replace(" ", "+") + + try: + if item.extra == "search": + item.url = item.url + texto + "-sch.fx" + else: + item.url = item.url % texto + + if texto != '': + return listado(item) + except: + import sys + for line in sys.exc_info(): + logger.error("{0}".format(line)) + return [] + + +def newest(categoria): + logger.info() + itemlist = [] + item = Item() + + try: + if categoria == 'peliculas': + item.url = host + 'descarga-0-58128-0-0-fx-1-1-.fx' + item.extra = "HD-RIP" + item.channel = "estrenosgo" + item.category_new= 'newest' + + itemlist = listado(item) + if ">> Página siguiente" in itemlist[-1].title: + itemlist.pop() + + # Se captura la excepción, para no interrumpir al canal novedades si un canal falla + except: + import sys + for line in sys.exc_info(): + logger.error("{0}".format(line)) + return [] return itemlist diff --git a/plugin.video.alfa/channels/mejortorrent1.py b/plugin.video.alfa/channels/mejortorrent1.py index 4718f6a8..f2cf315f 100644 --- a/plugin.video.alfa/channels/mejortorrent1.py +++ b/plugin.video.alfa/channels/mejortorrent1.py @@ -1008,10 +1008,11 @@ def newest(categoria): try: if categoria == 'peliculas': item.url = host + "peliculas/" - item.extra = "novedades" + item.extra = "peliculas" item.channel = "mejortorrent1" + item.category_new= 'newest' item.tipo = False - itemlist = listado_busqueda(item) + itemlist = listado(item) if "Pagina siguiente >>" in itemlist[-1].title: itemlist.pop() @@ -1019,6 +1020,7 @@ def newest(categoria): item.url = host + "documentales/" item.extra = "documentales" item.channel = "mejortorrent1" + item.category_new= 'newest' item.tipo = False itemlist = listado(item) if "Pagina siguiente >>" in itemlist[-1].title: diff --git a/plugin.video.alfa/channels/newpct1.json b/plugin.video.alfa/channels/newpct1.json index c01d3a25..63ed5864 100644 --- a/plugin.video.alfa/channels/newpct1.json +++ b/plugin.video.alfa/channels/newpct1.json @@ -534,7 +534,7 @@ { "id": "include_in_newest_latino", "type": "bool", - "label": "Incluir en Novedades - Documentales", + "label": "Incluir en Novedades - Latino", "default": true, "enabled": true, "visible": false diff --git a/plugin.video.alfa/channels/newpct1.py b/plugin.video.alfa/channels/newpct1.py index ed7d1ed5..489713fc 100644 --- a/plugin.video.alfa/channels/newpct1.py +++ b/plugin.video.alfa/channels/newpct1.py @@ -62,9 +62,9 @@ elif fecha_rango == 4: fecha_rango = 'Siempre' episodio_serie = config.get_setting('clonenewpct1_serie_episodio_novedades', channel_py) #Episodio o serie para Novedades #Temporal, sólo para actualizar newpct1_data.json con otro valor por defecto -channel_banned = config.get_setting('clonenewpct1_excluir1_enlaces_veronline', channel_py) #1er Canal baneado -if channel_banned == 9: - config.set_setting('clonenewpct1_excluir1_enlaces_veronline', 22, channel_py) #se pone el nuevo valor por defecto +#channel_banned = config.get_setting('clonenewpct1_excluir1_enlaces_veronline', channel_py) #1eer Canal baneado +#if channel_banned == 9: +# config.set_setting('clonenewpct1_excluir1_enlaces_veronline', 22, channel_py) #se pone el nuevo valor por defecto def mainlist(item): @@ -86,9 +86,9 @@ def mainlist(item): thumb_buscar = get_thumb("search.png") thumb_settings = get_thumb("setting_0.png") - if channel_clone_name == "*** DOWN ***": #Ningún clones activo !!! + if channel_clone_name == "*** DOWN ***": #Ningún clones activo !!! itemlist.append(item.clone(action='', title="[COLOR yellow]Ningún canal NewPct1 activo[/COLOR]")) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos y salimos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos y salimos itemlist.append(Item(channel=item.channel, action="submenu_novedades", title="Novedades", url=item.channel_host + "ultimas-descargas/", extra="novedades", thumbnail=thumb_pelis, category=item.category, channel_host=item.channel_host)) @@ -148,8 +148,8 @@ def submenu(item): if not data: #Si no ha logrado encontrar nada, salimos itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.category + '[/COLOR]: Ningún canal NewPct1 activo')) itemlist.append(item.clone(action='', title=item.category + ': ERROR 01: SUBMENU: La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos - elif item.channel_alt: #Si ha habido fail-over, lo comento + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + elif item.channel_alt: #Si ha habido fail-over, lo comento itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.category + '[/COLOR] [ALT ] en uso')) itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.channel_alt.capitalize() + '[/COLOR] inaccesible')) @@ -157,15 +157,15 @@ def submenu(item): del item.channel_alt data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8") - data = data.replace("'", '"').replace('/series"', '/series/"') #Compatibilidad con mispelisy.series.com - if "pelisyseries.com" in item.channel_host and item.extra == "varios": #compatibilidad con mispelisy.series.com + data = data.replace("'", '"').replace('/series"', '/series/"') #Compatibilidad con mispelisy.series.com + if "pelisyseries.com" in item.channel_host and item.extra == "varios": #compatibilidad con mispelisy.series.com data = '<li><a href="' + item.channel_host + 'varios/" title="Documentales">Documentales</a></li>' else: - data = scrapertools.get_match(data, patron) #Seleccionamos el trozo que nos interesa + data = scrapertools.get_match(data, patron) #Seleccionamos el trozo que nos interesa if not data: logger.error("ERROR 02: SUBMENU: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.category + ': ERROR 02: SUBMENU: Ha cambiado la estructura de la Web. Reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos patron = '<li><a.*?href="([^"]+)"\s?.itle="[^"]+"\s?>([^>]+)<\/a><\/li>' matches = re.compile(patron, re.DOTALL).findall(data) @@ -173,7 +173,7 @@ def submenu(item): if not matches: logger.error("ERROR 02: SUBMENU: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.category + ': ERROR 02: SUBMENU: Ha cambiado la estructura de la Web. Reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos for scrapedurl, scrapedtitle in matches: title = scrapedtitle.strip() @@ -197,7 +197,7 @@ def submenu_novedades(item): itemlist_alt = [] data = '' - timeout_search=timeout * 2 #Más tiempo para Novedades, que es una búsqueda + timeout_search=timeout * 2 #Más tiempo para Novedades, que es una búsqueda thumb_settings = get_thumb("setting_0.png") #Establecer los valores del .json por si se entra directamente desde un favorito @@ -206,9 +206,9 @@ def submenu_novedades(item): item.category = scrapertools.find_single_match(item.url, 'http.?\:\/\/(?:www.)?(\w+)\.\w+\/').capitalize() item.extra = "novedades" - if channel_clone_name == "*** DOWN ***": #Ningún clones activo !!! + if channel_clone_name == "*** DOWN ***": #Ningún clones activo !!! itemlist.append(item.clone(action='', title="[COLOR yellow]Ningún canal NewPct1 activo[/COLOR]")) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos y salimos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos y salimos try: data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(item.url, timeout=timeout_search).data) @@ -229,20 +229,20 @@ def submenu_novedades(item): #Si no hay datos consistentes, llamamos al método de fail_over para que encuentre un canal que esté activo y pueda gestionar el submenú item, data = generictools.fail_over_newpct1(item, patron) - if not data: #Si no ha logrado encontrar nada, salimos + if not data: #Si no ha logrado encontrar nada, salimos itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.category + '[/COLOR]: Ningún canal NewPct1 activo')) itemlist.append(item.clone(action='', title=item.category + ': ERROR 01: SUBMENU: La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos - elif item.channel_alt: #Si ha habido fail-over, lo comento + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + elif item.channel_alt: #Si ha habido fail-over, lo comento itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.category + '[/COLOR] [ALT ] en uso')) itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.channel_alt.capitalize() + '[/COLOR] inaccesible')) if item.url_alt: del item.url_alt del item.channel_alt - data = scrapertools.get_match(data, patron) #Seleccionamos el trozo que nos interesa + data = scrapertools.get_match(data, patron) #Seleccionamos el trozo que nos interesa data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8") - data = data.replace("'", '"').replace('/series"', '/series/"') #Compatibilidad con mispelisy.series.com + data = data.replace("'", '"').replace('/series"', '/series/"') #Compatibilidad con mispelisy.series.com patron = '<option value="([^"]+)".*?>(.*?)<\/option>' matches = re.compile(patron, re.DOTALL).findall(data) @@ -260,12 +260,12 @@ def submenu_novedades(item): if title not in "Juegos, Software, Musica, Deportes": #tratamos de poner al principio las categorías más relevantes - if value == '1027': title = "01" + title #Pelis HD - elif value == '757': title = "02" + title #Pelis Castellano - elif value == '1527': title = "03" + title #Pelis Latino - elif value == '1469': title = "04" + title #Series HD - elif value == '767': title = "05" + title #Series - else: title = "99" + title #Resto + if value == '1027': title = "01" + title #Pelis HD + elif value == '757': title = "02" + title #Pelis Castellano + elif value == '1527': title = "03" + title #Pelis Latino + elif value == '1469': title = "04" + title #Series HD + elif value == '767': title = "05" + title #Series + else: title = "99" + title #Resto item.post = "categoryIDR=%s&date=%s" % (value, fecha_rango) itemlist_alt.append(item.clone(action="listado_busqueda", title=title, url=item.url, post=item.post)) @@ -307,8 +307,8 @@ def alfabeto(item): if not data: #Si no ha logrado encontrar nada, salimos itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.category + '[/COLOR]: Ningún canal NewPct1 activo')) itemlist.append(item.clone(action='', title=item.category + ': ERROR 01: ALFABETO: La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos - elif item.channel_alt: #Si ha habido fail-over, lo comento + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + elif item.channel_alt: #Si ha habido fail-over, lo comento itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.category + '[/COLOR] [ALT ] en uso')) itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.channel_alt.capitalize() + '[/COLOR] inaccesible')) @@ -323,7 +323,7 @@ def alfabeto(item): if not matches: logger.error("ERROR 02: ALFABETO: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.category + ': ERROR 02: ALFABETO: Ha cambiado la estructura de la Web. Reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos for scrapedurl, scrapedtitle in matches: title = scrapedtitle.upper() @@ -336,9 +336,9 @@ def alfabeto(item): def listado(item): logger.info() itemlist = [] - clase = "pelilist" # etiqueta para localizar zona de listado de contenidos - url_next_page ='' # Controlde paginación - cnt_tot = 30 # Poner el num. máximo de items por página + clase = "pelilist" # etiqueta para localizar zona de listado de contenidos + url_next_page ='' # Control de paginación + cnt_tot = 30 # Poner el num. máximo de items por página if item.totalItems: del item.totalItems @@ -349,7 +349,7 @@ def listado(item): except: pass - patron = '<ul class="' + clase + '">(.*?)</ul>' #seleccionamos el bloque que nos interesa + patron = '<ul class="' + clase + '">(.*?)</ul>' #seleccionamos el bloque que nos interesa if not data or (not scrapertools.find_single_match(data, patron) and not '<h3><strong>( 0 ) Resultados encontrados </strong>' in data): item = generictools.web_intervenida(item, data) #Verificamos que no haya sido clausurada if item.intervencion: #Sí ha sido clausurada judicialmente @@ -363,13 +363,13 @@ def listado(item): if not data: #Si no ha logrado encontrar nada, salimos itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.channel.capitalize() + '[/COLOR]: Ningún canal NewPct1 activo')) itemlist.append(item.clone(action='', title=item.category + ': ERROR 01: LISTADO: La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos #Establecemos los valores básicos en función del tipo de contenido if item.extra == "peliculas": item.action = "findvideos" item.contentType = "movie" - pag = True #Sí hay paginación + pag = True #Sí hay paginación elif item.extra == "series" and not "/miniseries" in item.url: item.action = "episodios" item.contentType = "tvshow" @@ -387,24 +387,24 @@ def listado(item): if not fichas and not '<h3><strong>( 0 ) Resultados encontrados </strong>' in data: #error logger.error("ERROR 02: LISTADO: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.category + ': ERROR 02: LISTADO: Ha cambiado la estructura de la Web. Reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos - elif '<h3><strong>( 0 ) Resultados encontrados </strong>' in data: #no hay vídeos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + elif '<h3><strong>( 0 ) Resultados encontrados </strong>' in data: #no hay vídeos return itemlist else: return itemlist page_extra = clase #Scrapea los datos de cada vídeo. Título alternativo se mantiene, aunque no se usa de momento - patron = '<a href="([^"]+).*?' # la url - patron += 'title="([^"]+).*?' # el titulo + patron = '<a href="([^"]+).*?' # la url + patron += 'title="([^"]+).*?' # el titulo patron += '<img.*?src="([^"]+)"[^>]+>.*?' # el thumbnail - patron += '<h2.*?>(.*?)?<\/h2>' # titulo alternativo. Se trunca en títulos largos - patron += '<span>([^<].*?)?<' # la calidad + patron += '<h2.*?>(.*?)?<\/h2>' # titulo alternativo. Se trunca en títulos largos + patron += '<span>([^<].*?)?<' # la calidad matches = re.compile(patron, re.DOTALL).findall(fichas) - if not matches: #error + if not matches: #error logger.error("ERROR 02: LISTADO: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + fichas) itemlist.append(item.clone(action='', title=item.category + ': ERROR 02: LISTADO: Ha cambiado la estructura de la Web. Reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos #logger.debug("MATCHES: " + str(len(matches))) #logger.debug(matches) @@ -514,7 +514,7 @@ def listado(item): title_subs += ["[2D]"] #Extraemos info adicional del título y la guardamos para después de TMDB - if "temp" in title.lower() or "cap" in title.lower(): #Eliminamos Temporada, solo nos interesa la serie completa + if "temp" in title.lower() or "cap" in title.lower(): #Eliminamos Temporada, solo nos interesa la serie completa title = re.sub(r' - [t|T]emp\w+ \d+ Comp\w+\d+[x|X]\d+', ' Completa', title) title = re.sub(r' - [t|T]emp\w+ \d+x\d+', '', title) title = re.sub(r' - [t|T]emp\w+ \d+', '', title) @@ -522,7 +522,7 @@ def listado(item): title = re.sub(r' [t|T]emp.*?\d+x\d+', '', title) title = re.sub(r' [t|T]emp.*?\d+', '', title) title = re.sub(r' [c|C]ap.*?\d+', '', title) - if "audio" in title.lower(): #Reservamos info de audio para después de TMDB + if "audio" in title.lower(): #Reservamos info de audio para después de TMDB title_subs += ['[%s]' % scrapertools.find_single_match(title, r'(\[[a|A]udio.*?\])')] title = re.sub(r'\[[a|A]udio.*?\]', '', title) if "[dual" in title.lower() or "multileng" in title.lower() or "multileng" in item_local.quality.lower() or (("espa" in title.lower() or "spani" in title.lower()) and "VOS" in item_local.language): @@ -556,7 +556,8 @@ def listado(item): title = re.sub(r'Descargar\s\w+\-\w+', '', title) title = re.sub(r'\(COMPLE.*?\)', '', title) title = re.sub(r'\(\d{4}\)$', '', title) - title = re.sub(r'\d{4}$', '', title) + if re.sub(r'\d{4}$', '', title).strip(): + title = re.sub(r'\d{4}$', '', title) title = re.sub(r' \d+x\d+', '', title) title = re.sub(r' x\d+', '', title) @@ -581,7 +582,7 @@ def listado(item): title_alt = title_alt.strip() item_local.quality = item_local.quality.strip() - if not title: #Usamos solo el title_alt en caso de que no exista el título original + if not title: #Usamos solo el title_alt en caso de que no exista el título original title = title_alt if not title: title = "SIN TITULO" @@ -589,7 +590,7 @@ def listado(item): #Limpieza final del título y guardado en las variables según su tipo de contenido title = scrapertools.remove_htmltags(title) item_local.title = title - item_local.from_title = title #Guardamos esta etiqueta para posible desambiguación de título + item_local.from_title = title #Guardamos esta etiqueta para posible desambiguación de título if item_local.contentType == "movie": item_local.contentTitle = title else: @@ -646,21 +647,21 @@ def listado_busqueda(item): item.category_new = item.category item.category = scrapertools.find_single_match(item.url, 'http.?\:\/\/(?:www.)?(\w+)\.\w+\/').capitalize() - if channel_clone_name == "*** DOWN ***": #Ningún clones activo !!! + if channel_clone_name == "*** DOWN ***": #Ningún clones activo !!! itemlist.append(item.clone(action='', title="[COLOR yellow]Ningún canal NewPct1 activo[/COLOR]")) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos y salimos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos y salimos itemlist = [] - cnt_tot = 40 # Poner el num. máximo de items por página. Dejamos que la web lo controle - cnt_title = 0 # Contador de líneas insertadas en Itemlist - cnt_pag = 0 # Contador de líneas leídas de Matches - timeout_search = timeout * 2 # Timeout un poco más largo para las búsquedas + cnt_tot = 40 # Poner el num. máximo de items por página. Dejamos que la web lo controle + cnt_title = 0 # Contador de líneas insertadas en Itemlist + cnt_pag = 0 # Contador de líneas leídas de Matches + timeout_search = timeout * 2 # Timeout un poco más largo para las búsquedas if timeout_search < 5: - timeout_search = 5 # Timeout un poco más largo para las búsquedas + timeout_search = 5 # Timeout un poco más largo para las búsquedas data = '' if item.cnt_pag: - cnt_pag = item.cnt_pag # Se guarda en la lista de páginas anteriores en Item + cnt_pag = item.cnt_pag # Se guarda en la lista de páginas anteriores en Item del item.cnt_pag if item.totalItems: del item.totalItems @@ -670,12 +671,12 @@ def listado_busqueda(item): del item.text_color #Sistema de paginado para evitar páginas vacías o semi-vacías en casos de búsquedas con series con muchos episodios - title_lista = [] # Guarda la lista de series que ya están en Itemlist, para no duplicar lineas - if item.title_lista: # Si viene de una pasada anterior, la lista ya estará guardada - title_lista = item.title_lista # Se usa la lista de páginas anteriores en Item + title_lista = [] # Guarda la lista de series que ya están en Itemlist, para no duplicar lineas + if item.title_lista: # Si viene de una pasada anterior, la lista ya estará guardada + title_lista = item.title_lista # Se usa la lista de páginas anteriores en Item title_lista_alt = [] for url in title_lista: - title_lista_alt += [url] #hacemos una copia no vinculada de title_lista + title_lista_alt += [url] #hacemos una copia no vinculada de title_lista matches = [] cnt_next = 0 total_pag = 1 @@ -694,7 +695,7 @@ def listado_busqueda(item): if item.extra == "novedades": pattern = '<div class="content">.*?<ul class="noticias(.*?)<\/div><!-- end .content -->' #seleccionamos el bloque que nos interesa else: - pattern = '<ul class="%s">(.*?)</ul>' % item.pattern #seleccionamos el bloque que nos interesa + pattern = '<ul class="%s">(.*?)</ul>' % item.pattern #seleccionamos el bloque que nos interesa if not data or (not scrapertools.find_single_match(data, pattern) and not '<h3><strong>( 0 ) Resultados encontrados </strong>' in data): item = generictools.web_intervenida(item, data) #Verificamos que no haya sido clausurada if item.intervencion: #Sí ha sido clausurada judicialmente @@ -708,13 +709,13 @@ def listado_busqueda(item): if not data: #Si no ha logrado encontrar nada, salimos itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.channel.capitalize() + '[/COLOR]: Ningún canal NewPct1 activo')) itemlist.append(item.clone(action='', title=item.category + ': ERROR 01: LISTADO_BUSQUEDA:. La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos - elif item.channel_alt: #Si ha habido fail-over, lo comento + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + elif item.channel_alt: #Si ha habido fail-over, lo comento host = host.replace(item.channel_alt, item.channel) #Obtiene la dirección de la próxima página, si la hay try: - post_actual = item.post #Guardamos el post actual por si hay overflow de Itemlist y hay que hechar marcha atrás + post_actual = item.post #Guardamos el post actual por si hay overflow de Itemlist y hay que hechar marcha atrás if item.extra == "novedades": get, post, total_pag = scrapertools.find_single_match(data, '<ul class="pagination">.*?<a\s*href="([^"]+pg\/)(\d+)">Next<\/a>.*?<a\s*href="[^"]+pg\/(\d+)">Last<\/a>') @@ -722,14 +723,14 @@ def listado_busqueda(item): get, post, total_pag = scrapertools.find_single_match(data, '<ul class="pagination">.*?<a\s*href="([^"]+)"(?:\s*onClick=".*?\(\'([^"]+)\'\);">Next<\/a>.*?onClick=".*?\(\'([^"]+)\'\);">Last<\/a>)') except: post = False - cnt_next = 99 #No hay más páginas. Salir del bucle después de procesar ésta + cnt_next = 99 #No hay más páginas. Salir del bucle después de procesar ésta - if post: #puntero a la siguiente página. Cada página de la web tiene 30 entradas + if post: #puntero a la siguiente página. Cada página de la web tiene 30 entradas if "pg" in item.post: item.post = re.sub(r"pg=(\d+)", "pg=%s" % post, item.post) else: item.post += "&pg=%s" % post - post_num = int(post)-1 #Guardo página actual + post_num = int(post)-1 #Guardo página actual # Preparamos un patron que pretence recoger todos los datos significativos del video if item.extra == "novedades": @@ -757,48 +758,49 @@ def listado_busqueda(item): if not matches_alt and not '<h3><strong>( 0 ) Resultados encontrados </strong>' in data_alt and not '<ul class="noticias-series"></ul></form></div><!-- end .page-box -->' in data_alt: #error logger.error("ERROR 02: LISTADO_BUSQUEDA: Ha cambiado la estructura de la Web " + " / PATRON: " + pattern + " / DATA: " + data_alt) itemlist.append(item.clone(action='', title=item.category + ': ERROR 02: LISTADO_BUSQUEDA: Ha cambiado la estructura de la Web. Reportar el error con el log')) - item, itemlist = generictools.post_tmdb_listado(item, itemlist) #Pintamos los datos de fail-over, si los hay - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + item, itemlist = generictools.post_tmdb_listado(item, itemlist) #Pintamos los datos de fail-over, si los hay + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos #Ahora se hace una simulación para saber cuantas líneas podemos albergar en este Itemlist. #Se controlará cuantas páginas web se tienen que leer para rellenar la lista, sin pasarse - title_lista_alt_for = [] #usamos está lista de urls para el FOR, luego la integramos en la del WHILE + title_lista_alt_for = [] #usamos está lista de urls para el FOR, luego la integramos en la del WHILE for scrapedurl, scrapedtitle, scrapedthumbnail, calidad, year, size in matches_alt: #Realiza un control de las series que se añaden, ya que el buscador devuelve episodios y no las series completas #Se analiza si la url de la serie ya se ha listado antes. Si es así, esa entrada se ignora #Cuando llega al num. máximo de entradas por página, la pinta y guarda los contadores y la lista de series scrapedurl_alt = scrapedurl - if "pelisyseries.com" in host: #Excepción para mispelisyseries.com. - scrapedurl_alt = re.sub(r'\/[c|C]ap.*?-\d+-al-\d+', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie - scrapedurl_alt = re.sub(r'\/[c|C]ap.*?-\d+', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie - scrapedurl_alt = re.sub(r'\/[c|C]ap.*?-', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie - scrapedurl_alt = re.sub(r'\/\d{5,7}', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie - if scrapedurl_alt in title_lista_alt: # si ya se ha tratado, pasamos al siguiente item - continue # solo guardamos la url para series y docus + if "pelisyseries.com" in host: #Excepción para mispelisyseries.com. + scrapedurl_alt = re.sub(r'\/[c|C]ap.*?-\d+-al-\d+', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie + scrapedurl_alt = re.sub(r'\/[c|C]ap.*?-\d+', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie + scrapedurl_alt = re.sub(r'\/[c|C]ap.*?-', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie + scrapedurl_alt = re.sub(r'\/\d{5,7}', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie + if scrapedurl_alt in title_lista_alt: # si ya se ha tratado, pasamos al siguiente item + continue # solo guardamos la url para series y docus - if scrapedurl_alt in title_lista_alt or scrapedurl_alt in title_lista_alt_for: # si ya se ha tratado, pasamos al siguiente item - continue # solo guardamos la url para series y docus + if scrapedurl_alt in title_lista_alt or scrapedurl_alt in title_lista_alt_for or scrapedthumbnail in title_lista_alt or scrapedthumbnail in title_lista_alt_for: # si ya se ha tratado, pasamos al siguiente item + continue # solo guardamos la url para series y docus if ".com/serie" in scrapedurl or "/serie" in scrapedurl or "-serie" in scrapedurl or "varios/" in scrapedurl: title_lista_alt_for += [scrapedurl_alt] + title_lista_alt_for += [scrapedthumbnail] - if "juego/" in scrapedurl: # no mostramos lo que no sean videos + if "juego/" in scrapedurl: # no mostramos lo que no sean videos continue - cnt_title += 1 # Sería una línea real más para Itemlist + cnt_title += 1 # Sería una línea real más para Itemlist #Control de página - if cnt_title > cnt_tot*0.65: #si se acerca al máximo num. de lineas por pagina, tratamos lo que tenemos - cnt_next = 99 #Casi completo, no sobrepasar con la siguiente página + if cnt_title > cnt_tot*0.65: #si se acerca al máximo num. de lineas por pagina, tratamos lo que tenemos + cnt_next = 99 #Casi completo, no sobrepasar con la siguiente página if cnt_title > cnt_tot: - cnt_title = 99 #Sobrepasado el máximo. Ignoro página actual - item.post = post_actual #Restauro puntero "next" a la página actual, para releearla en otra pasada - post_num -= 1 #Restauro puntero a la página actual en el pie de página + cnt_title = 99 #Sobrepasado el máximo. Ignoro página actual + item.post = post_actual #Restauro puntero "next" a la página actual, para releearla en otra pasada + post_num -= 1 #Restauro puntero a la página actual en el pie de página break if cnt_title <= cnt_tot: - matches.extend(matches_alt) #Acumulamos las entradas a tratar. Si nos hemos pasado ignoro última página + matches.extend(matches_alt) #Acumulamos las entradas a tratar. Si nos hemos pasado ignoro última página title_lista_alt.extend(title_lista_alt_for) #logger.debug("PATRON: " + pattern) @@ -813,26 +815,28 @@ def listado_busqueda(item): #Realiza un control de las series que se añaden, ya que el buscador devuelve episodios y no las series completas #Se analiza si la url de la serie ya se ha listado antes. Si es así, esa entrada se ignora #El control de página ya se ha realizado más arriba - if "pelisyseries.com" in host: #Excepción para mispelisyseries.com. + if "pelisyseries.com" in host: #Excepción para mispelisyseries.com. scrapedurl_alt = scrapedurl - scrapedurl_alt = re.sub(r'\/[c|C]ap.*?-\d+-al-\d+', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie - scrapedurl_alt = re.sub(r'\/[c|C]ap.*?-\d+', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie - scrapedurl_alt = re.sub(r'\/[c|C]ap.*?-', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie - scrapedurl_alt = re.sub(r'\/\d{5,7}', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie - if scrapedurl_alt in title_lista: # si ya se ha tratado, pasamos al siguiente item - continue # solo guardamos la url para series y docus + scrapedurl_alt = re.sub(r'\/[c|C]ap.*?-\d+-al-\d+', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie + scrapedurl_alt = re.sub(r'\/[c|C]ap.*?-\d+', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie + scrapedurl_alt = re.sub(r'\/[c|C]ap.*?-', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie + scrapedurl_alt = re.sub(r'\/\d{5,7}', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie + if scrapedurl_alt in title_lista: # si ya se ha tratado, pasamos al siguiente item + continue # solo guardamos la url para series y docus - if scrapedurl in title_lista: # si ya se ha tratado, pasamos al siguiente item - continue # solo guardamos la url para series y docus + if scrapedurl in title_lista or scrapedthumbnail in title_lista: # si ya se ha tratado, pasamos al siguiente item + continue # solo guardamos la url para series y docus if ".com/serie" in scrapedurl or "/serie" in scrapedurl or "-serie" in scrapedurl or "varios/" in scrapedurl: if "pelisyseries.com" in host: title_lista += [scrapedurl_alt] else: title_lista += [scrapedurl] + title_lista += [scrapedthumbnail] + if ("juego/" in scrapedurl or "xbox" in scrapedurl.lower()) and not "/serie" in scrapedurl or "xbox" in scrapedtitle.lower() or "windows" in scrapedtitle.lower() or "windows" in calidad.lower() or "nintendo" in scrapedtitle.lower() or "xbox" in calidad.lower() or "epub" in calidad.lower() or "pdf" in calidad.lower() or "pcdvd" in calidad.lower() or "crack" in calidad.lower(): # no mostramos lo que no sean videos continue - cnt_title += 1 # Sería una línea real más para Itemlist + cnt_title += 1 # Sería una línea real más para Itemlist #Creamos una copia de Item para cada contenido item_local = item.clone() @@ -864,9 +868,9 @@ def listado_busqueda(item): #Si son episodios sueltos de Series que vienen de Novedades, se busca la url de la Serie if item.extra == "novedades" and "/serie" in url and episodio_serie == 1: item_local.url = url - item_local.extra2 = 'serie_episodios' #Creamos acción temporal excluyente para otros clones - if item_local.category == 'Mispelisyseries': #Esta web no gestiona bien el cambio de episodio a Serie - pattern = 'class="btn-torrent">.*?window.location.href = "([^"]+)";' #Patron para .torrent + item_local.extra2 = 'serie_episodios' #Creamos acción temporal excluyente para otros clones + if item_local.category == 'Mispelisyseries': #Esta web no gestiona bien el cambio de episodio a Serie + pattern = 'class="btn-torrent">.*?window.location.href = "([^"]+)";' #Patron para .torrent #Como no hay datos consistentes, llamamos al método de fail_over para que encuentre un canal que esté activo y pueda gestionar el cambio de episodio por serie item_local, data_serie = generictools.fail_over_newpct1(item_local, pattern) else: @@ -875,25 +879,25 @@ def listado_busqueda(item): except: pass - pattern = 'class="btn-torrent">.*?window.location.href = "([^"]+)";' #Patron para .torrent + pattern = '<div class="content">.*?<h1>.*?<a href="([^"]+)"' #Patron para Serie completa if not data_serie or (not scrapertools.find_single_match(data_serie, pattern) and not '<h3><strong>( 0 ) Resultados encontrados </strong>' in data and not '<ul class="noticias-series"></ul></form></div><!-- end .page-box -->' in data): logger.error("ERROR 01: LISTADO_BUSQUEDA: La Web no responde o ha cambiado de URL: " + item_local.url + " / DATA: " + data_serie) #Si no hay datos consistentes, llamamos al método de fail_over para que encuentre un canal que esté activo y pueda gestionar el cambio de episodio por serie item_local, data_serie = generictools.fail_over_newpct1(item_local, pattern) - if not data_serie: #Si no ha logrado encontrar nada, salimos + if not data_serie: #Si no ha logrado encontrar nada, salimos title_subs += ["ERR"] - elif item_local.channel_alt: #Si ha habido fail-over, lo comento + elif item_local.channel_alt: #Si ha habido fail-over, lo comento url = url.replace(item_local.channel_alt, item_local.category.lower()) title_subs += ["ALT"] try: - pattern = '<div class="content">.*?<h1>.*?<a href="([^"]+)"' #Patron para Serie completa + pattern = '<div class="content">.*?<h1>.*?<a href="([^"]+)"' #Patron para Serie completa item_local.url = scrapertools.find_single_match(data_serie, pattern) - if (item.post and '775' in item.post and 'vo/' not in item_local.url) or 'vo/' in url: #Son series VO mal formadas? + if (item.post and '775' in item.post and 'vo/' not in item_local.url) or 'vo/' in url: #Son series VO mal formadas? item_local.url = item_local.url.replace('/series/', '/series-vo/') - #item_local.url = re.sub(r'\/\d+$', '/', item_local.url) #Quitamos el ID de la serie por compatib. + #item_local.url = re.sub(r'\/\d+$', '/', item_local.url) #Quitamos el ID de la serie por compatib. if item_local.url: title_subs += ["Episodio %sx%s" % (scrapertools.find_single_match(url, '\/temp.*?-(\d+)-?\/cap.*?-(\d+(?:-al-\d+)?)-?\/'))] url = item_local.url @@ -914,15 +918,15 @@ def listado_busqueda(item): item_local.contentType = "tvshow" item_local.season_colapse = True item_local.extra = "series" - elif "varios/" in url or "/miniseries" in url: #Documentales y varios + elif "varios/" in url or "/miniseries" in url: #Documentales y varios item_local.action = "findvideos" item_local.contentType = "movie" item_local.extra = "varios" - elif "/capitulo" in url: #Documentales y varios + elif "/capitulo" in url: #Documentales y varios item_local.action = "findvideos" item_local.contentType = "episode" item_local.extra = "series" - else: #Películas + else: #Películas item_local.action = "findvideos" item_local.contentType = "movie" item_local.extra = "peliculas" @@ -969,7 +973,7 @@ def listado_busqueda(item): title = re.sub(r' [t|T]emp.*?\d+', '', title) title = re.sub(r' [c|C]ap.*?\d+ al \d+', '', title) title = re.sub(r' [c|C]ap.*?\d+', '', title) - if "audio" in title.lower(): #Reservamos info de audio para después de TMDB + if "audio" in title.lower(): #Reservamos info de audio para después de TMDB title_subs += ['[%s]' % scrapertools.find_single_match(title, r'(\[[a|A]udio.*?\])')] title = re.sub(r'\[[a|A]udio.*?\]', '', title) if "[dual" in title.lower() or "multileng" in title.lower() or "multileng" in item_local.quality.lower() or (("espa" in title.lower() or "spani" in title.lower()) and "VOS" in item_local.language): @@ -1003,7 +1007,8 @@ def listado_busqueda(item): title = re.sub(r'Descargar\s\w+\-\w+', '', title) title = re.sub(r'\(COMPLE.*?\)', '', title) title = re.sub(r'\(\d{4}\)$', '', title) - title = re.sub(r'\d{4}$', '', title) + if re.sub(r'\d{4}$', '', title).strip(): + title = re.sub(r'\d{4}$', '', title) title = re.sub(r' \d+x\d+', '', title) title = re.sub(r' x\d+', '', title) @@ -1056,7 +1061,7 @@ def listado_busqueda(item): #Limpieza final del título y guardado en las variables según su tipo de contenido item_local.title = title - item_local.from_title = title #Guardamos esta etiqueta para posible desambiguación de título + item_local.from_title = title #Guardamos esta etiqueta para posible desambiguación de título if item_local.contentType == "movie": item_local.contentTitle = title size = scrapedsize.replace(".", ",") @@ -1109,8 +1114,8 @@ def listado_busqueda(item): serieid = "" #detectar si la url creada de tvshow es válida o hay que volver atras - url_id = host + calidad_mps + real_title_mps + "/" + serieid #A veces necesita el serieid... - url_tvshow = host + calidad_mps + real_title_mps + "/" #... otras no. A probar... + url_id = host + calidad_mps + real_title_mps + "/" + serieid #A veces necesita el serieid... + url_tvshow = host + calidad_mps + real_title_mps + "/" #... otras no. A probar... #Leemos la página, a ver si es una página de episodios data_serie = data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(url_id, timeout=timeout).data) @@ -1124,24 +1129,24 @@ def listado_busqueda(item): data_serie = unicode(data_serie, "iso-8859-1", errors="replace").encode("utf-8") data_serie = data_serie.replace("chapters", "buscar-list") - if not scrapertools.find_single_match(data_serie, pattern): #No ha habido suerte ... - item_local.contentType = "movie" #tratarlo el capítulo como película + if not scrapertools.find_single_match(data_serie, pattern): #No ha habido suerte ... + item_local.contentType = "movie" #tratarlo el capítulo como película item_local.extra = "peliculas" else: - item_local.url = url_tvshow #Cambiamos url de episodio por el de serie + item_local.url = url_tvshow #Cambiamos url de episodio por el de serie else: - item_local.url = url_id #Cambiamos url de episodio por el de serie + item_local.url = url_id #Cambiamos url de episodio por el de serie #logger.debug("url: " + item_local.url + " / title o/n: " + item_local.title + " / " + real_title_mps + " / calidad_mps : " + calidad_mps + " / contentType : " + item_local.contentType) - item_local.title = real_title_mps.replace('-', ' ').title().strip() #Esperemos que el nuevo título esté bien + item_local.title = real_title_mps.replace('-', ' ').title().strip() #Esperemos que el nuevo título esté bien item_local.contentSerieName = item_local.title #Agrega el item local a la lista itemlist itemlist.append(item_local.clone()) - #if not item.category_new: #Si este campo no existe es que viene de la primera pasada de una búsqueda global - # return itemlist #Retornamos sin pasar por la fase de maquillaje para ahorra tiempo + #if not item.category_new: #Si este campo no existe es que viene de la primera pasada de una búsqueda global + # return itemlist #Retornamos sin pasar por la fase de maquillaje para ahorra tiempo #Pasamos a TMDB la lista completa Itemlist tmdb.set_infoLabels(itemlist, __modo_grafico__) @@ -1165,7 +1170,7 @@ def findvideos(item): item.channel_host = host item.category = scrapertools.find_single_match(item.url, 'http.?\:\/\/(?:www.)?(\w+)\.\w+\/').capitalize() - verify_fo = True #Verificamos si el clone a usar está activo + verify_fo = True #Verificamos si el clone a usar está activo item, data = generictools.fail_over_newpct1(item, verify_fo) # Cualquiera de las tres opciones son válidas @@ -1178,14 +1183,14 @@ def findvideos(item): #Inicializamos las variables por si hay un error en medio del proceso channel_exclude = [] ver_enlaces = [] - ver_enlaces_veronline = -1 #Ver todos los enlaces Ver Online - verificar_enlaces_veronline = -1 #Verificar todos los enlaces Ver Online - verificar_enlaces_veronline_validos = True #"¿Contar sólo enlaces 'verificados' en Ver Online?" - excluir_enlaces_veronline = [] #Lista vacía de servidores excluidos en Ver Online - ver_enlaces_descargas = 0 #Ver todos los enlaces Descargar - verificar_enlaces_descargas = -1 #Verificar todos los enlaces Descargar - verificar_enlaces_descargas_validos = True #"¿Contar sólo enlaces 'verificados' en Descargar?" - excluir_enlaces_descargas = [] #Lista vacía de servidores excluidos en Descargar + ver_enlaces_veronline = -1 #Ver todos los enlaces Ver Online + verificar_enlaces_veronline = -1 #Verificar todos los enlaces Ver Online + verificar_enlaces_veronline_validos = True #"¿Contar sólo enlaces 'verificados' en Ver Online?" + excluir_enlaces_veronline = [] #Lista vacía de servidores excluidos en Ver Online + ver_enlaces_descargas = 0 #Ver todos los enlaces Descargar + verificar_enlaces_descargas = -1 #Verificar todos los enlaces Descargar + verificar_enlaces_descargas_validos = True #"¿Contar sólo enlaces 'verificados' en Descargar?" + excluir_enlaces_descargas = [] #Lista vacía de servidores excluidos en Descargar #Leemos las opciones de permitir Servidores para Ver Online y Descargas #Cargamos en .json del canal para ver las listas de valores en settings @@ -1200,16 +1205,16 @@ def findvideos(item): #Primer loop para enlaces de Ver Online. #Carga la variable de ver ver_enlaces_veronline = int(config.get_setting("clonenewpct1_ver_enlaces_veronline", item.channel)) - if ver_enlaces_veronline == 1: #a "Todos" le damos valor -1. Para "No" dejamos 0 + if ver_enlaces_veronline == 1: #a "Todos" le damos valor -1. Para "No" dejamos 0 ver_enlaces_veronline = -1 - if ver_enlaces_veronline > 1: #para los demás valores, tomamos los de la lista + if ver_enlaces_veronline > 1: #para los demás valores, tomamos los de la lista ver_enlaces_veronline = int(ver_enlaces[ver_enlaces_veronline]) #Carga la variable de verificar verificar_enlaces_veronline = int(config.get_setting("clonenewpct1_verificar_enlaces_veronline", item.channel)) - if verificar_enlaces_veronline == 1: #a "Todos" le damos valor -1. Para "No" dejamos 0 + if verificar_enlaces_veronline == 1: #a "Todos" le damos valor -1. Para "No" dejamos 0 verificar_enlaces_veronline = -1 - if verificar_enlaces_veronline > 1: #para los demás valores, tomamos los de la lista + if verificar_enlaces_veronline > 1: #para los demás valores, tomamos los de la lista verificar_enlaces_veronline = int(ver_enlaces[verificar_enlaces_veronline]) #Carga la variable de contar sólo los servidores verificados @@ -1217,26 +1222,26 @@ def findvideos(item): #Carga la variable de lista de servidores excluidos x = 1 - for x in range(1, max_excl+1): #recorremos todas las opciones de canales exluidos + for x in range(1, max_excl+1): #recorremos todas las opciones de canales exluidos valor = str(config.get_setting("clonenewpct1_excluir%s_enlaces_veronline" % x, item.channel)) valor = int(valor) - if valor > 0: #Evitamos "No" - excluir_enlaces_veronline += [channel_exclude[valor]] #Añadimos el nombre de servidor excluido a la lista + if valor > 0: #Evitamos "No" + excluir_enlaces_veronline += [channel_exclude[valor]] #Añadimos el nombre de servidor excluido a la lista x += 1 #Segundo loop para enlaces de Descargar. #Carga la variable de ver ver_enlaces_descargas = int(config.get_setting("clonenewpct1_ver_enlaces_descargas", item.channel)) - if ver_enlaces_descargas == 1: #a "Todos" le damos valor -1. Para "No" dejamos 0 + if ver_enlaces_descargas == 1: #a "Todos" le damos valor -1. Para "No" dejamos 0 ver_enlaces_descargas = -1 - if ver_enlaces_descargas > 1: #para los demás valores, tomamos los de la lista + if ver_enlaces_descargas > 1: #para los demás valores, tomamos los de la lista ver_enlaces_descargas = int(ver_enlaces[ver_enlaces_descargas]) #Carga la variable de verificar verificar_enlaces_descargas = int(config.get_setting("clonenewpct1_verificar_enlaces_descargas", item.channel)) - if verificar_enlaces_descargas == 1: #a "Todos" le damos valor -1. Para "No" dejamos 0 + if verificar_enlaces_descargas == 1: #a "Todos" le damos valor -1. Para "No" dejamos 0 verificar_enlaces_descargas = -1 - if verificar_enlaces_descargas > 1: #para los demás valores, tomamos los de la lista + if verificar_enlaces_descargas > 1: #para los demás valores, tomamos los de la lista verificar_enlaces_descargas = int(ver_enlaces[verificar_enlaces_descargas]) #Carga la variable de contar sólo los servidores verificados @@ -1244,14 +1249,14 @@ def findvideos(item): #Carga la variable de lista de servidores excluidos x = 1 - for x in range(1, max_excl+1): #recorremos todas las opciones de canales exluidos + for x in range(1, max_excl+1): #recorremos todas las opciones de canales exluidos valor = str(config.get_setting("clonenewpct1_excluir%s_enlaces_descargas" % x, item.channel)) valor = int(valor) - if valor > 0: #Evitamos "No" - excluir_enlaces_descargas += [channel_exclude[valor]] #Añadimos el nombre de servidor excluido a la lista + if valor > 0: #Evitamos "No" + excluir_enlaces_descargas += [channel_exclude[valor]] #Añadimos el nombre de servidor excluido a la lista x += 1 - except Exception, ex: #En caso de error, lo mostramos y reseteamos todas las variables + except Exception, ex: #En caso de error, lo mostramos y reseteamos todas las variables logger.error("Error en la lectura de parámentros del .json del canal: " + item.channel + " \n%s" % ex) #Mostrar los errores logger.error(ver_enlaces_veronline) @@ -1263,53 +1268,82 @@ def findvideos(item): logger.error(verificar_enlaces_descargas_validos) logger.error(excluir_enlaces_descargas) #Resetear las variables a sus valores por defecto - ver_enlaces_veronline = -1 #Ver todos los enlaces Ver Online - verificar_enlaces_veronline = -1 #Verificar todos los enlaces Ver Online - verificar_enlaces_veronline_validos = True #"¿Contar sólo enlaces 'verificados' en Ver Online?" - excluir_enlaces_veronline = [] #Lista vacía de servidores excluidos en Ver Online - ver_enlaces_descargas = 0 #Ver todos los enlaces Descargar - verificar_enlaces_descargas = -1 #Verificar todos los enlaces Descargar - verificar_enlaces_descargas_validos = True #"¿Contar sólo enlaces 'verificados' en Descargar?" - excluir_enlaces_descargas = [] #Lista vacía de servidores excluidos en Descargar + ver_enlaces_veronline = -1 #Ver todos los enlaces Ver Online + verificar_enlaces_veronline = -1 #Verificar todos los enlaces Ver Online + verificar_enlaces_veronline_validos = True #"¿Contar sólo enlaces 'verificados' en Ver Online?" + excluir_enlaces_veronline = [] #Lista vacía de servidores excluidos en Ver Online + ver_enlaces_descargas = 0 #Ver todos los enlaces Descargar + verificar_enlaces_descargas = -1 #Verificar todos los enlaces Descargar + verificar_enlaces_descargas_validos = True #"¿Contar sólo enlaces 'verificados' en Descargar?" + excluir_enlaces_descargas = [] #Lista vacía de servidores excluidos en Descargar # Descarga la página data = '' try: data = re.sub(r"\n|\r|\t|\s{2}|(<!--.*?-->)", "", httptools.downloadpage(item.url, timeout=timeout).data) + data = data.replace("$!", "#!").replace("'", "\"").replace("ñ", "ñ").replace("//pictures", "/pictures") + url_servidores = item.url + category_servidores = item.category + data_servidores = data #salvamos data para verificar servidores, si es necesario except: pass - patron = 'class="btn-torrent">.*?window.location.href = "(.*?)";' #Patron para .torrent + patron = 'class="btn-torrent">.*?window.location.href = "(.*?)";' #Patron para .torrent #Verificamos si se ha cargado una página, y si además tiene la estructura correcta if not data or not scrapertools.find_single_match(data, patron): - item = generictools.web_intervenida(item, data) #Verificamos que no haya sido clausurada - if item.intervencion: #Sí ha sido clausurada judicialmente - item, itemlist = generictools.post_tmdb_findvideos(item, itemlist) #Llamamos al método para el pintado del error - return itemlist #Salimos + item = generictools.web_intervenida(item, data) #Verificamos que no haya sido clausurada + if item.intervencion: #Sí ha sido clausurada judicialmente + item, itemlist = generictools.post_tmdb_findvideos(item, itemlist) #Llamamos al método para el pintado del error + return itemlist #Salimos logger.error("ERROR 01: FINDVIDEOS: La Web no responde o la URL es erronea: " + item.url + " / DATA: " + data) #Si no hay datos consistentes, llamamos al método de fail_over para que encuentre un canal que esté activo y pueda gestionar el vídeo item, data = generictools.fail_over_newpct1(item, patron) - if not data: #Si no ha logrado encontrar nada, salimos - itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.channel.capitalize() + '[/COLOR]: Ningún canal NewPct1 activo')) - itemlist.append(item.clone(action='', title=item.category + ': ERROR 01: FINDVIDEOS:. La Web no responde o la URL es erronea. Si la Web está activa, reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + if not data: #Si no ha logrado encontrar nada, verificamos si hay servidores + cnt_servidores = 0 + item.category = category_servidores #restauramos valores originales + item.url = url_servidores + + # Nuevo sistema de scrapeo de servidores creado por Torrentlocula, compatible con otros clones de Newpct1 + patron = '<div class=\"box1\"[^<]+<img src=\"([^<]+)?" style[^<]+><\/div[^<]+<div class="box2">([^<]+)?<\/div[^<]+<div class="box3">([^<]+)?' + patron += '<\/div[^<]+<div class="box4">([^<]+)?<\/div[^<]+<div class="box5"><a href=(.*?)? rel.*?' + patron += '<\/div[^<]+<div class="box6">([^<]+)?<' + enlaces_ver = re.compile(patron, re.DOTALL).findall(data_servidores) + enlaces_descargar = enlaces_ver + + for logo, servidor, idioma, calidad, enlace, title in enlaces_ver: #buscamos enlaces de servidores de ver-online + if ver_enlaces_veronline == 0: #Si no se quiere Ver Online, se sale del bloque + break + if "ver" in title.lower(): + cnt_servidores += 1 + + if cnt_servidores == 0: + item, data_servidores = generictools.fail_over_newpct1(item, patron) #intentamos recuperar servidores + + #Miramos si ha servidores + if not data_servidores: #Si no ha logrado encontrar nada nos vamos + itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.channel.capitalize() + '[/COLOR]: Ningún canal NewPct1 activo')) + itemlist.append(item.clone(action='', title=item.category + ': ERROR 01: FINDVIDEOS:. La Web no responde o la URL es erronea. Si la Web está activa, reportar el error con el log')) + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + + data = data_servidores #restauramos los datos + data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8") data = data.replace("$!", "#!").replace("'", "\"").replace("ñ", "ñ").replace("//pictures", "/pictures") #Añadimos el tamaño para todos size = scrapertools.find_single_match(data, '<div class="entry-left".*?><a href=".*?span class=.*?>Size:<\/strong>?\s(\d+?\.?\d*?\s\w[b|B])<\/span>') - size = size.replace(".", ",") #sustituimos . por , porque Unify lo borra + size = size.replace(".", ",") #sustituimos . por , porque Unify lo borra if not size: size = scrapertools.find_single_match(item.quality, '\s\[(\d+,?\d*?\s\w[b|B])\]') else: - item.title = re.sub(r'\s\[\d+,?\d*?\s\w[b|B]\]', '', item.title) #Quitamos size de título, si lo traía - item.title = '%s [%s]' % (item.title, size) #Agregamos size al final del título + item.title = re.sub(r'\s\[\d+,?\d*?\s\w[b|B]\]', '', item.title) #Quitamos size de título, si lo traía + item.title = '%s [%s]' % (item.title, size) #Agregamos size al final del título if size: size = size.replace('GB', 'G B').replace('Gb', 'G b').replace('MB', 'M B').replace('Mb', 'M b') - item.quality = re.sub(r'\s\[\d+,?\d*?\s\w[b|B]\]', '', item.quality) #Quitamos size de calidad, si lo traía + item.quality = re.sub(r'\s\[\d+,?\d*?\s\w[b|B]\]', '', item.quality) #Quitamos size de calidad, si lo traía #Llamamos al método para crear el título general del vídeo, con toda la información obtenida de TMDB item, itemlist = generictools.post_tmdb_findvideos(item, itemlist) @@ -1318,33 +1352,33 @@ def findvideos(item): item_local = item.clone() # obtenemos la url torrent + patron = 'class="btn-torrent">.*?window.location.href = "(.*?)";' #Patron para .torrent item_local.url = scrapertools.find_single_match(data, patron) - if not item_local.url: #error + if not item_local.url: #error logger.error("ERROR 02: FINDVIDEOS: El archivo Torrent no existe o ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) - itemlist.append(item.clone(action='', title=item.category + ': ERROR 02: FINDVIDEOS: El archivo Torrent no existe o ha cambiado la estructura de la Web. Verificar en la Web y reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos - item_local.url = item_local.url.replace(" ", "%20") #sustituimos espacios por %20, por si acaso + item_local.url = item_local.url.replace(" ", "%20") #sustituimos espacios por %20, por si acaso #logger.debug("Patron: " + patron + " url: " + item_local.url) #logger.debug(data) #Ahora pintamos el link del Torrent, si lo hay if item_local.url: # Hay Torrent ? if size: - quality = '%s [%s]' % (item_local.quality, size) #Agregamos size al final del título + quality = '%s [%s]' % (item_local.quality, size) #Agregamos size al final del título else: quality = item_local.quality - item_local.title = '[COLOR yellow][?][/COLOR] [COLOR yellow][Torrent][/COLOR] [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR]' % (quality, str(item_local.language)) #Preparamos título de Torrent + item_local.title = '[COLOR yellow][?][/COLOR] [COLOR yellow][Torrent][/COLOR] [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR]' % (quality, str(item_local.language)) #Preparamos título de Torrent item_local.title = re.sub(r'\s\[COLOR \w+\]\[\[?\]?\]\[\/COLOR\]', '', item_local.title).strip() #Quitamos etiquetas vacías item_local.title = re.sub(r'\s\[COLOR \w+\]\[\/COLOR\]', '', item_local.title).strip() #Quitamos colores vacíos - item_local.alive = "??" #Calidad del link sin verificar - item_local.action = "play" #Visualizar vídeo - item_local.server = "torrent" #Servidor + item_local.alive = "??" #Calidad del link sin verificar + item_local.action = "play" #Visualizar vídeo + item_local.server = "torrent" #Servidor - itemlist.append(item_local.clone(quality=quality)) #Pintar pantalla + itemlist.append(item_local.clone(quality=quality)) #Pintar pantalla - logger.debug("TORRENT: " + item_local.url + " / title gen/torr: " + item.title + " / " + item_local.title + " / calidad: " + item_local.quality + " / tamaño: " + size + " / content: " + item_local.contentTitle + " / " + item_local.contentSerieName) - #logger.debug(item_local) + logger.debug("TORRENT: " + item_local.url + " / title gen/torr: " + item.title + " / " + item_local.title + " / calidad: " + item_local.quality + " / tamaño: " + size + " / content: " + item_local.contentTitle + " / " + item_local.contentSerieName) + #logger.debug(item_local) + # VER vídeos, descargar vídeos un link, o múltiples links data = scrapertools.find_single_match(data, '<div id="tab1" class="tab_content"(.*?<\/ul>(?:<div.*?>)?<\/div><\/div><\/div>)') #Seleccionar el bloque para evitar duplicados @@ -1365,15 +1399,15 @@ def findvideos(item): cnt_enl_ver = 1 cnt_enl_verif = 1 for logo, servidor, idioma, calidad, enlace, title in enlaces_ver: - if ver_enlaces_veronline == 0: #Si no se quiere Ver Online, se sale del bloque + if ver_enlaces_veronline == 0: #Si no se quiere Ver Online, se sale del bloque break if "ver" in title.lower(): servidor = servidor.replace("streamin", "streaminto") - if servidor.capitalize() in excluir_enlaces_veronline: #Servidor excluido, pasamos al siguiente + if servidor.capitalize() in excluir_enlaces_veronline: #Servidor excluido, pasamos al siguiente continue mostrar_server = True - if config.get_setting("hidepremium"): #Si no se aceptan servidore premium, se ignoran + if config.get_setting("hidepremium"): #Si no se aceptan servidore premium, se ignoran mostrar_server = servertools.is_server_enabled(servidor) #logger.debug("VER: url: " + enlace + " / title: " + title + " / servidor: " + servidor + " / idioma: " + idioma) @@ -1382,37 +1416,37 @@ def findvideos(item): if mostrar_server: try: if cnt_enl_ver <= ver_enlaces_veronline or ver_enlaces_veronline == -1: - devuelve = servertools.findvideosbyserver(enlace, servidor) #existe el link ? + devuelve = servertools.findvideosbyserver(enlace, servidor) #existe el link ? if verificar_enlaces_veronline == 0: cnt_enl_ver += 1 else: - break #Si se ha agotado el contador de verificación, se sale de Ver Online + break #Si se ha agotado el contador de verificación, se sale de Ver Online - if devuelve: #Hay link - enlace = devuelve[0][1] #Se guarda el link - item_local.alive = "??" #Se asume poe defecto que es link es dudoso - if verificar_enlaces_veronline != 0: #Se quiere verificar si el link está activo? + if devuelve: #Hay link + enlace = devuelve[0][1] #Se guarda el link + item_local.alive = "??" #Se asume poe defecto que es link es dudoso + if verificar_enlaces_veronline != 0: #Se quiere verificar si el link está activo? if cnt_enl_verif <= verificar_enlaces_veronline or verificar_enlaces_veronline == -1: #contador? #Llama a la subfunción de check_list_links(itemlist) para cada link de servidor item_local.alive = servertools.check_video_link(enlace, servidor, timeout=timeout) #activo el link ? - if verificar_enlaces_veronline_validos: #Los links tienen que ser válidos para contarlos? - if item_local.alive == "Ok": #Sí - cnt_enl_verif += 1 #Movemos los contadores - cnt_enl_ver += 1 #Movemos los contadores - else: #Si no es necesario que sean links válidos, sumamos - cnt_enl_verif += 1 #Movemos los contadores - cnt_enl_ver += 1 #Movemos los contadores + if verificar_enlaces_veronline_validos: #Los links tienen que ser válidos para contarlos? + if item_local.alive == "Ok": #Sí + cnt_enl_verif += 1 #Movemos los contadores + cnt_enl_ver += 1 #Movemos los contadores + else: #Si no es necesario que sean links válidos, sumamos + cnt_enl_verif += 1 #Movemos los contadores + cnt_enl_ver += 1 #Movemos los contadores else: - break #Si se ha agotado el contador de verificación, se sale de Ver Online + break #Si se ha agotado el contador de verificación, se sale de Ver Online #Si el link no está activo se ignora - if item_local.alive == "??": #dudoso + if item_local.alive == "??": #dudoso item_local.title = '[COLOR yellow][?][/COLOR] [COLOR yellow][%s][/COLOR] [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR]' % (servidor.capitalize(), item_local.quality, str(item_local.language)) elif item_local.alive.lower() == "no": #No está activo. Lo preparo, pero no lo pinto item_local.title = '[COLOR red][%s][/COLOR] [COLOR yellow][%s][/COLOR] [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR]' % (item_local.alive, servidor.capitalize(), item_local.quality, str(item_local.language)) logger.debug(item_local.alive + ": ALIVE / " + title + " / " + servidor + " / " + enlace) raise - else: #Sí está activo + else: #Sí está activo item_local.title = '[COLOR yellow][%s][/COLOR] [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR]' % (servidor.capitalize(), item_local.quality, str(item_local.language)) #Preparamos el resto de variables de Item para ver los vídeos en directo @@ -1430,7 +1464,7 @@ def findvideos(item): if len(enlaces_descargar) > 0 and ver_enlaces_descargas != 0: #Pintamos un pseudo-título de Descargas - if not item.unify: #Si Titulos Inteligentes NO seleccionados: + if not item.unify: #Si Titulos Inteligentes NO seleccionados: itemlist.append(item_local.clone(title="[COLOR gold]**- Enlaces Descargar: -**[/COLOR]", action="")) else: itemlist.append(item_local.clone(title="[COLOR gold] Enlaces Descargar: [/COLOR]", action="")) @@ -1444,10 +1478,10 @@ def findvideos(item): if "Ver" not in title: servidor = servidor.replace("uploaded", "uploadedto") - partes = enlace.split(" ") #Partimos el enlace en cada link de las partes - title = "Descarga" #Usamos la palabra reservada de Unify para que no formatee el título + partes = enlace.split(" ") #Partimos el enlace en cada link de las partes + title = "Descarga" #Usamos la palabra reservada de Unify para que no formatee el título - if servidor.capitalize() in excluir_enlaces_descargas: #Servidor excluido, pasamos al siguiente + if servidor.capitalize() in excluir_enlaces_descargas: #Servidor excluido, pasamos al siguiente continue #logger.debug("DESCARGAR: url: " + enlace + " / title: " + title + title + " / servidor: " + servidor + " / idioma: " + idioma) @@ -1461,7 +1495,7 @@ def findvideos(item): parte_title = "[COLOR yellow]%s-[/COLOR] %s %s/%s [COLOR limegreen]-%s[/COLOR] [COLOR red]-%s[/COLOR]" % (servidor.capitalize(), title, p, len(partes), item_local.quality, str(item_local.language)) p += 1 mostrar_server = True - if config.get_setting("hidepremium"): #Si no se aceptan servidore premium, se ignoran + if config.get_setting("hidepremium"): #Si no se aceptan servidore premium, se ignoran mostrar_server = servertools.is_server_enabled(servidor) #Si el servidor es válido, se comprueban si los links están activos @@ -1472,8 +1506,8 @@ def findvideos(item): if verificar_enlaces_descargas == 0: cnt_enl_ver += 1 else: - ver_enlaces_descargas = 0 #FORZAR SALIR de DESCARGAS - break #Si se ha agotado el contador de verificación, se sale de "Enlace" + ver_enlaces_descargas = 0 #FORZAR SALIR de DESCARGAS + break #Si se ha agotado el contador de verificación, se sale de "Enlace" if devuelve: enlace = devuelve[0][1] @@ -1489,20 +1523,20 @@ def findvideos(item): if item_local.alive == "Ok": #Sí cnt_enl_verif += 1 #Movemos los contadores cnt_enl_ver += 1 #Movemos los contadores - else: #Si no es necesario que sean links válidos, sumamos + else: #Si no es necesario que sean links válidos, sumamos cnt_enl_verif += 1 #Movemos los contadores cnt_enl_ver += 1 #Movemos los contadores else: ver_enlaces_descargas = 0 #FORZAR SALIR de DESCARGAS - break #Si se ha agotado el contador de verificación, se sale de "Enlace" + break #Si se ha agotado el contador de verificación, se sale de "Enlace" - if item_local.alive == "??": #dudoso - if not item.unify: #Si titles Inteligentes NO seleccionados: + if item_local.alive == "??": #dudoso + if not item.unify: #Si titles Inteligentes NO seleccionados: parte_title = '[COLOR yellow][?][/COLOR] %s' % (parte_title) else: parte_title = '[COLOR yellow]%s[/COLOR]-%s' % (item_local.alive, parte_title) - elif item_local.alive.lower() == "no": #No está activo. Lo preparo, pero no lo pinto - if not item.unify: #Si titles Inteligentes NO seleccionados: + elif item_local.alive.lower() == "no": #No está activo. Lo preparo, pero no lo pinto + if not item.unify: #Si titles Inteligentes NO seleccionados: parte_title = '[COLOR red][%s][/COLOR] %s' % (item_local.alive, parte_title) else: parte_title = '[COLOR red]%s[/COLOR]-%s' % (item_local.alive, parte_title) @@ -1534,14 +1568,14 @@ def episodios(item): item.channel_host = host item.category = scrapertools.find_single_match(item.url, 'http.?\:\/\/(?:www.)?(\w+)\.\w+\/').capitalize() - verify_fo = True #Verificamos si el clone a usar está activo + verify_fo = True #Verificamos si el clone a usar está activo item, data = generictools.fail_over_newpct1(item, verify_fo) #Limpiamos num. Temporada y Episodio que ha podido quedar por Novedades season_display = 0 if item.contentSeason: - if item.season_colapse: #Si viene del menú de Temporadas... - season_display = item.contentSeason #... salvamos el num de sesión a pintar + if item.season_colapse: #Si viene del menú de Temporadas... + season_display = item.contentSeason #... salvamos el num de sesión a pintar item.from_num_season_colapse = season_display del item.season_colapse item.contentType = "tvshow" @@ -1559,19 +1593,19 @@ def episodios(item): # Obtener la información actualizada de la Serie. TMDB es imprescindible para Videoteca if not item.infoLabels['tmdb_id']: try: - tmdb.set_infoLabels(item, True) #TMDB de cada Temp + tmdb.set_infoLabels(item, True) #TMDB de cada Temp except: pass modo_ultima_temp_alt = modo_ultima_temp - if item.ow_force == "1": #Si hay un traspaso de canal o url, se actualiza todo + if item.ow_force == "1": #Si hay un traspaso de canal o url, se actualiza todo modo_ultima_temp_alt = False max_temp = 1 if item.infoLabels['number_of_seasons']: max_temp = item.infoLabels['number_of_seasons'] y = [] - if modo_ultima_temp_alt and item.library_playcounts: #Averiguar cuantas temporadas hay en Videoteca + if modo_ultima_temp_alt and item.library_playcounts: #Averiguar cuantas temporadas hay en Videoteca patron = 'season (\d+)' matches = re.compile(patron, re.DOTALL).findall(str(item.library_playcounts)) for x in matches: @@ -1582,13 +1616,13 @@ def episodios(item): data_alt = '' try: if "pelisyseries.com" in item.url: - patron = '<ul class="%s">(.*?)</ul>' % "chapters" # item.pattern + patron = '<ul class="%s">(.*?)</ul>' % "chapters" # item.pattern else: - patron = '<ul class="%s">(.*?)</ul>' % "buscar-list" # item.pattern + patron = '<ul class="%s">(.*?)</ul>' % "buscar-list" # item.pattern data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(item.url, timeout=timeout).data) if data: data_alt = scrapertools.get_match(data, patron) - except: #Algún error de proceso + except: #Algún error de proceso pass if "pelisyseries.com" in item.url: @@ -1609,7 +1643,7 @@ def episodios(item): #Si no hay datos consistentes, llamamos al método de fail_over para que encuentre un canal que esté activo y pueda gestionar el vídeo item, data = generictools.fail_over_newpct1(item, patron, pattern) - if not data: #No se ha encontrado ningún canal activo para este vídeo + if not data: #No se ha encontrado ningún canal activo para este vídeo itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.channel.capitalize() + '[/COLOR]: Ningún canal NewPct1 activo')) itemlist.append(item.clone(action='', title=item.category + ': ERROR 01: EPISODIOS:. La Web no responde o la URL es erronea. Si la Web está activa, reportar el error con el log')) return itemlist @@ -1622,7 +1656,7 @@ def episodios(item): act_page = int(scrapertools.find_single_match(item.url, r'\/pg\/(\d+)')) #Num página actual else: act_page = 1 - pattern = '<li><a href="([^"]+)">Last<\/a>' #Busca última página + pattern = '<li><a href="([^"]+)">Last<\/a>' #Busca última página full_url = scrapertools.find_single_match(pagination, pattern) url, last_page = scrapertools.find_single_match(full_url, r'(.*?\/pg\/)(\d+)') last_page = int(last_page) @@ -1642,32 +1676,32 @@ def episodios(item): num_temporadas_flag = True else: num_temporadas_flag = False - for page in list_pages: #Recorre la lista de páginas + for page in list_pages: #Recorre la lista de páginas if not list_pages: break try: if not data: data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(page, timeout=timeout).data) data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8") - data = data.replace("chapters", "buscar-list") #Compatibilidad con mispelisy.series.com - pattern = '<ul class="%s">(.*?)</ul>' % "buscar-list" # item.pattern + data = data.replace("chapters", "buscar-list") #Compatibilidad con mispelisy.series.com + pattern = '<ul class="%s">(.*?)</ul>' % "buscar-list" # item.pattern data = scrapertools.get_match(data, pattern) if not data: raise except: logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + pattern + " / " + str(list_pages) + " / DATA: " + str(data)) itemlist.append(item.clone(action='', title=item.category + ': ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web. Reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos if "pelisyseries.com" in item.url: pattern = '<li[^>]*><div class.*?src="(?P<thumb>[^"]+)?".*?<a class.*?href="(?P<url>[^"]+).*?<h3[^>]+>(?P<info>.*?)?<\/h3>.*?<\/li>' else: pattern = '<li[^>]*><a href="(?P<url>[^"]+).*?<img.*?src="(?P<thumb>[^"]+)?".*?<h2[^>]+>(?P<info>.*?)?<\/h2>' matches = re.compile(pattern, re.DOTALL).findall(data) - if not matches: #error + if not matches: #error logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + pattern + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.category + ': ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web. Reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos #logger.debug("patron: " + pattern) #logger.debug(matches) @@ -1676,32 +1710,32 @@ def episodios(item): for scrapedurl, scrapedthumb, info in matches: url = scrapedurl thumb = scrapedthumb - if "pelisyseries.com" in item.url: #En esta web están en diferente orden + if "pelisyseries.com" in item.url: #En esta web están en diferente orden interm = url url = thumb thumb = interm - item_local = item.clone() #Creamos copia local de Item por episodio + item_local = item.clone() #Creamos copia local de Item por episodio item_local.url = url item_local.contentThumbnail = thumb - estado = True #Buena calidad de datos por defecto + estado = True #Buena calidad de datos por defecto - if "<span" in info: # new style + if "<span" in info: # new style pattern = "[^>]+>.*?Temporada\s*(?:<span[^>]+>\[\s?)?(?P<season>\d+)?.*?Capitulo(?:s)?\s*(?:<span[^>]+>\[\s?)?(?P<episode>\d+)?(?:.*?(?P<episode2>\d+)?)<.*?<span[^>]+>(?P<lang>.*?)?<\/span>\s*Calidad\s*<span[^>]+>[\[]\s*(?P<quality>.*?)?\s*[\]]<\/span>" if not scrapertools.find_single_match(info, pattern): - if "especial" in info.lower(): # Capitulos Especiales + if "especial" in info.lower(): # Capitulos Especiales pattern = ".*?[^>]+>.*?Temporada.*?\[.*?(?P<season>\d+).*?\].*?Capitulo.*?\[\s*(?P<episode>\d+).*?\]?(?:.*?(?P<episode2>\d+)?)<.+?<span[^>]+>(?P<lang>.*?)?<\/span>\s*Calidad\s*<span[^>]+>[\[]\s*(?P<quality>.*?)?\s*[\]]<\/span>" elif "miniserie" in info.lower() or "completa" in info.lower(): # Series o miniseries completa logger.debug("patron episodioNEW - MINISERIE: " + info) info = '><strong>%sTemporada %s Capitulo 01_99</strong> - <span >Español Castellano</span> Calidad <span >[%s]</span>' % (item_local.contentSerieName, season, item_local.quality) - if not scrapertools.find_single_match(info, pattern): #en caso de error de formato, creo uno básico + if not scrapertools.find_single_match(info, pattern): #en caso de error de formato, creo uno básico logger.debug("patron episodioNEW: " + pattern) logger.debug(info) logger.debug(item_local.url) info = '><strong>%sTemporada %s Capitulo 0</strong> - <span >Español Castellano</span> Calidad <span >[%s]</span>' % (item_local.contentSerieName, season, item_local.quality) - else: # old style. Se intenta buscar un patrón que encaje con los diversos formatos antiguos. Si no, se crea + else: # old style. Se intenta buscar un patrón que encaje con los diversos formatos antiguos. Si no, se crea pattern = '\[(?P<quality>.*?)\]\[Cap.(?P<season>\d).*?(?P<episode>\d{2})(?:_(?P<season2>\d+)(?P<episode2>\d{2}))?\].*?(?P<lang>.*)?' #Patrón básico por defecto if scrapertools.find_single_match(info, '\[\d{3}\]'): @@ -1719,7 +1753,7 @@ def episodios(item): elif "completa" in info.lower(): info = info.replace("COMPLETA", "Caps. 01_99") pattern = 'Temp.*?(?P<season>\d+).*?Cap\w?\.\s\d?(?P<episode>\d{2})(?:.*?(?P<episode2>\d{2}))?.*?\[(?P<quality>.*?)\].*?\[(?P<lang>\w+)\]?' - if not scrapertools.find_single_match(info, pattern): #en caso de error de formato, creo uno básico + if not scrapertools.find_single_match(info, pattern): #en caso de error de formato, creo uno básico logger.debug(info) info = '%s - Temp.%s [Caps. 01_99][%s][Spanish]' % (item_local.contentSerieName, season, item_local.quality) if scrapertools.find_single_match(info, '\[Cap.\d{2,3}'): @@ -1729,22 +1763,22 @@ def episodios(item): pattern = ".*?Temp.*?\s(?P<quality>.*?)\s.*?Cap.(?P<season>\d).*?(?P<episode>\d{2})(?:_(?P<season2>\d+)(?P<episode2>\d{2}))?.*?\s(?P<lang>.*)?" elif scrapertools.find_single_match(info, '(?P<quality>.*?)?(?P<season>\d)[x|X|\.](?P<episode>\d{2})\s?(?:_(?P<season2>\d+)(?P<episode2>\d{2}))?.*?(?P<lang>.*)?'): pattern = "(?P<quality>.*?)?(?P<season>\d)[x|X|\.](?P<episode>\d{2})\s?(?:_(?P<season2>\d+)(?P<episode2>\d{2}))?.*?(?P<lang>.*)?" - estado = False #Mala calidad de datos - if not scrapertools.find_single_match(info, pattern): #en caso de error de formato, creo uno básico + estado = False #Mala calidad de datos + if not scrapertools.find_single_match(info, pattern): #en caso de error de formato, creo uno básico logger.debug("patron episodioOLD: " + pattern) logger.debug(info) logger.debug(item_local.url) info = '%s - Temp.%s [%s][Cap.%s00][Spanish]' % (item_local.contentSerieName, season, item_local.quality, season) - estado = False #Mala calidad de datos + estado = False #Mala calidad de datos r = re.compile(pattern) match = [m.groupdict() for m in r.finditer(info)][0] if not match: #error logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + pattern + " / DATA: " + info) itemlist.append(item.clone(action='', title=item.category + ': ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web. Reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos - if match['season'] is None: match['season'] = season #Si no se encuentran valores, pero poner lo básico + if match['season'] is None: match['season'] = season #Si no se encuentran valores, pero poner lo básico if match['episode'] is None: match['episode'] = "0" try: match['season'] = int(match['season']) @@ -1766,7 +1800,7 @@ def episodios(item): max_temp = season if match['quality'] and not item_local.quality and estado == True: - item_local.quality = match['quality'] #Si hay quality se coge, si no, la de la serie + item_local.quality = match['quality'] #Si hay quality se coge, si no, la de la serie item_local.quality = item_local.quality.replace("ALTA DEFINICION", "HDTV") if match['lang'] and (estado == False or "especia" in str(match['lang']).lower()): @@ -1775,18 +1809,18 @@ def episodios(item): item_local.infoLabels['title'] = item_local.infoLabels['episodio_titulo'] - if match['episode'] == 0: match['episode'] = 1 #Evitar errores en Videoteca + if match['episode'] == 0: match['episode'] = 1 #Evitar errores en Videoteca item_local.contentEpisodeNumber = match['episode'] - if match["episode2"]: #Hay episodio dos? es una entrada múltiple? - item_local.title = "%sx%s al %s -" % (str(match["season"]), str(match["episode"]).zfill(2), str(match["episode2"]).zfill(2)) #Creamos un título con el rango de episodios - else: #Si es un solo episodio, se formatea ya + if match["episode2"]: #Hay episodio dos? es una entrada múltiple? + item_local.title = "%sx%s al %s -" % (str(match["season"]), str(match["episode"]).zfill(2), str(match["episode2"]).zfill(2)) #Creamos un título con el rango de episodios + else: #Si es un solo episodio, se formatea ya item_local.title = "%sx%s -" % (match["season"], str(match["episode"]).zfill(2)) - if modo_ultima_temp_alt and item.library_playcounts: #Si solo se actualiza la última temporada de Videoteca + if modo_ultima_temp_alt and item.library_playcounts: #Si solo se actualiza la última temporada de Videoteca if item_local.contentSeason < max_temp: - list_pages = [] #Sale del bucle de leer páginas - break #Sale del bucle actual del FOR de episodios por página + list_pages = [] #Sale del bucle de leer páginas + break #Sale del bucle actual del FOR de episodios por página #if ('%sx%s' % (str(item_local.contentSeason), str(item_local.contentEpisodeNumber).zfill(2))) in item.library_playcounts: # continue @@ -1816,10 +1850,10 @@ def episodios(item): if len(itemlist) > 1: itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) #clasificamos - if item.season_colapse and not item.add_videolibrary: #Si viene de listado, mostramos solo Temporadas + if item.season_colapse and not item.add_videolibrary: #Si viene de listado, mostramos solo Temporadas item, itemlist = generictools.post_tmdb_seasons(item, itemlist) - if not item.season_colapse: #Si no es pantalla de Temporadas, pintamos todo + if not item.season_colapse: #Si no es pantalla de Temporadas, pintamos todo # Pasada por TMDB y clasificación de lista por temporada y episodio tmdb.set_infoLabels(itemlist, True) diff --git a/plugin.video.alfa/channels/peliculasrey.json b/plugin.video.alfa/channels/peliculasrey.json deleted file mode 100755 index bd922f63..00000000 --- a/plugin.video.alfa/channels/peliculasrey.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "id": "peliculasrey", - "name": "peliculasrey", - "active": false, - "adult": false, - "language": ["cast", "lat"], - "thumbnail": "peliculasrey.png", - "banner": "peliculasrey.png", - "categories": [ - "direct", - "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", - "label": "Incluir en Novedades - Películas", - "default": true, - "enabled": true, - "visible": true - }, - { - "id": "include_in_newest_documentales", - "type": "bool", - "label": "Incluir en Novedades - Documentales", - "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": "include_in_newest_castellano", - "type": "bool", - "label": "Incluir en Novedades - Castellano", - "default": true, - "enabled": true, - "visible": true - }, - { - "id": "include_in_newest_latino", - "type": "bool", - "label": "Incluir en Novedades - Latino", - "default": true, - "enabled": true, - "visible": true - } -] -} diff --git a/plugin.video.alfa/channels/peliculasrey.py b/plugin.video.alfa/channels/peliculasrey.py deleted file mode 100755 index 83116c4b..00000000 --- a/plugin.video.alfa/channels/peliculasrey.py +++ /dev/null @@ -1,188 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -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 - -host = "http://www.peliculasrey.com/" - -def mainlist(item): - logger.info() - - itemlist = [] - itemlist.append(Item(channel=item.channel, action="peliculas", title="Recientes", 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 filtro(item): - logger.info(item.category) - itemlist = [] - patron1 = '<section class="%s">(.*?)</section>' %item.category - patron2 = '<a href="([^"]+).*?title="([^"]+)' - data = httptools.downloadpage(host).data - data = scrapertools.find_single_match(data, patron1) - matches = scrapertools.find_multiple_matches(data, patron2) - for scrapedurl, scrapedtitle in matches: - if "Adulto" in scrapedtitle and config.get_setting("adult_mode") == 0: - continue - itemlist.append( - Item(channel=item.channel, action="peliculas", title=scrapedtitle.strip(), url=scrapedurl, - viewmode="movie")) - return itemlist - - - -def search(item, texto): - logger.info() - texto = texto.replace(" ", "+") - item.url = host + "?s=" + 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("%s" % line) - return [] - - -def peliculas(item): - logger.info() - itemlist = [] - - # Descarga la pagina - data = httptools.downloadpage(item.url).data - data = re.sub(r"\n|\r|\t|\s{2}| ", "", data) - tabla_pelis = scrapertools.find_single_match(data, - 'class="section col-17 col-main grid-125 overflow clearfix">(.*?)</div></section>') - patron = '<img src="([^"]+)" alt="([^"]+).*?href="([^"]+)' - matches = scrapertools.find_multiple_matches(data, patron) - for scrapedthumbnail, scrapedtitle, scrapedurl in matches: - year = scrapertools.find_single_match(scrapedtitle, "[0-9]{4}") - fulltitle = scrapedtitle.replace(scrapertools.find_single_match(scrapedtitle, '\([0-9]+\)' ), "") - item.infoLabels['year'] = year - itemlist.append(item.clone(channel = item.channel, - action = "findvideos", - title = scrapedtitle, - url = scrapedurl, - thumbnail = scrapedthumbnail, - plot = "", - fulltitle = fulltitle - )) - tmdb.set_infoLabels(itemlist, True) - next_page = scrapertools.find_single_match(data, 'rel="next" href="([^"]+)') - if next_page != "": - itemlist.append( - Item(channel=item.channel, action="peliculas", title=">> Página siguiente", url=next_page, folder=True, - viewmode="movie")) - - return itemlist - - -def findvideos(item): - logger.info() - itemlist = [] - encontrados = [] - data = httptools.downloadpage(item.url).data - patron = 'hand" rel="([^"]+).*?title="(.*?)".*?<span>([^<]+)</span>.*?</span><span class="q">(.*?)<' - matches = scrapertools.find_multiple_matches(data, patron) - for scrapedurl, server_name, language, quality in matches: - if scrapedurl in encontrados: - continue - encontrados.append(scrapedurl) - language = language.strip() - quality = quality.strip() - mq = "(" + quality + ")" - if "http" in quality: - quality = mq = "" - titulo = "%s (" + language + ") " + mq - itemlist.append(item.clone(channel=item.channel, - action = "play", - title = titulo, - url = scrapedurl, - folder = False, - language = language, - quality = quality - )) - tmdb.set_infoLabels(itemlist, True) - itemlist = servertools.get_servers_itemlist(itemlist, lambda i: i.title % i.server.capitalize()) - if itemlist: - itemlist.append(Item(channel=item.channel)) - itemlist.append(item.clone(channel="trailertools", title="Buscar Tráiler", action="buscartrailer", - text_color="magenta")) - # Opción "Añadir esta película a la biblioteca de KODI" - if config.get_videolibrary_support(): - itemlist.append(Item(channel=item.channel, title="Añadir pelicula a la videoteca", text_color="green", - action="add_pelicula_to_library", url=item.url, thumbnail=item.thumbnail, - fulltitle=item.fulltitle)) - return itemlist - - -def play(item): - item.thumbnail = item.contentThumbnail - return [item] - -def newest(categoria): - logger.info() - itemlist = [] - item = Item() - try: - if categoria == 'peliculas': - item.url = host - - elif categoria == 'documentales': - item.url = host + "genero/documental/" - - elif categoria == 'infantiles': - item.url = host + "genero/animacion-e-infantil/" - - elif categoria == 'terror': - item.url = host + "genero/terror/" - - elif categoria == 'castellano': - item.url = host + "idioma/castellano/" - - elif categoria == 'latino': - item.url = host + "idioma/latino/" - - itemlist = peliculas(item) - - if itemlist[-1].action == "peliculas": - itemlist.pop() - - # Se captura la excepción, para no interrumpir al canal novedades si un canal falla - except: - import sys - for line in sys.exc_info(): - logger.error("{0}".format(line)) - return [] - - return itemlist - diff --git a/plugin.video.alfa/channels/pelisplusco.py b/plugin.video.alfa/channels/pelisplusco.py index d86a139d..bf065a39 100644 --- a/plugin.video.alfa/channels/pelisplusco.py +++ b/plugin.video.alfa/channels/pelisplusco.py @@ -103,7 +103,7 @@ def sub_search(item): title = dict["title"] + " (" + dict["release_year"] + ")", url = host + dict["slug"] )) - tmdb.set_infoLabels(itemlist) + tmdb.set_infoLabels(itemlist, seekTmdb=True) return itemlist @@ -278,6 +278,7 @@ def seasons(item): for title in matches: season = title.replace('Temporada ','') infoLabels['season'] = season + title = 'Temporada %s' % season.lstrip('0') itemlist.append(Item( channel=item.channel, title=title, @@ -289,7 +290,23 @@ def seasons(item): )) tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) - return itemlist[::-1] + itemlist = itemlist[::-1] + if config.get_videolibrary_support() and len(itemlist) > 0: + itemlist.append( + Item(channel=item.channel, title='[COLOR yellow]Añadir esta serie a la videoteca[/COLOR]', url=item.url, + action="add_serie_to_library", extra="episodios", contentSerieName=item.contentSerieName)) + + return itemlist + + +def episodios(item): + logger.info() + itemlist = [] + templist = seasons(item) + for tempitem in templist: + itemlist += season_episodes(tempitem) + + return itemlist def season_episodes(item): logger.info() @@ -304,8 +321,9 @@ def season_episodes(item): for url, episode in matches: episodenumber = re.sub('C.* ','',episode) infoLabels['episode'] = episodenumber + title = '%sx%s - %s' % (infoLabels['season'], episodenumber, episode) itemlist.append(Item(channel=item.channel, - title= episode, + title= title, url = host+url, action = 'findvideos', infoLabels=infoLabels, @@ -366,15 +384,18 @@ def findvideos(item): for language in matches: video_list.extend(get_links_by_language(item, language)) - if config.get_videolibrary_support() and len(itemlist) > 0 and item.extra != 'findvideos': - itemlist.append( - Item(channel=item.channel, - title='[COLOR yellow]Añadir esta pelicula a la videoteca[/COLOR]', - url=item.url, - action="add_pelicula_to_library", - extra="findvideos", - contentTitle=item.contentTitle - )) - video_list = servertools.get_servers_itemlist(video_list, lambda i: i.title % (i.server.capitalize(), i.language,i.quality) ) + video_list = servertools.get_servers_itemlist(video_list, lambda i: i.title % (i.server.capitalize(), i.language, + i.quality) ) + if item.contentType != 'episode': + if config.get_videolibrary_support() and len(video_list) > 0 and item.extra != 'findvideos': + video_list.append( + Item(channel=item.channel, + title='[COLOR yellow]Añadir esta pelicula a la videoteca[/COLOR]', + url=item.url, + action="add_pelicula_to_library", + extra="findvideos", + contentTitle=item.contentTitle + )) + return video_list diff --git a/plugin.video.alfa/channels/plusdede.py b/plugin.video.alfa/channels/plusdede.py index 98224050..1ba599d7 100644 --- a/plugin.video.alfa/channels/plusdede.py +++ b/plugin.video.alfa/channels/plusdede.py @@ -112,11 +112,7 @@ def menuseries(item): item.fanart = fanart_host item.text_color = None - item.thumbnail = "https://s18.postimg.cc/r5cylu6rd/12_-_oi_RDsdv.png" - itemlist.append(item.clone(title="Películas", action="menupeliculas", text_color=color3, text_blod=True)) - item.thumbnail = "https://s18.postimg.cc/ruvqy6zl5/15_-_9m9_Dp1m.png" - itemlist.append(item.clone(title="Series:", folder=False, text_color=color3, text_blod=True, select=True)) itemlist.append(item.clone(action="peliculas", title=" Novedades", url="https://www.plusdede.com/series", thumbnail='https://s18.postimg.cc/in3ihji95/11_-_WPg_H5_Kx.png')) itemlist.append(item.clone(action="generos", title=" Por géneros", url="https://www.plusdede.com/series", thumbnail='https://s18.postimg.cc/p0slktaah/5_-_c_Nf_KRvm.png')) itemlist.append( @@ -133,8 +129,6 @@ def menuseries(item): itemlist.append(item.clone(action="search", title=" Buscar...", url="https://www.plusdede.com/series", thumbnaiil='https://s18.postimg.cc/s7n54ghvt/1_-_01_ZDYii.png')) itemlist.append(item.clone(title="", folder=False, thumbnail=thumbnail_host)) - itemlist.append(item.clone(title="Listas", action="menulistas", text_color=color3, text_blod=True, thumbnail='https://s18.postimg.cc/xj21p46ih/10_-_Uf7e_XHE.png')) - itemlist.append(item.clone(title="", folder=False, thumbnail=thumbnail_host)) item.thumbnail = "" itemlist.append(Item(channel=item.channel, action="settingCanal", title="Configuración...", url="", thumbnail='https://s18.postimg.cc/c9efeassp/3_-_QAHK2_Tc.png')) return itemlist @@ -149,7 +143,6 @@ def menupeliculas(item): item.text_color = None item.thumbnail = "https://s18.postimg.cc/r5cylu6rd/12_-_oi_RDsdv.png" - itemlist.append(item.clone(title="Películas:", folder=False, text_color=color3, text_blod=True, select=True)) itemlist.append(item.clone(action="peliculas", title=" Novedades", url="https://www.plusdede.com/pelis", thumbnail='https://s18.postimg.cc/in3ihji95/11_-_WPg_H5_Kx.png')) itemlist.append(item.clone(action="generos", title=" Por géneros", url="https://www.plusdede.com/pelis", thumbnail='https://s18.postimg.cc/p0slktaah/5_-_c_Nf_KRvm.png')) itemlist.append(item.clone(action="peliculas", title=" Solo HD", url="https://www.plusdede.com/pelis?quality=3", thumbnail='https://s18.postimg.cc/e17e95mfd/16_-_qmqn4_Si.png')) @@ -161,14 +154,8 @@ def menupeliculas(item): item.clone(action="peliculas", title=" Favoritas", url="https://www.plusdede.com/pelis/favorites", thumbnail='https://s18.postimg.cc/n8zmpwynd/4_-_JGrig_Ep.png')) itemlist.append(item.clone(action="peliculas", title=" Vistas", url="https://www.plusdede.com/pelis/seen", thumbnail='https://s18.postimg.cc/5vpcay0qh/17_-_M2in_Fp_O.png')) itemlist.append(item.clone(action="search", title=" Buscar...", url="https://www.plusdede.com/pelis", thumbnail='https://s18.postimg.cc/s7n54ghvt/1_-_01_ZDYii.png')) - itemlist.append(item.clone(title="", folder=False, thumbnail=thumbnail_host)) - item.thumbnail = "https://github.com/master-1970/resources/raw/master/images/genres/0/TV%20Series.png" - itemlist.append(item.clone(title="Series", action="menuseries", text_color=color3, text_blod=True, thumbnail='https://s18.postimg.cc/ruvqy6zl5/15_-_9m9_Dp1m.png')) - - itemlist.append(item.clone(title="Listas", action="menulistas", text_color=color3, text_blod=True, thumbnail='https://s18.postimg.cc/xj21p46ih/10_-_Uf7e_XHE.png')) - itemlist.append(item.clone(title="", folder=False, thumbnail=thumbnail_host)) item.thumbnail = "" itemlist.append(item.clone(channel=item.channel, action="settingCanal", title="Configuración...", url="", thumbnail='https://s18.postimg.cc/c9efeassp/3_-_QAHK2_Tc.png')) return itemlist @@ -182,14 +169,6 @@ def menulistas(item): item.fanart = fanart_host item.text_color = None - item.thumbnail = "https://s18.postimg.cc/r5cylu6rd/12_-_oi_RDsdv.png" - itemlist.append(item.clone(title="Películas", action="menupeliculas", text_color=color3, text_blod=True)) - - item.thumbnail = "https://s18.postimg.cc/ruvqy6zl5/15_-_9m9_Dp1m.png" - - itemlist.append(item.clone(title="Series", action="menuseries", text_color=color3, text_blod=True)) - - itemlist.append(item.clone(title="Listas:", folder=False, text_color=color3, text_blod=True, thumbnail='https://s18.postimg.cc/xj21p46ih/10_-_Uf7e_XHE.png')) itemlist.append( item.clone(action="listas", tipo="populares", title=" Populares", url="https://www.plusdede.com/listas", thumbnail='https://s18.postimg.cc/7aqwzrha1/8_-_3rn14_Tq.png')) itemlist.append( @@ -197,6 +176,7 @@ def menulistas(item): itemlist.append( item.clone(action="listas", tipo="tuslistas", title=" Tus Listas", url="https://www.plusdede.com/listas")) itemlist.append(item.clone(title="", folder=False, thumbnail=thumbnail_host)) + item.thumbnail = "" itemlist.append(item.clone(channel=item.channel, action="settingCanal", title="Configuración...", url="", thumbnail='https://s18.postimg.cc/c9efeassp/3_-_QAHK2_Tc.png')) return itemlist diff --git a/plugin.video.alfa/channels/seriesblanco.json b/plugin.video.alfa/channels/seriesblanco.json index 088b3c9e..d7fc140b 100644 --- a/plugin.video.alfa/channels/seriesblanco.json +++ b/plugin.video.alfa/channels/seriesblanco.json @@ -5,7 +5,7 @@ "adult": false, "language": ["cast", "lat"], "thumbnail": "https://s22.postimg.cc/nucz720sx/image.png", - "banner": "", + "banner": "seriesblanco.png", "categories": [ "tvshow", "vos" diff --git a/plugin.video.alfa/channels/seriespapaya.py b/plugin.video.alfa/channels/seriespapaya.py index d70d5db3..10a1b196 100644 --- a/plugin.video.alfa/channels/seriespapaya.py +++ b/plugin.video.alfa/channels/seriespapaya.py @@ -28,34 +28,26 @@ list_servers = ['powvideo', 'streamplay', 'filebebo', 'flashx', 'gamovideo', 'no def mainlist(item): logger.info() - autoplay.init(item.channel, list_servers, list_quality) - thumb_series = get_thumb("channels_tvshow.png") thumb_series_az = get_thumb("channels_tvshow_az.png") thumb_buscar = get_thumb("search.png") - itemlist = [] itemlist.append( Item(action="listado_alfabetico", title="Listado Alfabetico", channel=item.channel, thumbnail=thumb_series_az)) itemlist.append( Item(action="novedades", title="Capítulos de estreno", channel=item.channel, thumbnail=thumb_series)) itemlist.append(Item(action="search", title="Buscar", channel=item.channel, thumbnail=thumb_buscar)) - itemlist = filtertools.show_option(itemlist, item.channel, list_idiomas, list_quality) - autoplay.show_option(item.channel, itemlist) - return itemlist def listado_alfabetico(item): logger.info() - itemlist = [item.clone(action="series_por_letra", title="0-9")] for letra in string.ascii_uppercase: itemlist.append(item.clone(action="series_por_letra", title=letra)) - return itemlist @@ -70,7 +62,6 @@ def series_por_letra_y_grupo(item): logger.info("letra: %s - grupo: %s" % (item.letter, item.extra)) itemlist = [] url = urlparse.urljoin(HOST, "autoload_process.php") - post_request = { "group_no": item.extra, "letra": item.letter.lower() @@ -80,10 +71,6 @@ def series_por_letra_y_grupo(item): patron = '<div class=list_imagen><img src=(.*?) \/>.*?<div class=list_titulo><a href=(.*?) style=.*?inherit;>(.*?)' patron +='<.*?justify>(.*?)<.*?Año:<\/b>.*?(\d{4})<' matches = re.compile(patron, re.DOTALL).findall(data) - #series = re.findall( - # 'list_imagen.+?src="(?P<img>[^"]+).+?<div class="list_titulo"><a[^>]+href="(?P<url>[^"]+)[^>]+>(.*?)</a>', data, - # re.MULTILINE | re.DOTALL) - for img, url, name, plot, year in matches: new_item= Item( channel = item.channel, @@ -99,13 +86,10 @@ def series_por_letra_y_grupo(item): if year: tmdb.set_infoLabels_item(new_item) itemlist.append(new_item) - if len(matches) == 8: itemlist.append(item.clone(title="Siguiente >>", action="series_por_letra_y_grupo", extra=item.extra + 1)) - if item.extra > 0: itemlist.append(item.clone(title="<< Anterior", action="series_por_letra_y_grupo", extra=item.extra - 1)) - return itemlist @@ -115,77 +99,76 @@ def novedades(item): data = re.sub(r'"|\n|\r|\t| |<br>|\s{2,}', "", data) patron = 'sidebarestdiv><a title=(.*?\d+X\d+) (.*?) href=(.*?)>.*?src=(.*?)>' matches = re.compile(patron, re.DOTALL).findall(data) - itemlist = [] - for title, language,url, img in matches: language = IDIOMAS[language] itemlist.append(item.clone(action="findvideos", title=title, url=urlparse.urljoin(HOST, url), thumbnail=img, language=language)) - return itemlist def newest(categoria): logger.info("categoria: %s" % categoria) - if categoria != 'series': return [] - return novedades(Item()) + def episodios(item): logger.info("url: %s" % item.url) - + infoLabels = {} data = httptools.downloadpage(item.url).data - episodes = re.findall('visco.*?href="(?P<url>[^"]+).+?nbsp; (?P<title>.*?)</a>.+?ucapaudio.?>(?P<langs>.*?)</div>', data, re.MULTILINE | re.DOTALL) - itemlist = [] for url, title, langs in episodes: + s_e = scrapertools.get_season_and_episode(title) + infoLabels = item.infoLabels + infoLabels["season"] = s_e.split("x")[0] + infoLabels["episode"] = s_e.split("x")[1] languages = " ".join( ["[%s]" % IDIOMAS.get(lang, lang) for lang in re.findall('images/s-([^\.]+)', langs)]) filter_lang = languages.replace("[", "").replace("]", "").split(" ") itemlist.append(item.clone(action="findvideos", + infoLabels = infoLabels, + language=filter_lang, title="%s %s %s" % (item.title, title, languages), - url=urlparse.urljoin(HOST, url), - language=filter_lang + url=urlparse.urljoin(HOST, url) )) - itemlist = filtertools.get_links(itemlist, item, list_idiomas, list_quality) - - # Opción "Añadir esta serie a la videoteca de XBMC" + tmdb.set_infoLabels(itemlist, True) + # Opción "Añadir esta serie a la videoteca de KODI" if config.get_videolibrary_support() and len(itemlist) > 0: itemlist.append( item.clone(title="Añadir esta serie a la videoteca", action="add_serie_to_library", extra="episodios")) - return itemlist def search(item, texto): logger.info("texto: %s" % texto) + itemlist = [] + infoLabels = () data = httptools.downloadpage(urlparse.urljoin(HOST, "/buscar.php?term=%s" % texto)).data data_dict = jsontools.load(data) try: tvshows = data_dict["myData"] except: return [] - - return [item.clone(action="episodios", - title=show["titulo"], - show=show["titulo"], - url=urlparse.urljoin(HOST, show["urla"]), + for show in tvshows: + itemlist.append(item.clone(action="episodios", + context=filtertools.context(item, list_idiomas, list_quality), + contentSerieName=show["titulo"], thumbnail=urlparse.urljoin(HOST, show["img"]), - context=filtertools.context(item, list_idiomas, list_quality) - ) for show in tvshows] + title=show["titulo"], + url=urlparse.urljoin(HOST, show["urla"]) + )) + tmdb.set_infoLabels(itemlist) + return itemlist def findvideos(item): logger.info("url: %s" % item.url) - data = httptools.downloadpage(item.url).data - expr = 'mtos' + '.+?' + \ '<div.+?images/(?P<lang>[^\.]+)' + '.+?' + \ '<div[^>]+>\s+(?P<date>[^\s<]+)' + '.+?' + \ @@ -193,52 +176,49 @@ def findvideos(item): '<div.+?href="(?P<url>[^"]+).+?images/(?P<type>[^\.]+)' + '.+?' + \ '<div[^>]+>\s*(?P<quality>.*?)</div>' + '.+?' + \ '<div.+?<a.+?>(?P<uploader>.*?)</a>' - links = re.findall(expr, data, re.MULTILINE | re.DOTALL) - itemlist = [] - try: filtro_enlaces = config.get_setting("filterlinks", item.channel) except: filtro_enlaces = 2 - typeListStr = ["Descargar", "Ver"] - for lang, date, server, url, linkType, quality, uploader in links: linkTypeNum = 0 if linkType == "descargar" else 1 if filtro_enlaces != 2 and filtro_enlaces != linkTypeNum: continue + if server == "Thevideo": server = "thevideome" + if server == "1fichier": server = "onefichier" + if server == "Uploaded": server = "uploadedto" itemlist.append(item.clone( action="play", title="{linkType} en {server} [{lang}] [{quality}] ({uploader}: {date})".format( linkType=typeListStr[linkTypeNum], lang=IDIOMAS.get(lang, lang), date=date, - server=server.rstrip(), + server=server.rstrip().capitalize(), quality=quality, uploader=uploader), - server=server.rstrip(), + server=server.lower().rstrip(), url=urlparse.urljoin(HOST, url), language=IDIOMAS.get(lang,lang), quality=quality ) ) - # Requerido para FilterTools - itemlist = filtertools.get_links(itemlist, item, list_idiomas, list_quality) - # Requerido para AutoPlay - autoplay.start(itemlist, item) - return itemlist def play(item): logger.info("play: %s" % item.url) + itemlist = [] data = httptools.downloadpage(item.url).data - video_url = scrapertools.find_single_match(data, "location.href='([^']+)") - itemlist = servertools.find_video_items(data=video_url) + item.url = scrapertools.find_single_match(data, "location.href='([^']+)") + item.server = "" + itemlist.append(item.clone()) + itemlist = servertools.get_servers_itemlist(itemlist) + itemlist[0].thumbnail=item.contentThumbnail return itemlist diff --git a/plugin.video.alfa/channels/seriesyonkis.json b/plugin.video.alfa/channels/seriesyonkis.json index 1c9c1bb9..c1f15fd5 100755 --- a/plugin.video.alfa/channels/seriesyonkis.json +++ b/plugin.video.alfa/channels/seriesyonkis.json @@ -1,7 +1,7 @@ { "id": "seriesyonkis", "name": "Seriesyonkis", - "active": true, + "active": false, "adult": false, "language": ["cast"], "thumbnail": "seriesyonkis.png", diff --git a/plugin.video.alfa/channels/tvvip.py b/plugin.video.alfa/channels/tvvip.py index 6d9951bb..36b7ee4c 100644 --- a/plugin.video.alfa/channels/tvvip.py +++ b/plugin.video.alfa/channels/tvvip.py @@ -607,22 +607,20 @@ def findvideos(item): def play(item): logger.info() itemlist = [] - #logger.debug('item.url %s' % item.url) uri = scrapertools.find_single_match(item.url, '(/transcoder[\w\W]+)') s = scrapertools.find_single_match(item.url, r'http.*?://(.*?)\.') - #logger.debug('uri %s' % uri) - #logger.debug('s %s'% s) uri_request = host + "/video2-prod/s/uri?uri=%s&s=%s&_=%s" % (uri, s, int(time.time())) data = httptools.downloadpage(uri_request).data data = jsontools.load(data) - #logger.debug(data) if data['s'] == None: data['s'] = '' - url = item.url.replace(".tv-vip.com/transcoder/", ".%s/e/transcoder/") % (data['b']) + "?tt=" + str(data['a']['tt']) + \ + # url = item.url.replace(".tv-vip.com/transcoder/", ".%s/e/transcoder/") % (data['b']) + "?tt=" + str(data['a']['tt']) + \ + # "&mm=" + data['a']['mm'] + "&bb=" + data['a']['bb'] + url = item.url.replace(".tv-vip.com/transcoder/", ".pelisipad.com/s/transcoder/") + "?tt=" + str( + data['a']['tt']) + \ "&mm=" + data['a']['mm'] + "&bb=" + data['a']['bb'] - #logger.debug(url) - #url += "|User-Agent=Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Mobile Safari/537.36" + url += "|User-Agent=Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Mobile Safari/537.36" itemlist.append(item.clone(action="play", server="directo", url=url, folder=False)) diff --git a/plugin.video.alfa/channelselector.py b/plugin.video.alfa/channelselector.py index f7ffb190..92a8f374 100644 --- a/plugin.video.alfa/channelselector.py +++ b/plugin.video.alfa/channelselector.py @@ -52,7 +52,7 @@ def getmainlist(view="thumb_"): thumbnail=get_thumb(thumb_setting, view), category=config.get_localized_string(30100), viewmode="list")) - itemlist.append(Item(title=config.get_localized_string(30104) + " (" + config.get_localized_string(20000) +" " + config.get_addon_version() + ")", channel="help", action="mainlist", + itemlist.append(Item(title=config.get_localized_string(30104) + " (" + config.get_localized_string(20000) +" " + config.get_addon_version(with_fix=False) + ")", channel="help", action="mainlist", thumbnail=get_thumb("help.png", view), category=config.get_localized_string(30104), viewmode="list")) return itemlist @@ -170,7 +170,7 @@ def filterchannels(category, view="thumb_"): # Si tiene configuración añadimos un item en el contexto context = [] if channel_parameters["has_settings"]: - context.append({"title": "Configurar canal", "channel": "setting", "action": "channel_config", + context.append({"title": config.get_localized_string(70525), "channel": "setting", "action": "channel_config", "config": channel_parameters["channel"]}) channel_info = set_channel_info(channel_parameters) @@ -197,7 +197,7 @@ def filterchannels(category, view="thumb_"): channelslist.insert(0, Item(title=config.get_localized_string(60088), action="mainlist", channel="url", thumbnail=channel_parameters["thumbnail"], type="generic", viewmode="list")) if category in ['movie', 'tvshow']: - titles = ['Mas Populares', 'Mejor Valoradas', 'Ahora en cines', 'En Emision', 'Por Genero'] + titles = [config.get_localized_string(70028), config.get_localized_string(30985), config.get_localized_string(70527), config.get_localized_string(60264), config.get_localized_string(70528)] ids = ['popular', 'top_rated', 'now_playing', 'on_the_air'] for x in range(0,3): if x == 2 and category != 'movie': diff --git a/plugin.video.alfa/core/servertools.py b/plugin.video.alfa/core/servertools.py index ad95edb9..7b80331d 100644 --- a/plugin.video.alfa/core/servertools.py +++ b/plugin.video.alfa/core/servertools.py @@ -52,7 +52,7 @@ def find_video_items(item=None, data=None): # Busca los enlaces a los videos for label, url, server, thumbnail in findvideos(data): - title = "Enlace encontrado en %s" % label + title = config.get_localized_string(70206) % label itemlist.append( item.clone(title=title, action="play", url=url, thumbnail=thumbnail, server=server, folder=False)) @@ -154,9 +154,7 @@ def findvideos(data, skip=False): break if not devuelve and is_filter_servers: - platformtools.dialog_ok("Filtrar servidores (Lista Negra)", - "No hay enlaces disponibles que cumplan los requisitos de su Lista Negra.", - "Pruebe de nuevo modificando el fíltro en 'Configuracíon Servidores") + platformtools.dialog_ok(config.get_localized_string(60001)) return devuelve @@ -243,8 +241,8 @@ def resolve_video_urls_for_playing(server, url, video_password="", muestra_dialo if server_parameters: # Muestra un diágo de progreso if muestra_dialogo: - progreso = platformtools.dialog_progress("alfa", - "Conectando con %s" % server_parameters["name"]) + progreso = platformtools.dialog_progress(config.get_localized_string(20000), + config.get_localized_string(70180) % server_parameters["name"]) # Cuenta las opciones disponibles, para calcular el porcentaje @@ -265,7 +263,7 @@ def resolve_video_urls_for_playing(server, url, video_password="", muestra_dialo logger.info("Opciones disponibles: %s | %s" % (len(opciones), opciones)) else: logger.error("No existe conector para el servidor %s" % server) - error_messages.append("No existe conector para el servidor %s" % server) + error_messages.append(config.get_localized_string(60004) % server) muestra_dialogo = False # Importa el server @@ -310,7 +308,7 @@ def resolve_video_urls_for_playing(server, url, video_password="", muestra_dialo # Muestra el progreso if muestra_dialogo: - progreso.update((100 / len(opciones)) * opciones.index(opcion), "Conectando con %s" % server_name) + progreso.update((100 / len(opciones)) * opciones.index(opcion), config.get_localized_string(70180) % server_name) # Modo free if opcion == "free": @@ -337,10 +335,10 @@ def resolve_video_urls_for_playing(server, url, video_password="", muestra_dialo elif response and response[0][0]: error_messages.append(response[0][0]) else: - error_messages.append("Se ha producido un error en %s" % server_name) + error_messages.append(config.get_localized_string(60006) % server_name) except: logger.error("Error en el servidor: %s" % opcion) - error_messages.append("Se ha producido un error en %s" % server_name) + error_messages.append(config.get_localized_string(60006) % server_name) import traceback logger.error(traceback.format_exc()) @@ -350,18 +348,18 @@ def resolve_video_urls_for_playing(server, url, video_password="", muestra_dialo # Cerramos el progreso if muestra_dialogo: - progreso.update(100, "Proceso finalizado") + progreso.update(100, config.get_localized_string(60008)) progreso.close() # Si no hay opciones disponibles mostramos el aviso de las cuentas premium if video_exists and not opciones and server_parameters.get("premium"): listapremium = [get_server_parameters(premium)["name"] for premium in server_parameters["premium"]] error_messages.append( - "Para ver un vídeo en %s necesitas<br/>una cuenta en: %s" % (server, " o ".join(listapremium))) + config.get_localized_string(60009) % (server, " o ".join(listapremium))) # Si no tenemos urls ni mensaje de error, ponemos uno generico elif not video_urls and not error_messages: - error_messages.append("Se ha producido un error en %s" % get_server_parameters(server)["name"]) + error_messages.append(config.get_localized_string(60006) % get_server_parameters(server)["name"]) return video_urls, len(video_urls) > 0, "<br/>".join(error_messages) @@ -480,7 +478,7 @@ def get_server_parameters(server): dict_servers_parameters[server] = dict_server except: - mensaje = "Error al cargar el servidor: %s\n" % server + mensaje = config.get_localized_string(59986) % server import traceback logger.error(mensaje + traceback.format_exc()) return {} @@ -693,9 +691,9 @@ def filter_servers(servers_list): servers_list_filter = filter(lambda x: not config.get_setting("black_list", server=x), servers_list) # Si no hay enlaces despues de filtrarlos - if servers_list_filter or not platformtools.dialog_yesno("Filtrar servidores (Lista Negra)", - "Todos los enlaces disponibles pertenecen a servidores incluidos en su Lista Negra.", - "¿Desea mostrar estos enlaces?"): + if servers_list_filter or not platformtools.dialog_yesno(config.get_localized_string(60000), + config.get_localized_string(60010), + config.get_localized_string(70281)): servers_list = servers_list_filter return servers_list @@ -740,10 +738,10 @@ def check_video_link(url, server, timeout=3): video_exists, message = server_module.test_video_exists(page_url=url) if not video_exists: logger.info("[check_video_link] No existe! %s %s %s" % (message, server, url)) - resultado = "NO" + resultado = "[COLOR red][B]NO[/B][/COLOR]" else: logger.info("[check_video_link] comprobacion OK %s %s" % (server, url)) - resultado = "Ok" + resultado = "[COLOR green][B]OK[/B][/COLOR]" except: logger.info("[check_video_link] No se puede comprobar ahora! %s %s" % (server, url)) resultado = "??" diff --git a/plugin.video.alfa/core/tmdb.py b/plugin.video.alfa/core/tmdb.py index 96e9c5a3..b8c1ccb0 100644 --- a/plugin.video.alfa/core/tmdb.py +++ b/plugin.video.alfa/core/tmdb.py @@ -451,11 +451,11 @@ def find_and_set_infoLabels(item): if item.contentType == "movie": tipo_busqueda = "movie" - tipo_contenido = "pelicula" + tipo_contenido = config.get_localized_string(70283) title = item.contentTitle else: tipo_busqueda = "tv" - tipo_contenido = "serie" + tipo_contenido = config.get_localized_string(70529) title = item.contentSerieName # Si el titulo incluye el (año) se lo quitamos diff --git a/plugin.video.alfa/lib/generictools.py b/plugin.video.alfa/lib/generictools.py index 639d374d..d569c642 100644 --- a/plugin.video.alfa/lib/generictools.py +++ b/plugin.video.alfa/lib/generictools.py @@ -248,7 +248,7 @@ def post_tmdb_listado(item, itemlist): #logger.debug(item_local) 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 item_local.contentSeason = item_local.contentSeason_save @@ -268,7 +268,7 @@ def post_tmdb_listado(item, itemlist): title_add = ' ' if 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 (.*?)') continue 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 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 rating = '' try: @@ -319,6 +313,15 @@ def post_tmdb_listado(item, itemlist): if item_local.infoLabels['aired']: 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 if item_local.contentType in ['season', 'tvshow', '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})') #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)) - 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 " 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 item_local.title = item_local.title.replace("99", str(num_episodios)) 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) @@ -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. """ - logger.debug(item) + #logger.debug(item) #Creción de título general del vídeo a visualizar en Findvideos itemlist = [] @@ -900,6 +903,10 @@ def post_tmdb_findvideos(item, itemlist): item.unify = config.get_setting("unify") except: 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 num_episodios = item.contentEpisodeNumber @@ -988,20 +995,26 @@ def post_tmdb_findvideos(item, itemlist): item.category = item.channel.capitalize() #Formateamos de forma especial el título para un episodio + title = '' + title_gen = '' if item.contentType == "episode": #Series title = '%sx%s' % (str(item.contentSeason), str(item.contentEpisodeNumber).zfill(2)) #Temporada y Episodio if item.infoLabels['temporada_num_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 - if " 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+)')) + 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|Al] (\d+)')) else: 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": 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 + else: #Películas title = 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) #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 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)) #Añadimos la opción de ver trailers @@ -1171,6 +1185,7 @@ def fail_over_newpct1(item, patron, patron2=None, timeout=None): data = '' channel_failed = '' + url_alt = [] if not item.category: item.category = scrapertools.find_single_match(item.url, 'http.?\:\/\/(?:www.)?(\w+)\.\w+\/').capitalize() 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 = channel_url_failed 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 + #quitamos el código de series, porque puede variar entre webs 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... + 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 return (item, data) #nos vamos, con un nuevo clone - #Leemos la nueva url - try: - if item.post: - data = re.sub(r"\n|\r|\t|\s{2}|(<!--.*?-->)", "", httptools.downloadpage(item.url, post=item.post, timeout=timeout).data) - else: - data = re.sub(r"\n|\r|\t|\s{2}|(<!--.*?-->)", "", httptools.downloadpage(item.url, timeout=timeout).data) - except: - data = '' - if not data: #no ha habido suerte, probamos con el siguiente canal válido - logger.error("ERROR 01: " + item.action + ": La Web no responde o la URL es erronea: " + item.url) - continue + #Leemos la nueva url.. Puede haber varias alternativas a la url original + for url in url_alt: + try: + if item.post: + data = re.sub(r"\n|\r|\t|\s{2}|(<!--.*?-->)", "", httptools.downloadpage(url, post=item.post, timeout=timeout).data) + else: + data = re.sub(r"\n|\r|\t|\s{2}|(<!--.*?-->)", "", httptools.downloadpage(url, timeout=timeout).data) + data_comillas = data.replace("'", "\"") + except: + data = '' + 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 - #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 patron: - data_alt = scrapertools.find_single_match(data, patron) - if patron2 != None: - 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: " + item.url + " / Patron: " + patron) + #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 + 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: + data_alt = scrapertools.find_single_match(data, patron) + if not data_alt: + data_alt = scrapertools.find_single_match(data_comillas, patron) + if patron2 != None: + 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) data = '' continue - else: - break #por fin !!! Este canal parece que funciona - else: - logger.error("ERROR 02: " + item.action + ": Ha cambiado la estructura de la Web: " + item.url + " / Patron: " + patron) - web_intervenida(item, data) - data = '' + + if not data: #no ha habido suerte, probamos con el siguiente clone + url_alt = [] continue + else: + break - del item.extra2 #Borramos acción temporal excluyente - if not data: #Si no ha logrado encontrar nada, salimos limpiando variables + del item.extra2 #Borramos acción temporal excluyente + if not data: #Si no ha logrado encontrar nada, salimos limpiando variables if item.channel == channel_py: if item.channel_alt: item.category = item.channel_alt.capitalize() diff --git a/plugin.video.alfa/lib/unshortenit.py b/plugin.video.alfa/lib/unshortenit.py index d35555f0..7dccb562 100755 --- a/plugin.video.alfa/lib/unshortenit.py +++ b/plugin.video.alfa/lib/unshortenit.py @@ -13,7 +13,6 @@ import time import urllib from base64 import b64decode - from core import httptools from platformcode import config @@ -36,6 +35,7 @@ class UnshortenIt(object): _anonymz_regex = r'anonymz\.com' _shrink_service_regex = r'shrink-service\.it' _rapidcrypt_regex = r'rapidcrypt\.net' + _cryptmango_regex = r'cryptmango' _maxretries = 5 @@ -73,45 +73,66 @@ class UnshortenIt(object): return self._unshorten_anonymz(uri) if re.search(self._rapidcrypt_regex, domain, re.IGNORECASE): return self._unshorten_rapidcrypt(uri) + if re.search(self._cryptmango_regex, uri, re.IGNORECASE): + return self._unshorten_cryptmango(uri) return uri, 200 def unwrap_30x(self, uri, timeout=10): + def unwrap_30x(uri, timeout=10): - domain = urlsplit(uri).netloc - self._timeout = timeout + domain = urlsplit(uri).netloc + self._timeout = timeout - try: - # headers stop t.co from working so omit headers if this is a t.co link - if domain == 't.co': - r = httptools.downloadpage(uri, timeout=self._timeout) - return r.url, r.code - # p.ost.im uses meta http refresh to redirect. - if domain == 'p.ost.im': - r = httptools.downloadpage(uri, timeout=self._timeout) - uri = re.findall(r'.*url\=(.*?)\"\.*', r.data)[0] - return uri, r.code - - retries = 0 - while True: - r = httptools.downloadpage( - uri, - timeout=self._timeout, - follow_redirects=False) - if not r.sucess: - return uri, -1 - - if 'location' in r.headers and retries < self._maxretries: - r = httptools.downloadpage( - r.headers['location'], - follow_redirects=False) - uri = r.url - retries += 1 - else: + try: + # headers stop t.co from working so omit headers if this is a t.co link + if domain == 't.co': + r = httptools.downloadpage(uri, timeout=self._timeout) return r.url, r.code + # p.ost.im uses meta http refresh to redirect. + if domain == 'p.ost.im': + r = httptools.downloadpage(uri, timeout=self._timeout) + uri = re.findall(r'.*url\=(.*?)\"\.*', r.data)[0] + return uri, r.code - except Exception as e: - return uri, str(e) + retries = 0 + while True: + r = httptools.downloadpage( + uri, + timeout=self._timeout, + cookies=False, + follow_redirects=False) + if not r.sucess: + return uri, -1 + + if '4snip' not in r.url and 'location' in r.headers and retries < self._maxretries: + r = httptools.downloadpage( + r.headers['location'], + cookies=False, + follow_redirects=False) + uri = r.url + retries += 1 + else: + return r.url, r.code + + except Exception as e: + return uri, str(e) + + uri, code = unwrap_30x(uri, timeout) + + if 'vcrypt' in uri and 'fastshield' in uri: + # twince because of cookies + httptools.downloadpage( + uri, + timeout=self._timeout, + post='go=go') + r = httptools.downloadpage( + uri, + timeout=self._timeout, + post='go=go') + return r.url, r.code + + return uri, code def _clear_google_outbound_proxy(self, url): ''' @@ -428,6 +449,18 @@ class UnshortenIt(object): except Exception as e: return uri, str(e) + def _unshorten_cryptmango(self, uri): + try: + r = httptools.downloadpage(uri, timeout=self._timeout, cookies=False) + html = r.data + + uri = re.findall(r'<iframe src="([^"]+)"[^>]+>', html)[0] + + return uri, r.code + + except Exception as e: + return uri, str(e) + def unwrap_30x_only(uri, timeout=10): unshortener = UnshortenIt() diff --git a/plugin.video.alfa/platformcode/updater.py b/plugin.video.alfa/platformcode/updater.py index b5eb4df4..c6e0a900 100644 --- a/plugin.video.alfa/platformcode/updater.py +++ b/plugin.video.alfa/platformcode/updater.py @@ -72,8 +72,8 @@ def check_addon_init(): def check_addon_updates(verbose=False): logger.info() - ADDON_UPDATES_JSON = 'http://extra.alfa-addon.com/addon_updates/updates.json' - ADDON_UPDATES_ZIP = 'http://extra.alfa-addon.com/addon_updates/updates.zip' + ADDON_UPDATES_JSON = 'https://extra.alfa-addon.com/addon_updates/updates.json' + ADDON_UPDATES_ZIP = 'https://extra.alfa-addon.com/addon_updates/updates.zip' try: last_fix_json = os.path.join(config.get_runtime_path(), 'last_fix.json') # información de la versión fixeada del usuario diff --git a/plugin.video.alfa/resources/language/English/strings.po b/plugin.video.alfa/resources/language/English/strings.po index 731a105f..ee9d9859 100644 --- a/plugin.video.alfa/resources/language/English/strings.po +++ b/plugin.video.alfa/resources/language/English/strings.po @@ -846,7 +846,7 @@ msgid "Enter URL" msgstr "" msgctxt "#60089" -msgid "Enter the URL [Link to server / download]" +msgid "Enter the URL [Link to server/download]" msgstr "" msgctxt "#60090" @@ -3033,10 +3033,6 @@ msgctxt "#70079" msgid "Remove only links of " msgstr "" -msgctxt "#70080" -msgid "Do you want Alfa to auto-configure Kodi's video library?" -msgstr "" - msgctxt "#70082" msgid "Global Search" msgstr "" @@ -4787,3 +4783,35 @@ msgctxt "#70521" msgid "You can install the Trakt script below, \nonce installed and configured what \nyou see will be synchronized with your account automatically. \nDo you want to continue?" msgstr "" +msgctxt "#70522" +msgid "No filter" +msgstr "" + +msgctxt "#70523" +msgid "%s: The data was restarted" +msgstr "" + +msgctxt "#70524" +msgid " Server error, try later." +msgstr "" + +msgctxt "#70525" +msgid "Configure channel" +msgstr "" + +msgctxt "#70526" +msgid "Verification of counters of videos seen / not seen (uncheck to verify)" +msgstr "" + +msgctxt "#70527" +msgid "Now in Theatres " +msgstr "" + +msgctxt "#70528" +msgid "Movies by Genre" +msgstr "" + +msgctxt "#70529" +msgid "tv show" +msgstr "" + diff --git a/plugin.video.alfa/resources/language/Italian/strings.po b/plugin.video.alfa/resources/language/Italian/strings.po index 5184e35d..9fa6c505 100644 --- a/plugin.video.alfa/resources/language/Italian/strings.po +++ b/plugin.video.alfa/resources/language/Italian/strings.po @@ -834,8 +834,8 @@ msgid "Enter URL" msgstr "Inserisci URL" msgctxt "#60089" -msgid "Enter the URL [Link to server / download]" -msgstr "Inserire l'URL [Link a server / download]" +msgid "Enter the URL [Link to server/download]" +msgstr "Inserire l'URL [Link a server/download]" msgctxt "#60090" msgid "Enter the URL [Direct link to video]." @@ -3021,14 +3021,6 @@ msgctxt "#70079" msgid "Remove only links of " msgstr "Rimuovere solo i collegamenti di " -msgctxt "#70080" -msgid "Do you want Alfa to auto-configure Kodi's video library?" -msgstr "Vuoi che Alfa auto-configuri la videoteca di Kodi?" - -msgctxt "#70081" -msgid "If you choose 'No' you can do it later from 'Configuration > Preferences > Paths'." -msgstr "Se scegli 'No' potrai farlo in seguito da 'Configurazione > Preferenze > Percorsi'." - msgctxt "#70082" msgid "Global Search" msgstr "Ricerca Globale" @@ -4257,7 +4249,7 @@ msgstr "Dai un punteggio con un [COLOR %s]%s[/COLOR]" msgctxt "#70393" msgid "[%s]: Select the correct %s " -msgstr "[%s]: Seleziona la %s corretta" +msgstr "[%s]: Seleziona il %s corretto" msgctxt "#70394" msgid "Action" @@ -4773,5 +4765,41 @@ msgstr "AutoPlay consente di riprodurre automaticamente i collegamenti direttame msgctxt "#70521" msgid "You can install the Trakt script below, \nonce installed and configured what \nyou see will be synchronized with your account automatically. \nDo you want to continue?" -msgstr "Puoi installare lo script Trakt qui sotto, \ nuna volta installato e configurato ciò che \nvedrai verrà sincronizzato automaticamente con il tuo account. \nVuoi continuare?" +msgstr "Puoi installare lo script Trakt qui sotto, \nuna volta installato e configurato ciò che \nvedrai verrà sincronizzato automaticamente con il tuo account. \nVuoi continuare?" + +msgctxt "#70522" +msgid "No Filter" +msgstr "Non Filtrare" + +msgctxt "#70523" +msgid "No filter" +msgstr "Non filtrare" + +msgctxt "#70523" +msgid "%s: The data was restarted" +msgstr "%s: I dati sono stati riavviati" + +msgctxt "#70524" +msgid " Server error, try later." +msgstr " Errore del server, riprova più tardi." + +msgctxt "#70525" +msgid "Configure channel" +msgstr "Configura canale" + +msgctxt "#70526" +msgid "Verification of counters of videos seen / not seen (uncheck to verify)" +msgstr "Verifica dei contatori di video visti/non visti (deselezionare per verificare)" + +msgctxt "#70527" +msgid "Now in Theatres " +msgstr "Oggi in Sala" + +msgctxt "#70528" +msgid "Movies by Genre" +msgstr "Per genere" + +msgctxt "#70529" +msgid "tv show" +msgstr "serie" diff --git a/plugin.video.alfa/resources/language/Spanish (Argentina)/strings.po b/plugin.video.alfa/resources/language/Spanish (Argentina)/strings.po index f55a67a4..39798fd8 100644 --- a/plugin.video.alfa/resources/language/Spanish (Argentina)/strings.po +++ b/plugin.video.alfa/resources/language/Spanish (Argentina)/strings.po @@ -303,7 +303,7 @@ msgstr "Populares" msgctxt "#30985" msgid "Top Rated" -msgstr "Mejor valoradas" +msgstr "Mejor Valoradas" msgctxt "#30986" msgid "Search by Collection" @@ -679,7 +679,7 @@ msgstr "Sincronizacion con Trakt iniciada" msgctxt "#60046" msgid "TheMovieDB not present.\nInstall it now?" -msgstr "TheMovieDB\nNo se ha encontrado el Scraper de películas de TheMovieDB.\n¿Desea instalarlo ahora?" +msgstr "TheMovieDB\nNo se ha encontrado el proveedor de información de películas de TheMovieDB.\n¿Desea instalarlo ahora?" msgctxt "#60047" msgid "The Movie Database is not installed." @@ -687,7 +687,7 @@ msgstr "The Movie Database no instalado." msgctxt "#60048" msgid "The TVDB not present.\nInstall it now?" -msgstr "The TVDB\nNo se ha encontrado el Scraper de series de The TVDB.\n¿Desea instalarlo ahora?" +msgstr "The TVDB\nNo se ha encontrado el proveedor de información de series de The TVDB.\n¿Desea instalarlo ahora?" msgctxt "#60049" msgid "The TVDB is not installed." @@ -707,15 +707,15 @@ msgstr "Errore di impostazione LibraryPath in BD" msgctxt "#60053" msgid "Do you want to configure this scraper in italian as default option for the movies ?" -msgstr "¿Desea configurar este Scraper en español como opción por defecto para películas?" +msgstr "¿Desea configurar este proveedor de información en español como opción por defecto para películas?" msgctxt "#60054" msgid "Do you want to configure this scraper in italian as default option for the tv series ?" -msgstr "¿Desea configurar este Scraper en español como opción por defecto para series?" +msgstr "¿Desea configurar este proveedor de información en español como opción por defecto para series?" msgctxt "#60055" msgid "Error of provider configuration in BD." -msgstr "Error al configurar el scraper en la BD." +msgstr "Error al configurar el proveedor de información en la BD." msgctxt "#60056" msgid "Videolibrary %s not configured" @@ -3033,14 +3033,6 @@ msgctxt "#70079" msgid "Remove only links of " msgstr "Eliminar solo los enlaces de " -msgctxt "#70080" -msgid "Do you want Alfa to auto-configure Kodi's video library?" -msgstr "¿Desea que Alfa auto-configure la videoteca de Kodi?" - -msgctxt "#70081" -msgid "If you choose 'No' you can do it later from 'Configuration > Preferences > Paths'." -msgstr "Si pulsa 'No' podra hacerlo desde 'Configuración > Preferencia > Rutas'." - msgctxt "#70082" msgid "Global Search" msgstr "Buscador global" @@ -3091,7 +3083,7 @@ msgstr "The Movie Database" msgctxt "#70094" msgid "Select scraper for movies" -msgstr "Seleccione el scraper para las películas" +msgstr "Seleccione el proveedor de información para las películas" msgctxt "#70095" msgid "Universal Movie Scraper not present.\nInstall it now?" @@ -3143,7 +3135,7 @@ msgstr "Si pulsa 'No' podrá hacerlo desde 'Configuración > Preferencias > Ruta msgctxt "#70107" msgid "Select scraper for Tv Shows" -msgstr "Seleccione el scraper para las series" +msgstr "Seleccione el proveedor de información para las series" msgctxt "#70108" msgid "Icons Set" @@ -4778,3 +4770,35 @@ msgstr "AutoPlay permite auto reproducir los enlaces directamente, basándose en msgctxt "#70521" msgid "You can install the Trakt script below, \nonce installed and configured what \nyou see will be synchronized with your account automatically. \nDo you want to continue?" msgstr "Puedes instalar el script de Trakt a continuacíon, \nuna vez instalado y configurado lo que \veas se sincronizara con tu cuenta automaticamente. \n¿Deseas continuar?" + +msgctxt "#70522" +msgid "No filter" +msgstr "No filtrar" + +msgctxt "#70523" +msgid "%s: The data was restarted" +msgstr "%s: Los datos fueron reiniciados" + +msgctxt "#70524" +msgid " Server error, try later." +msgstr " Error de servidor, inténtelo más tarde." + +msgctxt "#70525" +msgid "Configure channel" +msgstr "Configurar canal" + +msgctxt "#70526" +msgid "Verification of counters of videos seen / not seen (uncheck to verify)" +msgstr "Verificación de los contadores de vídeos vistos/no vistos (desmarcar para verificar)" + +msgctxt "#70527" +msgid "Now in Theatres " +msgstr "Ahora en cines" + +msgctxt "#70528" +msgid "Movies by Genre" +msgstr "Por generos" + +msgctxt "#70529" +msgid "tv show" +msgstr "serie" diff --git a/plugin.video.alfa/resources/language/Spanish (Mexico)/strings.po b/plugin.video.alfa/resources/language/Spanish (Mexico)/strings.po index f55a67a4..39798fd8 100644 --- a/plugin.video.alfa/resources/language/Spanish (Mexico)/strings.po +++ b/plugin.video.alfa/resources/language/Spanish (Mexico)/strings.po @@ -303,7 +303,7 @@ msgstr "Populares" msgctxt "#30985" msgid "Top Rated" -msgstr "Mejor valoradas" +msgstr "Mejor Valoradas" msgctxt "#30986" msgid "Search by Collection" @@ -679,7 +679,7 @@ msgstr "Sincronizacion con Trakt iniciada" msgctxt "#60046" msgid "TheMovieDB not present.\nInstall it now?" -msgstr "TheMovieDB\nNo se ha encontrado el Scraper de películas de TheMovieDB.\n¿Desea instalarlo ahora?" +msgstr "TheMovieDB\nNo se ha encontrado el proveedor de información de películas de TheMovieDB.\n¿Desea instalarlo ahora?" msgctxt "#60047" msgid "The Movie Database is not installed." @@ -687,7 +687,7 @@ msgstr "The Movie Database no instalado." msgctxt "#60048" msgid "The TVDB not present.\nInstall it now?" -msgstr "The TVDB\nNo se ha encontrado el Scraper de series de The TVDB.\n¿Desea instalarlo ahora?" +msgstr "The TVDB\nNo se ha encontrado el proveedor de información de series de The TVDB.\n¿Desea instalarlo ahora?" msgctxt "#60049" msgid "The TVDB is not installed." @@ -707,15 +707,15 @@ msgstr "Errore di impostazione LibraryPath in BD" msgctxt "#60053" msgid "Do you want to configure this scraper in italian as default option for the movies ?" -msgstr "¿Desea configurar este Scraper en español como opción por defecto para películas?" +msgstr "¿Desea configurar este proveedor de información en español como opción por defecto para películas?" msgctxt "#60054" msgid "Do you want to configure this scraper in italian as default option for the tv series ?" -msgstr "¿Desea configurar este Scraper en español como opción por defecto para series?" +msgstr "¿Desea configurar este proveedor de información en español como opción por defecto para series?" msgctxt "#60055" msgid "Error of provider configuration in BD." -msgstr "Error al configurar el scraper en la BD." +msgstr "Error al configurar el proveedor de información en la BD." msgctxt "#60056" msgid "Videolibrary %s not configured" @@ -3033,14 +3033,6 @@ msgctxt "#70079" msgid "Remove only links of " msgstr "Eliminar solo los enlaces de " -msgctxt "#70080" -msgid "Do you want Alfa to auto-configure Kodi's video library?" -msgstr "¿Desea que Alfa auto-configure la videoteca de Kodi?" - -msgctxt "#70081" -msgid "If you choose 'No' you can do it later from 'Configuration > Preferences > Paths'." -msgstr "Si pulsa 'No' podra hacerlo desde 'Configuración > Preferencia > Rutas'." - msgctxt "#70082" msgid "Global Search" msgstr "Buscador global" @@ -3091,7 +3083,7 @@ msgstr "The Movie Database" msgctxt "#70094" msgid "Select scraper for movies" -msgstr "Seleccione el scraper para las películas" +msgstr "Seleccione el proveedor de información para las películas" msgctxt "#70095" msgid "Universal Movie Scraper not present.\nInstall it now?" @@ -3143,7 +3135,7 @@ msgstr "Si pulsa 'No' podrá hacerlo desde 'Configuración > Preferencias > Ruta msgctxt "#70107" msgid "Select scraper for Tv Shows" -msgstr "Seleccione el scraper para las series" +msgstr "Seleccione el proveedor de información para las series" msgctxt "#70108" msgid "Icons Set" @@ -4778,3 +4770,35 @@ msgstr "AutoPlay permite auto reproducir los enlaces directamente, basándose en msgctxt "#70521" msgid "You can install the Trakt script below, \nonce installed and configured what \nyou see will be synchronized with your account automatically. \nDo you want to continue?" msgstr "Puedes instalar el script de Trakt a continuacíon, \nuna vez instalado y configurado lo que \veas se sincronizara con tu cuenta automaticamente. \n¿Deseas continuar?" + +msgctxt "#70522" +msgid "No filter" +msgstr "No filtrar" + +msgctxt "#70523" +msgid "%s: The data was restarted" +msgstr "%s: Los datos fueron reiniciados" + +msgctxt "#70524" +msgid " Server error, try later." +msgstr " Error de servidor, inténtelo más tarde." + +msgctxt "#70525" +msgid "Configure channel" +msgstr "Configurar canal" + +msgctxt "#70526" +msgid "Verification of counters of videos seen / not seen (uncheck to verify)" +msgstr "Verificación de los contadores de vídeos vistos/no vistos (desmarcar para verificar)" + +msgctxt "#70527" +msgid "Now in Theatres " +msgstr "Ahora en cines" + +msgctxt "#70528" +msgid "Movies by Genre" +msgstr "Por generos" + +msgctxt "#70529" +msgid "tv show" +msgstr "serie" diff --git a/plugin.video.alfa/resources/language/Spanish/strings.po b/plugin.video.alfa/resources/language/Spanish/strings.po index f55a67a4..39798fd8 100644 --- a/plugin.video.alfa/resources/language/Spanish/strings.po +++ b/plugin.video.alfa/resources/language/Spanish/strings.po @@ -303,7 +303,7 @@ msgstr "Populares" msgctxt "#30985" msgid "Top Rated" -msgstr "Mejor valoradas" +msgstr "Mejor Valoradas" msgctxt "#30986" msgid "Search by Collection" @@ -679,7 +679,7 @@ msgstr "Sincronizacion con Trakt iniciada" msgctxt "#60046" msgid "TheMovieDB not present.\nInstall it now?" -msgstr "TheMovieDB\nNo se ha encontrado el Scraper de películas de TheMovieDB.\n¿Desea instalarlo ahora?" +msgstr "TheMovieDB\nNo se ha encontrado el proveedor de información de películas de TheMovieDB.\n¿Desea instalarlo ahora?" msgctxt "#60047" msgid "The Movie Database is not installed." @@ -687,7 +687,7 @@ msgstr "The Movie Database no instalado." msgctxt "#60048" msgid "The TVDB not present.\nInstall it now?" -msgstr "The TVDB\nNo se ha encontrado el Scraper de series de The TVDB.\n¿Desea instalarlo ahora?" +msgstr "The TVDB\nNo se ha encontrado el proveedor de información de series de The TVDB.\n¿Desea instalarlo ahora?" msgctxt "#60049" msgid "The TVDB is not installed." @@ -707,15 +707,15 @@ msgstr "Errore di impostazione LibraryPath in BD" msgctxt "#60053" msgid "Do you want to configure this scraper in italian as default option for the movies ?" -msgstr "¿Desea configurar este Scraper en español como opción por defecto para películas?" +msgstr "¿Desea configurar este proveedor de información en español como opción por defecto para películas?" msgctxt "#60054" msgid "Do you want to configure this scraper in italian as default option for the tv series ?" -msgstr "¿Desea configurar este Scraper en español como opción por defecto para series?" +msgstr "¿Desea configurar este proveedor de información en español como opción por defecto para series?" msgctxt "#60055" msgid "Error of provider configuration in BD." -msgstr "Error al configurar el scraper en la BD." +msgstr "Error al configurar el proveedor de información en la BD." msgctxt "#60056" msgid "Videolibrary %s not configured" @@ -3033,14 +3033,6 @@ msgctxt "#70079" msgid "Remove only links of " msgstr "Eliminar solo los enlaces de " -msgctxt "#70080" -msgid "Do you want Alfa to auto-configure Kodi's video library?" -msgstr "¿Desea que Alfa auto-configure la videoteca de Kodi?" - -msgctxt "#70081" -msgid "If you choose 'No' you can do it later from 'Configuration > Preferences > Paths'." -msgstr "Si pulsa 'No' podra hacerlo desde 'Configuración > Preferencia > Rutas'." - msgctxt "#70082" msgid "Global Search" msgstr "Buscador global" @@ -3091,7 +3083,7 @@ msgstr "The Movie Database" msgctxt "#70094" msgid "Select scraper for movies" -msgstr "Seleccione el scraper para las películas" +msgstr "Seleccione el proveedor de información para las películas" msgctxt "#70095" msgid "Universal Movie Scraper not present.\nInstall it now?" @@ -3143,7 +3135,7 @@ msgstr "Si pulsa 'No' podrá hacerlo desde 'Configuración > Preferencias > Ruta msgctxt "#70107" msgid "Select scraper for Tv Shows" -msgstr "Seleccione el scraper para las series" +msgstr "Seleccione el proveedor de información para las series" msgctxt "#70108" msgid "Icons Set" @@ -4778,3 +4770,35 @@ msgstr "AutoPlay permite auto reproducir los enlaces directamente, basándose en msgctxt "#70521" msgid "You can install the Trakt script below, \nonce installed and configured what \nyou see will be synchronized with your account automatically. \nDo you want to continue?" msgstr "Puedes instalar el script de Trakt a continuacíon, \nuna vez instalado y configurado lo que \veas se sincronizara con tu cuenta automaticamente. \n¿Deseas continuar?" + +msgctxt "#70522" +msgid "No filter" +msgstr "No filtrar" + +msgctxt "#70523" +msgid "%s: The data was restarted" +msgstr "%s: Los datos fueron reiniciados" + +msgctxt "#70524" +msgid " Server error, try later." +msgstr " Error de servidor, inténtelo más tarde." + +msgctxt "#70525" +msgid "Configure channel" +msgstr "Configurar canal" + +msgctxt "#70526" +msgid "Verification of counters of videos seen / not seen (uncheck to verify)" +msgstr "Verificación de los contadores de vídeos vistos/no vistos (desmarcar para verificar)" + +msgctxt "#70527" +msgid "Now in Theatres " +msgstr "Ahora en cines" + +msgctxt "#70528" +msgid "Movies by Genre" +msgstr "Por generos" + +msgctxt "#70529" +msgid "tv show" +msgstr "serie" diff --git a/plugin.video.alfa/resources/media/channels/banner/bajui.png b/plugin.video.alfa/resources/media/channels/banner/bajui.png deleted file mode 100755 index e4bcc1fb..00000000 Binary files a/plugin.video.alfa/resources/media/channels/banner/bajui.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/banner/bityouth.png b/plugin.video.alfa/resources/media/channels/banner/bityouth.png deleted file mode 100755 index 6679f056..00000000 Binary files a/plugin.video.alfa/resources/media/channels/banner/bityouth.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/banner/bricocine.png b/plugin.video.alfa/resources/media/channels/banner/bricocine.png deleted file mode 100755 index 94a5f408..00000000 Binary files a/plugin.video.alfa/resources/media/channels/banner/bricocine.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/banner/crimenes.png b/plugin.video.alfa/resources/media/channels/banner/crimenes.png deleted file mode 100755 index fb152c75..00000000 Binary files a/plugin.video.alfa/resources/media/channels/banner/crimenes.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/banner/divxatope.png b/plugin.video.alfa/resources/media/channels/banner/divxatope.png deleted file mode 100755 index a3d8c445..00000000 Binary files a/plugin.video.alfa/resources/media/channels/banner/divxatope.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/banner/documaniatv.png b/plugin.video.alfa/resources/media/channels/banner/documaniatv.png deleted file mode 100755 index e10c2b41..00000000 Binary files a/plugin.video.alfa/resources/media/channels/banner/documaniatv.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/banner/doramastv.png b/plugin.video.alfa/resources/media/channels/banner/doramastv.png deleted file mode 100755 index 4758ab6a..00000000 Binary files a/plugin.video.alfa/resources/media/channels/banner/doramastv.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/banner/elsenordelanillo.png b/plugin.video.alfa/resources/media/channels/banner/elsenordelanillo.png deleted file mode 100755 index 6f9073fe..00000000 Binary files a/plugin.video.alfa/resources/media/channels/banner/elsenordelanillo.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/banner/guaridavalencianista.png b/plugin.video.alfa/resources/media/channels/banner/guaridavalencianista.png deleted file mode 100755 index 73d2bfba..00000000 Binary files a/plugin.video.alfa/resources/media/channels/banner/guaridavalencianista.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/banner/mocosoftx.png b/plugin.video.alfa/resources/media/channels/banner/mocosoftx.png deleted file mode 100755 index 9f98d080..00000000 Binary files a/plugin.video.alfa/resources/media/channels/banner/mocosoftx.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/banner/pasateatorrent.png b/plugin.video.alfa/resources/media/channels/banner/pasateatorrent.png deleted file mode 100755 index 79ec5091..00000000 Binary files a/plugin.video.alfa/resources/media/channels/banner/pasateatorrent.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/banner/peliculasnu.png b/plugin.video.alfa/resources/media/channels/banner/peliculasnu.png deleted file mode 100755 index 926bff71..00000000 Binary files a/plugin.video.alfa/resources/media/channels/banner/peliculasnu.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/banner/pelis24.png b/plugin.video.alfa/resources/media/channels/banner/pelis24.png deleted file mode 100755 index c3178eb9..00000000 Binary files a/plugin.video.alfa/resources/media/channels/banner/pelis24.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/banner/pelisadicto.png b/plugin.video.alfa/resources/media/channels/banner/pelisadicto.png deleted file mode 100755 index eec17aa8..00000000 Binary files a/plugin.video.alfa/resources/media/channels/banner/pelisadicto.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/banner/peliscity.png b/plugin.video.alfa/resources/media/channels/banner/peliscity.png deleted file mode 100755 index 38800dd8..00000000 Binary files a/plugin.video.alfa/resources/media/channels/banner/peliscity.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/banner/pelisdanko.png b/plugin.video.alfa/resources/media/channels/banner/pelisdanko.png deleted file mode 100755 index a85a9425..00000000 Binary files a/plugin.video.alfa/resources/media/channels/banner/pelisdanko.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/banner/quierodibujosanimados.png b/plugin.video.alfa/resources/media/channels/banner/quierodibujosanimados.png deleted file mode 100755 index 34bdf697..00000000 Binary files a/plugin.video.alfa/resources/media/channels/banner/quierodibujosanimados.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/banner/repelis.png b/plugin.video.alfa/resources/media/channels/banner/repelis.png deleted file mode 100755 index cf8895ac..00000000 Binary files a/plugin.video.alfa/resources/media/channels/banner/repelis.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/banner/seriesadicto.png b/plugin.video.alfa/resources/media/channels/banner/seriesadicto.png deleted file mode 100755 index 930236d7..00000000 Binary files a/plugin.video.alfa/resources/media/channels/banner/seriesadicto.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/banner/teledocumentales.png b/plugin.video.alfa/resources/media/channels/banner/teledocumentales.png deleted file mode 100755 index fead79d6..00000000 Binary files a/plugin.video.alfa/resources/media/channels/banner/teledocumentales.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/banner/torrentlocura.png b/plugin.video.alfa/resources/media/channels/banner/torrentlocura.png deleted file mode 100755 index 7edec687..00000000 Binary files a/plugin.video.alfa/resources/media/channels/banner/torrentlocura.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/banner/torrentrapid.png b/plugin.video.alfa/resources/media/channels/banner/torrentrapid.png deleted file mode 100644 index aa70b89d..00000000 Binary files a/plugin.video.alfa/resources/media/channels/banner/torrentrapid.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/banner/tumejortorrent.png b/plugin.video.alfa/resources/media/channels/banner/tumejortorrent.png deleted file mode 100644 index 1910766d..00000000 Binary files a/plugin.video.alfa/resources/media/channels/banner/tumejortorrent.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/banner/unsoloclic.png b/plugin.video.alfa/resources/media/channels/banner/unsoloclic.png deleted file mode 100755 index 84d54ec5..00000000 Binary files a/plugin.video.alfa/resources/media/channels/banner/unsoloclic.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/banner/verseriesynovelas.png b/plugin.video.alfa/resources/media/channels/banner/verseriesynovelas.png deleted file mode 100755 index 1980202d..00000000 Binary files a/plugin.video.alfa/resources/media/channels/banner/verseriesynovelas.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/banner/vertelenovelas.png b/plugin.video.alfa/resources/media/channels/banner/vertelenovelas.png deleted file mode 100755 index ede990e9..00000000 Binary files a/plugin.video.alfa/resources/media/channels/banner/vertelenovelas.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/banner/vixto.png b/plugin.video.alfa/resources/media/channels/banner/vixto.png deleted file mode 100755 index f60caf65..00000000 Binary files a/plugin.video.alfa/resources/media/channels/banner/vixto.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/banner/vseries.png b/plugin.video.alfa/resources/media/channels/banner/vseries.png deleted file mode 100755 index 0667279f..00000000 Binary files a/plugin.video.alfa/resources/media/channels/banner/vseries.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/banner/yaske.png b/plugin.video.alfa/resources/media/channels/banner/yaske.png deleted file mode 100755 index ca40bb78..00000000 Binary files a/plugin.video.alfa/resources/media/channels/banner/yaske.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/fanart/altorrent.jpg b/plugin.video.alfa/resources/media/channels/fanart/altorrent.jpg deleted file mode 100644 index b0759e2f..00000000 Binary files a/plugin.video.alfa/resources/media/channels/fanart/altorrent.jpg and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/fanart/bajui.png b/plugin.video.alfa/resources/media/channels/fanart/bajui.png deleted file mode 100755 index 999e9188..00000000 Binary files a/plugin.video.alfa/resources/media/channels/fanart/bajui.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/fanart/divxatope.jpg b/plugin.video.alfa/resources/media/channels/fanart/divxatope.jpg deleted file mode 100755 index d7e9d3c2..00000000 Binary files a/plugin.video.alfa/resources/media/channels/fanart/divxatope.jpg and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/fanart/quierodibujosanimados.jpg b/plugin.video.alfa/resources/media/channels/fanart/quierodibujosanimados.jpg deleted file mode 100755 index 5372f7f3..00000000 Binary files a/plugin.video.alfa/resources/media/channels/fanart/quierodibujosanimados.jpg and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/thumb/altorrent.png b/plugin.video.alfa/resources/media/channels/thumb/altorrent.png deleted file mode 100644 index ad5cdb5f..00000000 Binary files a/plugin.video.alfa/resources/media/channels/thumb/altorrent.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/thumb/bajui.png b/plugin.video.alfa/resources/media/channels/thumb/bajui.png deleted file mode 100755 index 0c1c89db..00000000 Binary files a/plugin.video.alfa/resources/media/channels/thumb/bajui.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/thumb/crimenes.png b/plugin.video.alfa/resources/media/channels/thumb/crimenes.png deleted file mode 100755 index e69eff1e..00000000 Binary files a/plugin.video.alfa/resources/media/channels/thumb/crimenes.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/thumb/divxatope.png b/plugin.video.alfa/resources/media/channels/thumb/divxatope.png deleted file mode 100755 index c3cc57e3..00000000 Binary files a/plugin.video.alfa/resources/media/channels/thumb/divxatope.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/thumb/doramastv.png b/plugin.video.alfa/resources/media/channels/thumb/doramastv.png deleted file mode 100755 index 4178a98c..00000000 Binary files a/plugin.video.alfa/resources/media/channels/thumb/doramastv.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/thumb/elsenordelanillo.png b/plugin.video.alfa/resources/media/channels/thumb/elsenordelanillo.png deleted file mode 100755 index 375e089b..00000000 Binary files a/plugin.video.alfa/resources/media/channels/thumb/elsenordelanillo.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/thumb/guaridavalencianista.png b/plugin.video.alfa/resources/media/channels/thumb/guaridavalencianista.png deleted file mode 100755 index 48296a40..00000000 Binary files a/plugin.video.alfa/resources/media/channels/thumb/guaridavalencianista.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/thumb/pelis24.png b/plugin.video.alfa/resources/media/channels/thumb/pelis24.png deleted file mode 100755 index d93b778e..00000000 Binary files a/plugin.video.alfa/resources/media/channels/thumb/pelis24.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/thumb/pelisdanko.png b/plugin.video.alfa/resources/media/channels/thumb/pelisdanko.png deleted file mode 100755 index 764fd831..00000000 Binary files a/plugin.video.alfa/resources/media/channels/thumb/pelisdanko.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/thumb/quierodibujosanimados.png b/plugin.video.alfa/resources/media/channels/thumb/quierodibujosanimados.png deleted file mode 100755 index 8616a66d..00000000 Binary files a/plugin.video.alfa/resources/media/channels/thumb/quierodibujosanimados.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/thumb/repelis.png b/plugin.video.alfa/resources/media/channels/thumb/repelis.png deleted file mode 100755 index edb4019a..00000000 Binary files a/plugin.video.alfa/resources/media/channels/thumb/repelis.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/thumb/seriesadicto.png b/plugin.video.alfa/resources/media/channels/thumb/seriesadicto.png deleted file mode 100755 index ef42b388..00000000 Binary files a/plugin.video.alfa/resources/media/channels/thumb/seriesadicto.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/thumb/teledocumentales.png b/plugin.video.alfa/resources/media/channels/thumb/teledocumentales.png deleted file mode 100755 index 992c8dad..00000000 Binary files a/plugin.video.alfa/resources/media/channels/thumb/teledocumentales.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/thumb/unsoloclic.png b/plugin.video.alfa/resources/media/channels/thumb/unsoloclic.png deleted file mode 100755 index a48d441d..00000000 Binary files a/plugin.video.alfa/resources/media/channels/thumb/unsoloclic.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/thumb/vertelenovelas.png b/plugin.video.alfa/resources/media/channels/thumb/vertelenovelas.png deleted file mode 100755 index 96915028..00000000 Binary files a/plugin.video.alfa/resources/media/channels/thumb/vertelenovelas.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/thumb/vseries.png b/plugin.video.alfa/resources/media/channels/thumb/vseries.png deleted file mode 100755 index e6201069..00000000 Binary files a/plugin.video.alfa/resources/media/channels/thumb/vseries.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/thumb/yaske.png b/plugin.video.alfa/resources/media/channels/thumb/yaske.png deleted file mode 100755 index 601610c0..00000000 Binary files a/plugin.video.alfa/resources/media/channels/thumb/yaske.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/servers/server_allmyvideos.png b/plugin.video.alfa/resources/media/servers/server_allmyvideos.png deleted file mode 100755 index 52578a08..00000000 Binary files a/plugin.video.alfa/resources/media/servers/server_allmyvideos.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/servers/server_divxstage.png b/plugin.video.alfa/resources/media/servers/server_divxstage.png deleted file mode 100755 index 3d508231..00000000 Binary files a/plugin.video.alfa/resources/media/servers/server_divxstage.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/servers/server_idowatch.png b/plugin.video.alfa/resources/media/servers/server_idowatch.png deleted file mode 100755 index 20192c4c..00000000 Binary files a/plugin.video.alfa/resources/media/servers/server_idowatch.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/servers/server_nowdownload.png b/plugin.video.alfa/resources/media/servers/server_nowdownload.png deleted file mode 100755 index 3c4220fd..00000000 Binary files a/plugin.video.alfa/resources/media/servers/server_nowdownload.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/servers/server_streaminto.png b/plugin.video.alfa/resources/media/servers/server_streaminto.png deleted file mode 100755 index a1be1155..00000000 Binary files a/plugin.video.alfa/resources/media/servers/server_streaminto.png and /dev/null differ diff --git a/plugin.video.alfa/servers/auroravid.json b/plugin.video.alfa/servers/auroravid.json deleted file mode 100755 index 4966911a..00000000 --- a/plugin.video.alfa/servers/auroravid.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "active": true, - "find_videos": { - "ignore_urls": [], - "patterns": [ - { - "pattern": "(?:embed.|)auroravid.to/(?:video/|embed/\\?v=)([A-z0-9]{13})", - "url": "http://www.auroravid.to/embed/?v=\\1" - } - ] - }, - "free": true, - "id": "auroravid", - "name": "auroravid", - "settings": [ - { - "default": false, - "enabled": true, - "id": "black_list", - "label": "@60654", - "type": "bool", - "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false - } - ] -} \ No newline at end of file diff --git a/plugin.video.alfa/servers/auroravid.py b/plugin.video.alfa/servers/auroravid.py deleted file mode 100755 index db22d30f..00000000 --- a/plugin.video.alfa/servers/auroravid.py +++ /dev/null @@ -1,43 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from core import httptools -from core import scrapertools -from platformcode import logger - - -def test_video_exists(page_url): - logger.info("(page_url='%s')" % page_url) - - data = httptools.downloadpage(page_url).data - - if "This file no longer exists on our servers" in data: - return False, "[Auroravid] El fichero ha sido borrado" - - elif "is being converted" in data: - return False, "[Auroravid] El fichero está en proceso todavía" - - return True, "" - - -def get_video_url(page_url, premium=False, user="", password="", video_password=""): - logger.info("(page_url='%s')" % page_url) - data = httptools.downloadpage(page_url).data - - video_urls = [] - videourls = scrapertools.find_multiple_matches(data, 'src\s*:\s*[\'"]([^\'"]+)[\'"]') - if not videourls: - videourls = scrapertools.find_multiple_matches(data, '<source src=[\'"]([^\'"]+)[\'"]') - for videourl in videourls: - if videourl.endswith(".mpd"): - id = scrapertools.find_single_match(videourl, '/dash/(.*?)/') - videourl = "http://www.auroravid.to/download.php%3Ffile=mm" + "%s.mp4" % id - - videourl = re.sub(r'/dl(\d)*/', '/dl/', videourl) - ext = scrapertools.get_filename_from_url(videourl)[-4:] - videourl = videourl.replace("%3F", "?") + \ - "|User-Agent=Mozilla/5.0 (Windows NT 10.0; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0" - video_urls.append([ext + " [auroravid]", videourl]) - - return video_urls diff --git a/plugin.video.alfa/servers/backin.json b/plugin.video.alfa/servers/backin.json deleted file mode 100755 index 6f634ee9..00000000 --- a/plugin.video.alfa/servers/backin.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "active": true, - "find_videos": { - "ignore_urls": [], - "patterns": [ - { - "pattern": "(?:backin).net/([A-Z0-9]+)", - "url": "http://backin.net/s/generating.php?code=\\1" - } - ] - }, - "free": true, - "id": "backin", - "name": "backin", - "settings": [ - { - "default": false, - "enabled": true, - "id": "black_list", - "label": "@60654", - "type": "bool", - "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false - } - ] -} \ No newline at end of file diff --git a/plugin.video.alfa/servers/backin.py b/plugin.video.alfa/servers/backin.py deleted file mode 100755 index 1f3ce37d..00000000 --- a/plugin.video.alfa/servers/backin.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- coding: utf-8 -*- - -from core import scrapertools -from platformcode import logger - - -def test_video_exists(page_url): - logger.info("(page_url='%s')" % page_url) - - data = scrapertools.cache_page(page_url) - - # if '<meta property="og:title" content=""/>' in data: - # return False,"The video has been cancelled from Backin.net" - - return True, "" - - -def get_video_url(page_url, premium=False, user="", password="", video_password=""): - logger.info("url=" + page_url) - video_urls = [] - headers = [] - headers.append(["User-Agent", - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17"]) - - # First access - data = scrapertools.cache_page(page_url, headers=headers) - logger.info("data=" + data) - - # URL - url = scrapertools.find_single_match(data, 'type="video/mp4" src="([^"]+)"') - logger.info("url=" + url) - - # URL del vídeo - video_urls.append([".mp4" + " [backin]", url]) - - for video_url in video_urls: - logger.info("%s - %s" % (video_url[0], video_url[1])) - - return video_urls diff --git a/plugin.video.alfa/servers/bigfile.json b/plugin.video.alfa/servers/bigfile.json deleted file mode 100755 index a06452f0..00000000 --- a/plugin.video.alfa/servers/bigfile.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "active": true, - "find_videos": { - "ignore_urls": [], - "patterns": [ - { - "pattern": "bigfile.to/((?:list|file)/[\\w]+)", - "url": "https://www.bigfile.to/\\1" - } - ] - }, - "free": false, - "id": "bigfile", - "name": "bigfile", - "premium": [ - "realdebrid" - ], - "settings": [ - { - "default": false, - "enabled": true, - "id": "black_list", - "label": "@60654", - "type": "bool", - "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false - } - ] -} \ No newline at end of file diff --git a/plugin.video.alfa/servers/bigfile.py b/plugin.video.alfa/servers/bigfile.py deleted file mode 100755 index dbc147ea..00000000 --- a/plugin.video.alfa/servers/bigfile.py +++ /dev/null @@ -1,15 +0,0 @@ -# -*- coding: utf-8 -*- - -from platformcode import logger - - -def test_video_exists(page_url): - logger.info("(page_url='%s')" % page_url) - - return True, "" - - -def get_video_url(page_url, premium=False, user="", password="", video_password=""): - logger.info("(page_url='%s')" % page_url) - video_urls = [] - return video_urls diff --git a/plugin.video.alfa/servers/clipwatching.py b/plugin.video.alfa/servers/clipwatching.py index a79cf63b..839c7290 100644 --- a/plugin.video.alfa/servers/clipwatching.py +++ b/plugin.video.alfa/servers/clipwatching.py @@ -2,15 +2,15 @@ from core import httptools from core import scrapertools -from platformcode import logger from lib import jsunpack +from platformcode import logger, config def test_video_exists(page_url): logger.info("(page_url='%s')" % page_url) data = httptools.downloadpage(page_url).data - if "File Not Found" in data or "File was deleted" in data: - return False, "[clipwatching] El video ha sido borrado" + if "File Not Found" in data: + return False, config.get_localized_string(70292) % "ClipWatching" return True, "" @@ -23,6 +23,6 @@ def get_video_url(page_url, user="", password="", video_password=""): videos = scrapertools.find_multiple_matches(unpacked, 'file:"([^"]+).*?label:"([^"]+)') for video, label in videos: video_urls.append([label + " [clipwatching]", video]) - logger.info("Url: %s" %videos) + logger.info("Url: %s" % videos) video_urls.sort(key=lambda it: int(it[0].split("p ", 1)[0])) return video_urls diff --git a/plugin.video.alfa/servers/datoporn.py b/plugin.video.alfa/servers/datoporn.py index e5b98efd..47f04015 100755 --- a/plugin.video.alfa/servers/datoporn.py +++ b/plugin.video.alfa/servers/datoporn.py @@ -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:"([^"]+)"') if not media_urls: 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:"([^"]+)"') # Extrae la URL @@ -41,6 +44,9 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= sorted(calidades) 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: video_urls.insert(0, [".m3u8 %s [datoporn]" % calidades[-1], m3u8]) diff --git a/plugin.video.alfa/servers/flashx.json b/plugin.video.alfa/servers/flashx.json index a43573b3..c4a806f9 100644 --- a/plugin.video.alfa/servers/flashx.json +++ b/plugin.video.alfa/servers/flashx.json @@ -4,12 +4,12 @@ "ignore_urls": [], "patterns": [ { - "pattern": "flashx.(?:tv|pw|ws|sx|to)/(?:embed.php\\?c=|embed-|playvid-|)([A-z0-9]+)", - "url": "https://www.flashx.tv/\\1.html" + "pattern": "flashx.co/([A-z0-9]+)\\.jsp", + "url": "https://www.flashx.co/\\1.jsp" }, { - "pattern": "flashx.co/([A-z0-9]+).jsp", - "url": "https://www.flashx.to/\\1.jsp" + "pattern": "flashx.(?:tv|pw|ws|sx|to)/(?:embed.php\\?c=|embed-|playvid-|)([A-z0-9]+)", + "url": "https://www.flashx.tv/\\1.html" } ] }, diff --git a/plugin.video.alfa/servers/flashx.py b/plugin.video.alfa/servers/flashx.py index d752b14b..39eb5a0f 100644 --- a/plugin.video.alfa/servers/flashx.py +++ b/plugin.video.alfa/servers/flashx.py @@ -4,8 +4,7 @@ import os import time import urllib -from core import httptools -from core import scrapertools +from core import httptools, scrapertools from lib import jsunpack from platformcode import config, logger @@ -13,30 +12,37 @@ from platformcode import config, logger def test_video_exists(page_url): logger.info("(page_url='%s')" % page_url) + data = httptools.downloadpage(page_url, cookies=False).data + if 'file was deleted' in data: + return False, config.get_localized_string(70292) % "FlashX" + elif 'Video is processing now' in data: + return False, config.get_localized_string(70293) % "FlashX" + return True, "" def get_video_url(page_url, premium=False, user="", password="", video_password=""): - domain_fx = "(?:co|tv)" logger.info("url=" + page_url) pfxfx = "" data = httptools.downloadpage(page_url, cookies=False).data - data = data.replace("\n","") - cgi_counter = scrapertools.find_single_match(data, """(?is)src=.(https://www.flashx.%s/counter.cgi.*?[^(?:'|")]+)""" %domain_fx) - cgi_counter = cgi_counter.replace("%0A","").replace("%22","") - playnow = scrapertools.find_single_match(data, 'https://www.flashx.%s/dl[^"]+' %domain_fx) + data = data.replace("\n", "") + cgi_counter = scrapertools.find_single_match(data, + """(?is)src=.(https://www.flashx.../counter.cgi.*?[^(?:'|")]+)""") + cgi_counter = cgi_counter.replace("%0A", "").replace("%22", "") + playnow = scrapertools.find_single_match(data, 'https://www.flashx.../dl[^"]+') # Para obtener el f y el fxfx - js_fxfx = "https://www." + scrapertools.find_single_match(data.replace("//","/"), """(?is)(flashx.%s/js\w+/c\w+.*?[^(?:'|")]+)""" %domain_fx) + js_fxfx = "https://www." + scrapertools.find_single_match(data.replace("//", "/"), + """(?is)(flashx.../js\w+/c\w+.*?[^(?:'|")]+)""") data_fxfx = httptools.downloadpage(js_fxfx).data - mfxfx = scrapertools.find_single_match(data_fxfx, 'get.*?({.*?})').replace("'","").replace(" ","") + mfxfx = scrapertools.find_single_match(data_fxfx, 'get.*?({.*?})').replace("'", "").replace(" ", "") matches = scrapertools.find_multiple_matches(mfxfx, '(\w+):(\w+)') for f, v in matches: pfxfx += f + "=" + v + "&" - logger.info("mfxfxfx1= %s" %js_fxfx) - logger.info("mfxfxfx2= %s" %pfxfx) + logger.info("mfxfxfx1= %s" % js_fxfx) + logger.info("mfxfxfx2= %s" % pfxfx) if pfxfx == "": - pfxfx = "ss=yes&f=fail&fxfx=6" - coding_url = 'https://www.flashx.co/flashx.php?%s' %(pfxfx) + pfxfx = "f=fail&fxfx=6" + coding_url = 'https://www.flashx.co/flashx.php?%s' % pfxfx # {f: 'y', fxfx: '6'} bloque = scrapertools.find_single_match(data, '(?s)Form method="POST" action(.*?)span') flashx_id = scrapertools.find_single_match(bloque, 'name="id" value="([^"]+)"') @@ -67,7 +73,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= # LICENSE GPL3, de alfa-addon: https://github.com/alfa-addon/ ES OBLIGATORIO AÑADIR ESTAS LÍNEAS except: pass - + matches = scrapertools.find_multiple_matches(data, "(eval\(function\(p,a,c,k.*?)\s+</script>") video_urls = [] for match in matches: @@ -97,3 +103,4 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= pass return video_urls + diff --git a/plugin.video.alfa/servers/powvideo.json b/plugin.video.alfa/servers/powvideo.json index 9d056ace..b7670faf 100755 --- a/plugin.video.alfa/servers/powvideo.json +++ b/plugin.video.alfa/servers/powvideo.json @@ -4,7 +4,7 @@ "ignore_urls": [], "patterns": [ { - "pattern": "powvideo.(?:net|xyz)/(?:embed-|iframe-|preview-|)([a-z0-9]+)", + "pattern": "powvideo.(?:net|xyz|cc)/(?:embed-|iframe-|preview-|)([a-z0-9]+)", "url": "http://powvideo.net/iframe-\\1-954x562.html" } ] diff --git a/plugin.video.alfa/servers/rapidvideo.py b/plugin.video.alfa/servers/rapidvideo.py index d6705262..1b80d819 100755 --- a/plugin.video.alfa/servers/rapidvideo.py +++ b/plugin.video.alfa/servers/rapidvideo.py @@ -2,7 +2,7 @@ from core import httptools from core import scrapertools -from platformcode import logger +from platformcode import config, logger def test_video_exists(page_url): @@ -13,20 +13,20 @@ def test_video_exists(page_url): pass if response.code == 404: - return False, "[Rapidvideo] El archivo no existe ó ha sido borrado" + return False, config.get_localized_string(70449) % "RapidVideo" if not response.data or "urlopen error [Errno 1]" in str(response.code): from platformcode import config if config.is_xbmc(): - return False, "[Rapidvideo] Este conector solo funciona a partir de Kodi 17" + return False, config.get_localized_string(70302) % "RapidVideo" elif config.get_platform() == "plex": - return False, "[Rapidvideo] Este conector no funciona con tu versión de Plex, intenta actualizarla" + return False, config.get_localized_string(70303) % "RapidVideo" elif config.get_platform() == "mediaserver": - return False, "[Rapidvideo] Este conector requiere actualizar python a la versión 2.7.9 o superior" + return False, config.get_localized_string(70304) % "RapidVideo" if "Object not found" in response.data: - return False, "[Rapidvideo] El archivo no existe o ha sido borrado" + return False, config.get_localized_string(70449) % "RapidVideo" if response.code == 500: - return False, "[Rapidvideo] Error de servidor, inténtelo más tarde." + return False, config.get_localized_string(70524) % "RapidVideo" return True, "" diff --git a/plugin.video.alfa/servers/speedvideo.py b/plugin.video.alfa/servers/speedvideo.py index cfa37821..8ff4bfd1 100755 --- a/plugin.video.alfa/servers/speedvideo.py +++ b/plugin.video.alfa/servers/speedvideo.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from core import httptools, scrapertools -from platformcode import logger +from platformcode import config, logger def test_video_exists(page_url): diff --git a/plugin.video.alfa/servers/streamango.py b/plugin.video.alfa/servers/streamango.py index cf1e8b3b..b92bb82f 100755 --- a/plugin.video.alfa/servers/streamango.py +++ b/plugin.video.alfa/servers/streamango.py @@ -2,7 +2,7 @@ from core import httptools from core import scrapertools -from platformcode import logger +from platformcode import config, logger def test_video_exists(page_url): diff --git a/plugin.video.alfa/servers/streaminto.json b/plugin.video.alfa/servers/streaminto.json deleted file mode 100755 index 77c0ad5f..00000000 --- a/plugin.video.alfa/servers/streaminto.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "active": true, - "find_videos": { - "ignore_urls": [ - "http://streamin.to/embed-theme.html", - "http://streamin.to/embed-jquery.html", - "http://streamin.to/embed-s.html", - "http://streamin.to/embed-images.html", - "http://streamin.to/embed-faq.html", - "http://streamin.to/embed-embed.html", - "http://streamin.to/embed-ri.html", - "http://streamin.to/embed-d.html", - "http://streamin.to/embed-css.html", - "http://streamin.to/embed-js.html", - "http://streamin.to/embed-player.html", - "http://streamin.to/embed-cgi.html" - ], - "patterns": [ - { - "pattern": "streamin.to/(?:embed-)?([a-z0-9A-Z]+)", - "url": "http://streamin.to/embed-\\1.html" - } - ] - }, - "free": true, - "id": [ - "streaminto", - "streamin" - ], - "name": "streamin", - "settings": [ - { - "default": false, - "enabled": true, - "id": "black_list", - "label": "@60654", - "type": "bool", - "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false - } - ], - "thumbnail": "server_streaminto.png" -} \ No newline at end of file diff --git a/plugin.video.alfa/servers/streaminto.py b/plugin.video.alfa/servers/streaminto.py deleted file mode 100755 index 1744b430..00000000 --- a/plugin.video.alfa/servers/streaminto.py +++ /dev/null @@ -1,77 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from core import httptools -from core import scrapertools -from platformcode import logger - - -def test_video_exists(page_url): - logger.info("(page_url='%s')" % page_url) - - data = httptools.downloadpage(page_url).data - if "File was deleted" in data: - return False, "El archivo no existe<br/>en streaminto o ha sido borrado." - elif "Video is processing now" in data: - return False, "El archivo está siendo procesado<br/>Prueba dentro de un rato." - else: - return True, "" - - -def get_video_url(page_url, premium=False, user="", password="", video_password=""): - logger.info("url=" + page_url) - - data = re.sub(r'\n|\t|\s+', '', httptools.downloadpage(page_url).data) - - video_urls = [] - try: - media_url = scrapertools.get_match(data, """.setup\({file:"([^"]+)",image""") - except: - js_data = scrapertools.find_single_match(data, "(eval.function.p,a,c,k,e.*?)</script>") - js_data = unPack(js_data) - media_url = scrapertools.get_match(js_data, """.setup\({file:"([^"]+)",image""") - - if media_url.endswith("v.mp4"): - media_url_mp42flv = re.sub(r'/v.mp4$', '/v.flv', media_url) - video_urls.append( - [scrapertools.get_filename_from_url(media_url_mp42flv)[-4:] + " [streaminto]", media_url_mp42flv]) - if media_url.endswith("v.flv"): - media_url_flv2mp4 = re.sub(r'/v.flv$', '/v.mp4', media_url) - video_urls.append( - [scrapertools.get_filename_from_url(media_url_flv2mp4)[-4:] + " [streaminto]", media_url_flv2mp4]) - video_urls.append([scrapertools.get_filename_from_url(media_url)[-4:] + " [streaminto]", media_url]) - - for video_url in video_urls: - logger.info("%s - %s" % (video_url[0], video_url[1])) - - return video_urls - - -def unPack(packed): - pattern = "}\('(.*)', *(\d+), *(\d+), *'(.*)'\.split\('([^']+)'\)" - d = [d for d in re.search(pattern, packed, re.DOTALL).groups()] - - p = d[0]; - a = int(d[1]); - c = int(d[2]); - k = d[3].split(d[4]) - - if a <= 62: - toString = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" - else: - toString = """ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~""" - - def e(c): - return toString[c] if c < a else toString[c // a] + toString[c % a] - - while c > 0: - c -= 1 - if k[c]: - x = e(c) - else: - x = k[c] - y = k[c] - p = re.sub(r"(\b%s\b)" % x, y, p) - - return p diff --git a/plugin.video.alfa/servers/tunepk.json b/plugin.video.alfa/servers/tunepk.json deleted file mode 100755 index 3d3452ce..00000000 --- a/plugin.video.alfa/servers/tunepk.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "active": true, - "find_videos": { - "ignore_urls": [], - "patterns": [ - { - "pattern": "tune.pk/player/embed_player.php\\?vid\\=(\\d+)", - "url": "http://embed.tune.pk/play/\\1?autoplay=no" - } - ] - }, - "free": true, - "id": "tunepk", - "name": "tunepk", - "settings": [ - { - "default": false, - "enabled": true, - "id": "black_list", - "label": "@60654", - "type": "bool", - "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false - } - ] -} \ No newline at end of file diff --git a/plugin.video.alfa/servers/tunepk.py b/plugin.video.alfa/servers/tunepk.py deleted file mode 100755 index cde33744..00000000 --- a/plugin.video.alfa/servers/tunepk.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from core import scrapertools -from platformcode import logger - - -# Returns an array of possible video url's from the page_url -def get_video_url(page_url, premium=False, user="", password="", video_password=""): - logger.info("(page_url='%s')" % page_url) - - video_urls = [] - - data = scrapertools.cache_page(page_url) - logger.info(data) - patron = 'file: "([^"]+)",\s+' - patron += 'width: "[^"]+",\s+' - patron += 'height: "[^"]+",\s+' - patron += 'label : "([^"]+)",\s+' - patron += 'type : "([^"]+)"' - matches = re.compile(patron, re.DOTALL).findall(data) - scrapertools.printMatches(matches) - - for url, calidad, formato in matches: - video_url = ["%s %s [tune.pk]" % (calidad, formato), url] - video_urls.append(video_url) - - for video_url in video_urls: - logger.info("%s - %s" % (video_url[0], video_url[1])) - - return video_urls diff --git a/plugin.video.alfa/servers/tutv.json b/plugin.video.alfa/servers/tutv.json deleted file mode 100755 index e7c11eff..00000000 --- a/plugin.video.alfa/servers/tutv.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "active": true, - "find_videos": { - "ignore_urls": [], - "patterns": [ - { - "pattern": "(http://(?:www.)?tu.tv[^\"]+)", - "url": "\\1" - }, - { - "pattern": "tu.tv/(iframe/\\d+)", - "url": "http://tu.tv/\\1" - } - ] - }, - "free": true, - "id": "tutv", - "name": "tutv", - "settings": [ - { - "default": false, - "enabled": true, - "id": "black_list", - "label": "@60654", - "type": "bool", - "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false - } - ] -} \ No newline at end of file diff --git a/plugin.video.alfa/servers/tutv.py b/plugin.video.alfa/servers/tutv.py deleted file mode 100755 index 475652ba..00000000 --- a/plugin.video.alfa/servers/tutv.py +++ /dev/null @@ -1,56 +0,0 @@ -# -*- coding: utf-8 -*- - -import re -import urllib - -from core import scrapertools -from platformcode import logger - - -# Returns an array of possible video url's from the page_url -def get_video_url(page_url, premium=False, user="", password="", video_password=""): - logger.info("(page_url='%s')" % page_url) - - # Busca el ID en la URL - id = extract_id(page_url) - - # Si no lo tiene, lo extrae de la página - if id == "": - # La descarga - data = scrapertools.cache_page(page_url) - patron = '<link rel="video_src" href="([^"]+)"/>' - matches = re.compile(patron, re.DOTALL).findall(data) - if len(matches) > 0: - id = extract_id(matches[0]) - else: - id = "" - - if id == "": - id = scrapertools.get_match(page_url, "tu.tv/iframe/(\d+)") - - # Descarga el descriptor - url = "http://tu.tv/visualizacionExterna2.php?web=undefined&codVideo=" + id - data = scrapertools.cache_page(url) - - # Obtiene el enlace al vídeo - patronvideos = 'urlVideo0=([^\&]+)\&' - matches = re.compile(patronvideos, re.DOTALL).findall(data) - # scrapertools.printMatches(matches) - url = urllib.unquote_plus(matches[0]) - video_urls = [["[tu.tv]", url]] - - for video_url in video_urls: - logger.info("%s - %s" % (video_url[0], video_url[1])) - - return video_urls - - -def extract_id(text): - patron = "xtp\=([a-zA-Z0-9]+)" - matches = re.compile(patron, re.DOTALL).findall(text) - if len(matches) > 0: - devuelve = matches[0] - else: - devuelve = "" - - return devuelve diff --git a/plugin.video.alfa/servers/youtube.py b/plugin.video.alfa/servers/youtube.py index 5a398635..8b838360 100755 --- a/plugin.video.alfa/servers/youtube.py +++ b/plugin.video.alfa/servers/youtube.py @@ -10,6 +10,18 @@ from core import scrapertools from platformcode import config, logger +def test_video_exists(page_url): + logger.info("(page_url='%s')" % page_url) + + data = httptools.downloadpage(page_url).data + + if "File was deleted" in data: + return False, config.get_localized_string(70449) % "Youtube" + + return True, "" + + + def get_video_url(page_url, premium=False, user="", password="", video_password=""): logger.info("(page_url='%s')" % page_url)