Merge remote-tracking branch 'origin/master'

This commit is contained in:
marco
2019-10-22 18:04:16 +02:00
246 changed files with 74 additions and 7819 deletions

View File

@@ -75,14 +75,16 @@ def peliculas(item):
def itemHook(item):
if item.quality1:
item.title = item.title + support.typo(item.quality1, '_ [] color kod')
item.quality = item.quality1
item.title += support.typo(item.quality, '_ [] color kod')
if item.lang2:
item.contentLanguage = item.lang2
item.title = item.title + support.typo(item.lang2, '_ [] color kod')
item.title += support.typo(item.lang2, '_ [] color kod')
if item.args == 'novita':
item.title = item.title
return item
#debug = True # True per testare le regex sul sito
## debug = True # True per testare le regex sul sito
return locals()
@support.scrape
@@ -95,7 +97,7 @@ def episodios(item):
item.contentType = 'tvshow'
blacklist = ['']
patron = r'(?P<episode>\d+(?:&#215;|×)?\d+\-\d+|\d+(?:&#215;|×)\d+)[;]?(?:(?P<title>[^<]+)<(?P<url>.*?)|(\2[ ])(?:<(\3.*?)))(?:<br />|</p>)'
patronBlock = r'<strong>(?P<block>(?:.+?Stagione*.+?(?P<lang>ITA|Sub-ITA))?(?:.+?|</strong>)(/?:</span>)?</p>.*?</p>)'
patronBlock = r'<strong>(?P<block>(?:.+?Stagione*.+?(?P<lang>[Ii][Tt][Aa]|[Ss][Uu][Bb][\-]?[iI][tT][aA]))?(?:.+?|</strong>)(/?:</span>)?</p>.*?</p>)'
## debug = True
return locals()
@@ -172,6 +174,7 @@ def newest(categoria):
if categoria == 'series':
item.contentType = 'tvshow'
item.url = host+'/aggiornamenti-serie-tv'
item.args = 'novita'
else:
item.contentType = 'movie'
item.url = host+'/category/film'

View File

@@ -4,19 +4,10 @@
"language": ["ita"],
"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
}
]
"thumbnail": "polpotv.png",
"banner": "polpotv.png",
"categories": ["movie"],
"not_active":[],
"default_off":["include_in_newest"],
"settings": []
}

View File

@@ -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,

View File

@@ -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)]
}

View File

@@ -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

View File

@@ -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())

View File

@@ -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):

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: 118 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: 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: 58 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: 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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

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