diff --git a/custom_code.json b/custom_code.json index b5e1c649..cf765278 100644 --- a/custom_code.json +++ b/custom_code.json @@ -1,3 +1,3 @@ { - "addon_version": "0.3" + "addon_version": "0.3.1" } \ No newline at end of file diff --git a/specials/netlovers.json b/specials/netlovers.json new file mode 100644 index 00000000..0ca5e040 --- /dev/null +++ b/specials/netlovers.json @@ -0,0 +1,12 @@ +{ + "id": "netlovers", + "name": "Net Lovers", + "language": ["ita"], + "active": false, + "adult": false, + "thumbnail": null, + "banner": null, + "categories": [], + "settings": [], + "channel": false +} \ No newline at end of file diff --git a/specials/netlovers.py b/specials/netlovers.py new file mode 100644 index 00000000..8e6c3c47 --- /dev/null +++ b/specials/netlovers.py @@ -0,0 +1,121 @@ +# -*- coding: utf-8 -*- +# ------------------------------------------------------------ +# Canale netlovers +# ------------------------------------------------------------ + +import re +import urllib +from channelselector import get_thumb +from core import httptools, scrapertools, support, tmdb +from core.item import Item +from platformcode import logger, config + +host = "https://www.netflixlovers.it" + +TIMEOUT_TOTAL = 60 + + +def mainlist(item): + logger.info(" mainlist") + itemlist = [Item(channel=item.channel, + title="Novità", + action="get_info", + url="%s/novita-su-netflix" % host, + thumbnail=item.thumbnail), + Item(channel=item.channel, + title="Prossimamente", + action="ratings", + url="%s/prossimamente-su-netflix" % host, + thumbnail=item.thumbnail), + Item(channel=item.channel, + title="Meglio del Mese", + action="ratings", + url="%s/classifiche/questo-mese" % host, + thumbnail=item.thumbnail), + Item(channel=item.channel, + title="Migliori Film", + action="ratings", + url="%s/classifiche/film" % host, + thumbnail=item.thumbnail), + Item(channel=item.channel, + title="Migliori Serie", + action="ratings", + url="%s/classifiche/migliori-serie-tv-su-netflix" % host, + thumbnail=item.thumbnail), + Item(channel=item.channel, + title="Migliori Documentari", + action="ratings", + url="%s/classifiche/documentari" % host, + thumbnail=item.thumbnail)] + + return itemlist + + +def get_info(item): + logger.info("filmontv tvoggi") + itemlist = [] + + # Carica la pagina + data = httptools.downloadpage(item.url).data + patron = r'
[a-z \n<>\/="_\-:0-9;A-Z.?!\'\&]*img src="([a-zA-Z:\/\.0-9\-_]*)[a-z \n<>\/="_\-:0-9;A-Z.?!\'\&]*alt="([A-Za-z ,:0-9\.À-ÖØ-öø-ÿ\-\']*)[a-z \n<>\/="_\-:0-9;A-Z.?!\'\&,#]*

([A-Za-z ,0-9\.À-ÖØ-öø-ÿ\-\']*)' + matches = re.compile(patron, re.DOTALL).findall(data) + for scrapedthumbnail, scrapedtitle, scrapedinfo in matches: + # for scrapedthumbnail, scrapedtitle, scrapedtv in matches: + scrapedurl = "" + scrapedtitle = scrapertools.decodeHtmlentities(scrapedtitle).strip() + infoLabels = {} + infoLabels["plot"] = scrapedinfo + itemlist.append( + Item(channel=item.channel, + action="do_search", + extra=urllib.quote_plus(scrapedtitle) + '{}' + 'movie', + title="[B]" + scrapedtitle + "[/B]", + fulltitle="[B]" + scrapedtitle + "[/B]", + url=scrapedurl, + thumbnail=scrapedthumbnail, + contentTitle=scrapedtitle, + contentType='movie', + infoLabels=infoLabels, + folder=True)) + + tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) + + return itemlist + + +def ratings(item): + logger.info("filmontv tvoggi") + itemlist = [] + + # Carica la pagina + data = httptools.downloadpage(item.url).data + patron = r'

[a-z \n<>\/="_\-:0-9;A-Z.?!\'\&]*img src="([a-zA-Z:\/\.0-9\-_]*)[a-z \n<>\/="_\-:0-9;A-Z.?!\'\&]*alt="([A-Za-z ,0-9:\.À-ÖØ-öø-ÿ\-\']*)[a-z \n<>\/="_\-:0-9;A-Z.?!\'\&,#]*

([A-Za-z ,0-9\.À-ÖØ-öø-ÿ\-\']*)' + matches = re.compile(patron, re.DOTALL).findall(data) + for scrapedthumbnail, scrapedtitle, scrapedinfo in matches: + # for scrapedthumbnail, scrapedtitle, scrapedtv in matches: + scrapedurl = "" + scrapedtitle = scrapertools.decodeHtmlentities(scrapedtitle).strip() + infoLabels = {} + infoLabels["plot"] = scrapedinfo + itemlist.append( + Item(channel=item.channel, + action="do_search", + extra=urllib.quote_plus(scrapedtitle) + '{}' + 'movie', + title="[B]" + scrapedtitle + "[/B]", + fulltitle="[B]" + scrapedtitle + "[/B]", + url=scrapedurl, + thumbnail=scrapedthumbnail, + contentTitle=scrapedtitle, + contentType='movie', + infoLabels=infoLabels, + folder=True)) + + tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) + + return itemlist + + + +def do_search(item): + from specials import search + return search.do_search(item) diff --git a/specials/search.py b/specials/search.py index 796bf551..50b6e2e8 100644 --- a/specials/search.py +++ b/specials/search.py @@ -32,7 +32,9 @@ def mainlist(item): itemlist.append(Item(channel=item.channel, action="sub_menu", title="[B]" + config.get_localized_string(70305)+ "[/B]", context=context, thumbnail=get_thumb("search.png"))) itemlist.append(Item(channel="filmontv", action="mainlist", title=config.get_localized_string(50001), - thumbnail=get_thumb("on_the_air.png"), viewmode="thumbnails")) + thumbnail=get_thumb("on_the_air.png"), viewmode="thumbnails")) + itemlist.append(Item(channel="netlovers", action="mainlist", title="Net Lovers", + thumbnail=get_thumb("on_the_air.png"), viewmode="thumbnails")) itemlist.append(Item(channel=item.channel, action='genres_menu', title=config.get_localized_string(70306), type='movie', thumbnail=get_thumb("genres.png"))) itemlist.append (Item(channel=item.channel, action='discover_list', title=config.get_localized_string(70307),