diff --git a/plugin.video.alfa/channels/ohpelis.json b/plugin.video.alfa/channels/ohpelis.json new file mode 100644 index 00000000..5c5d00f5 --- /dev/null +++ b/plugin.video.alfa/channels/ohpelis.json @@ -0,0 +1,43 @@ +{ + "id": "ohpelis", + "name": "OH-PELIS", + "compatible": { + "addon_version": "4.3" + }, + "active": true, + "adult": false, + "language": "es", + "thumbnail": "https://s28.postimg.org/6v7ig831p/oh-pelis.png", + "banner": "https://s27.postimg.org/bz0fh8jpf/oh-pelis-banner.png", + "version": 1, + "categories": [ + "latino", + "movie" + ], + "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_infantiles", + "type": "bool", + "label": "Incluir en Novedades - Infantiles", + "default": true, + "enabled": true, + "visible": true + } + ] +} \ No newline at end of file diff --git a/plugin.video.alfa/channels/ohpelis.py b/plugin.video.alfa/channels/ohpelis.py new file mode 100644 index 00000000..31b9080a --- /dev/null +++ b/plugin.video.alfa/channels/ohpelis.py @@ -0,0 +1,316 @@ +# -*- coding: utf-8 -*- +# -*- Channel OH-PELIS -*- +# -*- Created for Alfa-addon -*- +# -*- By the Alfa Develop Group -*- + +import re +import urllib +import urlparse + +from channels import autoplay +from channels import filtertools +from core import config +from core import httptools +from core import logger +from core import scrapertools +from core import servertools +from core import tmdb +from core.item import Item + + +host = 'http://www.ohpelis.com' +headers = { + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0 Chrome/58.0.3029.110', + 'Referer': host} + + +def mainlist(item): + logger.info() + + itemlist = [] + + itemlist.append( + item.clone(title="Peliculas", + action = 'movies_menu' + )) + + itemlist.append( + item.clone(title="Series", + action ='series_menu' + )) + + itemlist.append( + item.clone(title="Buscar", + action="search", + url='http://www.ohpelis.com/?s=', + )) + + + return itemlist + +def series_menu(item): + logger.info() + + itemlist = [] + + itemlist.append( + item.clone(title="Series", + action="list_all", + url=host + '/series/', + extra='serie' + )) + + return itemlist + + +def movies_menu(item): + logger.info() + + itemlist = [] + + itemlist.append( + item.clone(title="Todas", + action="list_all", + url=host + '/peliculas/' + )) + + itemlist.append( + item.clone(title="Generos", + action="section", + url=host, extra='genres')) + + itemlist.append( + item.clone(title="Por año", + action="section", + url=host, extra='byyear' + )) + + return itemlist + + +def list_all(item): + logger.info() + + itemlist = [] + data = httptools.downloadpage(item.url).data + + patron = '
(.*?)<\/p>' + matches = re.compile(patron, re.DOTALL).findall(data) + + for scrapedurl, scrapedthumbnail, scrapedtitle, scrapedtype, scrapedyear, scrapedplot in matches: + title = scrapedtitle + plot = scrapedplot + thumbnail = scrapedthumbnail + url = scrapedurl + year = scrapedyear + new_item = item.clone(action='', + title=title, + url=url, + thumbnail=thumbnail, + plot=plot, + infoLabels={'year': year}) + if scrapedtype == 'movies': + new_item.action = 'findvideos' + new_item.contentTitle = title + else: + new_item.action = 'seasons' + new_item.contentSerieName = title + + itemlist.append(new_item) + tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) + return itemlist + +def search(item, texto): + logger.info() + texto = texto.replace(" ", "+") + item.url = item.url + texto + if texto != '': + return search_list(item) + +def seasons (item): + logger.info() + itemlist = [] + + data = httptools.downloadpage(item.url).data + patron = '(.*?)<\/span>(.*?) ' + matches = re.compile(patron, re.DOTALL).findall(data) + infoLabels = item.infoLabels + for scrapedseason, scrapedtitle in matches: + title = scrapedtitle + contentSeasonNumber = scrapedseason + infoLabels['season']= scrapedseason + itemlist.append(item.clone(title = title, + contentSeasonNumber= contentSeasonNumber, + action = 'episodesxseason', + infoLabels=infoLabels)) + + tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) + + if config.get_videolibrary_support() and len(itemlist) > 0: + itemlist.append(item.clone(title='[COLOR yellow]Añadir esta serie a la videoteca[/COLOR]', + url=item.url, + action="add_serie_to_library", + extra = 'episodes', + contentSerieName=item.contentSerieName, + )) + return itemlist + +def episodes (item): + logger.info() + itemlist = [] + data = httptools.downloadpage(item.url).data + patron = '