Riscrittura canale
Riscritto il canale.
Per delle icone del menu vengono inoltre richieste delle modifiche al file channelselector.py
in particolare:
'lucky': ['fortunato'], # se potete inserire la icona anche per questa voce
'channels_musical':['musical'],
'channels_mistery':['mistero', 'giallo'],
'channels_noir':['noir'],
'popular' : ['popolari','popolare', 'più visti'],
'channels_thriller':['thriller'],
'top_rated' : ['fortunato'], #da tocgliere aggiunte la voce lucky o quello che volete
'channels_western':['western'],
This commit is contained in:
@@ -3,17 +3,20 @@
|
||||
# -*- Creato per Alfa-addon -*-
|
||||
# -*- e adattato for KOD -*-
|
||||
# -*- By Greko -*-
|
||||
# -*- last change: 3/05/2019
|
||||
# -*- last change: 04/05/2019
|
||||
|
||||
|
||||
from channels import autoplay, support, filtertools
|
||||
|
||||
from channelselector import get_thumb
|
||||
from channels import autoplay
|
||||
from channels import filtertools
|
||||
|
||||
from core import httptools
|
||||
from core import channeltools
|
||||
from core import scrapertools
|
||||
from core import servertools
|
||||
from core.item import Item
|
||||
from core import channeltools
|
||||
from core import tmdb
|
||||
from core.item import Item
|
||||
|
||||
from platformcode import config, logger
|
||||
|
||||
__channel__ = "altadefinizione01_link"
|
||||
@@ -24,23 +27,7 @@ __channel__ = "altadefinizione01_link"
|
||||
#host = "http://altadefinizione01.date/" #aggiornato al 3 maggio 2019
|
||||
host = "https://altadefinizione01.voto/" #aggiornato al 3 maggio 2019
|
||||
|
||||
# ======== def per utility INIZIO =============================
|
||||
try:
|
||||
__modo_grafico__ = config.get_setting('modo_grafico', __channel__)
|
||||
__perfil__ = int(config.get_setting('perfil', __channel__))
|
||||
except:
|
||||
__modo_grafico__ = True
|
||||
__perfil__ = 0
|
||||
|
||||
# Fijar perfil de color
|
||||
perfil = [['0xFFFFE6CC', '0xFFFFCE9C', '0xFF994D00', '0xFFFE2E2E', '0xFFFFD700'],
|
||||
['0xFFA5F6AF', '0xFF5FDA6D', '0xFF11811E', '0xFFFE2E2E', '0xFFFFD700'],
|
||||
['0xFF58D3F7', '0xFF2E9AFE', '0xFF2E64FE', '0xFFFE2E2E', '0xFFFFD700']]
|
||||
|
||||
if __perfil__ < 3:
|
||||
color1, color2, color3, color4, color5 = perfil[__perfil__]
|
||||
else:
|
||||
color1 = color2 = color3 = color4 = color5 = ""
|
||||
# ======== def per utility INIZIO ============================
|
||||
|
||||
__comprueba_enlaces__ = config.get_setting('comprueba_enlaces', __channel__)
|
||||
__comprueba_enlaces_num__ = config.get_setting('comprueba_enlaces_num', __channel__)
|
||||
@@ -48,7 +35,6 @@ __comprueba_enlaces_num__ = config.get_setting('comprueba_enlaces_num', __channe
|
||||
headers = [['User-Agent', 'Mozilla/50.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0'],
|
||||
['Referer', host]]#,['Accept-Language','it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3']]
|
||||
|
||||
|
||||
IDIOMAS = {'Italiano': 'IT'}
|
||||
list_language = IDIOMAS.values()
|
||||
list_servers = ['openload', 'streamcherry','rapidvideo', 'streamango', 'supervideo']
|
||||
@@ -67,54 +53,64 @@ def mainlist(item):
|
||||
title = ''
|
||||
|
||||
autoplay.init(item.channel, list_servers, list_quality)
|
||||
# Menu Principale
|
||||
support.menu(itemlist, 'Film Ultimi Arrivi bold', 'peliculas', host)#, args='film')
|
||||
support.menu(itemlist, 'Genere', 'categorie', host, args=['','genres'])
|
||||
support.menu(itemlist, 'Per anno submenu', 'categorie', host, args=['Film per Anno','years'])
|
||||
support.menu(itemlist, 'Per qualità submenu', 'categorie', host, args=['Film per qualità','quality'])
|
||||
support.menu(itemlist, 'Al Cinema bold', 'peliculas', host+'film-del-cinema')
|
||||
support.menu(itemlist, 'Popolari bold', 'categorie', host+'piu-visti.html', args=['popular',''])
|
||||
support.menu(itemlist, 'Mi sento fortunato bold', 'categorie', host+'piu-visti.html',args=['fortunato','lucky'])
|
||||
support.menu(itemlist, 'Sub-ITA bold', 'peliculas', host+'film-sub-ita/')
|
||||
support.menu(itemlist, 'Cerca film submenu', 'search', host)
|
||||
|
||||
itemlist = [
|
||||
# new upload
|
||||
Item(channel=__channel__, title="Ultimi Arrivi", action="peliculas",
|
||||
url="%s" % host, text_color=color4, extra="film", # color4 = red
|
||||
thumbnail=get_thumb(title, auto = True)
|
||||
),
|
||||
# x to Cinema
|
||||
Item(channel=__channel__, title="Al Cinema", action="peliculas",
|
||||
url="%sfilm-del-cinema" % host, text_color=color4, extra="",
|
||||
thumbnail=get_thumb(title, auto = True)
|
||||
),
|
||||
# Popolari
|
||||
Item(channel=__channel__, title="Popolari", action="peliculas",
|
||||
url="%spiu-visti.html" % host, text_color=color4, extra="",
|
||||
thumbnail=get_thumb(title, auto = True)
|
||||
),
|
||||
# x Sub-ita
|
||||
Item(channel=__channel__, title="Sottotitolati", action="peliculas",
|
||||
url="%sfilm-sub-ita/" % host, text_color=color4, extra="",
|
||||
thumbnail=get_thumb(title, auto = True)
|
||||
),
|
||||
# x mi sento fortunato - Prende solo film con player a pagamento
|
||||
Item(channel=__channel__, title="Mi Sento Fortunato", action="categorie",
|
||||
url="%s" % host, text_color=color4, extra="lucky",
|
||||
thumbnail=""),
|
||||
# x Category
|
||||
Item(channel=__channel__, title="Generi", action="categorie",
|
||||
url="%s" % host, text_color=color4, extra="genres",
|
||||
viewcontent='movies',
|
||||
thumbnail=get_thumb(title, auto = True)
|
||||
),
|
||||
# x year
|
||||
Item(channel=__channel__, title="Anno", action="categorie",
|
||||
url="%s" % host, text_color=color4, extra="year",
|
||||
thumbnail=get_thumb(title, auto = True)
|
||||
),
|
||||
# x quality
|
||||
Item(channel=__channel__, title="Qualità", action="categorie",
|
||||
url="%s" % host, text_color=color4, extra="quality",
|
||||
thumbnail=get_thumb(title, auto = True)
|
||||
),
|
||||
# Search
|
||||
Item(channel=__channel__, title="Cerca Film...", action="search",
|
||||
text_color=color4, extra="",
|
||||
thumbnail=get_thumb(title, auto = True)
|
||||
),
|
||||
]
|
||||
## itemlist = [
|
||||
## # new upload
|
||||
## Item(channel=__channel__, title="Ultimi Arrivi", action="peliculas",
|
||||
## url="%s" % host, text_color=color4, extra="film", # color4 = red
|
||||
## thumbnail=get_thumb(title, auto = True)
|
||||
## ),
|
||||
## # x to Cinema
|
||||
## Item(channel=__channel__, title="Al Cinema", action="peliculas",
|
||||
## url="%sfilm-del-cinema" % host, text_color=color4, extra="",
|
||||
## thumbnail=get_thumb(title, auto = True)
|
||||
## ),
|
||||
## # Popolari
|
||||
## Item(channel=__channel__, title="Popolari", action="peliculas",
|
||||
## url="%spiu-visti.html" % host, text_color=color4, extra="",
|
||||
## thumbnail=get_thumb(title, auto = True)
|
||||
## ),
|
||||
## # x Sub-ita
|
||||
## Item(channel=__channel__, title="Sottotitolati", action="peliculas",
|
||||
## url="%sfilm-sub-ita/" % host, text_color=color4, extra="",
|
||||
## thumbnail=get_thumb(title, auto = True)
|
||||
## ),
|
||||
## # x mi sento fortunato - Prende solo film con player a pagamento
|
||||
## Item(channel=__channel__, title="Mi Sento Fortunato", action="categorie",
|
||||
## url="%s" % host, text_color=color4, extra="lucky",
|
||||
## thumbnail=""),
|
||||
## # x Category
|
||||
## Item(channel=__channel__, title="Generi", action="categorie",
|
||||
## url="%s" % host, text_color=color4, extra="genres",
|
||||
## viewcontent='movies',
|
||||
## thumbnail=get_thumb(title, auto = True)
|
||||
## ),
|
||||
## # x year
|
||||
## Item(channel=__channel__, title="Anno", action="categorie",
|
||||
## url="%s" % host, text_color=color4, extra="year",
|
||||
## thumbnail=get_thumb(title, auto = True)
|
||||
## ),
|
||||
## # x quality
|
||||
## Item(channel=__channel__, title="Qualità", action="categorie",
|
||||
## url="%s" % host, text_color=color4, extra="quality",
|
||||
## thumbnail=get_thumb(title, auto = True)
|
||||
## ),
|
||||
## # Search
|
||||
## Item(channel=__channel__, title="Cerca Film...", action="search",
|
||||
## text_color=color4, extra="",
|
||||
## thumbnail=get_thumb(title, auto = True)
|
||||
## ),
|
||||
## ]
|
||||
|
||||
autoplay.show_option(item.channel, itemlist)
|
||||
|
||||
@@ -127,7 +123,6 @@ def peliculas(item):
|
||||
itemlist = []
|
||||
# scarico la pagina
|
||||
data = httptools.downloadpage(item.url, headers=headers).data
|
||||
|
||||
# da qui fare le opportuni modifiche
|
||||
patron = 'class="innerImage">.*?href="([^"]+)".*?src="([^"]+)".*?'\
|
||||
'class="ml-item-title">([^"]+)</.*?class="ml-item-label">'\
|
||||
@@ -149,7 +144,6 @@ def peliculas(item):
|
||||
contenType="movie",
|
||||
thumbnail=scrapedimg,
|
||||
title="%s [%s]" % (scrapedtitle, scrapedlang),
|
||||
text_color=color5,
|
||||
language=scrapedlang,
|
||||
context="buscar_trailer"
|
||||
))
|
||||
@@ -158,20 +152,7 @@ def peliculas(item):
|
||||
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||
|
||||
# Paginazione
|
||||
next_page = scrapertools.find_single_match(data, "<link rel='next' href='(.*?)' />")
|
||||
if not next_page:
|
||||
next_page = scrapertools.find_single_match(data, '<span>\d</span> <a href="([^"]+)">')
|
||||
|
||||
if next_page != "":
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
action="peliculas",
|
||||
title=config.get_localized_string(30992),
|
||||
url=next_page,
|
||||
extra=item.extra,
|
||||
text_color=color4,
|
||||
thumbnail= get_thumb('nextpage', auto = True)
|
||||
))
|
||||
support.nextPage(itemlist,item,data,'<span>\d</span> <a href="([^"]+)">')
|
||||
|
||||
return itemlist
|
||||
|
||||
@@ -184,24 +165,24 @@ def categorie(item):
|
||||
data = httptools.downloadpage(item.url, headers=headers).data
|
||||
|
||||
# da qui fare le opportuni modifiche
|
||||
if item.extra == 'genres':
|
||||
if item.args[1] == 'genres':
|
||||
bloque = scrapertools.find_single_match(data, '<ul class="listSubCat" id="Film">(.*?)</ul>')
|
||||
elif item.extra == 'year':
|
||||
elif item.args[1] == 'years':
|
||||
bloque = scrapertools.find_single_match(data, '<ul class="listSubCat" id="Anno">(.*?)</ul>')
|
||||
elif item.extra == 'quality':
|
||||
elif item.args[1] == 'quality':
|
||||
bloque = scrapertools.find_single_match(data, '<ul class="listSubCat" id="Qualita">(.*?)</ul>')
|
||||
elif item.extra == 'lucky': # sono i titoli random nella pagina, alcuni rimandano solo a server a pagamento
|
||||
elif item.args[1] == 'lucky': # sono i titoli random nella pagina, alcuni rimandano solo a server a pagamento
|
||||
bloque = scrapertools.find_single_match(data, 'FILM RANDOM.*?class="listSubCat">(.*?)</ul>')
|
||||
patron = '<li><a href="/(.*?)">(.*?)<'
|
||||
matches = scrapertools.find_multiple_matches(bloque, patron)
|
||||
|
||||
if item.extra == 'lucky':
|
||||
if item.args[1] == 'lucky':
|
||||
bloque = scrapertools.find_single_match(data, 'FILM RANDOM.*?class="listSubCat">(.*?)</ul>')
|
||||
patron = '<li><a href="(.*?)">(.*?)<'
|
||||
matches = scrapertools.find_multiple_matches(bloque, patron)
|
||||
|
||||
for scrapurl, scraptitle in sorted(matches):
|
||||
if item.extra != 'lucky':
|
||||
if item.args[1] != 'lucky':
|
||||
url = host+scrapurl
|
||||
action="peliculas"
|
||||
else:
|
||||
@@ -212,8 +193,6 @@ def categorie(item):
|
||||
action=action,
|
||||
title = scraptitle,
|
||||
url=url,
|
||||
#extra = '',
|
||||
text_color=color4,
|
||||
thumbnail=get_thumb(scraptitle, auto = True),
|
||||
Folder = True,
|
||||
))
|
||||
@@ -246,7 +225,6 @@ def findvideos_film(item):
|
||||
videoitem.contentTitle = item.contentTitle
|
||||
videoitem.contentType = item.contentType
|
||||
videoitem.channel = item.channel
|
||||
videoitem.text_color = color5
|
||||
videoitem.year = item.infoLabels['year']
|
||||
videoitem.infoLabels['plot'] = item.infoLabels['plot']
|
||||
except AttributeError:
|
||||
@@ -257,19 +235,14 @@ def findvideos_film(item):
|
||||
itemlist = servertools.check_list_links(itemlist, __comprueba_enlaces_num__)
|
||||
|
||||
# Requerido para FilterTools
|
||||
# itemlist = filtertools.get_links(itemlist, item, list_language)
|
||||
itemlist = filtertools.get_links(itemlist, item, list_language)
|
||||
|
||||
# Requerido para AutoPlay
|
||||
autoplay.start(itemlist, item)
|
||||
|
||||
# Opción "Añadir esta película a la biblioteca de KODI"
|
||||
if item.extra != "library":
|
||||
|
||||
itemlist.append(Item(channel=__channel__, title="Aggiungi alla Videoteca", text_color="green",
|
||||
action="add_pelicula_to_library", url=item.url,
|
||||
thumbnail= get_thumb('videolibrary', auto = True),
|
||||
contentTitle=item.contentTitle, infoLabels = item.infoLabels
|
||||
))
|
||||
# Aggiunge alla videoteca
|
||||
if config.get_videolibrary_support() and len(itemlist) != 0 and item.extra != "library":
|
||||
support.videolibrary(itemlist, item)
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
Reference in New Issue
Block a user