diff --git a/channels.json b/channels.json index bd5df542..8258dba7 100644 --- a/channels.json +++ b/channels.json @@ -8,6 +8,7 @@ "animesubita": "http://www.animesubita.org", "animetubeita": "http://www.animetubeita.com", "animeworld": "https://www.animeworld.cc", + "animeunity": "https://www.animeunity.it", "casacinema": "https://www.casacinema.biz", "casacinemaInfo": "https://casacinema.kim", "cb01anime": "https://www.cineblog01.ink", diff --git a/channels/animeunity.json b/channels/animeunity.json new file mode 100644 index 00000000..99dc0fe0 --- /dev/null +++ b/channels/animeunity.json @@ -0,0 +1,11 @@ +{ + "id": "animeunity", + "name": "AnimeUnity", + "active": true, + "adult": false, + "language": ["ita", "sub-ita"], + "thumbnail": "animeunity.png", + "banner": "animeunity.png", + "categories": ["anime"], + "settings": [] +} diff --git a/channels/animeunity.py b/channels/animeunity.py new file mode 100644 index 00000000..cced6c5a --- /dev/null +++ b/channels/animeunity.py @@ -0,0 +1,122 @@ +# -*- coding: utf-8 -*- +# ------------------------------------------------------------ +# Canale per AnimeUnity +# ------------------------------------------------------------ + +from core import support + +host = support.config.get_channel_url() + +list_servers = ['mixdrop', 'wstream', 'vupplayer', 'supervideo', 'cloudvideo', 'gounlimited'] +list_quality = ['default','1080p', '720p', '480p', '360p'] + +headers = [['Referer', host]] + + +@support.menu +def mainlist(item): + anime = ['/anime.php?c=archive&page=*', + ('In Corso',['/anime.php?c=onair', 'peliculas']), + ('Ultimi Episodi', ['', 'peliculas', 'news']), + ('Ultimi Aggiunti', ['', 'peliculas', 'last']) + ] + return locals() + + +@support.scrape +def menu(item): + action = 'peliculas' + patronBlock = item.args + r' Categorie\s*.*?)' + patronMenu = r']+>(?P[^>]+)<' + return locals() + + +def search(item, text): + support.log('search', item) + item.url = host + '/anime.php?c=archive&page=*' + item.search = text + try: + return peliculas(item) + # Continua la ricerca in caso di errore + except: + import sys + for line in sys.exc_info(): + support.log('search log:', line) + return [] + + +def newest(categoria): + support.log(categoria) + itemlist = [] + item = support.Item() + item.url = host + item.args = 'news' + item.action = 'peliculas' + try: + itemlist = peliculas(item) + + if itemlist[-1].action == 'peliculas': + itemlist.pop() + # Continua la ricerca in caso di errore + except: + import sys + for line in sys.exc_info(): + support.log({0}.format(line)) + return [] + + return itemlist + + +@support.scrape +def peliculas(item): + # debug = True + pagination = 20 + anime = True + if item.args == 'news': + patron = r'col-lg-3 col-md-6 col-sm-6 col-xs-6 mobile-col">\s*<a href="(?P<url>[^"]+)">[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*<img class="[^"]+" src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>[^-]+)\D+Episodio\s*(?P<episode>\d+)' + patronNext = r'page-link" href="([^"]+)">' + elif item.args == 'last': + patronBlock = r'ULTIME AGGIUNTE[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<block>.*?)<div class="row"' + patron = r'<img class="[^"]+" src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>\s*<a class="[^"]+" href="(?P<url>[^"]+)"\s*>(?P<title>[^<]+)</a>' + else: + search = item.search + patron = r'<div class="card-img-top archive-card-img"> <a href="(?P<url>[^"]+)"> <img class="[^"]+" src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>[^<\(]+)(?:\((?P<lang>[^\)]+)\))?' + return locals() + + +@support.scrape +def episodios(item): + data = item.data + anime = True + pagination = 50 + patron = r'<a href="([^"]+)" class="\D+ep-button">(?P<episode>\d+)' + def itemHook(item): + item.title = item.title + support.typo(item.fulltitle,'-- bold') + return item + return locals() + + +def findvideos(item): + support.log() + html = support.match(item, patron=r'TIPO:\s*</b>\s*([A-Za-z]+)') + if html.match == 'TV': + item.contentType = 'tvshow' + item.data = html.data + return episodios(item) + else: + itemlist = [] + video = support.match(html.data, patron=r'<source src="([^"]+)"').match + item.contentType = 'movie' + itemlist.append( + support.Item( + channel=item.channel, + action="play", + title='Diretto', + quality='', + url=video, + server='directo', + fulltitle=item.fulltitle, + show=item.show, + contentType=item.contentType, + folder=False)) + return support.server(item, itemlist=itemlist) diff --git a/core/support.py b/core/support.py index 5293231d..1b6dd4bb 100755 --- a/core/support.py +++ b/core/support.py @@ -201,8 +201,8 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t stagione = '' # per quei siti che hanno la stagione nel blocco ma non nelle puntate for i, match in enumerate(matches): - if pagination and (pag - 1) * pagination > i: continue # pagination - if pagination and i >= pag * pagination: break # pagination + if pagination and (pag - 1) * pagination > i and not search: continue # pagination + if pagination and i >= pag * pagination and not search: break # pagination listGroups = match.keys() match = match.values() @@ -214,7 +214,7 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t for kk in known_keys: val = match[listGroups.index(kk)] if kk in listGroups else '' if val and (kk == "url" or kk == 'thumb') and 'http' not in val: - val = scrapertools.find_single_match(item.url, 'https?://[a-z0-9.-]+') + val + val = scrapertools.find_single_match(item.url, 'https?://[a-z0-9.-]+') + (val if val.startswith('/') else '/' + val) scraped[kk] = val if scraped['season']: