Merge remote-tracking branch 'origin/master'
This commit is contained in:
2
.github/ISSUE_TEMPLATE/test-canale.md
vendored
2
.github/ISSUE_TEMPLATE/test-canale.md
vendored
@@ -45,7 +45,7 @@ Per aprirli non servono programmi particolari un semplice editor di testo è suf
|
||||
Occorrente: file .json
|
||||
|
||||
**1. Indica la coerenza delle voci presenti in "language" con i contenuti presenti sul sito:**
|
||||
valori: ita, vosi (sub-ita)
|
||||
valori: ita, sub-ita (sub-ita)
|
||||
|
||||
- [ ] coerenti
|
||||
- [ ] non coerenti
|
||||
|
||||
@@ -19,7 +19,7 @@ se vanno cancellati tutti deve rimanere la voce:
|
||||
{
|
||||
"id": "nome del file .json",
|
||||
"name": "Nome del canale visualizzato in KOD",
|
||||
"language": ["ita", "vosi"],
|
||||
"language": ["ita", "sub-ita"],
|
||||
"active": false,
|
||||
"adult": false,
|
||||
"thumbnail": "",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "altadefinizione01",
|
||||
"name": "Altadefinizione01",
|
||||
"language": ["ita", "vosi"],
|
||||
"language": ["ita", "sub-ita"],
|
||||
"active": true,
|
||||
"adult": false,
|
||||
"thumbnail": "https://raw.githubusercontent.com/Zanzibar82/images/master/posters/altadefinizione01.png",
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"name": "Altadefinizione01 L",
|
||||
"active": true,
|
||||
"adult": false,
|
||||
"language": ["ita","vosi"],
|
||||
"language": ["ita","sub-ita"],
|
||||
"thumbnail": "altadefinizione01_L.png",
|
||||
"banner": "altadefinizione01_L.png",
|
||||
"categories": ["movie","vos"],
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"name": "AltadefinizioneClick",
|
||||
"active": true,
|
||||
"adult": false,
|
||||
"language": ["ita","vosi"],
|
||||
"language": ["ita","sub-ita"],
|
||||
"thumbnail": "https:\/\/raw.githubusercontent.com\/Zanzibar82\/images\/master\/posters\/altadefinizioneclick.png",
|
||||
"bannermenu": "https:\/\/raw.githubusercontent.com\/Zanzibar82\/images\/master\/posters\/altadefinizioneciclk.png",
|
||||
"categories": ["movie","vos"],
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"name": "AnimePerTutti",
|
||||
"active": true,
|
||||
"adult": false,
|
||||
"language": ["ita", "vosi"],
|
||||
"language": ["ita", "sub-ita"],
|
||||
"thumbnail": "animepertutti.png",
|
||||
"bannermenu": "animepertutti.png",
|
||||
"categories": ["anime", "vos"],
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
"name": "AnimeSubIta",
|
||||
"active": true,
|
||||
"adult": false,
|
||||
"language": ["vosi"],
|
||||
"language": ["sub-ita"],
|
||||
"thumbnail": "animesubita.png",
|
||||
"bannermenu": "animesubita.png",
|
||||
"categories": ["anime", "vosi", "movie"],
|
||||
"categories": ["anime", "vos", "movie"],
|
||||
"settings": []
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"name": "AnimeWorld",
|
||||
"active": true,
|
||||
"adult": false,
|
||||
"language": ["ita", "vosi"],
|
||||
"language": ["ita", "sub-ita"],
|
||||
"thumbnail": "animeworld.png",
|
||||
"banner": "animeworld.png",
|
||||
"categories": ["anime", "vos"],
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "casacinema",
|
||||
"name": "Casacinema",
|
||||
"language": ["ita", "vosi"],
|
||||
"language": ["ita", "sub-ita"],
|
||||
"active": true,
|
||||
"adult": false,
|
||||
"thumbnail": "https://raw.githubusercontent.com/Zanzibar82/images/master/posters/casacinema.png",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "casacinemaInfo",
|
||||
"name": "La Casa del Cinema",
|
||||
"language": ["ita", "vosi"],
|
||||
"language": ["ita", "sub-ita"],
|
||||
"active": true,
|
||||
"adult": false,
|
||||
"thumbnail": "",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "cb01anime",
|
||||
"name": "Cb01anime",
|
||||
"language": ["ita", "vos", "vosi"],
|
||||
"language": ["ita", "vos", "sub-ita"],
|
||||
"active": true,
|
||||
"adult": false,
|
||||
"thumbnail": "cb01anime.png",
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"id": "cineblog01",
|
||||
"name": "CB01",
|
||||
"language": ["ita"],
|
||||
"language": ["ita", "sub-ita"],
|
||||
"active": true,
|
||||
"adult": false,
|
||||
"thumbnail": "cb01.png",
|
||||
"banner": "cb01.png",
|
||||
"categories": ["tvshow", "movie", "vosi"],
|
||||
"categories": ["tvshow", "movie", "vos"],
|
||||
"settings": []
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "dreamsub",
|
||||
"name": "DreamSub",
|
||||
"language": ["ita", "vosi"],
|
||||
"language": ["ita", "sub-ita"],
|
||||
"active": true,
|
||||
"adult": false,
|
||||
"thumbnail": "dreamsub.png",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "fastsubita",
|
||||
"name": "Fastsubita",
|
||||
"language": ["vosi"],
|
||||
"language": ["sub-ita"],
|
||||
"active": true,
|
||||
"adult": false,
|
||||
"thumbnail": "fastsubita.png",
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"name": "Italia Serie",
|
||||
"active": true,
|
||||
"adult": false,
|
||||
"language": ["ita","vosi"],
|
||||
"language": ["ita","sub-ita"],
|
||||
"thumbnail": "https:\/\/raw.githubusercontent.com\/Zanzibar82\/images\/master\/posters\/italiaserie.png",
|
||||
"bannermenu": "https:\/\/raw.githubusercontent.com\/Zanzibar82\/images\/master\/posters\/italiaserie.png",
|
||||
"categories": ["tvshow"],
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"adult": false,
|
||||
"thumbnail": "mondolunatico2.png",
|
||||
"banner": "mondolunatico2.png",
|
||||
"categories": ["tvshow", "movie", "vosi", "anime"],
|
||||
"categories": ["tvshow", "movie", "vos", "anime"],
|
||||
"settings": [
|
||||
{
|
||||
"id": "include_in_global_search",
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"adult": false,
|
||||
"thumbnail": "toonitalia.png",
|
||||
"banner": "toonitalia.png",
|
||||
"categories": ["tvshow", "movie", "vosi", "anime"],
|
||||
"categories": ["tvshow", "movie", "vos", "anime"],
|
||||
"settings": [
|
||||
{
|
||||
"id": "include_in_global_search",
|
||||
|
||||
@@ -88,7 +88,7 @@ def getchanneltypes(view="thumb_"):
|
||||
channel_types.append("adult")
|
||||
|
||||
# channel_language = config.get_setting("channel_language", default="all")
|
||||
channel_language = auto_filter()[0]
|
||||
channel_language = auto_filter()
|
||||
logger.info("channel_language=%s" % channel_language)
|
||||
|
||||
# Ahora construye el itemlist ordenadamente
|
||||
@@ -138,7 +138,7 @@ def filterchannels(category, view="thumb_"):
|
||||
logger.info("channel_files encontrados %s" % (len(channel_files)))
|
||||
|
||||
# channel_language = config.get_setting("channel_language", default="all")
|
||||
channel_language, channel_language_list = auto_filter()
|
||||
channel_language = auto_filter()
|
||||
logger.info("channel_language=%s" % channel_language)
|
||||
|
||||
for channel_path in channel_files:
|
||||
@@ -193,15 +193,14 @@ def filterchannels(category, view="thumb_"):
|
||||
# Se muestran sólo los idiomas filtrados, cast o lat
|
||||
# Los canales de adultos se mostrarán siempre que estén activos
|
||||
|
||||
for c in channel_language_list:
|
||||
if c in channel_parameters["language"]:
|
||||
L = True
|
||||
else:
|
||||
L = False
|
||||
# for channel_language_list in channel_language_list:
|
||||
# if c in channel_parameters["language"]:
|
||||
# L = True
|
||||
# else:
|
||||
# L = False
|
||||
# logger.info('CCLANG= ' + channel_language + ' ' + str(channel_language_list))
|
||||
if channel_language != "all" and "*" not in channel_parameters["language"] \
|
||||
and L == False and channel_language not in channel_parameters["language"]:
|
||||
logger.info('STOP!!!!')
|
||||
and channel_language not in str(channel_parameters["language"]):
|
||||
continue
|
||||
|
||||
# Se salta el canal si está en una categoria filtrado
|
||||
@@ -291,12 +290,13 @@ def set_channel_info(parameters):
|
||||
content = ''
|
||||
langs = parameters['language']
|
||||
lang_dict = {'ita':'Italiano',
|
||||
'vosi':'Sottotitolato in Italiano',
|
||||
'sub-ita':'Sottotitolato in Italiano',
|
||||
'*':'Italiano, Sottotitolato in Italiano'}
|
||||
|
||||
for lang in langs:
|
||||
# if 'vos' in parameters['categories']:
|
||||
# lang = '*'
|
||||
# if 'vosi' in parameters['categories']:
|
||||
# if 'sub-ita' in parameters['categories']:
|
||||
# lang = 'ita'
|
||||
|
||||
if lang in lang_dict:
|
||||
@@ -320,25 +320,33 @@ def set_channel_info(parameters):
|
||||
|
||||
|
||||
def auto_filter(auto_lang=False):
|
||||
import xbmc, xbmcaddon
|
||||
|
||||
addon = xbmcaddon.Addon('metadata.themoviedb.org')
|
||||
def_lang = addon.getSetting('language')
|
||||
lang = 'all'
|
||||
lang_list = ['all']
|
||||
|
||||
lang_dict = {'it':'ita'}
|
||||
lang_list_dict = {'it':['ita','vosi']}
|
||||
|
||||
if config.get_setting("channel_language") == 'auto' or auto_lang == True:
|
||||
lang = lang_dict[def_lang]
|
||||
lang_list = lang_list_dict[def_lang]
|
||||
lang = config.get_localized_string(20001)
|
||||
|
||||
else:
|
||||
lang = config.get_setting("channel_language", default="all")
|
||||
lang_list = lang_list_dict[def_lang]
|
||||
|
||||
return lang, lang_list
|
||||
return lang
|
||||
|
||||
# import xbmc, xbmcaddon
|
||||
|
||||
# addon = xbmcaddon.Addon('metadata.themoviedb.org')
|
||||
# def_lang = addon.getSetting('language')
|
||||
# lang = 'all'
|
||||
# lang_list = ['all']
|
||||
|
||||
# lang_dict = {'it':'ita'}
|
||||
# lang_list_dict = {'it':['ita','vosi']}
|
||||
|
||||
# if config.get_setting("channel_language") == 'auto' or auto_lang == True:
|
||||
# lang = lang_dict[def_lang]
|
||||
# lang_list = lang_list_dict[def_lang]
|
||||
|
||||
# else:
|
||||
# lang = config.get_setting("channel_language", default="all")
|
||||
# lang_list = lang_list_dict[def_lang]
|
||||
|
||||
# return lang, lang_list
|
||||
|
||||
|
||||
def thumb(itemlist=[], genre=False):
|
||||
|
||||
@@ -366,7 +366,7 @@ def get_localized_string(code):
|
||||
def get_localized_category(categ):
|
||||
categories = {'movie': get_localized_string(30122), 'tvshow': get_localized_string(30123),
|
||||
'anime': get_localized_string(30124), 'documentary': get_localized_string(30125),
|
||||
'vos': get_localized_string(30136), 'vosi': get_localized_string(70566), 'adult': get_localized_string(30126),
|
||||
'vos': get_localized_string(30136), 'sub-ita': get_localized_string(70566), 'adult': get_localized_string(30126),
|
||||
'direct': get_localized_string(30137), 'torrent': get_localized_string(70015)}
|
||||
return categories[categ] if categ in categories else categ
|
||||
|
||||
|
||||
@@ -253,7 +253,7 @@ def set_lang(language):
|
||||
lat=['latino','lat','la', 'espanol latino', 'espaol latino', 'zl', 'mx', 'co', 'vl']
|
||||
vose=['subtitulado','subtitulada','sub','sub espanol','vose','espsub','su','subs castellano',
|
||||
'sub: español', 'vs', 'zs', 'vs', 'english-spanish subs', 'ingles sub espanol']
|
||||
vosi=['sottotitolato','sottotitolata','sub','sub ita','vosi','sub-ita','subs italiano',
|
||||
sub_ita=['sottotitolato','sottotitolata','sub','sub ita','subs italiano',
|
||||
'sub: italiano', 'inglese sottotitolato']
|
||||
vos=['vos', 'sub ingles', 'engsub','ingles subtitulado', 'sub: ingles']
|
||||
vo=['ingles', 'en','vo', 'ovos', 'eng','v.o', 'english']
|
||||
@@ -272,8 +272,8 @@ def set_lang(language):
|
||||
language = 'lat'
|
||||
elif language in ita:
|
||||
language = 'ita'
|
||||
elif language in vosi:
|
||||
language = 'vosi'
|
||||
elif language in sub_ita:
|
||||
language = 'sub-ita'
|
||||
elif language in vose:
|
||||
language = 'vose'
|
||||
elif language in vos:
|
||||
|
||||
@@ -21,6 +21,10 @@ msgctxt "#20000"
|
||||
msgid "KOD"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#20001"
|
||||
msgid "eng"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#30001"
|
||||
msgid "Check for updates:"
|
||||
msgstr ""
|
||||
|
||||
@@ -21,6 +21,10 @@ msgctxt "#20000"
|
||||
msgid "KOD"
|
||||
msgstr "KOD"
|
||||
|
||||
msgctxt "#20001"
|
||||
msgid "eng"
|
||||
msgstr "ita"
|
||||
|
||||
msgctxt "#30001"
|
||||
msgid "Check for updates:"
|
||||
msgstr "Verifica aggiornamenti:"
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
<setting id="vose_color" type="labelenum" label="70142"
|
||||
values="[COLOR white]white[/COLOR]|[COLOR cyan]cyan[/COLOR]|[COLOR deepskyblue]deepskyblue[/COLOR]|[COLOR firebrick]firebrick[/COLOR]|[COLOR gold]gold[/COLOR]|[COLOR goldenrod]goldenrod[/COLOR]|[COLOR hotpink]hotpink[/COLOR]|[COLOR limegreen]limegreen[/COLOR]|[COLOR orange]orange[/COLOR]|[COLOR orchid]orchid[/COLOR]|[COLOR red]red[/COLOR]|[COLOR salmon]salmon[/COLOR]|[COLOR yellow]yellow[/COLOR]"
|
||||
default="white" visible="eq(-10,true)+eq(-11,true)"/>
|
||||
<setting id="vosi_color" type="labelenum" label="70566"
|
||||
<setting id="sub-ita_color" type="labelenum" label="70566"
|
||||
values="[COLOR white]white[/COLOR]|[COLOR cyan]cyan[/COLOR]|[COLOR deepskyblue]deepskyblue[/COLOR]|[COLOR firebrick]firebrick[/COLOR]|[COLOR gold]gold[/COLOR]|[COLOR goldenrod]goldenrod[/COLOR]|[COLOR hotpink]hotpink[/COLOR]|[COLOR limegreen]limegreen[/COLOR]|[COLOR orange]orange[/COLOR]|[COLOR orchid]orchid[/COLOR]|[COLOR red]red[/COLOR]|[COLOR salmon]salmon[/COLOR]|[COLOR yellow]yellow[/COLOR]"
|
||||
default="white" visible="eq(-11,true)+eq(-12,true)"/>
|
||||
<setting id="vos_color" type="labelenum" label="70143"
|
||||
|
||||
@@ -3,23 +3,30 @@
|
||||
# -*- Created for Alfa-addon -*-
|
||||
# -*- By the Alfa Develop Group -*-
|
||||
|
||||
import re, urllib, os, inspect
|
||||
import requests
|
||||
import re, os, inspect, requests
|
||||
|
||||
from core import httptools, scrapertoolsV2, servertools, jsontools, tmdb, support
|
||||
from core.item import Item
|
||||
from core.support import typo
|
||||
from channelselector import get_thumb
|
||||
from platformcode import logger, config, platformtools
|
||||
from platformcode import config, platformtools
|
||||
from specials import autoplay
|
||||
|
||||
import xbmc, xbmcaddon
|
||||
|
||||
addon = xbmcaddon.Addon('metadata.themoviedb.org')
|
||||
lang = addon.getSetting('language')
|
||||
|
||||
|
||||
list_data = {}
|
||||
|
||||
list_language = ['ITA', 'SUB-ITA']
|
||||
# list_language = ['ITA', 'SUB-ITA']
|
||||
list_servers = ['directo', 'akvideo', 'verystream', 'openload']
|
||||
list_quality = ['SD', '720', '1080', '4k']
|
||||
|
||||
tmdb_api = 'a1ab8b8669da03637a4b98fa39c39228'
|
||||
|
||||
|
||||
def mainlist(item):
|
||||
support.log()
|
||||
|
||||
@@ -48,8 +55,7 @@ def show_channels(item):
|
||||
itemlist.append(Item(channel=item.channel,
|
||||
title=typo(config.get_localized_string(70676),'bold color kod'),
|
||||
action='add_channel',
|
||||
thumbnail=get_thumb('add.png')
|
||||
))
|
||||
thumbnail=get_thumb('add.png')))
|
||||
|
||||
for key, channel in json['channels'].items():
|
||||
# Find File Path
|
||||
@@ -81,6 +87,7 @@ def show_channels(item):
|
||||
path=path))
|
||||
return itemlist
|
||||
|
||||
|
||||
def show_menu(item):
|
||||
global list_data
|
||||
itemlist = []
|
||||
@@ -94,6 +101,7 @@ def show_menu(item):
|
||||
fanart = relative('fanart', option, item.path)
|
||||
plot = option['plot'] if option.has_key('plot') else item.plot
|
||||
url = relative('link', option, item.path)
|
||||
submenu = option['submenu'] if option.has_key('submenu') else []
|
||||
itemlist.append(Item(channel=item.channel,
|
||||
title=format_title(option['title']),
|
||||
thumbnail=thumbnail,
|
||||
@@ -102,9 +110,26 @@ def show_menu(item):
|
||||
action='show_menu',
|
||||
url=url,
|
||||
path=item.path))
|
||||
if submenu:
|
||||
for key in submenu:
|
||||
if key != 'search':
|
||||
itemlist.append(Item(channel=item.channel,
|
||||
title=typo(submenu[key],'submenu'),
|
||||
url=url,
|
||||
path=item.path,
|
||||
thumbnail=item.thumbnail,
|
||||
action='submenu',
|
||||
filterkey=key))
|
||||
if submenu.has_key('search'):
|
||||
itemlist.append(Item(channel=item.channel,
|
||||
title=typo('Cerca ' + option['title'] +'...','color kod bold'),
|
||||
thumbnail=get_thumb('search.png'),
|
||||
action='search',
|
||||
url=url,
|
||||
path=item.path))
|
||||
# add Search
|
||||
itemlist.append(Item(channel=item.channel,
|
||||
title=typo('Cerca...','color kod bold'),
|
||||
title=typo('Cerca nel Canale...','color kod bold'),
|
||||
thumbnail=get_thumb('search.png'),
|
||||
action='search',
|
||||
url=item.url,
|
||||
@@ -121,6 +146,54 @@ def show_menu(item):
|
||||
|
||||
return list_all(item)
|
||||
|
||||
|
||||
def submenu(item):
|
||||
support.log()
|
||||
|
||||
itemlist = []
|
||||
filter_list = []
|
||||
|
||||
json_data = load_json(item)
|
||||
if json_data.has_key("movies_list"): item.media_type= 'movies_list'
|
||||
elif json_data.has_key("tvshows_list"): item.media_type = 'tvshows_list'
|
||||
elif json_data.has_key("episodes_list"): item.media_type = 'episodes_list'
|
||||
elif json_data.has_key("generic_list"): item.media_type= 'generic_list'
|
||||
media_type = item.media_type
|
||||
|
||||
for media in json_data[media_type]:
|
||||
if media.has_key(item.filterkey):
|
||||
if type(media[item.filterkey]) == str and media[item.filterkey] not in filter_list:
|
||||
filter_list.append(media[item.filterkey])
|
||||
elif type(media[item.filterkey]) == list:
|
||||
for f in media[item.filterkey]:
|
||||
if f not in filter_list:
|
||||
filter_list.append(f)
|
||||
filter_list.sort()
|
||||
|
||||
for filter in filter_list:
|
||||
if item.filterkey in ['director','actors']:
|
||||
load_info = load_json('http://api.themoviedb.org/3/search/person/?api_key=' + tmdb_api + '&language=' + lang + '&query=' + filter)
|
||||
if load_info:
|
||||
id = str(load_info['results'][0]['id'])
|
||||
if id:
|
||||
info = load_json('http://api.themoviedb.org/3/person/'+ id + '?api_key=' + tmdb_api + '&language=' + lang)
|
||||
if not info['biography']:
|
||||
bio = load_json('http://api.themoviedb.org/3/person/'+ id + '?api_key=' + tmdb_api + '&language=en')['biography']
|
||||
thumbnail = 'https://image.tmdb.org/t/p/w600_and_h900_bestv2' + info['profile_path'] if info['profile_path'] else item.thumbnail
|
||||
plot += info['biography'] if info['biography'] else bio if bio else ''
|
||||
|
||||
itemlist.append(Item(channel=item.channel,
|
||||
title=typo(filter, 'bold'),
|
||||
url=item.url,
|
||||
media_type=item.media_type,
|
||||
action='list_filtered',
|
||||
thumbnail=thumbnail,
|
||||
plot=plot,
|
||||
filterkey=item.filterkey,
|
||||
filter=filter))
|
||||
return itemlist
|
||||
|
||||
|
||||
def list_all(item):
|
||||
support.log()
|
||||
|
||||
@@ -132,8 +205,9 @@ def list_all(item):
|
||||
|
||||
if json_data:
|
||||
for media in json_data[media_type]:
|
||||
support.log(media)
|
||||
|
||||
quality, language, plot, poster = set_extra_values(media)
|
||||
quality, language, plot, poster = set_extra_values(media, item.path)
|
||||
|
||||
fulltitle = media['title']
|
||||
title = set_title(fulltitle, language, quality)
|
||||
@@ -171,6 +245,7 @@ def list_all(item):
|
||||
url=url,
|
||||
contentTitle=contentTitle,
|
||||
contentSerieName=contentSerieName,
|
||||
infoLabels=infoLabels,
|
||||
action=action))
|
||||
|
||||
if not 'generic_list' in json_data:
|
||||
@@ -180,8 +255,73 @@ def list_all(item):
|
||||
item.plot = '\n\n' + typo('','submenu') + '\n' + item.personal_plot + '\n' + typo('','submenu') + '\n\n' + item.plot
|
||||
return itemlist
|
||||
|
||||
|
||||
def list_filtered(item):
|
||||
support.log()
|
||||
|
||||
itemlist = []
|
||||
media_type = item.media_type
|
||||
json_data = load_json(item)
|
||||
contentTitle = contentSerieName = ''
|
||||
infoLabels = item.infoLabels if item.infoLabels else {}
|
||||
|
||||
if json_data:
|
||||
for media in json_data[media_type]:
|
||||
if media.has_key(item.filterkey):
|
||||
filter_keys = [it.lower() for it in media[item.filterkey]] if type(media[item.filterkey]) == list else media[item.filterkey].lower()
|
||||
if item.filter.lower() in filter_keys:
|
||||
|
||||
quality, language, plot, poster = set_extra_values(media, item.path)
|
||||
|
||||
fulltitle = media['title']
|
||||
title = set_title(fulltitle, language, quality)
|
||||
|
||||
infoLabels['year'] = media['year'] if media.has_key('year')else ''
|
||||
infoLabels['tmdb_id'] = media['tmdb_id'] if media.has_key('tmdb_id') else ''
|
||||
|
||||
if 'movies_list' in json_data or 'generic_list' in json_data:
|
||||
url= media
|
||||
contentTitle = fulltitle
|
||||
contentType = 'movie'
|
||||
action='findvideos'
|
||||
|
||||
else:
|
||||
contentSerieName = fulltitle
|
||||
contentType = 'tvshow'
|
||||
if media.has_key('seasons_list'):
|
||||
url = media['seasons_list']
|
||||
action = 'get_seasons'
|
||||
else:
|
||||
url = relative('link', media, item.path)
|
||||
action = 'episodios'
|
||||
|
||||
itemlist.append(Item(channel=item.channel,
|
||||
contentType=contentType,
|
||||
title=format_title(title),
|
||||
fulltitle=fulltitle,
|
||||
show=fulltitle,
|
||||
quality=quality,
|
||||
language=language,
|
||||
plot=plot,
|
||||
personal_plot=plot,
|
||||
thumbnail=poster,
|
||||
path=item.path,
|
||||
url=url,
|
||||
contentTitle=contentTitle,
|
||||
contentSerieName=contentSerieName,
|
||||
infoLabels=infoLabels,
|
||||
action=action))
|
||||
|
||||
if not 'generic_list' in json_data:
|
||||
tmdb.set_infoLabels(itemlist, seekTmdb=True)
|
||||
for item in itemlist:
|
||||
if item.personal_plot != item.plot and item.personal_plot:
|
||||
item.plot = '\n\n' + typo('','submenu') + '\n' + item.personal_plot + '\n' + typo('','submenu') + '\n\n' + item.plot
|
||||
return itemlist
|
||||
|
||||
|
||||
def get_seasons(item):
|
||||
support.log(item)
|
||||
support.log()
|
||||
itemlist = []
|
||||
infoLabels = item.infoLabels if item.infolabels else {}
|
||||
list_seasons = item.url
|
||||
@@ -218,7 +358,7 @@ def get_seasons(item):
|
||||
|
||||
|
||||
def episodios(item):
|
||||
support.log(item)
|
||||
support.log()
|
||||
|
||||
itemlist = []
|
||||
json_data = load_json(item)
|
||||
@@ -272,7 +412,7 @@ def findvideos(item):
|
||||
itemlist = []
|
||||
if 'links' in item.url:
|
||||
for url in item.url['links']:
|
||||
quality, language, plot, poster = set_extra_values(url)
|
||||
quality, language, plot, poster = set_extra_values(url, item.path)
|
||||
title = ''
|
||||
title = set_title(title, language, quality)
|
||||
|
||||
@@ -285,6 +425,7 @@ def findvideos(item):
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
def add_channel(item):
|
||||
support.log()
|
||||
import xbmc
|
||||
@@ -333,6 +474,7 @@ def add_channel(item):
|
||||
platformtools.dialog_notification(config.get_localized_string(20000), config.get_localized_string(70683) % json_file['channel_name'])
|
||||
return
|
||||
|
||||
|
||||
def remove_channel(item):
|
||||
support.log()
|
||||
import xbmc
|
||||
@@ -354,7 +496,7 @@ def remove_channel(item):
|
||||
return
|
||||
|
||||
|
||||
def set_extra_values(dict):
|
||||
def set_extra_values(dict, path):
|
||||
support.log()
|
||||
quality = ''
|
||||
language = ''
|
||||
@@ -368,7 +510,9 @@ def set_extra_values(dict):
|
||||
if 'plot' in dict and dict['plot'] != '':
|
||||
plot = dict['plot']
|
||||
if 'poster' in dict and dict['poster'] != '':
|
||||
poster = dict['poster']
|
||||
poster = dict['poster']if ':/' in dict['poster'] else path + dict['poster'] if '/' in dict['poster'] else ''
|
||||
elif 'thumbnail' in dict and dict['thumbnail'] != '':
|
||||
poster = dict['thumbnail']if ':/' in dict['thumbnail'] else path + dict['thumbnail'] if '/' in dict['thumbnail'] else ''
|
||||
|
||||
return quality, language, plot, poster
|
||||
|
||||
@@ -387,12 +531,14 @@ def set_title(title, language, quality):
|
||||
|
||||
return title
|
||||
|
||||
|
||||
def format_title(title):
|
||||
t = scrapertoolsV2.find_single_match(title, r'\{([^\}]+)\}')
|
||||
if 'bold' not in t: t += ' bold'
|
||||
title = re.sub(r'(\{[^\}]+\})','',title)
|
||||
return typo(title,t)
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.log('Search ', text)
|
||||
itemlist = []
|
||||
@@ -400,47 +546,55 @@ def search(item, text):
|
||||
|
||||
return load_links(item, itemlist, json_data, text)
|
||||
|
||||
|
||||
def load_links(item, itemlist, json_data, text):
|
||||
for option in json_data['menu']:
|
||||
json_data = load_json(option['link'] if option['link'].startswith('http') else item.path+option['link'])
|
||||
if not 'menu' in json_data:
|
||||
if "movies_list" in json_data: media_type= 'movies_list'
|
||||
elif "tvshows_list" in json_data: media_type = 'tvshows_list'
|
||||
elif "episodes_list" in json_data: media_type = 'episodes_list'
|
||||
if "generic_list" in json_data: media_type= 'generic_list'
|
||||
support.log()
|
||||
|
||||
if json_data:
|
||||
for media in json_data[media_type]:
|
||||
if text.lower() in media['title'].lower():
|
||||
quality, language, plot, poster = set_extra_values(media)
|
||||
def links(item, itemlist, json_data, text):
|
||||
support.log()
|
||||
if "movies_list" in json_data: media_type= 'movies_list'
|
||||
elif "tvshows_list" in json_data: media_type = 'tvshows_list'
|
||||
elif "episodes_list" in json_data: media_type = 'episodes_list'
|
||||
if "generic_list" in json_data: media_type= 'generic_list'
|
||||
|
||||
title = media['title']
|
||||
title = set_title(title, language, quality)
|
||||
if json_data:
|
||||
for media in json_data[media_type]:
|
||||
if text.lower() in media['title'].lower():
|
||||
quality, language, plot, poster = set_extra_values(media, item.path)
|
||||
|
||||
new_item = Item(channel=item.channel, title=format_title(title), quality=quality,
|
||||
language=language, plot=plot, personal_plot=plot, thumbnail=poster, path=item.path)
|
||||
title = media['title']
|
||||
title = set_title(title, language, quality)
|
||||
|
||||
new_item.infoLabels['year'] = media['year'] if 'year' in media else ''
|
||||
new_item.infoLabels['tmdb_id'] = media['tmdb_id'] if 'tmdb_id' in media else ''
|
||||
new_item = Item(channel=item.channel, title=format_title(title), quality=quality,
|
||||
language=language, plot=plot, personal_plot=plot, thumbnail=poster, path=item.path)
|
||||
|
||||
if 'movies_list' in json_data or 'generic_list' in json_data:
|
||||
new_item.url = media
|
||||
new_item.contentTitle = media['title']
|
||||
new_item.action = 'findvideos'
|
||||
else:
|
||||
new_item.url = media['seasons_list']
|
||||
new_item.contentSerieName = media['title']
|
||||
new_item.action = 'seasons'
|
||||
new_item.infoLabels['year'] = media['year'] if 'year' in media else ''
|
||||
new_item.infoLabels['tmdb_id'] = media['tmdb_id'] if 'tmdb_id' in media else ''
|
||||
|
||||
itemlist.append(new_item)
|
||||
if 'movies_list' in json_data or 'generic_list' in json_data:
|
||||
new_item.url = media
|
||||
new_item.contentTitle = media['title']
|
||||
new_item.action = 'findvideos'
|
||||
else:
|
||||
new_item.url = media['seasons_list']
|
||||
new_item.contentSerieName = media['title']
|
||||
new_item.action = 'seasons'
|
||||
|
||||
if not 'generic_list' in json_data:
|
||||
tmdb.set_infoLabels(itemlist, seekTmdb=True)
|
||||
for item in itemlist:
|
||||
if item.personal_plot != item.plot and item.personal_plot:
|
||||
item.plot = '\n\n' + typo('','submenu') + '\n' + item.personal_plot + '\n' + typo('','submenu') + '\n\n' + item.plot
|
||||
else:
|
||||
itemlist.append(new_item)
|
||||
|
||||
if not 'generic_list' in json_data:
|
||||
tmdb.set_infoLabels(itemlist, seekTmdb=True)
|
||||
for item in itemlist:
|
||||
if item.personal_plot != item.plot and item.personal_plot:
|
||||
item.plot = '\n\n' + typo('','submenu') + '\n' + item.personal_plot + '\n' + typo('','submenu') + '\n\n' + item.plot
|
||||
|
||||
if json_data.has_key('menu'):
|
||||
for option in json_data['menu']:
|
||||
json_data = load_json(option['link'] if option['link'].startswith('http') else item.path+option['link'])
|
||||
load_links(item, itemlist, json_data, text)
|
||||
else:
|
||||
links(item, itemlist, json_data, text)
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
@@ -454,18 +608,19 @@ def relative(key, json, path):
|
||||
ret = ''
|
||||
return ret
|
||||
|
||||
def load_json(item):
|
||||
support.log(item)
|
||||
url= item if type(item) == str else item.url
|
||||
|
||||
if url:
|
||||
def load_json(item):
|
||||
support.log()
|
||||
url= item if type(item) == str else item.url
|
||||
try:
|
||||
if url.startswith('http'):
|
||||
json_file = httptools.downloadpage(url).data
|
||||
else:
|
||||
json_file = open(url, "r").read()
|
||||
|
||||
json_data = jsontools.load(json_file)
|
||||
else:
|
||||
json_data = ''
|
||||
|
||||
except:
|
||||
json_data = {}
|
||||
|
||||
return json_data
|
||||
@@ -46,7 +46,7 @@ def mainlist(item):
|
||||
list_canales, any_active = get_channels_list()
|
||||
channel_language = config.get_setting("channel_language", default="auto")
|
||||
if channel_language == 'auto':
|
||||
channel_language = auto_filter()[0]
|
||||
channel_language = auto_filter()
|
||||
|
||||
#if list_canales['peliculas']:
|
||||
thumbnail = get_thumb("channels_movie.png")
|
||||
@@ -134,7 +134,7 @@ def get_channels_list():
|
||||
channels_path = os.path.join(config.get_runtime_path(), "channels", '*.json')
|
||||
channel_language = config.get_setting("channel_language", default="all")
|
||||
if channel_language =="auto":
|
||||
channel_language = auto_filter()[0]
|
||||
channel_language = auto_filter()
|
||||
|
||||
for infile in sorted(glob.glob(channels_path)):
|
||||
channel_id = os.path.basename(infile)[:-5]
|
||||
@@ -607,7 +607,7 @@ def setting_channel(item):
|
||||
channels_path = os.path.join(config.get_runtime_path(), "channels", '*.json')
|
||||
channel_language = config.get_setting("channel_language", default="auto")
|
||||
if channel_language == 'auto':
|
||||
channel_language = auto_filter()[0]
|
||||
channel_language = auto_filter()
|
||||
|
||||
|
||||
list_controls = []
|
||||
|
||||
@@ -475,7 +475,7 @@ def do_search(item, categories=None):
|
||||
logger.info("channels_path=%s" % channels_path)
|
||||
|
||||
# channel_language = config.get_setting("channel_language", default="all")
|
||||
channel_language = auto_filter()[0]
|
||||
channel_language = auto_filter()
|
||||
logger.info("channel_language=%s" % channel_language)
|
||||
|
||||
# Para Kodi es necesario esperar antes de cargar el progreso, de lo contrario
|
||||
|
||||
Reference in New Issue
Block a user