From 9e991c2d4946b9275c8d61d352c290b0b0d5565e Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Sat, 20 Aug 2022 10:57:44 +0200 Subject: [PATCH 1/5] Fix Impostazioni aggiornamento videoteca --- specials/videolibrary.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specials/videolibrary.json b/specials/videolibrary.json index 1e8a4223..7f98310e 100644 --- a/specials/videolibrary.json +++ b/specials/videolibrary.json @@ -37,7 +37,7 @@ "type": "list", "label": "@60613", "default": 1, - "enabled": "eq(-2,@60604)|eq(-2,@60605)|eq(-1,@60607)", + "enabled": "eq(-2,@60604)|eq(-2,@60605)|eq(-2,@60608)", "lvalues": [ "00:00", "04:00", From 5383448d442a665b9ceb8278c29b897aa53858a6 Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Sat, 20 Aug 2022 11:07:44 +0200 Subject: [PATCH 2/5] Fix Menu Contestuale in Libreria --- contextmenu.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contextmenu.py b/contextmenu.py index 7460af2a..46e3c8b0 100644 --- a/contextmenu.py +++ b/contextmenu.py @@ -1,10 +1,12 @@ from platformcode import config, logger import xbmc, sys, xbmcgui, os + librerias = xbmc.translatePath(os.path.join(config.get_runtime_path(), 'lib')) sys.path.insert(0, librerias) from core import jsontools, support +from core.item import Item addon_id = config.get_addon_core().getAddonInfo('id') @@ -45,7 +47,6 @@ def build_menu(): logger.debug('Add Select server menu item') contextmenuitems.append(config.get_localized_string(70192)) from core import filetools - from core.item import Item item = Item().fromurl(filetools.read(filePath)) item.disableAutoplay = True contextmenuactions.append(item) @@ -59,7 +60,7 @@ def build_menu(): if ret > -1: logger.debug('Contextmenu module index', ret, ', label=' + contextmenuitems[ret]) - if isinstance(contextmenuactions[ret], Item): + if type(contextmenuactions[ret]) == Item: from platformcode.launcher import run run(contextmenuactions[ret]) else: From f590067983c9b6a85d857d19204e089caba22b1b Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Sat, 20 Aug 2022 11:32:22 +0200 Subject: [PATCH 3/5] Migliorie contextmenu --- contextmenu.py | 14 +------------- platformcode/contextmenu/contextmenu.json | 3 ++- platformcode/contextmenu/show_servers.py | 23 +++++++++++++++++++++++ 3 files changed, 26 insertions(+), 14 deletions(-) create mode 100644 platformcode/contextmenu/show_servers.py diff --git a/contextmenu.py b/contextmenu.py index 46e3c8b0..f3b86a0d 100644 --- a/contextmenu.py +++ b/contextmenu.py @@ -43,14 +43,6 @@ def build_menu(): contextmenuitems.extend([item for item, fn in module_item_actions]) contextmenuactions.extend([fn for item, fn in module_item_actions]) - if 'kod' in filePath and mediatype in ['movie', 'episode'] and config.get_setting('autoplay'): - logger.debug('Add Select server menu item') - contextmenuitems.append(config.get_localized_string(70192)) - from core import filetools - item = Item().fromurl(filetools.read(filePath)) - item.disableAutoplay = True - contextmenuactions.append(item) - if len(contextmenuitems) == 0: logger.debug('No contextmodule found, build an empty one') contextmenuitems.append(empty_item()) @@ -60,11 +52,7 @@ def build_menu(): if ret > -1: logger.debug('Contextmenu module index', ret, ', label=' + contextmenuitems[ret]) - if type(contextmenuactions[ret]) == Item: - from platformcode.launcher import run - run(contextmenuactions[ret]) - else: - contextmenuactions[ret]() + contextmenuactions[ret]() def empty_item(): diff --git a/platformcode/contextmenu/contextmenu.json b/platformcode/contextmenu/contextmenu.json index 3acd6121..a5b2787f 100644 --- a/platformcode/contextmenu/contextmenu.json +++ b/platformcode/contextmenu/contextmenu.json @@ -1,5 +1,6 @@ [ "platformcode.contextmenu.search", "platformcode.contextmenu.tvshow_options", - "platformcode.contextmenu.trailer" + "platformcode.contextmenu.trailer", + "platformcode.contextmenu.show_servers" ] \ No newline at end of file diff --git a/platformcode/contextmenu/show_servers.py b/platformcode/contextmenu/show_servers.py new file mode 100644 index 00000000..cd128de9 --- /dev/null +++ b/platformcode/contextmenu/show_servers.py @@ -0,0 +1,23 @@ +import xbmc + +from core.item import Item +from platformcode import config + + +def get_menu_items(): + mediatype = xbmc.getInfoLabel('ListItem.DBTYPE') + filePath = xbmc.getInfoLabel('ListItem.FileNameAndPath') + res = [] + if 'kod' in filePath and mediatype in ['movie', 'episode'] and config.get_setting('autoplay'): + res = [(config.get_localized_string(70192), execute)] + return res + + +def execute(): + from core import filetools + from platformcode.launcher import run + filePath = xbmc.getInfoLabel('ListItem.FileNameAndPath') + item = Item().fromurl(filetools.read(filePath)) + item.disableAutoplay = True + + run(item) From fb80f47bc8993969dacc7236d0c78ac76e8b15a1 Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Tue, 23 Aug 2022 18:08:37 +0200 Subject: [PATCH 4/5] Fix Tmdb In caso non si conosca il mediatype e sia presente l'anno --- channels/altadefinizione.py | 2 +- core/tmdb.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/channels/altadefinizione.py b/channels/altadefinizione.py index 938e18d5..cc20d38a 100644 --- a/channels/altadefinizione.py +++ b/channels/altadefinizione.py @@ -70,7 +70,7 @@ def peliculas(item): action = 'check' patron = r'src="(?Phttp[^"]+)(?:[^>]+>){4}\s*]+>\s*(?P[^\[\(\<]+)(?:\[(?P<quality>[^\]]+)\])?\s*(?:\((?P<lang>[a-zA-z-]+)\))?\s*(?:\((?P<year>\d+)\))?\s*</a>\s*</h2>' if item.args == 'search': - patron = '<title>(?P<title>[^\[\(\<]+)(?:\[(?P<quality>[^\]]+)\])?\s*(?:\((?P<lang>[a-zA-z-]+)\))?[^>]+>\s*<link>(?P<url>[^<]+)' + patron = r'<title>(?P<title>[^\[\(\<]+)(?:\[(?P<quality>[^\]]+)\])?\s*(?:\((?P<lang>[a-zA-z-]+)\))?\s*(?:\((?P<year>\d+)\))?\s*[^>]+>\s*<link>(?P<url>[^<]+)' patronNext = r'href="([^"]+)[^>]+>Successivo' return locals() diff --git a/core/tmdb.py b/core/tmdb.py index c2418df0..5a6880fb 100644 --- a/core/tmdb.py +++ b/core/tmdb.py @@ -1033,7 +1033,13 @@ class Tmdb(object): if len(results) > 1: from lib.fuzzy_match import algorithims if self.search_type == 'multi': - results.sort(key=lambda r: algorithims.trigram(text_simple, r.get('name', '') if r.get('media_type') == 'tv' else r.get('title', '')), reverse=True) + if self.search_year: + for r in results: + if (r.get('release_date', '') and r.get('release_date', '')[:4] == self.search_year) or (r.get('first_air_date', '') and r.get('first_air_date', '')[:4] == self.search_year): + results = [r] + break + if len(results) > 1: + results.sort(key=lambda r: algorithims.trigram(text_simple, r.get('name', '') if r.get('media_type') == 'tv' else r.get('title', '')), reverse=True) else: results.sort(key=lambda r: algorithims.trigram(text_simple, r.get('name', '') if self.search_type == 'tv' else r.get('title', '')), reverse=True) From d20384c9cf3af7ea8e75bcf4d6004992db43963a Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Wed, 24 Aug 2022 08:57:47 +0200 Subject: [PATCH 5/5] Fix Film Streaming --- channels/filmstreaming.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/channels/filmstreaming.py b/channels/filmstreaming.py index c2ac9276..feced848 100644 --- a/channels/filmstreaming.py +++ b/channels/filmstreaming.py @@ -64,9 +64,11 @@ def newest(categoria): @support.scrape def peliculas(item): + # debug=True if item.args == 'last': patronBlock = r'inseriti:(?P<block>.*?)<div class="block-showmore' - patron = r'item-movie">[^>]+><a href="(?P<url>[^"]+)[^>]+><img data-src="(?P<thumb>[^"]+)(?:[^>]+>){6}(?P<title>[^<]+)(?:[^>]+>){6}(?P<quality>[^<]+)' + patron = r'item-movie">[^>]+><a href="(?P<url>[^"]+)[^>]+><img data-src="(?P<thumb>[^"]+)(?:[^>]+>){6}(?P<title>[^<]+)(?:[^>]+>){4}(?P<year>\d+)?(?:[^>]+>){2}(?P<quality>[^<]+)' + # patron = r'item-movie">[^>]+><a href="(?P<url>[^"]+)[^>]+><img data-src="(?P<thumb>[^"]+)(?:[^>]+>){6}(?P<title>[^<]+)(?:[^>]+>){6}(?P<quality>[^<]+)' patronNext = r'<a href="([^"]+)">&rarr' return locals()