From aa19c3ec0959bce8e636a64e3d108f6b016250c0 Mon Sep 17 00:00:00 2001 From: Whiplash Date: Sat, 19 Oct 2019 00:08:48 +0200 Subject: [PATCH 1/8] [PolpoTV] new channel for kod --- channels/polpotv.json | 22 ++++++++ channels/polpotv.py | 125 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 147 insertions(+) create mode 100644 channels/polpotv.json create mode 100644 channels/polpotv.py diff --git a/channels/polpotv.json b/channels/polpotv.json new file mode 100644 index 00000000..905cb59a --- /dev/null +++ b/channels/polpotv.json @@ -0,0 +1,22 @@ +{ + "id": "polpotv", + "name": "PolpoTV", + "language": ["it"], + "active": true, + "adult": false, + "thumbnail": "https://polpo.tv/build/assets/apple-touch-icon-152x152.png", + "banner": "https://polpo.tv/build/assets/apple-touch-icon-152x152.png", + "categories": [ + "movie" + ], + "settings": [ + { + "id": "include_in_global_search", + "type": "bool", + "label": "Includi ricerca globale", + "default": false, + "enabled": false, + "visible": true + } + ] +} diff --git a/channels/polpotv.py b/channels/polpotv.py new file mode 100644 index 00000000..b8452b8b --- /dev/null +++ b/channels/polpotv.py @@ -0,0 +1,125 @@ +# -*- coding: utf-8 -*- +# ------------------------------------------------------------ +# kod - XBMC Plugin +# Canale polpotv +# ------------------------------------------------------------ + +from platformcode import logger +from core import scrapertools, httptools +from core.item import Item +from platformcode import config +import json +from core import jsontools + +host = "https://polpo.tv" + +headers = [['Accept', 'application/ld+json']] + +def mainlist(item): + logger.info("kod.polpotv mainlist") + itemlist = [Item(channel=item.channel, + title="[COLOR azure]Ultimi Film Aggiunti[/COLOR]", + action="peliculas", + url="%s/api/movies?order[lastReleaseAt]=desc" %host, + thumbnail="http://orig03.deviantart.net/6889/f/2014/079/7/b/movies_and_popcorn_folder_icon_by_matheusgrilo-d7ay4tw.png", + extra="movie"), + Item(channel=item.channel, + action="search", + title="[COLOR yellow]Cerca...[/COLOR]", + extra="movie", + thumbnail="http://orig03.deviantart.net/6889/f/2014/079/7/b/movies_and_popcorn_folder_icon_by_matheusgrilo-d7ay4tw.png"), + ] + return itemlist + +def peliculas(item): + logger.error("kod.polpotv peliculas") + logger.error(item.url) + itemlist = [] + data = httptools.downloadpage(item.url, headers=headers).data + json_object = jsontools.load(data) + + for movie in json_object['hydra:member']: + itemlist.extend(get_itemlist_movie(movie,item)) + + if json_object['hydra:view']['hydra:next'] is not None: + itemlist.append( + Item(channel=item.channel, + action="peliculas", + title="[COLOR lightgreen]" + config.get_localized_string(30992) + "[/COLOR]", + url="%s"%host +json_object['hydra:view']['hydra:next'], + extra=item.extra, + thumbnail="http://badwolfrepo.altervista.org/themes/successivo2.png")) + + return itemlist + +def search(item, texto): + logger.info("kod.polpotv " + item.url + " search " + texto) + itemlist=[] + try: + item.url = host + "/api/movies?originalTitle="+texto+"&translations.name=" +texto + data = httptools.downloadpage(item.url, headers=headers).data + json_object = jsontools.load(data) + for movie in json_object['hydra:member']: + itemlist.extend(get_itemlist_movie(movie,item)) + return itemlist + # Continua la ricerca in caso di errore + except: + import sys + for line in sys.exc_info(): + logger.error("%s" % line) + return [] + +def findvideos(item): + logger.info("kod.polpotv peliculas") + itemlist = [] + data = httptools.downloadpage(item.url, headers=headers).data + json_object = jsontools.load(data) + for video in json_object['hydra:member'][0]['playlist']['videos']: + data = httptools.downloadpage(video['src'], headers={'Origin': host},follow_redirects=None).data + patron = 'href="([^"]+)"' + video_link = scrapertools.find_single_match(data, patron) + itemlist.append( + Item( + channel=item.channel, + action="play", + thumbnail=item.thumbnail, + title=item.title +' [COLOR orange][' +str(video['size'])+ 'p][/COLOR]', + url=video_link, + folder=False)) + + if config.get_videolibrary_support() and len(itemlist) > 0 and item.extra != 'findvideos': + itemlist.append( + Item(channel=item.channel, title="[COLOR yellow]%s[/COLOR]" % config.get_localized_string(30161), url=item.url, + action="add_pelicula_to_library", extra="findvideos", contentTitle=item.contentTitle)) + + return itemlist + +def get_itemlist_movie(movie,item): + itemlist=[] + try: + if movie['originalLanguage']['id']=='it': + scrapedtitle=movie['originalTitle'] + else: + scrapedtitle=movie['translations'][1]['name'] + if scrapedtitle=='': + scrapedtitle=movie['originalTitle'] + except: + scrapedtitle=movie['originalTitle'] + try: + scrapedplot=movie['translations'][1]['overview'] + except: + scrapedplot = "" + scrapedthumbnail = "" + itemlist.append( + Item(channel=item.channel, + action="findvideos", + title="[COLOR azure]" + scrapedtitle + "[/COLOR]", + fulltitle=scrapedtitle, + show=scrapedtitle, + plot=scrapedplot, + thumbnail=scrapedthumbnail, + contentType='movie', + contentTitle=scrapedtitle, + url="%s%s/releases" %(host,movie['@id'] ), + extra=item.extra)) + return itemlist From 4694b7cd3348549eefce7c6efcfbcac54d2cfaa2 Mon Sep 17 00:00:00 2001 From: Whiplash Date: Sat, 19 Oct 2019 22:03:28 +0200 Subject: [PATCH 2/8] [polpoTV] json fix + scraped thumbnail --- channels/polpotv.json | 2 +- channels/polpotv.py | 35 ++++++++++++++++++++++------------- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/channels/polpotv.json b/channels/polpotv.json index 905cb59a..e47c4dca 100644 --- a/channels/polpotv.json +++ b/channels/polpotv.json @@ -1,7 +1,7 @@ { "id": "polpotv", "name": "PolpoTV", - "language": ["it"], + "language": ["ita"], "active": true, "adult": false, "thumbnail": "https://polpo.tv/build/assets/apple-touch-icon-152x152.png", diff --git a/channels/polpotv.py b/channels/polpotv.py index b8452b8b..2a603680 100644 --- a/channels/polpotv.py +++ b/channels/polpotv.py @@ -95,6 +95,7 @@ def findvideos(item): return itemlist def get_itemlist_movie(movie,item): + logger.info("kod.polpotv get_itemlist_movie") itemlist=[] try: if movie['originalLanguage']['id']=='it': @@ -102,24 +103,32 @@ def get_itemlist_movie(movie,item): else: scrapedtitle=movie['translations'][1]['name'] if scrapedtitle=='': - scrapedtitle=movie['originalTitle'] + scrapedtitle=movie['originalTitle'] except: scrapedtitle=movie['originalTitle'] try: scrapedplot=movie['translations'][1]['overview'] except: scrapedplot = "" - scrapedthumbnail = "" + try: + scrapedthumbnail="http://"+movie['posterPath'] + except: + scrapedthumbnail="" + try: + scrapedfanart="http://"+movie['backdropPath'] + except: + scrapedfanart="" itemlist.append( - Item(channel=item.channel, - action="findvideos", - title="[COLOR azure]" + scrapedtitle + "[/COLOR]", - fulltitle=scrapedtitle, - show=scrapedtitle, - plot=scrapedplot, - thumbnail=scrapedthumbnail, - contentType='movie', - contentTitle=scrapedtitle, - url="%s%s/releases" %(host,movie['@id'] ), - extra=item.extra)) + Item(channel=item.channel, + action="findvideos", + title="[COLOR azure]" + scrapedtitle + "[/COLOR]", + fulltitle=scrapedtitle, + show=scrapedtitle, + plot=scrapedplot, + fanart=scrapedfanart, + thumbnail=scrapedthumbnail, + contentType='movie', + contentTitle=scrapedtitle, + url="%s%s/releases" %(host,movie['@id'] ), + extra=item.extra)) return itemlist From 4c987631207901683a427fca164b1db9fedc24db Mon Sep 17 00:00:00 2001 From: Whiplash Date: Sat, 19 Oct 2019 22:55:25 +0200 Subject: [PATCH 3/8] [polpoTV] added menu for genre and year --- channels/polpotv.py | 68 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 56 insertions(+), 12 deletions(-) diff --git a/channels/polpotv.py b/channels/polpotv.py index 2a603680..f80659f3 100644 --- a/channels/polpotv.py +++ b/channels/polpotv.py @@ -8,8 +8,9 @@ from platformcode import logger from core import scrapertools, httptools from core.item import Item from platformcode import config -import json from core import jsontools +import json +import datetime host = "https://polpo.tv" @@ -18,11 +19,22 @@ headers = [['Accept', 'application/ld+json']] def mainlist(item): logger.info("kod.polpotv mainlist") itemlist = [Item(channel=item.channel, - title="[COLOR azure]Ultimi Film Aggiunti[/COLOR]", + title="[COLOR azure]Ultimi Film aggiunti[/COLOR]", action="peliculas", url="%s/api/movies?order[lastReleaseAt]=desc" %host, thumbnail="http://orig03.deviantart.net/6889/f/2014/079/7/b/movies_and_popcorn_folder_icon_by_matheusgrilo-d7ay4tw.png", extra="movie"), + Item(channel=item.channel, + title="[COLOR azure]Film per anno[/COLOR]", + action="search_movie_by_year", + thumbnail="http://orig03.deviantart.net/6889/f/2014/079/7/b/movies_and_popcorn_folder_icon_by_matheusgrilo-d7ay4tw.png", + extra="movie"), + Item(channel=item.channel, + title="[COLOR azure]Film per genere[/COLOR]", + action="search_movie_by_genre", + url="%s/api/genres" %host, + thumbnail="http://orig03.deviantart.net/6889/f/2014/079/7/b/movies_and_popcorn_folder_icon_by_matheusgrilo-d7ay4tw.png", + extra="movie"), Item(channel=item.channel, action="search", title="[COLOR yellow]Cerca...[/COLOR]", @@ -32,8 +44,7 @@ def mainlist(item): return itemlist def peliculas(item): - logger.error("kod.polpotv peliculas") - logger.error(item.url) + logger.info("kod.polpotv peliculas") itemlist = [] data = httptools.downloadpage(item.url, headers=headers).data json_object = jsontools.load(data) @@ -41,14 +52,17 @@ def peliculas(item): for movie in json_object['hydra:member']: itemlist.extend(get_itemlist_movie(movie,item)) - if json_object['hydra:view']['hydra:next'] is not None: - itemlist.append( - Item(channel=item.channel, - action="peliculas", - title="[COLOR lightgreen]" + config.get_localized_string(30992) + "[/COLOR]", - url="%s"%host +json_object['hydra:view']['hydra:next'], - extra=item.extra, - thumbnail="http://badwolfrepo.altervista.org/themes/successivo2.png")) + try: + if json_object['hydra:view']['hydra:next'] is not None: + itemlist.append( + Item(channel=item.channel, + action="peliculas", + title="[COLOR lightgreen]" + config.get_localized_string(30992) + "[/COLOR]", + url="%s"%host +json_object['hydra:view']['hydra:next'], + extra=item.extra, + thumbnail="http://badwolfrepo.altervista.org/themes/successivo2.png")) + except: + pass return itemlist @@ -69,6 +83,36 @@ def search(item, texto): logger.error("%s" % line) return [] +def search_movie_by_genre(item): + logger.info("kod.polpotv search_movie_by_genre") + itemlist = [] + data = httptools.downloadpage(item.url, headers=headers).data + json_object = jsontools.load(data) + for genre in json_object['hydra:member']: + itemlist.append( + Item(channel=item.channel, + action="peliculas", + title="[COLOR azure]" + genre['name'] + "[/COLOR]", + contentType='movie', + url="%s/api/movies?genres.id=%s" %(host,genre['id']), + extra=item.extra)) + return itemlist + +def search_movie_by_year(item): + logger.info("kod.polpo.tv search_movie_by_year") + now = datetime.datetime.now() + year = int(now.year) + result = [] + for i in range(100): + year_to_search = year - i + result.append(Item(channel=item.channel, + url="%s/api/movies?releaseDate=%s" %(host,year_to_search), + plot="1", + type="movie", + title="[COLOR azure]%s[/COLOR]" % year_to_search, + action="peliculas")) + return result + def findvideos(item): logger.info("kod.polpotv peliculas") itemlist = [] From 35e8e044176d1b676e8211efa1cefe6ebf2cfeb2 Mon Sep 17 00:00:00 2001 From: Whiplash Date: Sat, 19 Oct 2019 23:03:09 +0200 Subject: [PATCH 4/8] [polpoTV] next page icon updated --- channels/polpotv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels/polpotv.py b/channels/polpotv.py index f80659f3..7600601e 100644 --- a/channels/polpotv.py +++ b/channels/polpotv.py @@ -60,7 +60,7 @@ def peliculas(item): title="[COLOR lightgreen]" + config.get_localized_string(30992) + "[/COLOR]", url="%s"%host +json_object['hydra:view']['hydra:next'], extra=item.extra, - thumbnail="http://badwolfrepo.altervista.org/themes/successivo2.png")) + thumbnail="http://2.bp.blogspot.com/-fE9tzwmjaeQ/UcM2apxDtjI/AAAAAAAAeeg/WKSGM2TADLM/s1600/pager+old.png")) except: pass From 1058007e7d7973909e30fa427179997852dcbb9e Mon Sep 17 00:00:00 2001 From: Whiplash Date: Sat, 19 Oct 2019 23:20:28 +0200 Subject: [PATCH 5/8] [polpoTV] added tmdbid in item infoLabels --- channels/polpotv.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/channels/polpotv.py b/channels/polpotv.py index 7600601e..b6c7816c 100644 --- a/channels/polpotv.py +++ b/channels/polpotv.py @@ -162,6 +162,8 @@ def get_itemlist_movie(movie,item): scrapedfanart="http://"+movie['backdropPath'] except: scrapedfanart="" + infoLabels = {} + infoLabels['tmdbid']=movie['tmdbId'] itemlist.append( Item(channel=item.channel, action="findvideos", @@ -174,5 +176,6 @@ def get_itemlist_movie(movie,item): contentType='movie', contentTitle=scrapedtitle, url="%s%s/releases" %(host,movie['@id'] ), + infoLabels=infoLabels, extra=item.extra)) return itemlist From fd60565435f75d9ecc8e299452b79a3b01bb8992 Mon Sep 17 00:00:00 2001 From: Whiplash Date: Sun, 20 Oct 2019 23:35:05 +0200 Subject: [PATCH 6/8] [PolpoTV] KoD tuning + support mini mod --- channels.json | 1 + channels/polpotv.py | 90 +++++++++++++++++++-------------------------- core/support.py | 2 +- 3 files changed, 39 insertions(+), 54 deletions(-) diff --git a/channels.json b/channels.json index e42f75b6..7757e518 100644 --- a/channels.json +++ b/channels.json @@ -41,6 +41,7 @@ "mondolunatico2": "https://mondolunatico.org/stream", "mondoserietv": "https://mondoserietv.com", "piratestreaming": "https://www.piratestreaming.media", + "polpotv": "https://polpo.tv", "seriehd": "https://www.seriehd.zone", "serietvonline": "https://serietvonline.tech", "serietvsubita": "http://serietvsubita.xyz", diff --git a/channels/polpotv.py b/channels/polpotv.py index b6c7816c..77833849 100644 --- a/channels/polpotv.py +++ b/channels/polpotv.py @@ -5,43 +5,29 @@ # ------------------------------------------------------------ from platformcode import logger -from core import scrapertools, httptools +from core import scrapertools, httptools, support from core.item import Item from platformcode import config from core import jsontools import json import datetime -host = "https://polpo.tv" +__channel__ = "polpotv" +host = config.get_channel_url(__channel__) headers = [['Accept', 'application/ld+json']] +list_servers = ['directo'] +list_quality = ['1080p','720p','480p','360p'] + +@support.menu def mainlist(item): - logger.info("kod.polpotv mainlist") - itemlist = [Item(channel=item.channel, - title="[COLOR azure]Ultimi Film aggiunti[/COLOR]", - action="peliculas", - url="%s/api/movies?order[lastReleaseAt]=desc" %host, - thumbnail="http://orig03.deviantart.net/6889/f/2014/079/7/b/movies_and_popcorn_folder_icon_by_matheusgrilo-d7ay4tw.png", - extra="movie"), - Item(channel=item.channel, - title="[COLOR azure]Film per anno[/COLOR]", - action="search_movie_by_year", - thumbnail="http://orig03.deviantart.net/6889/f/2014/079/7/b/movies_and_popcorn_folder_icon_by_matheusgrilo-d7ay4tw.png", - extra="movie"), - Item(channel=item.channel, - title="[COLOR azure]Film per genere[/COLOR]", - action="search_movie_by_genre", - url="%s/api/genres" %host, - thumbnail="http://orig03.deviantart.net/6889/f/2014/079/7/b/movies_and_popcorn_folder_icon_by_matheusgrilo-d7ay4tw.png", - extra="movie"), - Item(channel=item.channel, - action="search", - title="[COLOR yellow]Cerca...[/COLOR]", - extra="movie", - thumbnail="http://orig03.deviantart.net/6889/f/2014/079/7/b/movies_and_popcorn_folder_icon_by_matheusgrilo-d7ay4tw.png"), - ] - return itemlist + film = [ + ('Ultimi Film aggiunti', ['/api/movies?order[lastReleaseAt]=desc', 'peliculas', '']), + ('Generi', ['/api/genres', 'search_movie_by_genre', '']), + ('Anni', ['', 'search_movie_by_year', '']), + ] + return locals() def peliculas(item): logger.info("kod.polpotv peliculas") @@ -82,7 +68,7 @@ def search(item, texto): for line in sys.exc_info(): logger.error("%s" % line) return [] - + def search_movie_by_genre(item): logger.info("kod.polpotv search_movie_by_genre") itemlist = [] @@ -102,41 +88,39 @@ def search_movie_by_year(item): logger.info("kod.polpo.tv search_movie_by_year") now = datetime.datetime.now() year = int(now.year) - result = [] + itemlist = [] for i in range(100): year_to_search = year - i - result.append(Item(channel=item.channel, + itemlist.append(Item(channel=item.channel, url="%s/api/movies?releaseDate=%s" %(host,year_to_search), plot="1", type="movie", title="[COLOR azure]%s[/COLOR]" % year_to_search, action="peliculas")) - return result + return itemlist def findvideos(item): logger.info("kod.polpotv peliculas") itemlist = [] - data = httptools.downloadpage(item.url, headers=headers).data - json_object = jsontools.load(data) - for video in json_object['hydra:member'][0]['playlist']['videos']: - data = httptools.downloadpage(video['src'], headers={'Origin': host},follow_redirects=None).data - patron = 'href="([^"]+)"' - video_link = scrapertools.find_single_match(data, patron) - itemlist.append( - Item( - channel=item.channel, - action="play", - thumbnail=item.thumbnail, - title=item.title +' [COLOR orange][' +str(video['size'])+ 'p][/COLOR]', - url=video_link, - folder=False)) - - if config.get_videolibrary_support() and len(itemlist) > 0 and item.extra != 'findvideos': - itemlist.append( - Item(channel=item.channel, title="[COLOR yellow]%s[/COLOR]" % config.get_localized_string(30161), url=item.url, - action="add_pelicula_to_library", extra="findvideos", contentTitle=item.contentTitle)) - - return itemlist + try: + data = httptools.downloadpage(item.url, headers=headers).data + json_object = jsontools.load(data) + for video in json_object['hydra:member'][0]['playlist']['videos']: + data = httptools.downloadpage(video['src'], headers={'Origin': host},follow_redirects=None).data + patron = 'href="([^"]+)"' + video_link = scrapertools.find_single_match(data, patron) + itemlist.append( + Item( + channel=item.channel, + action="play", + thumbnail=item.thumbnail, + url=video_link, + server='directo', + quality=str(video['size'])+ 'p', + folder=False)) + except: + pass + return support.server(item, itemlist=itemlist) def get_itemlist_movie(movie,item): logger.info("kod.polpotv get_itemlist_movie") @@ -167,7 +151,7 @@ def get_itemlist_movie(movie,item): itemlist.append( Item(channel=item.channel, action="findvideos", - title="[COLOR azure]" + scrapedtitle + "[/COLOR]", + title="[COLOR azure]"+ scrapedtitle + "[/COLOR]" + " [COLOR yellow]["+movie['lastQuality']+"][/COLOR] ", fulltitle=scrapedtitle, show=scrapedtitle, plot=scrapedplot, diff --git a/core/support.py b/core/support.py index 8a58591c..11db7ebb 100644 --- a/core/support.py +++ b/core/support.py @@ -891,7 +891,7 @@ def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=Tru for videoitem in itemlist: item.title = item.contentTitle if config.get_localized_string(30161) in item.title else item.title - videoitem.title = item.title + typo(videoitem.title, '_ color kod []') + (typo(videoitem.quality, '_ color kod []') if videoitem.quality else "") + videoitem.title = item.title + (typo(videoitem.title, '_ color kod []') if videoitem.title else "") + (typo(videoitem.quality, '_ color kod []') if videoitem.quality else "") videoitem.fulltitle = item.fulltitle videoitem.show = item.show videoitem.thumbnail = item.thumbnail From 672fe67c480433679d51df829dbe5cf7a05d73b6 Mon Sep 17 00:00:00 2001 From: Whiplash Date: Sun, 27 Oct 2019 14:08:10 +0100 Subject: [PATCH 7/8] [polpotv] fix wrong merge --- channels/polpotv.json | 20 +---------- channels/polpotv.py | 84 ------------------------------------------- 2 files changed, 1 insertion(+), 103 deletions(-) diff --git a/channels/polpotv.json b/channels/polpotv.json index 168fdd31..b49a1a77 100644 --- a/channels/polpotv.json +++ b/channels/polpotv.json @@ -4,28 +4,10 @@ "language": ["ita"], "active": true, "adult": false, -<<<<<<< HEAD - "thumbnail": "https://polpo.tv/build/assets/apple-touch-icon-152x152.png", - "banner": "https://polpo.tv/build/assets/apple-touch-icon-152x152.png", - "categories": [ - "movie" - ], - "settings": [ - { - "id": "include_in_global_search", - "type": "bool", - "label": "Includi ricerca globale", - "default": false, - "enabled": false, - "visible": true - } - ] -======= "thumbnail": "polpotv.png", "banner": "polpotv.png", "categories": ["movie"], "not_active":[], "default_off":["include_in_newest"], "settings": [] ->>>>>>> 6bc4b7199c1eed191a4b9c8f1e066c368126c872 -} +} \ No newline at end of file diff --git a/channels/polpotv.py b/channels/polpotv.py index f047fc64..49d8f2d2 100644 --- a/channels/polpotv.py +++ b/channels/polpotv.py @@ -1,18 +1,5 @@ # -*- coding: utf-8 -*- # ------------------------------------------------------------ -<<<<<<< HEAD -# kod - XBMC Plugin -# Canale polpotv -# ------------------------------------------------------------ - -from platformcode import logger -from core import scrapertools, httptools, support -from core.item import Item -from platformcode import config -from core import jsontools -import json -import datetime -======= # KoD - XBMC Plugin # Canale polpotv # ------------------------------------------------------------ @@ -21,7 +8,6 @@ from core import scrapertools, httptools, support, jsontools from core.item import Item from platformcode import config import json, datetime ->>>>>>> 6bc4b7199c1eed191a4b9c8f1e066c368126c872 __channel__ = "polpotv" host = config.get_channel_url(__channel__) @@ -33,17 +19,6 @@ list_quality = ['1080p','720p','480p','360p'] @support.menu def mainlist(item): -<<<<<<< HEAD - film = [ - ('Ultimi Film aggiunti', ['/api/movies?order[lastReleaseAt]=desc', 'peliculas', '']), - ('Generi', ['/api/genres', 'search_movie_by_genre', '']), - ('Anni', ['', 'search_movie_by_year', '']), - ] - return locals() - -def peliculas(item): - logger.info("kod.polpotv peliculas") -======= menu = [ ('Ultimi Film aggiunti', ['/api/movies?order[lastReleaseAt]=desc', 'peliculas', '']), ('Generi', ['/api/genres', 'search_movie_by_genre', '']), @@ -62,7 +37,6 @@ def newest(categoria): def peliculas(item): support.log() ->>>>>>> 6bc4b7199c1eed191a4b9c8f1e066c368126c872 itemlist = [] data = httptools.downloadpage(item.url, headers=headers).data json_object = jsontools.load(data) @@ -71,23 +45,6 @@ def peliculas(item): itemlist.extend(get_itemlist_movie(movie,item)) try: -<<<<<<< HEAD - if json_object['hydra:view']['hydra:next'] is not None: - itemlist.append( - Item(channel=item.channel, - action="peliculas", - title="[COLOR lightgreen]" + config.get_localized_string(30992) + "[/COLOR]", - url="%s"%host +json_object['hydra:view']['hydra:next'], - extra=item.extra, - thumbnail="http://2.bp.blogspot.com/-fE9tzwmjaeQ/UcM2apxDtjI/AAAAAAAAeeg/WKSGM2TADLM/s1600/pager+old.png")) - except: - pass - - return itemlist - -def search(item, texto): - logger.info("kod.polpotv " + item.url + " search " + texto) -======= if support.inspect.stack()[1][3] not in ['newest']: support.nextPage(itemlist, item, next_page=json_object['hydra:view']['hydra:next']) except: @@ -97,7 +54,6 @@ def search(item, texto): def search(item, texto): support.log(item.url, "search", texto) ->>>>>>> 6bc4b7199c1eed191a4b9c8f1e066c368126c872 itemlist=[] try: item.url = host + "/api/movies?originalTitle="+texto+"&translations.name=" +texto @@ -106,17 +62,6 @@ def search(item, texto): for movie in json_object['hydra:member']: itemlist.extend(get_itemlist_movie(movie,item)) return itemlist -<<<<<<< HEAD - # Continua la ricerca in caso di errore - except: - import sys - for line in sys.exc_info(): - logger.error("%s" % line) - return [] - -def search_movie_by_genre(item): - logger.info("kod.polpotv search_movie_by_genre") -======= # Continua la ricerca in caso di errore except: import sys @@ -126,7 +71,6 @@ def search_movie_by_genre(item): def search_movie_by_genre(item): support.log() ->>>>>>> 6bc4b7199c1eed191a4b9c8f1e066c368126c872 itemlist = [] data = httptools.downloadpage(item.url, headers=headers).data json_object = jsontools.load(data) @@ -134,16 +78,6 @@ def search_movie_by_genre(item): itemlist.append( Item(channel=item.channel, action="peliculas", -<<<<<<< HEAD - title="[COLOR azure]" + genre['name'] + "[/COLOR]", - contentType='movie', - url="%s/api/movies?genres.id=%s" %(host,genre['id']), - extra=item.extra)) - return itemlist - -def search_movie_by_year(item): - logger.info("kod.polpo.tv search_movie_by_year") -======= title=support.typo(genre['name'],'bold'), contentType='movie', url="%s/api/movies?genres.id=%s" %(host,genre['id']), @@ -152,7 +86,6 @@ def search_movie_by_year(item): def search_movie_by_year(item): support.log() ->>>>>>> 6bc4b7199c1eed191a4b9c8f1e066c368126c872 now = datetime.datetime.now() year = int(now.year) itemlist = [] @@ -162,21 +95,12 @@ def search_movie_by_year(item): url="%s/api/movies?releaseDate=%s" %(host,year_to_search), plot="1", type="movie", -<<<<<<< HEAD - title="[COLOR azure]%s[/COLOR]" % year_to_search, - action="peliculas")) - return itemlist - -def findvideos(item): - logger.info("kod.polpotv peliculas") -======= title=support.typo(year_to_search,'bold'), action="peliculas")) return itemlist def findvideos(item): support.log() ->>>>>>> 6bc4b7199c1eed191a4b9c8f1e066c368126c872 itemlist = [] try: data = httptools.downloadpage(item.url, headers=headers).data @@ -199,11 +123,7 @@ def findvideos(item): return support.server(item, itemlist=itemlist) def get_itemlist_movie(movie,item): -<<<<<<< HEAD - logger.info("kod.polpotv get_itemlist_movie") -======= support.log() ->>>>>>> 6bc4b7199c1eed191a4b9c8f1e066c368126c872 itemlist=[] try: if movie['originalLanguage']['id']=='it': @@ -231,11 +151,7 @@ def get_itemlist_movie(movie,item): itemlist.append( Item(channel=item.channel, action="findvideos", -<<<<<<< HEAD - title="[COLOR azure]"+ scrapedtitle + "[/COLOR]" + " [COLOR yellow]["+movie['lastQuality']+"][/COLOR] ", -======= title=support.typo(scrapedtitle,'bold') + support.typo(movie['lastQuality'].upper(), '_ [] color kod bold'), ->>>>>>> 6bc4b7199c1eed191a4b9c8f1e066c368126c872 fulltitle=scrapedtitle, show=scrapedtitle, plot=scrapedplot, From 816c97ad46dd316fcd20acea4556834ef24fa2d8 Mon Sep 17 00:00:00 2001 From: Whiplash Date: Thu, 7 Nov 2019 23:44:47 +0100 Subject: [PATCH 8/8] [polpotv] movie list url update --- channels/polpotv.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/channels/polpotv.py b/channels/polpotv.py index 49d8f2d2..a3a268a0 100644 --- a/channels/polpotv.py +++ b/channels/polpotv.py @@ -20,7 +20,7 @@ list_quality = ['1080p','720p','480p','360p'] @support.menu def mainlist(item): menu = [ - ('Ultimi Film aggiunti', ['/api/movies?order[lastReleaseAt]=desc', 'peliculas', '']), + ('Ultimi Film aggiunti', ['/api/movies?order[releaseDate]=desc&lastReleaseAt[null]=false', 'peliculas', '']), ('Generi', ['/api/genres', 'search_movie_by_genre', '']), ('Anni {film}', ['', 'search_movie_by_year', '']), ('Cerca Film... bold', ['', 'search', '']) @@ -32,7 +32,7 @@ def newest(categoria): item = Item() if categoria == 'peliculas': item.contentType = 'movie' - item.url = host + '/api/movies?order[lastReleaseAt]=desc' + item.url = host + '/api/movies?order[releaseDate]=desc&lastReleaseAt[null]=false' return peliculas(item) def peliculas(item):