Merge branch 'master' of github.com:kodiondemand/addon

* 'master' of github.com:kodiondemand/addon:
  Loghi Canali e Servers in Remoto
  Tema di Default spostato online
  Modifiche Grafiche PolpoTV
This commit is contained in:
greko17
2019-10-22 18:00:09 +02:00
245 changed files with 58 additions and 7796 deletions
+3 -2
View File
@@ -7,6 +7,7 @@
"thumbnail": "polpotv.png", "thumbnail": "polpotv.png",
"banner": "polpotv.png", "banner": "polpotv.png",
"categories": ["movie"], "categories": ["movie"],
"not_active":["include_in_newest"], "not_active":[],
"settings": [] "default_off":["include_in_newest"],
"settings": []
} }
+31 -24
View File
@@ -1,16 +1,13 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# ------------------------------------------------------------ # ------------------------------------------------------------
# kod - XBMC Plugin # KoD - XBMC Plugin
# Canale polpotv # Canale polpotv
# ------------------------------------------------------------ # ------------------------------------------------------------
from platformcode import logger from core import scrapertools, httptools, support, jsontools
from core import scrapertools, httptools, support
from core.item import Item from core.item import Item
from platformcode import config from platformcode import config
from core import jsontools import json, datetime
import json
import datetime
__channel__ = "polpotv" __channel__ = "polpotv"
host = config.get_channel_url(__channel__) host = config.get_channel_url(__channel__)
@@ -25,12 +22,21 @@ def mainlist(item):
menu = [ menu = [
('Ultimi Film aggiunti', ['/api/movies?order[lastReleaseAt]=desc', 'peliculas', '']), ('Ultimi Film aggiunti', ['/api/movies?order[lastReleaseAt]=desc', 'peliculas', '']),
('Generi', ['/api/genres', 'search_movie_by_genre', '']), ('Generi', ['/api/genres', 'search_movie_by_genre', '']),
('Anni', ['', 'search_movie_by_year', '']), ('Anni {film}', ['', 'search_movie_by_year', '']),
('Cerca Film... bold', ['', 'search', ''])
] ]
return locals() return locals()
def newest(categoria):
support.log()
item = Item()
if categoria == 'peliculas':
item.contentType = 'movie'
item.url = host + '/api/movies?order[lastReleaseAt]=desc'
return peliculas(item)
def peliculas(item): def peliculas(item):
logger.info("kod.polpotv peliculas") support.log()
itemlist = [] itemlist = []
data = httptools.downloadpage(item.url, headers=headers).data data = httptools.downloadpage(item.url, headers=headers).data
json_object = jsontools.load(data) json_object = jsontools.load(data)
@@ -39,14 +45,15 @@ def peliculas(item):
itemlist.extend(get_itemlist_movie(movie,item)) itemlist.extend(get_itemlist_movie(movie,item))
try: try:
itemlist = support.nextPage(itemlist, item, next_page=json_object['hydra:view']['hydra:next']) if support.inspect.stack()[1][3] not in ['newest']:
support.nextPage(itemlist, item, next_page=json_object['hydra:view']['hydra:next'])
except: except:
pass pass
return itemlist return itemlist
def search(item, texto): def search(item, texto):
logger.info("kod.polpotv " + item.url + " search " + texto) support.log(item.url, "search", texto)
itemlist=[] itemlist=[]
try: try:
item.url = host + "/api/movies?originalTitle="+texto+"&translations.name=" +texto item.url = host + "/api/movies?originalTitle="+texto+"&translations.name=" +texto
@@ -55,15 +62,15 @@ def search(item, texto):
for movie in json_object['hydra:member']: for movie in json_object['hydra:member']:
itemlist.extend(get_itemlist_movie(movie,item)) itemlist.extend(get_itemlist_movie(movie,item))
return itemlist return itemlist
# Continua la ricerca in caso di errore # Continua la ricerca in caso di errore
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
logger.error("%s" % line) support.logger.error("%s" % line)
return [] return []
def search_movie_by_genre(item): def search_movie_by_genre(item):
logger.info("kod.polpotv search_movie_by_genre") support.log()
itemlist = [] itemlist = []
data = httptools.downloadpage(item.url, headers=headers).data data = httptools.downloadpage(item.url, headers=headers).data
json_object = jsontools.load(data) json_object = jsontools.load(data)
@@ -71,14 +78,14 @@ def search_movie_by_genre(item):
itemlist.append( itemlist.append(
Item(channel=item.channel, Item(channel=item.channel,
action="peliculas", action="peliculas",
title="[COLOR azure]" + genre['name'] + "[/COLOR]", title=support.typo(genre['name'],'bold'),
contentType='movie', contentType='movie',
url="%s/api/movies?genres.id=%s" %(host,genre['id']), url="%s/api/movies?genres.id=%s" %(host,genre['id']),
extra=item.extra)) extra=item.extra))
return itemlist return support.thumb(itemlist, True)
def search_movie_by_year(item): def search_movie_by_year(item):
logger.info("kod.polpo.tv search_movie_by_year") support.log()
now = datetime.datetime.now() now = datetime.datetime.now()
year = int(now.year) year = int(now.year)
itemlist = [] itemlist = []
@@ -88,12 +95,12 @@ def search_movie_by_year(item):
url="%s/api/movies?releaseDate=%s" %(host,year_to_search), url="%s/api/movies?releaseDate=%s" %(host,year_to_search),
plot="1", plot="1",
type="movie", type="movie",
title="[COLOR azure]%s[/COLOR]" % year_to_search, title=support.typo(year_to_search,'bold'),
action="peliculas")) action="peliculas"))
return itemlist return itemlist
def findvideos(item): def findvideos(item):
logger.info("kod.polpotv peliculas") support.log()
itemlist = [] itemlist = []
try: try:
data = httptools.downloadpage(item.url, headers=headers).data data = httptools.downloadpage(item.url, headers=headers).data
@@ -116,7 +123,7 @@ def findvideos(item):
return support.server(item, itemlist=itemlist) return support.server(item, itemlist=itemlist)
def get_itemlist_movie(movie,item): def get_itemlist_movie(movie,item):
logger.info("kod.polpotv get_itemlist_movie") support.log()
itemlist=[] itemlist=[]
try: try:
if movie['originalLanguage']['id']=='it': if movie['originalLanguage']['id']=='it':
@@ -144,7 +151,7 @@ def get_itemlist_movie(movie,item):
itemlist.append( itemlist.append(
Item(channel=item.channel, Item(channel=item.channel,
action="findvideos", action="findvideos",
title=scrapedtitle + " " + support.typo(movie['lastQuality'].upper(), '[] color kod'), title=support.typo(scrapedtitle,'bold') + support.typo(movie['lastQuality'].upper(), '_ [] color kod bold'),
fulltitle=scrapedtitle, fulltitle=scrapedtitle,
show=scrapedtitle, show=scrapedtitle,
plot=scrapedplot, plot=scrapedplot,
+16 -21
View File
@@ -263,20 +263,15 @@ def get_thumb(thumb_name, view="thumb_", auto=False):
thumb_name = unify.set_genre(unify.simplify(thumb_name)) thumb_name = unify.set_genre(unify.simplify(thumb_name))
if thumb_name in thumb_dict: if thumb_name in thumb_dict:
thumbnail = thumb_dict[thumb_name] thumbnail = thumb_dict[thumb_name]
return thumbnail return thumbnail
else: else:
icon_pack_name = config.get_setting('icon_set', default="default") icon_pack_name = config.get_setting('icon_set', default="default")
resource_path = os.path.join(config.get_runtime_path(), "resources", "media", "themes") media_path = os.path.join("https://raw.githubusercontent.com/kodiondemand/media/master/themes/", icon_pack_name)
media_path = os.path.join(resource_path, icon_pack_name)
if os.path.isdir(media_path) == False: if config.get_setting('enable_custom_theme') and config.get_setting('custom_theme') and os.path.isfile(config.get_setting('custom_theme') + view + thumb_name):
media_path = os.path.join("https://raw.githubusercontent.com/kodiondemand/media/master/themes/", icon_pack_name)
elif config.get_setting('enable_custom_theme') and config.get_setting('custom_theme') and os.path.isfile(config.get_setting('custom_theme') + view + thumb_name):
media_path = config.get_setting('custom_theme') media_path = config.get_setting('custom_theme')
return os.path.join(media_path, view + thumb_name) return os.path.join(media_path, view + thumb_name)
@@ -355,39 +350,39 @@ def thumb(itemlist=[], genre=False):
icon_dict = {'channels_movie':['film'], icon_dict = {'channels_movie':['film'],
'channels_tvshow':['serie','tv','episodi','episodio'], 'channels_tvshow':['serie','tv','episodi','episodio'],
'channels_documentary':['documentari','documentario'], 'channels_documentary':['documentari','documentario', 'documentary'],
'channels_all':['tutti'], 'channels_all':['tutti'],
'news':['novità', "novita'", 'aggiornamenti', 'nuovi', 'nuove'], 'news':['novità', "novita'", 'aggiornamenti', 'nuovi', 'nuove'],
'now_playing':['cinema', 'in sala'], 'now_playing':['cinema', 'in sala'],
'channels_anime':['anime'], 'channels_anime':['anime'],
'genres':['genere', 'generi', 'categorie', 'categoria'], 'genres':['genere', 'generi', 'categorie', 'categoria'],
'channels_animation': ['animazione', 'cartoni', 'cartoon'], 'channels_animation': ['animazione', 'cartoni', 'cartoon', 'animation'],
'channels_action':['azione', 'arti marziali'], 'channels_action':['azione', 'arti marziali', 'action'],
'channels_adventure': ['avventura'], 'channels_adventure': ['avventura', 'adventure'],
'channels_biographical':['biografico'], 'channels_biographical':['biografico'],
'channels_comedy':['comico','commedia', 'demenziale'], 'channels_comedy':['comico','commedia', 'demenziale', 'comedy'],
'channels_adult':['erotico', 'hentai'], 'channels_adult':['erotico', 'hentai'],
'channels_drama':['drammatico', 'drama'], 'channels_drama':['drammatico', 'drama'],
'channels_syfy':['fantascienza'], 'channels_syfy':['fantascienza', 'science fiction'],
'channels_fantasy':['fantasy'], 'channels_fantasy':['fantasy'],
'channels_crime':['gangster','poliziesco'], 'channels_crime':['gangster','poliziesco', 'crime'],
'channels_grotesque':['grottesco'], 'channels_grotesque':['grottesco'],
'channels_war':['guerra'], 'channels_war':['guerra', 'war'],
'channels_children':['bambini', 'kids'], 'channels_children':['bambini', 'kids'],
'horror':['horror'], 'horror':['horror'],
'lucky': ['fortunato'], 'lucky': ['fortunato'],
'channels_musical':['musical', 'musica'], 'channels_musical':['musical', 'musica', 'music'],
'channels_mistery':['mistero', 'giallo'], 'channels_mistery':['mistero', 'giallo', 'mystery'],
'channels_noir':['noir'], 'channels_noir':['noir'],
'popular' : ['popolari','popolare', 'più visti'], 'popular' : ['popolari','popolare', 'più visti'],
'channels_thriller':['thriller'], 'thriller':['thriller'],
'top_rated' : ['fortunato', 'votati'], 'top_rated' : ['fortunato', 'votati'],
'on_the_air' : ['corso', 'onda'], 'on_the_air' : ['corso', 'onda'],
'channels_western':['western'], 'channels_western':['western'],
'channels_vos':['sub','sub-ita'], 'channels_vos':['sub','sub-ita'],
'channels_romance':['romantico','sentimentale'], 'channels_romance':['romantico','sentimentale', 'romance'],
'channels_family':['famiglia','famiglie'], 'channels_family':['famiglia','famiglie', 'family'],
'channels_historical':['storico'], 'channels_historical':['storico', 'history'],
'autoplay':[config.get_localized_string(60071)] 'autoplay':[config.get_localized_string(60071)]
} }
+5 -6
View File
@@ -12,6 +12,8 @@ from platformcode import config, logger
DEFAULT_UPDATE_URL = "/channels/" DEFAULT_UPDATE_URL = "/channels/"
dict_channels_parameters = dict() dict_channels_parameters = dict()
remote_path = 'https://raw.githubusercontent.com/kodiondemand/media/master/'
def is_adult(channel_name): def is_adult(channel_name):
logger.info("channel_name=" + channel_name) logger.info("channel_name=" + channel_name)
@@ -56,14 +58,11 @@ def get_channel_parameters(channel_name):
# Imagenes: se admiten url y archivos locales dentro de "resources/images" # Imagenes: se admiten url y archivos locales dentro de "resources/images"
if channel_parameters.get("thumbnail") and "://" not in channel_parameters["thumbnail"]: if channel_parameters.get("thumbnail") and "://" not in channel_parameters["thumbnail"]:
channel_parameters["thumbnail"] = os.path.join(config.get_runtime_path(), "resources", "media", channel_parameters["thumbnail"] = os.path.join(remote_path, 'resources', "thumb", channel_parameters["thumbnail"])
"channels", "thumb", channel_parameters["thumbnail"])
if channel_parameters.get("banner") and "://" not in channel_parameters["banner"]: if channel_parameters.get("banner") and "://" not in channel_parameters["banner"]:
channel_parameters["banner"] = os.path.join(config.get_runtime_path(), "resources", "media", channel_parameters["banner"] = os.path.join(remote_path, 'resources', "banner", channel_parameters["banner"])
"channels", "banner", channel_parameters["banner"])
if channel_parameters.get("fanart") and "://" not in channel_parameters["fanart"]: if channel_parameters.get("fanart") and "://" not in channel_parameters["fanart"]:
channel_parameters["fanart"] = os.path.join(config.get_runtime_path(), "resources", "media", channel_parameters["fanart"] = os.path.join(remote_path, 'resources', "fanart", channel_parameters["fanart"])
"channels", "fanart", channel_parameters["fanart"])
# Obtenemos si el canal tiene opciones de configuración # Obtenemos si el canal tiene opciones de configuración
channel_parameters["has_settings"] = False channel_parameters["has_settings"] = False
+1 -2
View File
@@ -458,8 +458,7 @@ def get_server_parameters(server):
# Imagenes: se admiten url y archivos locales dentro de "resources/images" # Imagenes: se admiten url y archivos locales dentro de "resources/images"
if dict_server.get("thumbnail") and "://" not in dict_server["thumbnail"]: if dict_server.get("thumbnail") and "://" not in dict_server["thumbnail"]:
dict_server["thumbnail"] = os.path.join(config.get_runtime_path(), "resources", "media", dict_server["thumbnail"] = os.path.join("https://raw.githubusercontent.com/kodiondemand/media/master/resources/servers", dict_server["thumbnail"])
"servers", dict_server["thumbnail"])
for k in ['premium', 'id']: for k in ['premium', 'id']:
dict_server[k] = dict_server.get(k, list()) dict_server[k] = dict_server.get(k, list())
+2 -2
View File
@@ -704,7 +704,7 @@ def typo(string, typography=''):
kod_color = '0xFF65B3DA' #'0xFF0081C2' kod_color = '0xFF65B3DA' #'0xFF0081C2'
string = str(string)
# Check if the typographic attributes are in the string or outside # Check if the typographic attributes are in the string or outside
if typography: if typography:
string = string + ' ' + typography string = string + ' ' + typography
@@ -1000,7 +1000,7 @@ def log(stringa1="", stringa2="", stringa3="", stringa4="", stringa5=""):
frame = inspect.stack()[1] frame = inspect.stack()[1]
filename = frame[0].f_code.co_filename filename = frame[0].f_code.co_filename
filename = os.path.basename(filename) filename = os.path.basename(filename)
logger.info("[" + filename + "] - [" + inspect.stack()[1][3] + "] " + str(stringa1) + str(stringa2) + str(stringa3) + str(stringa4) + str(stringa5)) logger.info("[" + filename + "] - [" + inspect.stack()[1][3] + "] " + str(stringa1) + ( ' ' + str(stringa2) if stringa2 else '') + ( ' ' + str(stringa3) if stringa3 else '') + ( ' ' + str(stringa4) if stringa4 else '') + ( ' ' + str(stringa5) if stringa5 else '') )
def channel_config(item, itemlist): def channel_config(item, itemlist):
Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 306 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 173 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 515 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because it is too large Load Diff
Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Some files were not shown because too many files have changed in this diff Show More