diff --git a/platformcode/config.py b/platformcode/config.py index c1d13fce..650e01db 100644 --- a/platformcode/config.py +++ b/platformcode/config.py @@ -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(): diff --git a/resources/language/English/strings.po b/resources/language/English/strings.po index 659f0a72..a82aa558 100644 --- a/resources/language/English/strings.po +++ b/resources/language/English/strings.po @@ -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" diff --git a/resources/language/Italian/strings.po b/resources/language/Italian/strings.po index 5140b8a4..32105a30 100644 --- a/resources/language/Italian/strings.po +++ b/resources/language/Italian/strings.po @@ -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" diff --git a/resources/settings.xml b/resources/settings.xml index 799a6c18..68ebfdb9 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -2,7 +2,7 @@ - + @@ -63,7 +63,6 @@ - diff --git a/servers/akvideo.py b/servers/akvideo.py index c756cb35..3782780e 100644 --- a/servers/akvideo.py +++ b/servers/akvideo.py @@ -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= 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: diff --git a/specials/move_videolibrary.py b/specials/move_videolibrary.py index 1369bfd9..2ec0737c 100644 --- a/specials/move_videolibrary.py +++ b/specials/move_videolibrary.py @@ -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)) \ No newline at end of file diff --git a/specials/setting.py b/specials/setting.py index 5242dd42..12ee2e3f 100644 --- a/specials/setting.py +++ b/specials/setting.py @@ -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):