Merge remote-tracking branch 'origin/master'

This commit is contained in:
marco
2020-03-22 11:41:11 +01:00
8 changed files with 119 additions and 57 deletions

View File

@@ -152,7 +152,7 @@ def enable_disable_autorun(is_enabled):
if is_enabled is False:
with open(path, append_write) as file:
file.write("import xbmc\nxbmc.executebuiltin('XBMC.RunAddon(plugin.video.kod)')")
set_setting('autostart', get_localized_string(707431))
set_setting('autostart', 'On')
else:
file = open(path, "r")
old_content = file.read()
@@ -160,7 +160,7 @@ def enable_disable_autorun(is_enabled):
file.close()
with open(path, "w") as file:
file.write(new_content)
set_setting('autostart', get_localized_string(707432))
set_setting('autostart', 'Off')
return True
def get_all_settings_addon():

View File

@@ -42,7 +42,7 @@ msgid "Automatically update channels"
msgstr ""
msgctxt "#30005"
msgid "Play mode"
msgid "Video quality"
msgstr ""
msgctxt "#30006"
@@ -50,11 +50,11 @@ msgid "Ask"
msgstr ""
msgctxt "#30007"
msgid "Watch in low quality"
msgid "Low"
msgstr ""
msgctxt "#30008"
msgid "Watch in high quality"
msgid "High"
msgstr ""
msgctxt "#30010"
@@ -206,7 +206,7 @@ msgid "Unsopported Server"
msgstr ""
msgctxt "#30067"
msgid "Video library path"
msgid "Path"
msgstr ""
msgctxt "#30068"
@@ -286,7 +286,7 @@ msgid "Adult"
msgstr ""
msgctxt "#30130"
msgid "Recent"
msgid "News"
msgstr ""
msgctxt "#30131"
@@ -1483,7 +1483,7 @@ msgid "Restart Kodi to apply changes"
msgstr ""
msgctxt "#60327"
msgid "Novelties"
msgid "News"
msgstr ""
msgctxt "#60328"
@@ -3231,7 +3231,7 @@ msgid "Syncronize with Trakt.tv"
msgstr ""
msgctxt "#70110"
msgid "Priority Method"
msgid "Priority method"
msgstr ""
msgctxt "#70111"
@@ -3263,7 +3263,7 @@ msgid "Confirm new password"
msgstr ""
msgctxt "#70118"
msgid "TV shows folder
msgid "TV shows folder"
msgstr ""
msgctxt "#70119"
@@ -3715,7 +3715,7 @@ msgid "Move the downloaded file to the video library"
msgstr ""
msgctxt "#70232"
msgid "View downloaded files
msgid "View downloaded files"
msgstr ""
msgctxt "#70233"
@@ -3747,7 +3747,7 @@ msgid "Preferred quality"
msgstr ""
msgctxt "#70241"
msgid "The highest"
msgid "Highest"
msgstr ""
msgctxt "#70242"
@@ -5590,7 +5590,7 @@ msgid "Use your custom channel URLs"
msgstr ""
msgctxt "#70706"
msgid "Start KoD at Kodi boot"
msgid "Launch KoD at Kodi start"
msgstr ""
msgctxt "#70707"

View File

@@ -42,20 +42,20 @@ msgid "Automatically update channels"
msgstr "Aggiorna automaticamente i canali"
msgctxt "#30005"
msgid "Play mode"
msgstr "Modalità di riproduzione"
msgid "Video quality"
msgstr "Qualità video"
msgctxt "#30006"
msgid "Ask"
msgstr "Chiedi"
msgctxt "#30007"
msgid "Watch in low quality"
msgstr "Guarda in bassa qualità"
msgid "Low"
msgstr "Bassa"
msgctxt "#30008"
msgid "Watch in high quality"
msgstr "Guarda in alta qualità"
msgid "High"
msgstr "Alta"
msgctxt "#30010"
msgid "Channel icons view"
@@ -206,8 +206,8 @@ msgid "Unsopported Server"
msgstr "Server non supportato"
msgctxt "#30067"
msgid "Video library path"
msgstr "Percorso videoteca"
msgid "Path"
msgstr "Percorso"
msgctxt "#30068"
msgid "Filter by servers"
@@ -286,7 +286,7 @@ msgid "Adult"
msgstr "Adulti"
msgctxt "#30130"
msgid "Recent"
msgid "News"
msgstr "Novità"
msgctxt "#30131"
@@ -1482,7 +1482,7 @@ msgid "Restart Kodi to apply changes"
msgstr "Riavvia Kodi per applicare le modifiche"
msgctxt "#60327"
msgid "Novelties"
msgid "News"
msgstr "Novità"
msgctxt "#60328"
@@ -3230,7 +3230,7 @@ msgid "Syncronize with Trakt.tv"
msgstr "Sincronizza con Trakt.tv"
msgctxt "#70110"
msgid "Priority Method"
msgid "Priority method"
msgstr "Priorità"
msgctxt "#70111"
@@ -3746,8 +3746,8 @@ msgid "Preferred quality"
msgstr "Qualità preferita"
msgctxt "#70241"
msgid "The highest"
msgstr "La più alta"
msgid "Highest"
msgstr "Più alta"
msgctxt "#70242"
msgid "Choose fastest servers"
@@ -5590,7 +5590,7 @@ msgid "Use your custom channel URLs"
msgstr "Utilizza URL personalizzati per i canali"
msgctxt "#70706"
msgid "Start KoD at Kodi boot"
msgid "Launch KoD at Kodi start"
msgstr "Esegui KoD all'avvio di Kodi"
msgctxt "#70707"

View File

@@ -2,7 +2,7 @@
<settings>
<!-- General -->
<category label="70168">
<setting id="autostart" type="action" label="70706" action="RunPlugin(plugin://plugin.video.kod/?ew0KICAgICJhY3Rpb24iOiAiYXV0b3N0YXJ0IiwNCiAgICAiY2hhbm5lbCI6ICJzZXR0aW5nIg0KfQ==)" default="707432"/>
<setting id="autostart" type="action" label="70706" action="RunPlugin(plugin://plugin.video.kod/?ew0KICAgICJhY3Rpb24iOiAiYXV0b3N0YXJ0IiwNCiAgICAiY2hhbm5lbCI6ICJzZXR0aW5nIg0KfQ==)" default="Off"/>
<setting type="sep"/>
<setting id="thumbnail_type" type="select" lvalues="30011|30012|30200" label="30010" default="2"/>
<setting id="channel_language" type="select" values="auto|all|ita" label="30019" default="all"/>
@@ -63,7 +63,6 @@
<setting id="downloadenabled" type="bool" label="70689" default="false"/>
<setting id="downloadpath" type="folder" label="30017" visible="eq(-1,true)" default="special://profile/addon_data/plugin.video.kod/downloads" subsetting="true"/>
<setting id="downloadlistpath" type="folder" label="30018" visible="eq(-2,true)" default="special://profile/addon_data/plugin.video.kod/downloads/list" subsetting="true"/>
<setting id="library_add" type="bool" label="70230" default="false"/>
<setting id="library_move" type="bool" label="70231" default="false" visible="eq(-1,true)" subsetting="true"/>
<setting id="browser" type="bool" label="70232" default="true"/>

View File

@@ -54,14 +54,24 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
data = block if block else data
# URL
# logger.info(data)
matches = scrapertools.find_multiple_matches(data, '''src:\s*["']?(http.*?\.mp4)''')
# logger.info(str(matches))
if vres:
matches = scrapertools.find_multiple_matches(data, '''src:\s*["']?(http.*?\.mp4)''')
else:
matches = scrapertools.find_multiple_matches(data, '''src:\s*["']?(http.*?\.mp4)(?:[^,]+,[^,]+,res:([^,]+))?''')
if matches:
if len(matches[0])==2:
i=0
for m in matches:
vres.append("%sx" % m[1])
matches[i]=m[0]
i+=1
_headers = urllib.urlencode(httptools.default_headers)
i = 0
for media_url in matches:
# URL del vídeo
video_urls.append([vres[i] + " mp4 [Akvideo] ", media_url.replace('https://', 'http://') + '|' + _headers])
video_urls.append([vres[i] if i<len(vres) else "" + " mp4 [Akvideo] ", media_url.replace('https://', 'http://') + '|' + _headers])
i = i + 1
return sorted(video_urls, key=lambda x: int(x[0].split('x')[0]))
return sorted(video_urls, key=lambda x: int(x[0].split('x')[0])) if vres else video_urls

View File

@@ -446,7 +446,8 @@ def get_sub_menu(item, json, key, itemlist=[]):
action = 'show_menu',
menu = level2 if not item.menu else None,
filterkey = filterkey,
context = CONTEXT)
context = CONTEXT,
description = extra.description)
itemlist.append(it)
if 'search' in option:
@@ -468,7 +469,6 @@ def get_search_menu(item, json='', itemlist=[], channel_name=''):
else:
title = 'Cerca ' + item.fulltitle + '...'
extra = set_extra_values(item, json, item.path)
support.log('EXTRA',extra)
itemlist.append(Item(channel=item.channel,
title=support.typo(title,'submenu bold'),
@@ -487,30 +487,59 @@ def get_search_menu(item, json='', itemlist=[], channel_name=''):
return itemlist
def submenu(item, json, key, itemlist = []):
def submenu(item, json, key, itemlist = [], filter_list = []):
support.log(item)
import sys
if sys.version_info[0] >= 3:
from concurrent import futures
else:
from concurrent_py2 import futures
filter_list = []
for option in json[key]:
if item.filterkey in option and option[item.filterkey]:
if type(option[item.filterkey]) == str and option[item.filterkey] not in filter_list:
filter_list.append(option[item.filterkey])
elif type(option[item.filterkey]) == list:
for f in option[item.filterkey]:
if f not in filter_list:
filter_list.append(f)
if item.description:
if type(item.description) == dict:
description = item.description
else:
if ':/' in item.description: url = item.description
else: url = filetools.join(item.path, item.description)
description = load_json(url)
else:
description = None
filter_list.sort()
if item.thumb: item.thumbnail = item.thumb
if not filter_list:
for option in json[key]:
if item.filterkey in option and option[item.filterkey]:
if type(option[item.filterkey]) == str and option[item.filterkey] not in filter_list:
filter_list.append(option[item.filterkey])
elif type(option[item.filterkey]) == list:
for f in option[item.filterkey]:
if f not in filter_list:
filter_list.append(f)
filter_list.sort()
Pagination = int(defp) if defp.isdigit() else ''
pag = item.page if item.page else 1
filters = []
for i, filter in enumerate(filter_list):
if Pagination and (pag - 1) * Pagination > i: continue # pagination
if Pagination and i >= pag * Pagination: break
filters.append(filter)
with futures.ThreadPoolExecutor() as executor:
List = [executor.submit(filter_thread, filter, key, item) for filter in filter_list]
List = [executor.submit(filter_thread, filter, key, item, description) for filter in filters]
for res in futures.as_completed(List):
if res.result():
itemlist.append(res.result())
if Pagination and len(itemlist) >= Pagination:
item.title = support.typo(config.get_localized_string(30992), 'color kod bold')
item.page = pag + 1
item.thumb = item.thumbnail
item.thumbnail = support.thumb()
itemlist.append(item)
itemlist = sorted(itemlist, key=lambda it: it.title)
return itemlist
@@ -518,12 +547,12 @@ def submenu(item, json, key, itemlist = []):
################################ Filter results ################################
# filter results
def filter_thread(filter, key, item):
thumbnail = ''
plot = ''
def filter_thread(filter, key, item, description):
thumbnail = plot = fanart = ''
if item.filterkey in ['actors', 'director']:
dict_ = {'url': 'search/person', 'language': lang, 'query': filter, 'page': 1}
tmdb_inf = tmdb.discovery(item, dict_=dict_)
id = None
if tmdb_inf.results:
results = tmdb_inf.results[0]
id = results['id']
@@ -532,13 +561,21 @@ def filter_thread(filter, key, item):
json_file = httptools.downloadpage('http://api.themoviedb.org/3/person/'+ str(id) + '?api_key=' + tmdb_api + '&language=en', use_requests=True).data
plot += jsontools.load(json_file)['biography']
if description:
if filter in description:
extra = set_extra_values(item, description[filter], item.path)
thumbnail = extra.thumb if extra.thumb else item.thumbnail
fanart = extra.fanart if extra.fanart else item.fanart
plot = extra.plot if extra.plot else item.plot
item = Item(channel=item.channel,
title=support.typo(filter, 'bold'),
url=item.url,
media_type=item.media_type,
action='peliculas',
thumbnail=thumbnail,
plot=plot,
thumbnail=thumbnail if thumbnail else item.thumbnail,
fanart=fanart if fanart else item.fanart,
plot=plot if plot else item.plot,
path=item.path,
filterkey=item.filterkey,
filter=filter,
@@ -619,9 +656,10 @@ def set_extra_values(item, json, path):
filterkey = json[key].keys()[0]
ret.filter = json[key][filterkey]
ret.filterkey = filterkey
elif key == 'description':
ret.description = json[key]
if not ret.thumb:
support.log('STACK=',inspect.stack()[1][3])
if 'get_search_menu' in inspect.stack()[1][3]:
ret.thumb = get_thumb('search.png')
else:

View File

@@ -10,20 +10,26 @@ from xml.dom import minidom
global p
p = 0
progress = platformtools.dialog_progress('Spostamento Videoteca','Spostamento File')
progress.update(p, '')
def set_videolibrary_path(item):
log()
global p
previous_path = config.get_setting('videolibrarypath')
path = xbmcgui.Dialog().browse(3, 'Seleziona la cartella', 'files', '', False, False, config.get_setting('videolibrarypath'))
log('New Videolibrary path:', path)
log('Previous Videolibrary path:', previous_path)
if path != previous_path:
config.set_setting('videolibrarypath', path)
progress.update(p, '')
set_new_path(path, previous_path)
if platformtools.dialog_yesno('Spostare la Videoteca?', 'vuoi postare la videoteca e il relativo contenuto nella nuova posizione?'):
if platformtools.dialog_yesno('Spostare la Videoteca?', 'vuoi spostare la videoteca e il relativo contenuto nella nuova posizione?'):
move_videolibrary(path, previous_path)
progress.update(p, 'Spostamento Database')
move_db(path, previous_path)
clear_cache()
progress.close()
platformtools.dialog_ok('Spostamento Completato','')
@@ -176,3 +182,10 @@ def set_new_path(new, old):
nodo_type.appendChild(element_default)
source_nodes.appendChild(nodo_type)
xmldoc.appendChild(source_nodes)
def clear_cache():
path = xbmc.translatePath('special://home/cache/archive_cache/')
for file in filetools.listdir(path):
log(file)
filetools.remove(filetools.join(path, file))

View File

@@ -100,9 +100,11 @@ def channel_config(item):
def autostart(item): # item necessario launcher.py linea 265
if config.enable_disable_autorun(AUTOSTART):
xbmcgui.Dialog().ok(config.get_localized_string(20000), config.get_localized_string(70709))
logger.info('AUTOSTART ENABLED')
# xbmcgui.Dialog().ok(config.get_localized_string(20000), config.get_localized_string(70709))
else:
xbmcgui.Dialog().ok(config.get_localized_string(20000), config.get_localized_string(70710))
logger.info('AUTOSTART ENABLED')
# xbmcgui.Dialog().ok(config.get_localized_string(20000), config.get_localized_string(70710))
def setting_torrent(item):