diff --git a/channels/toonitalia.py b/channels/toonitalia.py index 51a3287f..eeff58af 100644 --- a/channels/toonitalia.py +++ b/channels/toonitalia.py @@ -3,8 +3,7 @@ # Canale per ToonItalia # ------------------------------------------------------------ -from core import httptools, scrapertools, support -import inspect +from core import scrapertools, support host = support.config.get_channel_url() headers = [['Referer', host]] @@ -13,17 +12,15 @@ headers = [['Referer', host]] @support.menu def mainlist(item): menu = [('Anime',['/category/anime', 'peliculas', '', 'undefined']), - ('Anime ITA {submenu}',['/anime-ita', 'peliculas', 'list', 'undefined']), - ('Anime Sub-ITA {submenu}',['/contatti', 'peliculas', 'list', 'undefined']), - ('Film Animazione',['/film-animazione', 'peliculas', 'list', 'undefined']), - ('Serie TV',['/serie-tv/', 'peliculas', 'list', 'tvshow'])] + ('Anime ITA {submenu}',['/anime-ita', 'peliculas', 'list', 'undefined']), + ('Anime Sub-ITA {submenu}',['/contatti', 'peliculas', 'list', 'undefined']), + ('Film Animazione',['/film-animazione', 'peliculas', 'list', 'undefined']), + ('Serie TV',['/serie-tv/', 'peliculas', 'list', 'tvshow'])] search = '' return locals() def search(item, text): - item.args='search' - item.thumbnail = 'anime' item.contentType = 'undefined' item.url = "{}/?{}".format(host, support.urlencode({"s": text})) support.info(item.url) @@ -50,14 +47,9 @@ def peliculas(item): patron = r'
  • (?P[^<]+)' else: - patronBlock = '<main[^>]+>(?P<block>.*)</main>' - patron = r'<article.*?<h2 class="entry-title.*?<a href="(?P<url>.*?)">(?P<title>.*?)</a>.*?<img.*?src="(?P<thumb>.*?)".*?<p>(?P<plot>.*?)</p>.*?</article>' - if item.args == 'search': - patron = r'<article.*?<h2 class="entry-title.*?<a href="(?P<url>.*?)">(?P<title>.*?)</a>.*?<p>(?P<plot>.*?)</p>.*?</article>' - - typeContentDict={'movie':['film']} - typeActionDict={'findvideos':['film']} - patronNext = '<a class="next page-numbers" href="([^"]+)">' + patronBlock = r'<main[^>]+>(?P<block>.*)</main>' + patron = r'class="entry-title[^>]+><a href="(?P<url>[^"]+)">(?P<title>[^<]+)</a>.*?<p>(?P<plot>[^<]+)' + patronNext = r'<a class="next page-numbers" href="([^"]+)">' def itemHook(item): support.info(item.title) @@ -79,7 +71,7 @@ def check(item): def episodios(item): anime = True item.contentType = 'tvshow' - patron = r'>\s*(?:(?P<season>\d+)(?:×|x|×))?(?P<episode>\d+)(?:\s+–\s+)?[ –]+(?P<title2>[^<]+)[ –]+<a (?P<data>.*?)(?:<br|</p)' + patron = r'>\s*(?:(?P<season>\d+)(?:×|x|×))?(?:0*)?(?P<episode>\d+)(?:\s+–\s+)?[ –]+(?P<title>[^<]+)' return locals() diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index a26a8f30..a1c0a5f1 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -340,7 +340,11 @@ def render_items(itemlist, parent_item): def setItem(n, item, parent_item): item.itemlistPosition = n item_url = item.tourl() - + if item.thumbnail == parent_item.thumbnail and parent_item.action in ['peliculas', 'search']: + if item.contentType in ['movie', 'undefined']: + item.thumbnail = 'https://raw.githubusercontent.com/kodiondemand/media/master/null/movie.png' + else: + item.thumbnail = 'https://raw.githubusercontent.com/kodiondemand/media/master/null/tv.png' if item.category == "": item.category = parent_item.category # If there is no action or it is findvideos / play, folder = False because no listing will be returned @@ -484,7 +488,7 @@ def getCurrentView(item=None, parent_item=None): elif item.contentType == 'music': return 'musicvideo', 'musicvideos' - elif (item.contentType in ['movie'] and parent_item.action in parent_actions) \ + elif (item.contentType in ['movie', 'undefined'] and parent_item.action in parent_actions) \ or (item.channel in ['videolibrary'] and parent_item.action in ['list_movies']) \ or (parent_item.channel in ['favorites'] and parent_item.action in ['mainlist']) \ or parent_item.action in ['now_on_tv', 'now_on_misc', 'now_on_misc_film', 'mostrar_perfil', 'live', 'replay', 'news']: