diff --git a/plugin.video.alfa/addon.xml b/plugin.video.alfa/addon.xml index b52b014b..b4686abb 100755 --- a/plugin.video.alfa/addon.xml +++ b/plugin.video.alfa/addon.xml @@ -1,5 +1,5 @@ - + @@ -19,14 +19,11 @@ [B]Estos son los cambios para esta versión:[/B] [COLOR green][B]Canales agregados y arreglos[/B][/COLOR] - ¤ cinecalidad ¤ verpelis - ¤ pepecine ¤ pelispedia - ¤ pelisplusco ¤ seriesblancoxyz - ¤ seriesdanko ¤ pedropolis - ¤ pelisplanet ¤ danimados - ¤ fembed ¤ upvid - ¤ megadede ¤ crunchyroll - ¤ pelismagnet + ¤ cinehindi ¤ repelis + ¤ rexpelis ¤ yape + ¤ bloghorror ¤ pelkex + ¤ documaniatv ¤ mejortorrent + ¤ arreglos internos diff --git a/plugin.video.alfa/channels/bloghorror.json b/plugin.video.alfa/channels/bloghorror.json new file mode 100644 index 00000000..23513828 --- /dev/null +++ b/plugin.video.alfa/channels/bloghorror.json @@ -0,0 +1,68 @@ +{ + "id": "bloghorror", + "name": "BlogHorror", + "active": true, + "adult": false, + "language": [""], + "thumbnail": "", + "banner": "", + "categories": [ + "movie", + "vo", + "torrent" + ], + "settings": [ + { + "id": "include_in_global_search", + "type": "bool", + "label": "Incluir en busqueda global", + "default": false, + "enabled": false, + "visible": false + }, + { + "id": "include_in_newest_peliculas", + "type": "bool", + "label": "Incluir en Novedades - Peliculas", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_latino", + "type": "bool", + "label": "Incluir en Novedades - Latino", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_infantiles", + "type": "bool", + "label": "Incluir en Novedades - Infantiles", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_terror", + "type": "bool", + "label": "Incluir en Novedades - terror", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "filter_languages", + "type": "list", + "label": "Mostrar enlaces en idioma...", + "default": 0, + "enabled": true, + "visible": true, + "lvalues": [ + "No filtrar", + "LAT" + ] + } + ] +} diff --git a/plugin.video.alfa/channels/bloghorror.py b/plugin.video.alfa/channels/bloghorror.py new file mode 100644 index 00000000..0004b752 --- /dev/null +++ b/plugin.video.alfa/channels/bloghorror.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +# -*- Channel BlogHorror -*- +# -*- Created for Alfa-addon -*- +# -*- By the Alfa Develop Group -*- + +import os +import re + +from channels import autoplay +from channels import filtertools +from core import httptools +from core import scrapertools +from core import servertools +from core import tmdb +from core.item import Item +from platformcode import config, logger +from channelselector import get_thumb + +host = 'http://bloghorror.com/' +fanart = 'http://bloghorror.com/wp-content/uploads/2015/04/bloghorror-2017-x.jpg' + +def get_source(url): + logger.info() + data = httptools.downloadpage(url).data + data = re.sub(r'\n|\r|\t| |
|\s{2,}', "", data) + return data + +def mainlist(item): + logger.info() + + itemlist = [] + + itemlist.append(Item(channel=item.channel, fanart=fanart, title="Todas", action="list_all", url=host, + thumbnail=get_thumb('all', auto=True))) + + itemlist.append(Item(channel=item.channel, fanart=fanart, title="Asiaticas", action="list_all", + url=host+'/category/asiatico', thumbnail=get_thumb('asiaticas', auto=True))) + + itemlist.append(Item(channel=item.channel, fanart=fanart, title = 'Buscar', action="search", url=host + '?s=', pages=3, + thumbnail=get_thumb('search', auto=True))) + + return itemlist + + +def list_all(item): + logger.info() + + itemlist = [] + data = get_source(item.url) + patron = '.?<.*?href="([^"]+)" title="([^"]+)".*?src="([^"]+)".*?' + + matches = re.compile(patron, re.DOTALL).findall(data) + + for scrapedurl, scrapedtitle, scrapedthumbnail in matches: + url = scrapedurl + title = scrapertools.find_single_match(scrapedtitle, '(.*?)(?:|\(|\| )\d{4}').strip() + year = scrapertools.find_single_match(scrapedtitle, '(\d{4})') + thumbnail = scrapedthumbnail + new_item = Item(channel=item.channel, fanart=fanart, title=title, url=url, action='findvideos', + thumbnail=thumbnail, infoLabels={'year':year}) + + new_item.contentTitle=title + itemlist.append(new_item) + + tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) + + # Paginacion + + if itemlist != []: + + next_page = scrapertools.find_single_match(data, '' + + matches = re.compile(patron, re.DOTALL).findall(data) + + for url, title in matches: + + itemlist.append(Item(channel=item.channel, fanart=fanart, title=title, url=url, action='list_all', pages=3)) + + return itemlist + + +def findvideos(item): + logger.info() + + itemlist = [] + full_data = get_source(item.url) + data = scrapertools.find_single_match(full_data, '>FICHA TECNICA:<.*?') + #patron = '(?:bold|strong>|
|)([^<]+)(?:|
).*?="(magnet[^"]+)"' + patron = '(?:|
|/> )(DVD|720|1080)(?:|
|).*?="(magnet[^"]+)"' + matches = re.compile(patron, re.DOTALL).findall(data) + + if len(matches) == 0: + patron = ' 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 + )) + + return itemlist + + +def search(item, texto): + logger.info() + itemlist = [] + texto = texto.replace(" ", "+") + item.url = item.url + texto + if texto != '': + try: + return list_all(item) + except: + itemlist.append(item.clone(url='', title='No hay elementos...', action='')) + return itemlist + +def newest(categoria): + logger.info() + itemlist = [] + item = Item() + try: + if categoria in ['peliculas', 'terror', 'torrent']: + item.url = host + itemlist = list_all(item) + if itemlist[-1].title == 'Siguiente >>>': + itemlist.pop() + except: + import sys + for line in sys.exc_info(): + logger.error("{0}".format(line)) + return [] + + return itemlist + + +def get_sub_from_subdivx(sub_url, sub_num): + logger.info() + + import xbmc + from time import sleep + import urlparse + sub_dir = os.path.join(config.get_data_path(), 'temp_subs') + + if os.path.exists(sub_dir): + for sub_file in os.listdir(sub_dir): + old_sub = os.path.join(sub_dir, sub_file) + os.remove(old_sub) + + sub_data = httptools.downloadpage(sub_url, follow_redirects=False) + + if 'x-frame-options' not in sub_data.headers: + sub_url = 'http://subdivx.com/sub%s/%s' % (sub_num, sub_data.headers['location']) + sub_url = sub_url.replace('http:///', '') + sub_data = httptools.downloadpage(sub_url).data + + fichero_rar = os.path.join(config.get_data_path(), "subtitle.rar") + outfile = open(fichero_rar, 'wb') + outfile.write(sub_data) + outfile.close() + xbmc.executebuiltin("XBMC.Extract(%s, %s/temp_subs)" % (fichero_rar, config.get_data_path())) + sleep(1) + if len(os.listdir(sub_dir)) > 0: + sub = os.path.join(sub_dir, os.listdir(sub_dir)[0]) + else: + sub = '' + else: + logger.info('sub no valido') + sub = '' + return sub + diff --git a/plugin.video.alfa/channels/cinehindi.py b/plugin.video.alfa/channels/cinehindi.py index dcb59acf..1e830539 100755 --- a/plugin.video.alfa/channels/cinehindi.py +++ b/plugin.video.alfa/channels/cinehindi.py @@ -3,25 +3,34 @@ import re import urlparse +from channelselector import get_thumb +from channels import autoplay +from channels import filtertools from core import httptools from core import scrapertools from core import servertools +from core import tmdb from core.item import Item from platformcode import config, logger +IDIOMAS = {'Hindi': 'Hindi'} +list_language = IDIOMAS.values() +list_quality = [] +list_servers = ['openload', 'netutv'] + host = "http://www.cinehindi.com/" def mainlist(item): logger.info() - + autoplay.init(item.channel, list_servers, list_quality) itemlist = list() - - itemlist.append(Item(channel=item.channel, action="genero", title="Generos", url=host)) - itemlist.append(Item(channel=item.channel, action="lista", title="Novedades", url=host)) + itemlist.append(Item(channel=item.channel, action="genero", title="Generos", url=host, thumbnail = get_thumb("genres", auto = True))) + itemlist.append(Item(channel=item.channel, action="lista", title="Novedades", url=host, thumbnail = get_thumb("newest", auto = True))) itemlist.append(Item(channel=item.channel, action="proximas", title="Próximas Películas", url=urlparse.urljoin(host, "proximamente"))) - itemlist.append(Item(channel=item.channel, title="Buscar", action="search", url=urlparse.urljoin(host, "?s="))) + itemlist.append(Item(channel=item.channel, title="Buscar", action="search", url=urlparse.urljoin(host, "?s="), thumbnail = get_thumb("search", auto = True))) + autoplay.show_option(item.channel, itemlist) return itemlist @@ -50,9 +59,7 @@ def search(item, texto): def proximas(item): logger.info() - itemlist = [] - data = httptools.downloadpage(item.url).data data = re.sub(r"\n|\r|\t|\s{2}| ", "", data) # Eliminamos tabuladores, dobles espacios saltos de linea, etc... patron = 'class="item">.*?' # Todos los items de peliculas (en esta web) empiezan con esto @@ -77,40 +84,36 @@ def proximas(item): item.url = next_page_url + 'proximamente/page/' + str(i) + '/' itemlist.append(Item(channel=item.channel, action="proximas", title=">> Página siguiente", url=item.url, thumbnail='https://s32.postimg.cc/4zppxf5j9/siguiente.png')) - return itemlist def lista(item): logger.info() - itemlist = [] - data = httptools.downloadpage(item.url).data - data = re.sub(r"\n|\r|\t|\s{2}| ", "", data) # Eliminamos tabuladores, dobles espacios saltos de linea, etc... patron = 'class="item">.*?' # Todos los items de peliculas (en esta web) empiezan con esto patron += ' 0 and item.contentChannel!='videolibrary': 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=show)) - return itemlist + + +def play(item): + logger.info() + item.thumbnail = item.contentThumbnail + return [item] diff --git a/plugin.video.alfa/channels/kbagi.json b/plugin.video.alfa/channels/kbagi.json deleted file mode 100644 index 9d76045f..00000000 --- a/plugin.video.alfa/channels/kbagi.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "id": "kbagi", - "name": "Kbagi/Diskokosmiko", - "language": ["cast", "lat"], - "active": false, - "adult": false, - "version": 1, - "thumbnail": "http://i.imgur.com/EjbfM7p.png?1", - "banner": "copiapop.png", - "categories": [ - "movie", - "tvshow" - ], - "settings": [ - { - "id": "include_in_global_search", - "type": "bool", - "label": "Incluir en busqueda global", - "default": false, - "enabled": true, - "visible": true - }, - { - "id": "kbagiuser", - "type": "text", - "color": "0xFF25AA48", - "label": "Usuario Kbagi", - "enabled": true, - "visible": true - }, - { - "id": "kbagipassword", - "type": "text", - "color": "0xFF25AA48", - "hidden": true, - "label": "Password Kbagi", - "enabled": "!eq(-1,'')", - "visible": true - }, - { - "id": "diskokosmikouser", - "type": "text", - "color": "0xFFC52020", - "label": "Usuario Diskokosmiko", - "enabled": true, - "visible": true - }, - { - "id": "diskokosmikopassword", - "type": "text", - "color": "0xFFC52020", - "hidden": true, - "label": "Password Diskokosmiko", - "enabled": "!eq(-1,'')", - "visible": true - }, - { - "id": "adult_content", - "type": "bool", - "color": "0xFFd50b0b", - "label": "Mostrar contenido adulto en las búsquedas", - "default": false, - "enabled": true, - "visible": true - }, - { - "id": "perfil", - "type": "list", - "label": "Perfil de color", - "default": 3, - "enabled": true, - "visible": true, - "lvalues": [ - "Sin color", - "Perfil 3", - "Perfil 2", - "Perfil 1" - ] - } - ] -} \ No newline at end of file diff --git a/plugin.video.alfa/channels/kbagi.py b/plugin.video.alfa/channels/kbagi.py deleted file mode 100644 index 7cb297a4..00000000 --- a/plugin.video.alfa/channels/kbagi.py +++ /dev/null @@ -1,384 +0,0 @@ -# -*- coding: utf-8 -*- - -import re -import threading -import urllib -import xbmc - -from core import downloadtools -from core import filetools -from core import httptools -from core import jsontools -from core import scrapertools -from core.item import Item -from platformcode import config, logger -from platformcode import platformtools - -__perfil__ = config.get_setting('perfil', "kbagi") - -# Fijar perfil de color -perfil = [['0xFFFFE6CC', '0xFFFFCE9C', '0xFF994D00', '0xFFFE2E2E', '0xFF088A08'], - ['0xFFA5F6AF', '0xFF5FDA6D', '0xFF11811E', '0xFFFE2E2E', '0xFF088A08'], - ['0xFF58D3F7', '0xFF2E9AFE', '0xFF2E64FE', '0xFFFE2E2E', '0xFF088A08']] - -if __perfil__ - 1 >= 0: - color1, color2, color3, color4, color5 = perfil[__perfil__ - 1] -else: - color1 = color2 = color3 = color4 = color5 = "" - -adult_content = config.get_setting("adult_content", "kbagi") - - -def login(pagina): - logger.info() - try: - dom = pagina.split(".")[0] - user = config.get_setting("%suser" %dom, "kbagi") - password = config.get_setting("%spassword" %dom, "kbagi") - if "kbagi" in pagina: - pagina = "k-bagi.com" - if not user: - return False, "Para ver los enlaces de %s es necesario registrarse en %s" %(dom, pagina) - data = httptools.downloadpage("http://%s" % pagina).data - if re.search(r'(?i)%s' % user, data): - return True, "" - token = scrapertools.find_single_match(data, 'name="__RequestVerificationToken".*?value="([^"]+)"') - post = "__RequestVerificationToken=%s&UserName=%s&Password=%s" % (token, user, password) - headers = {'X-Requested-With': 'XMLHttpRequest'} - url_log = "http://%s/action/Account/Login" % pagina - data = httptools.downloadpage(url_log, post, headers).data - if "redirectUrl" in data: - logger.info("Login correcto") - return True, "" - else: - logger.error("Error en el login") - return False, "Nombre de usuario no válido. Comprueba tus credenciales" - except: - import traceback - logger.error(traceback.format_exc()) - return False, "Error durante el login. Comprueba tus credenciales" - - -def mainlist(item): - logger.info() - itemlist = [] - item.text_color = color1 - logueado, error_message = login("kbagi.com") - if not logueado: - itemlist.append(item.clone(title=error_message, action="configuracion", folder=False)) - else: - item.extra = "http://k-bagi.com" - itemlist.append(item.clone(title="kbagi", action="", text_color=color2)) - itemlist.append( - item.clone(title=" Búsqueda", action="search", url="http://k-bagi.com/action/SearchFiles")) - itemlist.append(item.clone(title=" Colecciones", action="colecciones", - url="http://k-bagi.com/action/home/MoreNewestCollections?pageNumber=1")) - itemlist.append(item.clone(title=" Búsqueda personalizada", action="filtro", - url="http://k-bagi.com/action/SearchFiles")) - itemlist.append(item.clone(title=" Mi cuenta", action="cuenta")) - logueado, error_message = login("diskokosmiko.mx") - if not logueado: - itemlist.append(item.clone(title=error_message, action="configuracion", folder=False)) - else: - item.extra = "http://diskokosmiko.mx/" - itemlist.append(item.clone(title="DiskoKosmiko", action="", text_color=color2)) - itemlist.append(item.clone(title=" Búsqueda", action="search", url="http://diskokosmiko.mx/action/SearchFiles")) - itemlist.append(item.clone(title=" Colecciones", action="colecciones", - url="http://diskokosmiko.mx/action/home/MoreNewestCollections?pageNumber=1")) - itemlist.append(item.clone(title=" Búsqueda personalizada", action="filtro", - url="http://diskokosmiko.mx/action/SearchFiles")) - itemlist.append(item.clone(title=" Mi cuenta", action="cuenta")) - itemlist.append(item.clone(action="", title="")) - folder_thumb = filetools.join(config.get_data_path(), 'thumbs_kbagi') - files = filetools.listdir(folder_thumb) - if files: - itemlist.append( - item.clone(title="Eliminar caché de imágenes (%s)" % len(files), action="delete_cache", text_color="red")) - itemlist.append(item.clone(title="Configuración del canal", action="configuracion", text_color="gold")) - return itemlist - - -def search(item, texto): - logger.info() - item.post = "Mode=List&Type=Video&Phrase=%s&SizeFrom=0&SizeTo=0&Extension=&ref=pager&pageNumber=1" % texto.replace( - " ", "+") - try: - return listado(item) - except: - import sys, traceback - for line in sys.exc_info(): - logger.error("%s" % line) - logger.error(traceback.format_exc()) - return [] - - -def configuracion(item): - ret = platformtools.show_channel_settings() - platformtools.itemlist_refresh() - return ret - - -def listado(item): - logger.info() - itemlist = [] - data_thumb = httptools.downloadpage(item.url, item.post.replace("Mode=List", "Mode=Gallery")).data - if not item.post: - data_thumb = "" - item.url = item.url.replace("/gallery,", "/list,") - data = httptools.downloadpage(item.url, item.post).data - data = re.sub(r"\n|\r|\t|\s{2}| |
", "", data) - - folder = filetools.join(config.get_data_path(), 'thumbs_kbagi') - patron = 'data-file-id(.*?

)' - bloques = scrapertools.find_multiple_matches(data, patron) - for block in bloques: - if "adult_info" in block and not adult_content: - continue - size = scrapertools.find_single_match(block, '([^<]+)

') - patron = 'class="name">
([^<]+)<' - scrapedurl, scrapedtitle = scrapertools.find_single_match(block, patron) - scrapedthumbnail = scrapertools.find_single_match(block, "background-image:url\('([^']+)'") - if scrapedthumbnail: - try: - thumb = scrapedthumbnail.split("-", 1)[0].replace("?", "\?") - if data_thumb: - url_thumb = scrapertools.find_single_match(data_thumb, "(%s[^']+)'" % thumb) - else: - url_thumb = scrapedthumbnail - scrapedthumbnail = filetools.join(folder, "%s.jpg" % url_thumb.split("e=", 1)[1][-20:]) - except: - scrapedthumbnail = "" - if scrapedthumbnail: - t = threading.Thread(target=download_thumb, args=[scrapedthumbnail, url_thumb]) - t.setDaemon(True) - t.start() - else: - scrapedthumbnail = item.extra + "/img/file_types/gallery/movie.png" - scrapedurl = item.extra + scrapedurl - title = "%s (%s)" % (scrapedtitle, size) - if "adult_info" in block: - title += " [COLOR %s][+18][/COLOR]" % color4 - plot = scrapertools.find_single_match(block, '
(.*?)
') - if plot: - plot = scrapertools.decodeHtmlentities(plot) - new_item = Item(channel=item.channel, action="findvideos", title=title, url=scrapedurl, - thumbnail=scrapedthumbnail, contentTitle=scrapedtitle, text_color=color2, - extra=item.extra, infoLabels={'plot': plot}, post=item.post) - if item.post: - try: - new_item.folderurl, new_item.foldername = scrapertools.find_single_match(block, - '

([^<]+)<') - except: - pass - else: - new_item.folderurl = item.url.rsplit("/", 1)[0] - new_item.foldername = item.foldername - new_item.fanart = item.thumbnail - itemlist.append(new_item) - next_page = scrapertools.find_single_match(data, 'class="pageSplitter.*?" data-nextpage-number="([^"]+)"') - if next_page: - if item.post: - post = re.sub(r'pageNumber=(\d+)', "pageNumber=" + next_page, item.post) - url = item.url - else: - url = re.sub(r',\d+\?ref=pager', ",%s?ref=pager" % next_page, item.url) - post = "" - itemlist.append(Item(channel=item.channel, action="listado", title=">> Página Siguiente (%s)" % next_page, - url=url, post=post, extra=item.extra)) - return itemlist - - -def findvideos(item): - logger.info() - itemlist = [] - itemlist.append(item.clone(action="play", title="Reproducir/Descargar", server="kbagi")) - usuario = scrapertools.find_single_match(item.url, '%s/([^/]+)/' % item.extra) - url_usuario = item.extra + "/" + usuario - if item.folderurl and not item.folderurl.startswith(item.extra): - item.folderurl = item.extra + item.folderurl - if item.post: - itemlist.append(item.clone(action="listado", title="Ver colección: %s" % item.foldername, - url=item.folderurl + "/gallery,1,1?ref=pager", post="")) - data = httptools.downloadpage(item.folderurl).data - token = scrapertools.find_single_match(data, - 'data-action="followChanged.*?name="__RequestVerificationToken".*?value="([^"]+)"') - collection_id = item.folderurl.rsplit("-", 1)[1] - post = "__RequestVerificationToken=%s&collectionId=%s" % (token, collection_id) - url = "%s/action/Follow/Follow" % item.extra - title = "Seguir Colección: %s" % item.foldername - if "dejar de seguir" in data: - title = "Dejar de seguir la colección: %s" % item.foldername - url = "%s/action/Follow/UnFollow" % item.extra - itemlist.append(item.clone(action="seguir", title=title, url=url, post=post, text_color=color5, folder=False)) - itemlist.append( - item.clone(action="colecciones", title="Ver colecciones del usuario: %s" % usuario, url=url_usuario)) - return itemlist - - -def colecciones(item): - logger.info() - itemlist = [] - usuario = False - data = httptools.downloadpage(item.url).data - if "Ver colecciones del usuario" not in item.title and not item.index: - data = jsontools.load(data)["Data"] - content = data["Content"] - content = re.sub(r"\n|\r|\t|\s{2}| |
", "", content) - else: - usuario = True - if item.follow: - content = scrapertools.find_single_match(data, - 'id="followed_collections"(.*?)