From 80c318a7b8dee268e45422d9c7c4d88a807aa462 Mon Sep 17 00:00:00 2001 From: Alhaziel Date: Thu, 19 Dec 2019 18:51:19 +0100 Subject: [PATCH 1/9] Community Custom Search URL --- specials/community.py | 66 ++++++++++++++++++++++++++++++------------- 1 file changed, 47 insertions(+), 19 deletions(-) diff --git a/specials/community.py b/specials/community.py index 48d66525..85aa5b71 100644 --- a/specials/community.py +++ b/specials/community.py @@ -97,6 +97,7 @@ def show_channels(item): def show_menu(item): global list_data itemlist = [] + add_search = True support.log() # If Second Level Menu if item.menu: @@ -127,11 +128,16 @@ def show_menu(item): filterkey=key if not url else '' )) if menu.has_key('search'): + if type(menu['search']) == dict and menu['search'].has_key('url'): + url = relative('url', menu['search'], item.path) + else: + url = '' itemlist.append(Item(channel=item.channel, title=typo('Cerca ' + item.fulltitle +'...','color kod bold'), thumbnail=get_thumb('search.png'), action='search', url=item.url, + custom_url=url, path=item.path)) return itemlist @@ -146,16 +152,28 @@ def show_menu(item): url = relative('link', option, item.path) submenu = option['submenu'] if option.has_key('submenu') else [] level2 = option['level2'] if option.has_key('level2') else [] - itemlist.append(Item(channel=item.channel, - title=format_title(option['title']), - fulltitle=option['title'], - thumbnail=thumbnail, - fanart=fanart, - plot=plot, - action='show_menu', - url=url, - path=item.path, - menu=level2)) + if option.has_key('title'): + itemlist.append(Item(channel=item.channel, + title=format_title(option['title']), + fulltitle=option['title'], + thumbnail=thumbnail, + fanart=fanart, + plot=plot, + action='show_menu', + url=url, + path=item.path, + menu=level2)) + if option.has_key('search'): + menu = json_data['menu'] + if type(option['search']) == dict and option['search'].has_key('url'): + url = relative('url', option['search'], item.path) + itemlist.append(Item(channel=item.channel, + title=typo('Cerca nel Canale...','color kod bold'), + thumbnail=get_thumb('search.png'), + action='search', + url=url, + path=item.path)) + add_search = False if submenu: for key in submenu: @@ -177,6 +195,10 @@ def show_menu(item): action='submenu', filterkey=key)) if submenu.has_key('search'): + if type(submenu['search']) == dict and submenu['search'].has_key('url'): + url = relative('url', submenu['search'], item.path) + else: + url = '' itemlist.append(Item(channel=item.channel, title=typo('Cerca ' + option['title'] +'...','color kod bold'), thumbnail=get_thumb('search.png'), @@ -205,13 +227,13 @@ def show_menu(item): itemlist += list_all(item) # add Search - if 'channel_name' in json_data: + if 'channel_name' in json_data and add_search: itemlist.append(Item(channel=item.channel, - title=typo('Cerca nel Canale...','color kod bold'), - thumbnail=get_thumb('search.png'), - action='search', - url=item.url, - path=item.path)) + title=typo('Cerca nel Canale...','color kod bold'), + thumbnail=get_thumb('search.png'), + action='search', + url=item.url, + path=item.path)) return itemlist @@ -245,6 +267,7 @@ def submenu(item): thumbnail = '' plot = '' if item.filterkey in ['director','actors']: + tmdb.set_infoLabels(itemlist, seekTmdb=True) load_info = load_json('http://api.themoviedb.org/3/search/person/?api_key=' + tmdb_api + '&language=' + lang + '&query=' + filter) id = str(load_info['results'][0]['id']) if load_info.has_key('results') else '' if id: @@ -655,7 +678,9 @@ def add_channel(item): community_json = open(path, "r") community_json = jsontools.load(community_json.read()) - id = len(community_json['channels']) + 1 + id = 1 + while community_json['channels'].has_key(str(id)): + id +=1 community_json['channels'][id]=(channel_to_add) with open(path, "w") as file: @@ -732,6 +757,8 @@ def format_title(title): def search(item, text): support.log('Search ', text) + if item.custom_url: + item.url=item.custom_url + text itemlist = [] json_data = load_json(item) @@ -782,8 +809,9 @@ def load_links(item, itemlist, json_data, text): 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) + if option.has_key('link'): + 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) From 7212301ce741d5da7f4e76e4f4433c327ac1ab36 Mon Sep 17 00:00:00 2001 From: greko17 Date: Thu, 19 Dec 2019 23:18:40 +0100 Subject: [PATCH 2/9] fix: resolverDNS fix per android --- specials/resolverdns.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/specials/resolverdns.py b/specials/resolverdns.py index ba832f5a..9a2bf11b 100644 --- a/specials/resolverdns.py +++ b/specials/resolverdns.py @@ -2,6 +2,8 @@ # -*- OVERRIDE RESOLVE DNS -*- from platformcode import config +import xbmc + if config.get_setting('resolver_dns'): from lib import dns @@ -9,8 +11,11 @@ if config.get_setting('resolver_dns'): from dns.resolver import override_system_resolver from core import support - res = resolver.Resolver(configure=True) - + support.log("platform Android: {}".format(xbmc.getCondVisibility('System.Platform.Android'))) + if xbmc.getCondVisibility('System.Platform.Android') == True: + res = resolver.Resolver(filename='/system/etc/resolv.conf', configure=False) + else: + res = resolver.Resolver(configure=True) #legge le impostazioni dalla configurazione e setta i relativi DNS if config.get_setting('resolver_dns_custom') and not config.get_setting('resolver_dns_service_choose'): res.nameservers = [config.get_setting('resolver_dns_custom1'),config.get_setting('resolver_dns_custom2')] From 0e5914386e3638a962d34de3ad816e03c06e198f Mon Sep 17 00:00:00 2001 From: greko17 Date: Thu, 19 Dec 2019 23:47:56 +0100 Subject: [PATCH 3/9] fix: resolverDNS fix per android --- specials/resolverdns.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/specials/resolverdns.py b/specials/resolverdns.py index 9a2bf11b..125e30f3 100644 --- a/specials/resolverdns.py +++ b/specials/resolverdns.py @@ -2,10 +2,9 @@ # -*- OVERRIDE RESOLVE DNS -*- from platformcode import config -import xbmc - if config.get_setting('resolver_dns'): + import xbmc from lib import dns from dns import resolver, name from dns.resolver import override_system_resolver @@ -13,7 +12,7 @@ if config.get_setting('resolver_dns'): support.log("platform Android: {}".format(xbmc.getCondVisibility('System.Platform.Android'))) if xbmc.getCondVisibility('System.Platform.Android') == True: - res = resolver.Resolver(filename='/system/etc/resolv.conf', configure=False) + res = resolver.Resolver(filename='/system/etc/resolv.conf', configure=True) else: res = resolver.Resolver(configure=True) #legge le impostazioni dalla configurazione e setta i relativi DNS From de66b12cd9ed1d68e2a1b9551b11c764bfdc9b9c Mon Sep 17 00:00:00 2001 From: greko17 Date: Fri, 20 Dec 2019 00:40:55 +0100 Subject: [PATCH 4/9] test: resolverDNS --- specials/resolverdns.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/specials/resolverdns.py b/specials/resolverdns.py index 125e30f3..6881d8ff 100644 --- a/specials/resolverdns.py +++ b/specials/resolverdns.py @@ -12,7 +12,8 @@ if config.get_setting('resolver_dns'): support.log("platform Android: {}".format(xbmc.getCondVisibility('System.Platform.Android'))) if xbmc.getCondVisibility('System.Platform.Android') == True: - res = resolver.Resolver(filename='/system/etc/resolv.conf', configure=True) + #res = resolver.Resolver(filename='/system/etc/resolv.conf', configure=True) + res = resolver.Resolver(filename='/system/etc/dhcpcd/dhcpcd-hooks/20-dns.conf', configure=True) else: res = resolver.Resolver(configure=True) #legge le impostazioni dalla configurazione e setta i relativi DNS From 757cd00481e86f414051ec0f4579364771b882c0 Mon Sep 17 00:00:00 2001 From: greko17 Date: Fri, 20 Dec 2019 01:03:38 +0100 Subject: [PATCH 5/9] revenge: resolverDNS --- specials/resolverdns.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specials/resolverdns.py b/specials/resolverdns.py index 6881d8ff..e502a7ee 100644 --- a/specials/resolverdns.py +++ b/specials/resolverdns.py @@ -12,8 +12,8 @@ if config.get_setting('resolver_dns'): support.log("platform Android: {}".format(xbmc.getCondVisibility('System.Platform.Android'))) if xbmc.getCondVisibility('System.Platform.Android') == True: - #res = resolver.Resolver(filename='/system/etc/resolv.conf', configure=True) - res = resolver.Resolver(filename='/system/etc/dhcpcd/dhcpcd-hooks/20-dns.conf', configure=True) + res = resolver.Resolver(filename='/system/etc/resolv.conf', configure=True) + #res = resolver.Resolver(filename='/system/etc/dhcpcd/dhcpcd-hooks/20-dns.conf', configure=True) else: res = resolver.Resolver(configure=True) #legge le impostazioni dalla configurazione e setta i relativi DNS From 82705ef806ec99e94bb22d02cac489082e687fb4 Mon Sep 17 00:00:00 2001 From: Alhaziel Date: Fri, 20 Dec 2019 11:13:48 +0100 Subject: [PATCH 6/9] Piccola miglioria a search e selezione dei thread --- channelselector.py | 4 +--- resources/language/English/strings.po | 2 +- resources/language/Italian/strings.po | 4 ++-- specials/search.json | 13 ++++++++++++- specials/search.py | 18 +++++++++++++++++- 5 files changed, 33 insertions(+), 8 deletions(-) diff --git a/channelselector.py b/channelselector.py index 1cacdc20..13d7d22d 100644 --- a/channelselector.py +++ b/channelselector.py @@ -36,9 +36,7 @@ def getmainlist(view="thumb_"): if addon.getSetting('enable_search_menu') == "true": itemlist.append(Item(title=config.get_localized_string(30103), channel="search", path='special', action="mainlist", thumbnail=get_thumb("search.png", view), - category=config.get_localized_string(30119), viewmode="list", - context=[{"title": config.get_localized_string(70286), "channel": "search", "action": "opciones", - "goto": True}])) + category=config.get_localized_string(30119), viewmode="list")) if addon.getSetting('enable_onair_menu') == "true": itemlist.append(Item(channel="filmontv", action="mainlist", title=config.get_localized_string(50001), diff --git a/resources/language/English/strings.po b/resources/language/English/strings.po index ed1c23a5..ee933baf 100644 --- a/resources/language/English/strings.po +++ b/resources/language/English/strings.po @@ -2715,7 +2715,7 @@ msgid "Global Search" msgstr "" msgctxt "#60673" -msgid "MultiThread Search" +msgid "Number of Search Threads" msgstr "" msgctxt "#60674" diff --git a/resources/language/Italian/strings.po b/resources/language/Italian/strings.po index 41a3780b..c9a879f2 100644 --- a/resources/language/Italian/strings.po +++ b/resources/language/Italian/strings.po @@ -2714,8 +2714,8 @@ msgid "Global Search" msgstr "Ricerca globale" msgctxt "#60673" -msgid "MultiThread Search" -msgstr "Ricerca MultiThread" +msgid "Number of Search Threads" +msgstr "Numero di Threads di Ricerca" msgctxt "#60674" msgid "Show Results:" diff --git a/specials/search.json b/specials/search.json index e752457d..62d846ec 100644 --- a/specials/search.json +++ b/specials/search.json @@ -5,5 +5,16 @@ "adult": false, "thumbnail": "", "banner": "", - "categories": [] + "categories": [], + "settings": [ + { + "id": "thread_number", + "type": "list", + "label": "@60673", + "default": 0, + "enabled": true, + "visible": true, + "lvalues": ["auto","1","2","4","6","8","16","24","32","64"] + } + ] } \ No newline at end of file diff --git a/specials/search.py b/specials/search.py index a0dee760..2aa55a2c 100755 --- a/specials/search.py +++ b/specials/search.py @@ -11,6 +11,9 @@ from channelselector import get_thumb from platformcode import logger, config, platformtools, unify from core.support import typo +import gc +gc.disable() + import xbmcaddon addon = xbmcaddon.Addon('metadata.themoviedb.org') def_lang = addon.getSetting('language') @@ -38,6 +41,9 @@ def mainlist(item): itemlist.append(Item(channel=item.channel, title=config.get_localized_string(59994), action='opciones', thumbnail=get_thumb('setting_0.png'))) + itemlist.append(Item(channel=item.channel, title=config.get_localized_string(60415), action='settings', + thumbnail=get_thumb('setting_0.png'))) + itemlist = set_context(itemlist) return itemlist @@ -179,7 +185,7 @@ def channel_search(item): str(searching_titles)) config.set_setting('tmdb_active', False) - with futures.ThreadPoolExecutor() as executor: + with futures.ThreadPoolExecutor(max_workers=set_workers()) as executor: c_results = [executor.submit(get_channel_results, ch, item, session) for ch in channel_list] for res in futures.as_completed(c_results): @@ -339,6 +345,13 @@ def get_channels(item): def opciones(item): return setting_channel_new(item) +def settings(item): + return platformtools.show_channel_settings(caption=config.get_localized_string(59993)) + +def set_workers(): + list_mode=[None,1,2,4,6,8,16,24,32,64] + index = config.get_setting('thread_number', 'search') + return list_mode[index] def setting_channel_new(item): import xbmcgui @@ -652,6 +665,9 @@ def set_context(itemlist): for elem in itemlist: elem.context = [{"title": config.get_localized_string(60412), "action": "setting_channel_new", + "channel": "search"}, + {"title": config.get_localized_string(60415), + "action": "settings", "channel": "search"}] return itemlist From aa6427ff64d908d39534f393ea2325aa550a8184 Mon Sep 17 00:00:00 2001 From: Alhaziel Date: Fri, 20 Dec 2019 20:05:22 +0100 Subject: [PATCH 7/9] Fix Cinemalibero --- channels/cinemalibero.py | 86 ++++++++++++++++++++++++++++++---------- core/support.py | 8 ++-- 2 files changed, 70 insertions(+), 24 deletions(-) diff --git a/channels/cinemalibero.py b/channels/cinemalibero.py index 5bb7ebcd..df6ede32 100644 --- a/channels/cinemalibero.py +++ b/channels/cinemalibero.py @@ -39,8 +39,7 @@ def mainlist(item): tvshow = ['/category/serie-tv/' ] -## Anime = [(support.typo('Anime', 'bullet bold'),['/category/anime-giapponesi/', 'peliculas', 'anime', 'tvshow']) -## ] + anime = ['/category/anime-giapponesi/'] ## Sport = [(support.typo('Sport', 'bullet bold'), ['/category/sport/', 'peliculas', 'sport', 'tvshow']) ## ] @@ -53,7 +52,7 @@ def mainlist(item): @support.scrape def peliculas(item): - + action = 'check' patronBlock = r'
.*?class="col-md-12[^"]*?">(?P.*?)
' if item.args == 'newest': patron = r'
[^>]+>[^>]+>\s[^\)]+)\)">[^>]+>(?P[^<]+)<[^>]+>[^>]+>(?:[^>]+>)?\s?(?P<rating>[\d\.]+)?[^>]+>.+?(?:[ ]\((?P<year>\d{4})\))?<[^>]+>[^>]+>(.?[\d\-x]+\s\(?(?P<lang>[sSuUbBiItTaA\-]+)?\)?\s?(?P<quality>[\w]+)?[|]?\s?(?:[fFiInNeE]+)?\s?\(?(?P<lang2>[sSuUbBiItTaA\-]+)?\)?)?' @@ -64,19 +63,23 @@ def peliculas(item): patronBlock = r'<section id="slider">(?P<block>.*?)</section>' patron = r'<a href="(?P<url>(?:https:\/\/.+?\/(?P<title>[^\/]+[a-zA-Z0-9\-]+)(?P<year>\d{4})))/".+?url\((?P<thumb>[^\)]+)\)">' elif item.contentType == 'tvshow': - action = 'episodios' - patron = r'<a href="(?P<url>[^"]+)".+?url\((?P<thumb>[^\)]+)\)">[^>]+>[^>]+>[^>]+>(?:[^>]+>)?\s?(?P<rating>[\d\.]+)?[^>]+>(?P<title>.+?)(?:[ ]\((?P<year>\d{4})\))?<[^>]+>[^>]+>(.?[\d\-x]+\s\(?(?P<lang>[sSuUbBiItTaA\-]+)?\)?\s?(?P<quality>[\w]+)?[|]?\s?(?:[fFiInNeE]+)?\s?\(?(?P<lang2>[sSuUbBiItTaA\-]+)?\)?)?' - if item.args == 'anime': - anime = True - patron = r'<div class="col-lg-3">[^>]+>[^>]+>\s<a href="(?P<url>[^"]+)".+?url\((?P<thumb>[^\)]+)\)">[^>]+>[^>]+>[^>]+>\s?(?P<rating>[\d\.]+)?[^>]+>[^>]+>(?P<title>.+?)\(?(?P<year>\d+)?\)?<[^>]+>[^>]+>(?:.+?[^fFiInNeE]+?\(?(?P<lang>[sSuUbBiItTaA]+)\)?.+?)<' - elif item.args == 'update': + # patron = r'<a href="(?P<url>[^"]+)".+?url\((?P<thumb>[^\)]+)\)">[^>]+>[^>]+>[^>]+>(?:[^>]+>)?\s?(?P<rating>[\d\.]+)?[^>]+>(?P<title>.+?)(?:[ ]\((?P<year>\d{4})\))?<[^>]+>[^>]+>(.?[\d\-x]+\s\(?(?P<lang>[sSuUbBiItTaA\-]+)?\)?\s?(?P<quality>[\w]+)?[|]?\s?(?:[fFiInNeE]+)?\s?\(?(?P<lang2>[sSuUbBiItTaA\-]+)?\)?)?' + # if item.args == 'anime': + # anime = True + # patron = r'<div class="col-lg-3">[^>]+>[^>]+>\s<a href="(?P<url>[^"]+)".+?url\((?P<thumb>[^\)]+)\)">[^>]+>[^>]+>[^>]+>\s?(?P<rating>[\d\.]+)?[^>]+>[^>]+>(?P<title>.+?)\(?(?P<year>\d+)?\)?<[^>]+>[^>]+>(?:.+?[^fFiInNeE]+?\(?(?P<lang>[sSuUbBiItTaA]+)\)?.+?)<' + if item.args == 'update': patron = r'<a href="(?P<url>[^"]+)".+?url\((?P<thumb>.+?)\)">\s<div class="titolo">(?P<title>.+?)(?: – Serie TV)?(?:\([sSuUbBiItTaA\-]+\))?[ ]?(?P<year>\d{4})?</div>[ ]<div class="genere">(?:[\w]+?\.?\s?[\s|S]?[\dx\-S]+?\s\(?(?P<lang>[iItTaA]+|[sSuUbBiItTaA\-]+)\)?\s?(?P<quality>[HD]+)?|.+?\(?(?P<lang2>[sSuUbBiItTaA\-]+)?\)?</div>)' pagination = 25 + else: + patron = r'<a href="(?P<url>[^"]+)"\s*title="(?P<title>[^"\(]+)(?:"|\()(?:(?P<year>\d+)[^"]+)?.*?url\((?P<thumb>[^\)]+)\)(?:.*?<div class="voto">[^>]+>[^>]+>\s*(?P<rating>[^<]+))?.*?<div class="titolo">[^>]+>(?:<div class="genere">[^ ]*(?:\s\d+)?\s*(?:\()?(?P<lang>[^\)< ]+))?' else: #search patron = r'<div class="col-lg-3">[^>]+>[^>]+>\s<a href="(?P<url>[^"]+)".+?url\((?P<thumb>[^\)]+)\)">[^>]+>[^>]+>[^>]+>(?:[^>]+>)?\s?(?P<rating>[\d\.]+)?[^>]+>(?P<title>.+?)(?:[ ]\((?P<year>\d{4})\))?<[^>]+>[^>]+>(.?[\d\-x]+\s\(?(?P<lang>[sSuUbBiItTaA\-]+)?\)?\s?(?P<quality>[\w]+)?[|]?\s?(?:[fFiInNeE]+)?\s?\(?(?P<lang2>[sSuUbBiItTaA\-]+)?\)?)?' def itemHook(item): + if 'sub' in item.contentLanguage.lower(): + item.contentLanguage= 'Sub-ITA' + item.title = re.sub('[Ss]ub(?:-)?', item.contentLanguage, item.title) if item.lang2: if len(item.lang2)<3: item.lang2 = 'ITA' @@ -93,19 +96,28 @@ def peliculas(item): @support.scrape def episodios(item): + data=item.data + # debug = True + support.log('EPISODIOS DATA',data) if item.args == 'anime': support.log("Anime :", item) - blacklist = ['Clipwatching', 'Verystream', 'Easybytez', 'Flix555', 'Cloudvideo'] - patron = r'(Stagione (?P<season>\d+))?.+?<a target=(?P<url>[^>]+>(?P<title>.+?(?P<episode>\d+)))(?:[:]?.+?)(?:</a></p>|</a><br />)' - patronBlock = r'Stagione (?P<season>\d+)</span><br />(?P<block>.*?)(?:<div style="margin-left:|<span class="txt_dow">)' + # blacklist = ['Clipwatching', 'Verystream', 'Easybytez', 'Flix555', 'Cloudvideo'] + patron = r'<a target=(?P<url>[^>]+>(?P<title>Episodio\s(?P<episode>\d+))(?::)?(?:(?P<title2>[^<]+))?.*?(?:<br|</p))' + patronBlock = r'(?:Stagione (?P<season>\d+))?(?:</span><br />|</span></p>|strong></p>)(?P<block>.*?)(?:<div style="margin-left|<span class="txt_dow">)' item.contentType = 'tvshow' - item.contentSerieName = item.fulltitle + # item.contentSerieName = item.fulltitle else:# item.extra == 'serie': + # debug = True support.log("Serie :", item) patron = r'(?P<episode>\d+(?:×|×)?\d+\-\d+|\d+(?:×|×)\d+)[;]?[ ]?(?:(?P<title>[^<]+)(?P<url>.*?)|(\2[ ])(?:<(\3.*?)))(?:</a><br />|</a></p>)' - patronBlock = r'<p><strong>(?P<block>(?:.+?[Ss]tagione.+?(?P<lang>iTA|ITA|Sub-ITA|Sub-iTA))?(?:|.+?|</strong>)(/?:</span>)?</p>.*?</p>)' + patronBlock = r'<p><strong>(?:.+?[Ss]tagione\s)?(?:(?P<lang>iTA|ITA|Sub-ITA|Sub-iTA))?.*?</strong>(?P<block>.+?)(?:</span|</p)' item.contentType = 'tvshow' - item.contentSerieName = item.fulltitle + # item.contentSerieName = item.fulltitle + def itemHook(item): + # support.dbg() + if not scrapertoolsV2.find_single_match(item.title, r'(\d+x\d+)'): + item.title = re.sub(r'(\d+) -', '1x\\1', item.title) + return item return locals() @@ -115,7 +127,7 @@ def genres(item): action='peliculas' patron_block=r'<div id="bordobar" class="dropdown-menu(?P<block>.*?)</li>' - patron=r'<a class="dropdown-item" href="(?P<url>[^"]+)" title="(?P<title>[A-z]+)"' + patronMenu=r'<a class="dropdown-item" href="(?P<url>[^"]+)" title="(?P<title>[A-z]+)"' return locals() @@ -124,7 +136,7 @@ def search(item, texto): support.log(item.url,texto) text = texto.replace(' ', '+') item.url = host + "/?s=" + texto - item.contentType = 'episode' + item.contentType = 'tv' item.args = 'search' try: return peliculas(item) @@ -162,9 +174,41 @@ def newest(categoria): return itemlist +def check(item): + data = httptools.downloadpage(item.url, headers=headers).data + # support.log('cinemalibero DATA=',data) + if data: + genere = scrapertoolsV2.find_single_match(data, r'rel="category tag">([a-zA-Z0-9]+).+?<') + blockAnime = scrapertoolsV2.find_single_match(data, r'<div id="container" class="container">(.+?<div style="margin-left)') + support.log('GENRE',genere) + + if blockAnime: + support.log('È un ANIME') + if 'episodio' in blockAnime.lower() or 'saga' in blockAnime.lower(): + item.contentType = 'tvshow' + item.args = 'anime' + item.data = blockAnime + return episodios(item) + elif scrapertoolsV2.find_single_match(blockAnime,r'\d+(?:×|×)?\d+\-\d+|\d+(?:×|×)\d+'): + item.contentType = 'tvshow' + item.data = blockAnime + return episodios(item) + else: + support.log('È un ANIME FILM') + item.contentType = 'movie' + item.url = data + return findvideos(item) + if genere.lower() == 'serie': + item.contentType = 'tvshow' + item.data = data + return episodios(item) + else: + support.log('È un FILM') + item.contentType = 'movie' + item.url = data + return findvideos(item) + def findvideos(item): support.log('findvideos ->', item) - if item.contentType == 'movie' and item.args != 'anime': - return support.server(item) - else: - return support.server(item, data= item.url) + item.url = item.url.replace('http://rapidcrypt.net/verys/', '').replace('http://rapidcrypt.net/open/', '') #blocca la ricerca + return support.server(item, data= item.url) diff --git a/core/support.py b/core/support.py index 174f8950..54941b8c 100755 --- a/core/support.py +++ b/core/support.py @@ -165,7 +165,6 @@ def scrapeLang(scraped, lang, longtitle): if not language: language = lang if language: longtitle += typo(language, '_ [] color kod') - return language, longtitle def cleantitle(title): @@ -221,8 +220,8 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t if scraped['season']: stagione = scraped['season'] episode = scraped['season'] +'x'+ scraped['episode'] - elif stagione: - episode = stagione +'x'+ scraped['episode'] + elif item.season: + episode = item.season +'x'+ scraped['episode'] elif item.contentType == 'tvshow' and (scraped['episode'] == '' and scraped['season'] == '' and stagione == ''): item.news = 'season_completed' episode = '' @@ -389,6 +388,9 @@ def scrape(func): blocks = scrapertoolsV2.find_multiple_matches_groups(data, patronBlock) block = "" for bl in blocks: + # log(len(blocks),bl) + if 'season' in bl and bl['season']: + item.season = bl['season'] blockItemlist, blockMatches = scrapeBlock(item, args, bl['block'], patron, headers, action, pagination, debug, typeContentDict, typeActionDict, blacklist, search, pag, function, lang) for it in blockItemlist: From 07c4911f8485f52b574110fe89dc33ef61ec9654 Mon Sep 17 00:00:00 2001 From: Alhaziel <alhaziel01@gmail.com> Date: Fri, 20 Dec 2019 20:06:12 +0100 Subject: [PATCH 8/9] Fix Clipwathing e CloudVideo --- servers/clipwatching.json | 2 +- servers/cloudvideo.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/servers/clipwatching.json b/servers/clipwatching.json index c30208df..c72359fa 100644 --- a/servers/clipwatching.json +++ b/servers/clipwatching.json @@ -4,7 +4,7 @@ "ignore_urls": [], "patterns": [ { - "pattern": "clipwatching.com/((?:embed-)?[a-zA-Z0-9./_-]+).html", + "pattern": "clipwatching.com/((?:embed-)?[a-zA-Z0-9./_\\-\\[\\]\\(\\)]+).html", "url": "http://clipwatching.com/\\1.html" } ] diff --git a/servers/cloudvideo.json b/servers/cloudvideo.json index b1073973..67daa35b 100644 --- a/servers/cloudvideo.json +++ b/servers/cloudvideo.json @@ -4,7 +4,7 @@ "ignore_urls": [], "patterns": [ { - "pattern": "cloudvideo.tv/(?:embed-)?([a-z0-9]+).html", + "pattern": "cloudvideo.tv/(?:embed-)?([a-z0-9]+)(?:.html)?", "url": "https://cloudvideo.tv/embed-\\1.html" } ] From 4da2ede624befbaa2bdd64ec6f759675967c3b3e Mon Sep 17 00:00:00 2001 From: marco <m.toma99@gmail.com> Date: Fri, 20 Dec 2019 22:32:33 +0100 Subject: [PATCH 9/9] KoD 0.6 --- addon.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addon.xml b/addon.xml index d48be31c..56365729 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<addon id="plugin.video.kod" name="Kodi on Demand BETA" version="0.5.2" provider-name="KOD Team"> +<addon id="plugin.video.kod" name="Kodi on Demand BETA" version="0.6" provider-name="KOD Team"> <requires> <import addon="xbmc.python" version="2.1.0"/> <import addon="script.module.libtorrent" optional="true"/> @@ -20,9 +20,9 @@ <screenshot>resources/media/themes/ss/2.png</screenshot> <screenshot>resources/media/themes/ss/3.png</screenshot> </assets> - <news>- Fixato cloudflare (parzialmente) - - Ricerca e navigazione più veloce - - N.B. Su Android alcunu siti come SerieHD e GuardaSerie.click non funzionano</news> + <news>-Nuova ricerca globale + -migliorie prestazionali in generale + -fix vari ai server</news> <description lang="it">Naviga velocemente sul web e guarda i contenuti presenti</description> <disclaimer>[COLOR red]The owners and submitters to this addon do not host or distribute any of the content displayed by these addons nor do they have any affiliation with the content providers.[/COLOR] [COLOR yellow]Kodi © is a registered trademark of the XBMC Foundation. We are not connected to or in any other way affiliated with Kodi, Team Kodi, or the XBMC Foundation. Furthermore, any software, addons, or products offered by us will receive no support in official Kodi channels, including the Kodi forums and various social networks.[/COLOR]</disclaimer>