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
@@ -7,6 +7,7 @@
|
||||
"thumbnail": "polpotv.png",
|
||||
"banner": "polpotv.png",
|
||||
"categories": ["movie"],
|
||||
"not_active":["include_in_newest"],
|
||||
"settings": []
|
||||
"not_active":[],
|
||||
"default_off":["include_in_newest"],
|
||||
"settings": []
|
||||
}
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# ------------------------------------------------------------
|
||||
# kod - XBMC Plugin
|
||||
# KoD - XBMC Plugin
|
||||
# Canale polpotv
|
||||
# ------------------------------------------------------------
|
||||
|
||||
from platformcode import logger
|
||||
from core import scrapertools, httptools, support
|
||||
from core import scrapertools, httptools, support, jsontools
|
||||
from core.item import Item
|
||||
from platformcode import config
|
||||
from core import jsontools
|
||||
import json
|
||||
import datetime
|
||||
import json, datetime
|
||||
|
||||
__channel__ = "polpotv"
|
||||
host = config.get_channel_url(__channel__)
|
||||
@@ -25,12 +22,21 @@ def mainlist(item):
|
||||
menu = [
|
||||
('Ultimi Film aggiunti', ['/api/movies?order[lastReleaseAt]=desc', 'peliculas', '']),
|
||||
('Generi', ['/api/genres', 'search_movie_by_genre', '']),
|
||||
('Anni', ['', 'search_movie_by_year', '']),
|
||||
('Anni {film}', ['', 'search_movie_by_year', '']),
|
||||
('Cerca Film... bold', ['', 'search', ''])
|
||||
]
|
||||
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):
|
||||
logger.info("kod.polpotv peliculas")
|
||||
support.log()
|
||||
itemlist = []
|
||||
data = httptools.downloadpage(item.url, headers=headers).data
|
||||
json_object = jsontools.load(data)
|
||||
@@ -39,14 +45,15 @@ def peliculas(item):
|
||||
itemlist.extend(get_itemlist_movie(movie,item))
|
||||
|
||||
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:
|
||||
pass
|
||||
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
logger.info("kod.polpotv " + item.url + " search " + texto)
|
||||
support.log(item.url, "search", texto)
|
||||
itemlist=[]
|
||||
try:
|
||||
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']:
|
||||
itemlist.extend(get_itemlist_movie(movie,item))
|
||||
return itemlist
|
||||
# Continua la ricerca in caso di errore
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error("%s" % line)
|
||||
support.logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
def search_movie_by_genre(item):
|
||||
logger.info("kod.polpotv search_movie_by_genre")
|
||||
support.log()
|
||||
itemlist = []
|
||||
data = httptools.downloadpage(item.url, headers=headers).data
|
||||
json_object = jsontools.load(data)
|
||||
@@ -71,14 +78,14 @@ def search_movie_by_genre(item):
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
action="peliculas",
|
||||
title="[COLOR azure]" + genre['name'] + "[/COLOR]",
|
||||
title=support.typo(genre['name'],'bold'),
|
||||
contentType='movie',
|
||||
url="%s/api/movies?genres.id=%s" %(host,genre['id']),
|
||||
extra=item.extra))
|
||||
return itemlist
|
||||
return support.thumb(itemlist, True)
|
||||
|
||||
def search_movie_by_year(item):
|
||||
logger.info("kod.polpo.tv search_movie_by_year")
|
||||
support.log()
|
||||
now = datetime.datetime.now()
|
||||
year = int(now.year)
|
||||
itemlist = []
|
||||
@@ -88,12 +95,12 @@ def search_movie_by_year(item):
|
||||
url="%s/api/movies?releaseDate=%s" %(host,year_to_search),
|
||||
plot="1",
|
||||
type="movie",
|
||||
title="[COLOR azure]%s[/COLOR]" % year_to_search,
|
||||
title=support.typo(year_to_search,'bold'),
|
||||
action="peliculas"))
|
||||
return itemlist
|
||||
|
||||
return itemlist
|
||||
|
||||
def findvideos(item):
|
||||
logger.info("kod.polpotv peliculas")
|
||||
support.log()
|
||||
itemlist = []
|
||||
try:
|
||||
data = httptools.downloadpage(item.url, headers=headers).data
|
||||
@@ -116,7 +123,7 @@ def findvideos(item):
|
||||
return support.server(item, itemlist=itemlist)
|
||||
|
||||
def get_itemlist_movie(movie,item):
|
||||
logger.info("kod.polpotv get_itemlist_movie")
|
||||
support.log()
|
||||
itemlist=[]
|
||||
try:
|
||||
if movie['originalLanguage']['id']=='it':
|
||||
@@ -144,7 +151,7 @@ def get_itemlist_movie(movie,item):
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
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,
|
||||
show=scrapedtitle,
|
||||
plot=scrapedplot,
|
||||
|
||||
@@ -263,20 +263,15 @@ def get_thumb(thumb_name, view="thumb_", auto=False):
|
||||
|
||||
thumb_name = unify.set_genre(unify.simplify(thumb_name))
|
||||
|
||||
|
||||
if thumb_name in thumb_dict:
|
||||
thumbnail = thumb_dict[thumb_name]
|
||||
return thumbnail
|
||||
|
||||
else:
|
||||
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(resource_path, icon_pack_name)
|
||||
media_path = os.path.join("https://raw.githubusercontent.com/kodiondemand/media/master/themes/", icon_pack_name)
|
||||
|
||||
if os.path.isdir(media_path) == False:
|
||||
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):
|
||||
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 = config.get_setting('custom_theme')
|
||||
|
||||
return os.path.join(media_path, view + thumb_name)
|
||||
@@ -355,39 +350,39 @@ def thumb(itemlist=[], genre=False):
|
||||
|
||||
icon_dict = {'channels_movie':['film'],
|
||||
'channels_tvshow':['serie','tv','episodi','episodio'],
|
||||
'channels_documentary':['documentari','documentario'],
|
||||
'channels_documentary':['documentari','documentario', 'documentary'],
|
||||
'channels_all':['tutti'],
|
||||
'news':['novità', "novita'", 'aggiornamenti', 'nuovi', 'nuove'],
|
||||
'now_playing':['cinema', 'in sala'],
|
||||
'channels_anime':['anime'],
|
||||
'genres':['genere', 'generi', 'categorie', 'categoria'],
|
||||
'channels_animation': ['animazione', 'cartoni', 'cartoon'],
|
||||
'channels_action':['azione', 'arti marziali'],
|
||||
'channels_adventure': ['avventura'],
|
||||
'channels_animation': ['animazione', 'cartoni', 'cartoon', 'animation'],
|
||||
'channels_action':['azione', 'arti marziali', 'action'],
|
||||
'channels_adventure': ['avventura', 'adventure'],
|
||||
'channels_biographical':['biografico'],
|
||||
'channels_comedy':['comico','commedia', 'demenziale'],
|
||||
'channels_comedy':['comico','commedia', 'demenziale', 'comedy'],
|
||||
'channels_adult':['erotico', 'hentai'],
|
||||
'channels_drama':['drammatico', 'drama'],
|
||||
'channels_syfy':['fantascienza'],
|
||||
'channels_syfy':['fantascienza', 'science fiction'],
|
||||
'channels_fantasy':['fantasy'],
|
||||
'channels_crime':['gangster','poliziesco'],
|
||||
'channels_crime':['gangster','poliziesco', 'crime'],
|
||||
'channels_grotesque':['grottesco'],
|
||||
'channels_war':['guerra'],
|
||||
'channels_war':['guerra', 'war'],
|
||||
'channels_children':['bambini', 'kids'],
|
||||
'horror':['horror'],
|
||||
'lucky': ['fortunato'],
|
||||
'channels_musical':['musical', 'musica'],
|
||||
'channels_mistery':['mistero', 'giallo'],
|
||||
'channels_musical':['musical', 'musica', 'music'],
|
||||
'channels_mistery':['mistero', 'giallo', 'mystery'],
|
||||
'channels_noir':['noir'],
|
||||
'popular' : ['popolari','popolare', 'più visti'],
|
||||
'channels_thriller':['thriller'],
|
||||
'thriller':['thriller'],
|
||||
'top_rated' : ['fortunato', 'votati'],
|
||||
'on_the_air' : ['corso', 'onda'],
|
||||
'channels_western':['western'],
|
||||
'channels_vos':['sub','sub-ita'],
|
||||
'channels_romance':['romantico','sentimentale'],
|
||||
'channels_family':['famiglia','famiglie'],
|
||||
'channels_historical':['storico'],
|
||||
'channels_romance':['romantico','sentimentale', 'romance'],
|
||||
'channels_family':['famiglia','famiglie', 'family'],
|
||||
'channels_historical':['storico', 'history'],
|
||||
'autoplay':[config.get_localized_string(60071)]
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ from platformcode import config, logger
|
||||
DEFAULT_UPDATE_URL = "/channels/"
|
||||
dict_channels_parameters = dict()
|
||||
|
||||
remote_path = 'https://raw.githubusercontent.com/kodiondemand/media/master/'
|
||||
|
||||
|
||||
def is_adult(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"
|
||||
if channel_parameters.get("thumbnail") and "://" not in channel_parameters["thumbnail"]:
|
||||
channel_parameters["thumbnail"] = os.path.join(config.get_runtime_path(), "resources", "media",
|
||||
"channels", "thumb", channel_parameters["thumbnail"])
|
||||
channel_parameters["thumbnail"] = os.path.join(remote_path, 'resources', "thumb", channel_parameters["thumbnail"])
|
||||
if channel_parameters.get("banner") and "://" not in channel_parameters["banner"]:
|
||||
channel_parameters["banner"] = os.path.join(config.get_runtime_path(), "resources", "media",
|
||||
"channels", "banner", channel_parameters["banner"])
|
||||
channel_parameters["banner"] = os.path.join(remote_path, 'resources', "banner", channel_parameters["banner"])
|
||||
if channel_parameters.get("fanart") and "://" not in channel_parameters["fanart"]:
|
||||
channel_parameters["fanart"] = os.path.join(config.get_runtime_path(), "resources", "media",
|
||||
"channels", "fanart", channel_parameters["fanart"])
|
||||
channel_parameters["fanart"] = os.path.join(remote_path, 'resources', "fanart", channel_parameters["fanart"])
|
||||
|
||||
# Obtenemos si el canal tiene opciones de configuración
|
||||
channel_parameters["has_settings"] = False
|
||||
|
||||
@@ -458,8 +458,7 @@ def get_server_parameters(server):
|
||||
|
||||
# Imagenes: se admiten url y archivos locales dentro de "resources/images"
|
||||
if dict_server.get("thumbnail") and "://" not in dict_server["thumbnail"]:
|
||||
dict_server["thumbnail"] = os.path.join(config.get_runtime_path(), "resources", "media",
|
||||
"servers", dict_server["thumbnail"])
|
||||
dict_server["thumbnail"] = os.path.join("https://raw.githubusercontent.com/kodiondemand/media/master/resources/servers", dict_server["thumbnail"])
|
||||
for k in ['premium', 'id']:
|
||||
dict_server[k] = dict_server.get(k, list())
|
||||
|
||||
|
||||
@@ -704,7 +704,7 @@ def typo(string, typography=''):
|
||||
|
||||
kod_color = '0xFF65B3DA' #'0xFF0081C2'
|
||||
|
||||
|
||||
string = str(string)
|
||||
# Check if the typographic attributes are in the string or outside
|
||||
if typography:
|
||||
string = string + ' ' + typography
|
||||
@@ -1000,7 +1000,7 @@ def log(stringa1="", stringa2="", stringa3="", stringa4="", stringa5=""):
|
||||
frame = inspect.stack()[1]
|
||||
filename = frame[0].f_code.co_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):
|
||||
|
||||
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 59 KiB |
|
Before Width: | Height: | Size: 306 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 113 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 207 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 128 KiB |
|
Before Width: | Height: | Size: 143 KiB |
|
Before Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 8.2 KiB |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 201 KiB |
|
Before Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 173 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 515 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 145 KiB |
|
Before Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 92 KiB |
|
Before Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 38 KiB |