From 5348eebe1996cb8b561d3441718e4649eec50254 Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Thu, 30 Sep 2021 19:41:46 +0200 Subject: [PATCH] - Riscritto News - Finzioni peliculas -> movies, episodios -> episodes - Aggiornato sqlitedict - fix minori --- channels.json | 3 +- channels/0example.json.txt | 2 +- channels/0example.py.txt | 28 +- channels/accuradio.py | 8 +- channels/altadefinizione01.py | 24 +- channels/altadefinizione01_link.py | 24 +- channels/altadefinizioneclick.json | 2 +- channels/altadefinizioneclick.py | 28 +- channels/altadefinizionecommunity.py | 14 +- channels/animealtadefinizione.py | 22 +- channels/animeforce.py | 28 +- channels/animeleggendari.json | 2 +- channels/animeleggendari.py | 20 +- channels/animesaturn.py | 28 +- channels/animeunity.py | 18 +- channels/animeuniverse.py | 24 +- channels/animeworld.py | 28 +- channels/aniplay.py | 20 +- channels/casacinema.py | 26 +- channels/cb01anime.py | 22 +- channels/cineblog01.py | 38 +- channels/cinemalibero.json | 2 +- channels/cinemalibero.py | 30 +- channels/cinetecadibologna.json | 2 +- channels/cinetecadibologna.py | 6 +- channels/discoveryplus.py | 12 +- channels/dreamsub.py | 30 +- channels/dsda.py | 22 +- channels/eurostreaming.py | 18 +- channels/fastsubita.json | 2 +- channels/fastsubita.py | 44 +- channels/film4k.json | 2 +- channels/film4k.py | 18 +- channels/filmigratis.json | 4 +- channels/filmigratis.py | 28 +- channels/filmpertutti.py | 26 +- channels/guardaseriecam.py | 10 +- channels/guardaserieclick.json | 4 +- channels/guardaserieclick.py | 32 +- channels/guardaserieicu.py | 8 +- channels/hd4me.py | 6 +- channels/ilcorsaronero.py | 22 +- channels/ilgeniodellostreaming.py | 40 +- channels/ilgeniodellostreaming_cam.py | 18 +- channels/italiaserie.json | 2 +- channels/italiaserie.py | 30 +- channels/la7.py | 12 +- channels/mediasetplay.py | 14 +- channels/mediasetplay.py.old | 12 +- channels/metalvideo.py | 6 +- channels/mondoserietv.py | 28 +- channels/netfreex.json | 2 +- channels/netfreex.py | 10 +- channels/paramount.py | 10 +- channels/piratestreaming.py | 26 +- channels/polpotv.py | 22 +- channels/pufimovies.py | 32 +- channels/raiplay.py | 12 +- channels/seriehd.py | 32 +- channels/serietvonline.py | 36 +- channels/serietvsubita.json | 2 +- channels/serietvsubita.py | 22 +- channels/serietvu.json | 2 +- channels/serietvu.py | 24 +- channels/streamingaltadefinizione.json | 2 +- channels/streamingaltadefinizione.py | 8 +- channels/streamingcommunity.py | 35 +- channels/streamtime.py | 16 +- channels/tantifilm.json | 2 +- channels/tantifilm.py | 18 +- channels/tapmovie.py | 10 +- channels/toonitalia.json | 4 +- channels/toonitalia.py | 22 +- channels/vedohd.py | 8 +- channels/vvvvid.py | 66 +-- channelselector.py | 6 +- core/channeltools.py | 12 +- core/scrapertools.py | 2 +- core/support.py | 61 +-- core/tmdb.py | 4 +- core/videolibrarytools.py | 2 +- default_channel_settings.json | 4 +- lib/generictools.py | 96 ++-- lib/sqlitedict.py | 21 +- platformcode/envtal.py | 10 +- platformcode/platformtools.py | 30 +- platformcode/unify.py | 4 +- platformcode/xbmc_videolibrary.py | 10 +- resources/settings.xml | 12 +- servers/directo.json | 2 +- specials/classicsearch.py | 33 +- specials/community.py | 24 +- specials/globalsearch.py | 2 +- specials/news.py | 662 +++++-------------------- specials/news.py.old.py | 656 ++++++++++++++++++++++++ specials/search.py | 2 +- specials/tvmoviedb.py | 3 +- 97 files changed, 1633 insertions(+), 1347 deletions(-) create mode 100644 specials/news.py.old.py diff --git a/channels.json b/channels.json index 888b3c70..87c0004f 100644 --- a/channels.json +++ b/channels.json @@ -48,6 +48,7 @@ "findhost": { "altadefinizioneclick": "https://altadefinizione-nuovo.click", "altadefinizionecommunity": "https://altaregistrazione.com", - "filmpertutti": "https://filmpertuttiii.nuovo.live" + "filmpertutti": "https://filmpertuttiii.nuovo.live", + "streamingcommunity": "https://streamingcommunity-nuovo.link" } } \ No newline at end of file diff --git a/channels/0example.json.txt b/channels/0example.json.txt index 568c6405..2fc93406 100644 --- a/channels/0example.json.txt +++ b/channels/0example.json.txt @@ -35,7 +35,7 @@ se vanno cancellati tutti deve rimanere la voce: "visible": false }, { - "id": "include_in_newest_peliculas", + "id": "include_in_newest_movie", "type": "bool", "label": "@70727", "default": false, diff --git a/channels/0example.py.txt b/channels/0example.py.txt index a07a91de..a5e61b01 100644 --- a/channels/0example.py.txt +++ b/channels/0example.py.txt @@ -80,14 +80,14 @@ def mainlist(item): # Voce FILM, puoi solo impostare l'url film = ['', # url per la voce FILM, se possibile la pagina principale con le ultime novità #Voce Menu,['url','action','args',contentType] - ('Al Cinema', ['', 'peliculas', '']), + ('Al Cinema', ['', 'movies', '']), ('Generi', ['', 'genres', 'genres']), ('Per Lettera', ['', 'genres', 'letters']), ('Anni', ['', 'genres', 'years']), ('Qualità', ['', 'genres', 'quality']), ('Mi sento fortunato', ['', 'genres', 'lucky']), - ('Popolari', ['', 'peliculas', '']), - ('Sub-ITA', ['', 'peliculas', '']) + ('Popolari', ['', 'movies', '']), + ('Sub-ITA', ['', 'movies', '']) ] # Voce SERIE, puoi solo impostare l'url @@ -144,7 +144,7 @@ def mainlist(item): # lang = lingua del video. Es: ITA, Sub-ITA, Sub, SUB ITA. # AVVERTENZE: Se il titolo è trovato nella ricerca TMDB/TVDB/Altro allora le locandine e altre info non saranno quelle recuperate nel sito.!!!! @support.scrape -def peliculas(item): +def movies(item): #logger.dbg() # decommentare per attivare web_pdb action = '' @@ -158,7 +158,7 @@ def peliculas(item): return locals() @support.scrape -def episodios(item): +def episodes(item): #logger.dbg() action = '' @@ -192,7 +192,7 @@ def genres(item): # per quei casi dove il sito non differenzia film e/o serie e/o anime # e la ricerca porta i titoli mischiati senza poterli distinguere tra loro -# andranno modificate anche le def peliculas e episodios ove occorre +# andranno modificate anche le def movies e episodes ove occorre def select(item): logger.debug() #logger.dbg() @@ -203,7 +203,7 @@ def select(item): block = scrapertools.find_single_match(data, r'') if re.findall('', data, re.IGNORECASE): logger.debug('select = ### è una serie ###') - return episodios(Item(channel=item.channel, + return episodes(Item(channel=item.channel, title=item.title, fulltitle=item.fulltitle, url=item.url, @@ -223,7 +223,7 @@ def search(item, text): # se il canale è solo film, si può omettere, altrimenti bisgona aggiungerlo e discriminare. item.contentType = item.contentType try: - return peliculas(item) + return movies(item) # Se captura la excepcion, para no interrumpir al buscador global si un canal falla except: import sys @@ -235,17 +235,17 @@ def search(item, text): # da adattare al canale # inserire newest solo se il sito ha la pagina con le ultime novità/aggiunte # altrimenti NON inserirlo -def newest(categoria): - logger.debug(categoria) +def newest(category): + logger.debug(category) itemlist = [] item = Item() try: - if categoria == 'peliculas': + if category == 'movie': item.url = host - item.action = 'peliculas' - itemlist = peliculas(item) + item.action = 'movies' + itemlist = movies(item) - if itemlist[-1].action == 'peliculas': + if itemlist[-1].action == 'movies': itemlist.pop() # Continua la ricerca in caso di errore except: diff --git a/channels/accuradio.py b/channels/accuradio.py index 9fc879cc..8b0aee29 100644 --- a/channels/accuradio.py +++ b/channels/accuradio.py @@ -15,7 +15,7 @@ headers = [['Referer', host]] def mainlist(item): js = httptools.downloadpage(api_url.format('brands')).json itemlist = [] - item.action = 'peliculas' + item.action = 'movies' js = httptools.downloadpage(api_url.format('brands')).json for it in js.get('features',[]) + js.get('brands',[]): itemlist.append( @@ -31,7 +31,7 @@ def mainlist(item): @support.scrape -def peliculas(item): +def movies(item): tmdbEnabled = False action = 'playradio' patron = r'data-id="(?P[^"]+)"\s*data-oldid="(?P[^"]+)".*?data-name="(?P[^"]+)(?:[^>]+>){5}<img class="[^"]+"\s*src="(?P<thumb>[^"]+)(?:[^>]+>){6}\s*(?P<plot>[^<]+)' @@ -74,9 +74,9 @@ def search(item, text): artists = support.match(data, patronBlock=r'artistResults(.*?)</ul', patron=r'href="(?P<url>[^"]+)"\s*>(?P<title>[^<]+)').matches if artists: for url, artist in artists: - itemlist.append(item.clone(title=support.typo(artist,'bullet bold'), thumbnail=support.thumb('music'), url=host+url, action='peliculas')) + itemlist.append(item.clone(title=support.typo(artist,'bullet bold'), thumbnail=support.thumb('music'), url=host+url, action='movies')) item.data = data - itemlist += peliculas(item) + itemlist += movies(item) # Continua la ricerca in caso di errore except: import sys diff --git a/channels/altadefinizione01.py b/channels/altadefinizione01.py index 024cb984..90e75ada 100644 --- a/channels/altadefinizione01.py +++ b/channels/altadefinizione01.py @@ -21,19 +21,19 @@ headers = [['Referer', host]] def mainlist(item): film = [ - ('Al Cinema', ['/cinema/', 'peliculas', 'pellicola']), - ('Ultimi Aggiornati-Aggiunti', ['','peliculas', 'update']), + ('Al Cinema', ['/cinema/', 'movies', 'pellicola']), + ('Ultimi Aggiornati-Aggiunti', ['','movies', 'update']), ('Generi', ['', 'genres', 'genres']), ('Lettera', ['/catalog/a/', 'genres', 'az']), ('Anni', ['', 'genres', 'years']), - ('Sub-ITA', ['/sub-ita/', 'peliculas', 'pellicola']) + ('Sub-ITA', ['/sub-ita/', 'movies', 'pellicola']) ] return locals() @support.scrape -def peliculas(item): +def movies(item): action="findvideos" @@ -60,7 +60,7 @@ def peliculas(item): @support.scrape def genres(item): - action = "peliculas" + action = "movies" blacklist = ['Altadefinizione01'] if item.args == 'genres': @@ -95,7 +95,7 @@ def search(item, text): item.url = host + "/index.php?do=search&story=%s&subaction=search" % (text) item.args = "search" try: - return peliculas(item) + return movies(item) # Cattura la eccezione così non interrompe la ricerca globle se il canale si rompe! except: import sys @@ -103,18 +103,18 @@ def search(item, text): logger.error("search except: %s" % line) return [] -def newest(categoria): - logger.debug(categoria) +def newest(category): + logger.debug(category) itemlist = [] item = Item() try: - if categoria == "peliculas": + if category == "movie": item.url = host - item.action = "peliculas" + item.action = "movies" item.contentType = 'movie' - itemlist = peliculas(item) - if itemlist[-1].action == "peliculas": + itemlist = movies(item) + if itemlist[-1].action == "movies": itemlist.pop() # Continua la ricerca in caso di errore except: diff --git a/channels/altadefinizione01_link.py b/channels/altadefinizione01_link.py index 17bac949..a828e3c4 100644 --- a/channels/altadefinizione01_link.py +++ b/channels/altadefinizione01_link.py @@ -16,20 +16,20 @@ headers = [['Referer', host]] @support.menu def mainlist(item): film = [ - ('Al Cinema', ['/film-del-cinema', 'peliculas', '']), + ('Al Cinema', ['/film-del-cinema', 'movies', '']), ('Generi', ['', 'genres', 'genres']), ('Anni', ['', 'genres', 'years']), ('Qualità', ['/piu-visti.html', 'genres', 'quality']), ('Mi sento fortunato', ['/piu-visti.html', 'genres', 'lucky']), - ('Popolari', ['/piu-visti.html', 'peliculas', '']), - ('Sub-ITA', ['/film-sub-ita/', 'peliculas', '']) + ('Popolari', ['/piu-visti.html', 'movies', '']), + ('Sub-ITA', ['/film-sub-ita/', 'movies', '']) ] return locals() # ======== def in ordine di action dal menu =========================== @support.scrape -def peliculas(item): +def movies(item): patron = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)(?:[^>]+>){5}\s*<div class="[^"]+" style="background-image:url\((?P<thumb>[^\)]+)(?:[^>]+>){6}\s*(?P<year>\d{4})[^>]+>[^>]+>(?:\s*(?P<duration>\d+))?(?:[^>]+>){0,2}\s+(?P<quality>[a-zA-Z]+)\s+(?:[^>]+>){2}\s*(?P<lang>[^>]+)\s+[^>]+>' patronNext = r'<span>\d</span> <a href="([^"]+)">' return locals() @@ -38,7 +38,7 @@ def peliculas(item): @support.scrape def genres(item): - action = 'peliculas' + action = 'movies' if item.args == 'genres': patronBlock = r'<ul class="listSubCat" id="Film">(?P<block>.*)<ul class="listSubCat" id="Anno">' elif item.args == 'years': @@ -59,7 +59,7 @@ def search(item, text): text = text.replace(" ", "+") item.url = host+"/index.php?do=search&story=%s&subaction=search" % (text) try: - return peliculas(item) + return movies(item) # Se captura la excepcion, para no interrumpir al buscador global si un canal falla except: import sys @@ -69,18 +69,18 @@ def search(item, text): # =========== def per le novità nel menu principale ============= -def newest(categoria): - logger.debug(categoria) +def newest(category): + logger.debug(category) itemlist = [] item = Item() try: - if categoria == "peliculas": + if category == "movie": item.url = host - item.action = "peliculas" + item.action = "movies" item.contentType='movie' - itemlist = peliculas(item) + itemlist = movies(item) - if itemlist[-1].action == "peliculas": + if itemlist[-1].action == "movies": itemlist.pop() # Continua la ricerca in caso di errore except: diff --git a/channels/altadefinizioneclick.json b/channels/altadefinizioneclick.json index 663998db..8428a78b 100644 --- a/channels/altadefinizioneclick.json +++ b/channels/altadefinizioneclick.json @@ -6,6 +6,6 @@ "thumbnail": "altadefinizioneclick.png", "bannermenu": "altadefinizioneciclk.png", "categories": ["tvshow","movie","sub"], - "not_active":["include_in_newest_series"], + "not_active":["include_in_newest_tvshow"], "settings": [] } diff --git a/channels/altadefinizioneclick.py b/channels/altadefinizioneclick.py index f964579a..6f5e73fa 100644 --- a/channels/altadefinizioneclick.py +++ b/channels/altadefinizioneclick.py @@ -19,14 +19,14 @@ headers = [['Referer', host]] @support.menu def mainlist(item): film = ['', - ('Novità', ['/nuove-uscite/', 'peliculas', 'news']), - ('Al Cinema', ['/al-cinema/', 'peliculas', 'cinema']), + ('Novità', ['/nuove-uscite/', 'movies', 'news']), + ('Al Cinema', ['/al-cinema/', 'movies', 'cinema']), ('A-Z',['/lista-film/', 'genres', 'az']), ('Generi', ['', 'genres', 'genres']), ('Anni', ['', 'genres', 'years']), ('Qualità', ['', 'genres', 'quality']), ('Mi sento Fortunato',[ '', 'genres', 'lucky']), - ('Sub-ITA', ['/sub-ita/', 'peliculas', 'sub']) + ('Sub-ITA', ['/sub-ita/', 'movies', 'sub']) ] tvshow = ['/serie-tv/'] @@ -35,7 +35,7 @@ def mainlist(item): return locals() @support.scrape -def peliculas(item): +def movies(item): action = 'check' patron = r'<div class="wrapperImage">\s*(?:<span class="year">(?P<year>[^<]+)[^>]+>)?(?:<span class="hd">(?P<quality>[^<>]+))?.+?href="(?P<url>[^"]+)".+?src="(?P<thumb>[^"]+)".+?<h2 class="titleFilm">[^>]+>(?P<title>.+?)[ ]?(?:|\[(?P<lang>[^\]]+)\])?</a>.*?(?:IMDB\:</strong>[ ](?P<rating>.+?)<|</div>)' @@ -60,7 +60,7 @@ def peliculas(item): @support.scrape def genres(item): - action = 'peliculas' + action = 'movies' patronGenreMenu = r'<li><a href="(?P<url>[^"]+)">(?P<title>[^<]+)<' if item.args == 'genres': @@ -88,7 +88,7 @@ def search(item, text): item.args = 'search' item.url = host + "?s=" + text try: - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -96,19 +96,19 @@ def search(item, text): logger.error("%s" % line) return [] -def newest(categoria): - logger.debug(categoria) +def newest(category): + logger.debug(category) itemlist = [] item = Item() try: - if categoria == "peliculas": + if category == "movie": item.args = 'news' item.contentType = 'movie' item.url = host + "/nuove-uscite/" - item.action = "peliculas" - itemlist = peliculas(item) + item.action = "movies" + itemlist = movies(item) - if itemlist[-1].action == "peliculas": + if itemlist[-1].action == "movies": itemlist.pop() # Continua la ricerca in caso di errore @@ -156,10 +156,10 @@ def check(item): if res.result(): data += res.result() item.data = data - return episodios(item) + return episodes(item) @support.scrape -def episodios(item): +def episodes(item): data = item.data patron = r'(?P<season>\d+)x(?P<episode>\d+)\s*-\s*(?P<title>[^\|]+)\|(?P<url>[^ ]+)' diff --git a/channels/altadefinizionecommunity.py b/channels/altadefinizionecommunity.py index b1188f83..e72b81aa 100644 --- a/channels/altadefinizionecommunity.py +++ b/channels/altadefinizionecommunity.py @@ -128,7 +128,7 @@ def registerOrLogin(): @support.scrape -def peliculas(item): +def movies(item): json = {} # debug=True @@ -138,7 +138,7 @@ def peliculas(item): elif item.contentType == 'movie': action = 'findvideos' else: - action = 'episodios' + action = 'episodes' if '/load-more-film' not in item.url and '/search' not in item.url: # generi o altri menu, converto import ast @@ -160,7 +160,7 @@ def peliculas(item): url = '='.join(spl[:-1]) page = str(int(spl[-1])+1) total_pages = json.get('lastPage', 0) - support.nextPage(itemlist, item, 'peliculas', next_page='='.join((url, page)), total_pages=total_pages) + support.nextPage(itemlist, item, 'movies', next_page='='.join((url, page)), total_pages=total_pages) return itemlist return locals() @@ -172,7 +172,7 @@ def search(item, texto): item.args = 'search' item.url = host + "/search?s={}&page=1".format(texto) try: - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -200,13 +200,13 @@ def genres(item): patronBlock = r'ANNO(?P<block>.*?</section>)' else: patronBlock = ('Film' if item.contentType == 'movie' else 'Serie TV') + r'<span></span></a>\s+<ul class="dropdown-menu(?P<block>.*?)active-parent-menu' - action = 'peliculas' + action = 'movies' return locals() @support.scrape -def episodios(item): +def episodes(item): logger.debug() data = item.data patron = r'class="playtvshow "\s*data-href="(?P<url>[^"]+)' @@ -225,7 +225,7 @@ def check(item): resolve_url(item) if '/tvshow' in item.url: item.contentType = 'tvshow' - return episodios(item) + return episodes(item) else: item.contentType = 'movie' return findvideos(item) diff --git a/channels/animealtadefinizione.py b/channels/animealtadefinizione.py index 5e193863..081f1af5 100644 --- a/channels/animealtadefinizione.py +++ b/channels/animealtadefinizione.py @@ -21,13 +21,13 @@ def mainlist(item): ('Tipo',['', 'menu', 'Anime']), ('Anno',['', 'menu', 'Anno']), ('Genere', ['', 'menu','Genere']), - ('Ultimi Episodi',['', 'peliculas', 'last'])] + ('Ultimi Episodi',['', 'movies', 'last'])] return locals() @support.scrape def menu(item): - action = 'peliculas' + action = 'movies' patronBlock= r'<a href="' + host + r'/category/' + item.args.lower() + r'/">' + item.args + r'</a>\s*<ul class="sub-menu">(?P<block>.*?)</ul>' patronMenu = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)<' if 'genere' in item.args.lower(): @@ -39,7 +39,7 @@ def search(item, text): logger.debug(text) item.search = text try: - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -48,14 +48,14 @@ def search(item, text): return [] -def newest(categoria): - logger.debug(categoria) +def newest(category): + logger.debug(category) item = support.Item() try: - if categoria == "anime": + if category == "anime": item.url = host item.args = "last" - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -65,7 +65,7 @@ def newest(categoria): @support.scrape -def peliculas(item): +def movies(item): if '/movie/' in item.url: item.contentType = 'movie' action='findvideos' @@ -74,7 +74,7 @@ def peliculas(item): action='findvideos' else: item.contentType = 'tvshow' - action='episodios' + action='episodes' if item.search: query = 's' searchtext = item.search @@ -98,13 +98,13 @@ def peliculas(item): if item.search: itemlist = [ it for it in itemlist if ' Episodio ' not in it.title ] if len(itemlist) == int(perpage): - support.nextPage(itemlist, item, 'peliculas', page=page + 1, total_pages=int(res.match)) + support.nextPage(itemlist, item, 'movies', page=page + 1, total_pages=int(res.match)) return itemlist return locals() @support.scrape -def episodios(item): +def episodes(item): numerationEnabled = True pagination = True patron = epPatron diff --git a/channels/animeforce.py b/channels/animeforce.py index 2b0e6586..5e6e9dfa 100644 --- a/channels/animeforce.py +++ b/channels/animeforce.py @@ -13,20 +13,20 @@ headers = [['Referer', host]] @support.menu def mainlist(item): anime = ['/lista-anime/', - ('In Corso',['/anime/anime-status/in-corso/', 'peliculas', 'status']), - ('Completi',['/anime/anime-status/completo/', 'peliculas', 'status']), + ('In Corso',['/anime/anime-status/in-corso/', 'movies', 'status']), + ('Completi',['/anime/anime-status/completo/', 'movies', 'status']), ('Genere',['/anime', 'submenu', 'genre']), ('Anno',['/anime', 'submenu', 'anime-year']), ('Tipologia',['/anime', 'submenu', 'anime-type']), ('Stagione',['/anime', 'submenu', 'anime-season']), - ('Ultime Serie',['/category/anime/articoli-principali/','peliculas','last']) + ('Ultime Serie',['/category/anime/articoli-principali/','movies','last']) ] return locals() @support.scrape def submenu(item): - action = 'peliculas' + action = 'movies' patronBlock = r'data-taxonomy="' + item.args + r'"(?P<block>.*?)</select' patronMenu = r'<option class="level-\d+ (?P<u>[^"]+)"[^>]+>(?P<title>[^(]+)[^\(]+\((?P<num>\d+)' if 'genre' in item.args: @@ -38,16 +38,16 @@ def submenu(item): return locals() -def newest(categoria): - logger.debug(categoria) +def newest(category): + logger.debug(category) itemlist = [] item = support.Item() try: - if categoria == "anime": + if category == "anime": item.contentType = 'tvshow' item.url = host item.args = 'newest' - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -63,7 +63,7 @@ def search(item, text): item.url = host + '/lista-anime/' item.contentType = 'tvshow' try: - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -73,7 +73,7 @@ def search(item, text): @support.scrape -def peliculas(item): +def movies(item): search = item.search numerationEnabled = True if 'movie' in item.url: @@ -104,12 +104,12 @@ def check(item): item.contentType = 'movie' return findvideos(item) else: - return episodios(item) + return episodes(item) -def episodios(item): +def episodes(item): @support.scrape def _episodes(item): - actLike = 'episodios' + actLike = 'episodes' disableAll = True data = item.data @@ -135,7 +135,7 @@ def episodios(item): from platformcode.autorenumber import start start(itemlist, item) - itemlist = support.season_pagination(itemlist, item, function_level='episodios') + itemlist = support.season_pagination(itemlist, item, function_level='episodes') return itemlist diff --git a/channels/animeleggendari.json b/channels/animeleggendari.json index 8ebc82ab..fe07b6a4 100644 --- a/channels/animeleggendari.json +++ b/channels/animeleggendari.json @@ -6,6 +6,6 @@ "thumbnail": "animepertutti.png", "bannermenu": "animepertutti.png", "categories": ["anime", "sub"], - "not_active":["include_in_newest_peliculas", "include_in_newest_series", "include_in_newest_anime"], + "not_active":["include_in_newest_movie", "include_in_newest_tvshow", "include_in_newest_anime"], "settings": [] } diff --git a/channels/animeleggendari.py b/channels/animeleggendari.py index b24ac957..92df7b2a 100644 --- a/channels/animeleggendari.py +++ b/channels/animeleggendari.py @@ -20,11 +20,11 @@ headers = [['User-Agent', 'Mozilla/50.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/ def mainlist(item): anime = [ - # ('Leggendari', ['/category/anime-leggendari/', 'peliculas']), - ('ITA', ['/category/anime-ita/', 'peliculas']), - ('SUB-ITA', ['/category/anime-sub-ita/', 'peliculas']), - ('Conclusi', ['/category/serie-anime-concluse/', 'peliculas']), - ('in Corso', ['/category/serie-anime-in-corso/', 'peliculas']), + # ('Leggendari', ['/category/anime-leggendari/', 'movies']), + ('ITA', ['/category/anime-ita/', 'movies']), + ('SUB-ITA', ['/category/anime-sub-ita/', 'movies']), + ('Conclusi', ['/category/serie-anime-concluse/', 'movies']), + ('in Corso', ['/category/serie-anime-in-corso/', 'movies']), ('Genere', ['', 'genres']) ] @@ -36,7 +36,7 @@ def search(item, text): item.url = host + "/?s=" + text try: - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: @@ -51,12 +51,12 @@ def genres(item): blacklist = ['Contattaci','Privacy Policy', 'DMCA'] patronMenu = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)<' patronBlock = r'Generi</a>\s*<ul[^>]+>(?P<block>.*?)<\/ul>' - action = 'peliculas' + action = 'movies' return locals() @support.scrape -def peliculas(item): +def movies(item): numerationEnabled = True blacklist = ['top 10 anime da vedere'] if item.url != host: patronBlock = r'<div id="main-content(?P<block>.*?)<aside' @@ -76,12 +76,12 @@ def peliculas(item): return itlist patronNext = r'<a class="next page-numbers" href="([^"]+)">' - action = 'episodios' + action = 'episodes' return locals() @support.scrape -def episodios(item): +def episodes(item): data = support.match(item, headers=headers, patronBlock=r'entry-content clearfix">(.*?)class="mh-widget mh-posts-2 widget_text').block if not 'pagination clearfix' in data: logger.debug('NOT IN DATA') diff --git a/channels/animesaturn.py b/channels/animesaturn.py index bf15ec12..61ee3437 100644 --- a/channels/animesaturn.py +++ b/channels/animesaturn.py @@ -34,8 +34,8 @@ def mainlist(item): ('ITA',['', 'submenu', '/filter?language%5B0%5D=1']), ('SUB-ITA',['', 'submenu', '/filter?language%5B0%5D=0']), ('Più Votati',['/toplist','menu', 'top']), - ('In Corso',['/animeincorso','peliculas','incorso']), - ('Ultimi Episodi',['/fetch_pages.php?request=episodes&d=1','peliculas','updated'])] + ('In Corso',['/animeincorso','movies','incorso']), + ('Ultimi Episodi',['/fetch_pages.php?request=episodes&d=1','movies','updated'])] return locals() @@ -45,7 +45,7 @@ def search(item, text): item.url = host + '/animelist?search=' + text item.contentType = 'tvshow' try: - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -54,15 +54,15 @@ def search(item, text): return [] -def newest(categoria): - logger.debug(categoria) +def newest(category): + logger.debug(category) itemlist = [] item = support.Item() try: - if categoria == "anime": + if category == "anime": item.url = host + '/fetch_pages.php?request=episodes&d=1' item.args = "updated" - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -79,7 +79,7 @@ def submenu(item): action = 'filter' patronMenu = r'<h5 class="[^"]+">(?P<title>[^<]+)[^>]+>[^>]+>\s*<select id="(?P<parameter>[^"]+)"[^>]+>(?P<data>.*?)</select>' def itemlistHook(itemlist): - itemlist.insert(0, item.clone(title=support.typo('Tutti','bold'), url=item.url + item.args, action='peliculas')) + itemlist.insert(0, item.clone(title=support.typo('Tutti','bold'), url=item.url + item.args, action='movies')) return itemlist[:-1] return locals() @@ -88,7 +88,7 @@ def filter(item): itemlist = [] matches = support.match(item.data if item.data else item.url, patron=r'<option value="(?P<value>[^"]+)"[^>]*>(?P<title>[^<]+)').matches for value, title in matches: - itemlist.append(item.clone(title= support.typo(title,'bold'), url='{}{}&{}%5B0%5D={}'.format(host, item.args, item.parameter, value), action='peliculas', args='filter')) + itemlist.append(item.clone(title= support.typo(title,'bold'), url='{}{}&{}%5B0%5D={}'.format(host, item.args, item.parameter, value), action='movies', args='filter')) support.thumb(itemlist, mode='genre') return itemlist @@ -96,7 +96,7 @@ def filter(item): @support.scrape def menu(item): patronMenu = r'<div class="col-md-13 bg-dark-as-box-shadow p-2 text-white text-center">(?P<title>[^"<]+)<(?P<other>.*?)(?:"lista-top"|"clearfix")' - action = 'peliculas' + action = 'movies' item.args = 'top' def itemHook(item2): item2.url = item.url @@ -106,7 +106,7 @@ def menu(item): @support.scrape -def peliculas(item): +def movies(item): numerationEnabled = True deflang= 'Sub-ITA' @@ -155,17 +155,17 @@ def peliculas(item): def check(item): movie = support.match(item, patron=r'Episodi:</b> (\d*) Movie') if movie.match: - episodes = episodios(item) + episodes = episodes(item) if len(episodes) > 0: it = episodes[0].clone(contentType = 'movie', contentTitle=item.fulltitle, contentSerieName='') return findvideos(it) else: item.contentType = 'tvshow' - return episodios(item) + return episodes(item) @support.scrape -def episodios(item): +def episodes(item): if item.contentType != 'movie': numerationEnabled = True patron = r'episodi-link-button">\s*<a href="(?P<url>[^"]+)"[^>]+>\s*(?P<title>[^<]+)</a>' return locals() diff --git a/channels/animeunity.py b/channels/animeunity.py index ab97fd3f..956437ad 100644 --- a/channels/animeunity.py +++ b/channels/animeunity.py @@ -32,7 +32,7 @@ def mainlist(item): def menu(item): - item.action = 'peliculas' + item.action = 'movies' ITA = copy.copy(item.args) ITA['title'] = '(ita)' InCorso = copy.copy(item.args) @@ -58,7 +58,7 @@ def genres(item): for genre in genres: item.args['genres'] = [genre] - itemlist.append(item.clone(title=support.typo(genre['name'],'bold'), action='peliculas')) + itemlist.append(item.clone(title=support.typo(genre['name'],'bold'), action='movies')) return support.thumb(itemlist) def years(item): @@ -71,7 +71,7 @@ def years(item): for year in list(reversed(range(oldest_year, current_year + 1))): item.args['year']=year - itemlist.append(item.clone(title=support.typo(year,'bold'), action='peliculas')) + itemlist.append(item.clone(title=support.typo(year,'bold'), action='movies')) return itemlist @@ -84,7 +84,7 @@ def search(item, text): item.search = text try: - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -93,8 +93,8 @@ def search(item, text): return [] -def newest(categoria): - logger.debug(categoria) +def newest(category): + logger.debug(category) itemlist = [] item = support.Item() item.url = host @@ -138,7 +138,7 @@ def news(item): return itemlist -def peliculas(item): +def movies(item): logger.debug() itemlist = [] @@ -179,7 +179,7 @@ def peliculas(item): itm.contentType = 'tvshow' itm.contentTitle = '' itm.fulltitle = itm.show = itm.contentSerieName = title - itm.action = 'episodios' + itm.action = 'episodes' itm.episodes = it['episodes'] if 'episodes' in it else it['scws_id'] itm.video_url = item.url @@ -191,7 +191,7 @@ def peliculas(item): return itemlist -def episodios(item): +def episodes(item): logger.debug() itemlist = [] title = 'Parte ' if item.type.lower() == 'movie' else 'Episodio ' diff --git a/channels/animeuniverse.py b/channels/animeuniverse.py index c147f991..9b4264f0 100644 --- a/channels/animeuniverse.py +++ b/channels/animeuniverse.py @@ -20,14 +20,14 @@ def mainlist(item): ('Tipo',['', 'menu', 'Anime']), ('Anno',['', 'menu', 'Anno']), ('Genere', ['', 'menu','Genere']), - ('Ultimi Episodi',['/2/', 'peliculas', 'last']), - ('Hentai', ['/hentai/', 'peliculas'])] + ('Ultimi Episodi',['/2/', 'movies', 'last']), + ('Hentai', ['/hentai/', 'movies'])] return locals() @support.scrape def menu(item): - action = 'peliculas' + action = 'movies' patronBlock = item.args + r'</a>\s*<ul class="sub-menu">(?P<block>.*?)</ul>' patronMenu = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)<' if 'genere' in item.args.lower(): @@ -39,7 +39,7 @@ def search(item, text): logger.debug(text) item.search = text try: - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -48,14 +48,14 @@ def search(item, text): return [] -def newest(categoria): - logger.debug(categoria) +def newest(category): + logger.debug(category) item = support.Item() try: - if categoria == "anime": + if category == "anime": item.url = host item.args = "last" - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -65,7 +65,7 @@ def newest(categoria): @support.scrape -def peliculas(item): +def movies(item): query = '' if '/mos/' in item.url: item.contentType = 'movie' @@ -77,7 +77,7 @@ def peliculas(item): action='findvideos' else: item.contentType = 'tvshow' - action='episodios' + action='episodes' if item.search: query = 's' searchtext = item.search @@ -94,7 +94,7 @@ def peliculas(item): def itemlistHook(itemlist): if len(itemlist) == int(perpage): item.pag += 1 - itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), action='peliculas')) + itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), action='movies')) return itemlist return locals() @@ -102,7 +102,7 @@ def peliculas(item): @support.scrape -def episodios(item): +def episodes(item): numerationEnabled = True pagination = True patron = epPatron diff --git a/channels/animeworld.py b/channels/animeworld.py index 46761efd..49c80886 100644 --- a/channels/animeworld.py +++ b/channels/animeworld.py @@ -41,16 +41,16 @@ def mainlist(item): anime=['/filter?sort=', ('ITA',['/filter?dub=1&sort=', 'menu', '1']), ('SUB-ITA',['/filter?dub=0&sort=', 'menu', '0']), - ('In Corso', ['/ongoing', 'peliculas','noorder']), - ('Ultimi Episodi', ['/updated', 'peliculas', 'updated']), - ('Nuove Aggiunte',['/newest', 'peliculas','noorder' ]), + ('In Corso', ['/ongoing', 'movies','noorder']), + ('Ultimi Episodi', ['/updated', 'movies', 'updated']), + ('Nuove Aggiunte',['/newest', 'movies','noorder' ]), ('Generi',['/?d=1','genres',])] return locals() @support.scrape def genres(item): - action = 'peliculas' + action = 'movies' data = get_data(item) patronBlock = r'dropdown[^>]*>\s*Generi\s*<span.[^>]+>(?P<block>.*?)</ul>' patronGenreMenu = r'<input.*?name="(?P<name>[^"]+)" value="(?P<value>[^"]+)"\s*>[^>]+>(?P<title>[^<]+)</label>' @@ -70,7 +70,7 @@ def menu(item): def itemlistHook(itemlist): for item in itemlist: item.title += ' {anime}' - itemlist.insert(0, item.clone(title=support.typo('Tutti {anime}','bold'), action='peliculas')) + itemlist.insert(0, item.clone(title=support.typo('Tutti {anime}','bold'), action='movies')) itemlist.append(item.clone(title=support.typo('Cerca... {anime}','bold'), action='search', search=True, thumbnail=support.thumb('search.png'))) return itemlist return locals() @@ -78,7 +78,7 @@ def menu(item): @support.scrape def submenu(item): - action = 'peliculas' + action = 'movies' data = item.other patronMenu = r'<input.*?name="(?P<name>[^"]+)" value="(?P<value>[^"]+)"\s*>[^>]+>(?P<title>[^<]+)<\/label>' def itemHook(item): @@ -87,14 +87,14 @@ def submenu(item): return locals() -def newest(categoria): - logger.debug(categoria) +def newest(category): + logger.debug(category) item = support.Item() try: - if categoria == "anime": + if category == "anime": item.url = host + '/updated' item.args = "updated" - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -112,7 +112,7 @@ def search(item, texto): item.url = host + '/search?keyword=' + texto item.contentType = 'tvshow' try: - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -122,7 +122,7 @@ def search(item, texto): @support.scrape -def peliculas(item): +def movies(item): numerationEnabled = True # debug = True if item.args not in ['noorder', 'updated'] and not item.url[-1].isdigit(): item.url += order() # usa l'ordinamento di configura canale @@ -134,7 +134,7 @@ def peliculas(item): action='findvideos' else: patron= r'<div class="inner">\s*<a href="(?P<url>[^"]+)" class[^>]+>\s*<img.*?src="(?P<thumb>[^"]+)" alt?="(?P<title>[^\("]+)(?:\((?P<year>\d+)\) )?(?:\((?P<lang>[^\)]+)\))?(?P<title2>[^"]+)?[^>]+>[^>]+>(?:\s*<div class="(?P<l>[^"]+)">[^>]+>)?\s*(?:<div class="[^"]+">(?P<type>[^<]+)</div>)?' - action='episodios' + action='episodes' # Controlla la lingua se assente patronNext=r'<a href="([^"]+)" class="[^"]+" id="go-next' @@ -153,7 +153,7 @@ def peliculas(item): @support.scrape -def episodios(item): +def episodes(item): data = get_data(item) numerationEnabled = True # pagination = True diff --git a/channels/aniplay.py b/channels/aniplay.py index 5f53c3f6..68a341d4 100644 --- a/channels/aniplay.py +++ b/channels/aniplay.py @@ -29,7 +29,7 @@ def submenu_az(item): for letter in ['0-9'] + list('ABCDEFGHIJKLMNOPQRSTUVWXYZ'): itemlist.append(item.clone(title = support.typo(letter, 'bold'), url= host + '/api/anime/find-by-char', - action= 'peliculas', + action= 'movies', variable= '&character=' + letter, thumbnail=support.thumb('az'))) return itemlist @@ -67,7 +67,7 @@ def submenu_season(item): itemlist.append(item.clone(title=title, url = '{}/api/seasonal-view/{}-{}'.format(host, s, item.variable), thumbnail = support.thumb(s), - action = 'peliculas', + action = 'movies', variable='')) return itemlist @@ -86,7 +86,7 @@ def submenu_top_of(item): id=anime['animeId'], url = '{}/api/anime/{}'.format(host, anime['animeId']), thumbnail = get_thumbnail(anime, 'animeHorizontalImages'), - action = 'episodios', + action = 'episodes', variable=anime['animeId'])) return itemlist @@ -98,7 +98,7 @@ def search(item, texto): item.variable = '&query=' + texto try: - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -107,11 +107,11 @@ def search(item, texto): return [] -def newest(categoria): - logger.debug(categoria) +def newest(category): + logger.debug(category) item = support.Item() try: - if categoria == "anime": + if category == "anime": return latest_added(item) # Continua la ricerca in caso di errore except: @@ -155,7 +155,7 @@ def latest_added(item): return itemlist -def peliculas(item): +def movies(item): logger.debug() itemlist = [] @@ -174,7 +174,7 @@ def peliculas(item): contentType = 'movie' if it['type'] == 'Movie' else 'tvshow', contentTitle = title, contentSerieName = title if it['type'] == 'Serie' else '', - action ='findvideos' if it['type'] == 'Movie' else 'episodios',# '' if not active else 'findvideos' if it['type'] == 'Movie' else 'episodios', + action ='findvideos' if it['type'] == 'Movie' else 'episodes',# '' if not active else 'findvideos' if it['type'] == 'Movie' else 'episodes', plot = it['storyline'], year = it['startDate'].split('-')[0], url = '{}/api/anime/{}'.format(host, it['id']), @@ -189,7 +189,7 @@ def peliculas(item): return itemlist -def episodios(item): +def episodes(item): logger.debug() itemlist = [] diff --git a/channels/casacinema.py b/channels/casacinema.py index d33ba176..bc2caa3d 100644 --- a/channels/casacinema.py +++ b/channels/casacinema.py @@ -15,11 +15,11 @@ headers = [['Referer', host]] def mainlist(item): film = ['/category/film', ('Generi', ['', 'genres', 'genres']), - ('Sub-ITA', ['/category/sub-ita/', 'peliculas', 'sub']) + ('Sub-ITA', ['/category/sub-ita/', 'movies', 'sub']) ] tvshow = ['/category/serie-tv', - ('Novità', ['/aggiornamenti-serie-tv', 'peliculas', '']), + ('Novità', ['/aggiornamenti-serie-tv', 'movies', '']), ] search = '' @@ -29,7 +29,7 @@ def mainlist(item): @support.scrape def genres(item): - action = 'peliculas' + action = 'movies' blacklist = ['PRIME VISIONI', 'ULTIME SERIE TV', 'ULTIMI FILM'] patronGenreMenu = r'<li><a href="(?P<url>[^"]+)">(?P<title>[^<>]+)</a></li>' patronBlock = r'<div class="container home-cats">(?P<block>.*?)<div class="clear">' @@ -45,7 +45,7 @@ def select(item): else: logger.debug('select = ### è una serie ###') item.contentType = 'tvshow' - return episodios(item) + return episodes(item) def search(item, text): @@ -54,7 +54,7 @@ def search(item, text): item.url = host + '/?s=' + text item.args = 'search' try: - return peliculas(item) + return movies(item) except: import sys @@ -63,13 +63,13 @@ def search(item, text): return [] -def newest(categoria): +def newest(category): itemlist = [] item = support.Item() item.args = 'newest' try: - if categoria == 'series': + if category == 'tvshow': item.contentType = 'tvshow' item.url = host+'/aggiornamenti-serie-tv' @@ -77,10 +77,10 @@ def newest(categoria): item.contentType = 'movie' item.url = host+'/category/film' - item.action = 'peliculas' - itemlist = peliculas(item) + item.action = 'movies' + itemlist = movies(item) - if itemlist[-1].action == 'peliculas': + if itemlist[-1].action == 'movies': itemlist.pop() # Continua la ricerca in caso di errore @@ -94,12 +94,12 @@ def newest(categoria): @support.scrape -def peliculas(item): +def movies(item): # debug = True if item.contentType == 'movie': action = 'findvideos' elif item.contentType == 'tvshow': - action = 'episodios' + action = 'episodes' pagination = True else: action = 'select' @@ -129,7 +129,7 @@ def peliculas(item): @support.scrape -def episodios(item): +def episodes(item): if item.data: data = item.data action = 'findvideos' diff --git a/channels/cb01anime.py b/channels/cb01anime.py index 9144e423..04dbfc20 100644 --- a/channels/cb01anime.py +++ b/channels/cb01anime.py @@ -19,7 +19,7 @@ def mainlist(item): anime = [('Genere',['','menu', '2']), ('Per Lettera',['','menu', '1']), ('Per Anno',['','menu', '3']), - ('Ultimi Anime Aggiornati',['','peliculas', 'newest'])] + ('Ultimi Anime Aggiornati',['','movies', 'newest'])] return locals() @@ -30,7 +30,7 @@ def menu(item): patronMenu = r'<option value="(?P<url>[^"]+)">(?P<title>[^<]+)</option>' if '2' in item.args: patronGenreMenu = patronMenu - action = 'peliculas' + action = 'movies' def itemHook(item): item.url = item.url.replace('cb01-anime/','cb01-anime-cartoon/') return item @@ -41,7 +41,7 @@ def search(item, texto): logger.debug(texto) item.url = host + "/search/" + texto try: - return peliculas(item) + return movies(item) except: import sys for line in sys.exc_info(): @@ -49,15 +49,15 @@ def search(item, texto): return [] -def newest(categoria): - logger.debug(categoria) +def newest(category): + logger.debug(category) itemlist = [] item = support.Item() try: - if categoria == "anime": + if category == "anime": item.url = host item.args = 'newest' - itemlist = peliculas(item) + itemlist = movies(item) # Continua la ricerca in caso di errore except: import sys @@ -68,7 +68,7 @@ def newest(categoria): return itemlist @support.scrape -def peliculas(item): +def movies(item): # debug=True blacklist = Blacklist item.contentType = 'tvshow' @@ -84,15 +84,15 @@ def check(item): item.url = support.match(item, patron=r'(?:<p>|/>)(.*?)(?:<br|</td>|</p>)', patronBlock=r'Streaming:(.*?)</tr>').matches if 'Episodio' in str(item.url): item.contentType = 'tvshow' - item.action ='episodios' - return episodios(item) + item.action ='episodes' + return episodes(item) else: item.contentType = 'movie' item.action = 'findvideos' return findvideos(item) @support.scrape -def episodios(item): +def episodes(item): logger.debug('EPISODIOS ', item.data) data = '' matches = item.data diff --git a/channels/cineblog01.py b/channels/cineblog01.py index e0196e80..396c4fe4 100644 --- a/channels/cineblog01.py +++ b/channels/cineblog01.py @@ -27,17 +27,17 @@ def mainlist(item): ('Generi', ['', 'menu', 'Film per Genere']), ('Anni', ['', 'menu', 'Film per Anno']), ('Paese', ['', 'menu', 'Film per Paese']), - ('Ultimi Aggiornati', ['/ultimi-100-film-aggiornati/', 'peliculas', 'newest']), - ('Ultimi Aggiunti', ['/lista-film-ultimi-100-film-aggiunti/', 'peliculas', 'newest']) + ('Ultimi Aggiornati', ['/ultimi-100-film-aggiornati/', 'movies', 'newest']), + ('Ultimi Aggiunti', ['/lista-film-ultimi-100-film-aggiunti/', 'movies', 'newest']) ] tvshow = ['/serietv/', ('Per Lettera', ['/serietv/', 'menu', 'Serie-Tv per Lettera']), ('Per Genere', ['/serietv/', 'menu', 'Serie-Tv per Genere']), ('Per anno', ['/serietv/', 'menu', 'Serie-Tv per Anno']), - ('Ultime Aggiornate', ['/serietv/ultime-100-serie-tv-aggiornate/', 'peliculas', 'newest']) + ('Ultime Aggiornate', ['/serietv/ultime-100-serie-tv-aggiornate/', 'movies', 'newest']) ] - docu = [('Documentari {bullet bold}', ['/category/documentario/', 'peliculas']), - ('HD {submenu} {documentari}', ['/category/hd-alta-definizione/documentario-hd/', 'peliculas']) + docu = [('Documentari {bullet bold}', ['/category/documentario/', 'movies']), + ('HD {submenu} {documentari}', ['/category/hd-alta-definizione/documentario-hd/', 'movies']) ] return locals() @@ -49,24 +49,24 @@ def menu(item): patronMenu = r'href="?(?P<url>[^">]+)"?>(?P<title>.*?)<\/a>' if 'genere' in item.args.lower(): patronGenreMenu = patronMenu - action = 'peliculas' + action = 'movies' return locals() -def newest(categoria): - logger.debug(categoria) +def newest(category): + logger.debug(category) item = support.Item() try: - if categoria == "series": + if category == 'tvshow': item.contentType = 'tvshow' item.url = host + '/serietv/' # aggiornamento-quotidiano-serie-tv/' else: item.contentType = 'movie' item.url = host + '/lista-film-ultimi-100-film-aggiunti/' item.args = "newest" - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -82,7 +82,7 @@ def search(item, text): else: item.url = host try: item.url = item.url + "/search/" + text.replace(' ', '+') - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: @@ -93,7 +93,7 @@ def search(item, text): @support.scrape -def peliculas(item): +def movies(item): # debug = True # esclusione degli articoli 'di servizio' # curYear = datetime.date.today().year @@ -111,7 +111,7 @@ def peliculas(item): action = 'findvideos' else: patron = r'src=(?:")?(?P<thumb>[^ "]+)(?:")? alt=(?:")?(?P<title>.*?)(?: – \d+×\d+)?(?:>|"| – )(?:(?P<lang>Sub-ITA|ITA))?[^>]*>.*?<a href=(?:")?(?P<url>[^" ]+)(?:")?.*?rpwe-summary[^>]*>(?P<genre>[^\(]*)\((?P<year>\d{4})[^\)]*\) (?P<plot>[^<]+)<' - action = 'episodios' + action = 'episodes' elif '/serietv/' not in item.url: patron = r'(?<!sticky )hentry.*?<div class="card-image">\s*<a[^>]+>\s*<img src="(?P<thumb>[^" ]+)" alt[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+><a href="?(?P<url>[^" >]+)(?:\/|"|\s+)>(?P<title>[^<[(]+)(?:\[(?P<quality>[a-zA-Z/]+)\]\s*)?(?:\[(?P<lang>Sub-ITA|ITA)\]\s*)?(?:\[(?P<quality2>[a-zA-Z/]+)\]\s*)? (?:\((?P<year>[0-9]{4})\))?[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<genre>[^<>&‖“]+)(?:[^ ]+\s*DURATA\s*(?P<duration>[0-9]+)[^>]+>[^>]+>[^>]+>(?P<plot>[^<>]+))?' @@ -119,7 +119,7 @@ def peliculas(item): else: patron = r'(?<!sticky )hentry.*?card-image[^>]*>\s*<a href=(?:")?(?P<url>[^" >]+)(?:")?\s*>\s*<img src=(?:")?(?P<thumb>[^" ]+)(?:")? alt="(?P<title>.*?)(?: – \d+×\d+)?(?:"| – )(?:(?P<lang>Sub-ITA|ITA))?[^>]*>[^>]+>[^>]+>[^>]*>[^>]+>[^>]+>[^>]*>[^>]+>[^>]+>[^>]*>[^>]+>[^>]+>[^>]*>(?P<genre>[^\(]+)\((?P<year>\d{4})[^>]*>[^>]+>[^>]+>[^>]+>(?:<p>)?(?P<plot>[^<]+)' - action = 'episodios' + action = 'episodes' item.contentType = 'tvshow' patronNext = '<a class="?page-link"? href="?([^>"]+)"?><i class="fa fa-angle-right">' @@ -135,10 +135,10 @@ def peliculas(item): -def episodios(item): +def episodes(item): @support.scrape def listed(item, data): - actLike = 'episodios' + actLike = 'episodes' disableAll = True patronBlock = r'(?P<block>sp-head[^>]+>\s*(?:STAGION[EI]\s*(?:(?:DA)?\s*[0-9]+\s*A)?\s*[0-9]+|MINISSERIE)(?::\s*PARTE\s*[0-9]+)? - (?P<lang>[^-<]+)(?:- (?P<quality>[^-<]+))?.*?<\/div>.*?)spdiv[^>]*>' @@ -150,7 +150,7 @@ def episodios(item): def folder(item, data): # Quando c'è un link ad una cartella contenente più stagioni - actLike = 'episodios' + actLike = 'episodes' disableAll = True sceneTitle = True @@ -188,9 +188,9 @@ def episodios(item): if not support.stackCheck(['add_tvshow', 'get_episodes', 'update', 'find_episodes']): if len(seasons) > 1: - itemlist = support.season_pagination(itemlist, item, [], 'episodios') + itemlist = support.season_pagination(itemlist, item, [], 'episodes') else: - itemlist = support.pagination(itemlist, item, 'episodios') + itemlist = support.pagination(itemlist, item, 'episodes') if config.get_setting('episode_info'): support.tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) support.videolibrary(itemlist, item) diff --git a/channels/cinemalibero.json b/channels/cinemalibero.json index 79aa50c3..6c14722b 100644 --- a/channels/cinemalibero.json +++ b/channels/cinemalibero.json @@ -6,6 +6,6 @@ "thumbnail": "cinemalibero.png", "banner": "cinemalibero.png", "categories": ["movie","tvshow","anime"], - "not_active": ["include_in_newest_anime", "include_in_newest_peliculas"], + "not_active": ["include_in_newest_anime", "include_in_newest_movie"], "settings": [] } diff --git a/channels/cinemalibero.py b/channels/cinemalibero.py index 3cabff10..8abc19d5 100644 --- a/channels/cinemalibero.py +++ b/channels/cinemalibero.py @@ -29,15 +29,15 @@ headers = [['Referer', host]] def mainlist(item): film = ['/category/film/', - ('Novità', ['', 'peliculas', 'update']), + ('Novità', ['', 'movies', 'update']), ('Generi', ['', 'genres'])] tvshow = ['/category/serie-tv/'] anime = ['/category/anime-giapponesi/'] -## Sport = [(support.typo('Sport', 'bullet bold'), ['/category/sport/', 'peliculas', 'sport', 'tvshow'])] - news = [('Ultimi episodi Serie/Anime', ['/aggiornamenti-serie-tv/', 'peliculas', 'update', 'tvshow'])] +## Sport = [(support.typo('Sport', 'bullet bold'), ['/category/sport/', 'movies', 'sport', 'tvshow'])] + news = [('Ultimi episodi Serie/Anime', ['/aggiornamenti-serie-tv/', 'movies', 'update', 'tvshow'])] search = '' @@ -45,7 +45,7 @@ def mainlist(item): @support.scrape -def peliculas(item): +def movies(item): # debug = True action = 'check' patronBlock = r'<div class="container">.*?class="col-md-12[^"]*?">(?P<block>.*?)<div class=(?:"container"|"bg-dark ")>' @@ -86,7 +86,7 @@ def peliculas(item): return locals() @support.scrape -def episodios(item): +def episodes(item): data=item.data # debug=True if item.args == 'anime': @@ -114,7 +114,7 @@ def episodios(item): @support.scrape def genres(item): - action='peliculas' + action='movies' patron_block=r'<div id="bordobar" class="dropdown-menu(?P<block>.*?)</li>' patronGenreMenu=r'<a class="dropdown-item" href="(?P<url>[^"]+)" title="(?P<title>[A-z]+)"' @@ -129,7 +129,7 @@ def search(item, texto): # item.contentType = 'tv' item.args = 'search' try: - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -137,18 +137,18 @@ def search(item, texto): logger.error("%s" % line) return [] -def newest(categoria): - logger.debug('newest ->', categoria) +def newest(category): + logger.debug('newest ->', category) itemlist = [] item = Item() item.args = 'newest' try: - if categoria == 'series' or categoria == 'anime': + if category == 'tvshow' or category == 'anime': item.args = 'update' item.url = host+'/aggiornamenti-serie-tv/' item.contentType = 'tvshow' - item.action = 'peliculas' - itemlist = peliculas(item) + item.action = 'movies' + itemlist = movies(item) except: import sys for line in sys.exc_info(): @@ -168,13 +168,13 @@ def check(item): item.contentType = 'tvshow' item.args = 'serie' item.data = data - return episodios(item) + return episodes(item) elif ck == 'anime': item.contentType = 'tvshow' item.args = 'anime' item.data = data - return episodios(item) + return episodes(item) elif ck == 'film': item.contentType = 'movie' @@ -184,7 +184,7 @@ def check(item): else: item.contentType = 'tvshow' item.data = data - itemlist = episodios(item) + itemlist = episodes(item) if not itemlist: item.contentType = 'movie' item.data = data diff --git a/channels/cinetecadibologna.json b/channels/cinetecadibologna.json index 10adf700..b9ced864 100644 --- a/channels/cinetecadibologna.json +++ b/channels/cinetecadibologna.json @@ -6,6 +6,6 @@ "thumbnail": "cinetecadibologna.png", "banner": "cinetecadibologna.png", "categories": ["documentary"], - "not_active":["include_in_newest_peliculas", "include_in_newest_series", "include_in_newest_anime"], + "not_active":["include_in_newest_movie", "include_in_newest_tvshow", "include_in_newest_anime"], "settings": [] } diff --git a/channels/cinetecadibologna.py b/channels/cinetecadibologna.py index 0e1b8b5b..c441f273 100644 --- a/channels/cinetecadibologna.py +++ b/channels/cinetecadibologna.py @@ -22,7 +22,7 @@ def mainlist(item): @support.scrape def menu(item): - action = 'peliculas' + action = 'movies' if 'epoche' in item.url: patronMenu =r'<li>\s*<a href="(?P<url>[^"]+)">(?P<title>[^>]+)<' elif 'percorsi' in item.url: @@ -39,7 +39,7 @@ def search(item, text): item.url = host + '/ricerca/type_ALL/ricerca_' + text item.contentType = 'movie' try: - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -50,7 +50,7 @@ def search(item, text): @support.scrape -def peliculas(item): +def movies(item): if 'alfabetico' in item.url: patron = r'<img src="(?P<thumb>[^"]+)"[^>]+>\s*[^>]+>\s*<div[^>]+>\s*<div[^>]+>[^>]+>\s*<a href="(?P<url>[^"]+)"[^>]+>(?:\[)?(?P<title>[^\]<]+)(?:\]|<)' else: diff --git a/channels/discoveryplus.py b/channels/discoveryplus.py index 4a42b049..c4c76ccc 100644 --- a/channels/discoveryplus.py +++ b/channels/discoveryplus.py @@ -24,7 +24,7 @@ def Dict(item): @support.menu def mainlist(item): top = [('Dirette {bold}', ['', 'live']), - ('Programmi {bullet bold tv}', ['', 'peliculas', 'programmi']), + ('Programmi {bullet bold tv}', ['', 'movies', 'programmi']), ('Generi {bullet bold tv}', ['', 'genres'])] search = '' @@ -51,7 +51,7 @@ def search(item, text): item.args = 'search' item.text = text try: - itemlist = peliculas(item) + itemlist = movies(item) except: import sys for line in sys.exc_info(): @@ -69,7 +69,7 @@ def live(item): def genres(item): - item.action = 'peliculas' + item.action = 'movies' itemlist = [ item.clone(title='Attualità e inchiesta', args='genere/attualita-e-inchiesta'), item.clone(title='Beauty and style', args='genere/beauty-and-style'), @@ -95,7 +95,7 @@ def genres(item): return itemlist -def peliculas(item): +def movies(item): logger.debug() itemlist =[] if 'search' in item.args: @@ -122,7 +122,7 @@ def peliculas(item): programid=key['attributes']['alternateId'], id=key['id'], seasons=seasons, - action='episodios', + action='episodes', thumbnail=thumb, fanart=fanart, contentType='tvshow')) @@ -130,7 +130,7 @@ def peliculas(item): return itemlist -def episodios(item): +def episodes(item): logger.debug() itemlist =[] pdict = session.get(api + '/cms/routes/programmi/{}?decorators=viewingHistory&include=default'.format(item.programid), headers=headers).json()['included'] diff --git a/channels/dreamsub.py b/channels/dreamsub.py index 50eb7aba..b116ffa2 100644 --- a/channels/dreamsub.py +++ b/channels/dreamsub.py @@ -12,13 +12,13 @@ headers = [['Referer', host]] @support.menu def mainlist(item): anime = ['/search?typeY=tv', - ('Movie', ['/search?typeY=movie', 'peliculas', '', 'movie']), - ('OAV', ['/search?typeY=oav', 'peliculas', '', 'tvshow']), - ('Spinoff', ['/search?typeY=spinoff', 'peliculas', '', 'tvshow']), + ('Movie', ['/search?typeY=movie', 'movies', '', 'movie']), + ('OAV', ['/search?typeY=oav', 'movies', '', 'tvshow']), + ('Spinoff', ['/search?typeY=spinoff', 'movies', '', 'tvshow']), ('Generi', ['','menu','Generi']), ('Stato', ['','menu','Stato']), - ('Ultimi Episodi', ['', 'peliculas', ['last', 'episodiRecenti']]), - ('Ultimi Aggiornamenti', ['', 'peliculas', ['last', 'episodiNuovi']]) + ('Ultimi Episodi', ['', 'movies', ['last', 'episodiRecenti']]), + ('Ultimi Aggiornamenti', ['', 'movies', ['last', 'episodiNuovi']]) ] return locals() @@ -27,7 +27,7 @@ def mainlist(item): @support.scrape def menu(item): item.contentType = '' - action = 'peliculas' + action = 'movies' patronBlock = r'<div class="filter-header"><b>%s</b>(?P<block>.*?)<div class="filter-box">' % item.args patronMenu = r'<a class="[^"]+" data-state="[^"]+" (?P<other>[^>]+)>[^>]+></i>[^>]+></i>[^>]+></i>(?P<title>[^>]+)</a>' @@ -49,7 +49,7 @@ def search(item, text): item.url = host + '/search/' + text item.args = 'search' try: - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -58,14 +58,14 @@ def search(item, text): return [] -def newest(categoria): - logger.debug(categoria) +def newest(category): + logger.debug(category) item = support.Item() try: - if categoria == "anime": + if category == "anime": item.url = host item.args = ['last', 'episodiNuovi'] - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -76,7 +76,7 @@ def newest(categoria): @support.scrape -def peliculas(item): +def movies(item): # debug = True numerationEnabled = True if 'movie' in item.url: @@ -84,7 +84,7 @@ def peliculas(item): action = 'findvideos' else: item.contentType = 'tvshow' - action = 'episodios' + action = 'episodes' if len(item.args) > 1 and item.args[0] == 'last': patronBlock = r'<div id="%s"[^>]+>(?P<block>.*?)<div class="vistaDettagliata"' % item.args[1] @@ -102,7 +102,7 @@ def peliculas(item): @support.scrape -def episodios(item): +def episodes(item): numerationEnabled = True pagination = True @@ -123,7 +123,7 @@ def findvideos(item): if not matches.matches and item.contentType != 'episode': item.data = matches.data item.contentType = 'tvshow' - return episodios(item) + return episodes(item) if 'vvvvid' in matches.data: itemlist.append(item.clone(action="play", title='VVVVID', url=support.match(matches.data, patron=r'(http://www.vvvvid[^"]+)').match, server='vvvvid')) diff --git a/channels/dsda.py b/channels/dsda.py index e0d511ab..04330b44 100644 --- a/channels/dsda.py +++ b/channels/dsda.py @@ -11,7 +11,7 @@ host = config.get_channel_url() @support.menu def mainlist(item): - docu = [('Documentari {bullet bold}',('/elenco-documentari','peliculas')), + docu = [('Documentari {bullet bold}',('/elenco-documentari','movies')), ('Categorie {submenu documentary}',('','menu')), ('Cerca... {bullet bold documentary}',('','search')),] return locals() @@ -19,7 +19,7 @@ def mainlist(item): @support.scrape def menu(item): - action = 'peliculas' + action = 'movies' patronMenu = r'<li class="menu-item menu-item-type-taxonomy[^>]+>\s*<a href="(?P<url>[^"]+)"[^>]+>(?P<title>[^<]+)<' def fullItemlistHook(itemlist): item_list = [] @@ -32,14 +32,14 @@ def menu(item): return itemlist return locals() -def newest(categoria): +def newest(category): logger.debug() item = Item() try: - if categoria == "documentales": + if category == "documentales": item.url = host + "/elenco-documentari" - item.action = "peliculas" - return peliculas(item) + item.action = "movies" + return movies(item) # Continua la ricerca in caso di errore except: @@ -53,7 +53,7 @@ def search(item, texto): logger.debug(texto) item.url = host + "/?s=" + texto try: - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -63,7 +63,7 @@ def search(item, texto): @support.scrape -def peliculas(item): +def movies(item): blacklist = ['GUIDA PRINCIPIANTI Vedere film e documentari streaming gratis', 'Guida Dsda'] data = support.match(item).data # debug =True @@ -83,14 +83,14 @@ def peliculas(item): title = support.re.sub(r'(?:[Ss]erie\s*|[Ss]treaming(?:\s*[Dd][Aa])?\s*|[Cc]ollezione\s*|[Rr]accolta\s*|[Dd]ocumentari(?:o)?\s*)?','',item.fulltitle).strip() if 'serie' in item.fulltitle.lower(): item.contentType = 'tvshow' - item.action = 'episodios' + item.action = 'episodes' item.contentSerieName = title item.contentTitle = '' elif 'collezion' in item.fulltitle.lower() or \ 'raccolt' in item.fulltitle.lower() or \ 'filmografia' in item.fulltitle.lower(): item.args = 'collection' - item.action = 'peliculas' + item.action = 'movies' item.contentTitle = title item.contentSerieName = '' else: @@ -113,7 +113,7 @@ def peliculas(item): return locals() @support.scrape -def episodios(item): +def episodes(item): html = support.match(item, patron=r'class="title-episodio">(\d+x\d+)') data = html.data if html.match: diff --git a/channels/eurostreaming.py b/channels/eurostreaming.py index 35c92a5e..7da47906 100644 --- a/channels/eurostreaming.py +++ b/channels/eurostreaming.py @@ -20,17 +20,17 @@ headers = [['Referer', host]] def mainlist(item): tvshow = [] anime = ['/category/anime-cartoni-animati/'] - mix = [('Aggiornamenti {bullet bold} {TV}', ['/aggiornamento-episodi/', 'peliculas', 'newest']), - ('Archivio {bullet bold} {TV}', ['/category/serie-tv-archive/', 'peliculas'])] + mix = [('Aggiornamenti {bullet bold} {TV}', ['/aggiornamento-episodi/', 'movies', 'newest']), + ('Archivio {bullet bold} {TV}', ['/category/serie-tv-archive/', 'movies'])] search = '' return locals() @support.scrape -def peliculas(item): +def movies(item): # debug = True - action = 'episodios' + action = 'episodes' if item.args == 'newest': item.contentType = 'episode' @@ -43,7 +43,7 @@ def peliculas(item): return locals() @support.scrape -def episodios(item): +def episodes(item): # debug = True data = support.match(item, headers=headers).data if 'clicca qui per aprire' in data.lower(): data = support.match(support.match(data, patron=r'"go_to":"([^"]+)"').match.replace('\\',''), headers=headers).data @@ -65,7 +65,7 @@ def search(item, text): item.contentType = 'tvshow' try: - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: @@ -75,7 +75,7 @@ def search(item, text): return [] -def newest(categoria): +def newest(category): logger.debug() itemlist = [] @@ -84,8 +84,8 @@ def newest(categoria): item.args = 'newest' try: item.url = "%s/aggiornamento-episodi/" % host - item.action = "peliculas" - itemlist = peliculas(item) + item.action = "movies" + itemlist = movies(item) # Continua la ricerca in caso di errore except: import sys diff --git a/channels/fastsubita.json b/channels/fastsubita.json index 3b65618f..20511fec 100644 --- a/channels/fastsubita.json +++ b/channels/fastsubita.json @@ -6,6 +6,6 @@ "thumbnail": "fastsubita.png", "banner": "fastsubita.png", "categories": ["tvshow", "sub"], - "not_active": ["include_in_newest_peliculas", "include_in_newest_anime"], + "not_active": ["include_in_newest_movie", "include_in_newest_anime"], "settings": [] } diff --git a/channels/fastsubita.py b/channels/fastsubita.py index f27c19fa..7ce56c2b 100644 --- a/channels/fastsubita.py +++ b/channels/fastsubita.py @@ -4,7 +4,7 @@ # ------------------------------------------------------------ """ - Su questo canale, nella categoria 'Ricerca Globale' + Su questo canale, nella category 'Ricerca Globale' non saranno presenti le voci 'Aggiungi alla Videoteca' e 'Scarica Film'/'Scarica Serie', dunque, la loro assenza, nel Test, NON dovrà essere segnalata come ERRORE. @@ -28,7 +28,7 @@ headers = [['Referer', host]] def mainlist(item): Tvshow = [ - ('Aggiornamenti', ['', 'peliculas', 'update']), + ('Aggiornamenti', ['', 'movies', 'update']), ('Cerca... {bold}{TV}', ['', 'search']) ] @@ -38,25 +38,25 @@ def mainlist(item): @support.scrape -def peliculas(item): +def movies(item): deflang = 'Sub-ITA' # è una singola pagina con tutti gli episodi if item.grouped and not support.scrapertools.find_single_match(item.url, '-[0-9]+x[0-9]+-'): item.grouped = False - return episodios_args(item) + return episodes_args(item) # ogni puntata è un articolo a se if item.fulltitle: item.url = host + '?s=' + item.fulltitle - actLike = 'episodios' + actLike = 'episodes' action = 'findvideos' blacklist = [''] if item.args == 'genres': patronBlock = r'<h4 id="mctm1-.">'+item.fulltitle+'</h4>(?P<block>.+?)</div>' patron = r'[^>]+>[^>]+>.+?href="(?P<url>[^"]+)[^>]>(?P<title>[^<]+)\s<' - action = 'episodios' + action = 'episodes' elif item.args == 'search': group = True patronBlock = r'</header>(?P<block>.*?)</main>' @@ -64,7 +64,7 @@ def peliculas(item): else: # è una singola pagina con tutti gli episodi if item.args != 'update' and not support.scrapertools.find_single_match(item.url, '-[0-9]+x[0-9]+-'): - return episodios_args(item) + return episodes_args(item) patron = r'<div class="featured-thumb"> +<a href="(?P<url>[^"]+)" title="(?P<title>[^[]+)\[(?P<episode>\d+×\d+)?' patronBlock = r'<main id="main"[^>]+>(?P<block>.*?)<div id="secondary' @@ -78,8 +78,8 @@ def peliculas(item): return locals() -def episodios_args(item): - actLike = 'episodios' +def episodes_args(item): + actLike = 'episodes' deflang = 'Sub-ITA' action = 'findvideos' @@ -92,15 +92,15 @@ def episodios_args(item): @support.scrape -def episodios(item): - return episodios_args(item) +def episodes(item): + return episodes_args(item) @support.scrape def genres(item): logger.debug() - action = 'peliculas' + action = 'movies' patronBlock = r'<div id="mcTagMapNav">(?P<block>.+?)</div>' patron = r'<a href="(?P<url>[^"]+)">(?P<title>.+?)</a>' @@ -120,7 +120,7 @@ def search(item, text): try: item.args = 'search' item.contentType = 'tvshow' - return peliculas(item) + return movies(item) # Se captura la excepcion, para no interrumpir al buscador global si un canal falla except: import sys @@ -129,19 +129,19 @@ def search(item, text): return [] -def newest(categoria): - logger.debug('newest ->', categoria) +def newest(category): + logger.debug('newest ->', category) itemlist = [] item = Item() - if categoria == 'series': + if category == 'tvshow': try: item.contentType = 'tvshow' item.args = 'newest' item.url = host - item.action = 'peliculas' - itemlist = peliculas(item) + item.action = 'movies' + itemlist = movies(item) - if itemlist[-1].action == 'peliculas': + if itemlist[-1].action == 'movies': itemlist.pop() # Continua la ricerca in caso di errore except: @@ -170,14 +170,14 @@ def findvideos(item): resp = httptools.downloadpage(scrapedurl, follow_redirects=False) data += resp.headers.get("location", "") + '\n' elif not support.scrapertools.find_single_match(item.url, '-[0-9]+x[0-9]+-'): - return episodios(item) + return episodes(item) else: patronBlock = '<div class="entry-content">(?P<block>.*)<footer class="entry-footer">' html = support.match(item, patron=patron, patronBlock=patronBlock, headers=headers) matches = html.matches data= html.data - if item.args != 'episodios': + if item.args != 'episodes': item.infoLabels['mediatype'] = 'episode' for scrapedurl in matches: if 'is.gd' in scrapedurl: @@ -200,7 +200,7 @@ def findvideos(item): # contentType='tvshow', # contentSerieName=series, # url=host+"/serietv/"+series, - # action='episodios', + # action='episodes', # contentTitle=titles, # plot = "Vai alla Serie " + titles + " con tutte le puntate", # )) diff --git a/channels/film4k.json b/channels/film4k.json index 2875fcfa..447fe15e 100644 --- a/channels/film4k.json +++ b/channels/film4k.json @@ -6,6 +6,6 @@ "thumbnail": "film4k.png", "banner": "film4k.png", "categories": ["tvshow", "movie", "anime"], - "not_active": ["include_in_newest_peliculas", "include_in_newest_anime", "include_in_newest_series"], + "not_active": ["include_in_newest_movie", "include_in_newest_anime", "include_in_newest_tvshow"], "settings": [] } diff --git a/channels/film4k.py b/channels/film4k.py index 3e82f3b3..249b57e6 100644 --- a/channels/film4k.py +++ b/channels/film4k.py @@ -20,11 +20,11 @@ def mainlist(item): ('Qualità', ['', 'menu', 'quality']), ('Generi', ['movies', 'menu', 'genres']), ('Anno', ['movies', 'menu', 'releases']), - ('Più popolari', ['trending/?get=movies', 'peliculas']), - ('Più votati', ['ratings/?get=movies', 'peliculas'])] + ('Più popolari', ['trending/?get=movies', 'movies']), + ('Più votati', ['ratings/?get=movies', 'movies'])] tvshow = ['/tvshows', - ('Più popolari', ['trending/?get=tv', 'peliculas']), - ('Più votati', ['ratings/?get=tv', 'peliculas'])] + ('Più popolari', ['trending/?get=tv', 'movies']), + ('Più votati', ['ratings/?get=tv', 'movies'])] return locals() @@ -41,14 +41,14 @@ def search(item, text): -def peliculas(item): +def movies(item): if 'anime' in item.url: - return support.dooplay_peliculas(item, True) + return support.dooplay_movies(item, True) else: - return support.dooplay_peliculas(item, False) + return support.dooplay_movies(item, False) -def episodios(item): +def episodes(item): itemlist = support.dooplay_get_episodes(item) return itemlist @@ -72,7 +72,7 @@ def findvideos(item): @support.scrape def menu(item): - action = 'peliculas' + action = 'movies' if item.args in ['genres','releases']: patronBlock = r'<nav class="' + item.args + r'">(?P<block>.*?)</nav' patronMenu= r'<a href="(?P<url>[^"]+)"[^>]*>(?P<title>[^<]+)<' diff --git a/channels/filmigratis.json b/channels/filmigratis.json index 88221ecc..a5089844 100644 --- a/channels/filmigratis.json +++ b/channels/filmigratis.json @@ -8,7 +8,7 @@ "categories": ["movie","tvshow"], "settings": [ { - "id": "include_in_newest_peliculas", + "id": "include_in_newest_movie", "type": "bool", "label": "@70727", "default": false, @@ -16,7 +16,7 @@ "visible": false }, { - "id": "include_in_newest_series", + "id": "include_in_newest_tvshow", "type": "bool", "label": "@70727", "default": false, diff --git a/channels/filmigratis.py b/channels/filmigratis.py index c2488775..da111183 100644 --- a/channels/filmigratis.py +++ b/channels/filmigratis.py @@ -28,7 +28,7 @@ headers = [['Referer', host]] @support.menu def mainlist(item): film = [ - ('Al Cinema ', ['', 'peliculas', 'cinema']), + ('Al Cinema ', ['', 'movies', 'cinema']), ('Categorie', ['', 'genres', 'genres']), ] @@ -40,7 +40,7 @@ def mainlist(item): return locals() @support.scrape -def peliculas(item): +def movies(item): if item.args == 'search': action = '' @@ -65,7 +65,7 @@ def peliculas(item): patronNext = '<a class="page-link" href="([^"]+)">>>' else: - action = 'episodios' + action = 'episodes' patron = r'<div class="cnt">\s.*?src="([^"]+)".+?title="((?P<title>.+?)(?:[ ]\[(?P<lang>Sub-ITA|SUB-ITA)\])?(?:[ ]\[(?P<quality>.*?)\])?(?:[ ]\((?P<year>\d+)\))?)"\s*[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s+<a href="(?P<url>[^"]+)"' ## if item.args == 'search': ## patron = r'<div class="cnt">.*?src="([^"]+)".+?[^>]+>[^>]+>[^>]+>\s+((?P<title>.+?)(?:[ ]\[(?P<lang>Sub-ITA|SUB-ITA)\])?(?:[ ]\[(?P<quality>.*?)\])?(?:[ ]\((?P<year>\d+)\))?)\s+<[^>]+>[^>]+>[^>]+>[ ]<a href="(?P<url>[^"]+)"' @@ -74,7 +74,7 @@ def peliculas(item): def itemHook(item): if item.args == 'search': if 'series' in item.url: - item.action = 'episodios' + item.action = 'episodes' item.contentType = 'tvshow' else: item.action = 'findvideos' @@ -86,7 +86,7 @@ def peliculas(item): @support.scrape -def episodios(item): +def episodes(item): action = 'findvideos' patronBlock = r'<div class="row">(?P<block>.*?)<section class="main-content">' patron = r'href="(?P<url>.*?)">(?:.+?)?\s+S(?P<season>\d+)\s\-\sEP\s(?P<episode>\d+)[^<]+<' @@ -96,12 +96,12 @@ def episodios(item): @support.scrape def genres(item): if item.contentType == 'movie': - action = 'peliculas' + action = 'movies' patron = r'<a href="(?P<url>.*?)">(?P<title>.*?)<' patronBlock = r'CATEGORIES.*?<ul>(?P<block>.*?)</ul>' else: item.contentType = 'tvshow' - action = 'peliculas' + action = 'movies' blacklist = ['Al-Cinema'] patron = r'<a href="(?P<url>.*?)">(?P<title>.*?)<' patronBlock = r'class="material-button submenu-toggle"> SERIE TV.*?<ul>.*?</li>(?P<block>.*?)</ul>' @@ -116,7 +116,7 @@ def search(item, text): item.url = host + '/search/?s=' + text try: item.args = 'search' - return peliculas(item) + return movies(item) # Se captura la excepcion, para no interrumpir al buscador global si un canal falla except: import sys @@ -124,18 +124,18 @@ def search(item, text): logger.error('search log:', line) return [] -def newest(categoria): - logger.debug('newest ->', categoria) +def newest(category): + logger.debug('newest ->', category) itemlist = [] item = Item() try: - if categoria == 'peliculas': + if category == 'movie': item.url = host item.contentType = 'movie' - item.action = 'peliculas' - itemlist = peliculas(item) + item.action = 'movies' + itemlist = movies(item) - if itemlist[-1].action == 'peliculas': + if itemlist[-1].action == 'movies': itemlist.pop() # Continua la ricerca in caso di errore except: diff --git a/channels/filmpertutti.py b/channels/filmpertutti.py index ff544363..df5b535e 100644 --- a/channels/filmpertutti.py +++ b/channels/filmpertutti.py @@ -22,7 +22,7 @@ def mainlist(item): ] tvshow = ['/category/serie-tv/', - ('Aggiornamenti', ['/aggiornamenti-serie-tv/', 'peliculas', 'newest']), + ('Aggiornamenti', ['/aggiornamenti-serie-tv/', 'movies', 'newest']), ('Per Lettera', ['/category/serie-tv/', 'genres', 'lettersS']) ] @@ -31,7 +31,7 @@ def mainlist(item): @support.scrape -def peliculas(item): +def movies(item): if item.args != 'newest': patronBlock = r'<ul class="posts">(?P<block>.*)<\/ul>' @@ -44,7 +44,7 @@ def peliculas(item): if item.args == 'search': action = 'check' elif item.contentType == 'tvshow': - action = 'episodios' + action = 'episodes' elif item.contentType == 'movie': action ='findvideos' else: @@ -57,7 +57,7 @@ def peliculas(item): return locals() @support.scrape -def episodios(item): +def episodes(item): # debug=True data = support.match(item.url, headers=headers).data if 'accordion-item' in data: @@ -84,7 +84,7 @@ def genres(item): else: item.contentType = 'tvshow' - action = 'peliculas' + action = 'movies' patronBlock = r'<select class="cats">(?P<block>.*?)<\/select>' patronGenreMenu = r'<option data-src="(?P<url>[^"]+)">(?P<title>[^<]+)<\/option>' @@ -98,7 +98,7 @@ def check(item): if block.lower() != 'film': logger.debug('### è una Serie ###') item.contentType='tvshow' - return episodios(item) + return episodes(item) else: logger.debug(' ### è un Film ###') item.contentType='movie' @@ -110,7 +110,7 @@ def search(item, texto): item.url = host + "/?s=" + texto item.args = 'search' try: - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -119,23 +119,23 @@ def search(item, texto): return [] -def newest(categoria): +def newest(category): logger.debug() itemlist = [] item = Item() try: - if categoria == "peliculas": + if category == "movie": item.url = host + "/category/film/" - item.action = "peliculas" + item.action = "movies" item.extra = "movie" item.contentType = 'movie' - itemlist = peliculas(item) + itemlist = movies(item) else: item.url = host + "/aggiornamenti-serie-tv/" - item.action = "peliculas" + item.action = "movies" item.args = "newest" item.contentType = 'tvshow' - itemlist = peliculas(item) + itemlist = movies(item) # Continua la ricerca in caso di errore except: diff --git a/channels/guardaseriecam.py b/channels/guardaseriecam.py index b2c24273..c5c79dea 100644 --- a/channels/guardaseriecam.py +++ b/channels/guardaseriecam.py @@ -28,20 +28,20 @@ def mainlist(item): @support.scrape def list(item): patronMenu = r'<a title="(?P<title>[^"]+)" href="(?P<url>[^"]+)' - action = 'peliculas' + action = 'movies' return locals() @support.scrape -def peliculas(item): +def movies(item): patron = r'<div class="mlnh-thumb"><a href="(?P<url>[^"]+).*?title="(?P<title>[^"]+).*?src="(?P<thumb>[^"]+).*?hdn">(?P<year>[0-9]{4})' patronNext = 'pagenavi.*?<span>.</span>.*?<a href="([^"]+)' - action = 'episodios' + action = 'episodes' return locals() @support.scrape -def episodios(item): +def episodes(item): patronBlock = r'<div class="tab-pane fade" id="season-(?P<season>.)"(?P<block>.*?)</div>' patron = r'<a href="#" allowfullscreen data-link="(?P<url>[^"]+).*?title="(?P<title>[^"]+)(?P<lang>[sS][uU][bB]-?[iI][tT][aA])?\s*">(?P<episode>[^<]+)' action = 'findvideos' @@ -56,7 +56,7 @@ def search(item, text): text = text.replace(' ', '+') item.url = host + '/index.php?story=%s&do=search&subaction=search' % (text) try: - return peliculas(item) + return movies(item) except: import sys for line in sys.exc_info(): diff --git a/channels/guardaserieclick.json b/channels/guardaserieclick.json index a850b5de..ce385be5 100644 --- a/channels/guardaserieclick.json +++ b/channels/guardaserieclick.json @@ -6,10 +6,10 @@ "thumbnail": "guardaserieclick.png", "bannermenu": "guardaserieclick.png", "categories": ["tvshow", "anime"], - "not_active": ["include_in_newest_peliculas", "include_in_newest_anime"], + "not_active": ["include_in_newest_movie", "include_in_newest_anime"], "settings": [ { - "id": "include_in_newest_peliculas", + "id": "include_in_newest_movie", "type": "bool", "label": "@70727", "default": false, diff --git a/channels/guardaserieclick.py b/channels/guardaserieclick.py index 0a4910bf..01ddb424 100644 --- a/channels/guardaserieclick.py +++ b/channels/guardaserieclick.py @@ -25,21 +25,21 @@ headers = [['Referer', host]] @support.menu def mainlist(item): tvshow = ['', - ('Aggiornamenti', ['', 'peliculas', 'update']), + ('Aggiornamenti', ['', 'movies', 'update']), ('Generi', ['', 'genres', 'genres']), - ('News Sub-ITA', ['', 'peliculas', 'ined']), - ('Anime/Cartoni', ["/category/animazione/", 'peliculas', 'genres']) + ('News Sub-ITA', ['', 'movies', 'ined']), + ('Anime/Cartoni', ["/category/animazione/", 'movies', 'genres']) ] return locals() ##@support.scrape -##def peliculas(item): +##def movies(item): #### import web_pdb; web_pdb.set_trace() -## logger.debug('peliculas ->\n', item) +## logger.debug('movies ->\n', item) ## -## action = 'episodios' +## action = 'episodes' ## block = r'(?P<block>.*?)<div\s+class="btn btn-lg btn-default btn-load-other-series">' ## ## if item.args == 'ined': @@ -72,11 +72,11 @@ def mainlist(item): ## return locals() @support.scrape -def peliculas(item): +def movies(item): ## import web_pdb; web_pdb.set_trace() - logger.debug('peliculas ->\n', item) + logger.debug('movies ->\n', item) - action = 'episodios' + action = 'episodes' blacklist = ['DMCA'] if item.args == 'genres' or item.args == 'search': @@ -118,7 +118,7 @@ def peliculas(item): @support.scrape -def episodios(item): +def episodes(item): logger.debug() action = 'findvideos' @@ -137,7 +137,7 @@ def episodios(item): def genres(item): logger.debug() - action = 'peliculas' + action = 'movies' patronMenu = r'<li>\s<a\shref="(?P<url>[^"]+)"[^>]+>(?P<title>[^<]+)</a></li>' patron_block = r'<ul\sclass="dropdown-menu category">(?P<block>.*?)</ul>' # debug = True @@ -150,7 +150,7 @@ def search(item, text): item.contentType = 'tvshow' item.args = 'search' try: - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -159,17 +159,17 @@ def search(item, text): return [] -def newest(categoria): +def newest(category): logger.debug() itemlist = [] item = Item() item.contentType = 'tvshow' item.args = 'update' try: - if categoria == "series": + if category == 'tvshow': item.url = host - item.action = "peliculas" - itemlist = peliculas(item) + item.action = "movies" + itemlist = movies(item) # Continua la ricerca in caso di errore except: diff --git a/channels/guardaserieicu.py b/channels/guardaserieicu.py index 113916f9..fb72bf31 100644 --- a/channels/guardaserieicu.py +++ b/channels/guardaserieicu.py @@ -26,15 +26,15 @@ def mainlist(item): return locals() @support.scrape -def peliculas(item): +def movies(item): patronBlock = r'movies-list movies-list-full(?P<block>.*?)footer>' patron = r'<div data-movie-id[^>]+>\s*<a href="(?P<url>[^"]+)"[^>]+>[^>]+>[^>]+><img src="(?P<thumbnail>[^"]+)[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>[^<]+).*?jt-info[^>]+>[^:]+:\s*(?P<rating>[^<]+)[^>]+>[^>]+>[^>]+>(?P<year>\d*)[^>]+>[^>]+>[^>]+>(?P<duration>\d*)' patronNext = '<li class=.active.>.*?href=.(.*?).>' - action = 'episodios' + action = 'episodes' return locals() @support.scrape -def episodios(item): +def episodes(item): patronBlock = r'<strong>Stagione (?P<season>[0-9]+)(?P<block>.*?)</div></div>' patron = r'<a href="(?P<url>[^"]+)">\s*Episodio\s*(?P<episode>[0-9]+)' return locals() @@ -45,7 +45,7 @@ def search(item, text): item.url = host + "/?s=" + text try: item.args = 'search' - return peliculas(item) + return movies(item) except: import sys for line in sys.exc_info(): diff --git a/channels/hd4me.py b/channels/hd4me.py index 96ae8d45..9e9fd6af 100644 --- a/channels/hd4me.py +++ b/channels/hd4me.py @@ -20,7 +20,7 @@ def mainlist(item): @support.scrape -def peliculas(item): +def movies(item): # debug = True if item.args == 'alternative': pagination = True @@ -33,7 +33,7 @@ def peliculas(item): @support.scrape def genre(item): - action = 'peliculas' + action = 'movies' blacklist =['prova '] patronGenreMenu = r'<a href="(?P<url>[^"]+)" class="menu-link\s*sub-menu-link">(?P<title>[^<]+)<' def itemHook(item): @@ -47,7 +47,7 @@ def search(item, text): logger.debug(text) item.url = host + '/?s=' + text try: - return peliculas(item) + return movies(item) # Cattura la eccezione così non interrompe la ricerca globle se il canale si rompe! except: import sys diff --git a/channels/ilcorsaronero.py b/channels/ilcorsaronero.py index b92bbfac..84c76c37 100644 --- a/channels/ilcorsaronero.py +++ b/channels/ilcorsaronero.py @@ -21,22 +21,22 @@ headers = [['Referer', host]] def mainlist(item): menu = [ - ('BDRiP {film}', ['/categoria.php?active=0&category=1&order=data&by=DESC&page=', 'peliculas', [0, 'movie', True], 'undefined']), + ('BDRiP {film}', ['/categoria.php?active=0&category=1&order=data&by=DESC&page=', 'movies', [0, 'movie', True], 'undefined']), ('Cerca BDRiP... {submenu} {film}', ['/torrent-ita/1/', 'search', ['search', 'movie', True], 'movie']), - ('DVD {film}', ['/categoria.php?active=0&category=20&order=data&by=DESC&page=', 'peliculas', [0, 'movie', True], 'undefined']), + ('DVD {film}', ['/categoria.php?active=0&category=20&order=data&by=DESC&page=', 'movies', [0, 'movie', True], 'undefined']), ('Cerca DVD... {submenu} {film}', ['/torrent-ita/20/', 'search', ['search', 'movie', True], 'movie']), - ('Screener {film}', ['/categoria.php?active=0&category=19&order=data&by=DESC&page=', 'peliculas', [0, 'movie', True], 'undefined']), + ('Screener {film}', ['/categoria.php?active=0&category=19&order=data&by=DESC&page=', 'movies', [0, 'movie', True], 'undefined']), ('Cerca Screener.. {submenu} {film}', ['/torrent-ita/19/', 'search', ['search', 'movie', True], 'movie']), - ('Serie TV', ['/categoria.php?active=0&category=15&order=data&by=DES&page=', 'peliculas', [0 , 'tvshow', True], 'tvshow']), + ('Serie TV', ['/categoria.php?active=0&category=15&order=data&by=DES&page=', 'movies', [0 , 'tvshow', True], 'tvshow']), ('Cerca Serie TV.. {submenu}', ['/torrent-ita/15/', 'search', ['search', 'tvshow',True], 'tvshow']), - ('Anime', ['/categoria.php?active=0&category=5&order=data&by=DESC&page=', 'peliculas', [0, 'anime', True], 'tvshow']), + ('Anime', ['/categoria.php?active=0&category=5&order=data&by=DESC&page=', 'movies', [0, 'anime', True], 'tvshow']), ('Cerca Anime.. {submenu}', ['/torrent-ita/5/', 'search', ['search', 'anime', True], 'tvshow']), - ('Musica', ['/categoria.php?active=0&category=2&order=data&by=DESC&page=', 'peliculas', [0, 'music', False], 'music']), + ('Musica', ['/categoria.php?active=0&category=2&order=data&by=DESC&page=', 'movies', [0, 'music', False], 'music']), ('Cerca Musica.. {submenu}', ['/torrent-ita/2/', 'search', ['search', 'music', False], 'music']), - ('Audiolibri {musica}', ['/categoria.php?active=0&category=18&order=data&by=DESC&page=', 'peliculas', [0, 'music', False], 'music']), + ('Audiolibri {musica}', ['/categoria.php?active=0&category=18&order=data&by=DESC&page=', 'movies', [0, 'music', False], 'music']), ('Cerca Audiolibri.. {submenu}', ['/torrent-ita/18/', 'search', ['search', 'music', False], 'music']), # mostrerebbe anche risultati non "multimediali" e allungherebbero inutilmente la ricerca globale - # ('Altro {film}', ['/categoria.php?active=0&category=4&order=data&by=DESC&page=', 'peliculas', [0, 'other', False]]), + # ('Altro {film}', ['/categoria.php?active=0&category=4&order=data&by=DESC&page=', 'movies', [0, 'other', False]]), # ('Cerca altro.. {submenu}', ['/torrent-ita/4/', 'search', ['search', 'other', False]]), # ('Cerca Tutto... {color kod bold}', ['/argh.php?search=', 'search', ['search', 'all', False]]) ] @@ -45,7 +45,7 @@ def mainlist(item): @support.scrape -def peliculas(item): +def movies(item): # debug = True sceneTitle = item.args[2] if item.args[1] in ['tvshow', 'anime', 'music', 'other']: @@ -59,7 +59,7 @@ def peliculas(item): def itemlistHook(itemlist): args = item.args args[0] += 1 - support.nextPage(itemlist, item, next_page=item.url, "peliculas") + support.nextPage(itemlist, item, next_page=item.url, "movies") # itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), args=args, thumbnail=support.thumb())) return itemlist return locals() @@ -72,7 +72,7 @@ def search(item, text): else: item.url += text + '.html' try: - return peliculas(item) + return movies(item) # Cattura la eccezione così non interrompe la ricerca globle se il canale si rompe! except: import sys diff --git a/channels/ilgeniodellostreaming.py b/channels/ilgeniodellostreaming.py index cc67e083..fb9dfe14 100644 --- a/channels/ilgeniodellostreaming.py +++ b/channels/ilgeniodellostreaming.py @@ -19,14 +19,14 @@ def mainlist(item): ('Generi',['', 'genres', 'genres']), ('Per Lettera',['/film-a-z/', 'genres', 'letter']), ('Anni',['', 'genres', 'year']), - ('Popolari',['/trending/?get=movies', 'peliculas', 'populared']), - ('Più Votati', ['/ratings/?get=movies', 'peliculas', 'populared']) + ('Popolari',['/trending/?get=movies', 'movies', 'populared']), + ('Più Votati', ['/ratings/?get=movies', 'movies', 'populared']) ] tvshow = ['/serie/', - ('Aggiornamenti', ['/aggiornamenti-serie/', 'peliculas', 'update']), - ('Popolari',['/trending/?get=tv', 'peliculas', 'populared']), - ('Più Votati', ['/ratings/?get=tv', 'peliculas', 'populared']) + ('Aggiornamenti', ['/aggiornamenti-serie/', 'movies', 'update']), + ('Popolari',['/trending/?get=tv', 'movies', 'populared']), + ('Più Votati', ['/ratings/?get=tv', 'movies', 'populared']) ] @@ -34,7 +34,7 @@ def mainlist(item): ] Tvshow = [ - ('Show TV {bullet bold}', ['/tv-show/', 'peliculas', '', 'tvshow']) + ('Show TV {bullet bold}', ['/tv-show/', 'movies', '', 'tvshow']) ] search = '' @@ -43,7 +43,7 @@ def mainlist(item): @support.scrape -def peliculas(item): +def movies(item): logger.debug() # debugBlock = True # debug=True @@ -53,7 +53,7 @@ def peliculas(item): patron = r'<img src="(?P<thumb>[^"]+)" alt="[^"]+" ?/?>[^>]+>(?P<type>[^<]+)</span>.*?<a href="(?P<url>[^"]+)">(?P<title>.+?)[ ]?(?:\[(?P<lang>Sub-ITA)\])?</a>[^>]+>[^>]+>(?:<span class="rating">IMDb\s*(?P<rating>[^>]+)</span>)?.?(?:<span class="year">(?P<year>[0-9]+)</span>)?.*?<p>(?P<plot>.*?)</p>' typeContentDict={'movie': ['film'], 'tvshow': ['tv']} - typeActionDict={'findvideos': ['film'], 'episodios': ['tv']} + typeActionDict={'findvideos': ['film'], 'episodes': ['tv']} else: if item.contentType == 'movie': @@ -75,7 +75,7 @@ def peliculas(item): patron = r'<div class="poster">\s?<a href="(?P<url>[^"]+)"><img src="(?P<thumb>[^"]+)" alt="[^"]+"><\/a>[^>]+>[^>]+>[^>]+>\s*(?P<rating>[0-9.]+)<\/div>(?:<span class="quality">(?:SUB-ITA|)?(?P<quality>|[^<]+)?<\/span>)?[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>.+?)[ ]?(?:\[(?P<lang>Sub-ITA)\])?<\/a>[^>]+>[^>]+>(?P<year>[^<]+)<\/span>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<plot>[^<]+)<div' else: # TVSHOW - action = 'episodios' + action = 'episodes' if item.args == 'update': action = 'findvideos' patron = r'<div class="poster"><img src="(?P<thumb>[^"]+)"(?:[^>]+>){2}<a href="(?P<url>[^"]+)">[^>]+>(?P<episode>[\d\-x]+)(?:[^>]+>){4}(?P<title>.+?)(?:\[(?P<lang>[SsuUbBiItTaA-]{7})\])?<(?:[^>]+>){4}(?P<quality>[HDWEBRIP-]+)?(?:.+?)?/span><p class="serie"' @@ -93,10 +93,10 @@ def peliculas(item): @support.scrape -def episodios(item): +def episodes(item): logger.debug() - patronBlock = r'<h1>.*?[ ]?(?:\[(?P<lang>.+?\]))?</h1>.+?<div class="se-a" style="display:block">\s*<ul class="episodios">(?P<block>.*?)</ul>\s*</div>\s*</div>\s*</div>\s*</div>\s*</div>' + patronBlock = r'<h1>.*?[ ]?(?:\[(?P<lang>.+?\]))?</h1>.+?<div class="se-a" style="display:block">\s*<ul class="episodes">(?P<block>.*?)</ul>\s*</div>\s*</div>\s*</div>\s*</div>\s*</div>' patron = r'<a href="(?P<url>[^"]+)"><img src="(?P<thumb>[^"]+)">.*?'\ '<div class="numerando">(?P<episode>[^<]+).*?<div class="episodiotitle">'\ '[^>]+>(?P<title>[^<]+)<\/a>' @@ -108,7 +108,7 @@ def episodios(item): def genres(item): logger.debug(item) - action='peliculas' + action='movies' if item.args == 'genres': patronBlock = r'<div class="sidemenu"><h2>Genere</h2>(?P<block>.*?)/li></ul></div>' elif item.args == 'year': @@ -130,7 +130,7 @@ def search(item, text): item.url = host + '/?' + uuid.uuid4().hex + '=' + uuid.uuid4().hex + '&s=' + text try: item.args = 'search' - return peliculas(item) + return movies(item) except: import sys for line in sys.exc_info(): @@ -138,24 +138,24 @@ def search(item, text): return [] -def newest(categoria): - logger.debug(categoria) +def newest(category): + logger.debug(category) itemlist = [] item = Item() - if categoria == 'peliculas': + if category == 'movie': item.contentType = 'movie' item.url = host + '/film/' - elif categoria == 'series': + elif category == 'tvshow': item.args = 'update' item.contentType = 'tvshow' item.url = host + '/aggiornamenti-serie/' -## elif categoria == 'anime': +## elif category == 'anime': ## item.contentType = 'tvshow' ## item.url = host + '/anime/' try: - item.action = 'peliculas' - itemlist = peliculas(item) + item.action = 'movies' + itemlist = movies(item) except: import sys diff --git a/channels/ilgeniodellostreaming_cam.py b/channels/ilgeniodellostreaming_cam.py index f2561712..89c7ae5f 100644 --- a/channels/ilgeniodellostreaming_cam.py +++ b/channels/ilgeniodellostreaming_cam.py @@ -14,7 +14,7 @@ headers = [['Referer', host]] @support.menu def mainlist(item): film = ['/film/', - ('In Sala', ['', 'peliculas', 'sala']), + ('In Sala', ['', 'movies', 'sala']), ('Generi',['', 'genres', 'genres']), ('Per Lettera',['/catalog/all', 'genres', 'az']), ('Anni',['', 'genres', 'year'])] @@ -23,7 +23,7 @@ def mainlist(item): @support.scrape -def peliculas(item): +def movies(item): if item.args == 'sala': patronBlock = r'insala(?P<block>.*?)<header>' patron = r'<img src="(?P<thumb>[^"]+)[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*(?P<rating>[^<]+)[^>]+>[^>]+>(?P<quality>[^<]+)[^>]+>[^>]+>[^>]+>[^>]+><a href="(?P<url>[^"]+)">(?P<title>[^<]+)[^>]+>[^>]+>[^>]+>(?P<year>\d{4})' @@ -39,7 +39,7 @@ def peliculas(item): @support.scrape def genres(item): - action='peliculas' + action='movies' if item.args == 'genres': patronBlock = r'<div class="sidemenu">\s*<h2>Genere</h2>(?P<block>.*?)</ul' elif item.args == 'year': @@ -57,7 +57,7 @@ def search(item, text): text = text.replace(' ', '+') item.url = host + "/search/" + text try: - return peliculas(item) + return movies(item) except: import sys for line in sys.exc_info(): @@ -65,17 +65,17 @@ def search(item, text): return [] -def newest(categoria): - logger.debug(categoria) +def newest(category): + logger.debug(category) itemlist = [] item = Item() - if categoria == 'peliculas': + if category == 'movie': item.contentType = 'movie' item.url = host + '/film/' try: - item.action = 'peliculas' - itemlist = peliculas(item) + item.action = 'movies' + itemlist = movies(item) except: import sys diff --git a/channels/italiaserie.json b/channels/italiaserie.json index d456096b..6785ebb9 100644 --- a/channels/italiaserie.json +++ b/channels/italiaserie.json @@ -6,6 +6,6 @@ "thumbnail": "italiaserie.png", "bannermenu": "italiaserie.png", "categories": ["tvshow", "sub"], - "not_active": ["include_in_newest_peliculas", "include_in_newest_anime"], + "not_active": ["include_in_newest_movie", "include_in_newest_anime"], "settings": [] } diff --git a/channels/italiaserie.py b/channels/italiaserie.py index 68a441b7..e08dd945 100644 --- a/channels/italiaserie.py +++ b/channels/italiaserie.py @@ -15,26 +15,26 @@ headers = [['Referer', host]] @support.menu def mainlist(item): tvshow = ['', - ('Aggiornamenti', ['/aggiornamento-episodi/', 'peliculas', 'update']), - ('Top 10', ['/top-10', 'peliculas', 'top']), - ('Netflix {tv submenu}', ['/genere/netflix', 'peliculas']) + ('Aggiornamenti', ['/aggiornamento-episodi/', 'movies', 'update']), + ('Top 10', ['/top-10', 'movies', 'top']), + ('Netflix {tv submenu}', ['/genere/netflix', 'movies']) ] return locals() @support.scrape -def peliculas(item): +def movies(item): # debug=True blacklist = ['Aggiornamento Episodi'] - action = 'episodios' + action = 'episodes' patron = r'<div class="post-thumb">\s*<a href="(?P<url>[^"]+)" title="(?P<title>[^"\[]+)[^>]+>\s*<img src="(?P<thumb>[^"]+)"[^>]+>' if item.args == 'update': pagination = True #patron = r'br />(?:[^>]+>)?(?P<title>[^–]+)[^<]+<a href="(?P<url>[^"]+)">(?P<episode>[^ ]+)\s*(?P<title2>[^\(<]+)(?:\((?P<lang>[^\)]+))?' patron = r'br[\s/]*>(?:\s*<[^>]+>)*(?P<title>[^–<]+)[^<]+<a href="(?P<url>[^"]+)"[^>]*>(?:[^,]{0,80}[, ]{2})*(?P<episode>[\S]+)\s*(?P<title2>[^\(<]+)(?:\((?P<lang>[^\)]+))?' - action = 'episodios' + action = 'episodes' if item.args == 'top': patron = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)</a>(?:[^>]+>){3}<img.*?src="(?P<thumb>[^"]+)"[^>]+>(?:[^>]+>){5}:\s*(?P<rating>[^/]+)' if item.args =='a-z': @@ -50,7 +50,7 @@ def peliculas(item): @support.scrape -def episodios(item): +def episodes(item): res = support.match(item, patron=r'<a href="([^"]+)">>') if res.match: data = support.match(res.match).data else: data = res.data @@ -66,7 +66,7 @@ def episodios(item): @support.scrape def category(item): - action = 'peliculas' + action = 'movies' patron = r'<li class="cat-item.*?href="(?P<url>[^"]+)".*?>(?P<title>.*?)</a>' return locals() @@ -76,7 +76,7 @@ def search(item, text): item.url = host + "/?s=" + text item.contentType = 'tvshow' try: - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -85,19 +85,19 @@ def search(item, text): return [] -def newest(categoria): - logger.debug("newest", categoria) +def newest(category): + logger.debug("newest", category) itemlist = [] item = Item() try: - if categoria == "series": + if category == 'tvshow': item.url = host + "/aggiornamento-episodi/" - item.action = "peliculas" + item.action = "movies" item.args = "update" item.contentType = "episode" - itemlist = peliculas(item) + itemlist = movies(item) - if itemlist[-1].action == "peliculas": + if itemlist[-1].action == "movies": itemlist.pop() # Continua la ricerca in caso di errore diff --git a/channels/la7.py b/channels/la7.py index dd74f939..49ebee1d 100644 --- a/channels/la7.py +++ b/channels/la7.py @@ -27,8 +27,8 @@ def mainlist(item): top = [('Dirette {bold}', ['', 'live']), ('Replay {bold}', ['', 'replay_channels'])] - menu = [('Programmi TV {bullet bold}', ['/tutti-i-programmi', 'peliculas', '', 'tvshow']), - ('Teche La7 {bullet bold}', ['/i-protagonisti', 'peliculas', '', 'tvshow'])] + menu = [('Programmi TV {bullet bold}', ['/tutti-i-programmi', 'movies', '', 'tvshow']), + ('Teche La7 {bullet bold}', ['/i-protagonisti', 'movies', '', 'tvshow'])] search = '' return locals() @@ -74,7 +74,7 @@ def search(item, text): item.url = host + '/tutti-i-programmi' item.search = text try: - return peliculas(item) + return movies(item) except: import sys for line in sys.exc_info(): @@ -83,12 +83,12 @@ def search(item, text): @support.scrape -def peliculas(item): +def movies(item): search = item.search tmdbEnabled = False videlibraryEnabled = False downloadEnabled = False - action = 'episodios' + action = 'episodes' patron = r'<a href="(?P<url>[^"]+)"[^>]+><div class="[^"]+" data-background-image="(?P<t>[^"]+)"></div><div class="titolo">\s*(?P<title>[^<]+)<' def itemHook(item): logger.debug(item) @@ -99,7 +99,7 @@ def peliculas(item): @support.scrape -def episodios(item): +def episodes(item): data = support.match(item).data # debug = True action = 'play' diff --git a/channels/mediasetplay.py b/channels/mediasetplay.py index 6976b625..4507f98f 100644 --- a/channels/mediasetplay.py +++ b/channels/mediasetplay.py @@ -45,7 +45,7 @@ pagination = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100][config.get_setting('pagin def mainlist(item): top = [('Dirette {bold}', ['', 'live'])] - menu = [('Film {bullet bold}', ['/cinema', 'peliculas', {'uxReference':'filmUltimiArrivi'}, 'movie']), + menu = [('Film {bullet bold}', ['/cinema', 'movies', {'uxReference':'filmUltimiArrivi'}, 'movie']), ('Fiction / Serie TV {bullet bold}', ['/fiction', 'menu', '5acfcb3c23eec6000d64a6a4', 'tvshow']), ('Programmi TV{ bullet bold}', ['/programmitv', 'menu', '5acfc8011de1c4000b6ec953', 'tvshow']), ('Documentari {bullet bold}', ['/documentari', 'menu', '5bfd17c423eec6001aec49f9', 'undefined']), @@ -63,7 +63,7 @@ def menu(item): itemlist.append(item.clone(title=support.typo(it['title'], 'bullet bold'), url= it['landingUrl'], args={'uxReference':it.get('uxReferenceV2', ''), 'params':it.get('uxReferenceV2Params', ''), 'feed':it.get('feedurlV2','')}, - action='peliculas')) + action='movies')) return itemlist @@ -98,7 +98,7 @@ def search(item, text): item.args = {'uxReference':'main', 'params':'channel≈', 'query':text} try: - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -107,7 +107,7 @@ def search(item, text): return [] -def peliculas(item): +def movies(item): itemlist = [] res = get_programs(item) video_id= '' @@ -181,13 +181,13 @@ def epmenu(item): item.clone(seriesid = '', title=support.typo(it['description'], 'bold'), subbrand=it['mediasetprogram$subBrandId'], - action='episodios')) + action='episodes')) itemlist = sorted(itemlist, key=lambda it: it.title, reverse=True) - if len(itemlist) == 1: return episodios(itemlist[0]) + if len(itemlist) == 1: return episodes(itemlist[0]) return itemlist -def episodios(item): +def episodes(item): # create month list months = [] try: diff --git a/channels/mediasetplay.py.old b/channels/mediasetplay.py.old index e74f99f8..f0ec6345 100644 --- a/channels/mediasetplay.py.old +++ b/channels/mediasetplay.py.old @@ -100,7 +100,7 @@ def search(item, text): item.search = text try: - itemlist = peliculas(item) + itemlist = movies(item) except: import sys for line in sys.exc_info(): @@ -117,7 +117,7 @@ def menu(item): for it in json: logger.debug(jsontools.dump(it)) if 'uxReference' in it: itemlist.append( - item.clone(title=support.typo(it['title'], 'bullet bold'), url= it['landingUrl'], feed = it.get('feedurlV2',''), ref=it['uxReference'], args='', action='peliculas')) + item.clone(title=support.typo(it['title'], 'bullet bold'), url= it['landingUrl'], feed = it.get('feedurlV2',''), ref=it['uxReference'], args='', action='movies')) return itemlist @@ -153,7 +153,7 @@ def live(item): return support.thumb(itemlist, mode='live') -def peliculas(item): +def movies(item): logger.debug() itemlist = [] titlelist = [] @@ -228,16 +228,16 @@ def epmenu(item): for entry in entries: if 'mediasetprogram$subBrandId' in entry: itemlist.append( - item.clone(action='episodios', + item.clone(action='episodes', title=support.typo(entry['description'], 'bold'), url=entry['mediasetprogram$subBrandId'], order=entry.get('mediasetprogram$order',0))) - if len(itemlist) == 1: return episodios(itemlist[0]) + if len(itemlist) == 1: return episodes(itemlist[0]) itemlist = sorted(itemlist, key=lambda it: it.order) return itemlist -def episodios(item): +def episodes(item): logger.debug() itemlist = [] if not item.nextIndex: item.nextIndex = 1 diff --git a/channels/metalvideo.py b/channels/metalvideo.py index 7dba79c9..61ca5616 100644 --- a/channels/metalvideo.py +++ b/channels/metalvideo.py @@ -13,7 +13,7 @@ headers = {'X-Requested-With': 'XMLHttpRequest'} @support.scrape def mainlist(item): item.url = host - action = 'peliculas' + action = 'movies' patronBlock = r'<ul class="dropdown-menu(?P<block>.*?)</ul>\s*</div' patron = r'<a href="(?P<url>[^"]+)"(?: class="")?>(?P<title>[^<]+)<' def itemHook(item): @@ -36,7 +36,7 @@ def mainlist(item): return locals() @support.scrape -def peliculas(item): +def movies(item): # debug=True action = 'findvideos' patron= r'<img src="[^"]+" alt="(?P<title>[^"]+)" data-echo="(?P<thumb>[^"]+)"(?:[^>]+>){7}<a href="(?P<url>[^"]+)"' @@ -53,7 +53,7 @@ def search(item, text): logger.debug(text) item.url = host + '/search.php?keywords=' + text + '&video-id=' try: - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys diff --git a/channels/mondoserietv.py b/channels/mondoserietv.py index 84013ad1..9c78e690 100644 --- a/channels/mondoserietv.py +++ b/channels/mondoserietv.py @@ -14,7 +14,7 @@ headers = {'Referer': host} def mainlist(item): film = ['/lista-film', - ('Ultimi Film Aggiunti', ['/ultimi-film-aggiunti', 'peliculas' , 'last'])] + ('Ultimi Film Aggiunti', ['/ultimi-film-aggiunti', 'movies' , 'last'])] tvshow = ['/lista-serie-tv', ('HD {TV}', ['/lista-serie-tv-in-altadefinizione']), @@ -23,7 +23,7 @@ def mainlist(item): anime = ['/lista-cartoni-animati-e-anime'] - docu = [('Documentari {bullet bold}',['/lista-documentari', 'peliculas', '', 'tvshow'])] + docu = [('Documentari {bullet bold}',['/lista-documentari', 'movies', '', 'tvshow'])] search = '' @@ -35,11 +35,11 @@ def search(item, text): if item.contentType == 'movie' or item.extra == 'movie': action = 'findvideos' else: - action = 'episodios' + action = 'episodes' item.args = 'search' item.url = host + "?a=b&s=" + text try: - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore . except: import sys @@ -48,19 +48,19 @@ def search(item, text): return [] -def newest(categoria): - logger.debug(categoria) +def newest(category): + logger.debug(category) item = support.Item() try: - if categoria == "series": + if category == 'tvshow': item.contentType= 'tvshow' item.url = host + '/ultimi-episodi-aggiunti' item.args = "lastep" - if categoria == "peliculas": + if category == "movie": item.contentType= 'movie' item.url = host + '/ultimi-film-aggiunti' item.args = "last" - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -70,7 +70,7 @@ def newest(categoria): @support.scrape -def peliculas(item): +def movies(item): pagination = True numerationEnabled = True patronNext = r'href="([^"]+)" title="[^"]+" class="lcp_nextlink"' @@ -83,7 +83,7 @@ def peliculas(item): patronBlock = r'<table>(?P<block>.*?)</table>' patron = r'<td>\s*<a href="[^>]+>(?P<title>.*?)(?:\s(?P<year>\d{4}))?\s(?:(?P<episode>(?:\d+x\d+|\d+)))\s*(?P<title2>[^<]+)(?P<url>.*?)<tr>' elif item.args == 'search': - patronBlock = r'<div class="peliculas">(?P<block>.*?)<div id="paginador"' + patronBlock = r'<div class="movies">(?P<block>.*?)<div id="paginador"' patron = r'class="item">\s*<a href="(?P<url>[^"]+)">\s*<div class="image">\s*<img src="(?P<thumb>[^"]+)" alt="(?P<title>.+?)(?:"| \d{4}).*?<span class="ttx">(?P<plot>[^<]+)<div class="degradado">[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*(?:<span class="imdbs">(?P<rating>[^<]+))?(?:[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<year>\d+))?' def itemHook(item): if '/film/' in item.url: @@ -91,19 +91,19 @@ def peliculas(item): item.action = 'findvideos' else: item.contentType = 'tvshow' - item.action = 'episodios' + item.action = 'episodes' return item else: patronBlock = r'<div class="entry-content pagess">(?P<block>.*?)</ul>' patron = r'<li\s*><a href="(?P<url>[^"]+)" title="(?P<title>.*?)(?:\s(?P<year>\d{4}))?"[^>]*>' if item.contentType == 'tvshow': - action = 'episodios' + action = 'episodes' numerationEnabled = True return locals() @support.scrape -def episodios(item): +def episodes(item): numerationEnabled = True pagination = True patronBlock = r'<table>(?P<block>.*?)</table>' diff --git a/channels/netfreex.json b/channels/netfreex.json index 999eb078..2608a10b 100644 --- a/channels/netfreex.json +++ b/channels/netfreex.json @@ -6,6 +6,6 @@ "thumbnail": "netfreex.png", "banner": "netfreex.png", "categories": ["tvshow", "movie", "anime"], - "not_active": ["include_in_newest_peliculas", "include_in_newest_anime", "include_in_newest_series"], + "not_active": ["include_in_newest_movie", "include_in_newest_anime", "include_in_newest_tvshow"], "settings": [] } diff --git a/channels/netfreex.py b/channels/netfreex.py index 442145e7..5c3f2ab9 100644 --- a/channels/netfreex.py +++ b/channels/netfreex.py @@ -40,14 +40,14 @@ def search(item, text): return [] -def peliculas(item): +def movies(item): if 'anime' in item.url: - return support.dooplay_peliculas(item, True) + return support.dooplay_movies(item, True) else: - return support.dooplay_peliculas(item, False) + return support.dooplay_movies(item, False) -def episodios(item): +def episodes(item): return support.dooplay_get_episodes(item) @@ -65,7 +65,7 @@ def findvideos(item): @support.scrape def menu(item): - action = 'peliculas' + action = 'movies' data = support.match(item, patron=r'<a href="#">Genere<(.*?)</ul').match patronMenu= r'<a href="(?P<url>[^"]+)"[^>]*>(?P<title>[^<]+)<' return locals() diff --git a/channels/paramount.py b/channels/paramount.py index 56b89165..e7ec1379 100644 --- a/channels/paramount.py +++ b/channels/paramount.py @@ -20,7 +20,7 @@ def mainlist(item): @support.scrape def menu(item): - action='peliculas' + action='movies' blacklist=['Tutti'] patronMenu = r'<a data-display-name="Link" href="(?P<url>[^"]+)" class="[^"]+">(?P<title>[^<]+)' return locals() @@ -31,7 +31,7 @@ def search(item, text): item.text = text try: - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore . except: import sys @@ -68,7 +68,7 @@ def live(item): return support.thumb(itemlist, mode='live') -def peliculas(item): +def movies(item): logger.debug() def load_more(url): second_url = host if url.startswith('/') else '' + url.replace('\u002F','/').replace('\\u002F','/').replace('%5C','/') @@ -101,11 +101,11 @@ def peliculas(item): thumbnail = it['media']['image']['url'], fanart = it['media']['image']['url'], plot = it['meta']['description'], - action = 'findvideos' if item.contentType == 'movie' else 'episodios')) + action = 'findvideos' if item.contentType == 'movie' else 'episodes')) return itemlist -def episodios(item): +def episodes(item): logger.debug() def load_more(url): second_url = host if url.startswith('/') else '' + url.replace('\u002F','/').replace('%5C','/') diff --git a/channels/piratestreaming.py b/channels/piratestreaming.py index f0ce5bb6..cb9be1f0 100644 --- a/channels/piratestreaming.py +++ b/channels/piratestreaming.py @@ -27,7 +27,7 @@ def search(item, texto): logger.debug(texto) item.url = host + "/search/" + texto try: - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -36,23 +36,23 @@ def search(item, texto): return [] -def newest(categoria): - logger.debug(categoria) +def newest(category): + logger.debug(category) itemlist = [] item = support.Item() try: - if categoria == "peliculas": + if category == "movie": item.url = host + '/category/films' item.contentType = 'movies' - return peliculas(item) - if categoria == "series": + return movies(item) + if category == 'tvshow': item.url = host + '/category/serie' item.contentType = 'tvshow' - return peliculas(item) - if categoria == "anime": + return movies(item) + if category == "anime": item.url = host + '/category/anime-cartoni-animati' item.contentType = 'tvshow' - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -64,18 +64,18 @@ def newest(categoria): @support.scrape -def peliculas(item): +def movies(item): patron = r'data-placement="bottom" title="(?P<title>[^"]+)" alt=[^=]+="(?P<url>[^"]+)"> <img class="[^"]+" title="[^"]+(?P<type>film|serie)[^"]+" alt="[^"]+" src="(?P<thumb>[^"]+)"' patronNext = r'<a\s*class="nextpostslink" rel="next" href="([^"]+)">Avanti' - typeActionDict = {'findvideos': ['film'], 'episodios': ['serie']} + typeActionDict = {'findvideos': ['film'], 'episodes': ['serie']} typeContentDict = {'movie': ['film'], 'tvshow': ['serie']} # debug = True return locals() @support.scrape -def episodios(item): +def episodes(item): if item.data: data = item.data # debug= True title = item.fulltitle @@ -94,5 +94,5 @@ def findvideos(item): data = support.match(item).data if 'link-episode' in data: item.data = data - return episodios(item) + return episodes(item) return support.server(item, data=data) diff --git a/channels/polpotv.py b/channels/polpotv.py index ec815d97..b38a4217 100644 --- a/channels/polpotv.py +++ b/channels/polpotv.py @@ -17,8 +17,8 @@ headers = [['Accept', 'application/ld+json']] @support.menu def mainlist(item): # menu = [ - # ('Ultimi Film aggiunti', ['/api/movies', 'peliculas', '']), - # ('Ultime Serie TV aggiunte', ['/api/shows', 'peliculas', '']), + # ('Ultimi Film aggiunti', ['/api/movies', 'movies', '']), + # ('Ultime Serie TV aggiunte', ['/api/shows', 'movies', '']), # ('Generi', ['/api/genres', 'search_movie_by_genre', '']), # ('Anni {film}', ['', 'search_movie_by_year', '']), # ('Cerca... bold', ['', 'search', '']) @@ -33,18 +33,18 @@ def mainlist(item): return locals() -def newest(categoria): +def newest(category): logger.debug() item = Item() - if categoria == 'peliculas': + if category == 'movie': item.contentType = 'movie' item.url = host + '/api/movies' - elif categoria == 'series': + elif category == 'tvshow': item.contentType = 'tvshow' item.url = host+'/api/shows' - return peliculas(item) + return movies(item) -def peliculas(item): +def movies(item): logger.debug() itemlist = [] @@ -66,7 +66,7 @@ def peliculas(item): return itemlist -def episodios(item): +def episodes(item): logger.debug() itemlist = [] data = support.match(item.url, headers=headers).data @@ -129,7 +129,7 @@ def search_movie_by_genre(item): json_object = jsontools.load(data) for genre in json_object['hydra:member']: itemlist.append( - item.clone(action="peliculas", + item.clone(action="movies", title=support.typo(genre['name'],'bold'), contentType='movie', url="%s/api/movies?genres.id=%s" %(host,genre['id']))) @@ -148,7 +148,7 @@ def search_movie_by_year(item): plot="1", type="movie", title=support.typo(year_to_search,'bold'), - action="peliculas")) + action="movies")) return itemlist @@ -209,7 +209,7 @@ def get_itemlist_element(element,item): infoLabels['tmdb_id']=element['tmdbId'] else: contentSerieName = scrapedtitle - next_action='episodios' + next_action='episodes' quality='' url="%s%s" diff --git a/channels/pufimovies.py b/channels/pufimovies.py index bff19e0b..c5f4d9b8 100644 --- a/channels/pufimovies.py +++ b/channels/pufimovies.py @@ -18,12 +18,12 @@ headers = [['Referer', host]] def mainlist(item): film = [ ('Generi', ['', 'menu', 'Film']), - ('Più Visti', ['','peliculas', 'most']) + ('Più Visti', ['','movies', 'most']) ] tvshow = ['', ('Generi', ['', 'menu', 'Serie Tv']), - ('Ultimi Episodi', ['','peliculas', 'last']) + ('Ultimi Episodi', ['','movies', 'last']) ] search = '' @@ -32,7 +32,7 @@ def mainlist(item): @support.scrape def menu(item): - action = 'peliculas' + action = 'movies' patronBlock = item.args + r' Categorie</a>\s*<ul(?P<block>.*?)</ul>' patronMenu = r'<a href="(?P<url>[^"]+)"[^>]+>(?P<title>[^>]+)<' return locals() @@ -45,8 +45,8 @@ def search(item, text): item.url = host + '/search/keyword/' + text try: item.args = 'search' - itemlist = peliculas(item) - if itemlist[-1].action == 'peliculas': + itemlist = movies(item) + if itemlist[-1].action == 'movies': itemlist.pop() return itemlist # Continua la ricerca in caso di errore @@ -57,22 +57,22 @@ def search(item, text): return [] -def newest(categoria): - logger.debug(categoria) +def newest(category): + logger.debug(category) itemlist = [] item = support.Item() item.url = host - item.action = 'peliculas' + item.action = 'movies' try: - if categoria == 'peliculas': + if category == 'movie': item.contentType = 'movie' - itemlist = peliculas(item) + itemlist = movies(item) else: item.args = 'last' item.contentType = 'tvshow' - itemlist = peliculas(item) + itemlist = movies(item) - if itemlist[-1].action == 'peliculas': + if itemlist[-1].action == 'movies': itemlist.pop() # Continua la ricerca in caso di errore except: @@ -85,9 +85,9 @@ def newest(categoria): @support.scrape -def peliculas(item): +def movies(item): if item.contentType == 'tvshow' and not item.args: - action = 'episodios' + action = 'episodes' patron = r'<div class="movie-box">\s*<a href="(?P<url>[^"]+)">[^>]+>[^>]+>\D+Streaming\s(?P<lang>[^"]+)[^>]+>[^>]+>[^>]+>(?P<quality>[^<]+)[^>]+>[^>]+>[^>]+>\s*<img src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>(?P<rating>[^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>[^<]+)[^>]+>[^>]+>[^>]+>\s*(?P<year>\d+)' elif item.contentType == 'movie' and not item.args: patron = r'<div class="existing_item col-6 col-lg-3 col-sm-4 col-xl-4">\s*<div class="movie-box">\s*<a href="(?P<url>(?:http(?:s)://[^/]+)?/(?P<type>[^/]+)/[^"]+)">[^>]+>[^>]+>\D+Streaming\s*(?P<lang>[^"]+)">[^>]+>[^>]+>(?P<quality>[^<]+)<[^>]+>[^>]+>[^>]+>\s*<img src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>(?P<rating>[^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>[^<]+)[^>]+>[^>]+>[^>]+>\s*(?:(?P<year>\d+))?[^>]+>[^>]+>[^>]+>[^>]+>(?P<plot>[^<]*)<' @@ -97,14 +97,14 @@ def peliculas(item): patron =r'div class="sm-113 item">\s*<a href="(?P<url>[^"]+)">[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s<img src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*(?P<title>[^<]+)' else: patron = r'<div class="movie-box">\s*<a href="(?P<url>(?:http(?:s)://[^/]+)?/(?P<type>[^/]+)/[^"]+)">[^>]+>[^>]+>\D+Streaming\s*(?P<lang>[^"]+)">[^>]+>[^>]+>(?P<quality>[^<]+)<[^>]+>[^>]+>[^>]+>\s*<img src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>(?P<rating>[^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>[^<]+)[^>]+>[^>]+>[^>]+>\s*(?:(?P<year>\d+))?[^>]+>[^>]+>[^>]+>[^>]+>(?P<plot>[^<]*)<' - typeActionDict = {'findvideos':['movie'], 'episodios':['tvshow']} + typeActionDict = {'findvideos':['movie'], 'episodes':['tvshow']} typeContentDict = {'movie':['movie'], 'tvshow':['tvshow']} patronNext = r'<a href="([^"]+)"[^>]+>»' return locals() @support.scrape -def episodios(item): +def episodes(item): patron = r'<div class="episode-box">[^>]+>[^>]+>[^>]+>\D+Streaming\s(?P<lang>[^"]+)">[^>]+>[^>]+>(?P<quality>[^<]+)<[^>]+>[^>]+>[^>]+>\s*<img src="(?P<thumb>[^"]+)"[^[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*<a href="(?P<url>[^"]+)"[^>]+>[^>]+>(?P<title>[^<]+)<[^>]+>[^>]+>[^>]+>\D*(?P<season>\d+)[^>]+>\D*(?P<episode>\d+)' return locals() diff --git a/channels/raiplay.py b/channels/raiplay.py index ee456506..004d309f 100644 --- a/channels/raiplay.py +++ b/channels/raiplay.py @@ -43,7 +43,7 @@ def menu(item): logger.debug() itemlist = [] item.disable_videolibrary = True - action = 'peliculas' + action = 'movies' if item.data: for it in item.data: @@ -68,7 +68,7 @@ def genres(item): itemlist = [] items = requests.get(getUrl(item.genre_url)).json()['contents'] for title, it in items.items(): - if it: itemlist.append(item.clone(title=support.typo(title, 'bold'), data=it, action='peliculas', thumbnail=support.thumb('az'))) + if it: itemlist.append(item.clone(title=support.typo(title, 'bold'), data=it, action='movies', thumbnail=support.thumb('az'))) return itemlist @@ -78,7 +78,7 @@ def search(item, text): try: item.data = requests.post(host + '/atomatic/raiplay-search-service/api/v3/search', json=post).json()['agg']['titoli']['cards'] - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -87,12 +87,12 @@ def search(item, text): return [] -def peliculas(item): +def movies(item): logger.debug() return addinfo(item.data, item) -def episodios(item): +def episodes(item): logger.debug() itemlist = [] @@ -286,7 +286,7 @@ def addinfo(items, item): it.action = 'play' it.contentTitle = it.fulltitle else: - it.action = 'episodios' + it.action = 'episodes' it.contentSerieName = it.fulltitle return it diff --git a/channels/seriehd.py b/channels/seriehd.py index 628b6c87..d3b496df 100644 --- a/channels/seriehd.py +++ b/channels/seriehd.py @@ -18,12 +18,12 @@ def mainlist(item): tvshow = [('Genere', ['', 'menu', 'genre']), ('A-Z', ['', 'menu', 'a-z']), - ('In Corso', ['/category/serie-tv-streaming/serie-in-corso', 'peliculas']), - ('Complete', ['/category/serie-tv-streaming/serie-complete', 'peliculas']), - ('Americane', ['/category/serie-tv-streaming/serie-tv-americane', 'peliculas']), - ('Italiane', ['/category/serie-tv-streaming/serie-tv-italiane', 'peliculas']), - ('Ultimi Episodi', ['/aggiornamenti', 'peliculas', 'last']), - ('Evidenza', ['', 'peliculas', 'best'])] + ('In Corso', ['/category/serie-tv-streaming/serie-in-corso', 'movies']), + ('Complete', ['/category/serie-tv-streaming/serie-complete', 'movies']), + ('Americane', ['/category/serie-tv-streaming/serie-tv-americane', 'movies']), + ('Italiane', ['/category/serie-tv-streaming/serie-tv-italiane', 'movies']), + ('Ultimi Episodi', ['/aggiornamenti', 'movies', 'last']), + ('Evidenza', ['', 'movies', 'best'])] return locals() @@ -34,7 +34,7 @@ def search(item, texto): item.contentType = 'tvshow' item.url = host + "/?s=" + texto try: - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore . except: import sys @@ -43,17 +43,17 @@ def search(item, texto): return [] -def newest(categoria): - logger.debug(categoria) +def newest(category): + logger.debug(category) itemlist = [] item = support.Item() item.url = host + '/aggiornamenti' item.args = 'last' try: - if categoria == "series": + if category == 'tvshow': item.contentType = 'tvshow' - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -65,17 +65,17 @@ def newest(categoria): @support.scrape -def peliculas(item): +def movies(item): # debug = True if item.args == 'last': action = 'findvideos' patron = r'singleUpdate">(?:[^>]+>){2}\s*<img src="(?P<thumb>[^"]+)"(?:[^>]+>){3}\s*<h2>(?P<title>[^<]+)<(?:[^>]+>){14,16}\s*<a href="(?P<url>[^"]+)">(?:[^>]+>){3}\s*(?P<season>\d+)\D+(?P<episode>\d+)(?:[^\(]*\()?(?P<lang>[^\)]+)?(?:\))?' elif item.args == 'best': - action='episodios' + action='episodes' patron = r'col-md-3">\s*<a href="(?P<url>[^"]+)">[^>]+>\s*<div class="infoVetrina">[^>]+>(?P<year>\d{4})(?:[^>]+>){2}(?P<title>[^<]+)<(?:[^>]+>){4}(?P<rating>[^<]+)(?:[^>]+>){4}\s*<img src="(?P<thumb>[^"]+)"' else: - action='episodios' + action='episodes' # patron = r'<a href="(?P<url>[^"]+)">[^>]+>\s*<div class="infoSeries">\s*<h2>(?P<title>[^<]+)<(?:[^>]+>){5}(?P<rating>[^<]+)?(?:[^>]+>){3}\s*<img src="(?P<thumb>[^"]+)"(?:[^>]+>){3}(?P<quality>[^<]+)<(?:[^>]+>){2}(?P<year>\d{4})' patron = r'<a href="(?P<url>[^"]+)">[^>]+>\s*<div class="infoSeries">\s*<h2>(?P<title>[^<]+?)(?:\[(?P<lang>[^\]]+)\])?<(?:[^>]+>){5}(?P<rating>[^<]+)?(?:[^>]+>){3}\s*(?:<img src="(?P<thumb>[^"]+)"[^>]+>)?(?:[^>]+>){0,2}(?P<quality>[^<]+)<(?:[^>]+>){2}(?P<year>\d{4})' patronNext=r'next page-numbers" href="([^"]+)"' @@ -84,7 +84,7 @@ def peliculas(item): @support.scrape -def episodios(item): +def episodes(item): def get_season(pageData, seas_url, season): data = '' episodes = support.match(pageData if pageData else seas_url, patronBlock=patron_episode, patron=patron_option).matches @@ -137,7 +137,7 @@ def menu(item): patronMenu = r'<a href="(?P<url>[^"]+)" class="">(?P<title>[^<]+)' blacklist = ['Serie TV Streaming','Serie TV Americane','Serie TV Italiane','Serie Complete','Serie in Corso','altadefinizione'] - action = 'peliculas' + action = 'movies' return locals() diff --git a/channels/serietvonline.py b/channels/serietvonline.py index 1d780ff8..d4cb0309 100644 --- a/channels/serietvonline.py +++ b/channels/serietvonline.py @@ -35,27 +35,27 @@ def mainlist(item): film = ['/ultimi-film-aggiunti/', - ('A-Z', ['/lista-film/', 'peliculas', 'lista']) + ('A-Z', ['/lista-film/', 'movies', 'lista']) ] tvshow = ['', - ('Aggiornamenti', ['/ultimi-episodi-aggiunti/', 'peliculas', 'update']), - ('Tutte', ['/lista-serie-tv/', 'peliculas', 'qualcosa']), - ('Italiane', ['/lista-serie-tv-italiane/', 'peliculas', 'qualcosa']), - ('Anni 50-60-70-80', ['/lista-serie-tv-anni-60-70-80/', 'peliculas', 'qualcosa']), - ('HD', ['/lista-serie-tv-in-altadefinizione/', 'peliculas', 'qualcosa']) + ('Aggiornamenti', ['/ultimi-episodi-aggiunti/', 'movies', 'update']), + ('Tutte', ['/lista-serie-tv/', 'movies', 'qualcosa']), + ('Italiane', ['/lista-serie-tv-italiane/', 'movies', 'qualcosa']), + ('Anni 50-60-70-80', ['/lista-serie-tv-anni-60-70-80/', 'movies', 'qualcosa']), + ('HD', ['/lista-serie-tv-in-altadefinizione/', 'movies', 'qualcosa']) ] anime = ['/lista-cartoni-animati-e-anime/'] - documentari = [('Documentari {bullet bold}', ['/lista-documentari/' , 'peliculas' , 'doc', 'tvshow'])] + documentari = [('Documentari {bullet bold}', ['/lista-documentari/' , 'movies' , 'doc', 'tvshow'])] search = '' return locals() @support.scrape -def peliculas(item): +def movies(item): logger.debug() numerationEnabled = True @@ -99,13 +99,13 @@ def peliculas(item): pass else: item.contentType = 'tvshow' - item.action = 'episodios' + item.action = 'episodes' return item return locals() @support.scrape -def episodios(item): +def episodes(item): logger.debug() numerationEnabled = True action = 'findvideos' @@ -127,7 +127,7 @@ def search(item, text): try: item.args = 'search' - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -135,22 +135,22 @@ def search(item, text): logger.error("%s" % line) return [] -def newest(categoria): - logger.debug(categoria) +def newest(category): + logger.debug(category) itemlist = [] item = Item() - if categoria == 'peliculas': + if category == 'movie': item.contentType = 'movie' item.url = host + '/ultimi-film-aggiunti/' - elif categoria == 'series': + elif category == 'tvshow': item.args = 'update' item.contentType = 'episode' item.url = host +'/ultimi-episodi-aggiunti/' try: - item.action = 'peliculas' - itemlist = peliculas(item) + item.action = 'movies' + itemlist = movies(item) except: import sys @@ -179,6 +179,6 @@ def findvideos(item): series = support.typo(item.contentSerieName, ' bold color kod') itemlist = support.server(item, data=url_video) - itemlist.append(item.clone(title=goseries + series, contentType='tvshow', url=url_serie, action='episodios', plot = goseries + series + "con tutte le puntate", args='')) + itemlist.append(item.clone(title=goseries + series, contentType='tvshow', url=url_serie, action='episodes', plot = goseries + series + "con tutte le puntate", args='')) return itemlist diff --git a/channels/serietvsubita.json b/channels/serietvsubita.json index 2cd33c2f..fcc598e3 100644 --- a/channels/serietvsubita.json +++ b/channels/serietvsubita.json @@ -16,7 +16,7 @@ "visible": true }, { - "id": "include_in_newest_series", + "id": "include_in_newest_tvshow", "type": "bool", "label": "Includi in Novità - Serie TV", "default": true, diff --git a/channels/serietvsubita.py b/channels/serietvsubita.py index 31d06631..a27bb4a0 100644 --- a/channels/serietvsubita.py +++ b/channels/serietvsubita.py @@ -22,7 +22,7 @@ list_language = IDIOMAS.values() def mainlist(item): itemlist = [] tvshowSub = [ - ('Novità {bold}',[ '', 'peliculas_tv', '', 'tvshow']), + ('Novità {bold}',[ '', 'movies_tv', '', 'tvshow']), ('Serie TV {bold}',[ '', 'lista_serie', '', 'tvshow']), ('Per Lettera', ['', 'list_az', 'serie', 'tvshow']) ] @@ -110,7 +110,7 @@ def lista_serie(item): if i >= p * PERPAGE: break title = cleantitle(scrapedtitle) itemlist.append( - item.clone(action="episodios", + item.clone(action="episodes", title=title, url=scrapedurl, thumbnail=scrapedthumbnail, @@ -134,7 +134,7 @@ def lista_serie(item): # ---------------------------------------------------------------------------------------------------------------- -def episodios(item, itemlist=[]): +def episodes(item, itemlist=[]): logger.debug() patron = r'<div class="post-meta">\s*<a href="([^"]+)"\s*title="([^"]+)"\s*class=".*?"></a>.*?' patron += r'<p><a href="([^"]+)">' @@ -198,7 +198,7 @@ def episodios(item, itemlist=[]): next_page = scrapertools.find_single_match(data, patron) if next_page != "": item.url = next_page - itemlist = episodios(item, itemlist) + itemlist = episodes(item, itemlist) else: item.url = item.originalUrl support.videolibrary(itemlist, item, 'bold color kod') @@ -209,7 +209,7 @@ def episodios(item, itemlist=[]): # ================================================================================================================ # ---------------------------------------------------------------------------------------------------------------- -def peliculas_tv(item): +def movies_tv(item): logger.debug() itemlist = [] @@ -262,16 +262,16 @@ def peliculas_tv(item): # ---------------------------------------------------------------------------------------------------------------- -def newest(categoria): - logger.debug(categoria) +def newest(category): + logger.debug(category) itemlist = [] item = Item() item.url = host item.extra = 'serie' try: - if categoria == "series": - itemlist = peliculas_tv(item) - if itemlist[-1].action == 'peliculas_tv': + if category == 'tvshow': + itemlist = movies_tv(item) + if itemlist[-1].action == 'movies_tv': itemlist.pop(-1) except: @@ -298,7 +298,7 @@ def search(item, texto): scrapedplot = "" title = cleantitle(scrapedtitle) itemlist.append( - item.clone(action="episodios", + item.clone(action="episodes", title=title, url=scrapedurl, thumbnail=scrapedthumbnail, diff --git a/channels/serietvu.json b/channels/serietvu.json index 73fa9b6e..8e1d9eb0 100644 --- a/channels/serietvu.json +++ b/channels/serietvu.json @@ -6,6 +6,6 @@ "thumbnail": "serietvu.png", "banner": "serietvu.png", "categories": ["tvshow", "sub"], - "not_active": ["include_in_newest_peliculas", "include_in_newest_anime"], + "not_active": ["include_in_newest_movie", "include_in_newest_anime"], "settings": [] } diff --git a/channels/serietvu.py b/channels/serietvu.py index 01447e73..86bb1f15 100644 --- a/channels/serietvu.py +++ b/channels/serietvu.py @@ -23,7 +23,7 @@ headers = [['Referer', host]] def mainlist(item): tvshow = ['/category/serie-tv', - ('Ultimi episodi', ['/ultimi-episodi/', 'peliculas', 'update']), + ('Ultimi episodi', ['/ultimi-episodi/', 'movies', 'update']), ('Generi', ['', 'genres', 'genres']) ] @@ -31,12 +31,12 @@ def mainlist(item): @support.scrape -def peliculas(item): +def movies(item): # debug=True patronBlock = r'<div class="wrap">\s*<h.>.*?</h.>(?P<block>.*?)<footer>' if item.args != 'update': - action = 'episodios' + action = 'episodes' patron = r'<div class="item">\s*?<a href="(?P<url>[^"]+)" data-original="(?P<thumb>[^"]+)" class="lazy inner">(?:[^>]+>){4}(?P<title>[^<]+)<' else: action = 'findvideos' @@ -48,7 +48,7 @@ def peliculas(item): @support.scrape -def episodios(item): +def episodes(item): seasons = support.match(item, patron=r'<option value="(\d+)"[^>]*>\D+(\d+)').matches patronBlock = r'</select><div style="clear:both"></div></h2>(?P<block>.*?)<div id="trailer" class="tab">' patron = r'(?:<div class="list (?:active)?")?\s*<a data-id="\d+(?:[ ](?P<lang>[SuUbBiItTaA\-]+))?"(?P<other>[^>]+)>.*?Episodio [0-9]+\s?(?:<br>(?P<title>[^<]+))?.*?Stagione (?P<season>[0-9]+) , Episodio - (?P<episode>[0-9]+).*?<(?P<url>.*?<iframe)' @@ -66,7 +66,7 @@ def episodios(item): @support.scrape def genres(item): blacklist = ["Home Page", "Calendario Aggiornamenti"] - action = 'peliculas' + action = 'movies' patronBlock = r'<h2>Sfoglia</h2>\s*<ul>(?P<block>.*?)</ul>\s*</section>' patronMenu = r'<li><a href="(?P<url>[^"]+)">(?P<title>[^<]+)</a></li>' return locals() @@ -77,7 +77,7 @@ def search(item, text): item.url = host + "/?s=" + text try: item.contentType = 'tvshow' - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -86,17 +86,17 @@ def search(item, text): return [] -def newest(categoria): - logger.debug(categoria) +def newest(category): + logger.debug(category) itemlist = [] item = Item() try: - if categoria == "series": + if category == 'tvshow': item.url = host + "/ultimi-episodi" - item.action = "peliculas" + item.action = "movies" item.contentType = 'tvshow' item.args = 'update' - itemlist = peliculas(item) + itemlist = movies(item) # Continua la ricerca in caso di errore except: @@ -126,7 +126,7 @@ def findvideos(item): item.clone(title=support.typo("Vai alla Serie Completa: " + item.fulltitle, ' bold'), contentType='tvshow', url=url_serie, - action='episodios', + action='episodes', thumbnail = support.thumb('tvshow'))) return itemlist diff --git a/channels/streamingaltadefinizione.json b/channels/streamingaltadefinizione.json index 404c2ddb..e462fae3 100644 --- a/channels/streamingaltadefinizione.json +++ b/channels/streamingaltadefinizione.json @@ -6,6 +6,6 @@ "thumbnail": "popcornstream.png", "banner": "popcornstream.png", "categories": ["movie","tvshow","anime"], - "not_active":["include_in_newest_peliculas", "include_in_newest_series", "include_in_newest_anime"], + "not_active":["include_in_newest_movie", "include_in_newest_tvshow", "include_in_newest_anime"], "settings": [] } diff --git a/channels/streamingaltadefinizione.py b/channels/streamingaltadefinizione.py index 89b604dc..eda016d3 100644 --- a/channels/streamingaltadefinizione.py +++ b/channels/streamingaltadefinizione.py @@ -46,16 +46,16 @@ def search(item, text): def genre(item): patronMenu = '<a href="(?P<url>[^"#]+)">(?P<title>[a-zA-Z]+)' patronBlock='<a href="#">Genere</a><ul class="sub-menu">(?P<block>.*?)</ul>' - action='peliculas' + action='movies' return locals() -def peliculas(item): - return support.dooplay_peliculas(item, True if "/genere/" in item.url else False) +def movies(item): + return support.dooplay_movies(item, True if "/genere/" in item.url else False) -def episodios(item): +def episodes(item): return support.dooplay_get_episodes(item) diff --git a/channels/streamingcommunity.py b/channels/streamingcommunity.py index 1d57470d..eed5eb6c 100644 --- a/channels/streamingcommunity.py +++ b/channels/streamingcommunity.py @@ -11,7 +11,10 @@ if sys.version_info[0] >= 3: else: from concurrent_py2 import futures -host = support.config.get_channel_url() +def findhost(url): + return 'https://' + support.match(url, patron='var domain\s*=\s*"([^"]+)').match + +host = support.config.get_channel_url(findhost) session = requests.Session() headers = {} @@ -32,14 +35,14 @@ getHeaders() def mainlist(item): film=['', ('Generi',['/film','genres']), - ('Titoli del Momento',['/film','peliculas',0]), - ('Novità',['/film','peliculas',1]), - ('Popolari',['/film','peliculas',2])] + ('Titoli del Momento',['/film','movies',0]), + ('Novità',['/film','movies',1]), + ('Popolari',['/film','movies',2])] tvshow=['', ('Generi',['/serie-tv','genres']), - ('Titoli del Momento',['/serie-tv','peliculas',0]), - ('Novità',['/serie-tv','peliculas',1]), - ('Popolari',['/serie-tv','peliculas',2])] + ('Titoli del Momento',['/serie-tv','movies',0]), + ('Novità',['/serie-tv','movies',1]), + ('Popolari',['/serie-tv','movies',2])] search='' return locals() @@ -51,7 +54,7 @@ def genres(item): data = support.scrapertools.decodeHtmlentities(support.match(item).data) args = support.match(data, patronBlock=r'genre-options-json="([^\]]+)\]', patron=r'name"\s*:\s*"([^"]+)').matches for arg in args: - itemlist.append(item.clone(title=support.typo(arg, 'bold'), args=arg, action='peliculas')) + itemlist.append(item.clone(title=support.typo(arg, 'bold'), args=arg, action='movies')) support.thumb(itemlist, genre=True) return itemlist @@ -61,7 +64,7 @@ def search(item, text): item.search = text try: - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -75,15 +78,17 @@ def newest(category): itemlist = [] item = support.Item() item.args = 1 - if category == 'peliculas': + if category == 'movie': + item.contentType= 'movie' item.url = host + '/film' else: + item.contentType= 'tvshow' item.url = host + '/serie-tv' try: - itemlist = peliculas(item) + itemlist = movies(item) - if itemlist[-1].action == 'peliculas': + if itemlist[-1].action == 'movies': itemlist.pop() # Continua la ricerca in caso di errore except: @@ -96,7 +101,7 @@ def newest(category): -def peliculas(item): +def movies(item): # getHeaders() logger.debug() itemlist = [] @@ -157,13 +162,13 @@ def makeItem(n, it, item): # itm.contentType = 'tvshow' itm.contentTitle = '' itm.fulltitle = itm.show = itm.contentSerieName = title - itm.action = 'episodios' + itm.action = 'episodes' itm.season_count = info['seasons_count'] itm.url = host + '/titles/%s-%s' % (it['id'], it['slug']) itm.n = n return itm -def episodios(item): +def episodes(item): # getHeaders() logger.debug() itemlist = [] diff --git a/channels/streamtime.py b/channels/streamtime.py index 00de08c8..dafc5660 100644 --- a/channels/streamtime.py +++ b/channels/streamtime.py @@ -24,7 +24,7 @@ def mainlist(item): @support.scrape -def peliculas(item): +def movies(item): patron = """tgme_widget_message_photo_wrap.*?image:url\("(?P<thumbnail>[^"]+).*?//telegram\.org/img/emoji/40/(?:F09F8EAC|F09F8EA5)\.png"\)">.*?</i>\s?(?:<b>)?(?P<title>[^<]+).*?(?:Audio(?:</b>)?: (?P<lang>.*?<br>))?.*?Anno(?:</b>)?: (?P<year>[0-9]{4}).*?(?:<b>Stream</b>|Risoluzione|<b>Tipo</b>|Tipo|Stream): (?P<quality>[^<]+).*?tgme_widget_message_inline_button url_button" href="(?P<url>[^"]+)""" def itemlistHook(itemlist): retItemlist = [] @@ -34,7 +34,7 @@ def peliculas(item): i.contentType = 'movie' if '/SerieTv/' in i.url: i.contentType = 'tvshow' - i.action = 'episodios' + i.action = 'episodes' if item.contentType == i.contentType or item.contentType == 'list': # list = ricerca globale quando c'è un solo tipo di risultato retItemlist.append(i) # rimuovo duplicati @@ -66,14 +66,14 @@ def peliculas(item): # return item if item.contentType == 'tvshow': - action = 'episodios' + action = 'episodes' return locals() def search(item, texto): item.url = host + "/?q=" + texto try: - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -82,19 +82,19 @@ def search(item, texto): return [] -def newest(categoria): +def newest(category): item = Item() - if categoria == "series": + if category == 'tvshow': item.contentType = 'tvshow' item.url = host + '?q=%23SerieTv' else: item.contentType = 'movie' item.url = host + '?q=%23Film' - return peliculas(item) + return movies(item) # cerco il titolo, così mi escono fuori tutti i messaggi contenenti puntate singole o serie -def episodios(item): +def episodes(item): url = item.url item.cercaSerie = True itemlist = search(item, item.fulltitle.replace("'", "")) diff --git a/channels/tantifilm.json b/channels/tantifilm.json index 1cf987db..0acb07da 100644 --- a/channels/tantifilm.json +++ b/channels/tantifilm.json @@ -6,6 +6,6 @@ "thumbnail": "tantifilm.png", "banner": "tantifilm.png", "categories": ["tvshow", "movie", "anime"], - "not_active":["include_in_newest_anime", "include_in_newest_peliculas"], + "not_active":["include_in_newest_anime", "include_in_newest_movie"], "settings": [] } diff --git a/channels/tantifilm.py b/channels/tantifilm.py index d4a412d6..3c7805d6 100644 --- a/channels/tantifilm.py +++ b/channels/tantifilm.py @@ -45,7 +45,7 @@ def mainlist(item): return locals() @support.scrape -def peliculas(item): +def movies(item): # debug = True if item.args == 'search': patron = r'<a href="(?P<url>[^"]+)" title="Permalink to\s*(?P<title>[^"]+) \((?P<year>[0-9]+)[^<]*\)[^"]*"[^>]+>\s*<img[^s]+src="(?P<thumb>[^"]+)".*?<div class="calitate">\s*<p>(?P<quality>[^<]+)<\/p>' @@ -55,7 +55,7 @@ def peliculas(item): patronBlock = r'<div id="main_col">(?P<block>.*?)<!\-\- main_col \-\->' # if item.args != 'all' and item.args != 'search': - # action = 'findvideos' if item.extra == 'movie' else 'episodios' + # action = 'findvideos' if item.extra == 'movie' else 'episodes' # item.contentType = 'movie' if item.extra == 'movie' else 'tvshow' # debug = True return locals() @@ -63,7 +63,7 @@ def peliculas(item): @support.scrape -def episodios(item): +def episodes(item): def get_season(pageData, seas_url, season): data = '' episodes = support.match(pageData if pageData else seas_url, patronBlock=patron_episode, patron=patron_option).matches @@ -106,7 +106,7 @@ def category(item): blacklist = ['Ultimi Film Aggiornati', 'Anime', 'Serie TV Altadefinizione', 'HD AltaDefinizione', 'Al Cinema', 'Serie TV', 'Miniserie', 'Programmi Tv', 'Live', 'Trailers', 'Serie TV Aggiornate', 'Aggiornamenti', 'Featured'] patronGenreMenu = '<li><a href="(?P<url>[^"]+)"><span></span>(?P<title>[^<]+)</a></li>' patron_block = '<ul class="table-list">(.*?)</ul>' - action = 'peliculas' + action = 'movies' return locals() @@ -118,7 +118,7 @@ def search(item, texto): item.url = host + "/?s=" + texto try: item.args = 'search' - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: @@ -129,8 +129,8 @@ def search(item, texto): @support.scrape -def newest(categoria): - if categoria == 'series': +def newest(category): + if category == 'tvshow': item = Item(url=host + '/aggiornamenti-serie-tv') data = support.match(item).data.replace('<u>','').replace('</u>','') item.contentType = 'episode' @@ -165,13 +165,13 @@ def findvideos(item): item.data = data logger.debug('select = ### è una anime ###') try: - return episodios(item) + return episodes(item) except: pass elif 'serie' in check.lower(): item.contentType = 'tvshow' item.data = data - return episodios(item) + return episodes(item) else: item.contentTitle = item.fulltitle item.contentType = 'movie' diff --git a/channels/tapmovie.py b/channels/tapmovie.py index 65fd92fa..f40b13f5 100644 --- a/channels/tapmovie.py +++ b/channels/tapmovie.py @@ -26,7 +26,7 @@ def mainlist(item): return locals() -def episodios(item): +def episodes(item): logger.debug(item) itemlist = [] @@ -49,11 +49,11 @@ def episodios(item): def genres(item): itemlist = [] for n, genre in enumerate(httptools.downloadpage(host + api_url + 'categories', post={}).json.get('categories', [])): - itemlist.append(item.clone(action="peliculas", genre=genre.get('name'), title=genre.get('value'), n=n)) + itemlist.append(item.clone(action="movies", genre=genre.get('name'), title=genre.get('value'), n=n)) return support.thumb(itemlist, mode='genre') -def peliculas(item, text=''): +def movies(item, text=''): logger.debug('search', item) itemlist = [] filter_type = False @@ -76,7 +76,7 @@ def peliculas(item, text=''): itemlist.append(item.clone(id=result.get('id'), title=result.get('title'), contentTitle=result.get('title'), contentSerieName='' if contentType == 'movie' else result.get('title'), contentPlot=result.get('description'), thumbnail=result.get('poster'), - fanart=result.get('backdrop'), year=result.get('year'), action='episodios' if contentType == 'tvshow' else 'findvideos', + fanart=result.get('backdrop'), year=result.get('year'), action='episodes' if contentType == 'tvshow' else 'findvideos', url='{}/{}/{}-{}'.format('https://filmigratis.org', contentType, result.get('id'), support.scrapertools.slugify(result.get('title'))), contentType=contentType)) support.tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) @@ -88,7 +88,7 @@ def peliculas(item, text=''): def search(item, text): - return peliculas(item, text) + return movies(item, text) def findvideos(item): diff --git a/channels/toonitalia.json b/channels/toonitalia.json index 44d43c2b..15ac39ac 100644 --- a/channels/toonitalia.json +++ b/channels/toonitalia.json @@ -5,8 +5,8 @@ "active": true, "thumbnail": "toonitalia.png", "banner": "toonitalia.png", - "categories": ["tvshow", "movie", "sub, "anime"], - "not_active":["include_in_newest_peliculas", "include_in_newest_series"], + "categories": ["tvshow", "movie", "sub", "anime"], + "not_active":["include_in_newest_movie", "include_in_newest_tvshow"], "default_off":["include_in_newest"], "settings": [] } diff --git a/channels/toonitalia.py b/channels/toonitalia.py index c981f243..11259201 100644 --- a/channels/toonitalia.py +++ b/channels/toonitalia.py @@ -14,12 +14,12 @@ headers = [['Referer', host]] @support.menu def mainlist(item): - top = [('Novità',['', 'peliculas', 'new', 'tvshow']), - ('Aggiornamenti', ['', 'peliculas', 'last', 'tvshow'])] + top = [('Novità',['', 'movies', 'new', 'tvshow']), + ('Aggiornamenti', ['', 'movies', 'last', 'tvshow'])] tvshow = ['/category/serie-tv/'] anime =['/category/anime/', - ('Sub-Ita',['/category/anime-sub-ita/', 'peliculas', 'sub']), - ('Film Animati',['/category/film-animazione/','peliculas', '', 'movie'])] + ('Sub-Ita',['/category/anime-sub-ita/', 'movies', 'sub']), + ('Film Animati',['/category/film-animazione/','movies', '', 'movie'])] search = '' return locals() @@ -31,7 +31,7 @@ def search(item, text): item.url = item.url + '/?a=b&s=' + text.replace(' ', '+') try: - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -40,14 +40,14 @@ def search(item, text): return [] -def newest(categoria): - logger.debug(categoria) +def newest(category): + logger.debug(category) item = support.Item() try: item.contentType = 'undefined' item.url= host item.args= 'new' - return peliculas(item) + return movies(item) # Continua la ricerca in caso di errore except: import sys @@ -57,12 +57,12 @@ def newest(categoria): @support.scrape -def peliculas(item): +def movies(item): # debugBlock = True # debug = True # search = item.text if item.contentType != 'movie': numerationEnabled = True - action = 'findvideos' if item.contentType == 'movie' else 'episodios' + action = 'findvideos' if item.contentType == 'movie' else 'episodes' blacklist = ['-Film Animazione disponibili in attesa di recensione '] if item.action == 'search': @@ -92,7 +92,7 @@ def peliculas(item): @support.scrape -def episodios(item): +def episodes(item): numerationEnabled = True # debug = True patron = r'>\s*(?:(?P<season>\d+)(?:×|x|×))?(?P<episode>\d+)(?:\s+–\s+)?[ –]+(?P<title2>[^<]+)[ –]+<a (?P<data>.*?)(?:<br|</p)' diff --git a/channels/vedohd.py b/channels/vedohd.py index ffb81a21..e7c13565 100644 --- a/channels/vedohd.py +++ b/channels/vedohd.py @@ -21,8 +21,8 @@ blacklist = ['CB01.UNO ▶ TROVA L’INDIRIZZO UFFICIALE ', 'AVVISO IMP def mainlist(item): film = [ - ('I più votati', ["ratings/?get=movies", 'peliculas']), - ('I più popolari', ["trending/?get=movies", 'peliculas']), + ('I più votati', ["ratings/?get=movies", 'movies']), + ('I più popolari', ["trending/?get=movies", 'movies']), ('Generi', ['ratings/?get=movies', 'menu', 'genres']), ('Anno', ["", 'menu', 'releases']), ] @@ -36,8 +36,8 @@ def search(item, text): return support.dooplay_search(item, blacklist) -def peliculas(item): - return support.dooplay_peliculas(item, False, blacklist) +def movies(item): + return support.dooplay_movies(item, False, blacklist) def findvideos(item): diff --git a/channels/vvvvid.py b/channels/vvvvid.py index 6ab9e301..faab6ba9 100644 --- a/channels/vvvvid.py +++ b/channels/vvvvid.py @@ -31,35 +31,35 @@ main_host = host + '/vvvvid/ondemand/' def mainlist(item): if conn_id: anime = ['/vvvvid/ondemand/anime/', - ('Popolari',['/vvvvid/ondemand/anime/', 'peliculas', 'channel/10002/last/']), - ('Nuove Uscite',['/vvvvid/ondemand/anime/', 'peliculas', 'channel/10007/last/']), - ('Generi',['/vvvvid/ondemand/anime/', 'peliculas', 'channel/10004/last/?category=']), - ('A-Z',['/vvvvid/ondemand/anime/', 'peliculas', 'channel/10003/last/?filter=']) + ('Popolari',['/vvvvid/ondemand/anime/', 'movies', 'channel/10002/last/']), + ('Nuove Uscite',['/vvvvid/ondemand/anime/', 'movies', 'channel/10007/last/']), + ('Generi',['/vvvvid/ondemand/anime/', 'movies', 'channel/10004/last/?category=']), + ('A-Z',['/vvvvid/ondemand/anime/', 'movies', 'channel/10003/last/?filter=']) ] film = ['/vvvvid/ondemand/film/', - ('Popolari',['/vvvvid/ondemand/film/', 'peliculas', 'channel/10002/last/']), - ('Nuove Uscite',['/vvvvid/ondemand/film/', 'peliculas', 'channel/10007/last/']), - ('Generi',['/vvvvid/ondemand/film/', 'peliculas', 'channel/10004/last/?category=']), - ('A-Z',['/vvvvid/ondemand/film/', 'peliculas', 'channel/10003/last/?filter=']), + ('Popolari',['/vvvvid/ondemand/film/', 'movies', 'channel/10002/last/']), + ('Nuove Uscite',['/vvvvid/ondemand/film/', 'movies', 'channel/10007/last/']), + ('Generi',['/vvvvid/ondemand/film/', 'movies', 'channel/10004/last/?category=']), + ('A-Z',['/vvvvid/ondemand/film/', 'movies', 'channel/10003/last/?filter=']), ] tvshow = ['/vvvvid/ondemand/series/', - ('Popolari',['/vvvvid/ondemand/series/', 'peliculas', 'channel/10002/last/']), - ('Nuove Uscite',['/vvvvid/ondemand/series/', 'peliculas', 'channel/10007/last/']), - ('Generi',['/vvvvid/ondemand/series/', 'peliculas', 'channel/10004/last/?category=']), - ('A-Z',['/vvvvid/ondemand/series/', 'peliculas', 'channel/10003/last/?filter=']) + ('Popolari',['/vvvvid/ondemand/series/', 'movies', 'channel/10002/last/']), + ('Nuove Uscite',['/vvvvid/ondemand/series/', 'movies', 'channel/10007/last/']), + ('Generi',['/vvvvid/ondemand/series/', 'movies', 'channel/10004/last/?category=']), + ('A-Z',['/vvvvid/ondemand/series/', 'movies', 'channel/10003/last/?filter=']) ] - show = [('Show {bold} {tv}',['/vvvvid/ondemand/show/', 'peliculas', '', 'tvshow']), - ('Popolari {submenu} {tv}',['/vvvvid/ondemand/show/', 'peliculas', 'channel/10002/last/', 'tvshow']), - ('Nuove Uscite {submenu} {tv}',['/vvvvid/ondemand/show/', 'peliculas', 'channel/10007/last/', 'tvshow']), - ('Generi {submenu} {tv}',['/vvvvid/ondemand/show/', 'peliculas', 'channel/10004/last/?category=', 'tvshow']), - ('A-Z {submenu} {tv}',['/vvvvid/ondemand/show/', 'peliculas', 'channel/10003/last/?filter=', 'tvshow']), + show = [('Show {bold} {tv}',['/vvvvid/ondemand/show/', 'movies', '', 'tvshow']), + ('Popolari {submenu} {tv}',['/vvvvid/ondemand/show/', 'movies', 'channel/10002/last/', 'tvshow']), + ('Nuove Uscite {submenu} {tv}',['/vvvvid/ondemand/show/', 'movies', 'channel/10007/last/', 'tvshow']), + ('Generi {submenu} {tv}',['/vvvvid/ondemand/show/', 'movies', 'channel/10004/last/?category=', 'tvshow']), + ('A-Z {submenu} {tv}',['/vvvvid/ondemand/show/', 'movies', 'channel/10003/last/?filter=', 'tvshow']), ('Cerca Show... {bold submenu} {tv}', ['/vvvvid/ondemand/show/', 'search', '', 'tvshow']) ] - kids = [('Kids {bold}',['/vvvvid/ondemand/kids/', 'peliculas', '', 'tvshow']), - ('Popolari {submenu} {kids}',['/vvvvid/ondemand/kids/', 'peliculas', 'channel/10002/last/', 'tvshow']), - ('Nuove Uscite {submenu} {kids}',['/vvvvid/ondemand/kids/', 'peliculas', 'channel/10007/last/', 'tvshow']), - ('Generi {submenu} {kids}',['/vvvvid/ondemand/kids/', 'peliculas', 'channel/10004/last/?category=', 'tvshow']), - ('A-Z {submenu} {kids}',['/vvvvid/ondemand/kids/', 'peliculas', 'channel/10003/last/?filter=', 'tvshow']), + kids = [('Kids {bold}',['/vvvvid/ondemand/kids/', 'movies', '', 'tvshow']), + ('Popolari {submenu} {kids}',['/vvvvid/ondemand/kids/', 'movies', 'channel/10002/last/', 'tvshow']), + ('Nuove Uscite {submenu} {kids}',['/vvvvid/ondemand/kids/', 'movies', 'channel/10007/last/', 'tvshow']), + ('Generi {submenu} {kids}',['/vvvvid/ondemand/kids/', 'movies', 'channel/10004/last/?category=', 'tvshow']), + ('A-Z {submenu} {kids}',['/vvvvid/ondemand/kids/', 'movies', 'channel/10003/last/?filter=', 'tvshow']), ('Cerca Kids... {bold submenu} {kids}', ['/vvvvid/ondemand/kids/', 'search', '', 'tvshow']) ] else: @@ -75,7 +75,7 @@ def search(item, text): else: item.contentType = 'tvshow' item.search = text try: - itemlist = peliculas(item) + itemlist = movies(item) except: import sys for line in sys.exc_info(): @@ -84,22 +84,22 @@ def search(item, text): return itemlist -def newest(categoria): +def newest(category): item = support.Item() item.args = 'channel/10007/last/' - if categoria == 'peliculas': + if category == 'movie': item.contentType = 'movie' item.url = main_host + 'film/' - if categoria == 'series': + if category == 'tvshow': item.contentType = 'tvshow' item.url = main_host + 'series/' - if categoria == 'anime': + if category == 'anime': item.contentType = 'tvshow' item.url = main_host + 'anime/' - return peliculas(item) + return movies(item) -def peliculas(item): +def movies(item): itemlist = [] # logger.dbg() @@ -107,7 +107,7 @@ def peliculas(item): json_file =loadjs(item.url + 'channel/10005/last/') logger.debug(json_file) make_itemlist(itemlist, item, json_file) - itemlist = support.pagination(itemlist, item, 'peliculas') + itemlist = support.pagination(itemlist, item, 'movies') if item.contentType != 'movie': autorenumber.start(itemlist) tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) @@ -124,7 +124,7 @@ def peliculas(item): itemlist.append( item.clone(title = support.typo(key.upper() if Filter == 'filter' else key['name'], 'bold'), url = item.url + item.args + (key if Filter == 'filter' else str(key['id'])), - action = 'peliculas', + action = 'movies', args = 'filters')) else: @@ -138,7 +138,7 @@ def peliculas(item): return itemlist -def episodios(item): +def episodes(item): itemlist = [] if item.episodes: episodes = item.episodes @@ -230,7 +230,7 @@ def make_itemlist(itemlist, item, data): fulltitle= title, show= title, url= main_host + str(key['show_id']) + '/seasons/', - action= 'findvideos' if item.contentType == 'movie' else 'episodios', + action= 'findvideos' if item.contentType == 'movie' else 'episodes', contentType = item.contentType, contentSerieName= fulltitle if item.contentType != 'movie' else '', contentTitle= fulltitle if item.contentType == 'movie' else '', diff --git a/channelselector.py b/channelselector.py index 20a98b82..a5d07961 100644 --- a/channelselector.py +++ b/channelselector.py @@ -190,7 +190,7 @@ def filterchannels(category, view="thumb_"): if category in ['movie', 'tvshow']: ch_list = [] titles = [config.get_localized_string(70028), config.get_localized_string(30985), config.get_localized_string(70559), config.get_localized_string(60264), config.get_localized_string(70560)] - ids = ['popular', 'top_rated', 'now_playing', 'on_air'] + ids = ['popular', 'top_rated', 'now_playing', 'on_the_air'] for x in range(0,3): if x == 2 and category != 'movie': title=titles[x+1] + '{tv}' @@ -199,11 +199,11 @@ def filterchannels(category, view="thumb_"): title=titles[x] + '{movie}' id = ids[x] ch_list.insert(x, - Item(channel='search', action='discover_list', title=title, search_type='list', + Item(channel='classicsearch', action='discover_list', title=title, search_type='list', list_type='%s/%s' % (category.replace('show',''), id), mode=category)) - ch_list.insert(3, Item(channel='search', action='genres_menu', title=config.get_localized_string(30987) + '{' + category.replace('show','') + '}', + ch_list.insert(3, Item(channel='classicsearch', action='genres_menu', title=config.get_localized_string(30987) + '{' + category.replace('show','') + '}', type=category.replace('show',''), mode=category)) channelslist = thumb(ch_list) + channelslist diff --git a/core/channeltools.py b/core/channeltools.py index 5a14350d..79b35e78 100644 --- a/core/channeltools.py +++ b/core/channeltools.py @@ -37,8 +37,7 @@ def get_channel_parameters(channel_name): channel_parameters["update_url"] = channel_parameters.get("update_url", DEFAULT_UPDATE_URL) channel_parameters["language"] = channel_parameters.get("language", ["all"]) channel_parameters["active"] = channel_parameters.get("active", False) - channel_parameters["include_in_global_search"] = channel_parameters.get("include_in_global_search", - False) + channel_parameters["include_in_global_search"] = channel_parameters.get("include_in_global_search", False) channel_parameters["categories"] = channel_parameters.get("categories", list()) channel_parameters["thumbnail"] = channel_parameters.get("thumbnail", "") @@ -186,18 +185,17 @@ def get_default_settings(channel_name): # Apply default configurations if they do not exist for control in copy.deepcopy(default_controls): if control['id'] not in str(channel_controls): - if 'include_in_newest' in control['id'] and 'include_in_newest' not in not_active and control[ - 'id'] not in not_active: + if 'include_in_newest' in control['id'] and 'include_in_newest' not in not_active and control['id'] not in not_active: label = control['id'].split('_') label = label[-1] - if label == 'peliculas': + if label == 'movies': if 'movie' in categories: control['label'] = config.get_localized_string(70727) + ' - ' + config.get_localized_string( 30122) - control['default'] = False if ('include_in_newest' in default_off) or ( ' include_in_newest_peliculas' in default_off) else True + control['default'] = False if ('include_in_newest' in default_off) or ( ' include_in_newest_movie' in default_off) else True channel_controls.append(control) else: pass - elif label == 'series': + elif label == 'tvshows': if 'tvshow' in categories: control['label'] = config.get_localized_string(70727) + ' - ' + config.get_localized_string( 30123) control['default'] = False if ('include_in_newest' in default_off) or ( 'include_in_newest_series' in default_off) else True diff --git a/core/scrapertools.py b/core/scrapertools.py index 1d5b5f2e..e47455e7 100644 --- a/core/scrapertools.py +++ b/core/scrapertools.py @@ -429,7 +429,7 @@ def get_season_and_episode(title): "Temp 3 episodio 2.avi" -> '3x02' "Alcantara season 13 episodie 12.avi" -> '13x12' "Temp1 capitulo 14" -> '1x14' - "Temporada 1: El origen Episodio 9" -> '' (entre el numero de temporada y los episodios no puede haber otro texto) + "Temporada 1: El origen Episodio 9" -> '' (entre el numero de temporada y los episodes no puede haber otro texto) "Episodio 25: titulo episodio" -> '' (no existe el numero de temporada) "Serie X Temporada 1" -> '' (no existe el numero del episodio) @type title: str diff --git a/core/support.py b/core/support.py index e951267b..6b9ffb82 100755 --- a/core/support.py +++ b/core/support.py @@ -232,7 +232,7 @@ class scrape: if self.numerationEnabled and not stackCheck('find_episodes'): from platformcode import autorenumber - if self.function == 'episodios': + if self.function == 'episodes': autorenumber.start(self.itemlist, item) for i in self.itemlist: @@ -245,13 +245,13 @@ class scrape: if not stackCheck(['add_tvshow', 'get_episodes', 'update', 'find_episodes']): if len(self.seasons) > 1 and self.seasonPagination: self.itemlist = season_pagination(self.itemlist, item, self.seasons, self.function) - elif self.pagination or (self.function in ['episodios'] and self.seasonPagination): + elif self.pagination or (self.function in ['episodes'] and self.seasonPagination): self.itemlist = pagination(self.itemlist, item, self.function) if self.tmdbEnabled and ( self.action != 'play' and 'patronMenu' not in self.args and 'patronGenreMenu' not in self.args - and not stackCheck('add_tvshow') and (self.function not in ['episodios', 'mainlist'] - or (self.function in ['episodios'] and config.get_setting('episode_info')))): + and not stackCheck(['add_tvshow', 'get_newest']) and (self.function not in ['episodes', 'mainlist'] + or (self.function in ['episodes'] and config.get_setting('episode_info')))): tmdb.set_infoLabels_itemlist(self.itemlist, seekTmdb=True) @@ -259,7 +259,7 @@ class scrape: if self.videlibraryEnabled and (item.infoLabels["title"] or item.fulltitle): # item.fulltitle = item.infoLabels["title"] videolibrary(self.itemlist, item, function=self.function) - if self.downloadEnabled and self.function == 'episodios' or self.function == 'findvideos': + if self.downloadEnabled and self.function == 'episodes' or self.function == 'findvideos': download(self.itemlist, item, function=self.function) if 'patronGenreMenu' in self.args and self.itemlist: @@ -340,7 +340,7 @@ class scrape: if item.infoLabels["title"]: infolabels = item.infoLabels else: - if self.function == 'episodios': + if self.function == 'episodes': infolabels = item.infoLabels else: infolabels = {'mediatype':item.contentType} @@ -468,14 +468,14 @@ class scrape: if self.itemParams.infoLabels.get('season'): it.contentSeason = self.itemParams.infoLabels.get('season') if self.itemParams.infoLabels.get('episode'): it.contentEpisodeNumber = self.itemParams.infoLabels.get('episode') if self.itemParams._url: it.url = self.itemParams._url - if self.function == 'episodios': it.fulltitle = it.show = self.itemParams._title + if self.function == 'episodes': it.fulltitle = it.show = self.itemParams._title if self.itemParams._quality: it.quality = self.itemParams._quality if self.itemParams._language: it.contentLanguage = self.itemParams._language if item.prevthumb: it.thumbnail = item.prevthumb elif self.itemParams._thumb: it.thumbnail = self.itemParams._thumb - it.contentType = 'episode' if self.function == 'episodios' else CT if CT else item.contentType - if it.contentType not in ['movie'] and self.function != 'episodios' or it.contentType in ['undefined']: it.contentSerieName = self.itemParams._title - if self.function == 'peliculas': it.contentTitle= self.itemParams._title + it.contentType = 'episode' if self.function == 'episodes' else CT if CT else item.contentType + if it.contentType not in ['movie'] and self.function != 'episodes' or it.contentType in ['undefined']: it.contentSerieName = self.itemParams._title + if self.function == 'movies': it.contentTitle= self.itemParams._title if self.itemParams._title2: it.title2 = self.itemParams._title2 if self.itemParams._episode and self.group and not item.grouped: @@ -636,7 +636,7 @@ def menu(func): menuItem(itemlist, channel, title = sub + '{italic bold}', url = host + var[0] if len(var) > 0 else '', - action = var[1] if len(var) > 1 else 'peliculas', + action = var[1] if len(var) > 1 else 'movies', args=var[2] if len(var) > 2 else '', contentType= var[3] if len(var) > 3 else 'movie') @@ -649,7 +649,7 @@ def menu(func): if not global_search: menuItem(itemlist, channel, - title + '{bullet bold}', 'peliculas', + title + '{bullet bold}', 'movies', host + url, contentType='movie' if name == 'film' else 'tvshow') @@ -661,7 +661,7 @@ def menu(func): menuItem(itemlist, channel, title = sub + '{submenu} {' + title + '}', url = host + var[0] if len(var) > 0 else '', - action = var[1] if len(var) > 1 else 'peliculas', + action = var[1] if len(var) > 1 else 'movies', args=var[2] if len(var) > 2 else '', contentType= var[3] if len(var) > 3 else 'movie' if name == 'film' else 'tvshow') # add search menu for category @@ -679,7 +679,7 @@ def menu(func): menuItem(itemlist, channel, title = sub, url = host + var[0] if len(var) > 0 else '', - action = var[1] if len(var) > 1 else 'peliculas', + action = var[1] if len(var) > 1 else 'movies', args=var[2] if len(var) > 2 else '', contentType= var[3] if len(var) > 3 else 'movie',) @@ -841,7 +841,7 @@ def nextPage(itemlist, item, function_or_level=1, **kwargs): total_pages = integer, the number of total pages ''' logger.debug() - if stackCheck('channel_search'): + if stackCheck(['channel_search', 'get_newest']): return itemlist # get optional args @@ -901,7 +901,7 @@ def nextPage(itemlist, item, function_or_level=1, **kwargs): def pagination(itemlist, item, function_level=1): - if stackCheck(['channel_search', 'update_videolibrary']): + if stackCheck(['channel_search', 'update_videolibrary', 'get_newest']) and function_level != 'news': return itemlist if not item.page: @@ -1127,8 +1127,8 @@ def videolibrary(itemlist, item, typography='', function_level=1, function=''): contentType = 'tvshow' function = function if function else inspect.stack()[function_level][3] - # go up until find findvideos/episodios - while function not in ['findvideos', 'episodios']: + # go up until find findvideos/episodes + while function not in ['findvideos', 'episodes']: function_level += 1 try: function = inspect.stack()[function_level][3] @@ -1142,7 +1142,7 @@ def videolibrary(itemlist, item, typography='', function_level=1, function=''): contentTitle=item.contentTitle if item.contentTitle else item.fulltitle if item.contentType == 'movie' else '' if (function == 'findvideos' and contentType == 'movie') \ - or (function == 'episodios' and contentType != 'movie'): + or (function == 'episodes' and contentType != 'movie'): if config.get_videolibrary_support() and len(itemlist) > 0: itemlist.append( item.clone(channel=item.channel, @@ -1177,7 +1177,7 @@ def download(itemlist, item, typography='', function_level=1, function=''): if item.channel == 'community' and config.get_setting('show_seasons', item.channel): from_action = 'season' else: - from_action = 'episodios' + from_action = 'episodes' title = typo(config.get_localized_string(60355), typography) elif item.contentType in 'season': from_action = 'get_seasons' @@ -1216,7 +1216,7 @@ def download(itemlist, item, typography='', function_level=1, function=''): thumbnail=thumb('download'), downloadItemlist=downloadItemlist )) - if from_action == 'episodios': + if from_action == 'episodes': itemlist.append( Item(channel='downloads', from_channel=item.channel, @@ -1734,7 +1734,7 @@ def search(channel, item, texto): logger.debug(item.url + " search " + texto) item.url = channel.host + "/?s=" + texto try: - return channel.peliculas(item) + return channel.movies(item) # Continua la ricerca in caso di errore except: import sys @@ -1778,14 +1778,14 @@ def dooplay_get_links(item, host, paramList=[]): def dooplay_get_episodes(item): item.contentType = 'tvshow' patron = '<li class="mark-[0-9]+">.*?<img.*?(?:data-lazy-)?src="(?P<thumb>[^"]+).*?(?P<episode>[0-9]+ - [0-9]+).*?<a href="(?P<url>[^"]+)">(?P<title>[^<>]+).*?(?P<year>[0-9]{4})' - actLike = 'episodios' + actLike = 'episodes' return locals() @scrape -def dooplay_peliculas(item, mixed=False, blacklist=""): - actLike = 'peliculas' +def dooplay_movies(item, mixed=False, blacklist=""): + actLike = 'movies' # debug = True if item.args == 'searchPage': return dooplay_search_vars(item, blacklist) @@ -1794,13 +1794,13 @@ def dooplay_peliculas(item, mixed=False, blacklist=""): action = 'findvideos' patron = '<article id="post-[0-9]+" class="item movies">.*?<img src="(?!data)(?P<thumb>[^"]+)".*?(?:<span class="quality">(?P<quality>[^<>]+).*?)?<a href="(?P<url>[^"]+)">(?P<title>[^<>]+)</a></h3>.*?(?:<span>[^<>]*(?P<year>[0-9]{4})</span>|</article>)' else: - action = 'episodios' + action = 'episodes' patron = '<article id="post-[0-9]+" class="item (?P<type>' + ('\w+' if mixed else 'tvshows') + ')">.*?<img src="(?!data)(?P<thumb>[^"]+)".*?(?:<span class="quality">(?P<quality>[^<>]+))?.*?<a href="(?P<url>[^"]+)">(?P<title>[^<>]+)</a></h3>.*?(?:<span>(?P<year>[0-9]{4})</span>|</article>).*?(?:<div class="texto">(?P<plot>[^<>]+)|</article>).*?(?:genres">(?P<genre>.*?)</div>|</article>)' patronNext = '<div class="pagination">.*?class="current".*?<a href="([^"]+)".*?<div class="resppages">' videlibraryEnabled = False if mixed: - typeActionDict={'findvideos': ['movies'], 'episodios': ['tvshows']} + typeActionDict={'findvideos': ['movies'], 'episodes': ['tvshows']} typeContentDict={'film': ['movies'], 'serie': ['tvshows']} return locals() @@ -1814,14 +1814,14 @@ def dooplay_search(item, blacklist=""): def dooplay_search_vars(item, blacklist): if item.contentType == 'list': # ricerca globale type = '(?P<type>movies|tvshows)' - typeActionDict = {'findvideos': ['movies'], 'episodios': ['tvshows']} + typeActionDict = {'findvideos': ['movies'], 'episodes': ['tvshows']} typeContentDict = {'movie': ['movies'], 'tvshow': ['tvshows']} elif item.contentType == 'movie': type = 'movies' action = 'findvideos' else: type = 'tvshows' - action = 'episodios' + action = 'episodes' patron = '<div class="result-item">.*?<img src="(?P<thumb>[^"]+)".*?<span class="' + type + '">(?P<quality>[^<>]+).*?<a href="(?P<url>[^"]+)">(?P<title>[^<>]+)</a>.*?<span class="year">(?P<year>[0-9]{4}).*?<div class="contenido"><p>(?P<plot>[^<>]+)' patronNext = '<a class="arrow_pag" href="([^"]+)"><i id="nextpagination"' @@ -1831,7 +1831,7 @@ def dooplay_search_vars(item, blacklist): def dooplay_menu(item, type): patronMenu = '<a href="(?P<url>[^"#]+)"(?: title="[^"]+")?>(?P<title>[a-zA-Z0-9]+)' patronBlock = '<nav class="' + item.args + '">(?P<block>.*?)</nav>' - action = 'peliculas' + action = 'movies' return locals() @@ -1884,6 +1884,7 @@ def itemlistdb(itemlist=None): def stackCheck(values): stacks = [s[3] for s in inspect.stack()] + logger.debug('STAKS', stacks) if type(values) == str: return values in stacks else: diff --git a/core/tmdb.py b/core/tmdb.py index dd27ce38..9725af5e 100644 --- a/core/tmdb.py +++ b/core/tmdb.py @@ -616,8 +616,8 @@ def discovery(item, dict_=False, cast=False): elif item.search_type == 'list': if item.page == '': - item.page = '1' - listado = Tmdb(discover={'url': item.list_type, 'language':def_lang, 'page':item.page}) + item.page = 1 + listado = Tmdb(discover={'url': item.list_type, 'language':def_lang, 'page':str(item.page)}) return listado diff --git a/core/videolibrarytools.py b/core/videolibrarytools.py index 56fdc26d..7ed6120e 100644 --- a/core/videolibrarytools.py +++ b/core/videolibrarytools.py @@ -1189,7 +1189,7 @@ def convert_videolibrary(): channel = platformtools.channel_import(ch) it.host = channel.host it.url = channel.host + it.url - episodes = getattr(channel, 'episodios')(it) + episodes = getattr(channel, 'episodes')(it) for ep in episodes: logger.debug('EPISODE URL', ep.url) it.no_reload = True diff --git a/default_channel_settings.json b/default_channel_settings.json index 86c79405..40c868b3 100644 --- a/default_channel_settings.json +++ b/default_channel_settings.json @@ -9,7 +9,7 @@ "visible": true }, { - "id": "include_in_newest_peliculas", + "id": "include_in_newest_movie", "type": "bool", "label": "@70727", "default": true, @@ -17,7 +17,7 @@ "visible": true }, { - "id": "include_in_newest_series", + "id": "include_in_newest_tvshow", "type": "bool", "label": "@70727", "default": true, diff --git a/lib/generictools.py b/lib/generictools.py index a22b39df..0abc56b6 100644 --- a/lib/generictools.py +++ b/lib/generictools.py @@ -36,7 +36,7 @@ def update_title(item): # Allow the updating of titles, either for immediate use, or to add to the video library item.from_action = item.action # Save action item.from_title = item.title # Save Title - itemlist.append(item.clone(title="** [COLOR limegreen]Update Titles - video library preview[/COLOR] **", action="actualizar_titulos", extra="episodios", tmdb_stat=False)) + itemlist.append(item.clone(title="** [COLOR limegreen]Update Titles - video library preview[/COLOR] **", action="actualizar_titulos", extra="episodes", tmdb_stat=False)) The channel must add a method to be able to receive the call from Kodi / Alfa, and be able to call this method: @@ -390,7 +390,7 @@ def post_tmdb_listado(item, itemlist): title = '%sx%s al 99 -' % (str(item_local.contentSeason), str(item_local.contentEpisodeNumber)) if " al " in title: # If they are multiple episodes, we put a series name if " al 99" in title.lower(): # Full season. We are looking for total number of episodes - title = title.replace("99", str(item_local.infoLabels['temporada_num_episodios'])) + title = title.replace("99", str(item_local.infoLabels['temporada_num_episodes'])) title = '%s %s' % (title, item_local.contentSerieName) item_local.infoLabels['episodio_titulo'] = '%s - %s [%s] [%s]' % (scrapertools.find_single_match(title, r'(al \d+)'), item_local.contentSerieName, item_local.infoLabels['year'], rating) @@ -601,8 +601,8 @@ def post_tmdb_seasons(item, itemlist): #if rating and rating > 0.0: # item_local.title += ' [%s]' % str(rating) - if item_local.infoLabels['temporada_num_episodios']: # No. of Temp Episodes - item_local.title += ' [%s epi]' % str(item_local.infoLabels['temporada_num_episodios']) + if item_local.infoLabels['temporada_num_episodes']: # No. of Temp Episodes + item_local.title += ' [%s epi]' % str(item_local.infoLabels['temporada_num_episodes']) if not config.get_setting("unify"): # If Smart Titles NOT selected: item_local.title = '%s [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR]' % (item_local.title, item_local.quality, str(item_local.language)) @@ -624,7 +624,7 @@ def post_tmdb_seasons(item, itemlist): title = '' if item.infoLabels['status'] and item.infoLabels['status'].lower() == "ended": title += ' [TERMINADA]' - itemlist_temporadas.append(item_season.clone(title="[COLOR yellow]Añadir esta serie a videoteca-[/COLOR]" + title, action="add_serie_to_library", extra="episodios", add_menu=True)) + itemlist_temporadas.append(item_season.clone(title="[COLOR yellow]Añadir esta serie a videoteca-[/COLOR]" + title, action="add_serie_to_library", extra="episodes", add_menu=True)) # If judicial intervention, I warn !!! if item.intervencion: @@ -644,7 +644,7 @@ def post_tmdb_seasons(item, itemlist): return (item, itemlist_temporadas) -def post_tmdb_episodios(item, itemlist): +def post_tmdb_episodes(item, itemlist): logger.debug() itemlist_fo = [] @@ -674,12 +674,12 @@ def post_tmdb_episodios(item, itemlist): modo_ultima_temp = config.get_setting('seleccionar_ult_temporadda_activa', item.channel) # Initiates variables to control the number of episodes per season - num_episodios = 1 - num_episodios_lista = [] - for i in range(0, 50): num_episodios_lista += [0] + num_episodes = 1 + num_episodes_lista = [] + for i in range(0, 50): num_episodes_lista += [0] num_temporada = 1 num_temporada_max = 99 - num_episodios_flag = True + num_episodes_flag = True # We restore the Season number to make the choice of Video Library more flexible contentSeason = item.contentSeason @@ -805,14 +805,14 @@ def post_tmdb_episodios(item, itemlist): if item_local.infoLabels['number_of_seasons']: # If the season num is out of control, it gets 0, and itemlist is reclassified if item_local.contentSeason > item_local.infoLabels['number_of_seasons'] + 1: - logger.error("ERROR 07: EPISODES: Season number out of range " + " / SEASON: " + str(item_local.contentSeason) + " / " + str(item_local.contentEpisodeNumber) + " / MAX_SEASONS: " + str(item_local.infoLabels['number_of_seasons']) + " / SEASON_LIST: " + str(num_episodios_lista)) + logger.error("ERROR 07: EPISODES: Season number out of range " + " / SEASON: " + str(item_local.contentSeason) + " / " + str(item_local.contentEpisodeNumber) + " / MAX_SEASONS: " + str(item_local.infoLabels['number_of_seasons']) + " / SEASON_LIST: " + str(num_episodes_lista)) item_local.contentSeason = 0 itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) else: num_temporada_max = item_local.infoLabels['number_of_seasons'] else: if item_local.contentSeason > num_temporada_max + 1: - logger.error("ERROR 07: EPISODES: Season number out of range " + " / SEASON: " + str(item_local.contentSeason) + " / " + str(item_local.contentEpisodeNumber) + " / MAX_SEASONS: " + str(num_temporada_max) + " / SEASON_LIST: " + str(num_episodios_lista)) + logger.error("ERROR 07: EPISODES: Season number out of range " + " / SEASON: " + str(item_local.contentSeason) + " / " + str(item_local.contentEpisodeNumber) + " / MAX_SEASONS: " + str(num_temporada_max) + " / SEASON_LIST: " + str(num_episodes_lista)) item_local.contentSeason = 0 itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) @@ -820,11 +820,11 @@ def post_tmdb_episodios(item, itemlist): try: if num_temporada != item_local.contentSeason: num_temporada = item_local.contentSeason - num_episodios = 0 - if item_local.infoLabels['temporada_num_episodios'] and int(item_local.infoLabels['temporada_num_episodios']) > int(num_episodios): - num_episodios = item_local.infoLabels['temporada_num_episodios'] + num_episodes = 0 + if item_local.infoLabels['temporada_num_episodes'] and int(item_local.infoLabels['temporada_num_episodes']) > int(num_episodes): + num_episodes = item_local.infoLabels['temporada_num_episodes'] except: - num_episodios = 0 + num_episodes = 0 logger.error(traceback.format_exc()) # We prepare the video Rating @@ -861,7 +861,7 @@ def post_tmdb_episodios(item, itemlist): item_local.title = '%sx%s al 99 -' % (str(item_local.contentSeason), str(item_local.contentEpisodeNumber)) if " al " in item_local.title: # If they are multiple episodes, we put a series name if " al 99" in item_local.title.lower(): # Full season. We are looking for the total number of episodes of the season - item_local.title = item_local.title.replace("99", str(num_episodios)) + item_local.title = item_local.title.replace("99", str(num_episodes)) item_local.title = '%s %s' % (item_local.title, item_local.contentSerieName) item_local.infoLabels['episodio_titulo'] = '%s - %s [%s] [%s]' % (scrapertools.find_single_match(item_local.title, r'(al \d+)'), item_local.contentSerieName, item_local.infoLabels['year'], rating) @@ -887,20 +887,20 @@ def post_tmdb_episodios(item, itemlist): item_local.title = item_local.title.replace(".", ",").replace("GB", "G B").replace("Gb", "G b").replace("gb", "g b").replace("MB", "M B").replace("Mb", "M b").replace("mb", "m b") # If the information of num. total episodes of TMDB is not correct, we try to calculate it - if num_episodios < item_local.contentEpisodeNumber: - num_episodios = item_local.contentEpisodeNumber - if num_episodios > item_local.contentEpisodeNumber: - item_local.infoLabels['temporada_num_episodios'] = num_episodios - num_episodios_flag = False - if num_episodios and not item_local.infoLabels['temporada_num_episodios']: - item_local.infoLabels['temporada_num_episodios'] = num_episodios - num_episodios_flag = False + if num_episodes < item_local.contentEpisodeNumber: + num_episodes = item_local.contentEpisodeNumber + if num_episodes > item_local.contentEpisodeNumber: + item_local.infoLabels['temporada_num_episodes'] = num_episodes + num_episodes_flag = False + if num_episodes and not item_local.infoLabels['temporada_num_episodes']: + item_local.infoLabels['temporada_num_episodes'] = num_episodes + num_episodes_flag = False try: - num_episodios_lista[item_local.contentSeason] = num_episodios + num_episodes_lista[item_local.contentSeason] = num_episodes except: logger.error(traceback.format_exc()) - #logger.debug("title: " + item_local.title + " / url: " + item_local.url + " / calidad: " + item_local.quality + " / Season: " + str(item_local.contentSeason) + " / EpisodeNumber: " + str(item_local.contentEpisodeNumber) + " / num_episodios_lista: " + str(num_episodios_lista) + str(num_episodios_flag)) + #logger.debug("title: " + item_local.title + " / url: " + item_local.url + " / calidad: " + item_local.quality + " / Season: " + str(item_local.contentSeason) + " / EpisodeNumber: " + str(item_local.contentEpisodeNumber) + " / num_episodes_lista: " + str(num_episodes_lista) + str(num_episodes_flag)) #logger.debug(item_local) # If you are updating video library of a NewPct1 series, we restore the channel with the name of the clone @@ -910,11 +910,11 @@ def post_tmdb_episodios(item, itemlist): # After reviewing each episode, we close with the footer # First we update all episodes with their maximum number of episodes per season try: - if not num_episodios_flag: # If the number of episodes is not reported, we update episodes of the entire series + if not num_episodes_flag: # If the number of episodes is not reported, we update episodes of the entire series for item_local in itemlist: - item_local.infoLabels['temporada_num_episodios'] = int(num_episodios_lista[item_local.contentSeason]) + item_local.infoLabels['temporada_num_episodes'] = int(num_episodes_lista[item_local.contentSeason]) except: - logger.error("ERROR 07: EPISODES: Season number out of range" + " / SEASON: " + str(item_local.contentSeason) + " / " + str(item_local.contentEpisodeNumber) + " / MAX_SEASONS: " + str(num_temporada_max) + " / SEASON_LIST: " + str(num_episodios_lista)) + logger.error("ERROR 07: EPISODES: Season number out of range" + " / SEASON: " + str(item_local.contentSeason) + " / " + str(item_local.contentEpisodeNumber) + " / MAX_SEASONS: " + str(num_temporada_max) + " / SEASON_LIST: " + str(num_episodes_lista)) logger.error(traceback.format_exc()) # We allow the updating of titles, either for immediate use, or to add to the video library @@ -931,8 +931,8 @@ def post_tmdb_episodios(item, itemlist): item_local = itemlist[-2] title = '' - if item_local.infoLabels['temporada_num_episodios']: - title += ' [Temp. de %s ep.]' % item_local.infoLabels['temporada_num_episodios'] + if item_local.infoLabels['temporada_num_episodes']: + title += ' [Temp. de %s ep.]' % item_local.infoLabels['temporada_num_episodes'] if item_local.infoLabels['status'] and item_local.infoLabels['status'].lower() == "ended": title += ' [TERMINADA]' @@ -968,7 +968,7 @@ def post_tmdb_episodios(item, itemlist): itemlist.append(item.clone(title="[COLOR yellow]Aadd this Temp. to Video Library-[/COLOR]" + title, action="add_serie_to_library", contentType="season", contentSeason=contentSeason, add_menu=True)) else: # It is a standard channel, just a line of Add to Video Library - itemlist.append(item.clone(title="[COLOR yellow]Add this series to video library-[/COLOR]" + title, action="add_serie_to_library", extra="episodios", add_menu=True)) + itemlist.append(item.clone(title="[COLOR yellow]Add this series to video library-[/COLOR]" + title, action="add_serie_to_library", extra="episodes", add_menu=True)) # If judicial intervention, I warn !!! if item.intervencion: @@ -1035,9 +1035,9 @@ def post_tmdb_findvideos(item, itemlist): del item.library_filter_show # We save the information of max num. of episodes per season after TMDB - num_episodios = item.contentEpisodeNumber - if item.infoLabels['temporada_num_episodios'] and item.contentEpisodeNumber <= item.infoLabels['temporada_num_episodios']: - num_episodios = item.infoLabels['temporada_num_episodios'] + num_episodes = item.contentEpisodeNumber + if item.infoLabels['temporada_num_episodes'] and item.contentEpisodeNumber <= item.infoLabels['temporada_num_episodes']: + num_episodes = item.infoLabels['temporada_num_episodes'] # Get updated video information. In a second TMDB reading it gives more information than in the first #if not item.infoLabels['tmdb_id'] or (not item.infoLabels['episodio_titulo'] and item.contentType == 'episode'): @@ -1050,11 +1050,11 @@ def post_tmdb_findvideos(item, itemlist): logger.error(traceback.format_exc()) # We restore the information of max num. of episodes per season after TMDB try: - if item.infoLabels['temporada_num_episodios']: - if int(num_episodios) > int(item.infoLabels['temporada_num_episodios']): - item.infoLabels['temporada_num_episodios'] = num_episodios + if item.infoLabels['temporada_num_episodes']: + if int(num_episodes) > int(item.infoLabels['temporada_num_episodes']): + item.infoLabels['temporada_num_episodes'] = num_episodes else: - item.infoLabels['temporada_num_episodios'] = num_episodios + item.infoLabels['temporada_num_episodes'] = num_episodes except: logger.error(traceback.format_exc()) @@ -1143,8 +1143,8 @@ def post_tmdb_findvideos(item, itemlist): title_gen = '' if item.contentType == "episode": # Series title = '%sx%s' % (str(item.contentSeason), str(item.contentEpisodeNumber).zfill(2)) # Season and Episode - if item.infoLabels['temporada_num_episodios']: - title = '%s (de %s)' % (title, str(item.infoLabels['temporada_num_episodios'])) # Total Episodes + if item.infoLabels['temporada_num_episodes']: + title = '%s (de %s)' % (title, str(item.infoLabels['temporada_num_episodes'])) # Total Episodes # If they are multiple episodes, and it comes from Video Library, we put series name if (" al " in item.title or " Al " in item.title) and not "al " in item.infoLabels['episodio_titulo']: @@ -1201,10 +1201,10 @@ def post_tmdb_findvideos(item, itemlist): # we added the option to Add to Video Library for movies (no series) if (item.contentType == 'movie' or item.contentType == 'season') and item.contentChannel != "videolibrary": # We allow the updating of titles, either for immediate use, or to add to the video library - itemlist.append(item.clone(title="** [COLOR yelow]Actualizar Títulos - vista previa videoteca[/COLOR] **", action="actualizar_titulos", extra="peliculas", tmdb_stat=False, from_action=item.action, from_title_tmdb=item.title, from_update=True)) + itemlist.append(item.clone(title="** [COLOR yelow]Actualizar Títulos - vista previa videoteca[/COLOR] **", action="actualizar_titulos", extra="movies", tmdb_stat=False, from_action=item.action, from_title_tmdb=item.title, from_update=True)) if item.contentType == 'movie' and item.contentChannel != "videolibrary": - itemlist.append(item.clone(title="**-[COLOR yellow] Añadir a la videoteca [/COLOR]-**", action="add_movie_to_library", extra="peliculas", from_action=item.action, from_title_tmdb=item.title)) + itemlist.append(item.clone(title="**-[COLOR yellow] Añadir a la videoteca [/COLOR]-**", action="add_movie_to_library", extra="movies", from_action=item.action, from_title_tmdb=item.title)) # We added the option to watch trailers if item.contentChannel != "videolibrary": @@ -1371,7 +1371,7 @@ def fail_over_newpct1(item, patron, patron2=None, timeout=None): if patron == True and active == '1': # we have only been asked to verify the clone return (item, data) # we leave, with the same clone, if it is active - if (item.action == 'episodios' or item.action == "update_tvshow" or item.action == "get_seasons" or item.action == 'findvideos') and item.contentType not in contentType: # supports fail_over of this content? + if (item.action == 'episodes' or item.action == "update_tvshow" or item.action == "get_seasons" or item.action == 'findvideos') and item.contentType not in contentType: # supports fail_over of this content? logger.error("ERROR 99: " + item.action.upper() + ": Unsupported Action for Channel Fail-Over: " + item.url) return (item, data) # does not support fail_over of this content, we can not do anything break @@ -1386,7 +1386,7 @@ def fail_over_newpct1(item, patron, patron2=None, timeout=None): data_alt = '' if channel == channel_failed or active == '0' or item.action in action_excluded or item.extra2 in action_excluded: # is the new channel valid? continue - if (item.action == 'episodios' or item.action == "update_tvshow" or item.action == "get_seasons" or item.action == 'findvideos') and item.contentType not in contentType: # does it support content? + if (item.action == 'episodes' or item.action == "update_tvshow" or item.action == "get_seasons" or item.action == 'findvideos') and item.contentType not in contentType: # does it support content? continue # We make the channel and url name change, keeping the previous ones as ALT @@ -1405,7 +1405,7 @@ def fail_over_newpct1(item, patron, patron2=None, timeout=None): # logger.debug(str(url_alt)) # We remove the series code, because it can vary between websites - if item.action == "episodios" or item.action == "get_seasons" or item.action == "update_tvshow": + if item.action == "episodes" or item.action == "get_seasons" or item.action == "update_tvshow": item.url = re.sub(r'\/\d+\/?$', '', item.url) # it seems that with the title only finds the series, usually ... url_alt = [item.url] # we save the url for the loop, but for now we ignore the initial with serial code @@ -1446,7 +1446,7 @@ def fail_over_newpct1(item, patron, patron2=None, timeout=None): # We have managed to read the web, we validate if we find a valid link in this structure # Avoid misleading pages that can put the channel in an infinite loop - if (not ".com/images/no_imagen.jpg" in data and not ".com/images/imagen-no-disponible.jpg" in data) or item.action != "episodios": + if (not ".com/images/no_imagen.jpg" in data and not ".com/images/imagen-no-disponible.jpg" in data) or item.action != "episodes": if patron: data_alt = scrapertools.find_single_match(data, patron) if not data_alt: diff --git a/lib/sqlitedict.py b/lib/sqlitedict.py index 3d0082c5..2e0db32b 100644 --- a/lib/sqlitedict.py +++ b/lib/sqlitedict.py @@ -38,6 +38,9 @@ from threading import Thread __version__ = '1.7.0.dev0' +import xbmc +kodi_monitor = xbmc.Monitor() + major_version = sys.version_info[0] if major_version < 3: # py <= 2.x if sys.version_info[1] < 5: # py <= 2.4 @@ -172,6 +175,7 @@ class SqliteDict(DictClass): self.encode = encode self.decode = decode self.timeout = timeout + self.cache = {} logger.info("opening Sqlite table %r in %r" % (tablename, filename)) self.conn = self._new_conn() @@ -234,7 +238,9 @@ class SqliteDict(DictClass): def iteritems(self): GET_ITEMS = 'SELECT key, value FROM "%s" ORDER BY rowid' % self.tablename for key, value in self.conn.select(GET_ITEMS): - yield key, self.decode(value) + ret = key, self.decode(value) + self.cache[key] = ret[1] + yield ret def keys(self): return self.iterkeys() if major_version > 2 else list(self.iterkeys()) @@ -250,11 +256,15 @@ class SqliteDict(DictClass): return self.conn.select_one(HAS_ITEM, (key,)) is not None def __getitem__(self, key): + if key in self.cache.keys(): + return self.cache[key] GET_ITEM = 'SELECT value FROM "%s" WHERE key = ?' % self.tablename item = self.conn.select_one(GET_ITEM, (key,)) if item is None: raise KeyError(key) - return self.decode(item[0]) + ret = self.decode(item[0]) + self.cache[key] = ret + return ret def __setitem__(self, key, value): if self.flag == 'r': @@ -264,6 +274,7 @@ class SqliteDict(DictClass): self.conn.execute(ADD_ITEM, (key, self.encode(value))) if self.autocommit: self.commit() + self.cache[key] = value def __delitem__(self, key): if self.flag == 'r': @@ -275,6 +286,7 @@ class SqliteDict(DictClass): self.conn.execute(DEL_ITEM, (key,)) if self.autocommit: self.commit() + del self.cache[key] def update(self, items=(), **kwds): if self.flag == 'r': @@ -292,6 +304,7 @@ class SqliteDict(DictClass): self.update(kwds) if self.autocommit: self.commit() + self.cache.update(items) def __iter__(self): return self.iterkeys() @@ -305,6 +318,7 @@ class SqliteDict(DictClass): self.conn.commit() self.conn.execute(CLEAR_ALL) self.conn.commit() + self.cache = {} @staticmethod def get_tablenames(filename): @@ -403,6 +417,7 @@ class SqliteMultithread(Thread): self.log = logging.getLogger('sqlitedict.SqliteMultithread') self.start() + def run(self): try: if self.autocommit: @@ -428,7 +443,7 @@ class SqliteMultithread(Thread): self._sqlitedict_thread_initialized = True res = None - while True: + while not kodi_monitor.abortRequested(): req, arg, res, outer_stack = self.reqs.get() if req == '--close--': assert res, ('--close-- without return queue', res) diff --git a/platformcode/envtal.py b/platformcode/envtal.py index a436d0bb..62dd4b57 100644 --- a/platformcode/envtal.py +++ b/platformcode/envtal.py @@ -143,7 +143,7 @@ def get_environment(): try: environment['videolab_series'] = '?' - environment['videolab_episodios'] = '?' + environment['videolab_episodes'] = '?' environment['videolab_pelis'] = '?' environment['videolab_path'] = str(xbmc.translatePath(config.get_videolibrary_path())) if filetools.exists(filetools.join(environment['videolab_path'], config.get_setting("folder_tvshows"))): @@ -152,7 +152,7 @@ def get_environment(): for root, folders, files in filetools.walk(filetools.join(environment['videolab_path'], config.get_setting("folder_tvshows"))): for file in files: if file.endswith('.strm'): counter += 1 - environment['videolab_episodios'] = str(counter) + environment['videolab_episodes'] = str(counter) if filetools.exists(filetools.join(environment['videolab_path'], config.get_setting("folder_movies"))): environment['videolab_pelis'] = str(len(filetools.listdir(filetools.join(environment['videolab_path'], config.get_setting("folder_movies"))))) except: @@ -321,7 +321,7 @@ def get_environment(): environment['kodi_bmode'] = '' environment['kodi_rfactor'] = '' environment['videolab_series'] = '' - environment['videolab_episodios'] = '' + environment['videolab_episodes'] = '' environment['videolab_pelis'] = '' environment['videolab_update'] = '' environment['debug'] = '' @@ -366,7 +366,7 @@ def list_env(environment={}): environment['userdata_free'].replace('.', ',') + ' GB') logger.info('Videolibrary: Series/Episodes: ' + environment['videolab_series'] + '/' + - environment['videolab_episodios'] + ' - Pelis: ' + + environment['videolab_episodes'] + ' - Pelis: ' + environment['videolab_pelis'] + ' - Upd: ' + environment['videolab_update'] + ' - Path: ' + environment['videolab_path'] + ' - Free: ' + @@ -520,7 +520,7 @@ def paint_env(item, environment={}): ' GB', action="", plot=userdata, thumbnail=thumb, folder=False)) itemlist.append(Item(channel=item.channel, title='Video store: Series/Epis: ' + - environment['videolab_series'] + '/' + environment['videolab_episodios'] + + environment['videolab_series'] + '/' + environment['videolab_episodes'] + ' - Movie: ' + environment['videolab_pelis'] + ' - Upd: ' + environment['videolab_update'] + ' - Path: ' + environment['videolab_path'] + ' - Free: ' + environment[ 'videolab_free'].replace('.', ',') + ' GB', action="", plot=videoteca, thumbnail=thumb, folder=False)) diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index 5fbcac42..42b25770 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -461,10 +461,10 @@ def render_items(itemlist, parent_item): breadcrumb = config.get_localized_string(70693) xbmcplugin.setPluginCategory(handle=_handle, category=breadcrumb) - set_view_mode(itemlist[0], parent_item) - xbmcplugin.endOfDirectory(_handle) + xbmcplugin.endOfDirectory(_handle, succeeded=True, updateListing=False, cacheToDisc=False) + logger.debug('END render_items') @@ -489,10 +489,10 @@ def viewmodeMonitor(): if currentModeName and 'plugin.video.kod' in xbmc.getInfoLabel('Container.FolderPath') and currentMode < 1000 and currentMode >= 50: # inside addon and in itemlist view content, Type = getCurrentView() if content: - defaultMode = int(config.get_setting('view_mode_%s' % content).split(',')[-1]) + defaultMode = int(config.get_setting('view_mode_{}'.format(content)).split(',')[-1]) if currentMode != defaultMode: logger.debug('viewmode changed: ' + currentModeName + '-' + str(currentMode) + ' - content: ' + content) - config.set_setting('view_mode_%s' % content, currentModeName + ', ' + str(currentMode)) + config.set_setting('view_mode_{}'.format(content), currentModeName + ', ' + str(currentMode)) dialog_notification(config.get_localized_string(70153), config.get_localized_string(70187) % (content, currentModeName), sound=False) @@ -512,8 +512,8 @@ def getCurrentView(item=None, parent_item=None): if not info: return None, None item = Item().fromurl(info) if info else Item() - parent_actions = ['peliculas', 'novedades', 'search', 'get_from_temp', 'newest', 'discover_list', 'new_search', 'channel_search'] - + parent_actions = ['movies', 'news', 'search', 'get_from_temp', 'newest', 'discover_list', 'new_search', 'channel_search'] + logger.debug('PARENT:',parent_item.action) if parent_item.action == 'findvideos' or (parent_item.action in ['channel_search', 'new_search'] and parent_item.infoLabels['tmdb_id']): return 'server', 'addons' if config.get_setting('touch_view') else '' @@ -533,32 +533,38 @@ def getCurrentView(item=None, parent_item=None): elif parent_item.action in ['get_seasons'] or item.contentType == 'season': return 'season', 'tvshows' - elif parent_item.action in ['episodios', 'get_episodes'] or item.contentType == 'episode': + elif parent_item.action in ['episodes', 'get_episodes'] or item.contentType == 'episode': return 'episode', 'episodes' + elif not parent_item.action or parent_item.action in ['getmainlist']: + return 'home', 'addons' if config.get_setting('touch_view') else '' + + elif parent_item.action in ['filterchannels']: + return 'channels', 'addons' if config.get_setting('touch_view') else '' + else: return 'menu', 'addons' if config.get_setting('touch_view') else '' def set_view_mode(item, parent_item): def reset_view_mode(): - for mode in ['menu','channel','movie','tvshow','season','episode','server']: + for mode in ['menu','channel','channels','home', 'movie','tvshow','season','episode','server']: config.set_setting('skin_name', xbmc.getSkinDir()) - config.set_setting('view_mode_%s' % mode, config.get_localized_string(70003) + ' , 0') + config.set_setting('view_mode_{}'.format(mode), config.get_localized_string(70003) + ' , 0') if xbmc.getSkinDir() != config.get_setting('skin_name') or not config.get_setting('skin_name'): reset_view_mode() xbmcplugin.setContent(handle=int(sys.argv[1]), content='') - xbmc.executebuiltin('Container.SetViewMode(%s)' % 55) + xbmc.executebuiltin('Container.SetViewMode({})'.format(55)) content, Type = getCurrentView(item, parent_item) if content: - mode = int(config.get_setting('view_mode_%s' % content).split(',')[-1]) + mode = int(config.get_setting('view_mode_{}'.format(content)).split(',')[-1]) if mode == 0: logger.debug('default mode') mode = 55 xbmcplugin.setContent(handle=int(sys.argv[1]), content=Type) - xbmc.executebuiltin('Container.SetViewMode(%s)' % mode) + xbmc.executebuiltin('Container.SetViewMode({})'.format(mode)) logger.debug('TYPE: ' + Type + ' - ' + 'CONTENT: ' + content) diff --git a/platformcode/unify.py b/platformcode/unify.py index ec90ffd3..2c4a35b5 100644 --- a/platformcode/unify.py +++ b/platformcode/unify.py @@ -15,7 +15,7 @@ from platformcode import config, logger from core.item import Item from core import scrapertools -thumb_dict = {"movies": "https://s10.postimg.cc/fxtqzdog9/peliculas.png", +thumb_dict = {"movies": "https://s10.postimg.cc/fxtqzdog9/movies.png", "tvshows": "https://s10.postimg.cc/kxvslawe1/series.png", "on air": "https://i.postimg.cc/HLLJWMcr/en-emision.png", "all": "https://s10.postimg.cc/h1igpgw0p/todas.png", @@ -131,7 +131,7 @@ def set_genre(string): 'thriller': ['thriller', 'thrillers'], 'western': ['western', 'westerns', 'oeste western'] } - string = re.sub(r'peliculas de |pelicula de la |peli |cine ', '', string) + string = re.sub(r'movies de |pelicula de la |peli |cine ', '', string) for genre, variants in list(genres_dict.items()): if string in variants: string = genre diff --git a/platformcode/xbmc_videolibrary.py b/platformcode/xbmc_videolibrary.py index b535a567..8eeb83e8 100644 --- a/platformcode/xbmc_videolibrary.py +++ b/platformcode/xbmc_videolibrary.py @@ -196,19 +196,19 @@ def sync_trakt_addon(path_folder): serie.library_playcounts[k] = dict_trakt_show.get(k, 0) for season in seasons: - episodios_temporada = 0 - episodios_vistos_temporada = 0 + episodes_temporada = 0 + episodes_vistos_temporada = 0 # we obtain the keys of the episodes of a certain season keys_season_episodes = [key for key in keys_episodes if key.startswith("%sx" % season)] for k in keys_season_episodes: - episodios_temporada += 1 + episodes_temporada += 1 if serie.library_playcounts[k] > 0: - episodios_vistos_temporada += 1 + episodes_vistos_temporada += 1 # it is verified that if all the episodes are watched, the season is marked as watched - if episodios_temporada == episodios_vistos_temporada: + if episodes_temporada == episodes_vistos_temporada: serie.library_playcounts.update({"season %s" % season: 1}) temporada = 0 diff --git a/resources/settings.xml b/resources/settings.xml index 76f1cec4..be5bbfbb 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -122,11 +122,11 @@ <!-- News --> <category label="60327"> <setting label="60525" type="lsep"/> - <setting id="news_films" type="action" label="60509" action="RunPlugin(plugin://plugin.video.kod/?ew0KICAgICJhY3Rpb24iOiJzZXR0aW5nX2NoYW5uZWwiLA0KICAgICJjaGFubmVsIjoibmV3cyIsDQoJImV4dHJhIjoicGVsaWN1bGFzIg0KfQ==)"/> - <setting id="news_series" type="action" label="60511" action="RunPlugin(plugin://plugin.video.kod/?ew0KICAgICJhY3Rpb24iOiJzZXR0aW5nX2NoYW5uZWwiLA0KICAgICJjaGFubmVsIjoibmV3cyIsDQoJImV4dHJhIjoic2VyaWVzIg0KfQ==)"/> - <setting id="news_anime" type="action" label="60512" action="RunPlugin(plugin://plugin.video.kod/?ew0KICAgICJhY3Rpb24iOiJzZXR0aW5nX2NoYW5uZWwiLA0KICAgICJjaGFubmVsIjoibmV3cyIsDQoJImV4dHJhIjoiYW5pbWUiDQp9)"/> - <setting id="news_documentaries" type="action" label="60513" action="RunPlugin(plugin://plugin.video.kod/?ew0KICAgICJhY3Rpb24iOiJzZXR0aW5nX2NoYW5uZWwiLA0KICAgICJjaGFubmVsIjoibmV3cyIsDQoJImV4dHJhIjoiZG9jdW1lbnRhbGVzIg0KfQ==)"/> - <setting id="news_options" type="action" label="60415" action="RunPlugin(plugin://plugin.video.kod/?ew0KICAgICJhY3Rpb24iOiJzZXR0aW5ncyIsDQogICAgImNoYW5uZWwiOiJuZXdzIg0KfQ==)"/> + <setting id="news_films" type="action" label="60509" action="RunPlugin(plugin://plugin.video.kod/?action=setting_channel&channel=news&extra=movie)"/> + <setting id="news_series" type="action" label="60511" action="RunPlugin(plugin://plugin.video.kod/?action=setting_channel&channel=news&extra=tvshow)"/> + <setting id="news_anime" type="action" label="60512" action="RunPlugin(plugin://plugin.video.kod/?action=setting_channel&channel=news&extra=anime)"/> + <setting id="news_documentaries" type="action" label="60513" action="RunPlugin(plugin://plugin.video.kod/?action=setting_channel&channel=news&extra=documentary)"/> + <setting id="news_options" type="action" label="60415" action="RunPlugin(plugin://plugin.video.kod/?action=settings&channel=news)"/> </category> <!-- Customization --> @@ -146,6 +146,8 @@ <setting id="skin_name" label='Skin Name' type="text" default="skin.estuary" visible="false"/> <setting id="view_mode_menu" type="action" label="70009" default= "Default, 0" visible="false"/> <setting id="view_mode_channel" type="action" label="30118" default= "Default, 0" visible="false"/> + <setting id="view_mode_channels" type="action" label="30118" default= "Default, 0" visible="false"/> + <setting id="view_mode_home" type="action" label="30118" default= "Default, 0" visible="false"/> <setting id="view_mode_movie" type="action" label="30122" default= "Default, 0" visible="false"/> <setting id="view_mode_tvshow" type="action" label="30123" default= "Default, 0" visible="false"/> <setting id="view_mode_season" type="action" label="30140" default= "Default, 0" visible="false"/> diff --git a/servers/directo.json b/servers/directo.json index 185c7952..81d4cf59 100644 --- a/servers/directo.json +++ b/servers/directo.json @@ -37,7 +37,7 @@ "url": "http://mangaid.com\\1" }, { - "pattern": "so\\.addVariable\\(\\’file\\’,\\’(http\\://peliculasid[^\\']+)", + "pattern": "so\\.addVariable\\(\\’file\\’,\\’(http\\://moviesid[^\\']+)", "url": "\\1" } ] diff --git a/specials/classicsearch.py b/specials/classicsearch.py index 9e4c86e1..fb47e9a8 100644 --- a/specials/classicsearch.py +++ b/specials/classicsearch.py @@ -381,7 +381,7 @@ def genres_menu(item): discovery = {'url': 'discover/%s' % mode, 'with_genres': key, 'language': def_lang, 'page': '1'} - itemlist.append(Item(channel=item.channel, title=typo(value, 'bold'), page=1, + itemlist.append(Item(channel=item.channel, title=value, page=1, action='discover_list', discovery=discovery, mode=item.mode)) from core import support @@ -410,7 +410,7 @@ def years_menu(item): '%s' % par_year: '%s' % year, 'sort_by': 'popularity.desc', 'language': def_lang} - itemlist.append(Item(channel=item.channel, title=typo(str(year), 'bold'), action='discover_list', + itemlist.append(Item(channel=item.channel, title=str(year), action='discover_list', discovery=discovery, mode=item.mode, year_=str(year), thumbnail=thumb)) itemlist.reverse() itemlist.append(Item(channel=item.channel, title=typo(config.get_localized_string(70745),'color kod bold'), url='', @@ -467,7 +467,7 @@ def actor_list(item): plot = '%s in %s' % (rol, t_k) thumbnail = 'https://image.tmdb.org/t/p/original%s' % elem.get('profile_path', '') - title = typo(name,'bold')+typo(rol,'_ [] color kod bold') + title = name + typo(rol,'_ [] color kod') discovery = {'url': 'person/%s/combined_credits' % cast_id, 'page': '1', 'sort_by': 'primary_release_date.desc', 'language': def_lang} @@ -475,9 +475,9 @@ def actor_list(item): itemlist.append(Item(channel=item.channel, title=title, action='discover_list', cast_='cast', discovery=discovery, thumbnail=thumbnail, plot=plot, page=1)) - if len(results) > 19: + if len(results) >= config.get_setting('pagination', default=20): next_ = item.page + 1 - itemlist.append(Item(channel=item.channel, title=typo(config.get_localized_string(30992),'bold color kod'), action='actor_list', + itemlist.append(Item(channel=item.channel, title=typo(config.get_localized_string(90006),'bold color kod'), action='actor_list', page=next_, thumbnail=thumbnail, searched_text=item.searched_text)) return itemlist @@ -488,8 +488,10 @@ def discover_list(item): itemlist = [] year = 0 + tmdb_inf = tmdb.discovery(item, dict_=item.discovery, cast=item.cast_) result = tmdb_inf.results + total_pages = tmdb_inf.total_pages tvshow = False for elem in result: @@ -511,13 +513,13 @@ def discover_list(item): if not item.cast_ or (item.cast_ and (int(year) <= int(datetime.datetime.today().year))): if config.get_setting('new_search'): - new_item = Item(channel='globalsearch', title=typo(title, 'bold'), infoLabels=elem, + new_item = Item(channel='globalsearch', title=title, infoLabels=elem, action='Search', text=title, thumbnail=thumbnail, fanart=fanart, context='', mode='search', type = mode, contentType=mode, release_date=year, folder = False) else: - new_item = Item(channel='search', title=typo(title, 'bold'), infoLabels=elem, + new_item = Item(channel='search', title=title, infoLabels=elem, action='channel_search', text=title, thumbnail=thumbnail, fanart=fanart, context='', mode=mode, contentType=mode, @@ -536,17 +538,12 @@ def discover_list(item): itemlist.sort(key=lambda it: int(it.release_date), reverse=True) return itemlist - elif len(result) > 19 and item.discovery: - item.discovery['page'] = str(int(item.discovery['page']) + 1) - itemlist.append(Item(channel=item.channel, action='discover_list', nextPage=True, - title=typo(config.get_localized_string(30992), 'color kod bold'), - list_type=item.list_type, discovery=item.discovery, thumbnail=thumb(), page=item.discovery['page'])) - elif len(result) > 19: - next_page = str(int(item.page) + 1) - - itemlist.append(Item(channel=item.channel, action='discover_list', nextPage=True, - title=typo(config.get_localized_string(30992), 'color kod bold'), - list_type=item.list_type, search_type=item.search_type, mode=item.mode, page=next_page, thumbnail=thumb())) + elif config.get_setting('pagination', default=20): + if item.discovery: + page = item.discovery['page'] = int(item.discovery['page']) + 1 + else: + page = item.page + 1 + support.nextPage(itemlist, item, page=page, total_pages=total_pages) return itemlist diff --git a/specials/community.py b/specials/community.py index 26981336..02be7402 100644 --- a/specials/community.py +++ b/specials/community.py @@ -100,12 +100,12 @@ def show_menu(item): if item.filterkey and not item.filter: itemlist += submenu(item, json, key) elif key in ['movies_list', 'tvshows_list', 'generic_list']: - itemlist += peliculas(item, json, key) + itemlist += movies(item, json, key) elif key in ['seasons_list']: item.url = json itemlist += get_seasons(item) elif key in ['episodes_list']: - itemlist += episodios(item, json, key) + itemlist += episodes(item, json, key) elif key in ['links', 'find_links']: itemlist += findvideos(item) elif key in ['search'] and 'url' in json['search']: @@ -139,7 +139,7 @@ def search(item, text): if item.custom_search and key == 'menu': get_menu(item, json, key, itemlist) else: - peliculas(item, json, key, itemlist) + movies(item, json, key, itemlist) return itemlist @@ -166,7 +166,7 @@ def global_search(item, text): return itemlist -def peliculas(item, json='', key='', itemlist=[]): +def movies(item, json='', key='', itemlist=[]): item.plot = item.thumb = item.fanart = '' logger.debug('PAGINATION:', item.disable_pagination) if not json: @@ -200,7 +200,7 @@ def peliculas(item, json='', key='', itemlist=[]): title = option['title'] if 'title' in option else '' if 'tvshows_list' in key and 'links' not in option: - action = 'episodios' + action = 'episodes' # filter elements if (not item.filter or item.filter.lower() in filterkey) and item.search.lower() in title.lower() and title: @@ -269,7 +269,7 @@ def get_seasons(item): thumbnail=extra.thumb, filterseason=int(option['season']), url=extra.url, - action='episodios', + action='episodes', contentSeason=option['season'], infoLabels=infoLabels, contentType='season' if show_seasons else 'tvshow', @@ -279,7 +279,7 @@ def get_seasons(item): 'get_newest'] or show_seasons == False: itlist = [] for item in itemlist: - itlist = episodios(item) + itlist = episodes(item) itemlist = itlist if inspect.stack()[2][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes', 'get_newest'] and defp and not item.disable_pagination: @@ -291,7 +291,7 @@ def get_seasons(item): return itemlist -def episodios(item, json='', key='', itemlist=[]): +def episodes(item, json='', key='', itemlist=[]): logger.debug() infoLabels = item.infoLabels itm = item @@ -300,7 +300,7 @@ def episodios(item, json='', key='', itemlist=[]): if 'seasons_list' in item.url: return get_seasons(item) elif 'tvshows_list' in item.url: - return peliculas(item, item.url, 'tvshows_list') + return movies(item, item.url, 'tvshows_list') else: json = {} json = item.url['episodes_list'] @@ -312,7 +312,7 @@ def episodios(item, json='', key='', itemlist=[]): item.url = json['seasons_list'] return get_seasons(item) elif 'tvshows_list' in json: - return peliculas(item, json, 'tvshows_list') + return movies(item, json, 'tvshows_list') # set variable ep = 1 @@ -385,7 +385,7 @@ def episodios(item, json='', key='', itemlist=[]): show=itm.show, thumbnails=itm.thumbnails, url=itm.url, - action='episodios', + action='episodes', contentSeason=season, contentType='episode', infoLabels=infoLabels, @@ -652,7 +652,7 @@ def filter_thread(filter, key, item, description): title=support.typo(filter, 'bold'), url=item.url, media_type=item.media_type, - action='peliculas', + action='movies', thumbnail=thumbnail if thumbnail else item.thumbnail, fanart=fanart if fanart else item.fanart, plot=plot if plot else item.plot, diff --git a/specials/globalsearch.py b/specials/globalsearch.py index a02d4769..f20e75c1 100644 --- a/specials/globalsearch.py +++ b/specials/globalsearch.py @@ -674,7 +674,7 @@ class SearchWindow(xbmcgui.WindowXML): for e in self.episodes: if e.action in ['findvideos']: ep.append(self.makeItem(e)) - if e.nextSeason and e.action in ['episodios']: + if e.nextSeason and e.action in ['episodes']: self.nextAction = e.clone() isnext = True diff --git a/specials/news.py b/specials/news.py index 64a63f26..78bd463b 100644 --- a/specials/news.py +++ b/specials/news.py @@ -2,45 +2,19 @@ # ------------------------------------------------------------ # Channel for recent videos on several channels # ------------------------------------------------------------ - -#from builtins import str -import sys - -from core.support import typo - -PY3 = False -if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int - -import glob, os, re, time -from threading import Thread - -from channelselector import auto_filter -from core. support import thumb -from core import channeltools, jsontools, scrapertools, support -from core.item import Item +import sys, channelselector from platformcode import config, logger, platformtools +from channelselector import auto_filter +from core.item import Item +from core import support, filetools, channeltools, tmdb -THUMBNAILS = {'0': 'posters', '1': 'banners', '2': 'squares'} - -__perfil__ = config.get_setting('perfil', "news") - -# Set color profile -perfil = [['0xFF0B7B92', '0xFF89FDFB', '0xFFACD5D4'], - ['0xFFB31313', '0xFFFF9000', '0xFFFFEE82'], - ['0xFF891180', '0xFFCB22D7', '0xFFEEA1EB'], - ['0xFFA5DEE5', '0xFFE0F9B5', '0xFFFEFDCA'], - ['0xFFF23557', '0xFF22B2DA', '0xFFF0D43A']] - -color1, color2, color3 = ["red", "0xFF65B3DA", "yellow"] -# color1, color2, color3 = perfil[__perfil__] - -list_newest = [] -list_newest_tourl = [] -channels_id_name = {} - -menu_cache_path = os.path.join(config.get_data_path(), "settings_channels", 'menu_cache_data.json') -menu_settings_path = os.path.join(config.get_data_path(), "settings_channels", 'menu_settings_data.json') +if sys.version_info[0] >= 3: + from concurrent import futures +else: + from concurrent_py2 import futures +progress = None +mode = config.get_setting('result_mode', 'news') def mainlist(item): logger.debug() @@ -51,542 +25,172 @@ def mainlist(item): if channel_language == 'auto': channel_language = auto_filter() - #if list_canales['peliculas']: - # thumbnail = thumb("movie") - new_item = Item(channel=item.channel, action="novedades", extra="peliculas", title=config.get_localized_string(30122) + '{news}') + itemlist = [item.clone(action="news", extra="movie", title=config.get_localized_string(30122) + ' {news}'), + item.clone(action="news", extra="tvshow", title=config.get_localized_string(60511) + ' {news}'), + item.clone(action="news", extra="anime", title=config.get_localized_string(60512) + ' {news}')] - set_category_context(new_item) - itemlist.append(new_item) + set_category_context(itemlist) - # thumbnail = thumb("movie_4k") - # new_item = Item(channel=item.channel, action="novedades", extra="4k", title=config.get_localized_string(70208), thumbnail=thumbnail) - # - # set_category_context(new_item) - # itemlist.append(new_item) - - #if list_canales['terror']: - # thumbnail = thumb("channels_horror") - # new_item = Item(channel=item.channel, action="novedades", extra="terror", title=config.get_localized_string(70209), - # thumbnail=thumbnail) - # set_category_context(new_item) - # itemlist.append(new_item) - - #if list_canales['infantiles']: - # thumbnail = thumb("children") - # new_item = Item(channel=item.channel, action="novedades", extra="infantiles", title=config.get_localized_string(60510), - # thumbnail=thumbnail) - # set_category_context(new_item) - # itemlist.append(new_item) - - #if list_canales['series']: - new_item = Item(channel=item.channel, action="novedades", extra="series", title=config.get_localized_string(60511) + '{news}') - set_category_context(new_item) - itemlist.append(new_item) - - #if list_canales['anime']: - new_item = Item(channel=item.channel, action="novedades", extra="anime", title=config.get_localized_string(60512) + '{news}') - set_category_context(new_item) - itemlist.append(new_item) - - # if channel_language == "all": - # # if list_canales['Italiano']: - # thumbnail = thumb("italian") - # new_item = Item(channel=item.channel, action="novedades", extra="italiano", title=config.get_localized_string(70563), - # thumbnail=thumbnail) - # set_category_context(new_item) - # itemlist.append(new_item) - - # if list_canales['Torrent']: - # thumbnail = thumb("channels_torrent") - # new_item = Item(channel=item.channel, action="novedades", extra="torrent", title=config.get_localized_string(70171), thumbnail=thumbnail) - # set_category_context(new_item) - # itemlist.append(new_item) - - #if list_canales['documentales']: - # thumbnail = thumb("documentary") - # new_item = Item(channel=item.channel, action="novedades", extra="documentales", title=config.get_localized_string(60513), - # thumbnail=thumbnail) - # set_category_context(new_item) - # itemlist.append(new_item) itemlist.append(Item(channel='shortcuts', action="SettingOnPosition", category=7, setting=1, - title=typo(config.get_localized_string(70285), 'bold color kod'))) + title=support.typo(config.get_localized_string(70285), 'bold color kod'))) + support.thumb(itemlist) + set_category_context(itemlist) + return itemlist -def set_category_context(item): - item.context = [{"title": config.get_localized_string(60514) % item.title, - "extra": item.extra, - "action": "setting_channel", - "channel": item.channel}] - item.category = config.get_localized_string(60679) % re.sub('\[[^\]]+\]','',item.title).strip() +def set_category_context(itemlist): + for item in itemlist: + if item.extra: + item.context = [{"title": config.get_localized_string(60514) % item.title, + "extra": item.extra, + "action": "setting_channel", + "channel": item.channel}] + item.category = config.get_localized_string(60679) % item.title -def get_channels_list(): +def get_channels(category='all'): logger.debug() -## import web_pdb; web_pdb.set_trace() -## list_canales = {'peliculas': [], '4k': [], 'terror': [], 'infantiles': [], 'series': [], 'anime': [], -## 'castellano': [], 'latino':[], 'italiano':[], 'torrent':[], 'documentales': []} - list_canales = {'peliculas': [], 'series': [], 'anime': [], 'documentales': []} + # logger.dbg() + channels = [] - any_active = False - # Fill available channel lists - channels_path = os.path.join(config.get_runtime_path(), "channels", '*.json') - channel_language = config.get_setting("channel_language", default="all") - if channel_language =="auto": - channel_language = auto_filter() + all_channels = channelselector.filterchannels(category) - for infile in sorted(glob.glob(channels_path)): - channel_id = os.path.basename(infile)[:-5] - channel_parameters = channeltools.get_channel_parameters(channel_id) - - # Do not include if it is an inactive channel - if not channel_parameters["active"]: + for ch in all_channels: + channel = ch.channel + ch_param = channeltools.get_channel_parameters(channel) + if not ch_param.get("active", False): continue - # Do not include if the channel is in a filtered language - if channel_language != "all" and channel_language not in str(channel_parameters["language"]) \ - and "*" not in channel_parameters["language"]: + if not config.get_setting("include_in_newest_" + category, channel): continue - # Include in each category, if in your configuration the channel is activated to show news + channels.append([ch_param.get('title'), channel]) + return channels - for categoria in list_canales: - include_in_newest = config.get_setting("include_in_newest_" + categoria, channel_id) - if include_in_newest: - channels_id_name[channel_id] = channel_parameters["title"] - list_canales[categoria].append((channel_id, channel_parameters["title"])) - any_active = True - return list_canales, any_active +def news(item): -def set_cache(item): - logger.debug() - item.mode = 'set_cache' - t = Thread(target=novedades, args=[item]) - t.start() - #t.join() + if item.itemlist: + itemlist = support.itemlistdb() -def get_from_cache(item): - logger.debug() - itemlist=[] - cache_node = jsontools.get_node_from_file('menu_cache_data.json', 'cached') - first=item.last - last = first+40 - #if last >=len(cache_node[item.extra]): - # last = len(cache_node[item.extra]) - - for cached_item in cache_node[item.extra][first:last]: - new_item= Item() - new_item = new_item.fromurl(cached_item) - itemlist.append(new_item) - if item.mode == 'silent': - set_cache(item) - if last >= len(cache_node[item.extra]): - item.mode='finish' - itemlist = add_menu_items(item, itemlist) else: - item.mode='get_cached' - item.last =last - itemlist = add_menu_items(item, itemlist) + itemlist = [] + results = cache() + if not results: + + global progress + progress = platformtools.dialog_progress(item.category, config.get_localized_string(60519)) + channels = get_channels(item.extra) + + with futures.ThreadPoolExecutor() as executor: + itlist = [executor.submit(get_newest, i, channel, item.extra, len(channels)) for i, channel in enumerate(channels)] + for res in futures.as_completed(itlist): + if res.result(): + results.append(res.result()) + if progress: + progress.close() + + cache(results) + + if mode in [2]: + for res in results: + _name, _id, _list = res + for it in _list: + it.title += ' [{}]'.format(_name) + itemlist.extend(_list) + + elif mode in [1]: + for res in results: + plot = '' + items = [] + for it in res[2]: + plot += '\n{}'.format(it.title) + items.append(it.tourl()) + if items: + itemlist.append(Item(title='{} [{}]'.format(res[0], len(items)), + plot=plot, + channel='news', + action='movies', + thumbnail=channeltools.get_channel_parameters(res[1])["thumbnail"], + items=items)) + itemlist.sort(key=lambda it: it.title) + elif mode in [0]: + + items = {} + for res in results: + _name, _id, _list = res + for it in _list: + if it.fulltitle not in items: + items[it.fulltitle] = [] + + items[it.fulltitle].append(it.tourl()) + + itemlist = [Item(title='{} [{}]'.format(k, len(items)), infoLabels=Item().fromurl(v[0]).infoLabels, channel='news', action='movies', items = v) for k, v in items.items()] + + if mode in [0, 2]: + itemlist = support.pagination(itemlist, item, 'news') + tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) return itemlist -def add_menu_items(item, itemlist): - logger.debug() - menu_icon = thumb('menu') - menu = Item(channel="channelselector", action="getmainlist", viewmode="movie", thumbnail=menu_icon, title='Menu') - itemlist.insert(0, menu) - if item.mode != 'finish': - if item.mode == 'get_cached': - last=item.last - else: - last = len(itemlist) - refresh_icon = thumb('more') - refresh = item.clone(thumbnail=refresh_icon, mode='get_cached',title='Mas', last=last) - itemlist.insert(len(itemlist), refresh) +def get_newest(i, channel, category, total): + global progress + cat = {'movie':'movies', 'tvshow':'shows', 'anime':'anime'} + name = channel[0] + _id = channel[1] - return itemlist - -def novedades(item): - logger.debug() - - global list_newest - threads = [] + module = platformtools.channel_import(_id) + logger.debug('channel_id=', _id, 'category=', category) + if progress: progress.update(int(i + 1 / total), name) list_newest = [] - start_time = time.time() - - mode = item.mode - if mode == '': - mode = 'normal' - - if mode=='get_cached': - if os.path.exists(menu_cache_path): - return get_from_cache(item) - - multithread = config.get_setting("multithread", "news") - logger.debug("multithread= " + str(multithread)) - - if not multithread: - if platformtools.dialog_yesno(config.get_localized_string(60515), - config.get_localized_string(60516) + '\n' + - config.get_localized_string(60517) + '\n' + - config.get_localized_string(60518)): - if config.set_setting("multithread", True, "news"): - multithread = True - - if mode == 'normal': - progreso = platformtools.dialog_progress(item.category, config.get_localized_string(60519)) - - list_canales, any_active = get_channels_list() - - # if config.is_xbmc(): - # from platformcode import side_menu - # if mode=='silent' and any_active and len(list_canales[item.extra]) > 0: - # side_menu.set_menu_settings(item) - # aux_list=[] - # for canal in list_canales[item.extra]: - # if len(aux_list)<2: - # aux_list.append(canal) - # list_canales[item.extra]=aux_list - - if mode == 'set_cache': - list_canales[item.extra] = list_canales[item.extra][2:] - - if any_active and len(list_canales[item.extra])>0: - import math - # fix float because division is done poorly in python 2.x - number_of_channels = float(100) / len(list_canales[item.extra]) - - for index, channel in enumerate(list_canales[item.extra]): - channel_id, channel_title = channel - percentage = int(math.ceil((index + 1) * number_of_channels)) - - # if progreso.iscanceled(): - # progreso.close() - # logger.debug("Búsqueda cancelada") - # return itemlist - - # Modo Multi Thread - if multithread: - t = Thread(target=get_newest, args=[channel_id, item.extra], name=channel_title) - t.start() - threads.append(t) - if mode == 'normal': - progreso.update(percentage, config.get_localized_string(60520) % channel_title) - - # Modo single Thread - else: - if mode == 'normal': - logger.debug("Obteniendo novedades de channel_id=" + channel_id) - progreso.update(percentage, config.get_localized_string(60520) % channel_title) - get_newest(channel_id, item.extra) - - # Multi Thread mode: wait for all threads to finish - if multithread: - pendent = [a for a in threads if a.is_alive()] - t = float(100) / len(pendent) - while pendent: - index = (len(threads) - len(pendent)) + 1 - percentage = int(math.ceil(index * t)) - - list_pendent_names = [a.getName() for a in pendent] - if mode == 'normal': - mensaje = config.get_localized_string(30994) % (", ".join(list_pendent_names)) - progreso.update(percentage, config.get_localized_string(60521) % (len(threads) - len(pendent), len(threads)) + '\n' + - mensaje) - logger.debug(mensaje) - - if progreso.iscanceled(): - logger.debug("Busqueda de novedades cancelada") - break - - time.sleep(0.5) - pendent = [a for a in threads if a.is_alive()] - if mode == 'normal': - mensaje = config.get_localized_string(60522) % (len(list_newest), time.time() - start_time) - progreso.update(100, mensaje) - logger.debug(mensaje) - start_time = time.time() - # logger.debug(start_time) - - result_mode = config.get_setting("result_mode", "news") - if mode != 'normal': - result_mode=0 - - if result_mode == 0: # Grouped by content - ret = group_by_content(list_newest) - elif result_mode == 1: # Grouped by channels - ret = group_by_channel(list_newest) - else: # Ungrouped - ret = no_group(list_newest) - - while time.time() - start_time < 2: - # show progress chart with time spent for at least 2 seconds - time.sleep(0.5) - if mode == 'normal': - progreso.close() - if mode == 'silent': - set_cache(item) - item.mode = 'set_cache' - ret = add_menu_items(item, ret) - if mode != 'set_cache': - return ret - else: - if mode != 'set_cache': - no_channels = platformtools.dialog_ok(config.get_localized_string(30130) + ' - ' + item.extra + '\n' + config.get_localized_string(70661) + '\n' + config.get_localized_string(70662)) - return - - -def get_newest(channel_id, categoria): - logger.debug("channel_id=" + channel_id + ", categoria=" + categoria) - - global list_newest - global list_newest_tourl - - # We request the news of the category (item.extra) searched in the channel channel - # If there are no news for that category in the channel, it returns an empty list try: - modulo = platformtools.channel_import(channel_id) - if not modulo: - return + if not module: + return [] - logger.debug("running channel " + modulo.__name__ + " " + modulo.__file__) - list_result = modulo.newest(categoria) - logger.debug("canal= %s %d resultados" % (channel_id, len(list_result))) - exist=False - if os.path.exists(menu_cache_path): - cache_node = jsontools.get_node_from_file('menu_cache_data.json', 'cached') - exist=True - else: - cache_node = {} - # logger.debug('cache node: %s' % cache_node) - for item in list_result: - # logger.debug("item="+item.tostring()) - item.channel = channel_id - list_newest.append(item) - list_newest_tourl.append(item.tourl()) - - cache_node[categoria] = list_newest_tourl - - jsontools.update_node(cache_node, 'menu_cache_data.json', "cached") + list_newest = module.newest(category) + for item in list_newest: + item.channel = _id except: - logger.error("No se pueden recuperar novedades de: " + channel_id) + logger.error("No se pueden recuperar novedades de: " + name) import traceback logger.error(traceback.format_exc()) - -def get_title(item): - # logger.debug("ITEM NEWEST ->", item) - # item.contentSerieName c'è anche se è un film - if item.contentSerieName and item.contentType != 'movie': # Si es una serie - title = item.contentSerieName - # title = re.compile("\[.*?\]", re.DOTALL).sub("", item.contentSerieName) - if not scrapertools.get_season_and_episode(title) and item.contentEpisodeNumber: - # contentSeason non c'è in support - if item.contentSeason: - title = '{}x{:02d}. {}'.format(item.contentSeason, item.contentEpisodeNumber, title) - else: - title = '{:02d}. {}'.format(item.contentEpisodeNumber, title) - else: - seas = scrapertools.get_season_and_episode(item.title) - if seas: - title = "{}. {}".format(seas, title) - - elif item.contentTitle: # If it is a movie with the adapted channel - title = item.contentTitle - elif item.contentTitle: # If the channel is not adapted - title = item.contentTitle - else: # As a last resort - title = item.title - - # We clean the title of previous format labels - title = re.compile("\[/*COLO.*?\]", re.DOTALL).sub("", title) - title = re.compile("\[/*B\]", re.DOTALL).sub("", title) - title = re.compile("\[/*I\]", re.DOTALL).sub("", title) + return name, _id, list_newest - title = '[B]'+title+'[/B]' - - if item.contentLanguage == '': - pass - elif type(item.contentLanguage) == list and len(item.contentLanguage) ==1: - title += support.typo(item.contentLanguage[0], '_ [] color kod') - elif type(item.contentLanguage) != '': - title += support.typo(item.contentLanguage, '_ [] color kod') - elif type(item.contentLanguage) == list: - title += item.contentLanguage - - if item.quality: - title += support.typo(item.quality, '_ [] color kod') - - # season_ = support.typo(config.get_localized_string(70736), '_ [] color white bold') if (type(item.args) != bool and 'season_completed' in item.news and not item.episode) else '' - # if season_: - # title += season_ - return title - - -def no_group(list_result_canal): - itemlist = [] - global channels_id_name - - for i in list_result_canal: - # logger.debug("NO GROUP i -> ", i) - canale = channels_id_name[i.channel] - canale = canale # to differentiate it from the color of the other items - i.title = get_title(i) + " [" + canale + "]" -# i.text_color = color3 - - itemlist.append(i.clone()) - if config.get_setting('order','news') == 1: - itemlist = sorted(itemlist, key=lambda it: it.title.lower()) +def movies(item): + itemlist = [Item().fromurl(url=it) for it in item.items] + if mode == 1: tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) return itemlist -def group_by_channel(list_result_canal): - global channels_id_name - dict_canales = {} - itemlist = [] +def cache(results=None): + from core import db + from time import time + news = db['news'] - for i in list_result_canal: - if i.channel not in dict_canales: - dict_canales[i.channel] = [] - # Format title - i.title = get_title(i) - # We add the content to the list of each channel - dict_canales[i.channel].append(i) - - # We add the content found in the list_result list - for c in sorted(dict_canales): - channel_params = channeltools.get_channel_parameters(c) - itemlist.append(Item(channel="news", title=support.typo(channel_params['title'],'bullet bold color kod'), thumbnail=channel_params['thumbnail'])) - - for i in dict_canales[c]: - itemlist.append(i.clone()) - - return itemlist - - -def group_by_content(list_result_canal): - global channels_id_name - dict_contenidos = {} - list_result = [] - - for i in list_result_canal: - # Format title - i.title = get_title(i) - - # Remove tildes and other special characters for the key - import unicodedata - try: - new_key = i.title.lower().strip().decode("UTF-8") - new_key = ''.join((c for c in unicodedata.normalize('NFD', new_key) if unicodedata.category(c) != 'Mn')) - - except: - new_key = i.title - - if new_key in dict_contenidos: - #If the content was already in the dictionary add it to the list of options ... - dict_contenidos[new_key].append(i) - else: # ...but add it to the dictionary - dict_contenidos[new_key] = [i] - - # We add the content found in the list_result list - for v in list(dict_contenidos.values()): - title = v[0].title - if len(v) > 1: - # Remove duplicate q's from the channel names list - canales_no_duplicados = [] - for i in v: - if i.channel not in canales_no_duplicados: - canales_no_duplicados.append(channels_id_name[i.channel]) - - if len(canales_no_duplicados) > 1: - canales = ', '.join([i for i in canales_no_duplicados[:-1]]) - title += config.get_localized_string(70210) % (canales, canales_no_duplicados[-1]) - else: - title += config.get_localized_string(70211) % (', '.join([i for i in canales_no_duplicados])) - - new_item = v[0].clone(channel="news", title=title, action="show_channels", sub_list=[i.tourl() for i in v], extra=channels_id_name) - else: - new_item = v[0].clone(title=title) - - list_result.append(new_item) - - return sorted(list_result, key=lambda it: it.title.lower()) - - -def show_channels(item): - logger.debug() - global channels_id_name - channels_id_name = item.extra - itemlist = [] - - for i in item.sub_list: - new_item = Item() - new_item = new_item.fromurl(i) - # logger.debug(new_item.tostring()) -## if new_item.contentQuality: -## new_item.title += ' (%s)' % new_item.contentQuality -## if new_item.language: -## new_item.title += ' [%s]' % new_item.language -## new_item.title += ' (%s)' % channels_id_name[new_item.channel] - new_item.text_color = color1 - new_item.title += typo(new_item.channel, '[]') - - itemlist.append(new_item.clone()) - - return itemlist - - -def menu_opciones(item): - itemlist = list() - itemlist.append(Item(channel=item.channel, title=config.get_localized_string(60525), - text_bold = True, thumbnail=thumb("setting"), - folder=False)) - itemlist.append(Item(channel=item.channel, action="setting_channel", extra="peliculas", title=config.get_localized_string(60526), - thumbnail=thumb("movie"), - folder=False)) - # itemlist.append(Item(channel=item.channel, action="setting_channel", extra="4K", title=config.get_localized_string(70207), - # thumbnail=thumb("movie"), folder=False)) - # itemlist.append(Item(channel=item.channel, action="setting_channel", extra="infantiles", title=config.get_localized_string(60527), - # thumbnail=thumb("children"), - # folder=False)) - itemlist.append(Item(channel=item.channel, action="setting_channel", extra="series", - title=config.get_localized_string(60528), - thumbnail=thumb("tvshow"), - folder=False)) - itemlist.append(Item(channel=item.channel, action="setting_channel", extra="anime", - title=config.get_localized_string(60529), - thumbnail=thumb("anime"), - folder=False)) - # itemlist.append( - # Item(channel=item.channel, action="setting_channel", extra="castellano", title=config.get_localized_string(70212), - # thumbnail=thumb("documentary"), folder=False)) - - # itemlist.append(Item(channel=item.channel, action="setting_channel", extra="latino", title=config.get_localized_string(70213), - # thumbnail=thumb("documentary"), folder=False)) - - # itemlist.append(Item(channel=item.channel, action="setting_channel", extra="torrent", title=config.get_localized_string(70214), - # thumbnail=thumb("documentary"), folder=False)) - - itemlist.append(Item(channel=item.channel, action="setting_channel", extra="documentales", - title=config.get_localized_string(60530), - thumbnail=thumb("documentary"), - folder=False)) - itemlist.append(Item(channel=item.channel, action="settings", title=config.get_localized_string(60531), - thumbnail=thumb("setting"), - folder=False)) - return itemlist + if results != None: + news['time'] = time() + news['results'] = results + db['news'] = news + elif news.get('time', 0) + 60 < time() : + results = [] + else: + results = news.get('results', []) + db.close() + return results def settings(item): return platformtools.show_channel_settings(caption=config.get_localized_string(60532)) def setting_channel(item): + import os, glob channels_path = os.path.join(config.get_runtime_path(), "channels", '*.json') channel_language = config.get_setting("channel_language", default="auto") if channel_language == 'auto': @@ -595,7 +199,7 @@ def setting_channel(item): list_controls = [] for infile in sorted(glob.glob(channels_path)): - channel_id = os.path.basename(infile)[:-5] + channel_id = filetools.basename(infile)[:-5] channel_parameters = channeltools.get_channel_parameters(channel_id) # Do not include if it is an inactive channel @@ -603,13 +207,12 @@ def setting_channel(item): continue # Do not include if the channel is in a filtered language - if channel_language != "all" and channel_language not in str(channel_parameters["language"]) \ - and "*" not in channel_parameters["language"]: + if channel_language != "all" and channel_language not in str(channel_parameters["language"]) and "*" not in channel_parameters["language"]: continue # Do not include if the channel does not exist 'include_in_newest' in your configuration include_in_newest = config.get_setting("include_in_newest_" + item.extra, channel_id) - if include_in_newest is None: + if include_in_newest is None or item.extra not in channel_parameters['categories']: continue control = {'id': channel_id, @@ -637,6 +240,7 @@ def setting_channel(item): def save_settings(item, dict_values): + cache([]) for v in dict_values: config.set_setting("include_in_newest_" + item.extra, dict_values[v], v) diff --git a/specials/news.py.old.py b/specials/news.py.old.py new file mode 100644 index 00000000..8a144d82 --- /dev/null +++ b/specials/news.py.old.py @@ -0,0 +1,656 @@ +# -*- coding: utf-8 -*- +# ------------------------------------------------------------ +# Channel for recent videos on several channels +# ------------------------------------------------------------ + +#from builtins import str +import sys + +from core.support import typo + +PY3 = False +if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int + +import glob, os, re, time +from threading import Thread + +from channelselector import auto_filter +from core. support import thumb +from core import channeltools, jsontools, scrapertools, support +from core.item import Item +from platformcode import config, logger, platformtools + +THUMBNAILS = {'0': 'posters', '1': 'banners', '2': 'squares'} + +__perfil__ = config.get_setting('perfil', "news") + +# Set color profile +perfil = [['0xFF0B7B92', '0xFF89FDFB', '0xFFACD5D4'], + ['0xFFB31313', '0xFFFF9000', '0xFFFFEE82'], + ['0xFF891180', '0xFFCB22D7', '0xFFEEA1EB'], + ['0xFFA5DEE5', '0xFFE0F9B5', '0xFFFEFDCA'], + ['0xFFF23557', '0xFF22B2DA', '0xFFF0D43A']] + +color1, color2, color3 = ["red", "0xFF65B3DA", "yellow"] +# color1, color2, color3 = perfil[__perfil__] + +list_newest = [] +list_newest_tourl = [] +channels_id_name = {} + +menu_cache_path = os.path.join(config.get_data_path(), "settings_channels", 'menu_cache_data.json') +menu_settings_path = os.path.join(config.get_data_path(), "settings_channels", 'menu_settings_data.json') + + +def mainlist(item): + logger.debug() + + itemlist = [] + # list_canales, any_active = get_channels_list() + channel_language = config.get_setting("channel_language", default="auto") + if channel_language == 'auto': + channel_language = auto_filter() + + #if list_canales['movies']: + # thumbnail = thumb("movie") + new_item = Item(channel=item.channel, action="novedades", extra="movies", title=config.get_localized_string(30122) + '{news}') + + set_category_context(new_item) + itemlist.append(new_item) + + # thumbnail = thumb("movie_4k") + # new_item = Item(channel=item.channel, action="novedades", extra="4k", title=config.get_localized_string(70208), thumbnail=thumbnail) + # + # set_category_context(new_item) + # itemlist.append(new_item) + + #if list_canales['terror']: + # thumbnail = thumb("channels_horror") + # new_item = Item(channel=item.channel, action="novedades", extra="terror", title=config.get_localized_string(70209), + # thumbnail=thumbnail) + # set_category_context(new_item) + # itemlist.append(new_item) + + #if list_canales['infantiles']: + # thumbnail = thumb("children") + # new_item = Item(channel=item.channel, action="novedades", extra="infantiles", title=config.get_localized_string(60510), + # thumbnail=thumbnail) + # set_category_context(new_item) + # itemlist.append(new_item) + + #if list_canales['series']: + new_item = Item(channel=item.channel, action="novedades", extra="series", title=config.get_localized_string(60511) + '{news}') + set_category_context(new_item) + itemlist.append(new_item) + + #if list_canales['anime']: + new_item = Item(channel=item.channel, action="novedades", extra="anime", title=config.get_localized_string(60512) + '{news}') + set_category_context(new_item) + itemlist.append(new_item) + + # if channel_language == "all": + # # if list_canales['Italiano']: + # thumbnail = thumb("italian") + # new_item = Item(channel=item.channel, action="novedades", extra="italiano", title=config.get_localized_string(70563), + # thumbnail=thumbnail) + # set_category_context(new_item) + # itemlist.append(new_item) + + # if list_canales['Torrent']: + # thumbnail = thumb("channels_torrent") + # new_item = Item(channel=item.channel, action="novedades", extra="torrent", title=config.get_localized_string(70171), thumbnail=thumbnail) + # set_category_context(new_item) + # itemlist.append(new_item) + + #if list_canales['documentales']: + # thumbnail = thumb("documentary") + # new_item = Item(channel=item.channel, action="novedades", extra="documentales", title=config.get_localized_string(60513), + # thumbnail=thumbnail) + # set_category_context(new_item) + # itemlist.append(new_item) + itemlist.append(Item(channel='shortcuts', action="SettingOnPosition", category=7, setting=1, + title=typo(config.get_localized_string(70285), 'bold color kod'))) + support.thumb(itemlist) + return itemlist + + +def set_category_context(item): + item.context = [{"title": config.get_localized_string(60514) % item.title, + "extra": item.extra, + "action": "setting_channel", + "channel": item.channel}] + item.category = config.get_localized_string(60679) % re.sub('\[[^\]]+\]','',item.title).strip() + + +def get_channels_list(): + logger.debug() +## import web_pdb; web_pdb.set_trace() +## list_canales = {'movies': [], '4k': [], 'terror': [], 'infantiles': [], 'series': [], 'anime': [], +## 'castellano': [], 'latino':[], 'italiano':[], 'torrent':[], 'documentales': []} + list_canales = {'movies': [], 'series': [], 'anime': [], 'documentales': []} + + any_active = False + # Fill available channel lists + channels_path = os.path.join(config.get_runtime_path(), "channels", '*.json') + channel_language = config.get_setting("channel_language", default="all") + if channel_language =="auto": + channel_language = auto_filter() + + for infile in sorted(glob.glob(channels_path)): + channel_id = os.path.basename(infile)[:-5] + channel_parameters = channeltools.get_channel_parameters(channel_id) + + # Do not include if it is an inactive channel + if not channel_parameters["active"]: + continue + + # Do not include if the channel is in a filtered language + if channel_language != "all" and channel_language not in str(channel_parameters["language"]) \ + and "*" not in channel_parameters["language"]: + continue + + # Include in each category, if in your configuration the channel is activated to show news + + for categoria in list_canales: + include_in_newest = config.get_setting("include_in_newest_" + categoria, channel_id) + if include_in_newest: + channels_id_name[channel_id] = channel_parameters["title"] + list_canales[categoria].append((channel_id, channel_parameters["title"])) + any_active = True + + return list_canales, any_active + +def set_cache(item): + logger.debug() + item.mode = 'set_cache' + t = Thread(target=novedades, args=[item]) + t.start() + #t.join() + +def get_from_cache(item): + logger.debug() + itemlist=[] + cache_node = jsontools.get_node_from_file('menu_cache_data.json', 'cached') + first=item.last + last = first+40 + #if last >=len(cache_node[item.extra]): + # last = len(cache_node[item.extra]) + + for cached_item in cache_node[item.extra][first:last]: + new_item= Item() + new_item = new_item.fromurl(cached_item) + itemlist.append(new_item) + if item.mode == 'silent': + set_cache(item) + if last >= len(cache_node[item.extra]): + item.mode='finish' + itemlist = add_menu_items(item, itemlist) + else: + item.mode='get_cached' + item.last =last + itemlist = add_menu_items(item, itemlist) + + return itemlist + +def add_menu_items(item, itemlist): + logger.debug() + + menu_icon = thumb('menu') + menu = Item(channel="channelselector", action="getmainlist", viewmode="movie", thumbnail=menu_icon, title='Menu') + itemlist.insert(0, menu) + if item.mode != 'finish': + if item.mode == 'get_cached': + last=item.last + else: + last = len(itemlist) + refresh_icon = thumb('more') + refresh = item.clone(thumbnail=refresh_icon, mode='get_cached',title='Mas', last=last) + itemlist.insert(len(itemlist), refresh) + + return itemlist + +def novedades(item): + logger.debug() + + global list_newest + threads = [] + list_newest = [] + start_time = time.time() + + mode = item.mode + if mode == '': + mode = 'normal' + + if mode=='get_cached': + if os.path.exists(menu_cache_path): + return get_from_cache(item) + + multithread = config.get_setting("multithread", "news") + logger.debug("multithread= " + str(multithread)) + + if not multithread: + if platformtools.dialog_yesno(config.get_localized_string(60515), + config.get_localized_string(60516) + '\n' + + config.get_localized_string(60517) + '\n' + + config.get_localized_string(60518)): + if config.set_setting("multithread", True, "news"): + multithread = True + + if mode == 'normal': + progreso = platformtools.dialog_progress(item.category, config.get_localized_string(60519)) + + list_canales, any_active = get_channels_list() + + # if config.is_xbmc(): + # from platformcode import side_menu + # if mode=='silent' and any_active and len(list_canales[item.extra]) > 0: + # side_menu.set_menu_settings(item) + # aux_list=[] + # for canal in list_canales[item.extra]: + # if len(aux_list)<2: + # aux_list.append(canal) + # list_canales[item.extra]=aux_list + + if mode == 'set_cache': + list_canales[item.extra] = list_canales[item.extra][2:] + + if any_active and len(list_canales[item.extra])>0: + import math + # fix float because division is done poorly in python 2.x + number_of_channels = float(100) / len(list_canales[item.extra]) + + for index, channel in enumerate(list_canales[item.extra]): + channel_id, channel_title = channel + percentage = int(math.ceil((index + 1) * number_of_channels)) + + # if progreso.iscanceled(): + # progreso.close() + # logger.debug("Búsqueda cancelada") + # return itemlist + + # Modo Multi Thread + if multithread: + t = Thread(target=get_newest, args=[channel_id, item.extra], name=channel_title) + t.start() + threads.append(t) + if mode == 'normal': + progreso.update(percentage, config.get_localized_string(60520) % channel_title) + + # Modo single Thread + else: + if mode == 'normal': + logger.debug("Obteniendo novedades de channel_id=" + channel_id) + progreso.update(percentage, config.get_localized_string(60520) % channel_title) + get_newest(channel_id, item.extra) + + # Multi Thread mode: wait for all threads to finish + if multithread: + pendent = [a for a in threads if a.is_alive()] + t = float(100) / len(pendent) + while pendent: + index = (len(threads) - len(pendent)) + 1 + percentage = int(math.ceil(index * t)) + + list_pendent_names = [a.getName() for a in pendent] + if mode == 'normal': + mensaje = config.get_localized_string(30994) % (", ".join(list_pendent_names)) + progreso.update(percentage, config.get_localized_string(60521) % (len(threads) - len(pendent), len(threads)) + '\n' + + mensaje) + logger.debug(mensaje) + + if progreso.iscanceled(): + logger.debug("Busqueda de novedades cancelada") + break + + time.sleep(0.5) + pendent = [a for a in threads if a.is_alive()] + if mode == 'normal': + mensaje = config.get_localized_string(60522) % (len(list_newest), time.time() - start_time) + progreso.update(100, mensaje) + logger.debug(mensaje) + start_time = time.time() + # logger.debug(start_time) + + result_mode = config.get_setting("result_mode", "news") + if mode != 'normal': + result_mode=0 + + if result_mode == 0: # Grouped by content + ret = group_by_content(list_newest) + elif result_mode == 1: # Grouped by channels + ret = group_by_channel(list_newest) + else: # Ungrouped + ret = no_group(list_newest) + + while time.time() - start_time < 2: + # show progress chart with time spent for at least 2 seconds + time.sleep(0.5) + if mode == 'normal': + progreso.close() + if mode == 'silent': + set_cache(item) + item.mode = 'set_cache' + ret = add_menu_items(item, ret) + if mode != 'set_cache': + return ret + else: + if mode != 'set_cache': + no_channels = platformtools.dialog_ok(config.get_localized_string(30130) + ' - ' + item.extra + '\n' + config.get_localized_string(70661) + '\n' + config.get_localized_string(70662)) + return + + +def get_newest(channel_id, categoria): + logger.debug("channel_id=" + channel_id + ", categoria=" + categoria) + + global list_newest + global list_newest_tourl + + # We request the news of the category (item.extra) searched in the channel channel + # If there are no news for that category in the channel, it returns an empty list + try: + modulo = platformtools.channel_import(channel_id) + if not modulo: + return + + logger.debug("running channel " + modulo.__name__ + " " + modulo.__file__) + list_result = modulo.newest(categoria) + logger.debug("canal= %s %d resultados" % (channel_id, len(list_result))) + exist=False + if os.path.exists(menu_cache_path): + cache_node = jsontools.get_node_from_file('menu_cache_data.json', 'cached') + exist=True + else: + cache_node = {} + # logger.debug('cache node: %s' % cache_node) + for item in list_result: + # logger.debug("item="+item.tostring()) + item.channel = channel_id + list_newest.append(item) + list_newest_tourl.append(item.tourl()) + + cache_node[categoria] = list_newest_tourl + + jsontools.update_node(cache_node, 'menu_cache_data.json', "cached") + + except: + logger.error("No se pueden recuperar novedades de: " + channel_id) + import traceback + logger.error(traceback.format_exc()) + + +def get_title(item): + # logger.debug("ITEM NEWEST ->", item) + # item.contentSerieName c'è anche se è un film + if item.contentSerieName and item.contentType != 'movie': # Si es una serie + title = item.contentSerieName + # title = re.compile("\[.*?\]", re.DOTALL).sub("", item.contentSerieName) + if not scrapertools.get_season_and_episode(title) and item.contentEpisodeNumber: + # contentSeason non c'è in support + if item.contentSeason: + title = '{}x{:02d}. {}'.format(item.contentSeason, item.contentEpisodeNumber, title) + else: + title = '{:02d}. {}'.format(item.contentEpisodeNumber, title) + else: + seas = scrapertools.get_season_and_episode(item.title) + if seas: + title = "{}. {}".format(seas, title) + + elif item.contentTitle: # If it is a movie with the adapted channel + title = item.contentTitle + elif item.contentTitle: # If the channel is not adapted + title = item.contentTitle + else: # As a last resort + title = item.title + + # We clean the title of previous format labels + title = re.compile("\[/*COLO.*?\]", re.DOTALL).sub("", title) + title = re.compile("\[/*B\]", re.DOTALL).sub("", title) + title = re.compile("\[/*I\]", re.DOTALL).sub("", title) + + + title = '[B]'+title+'[/B]' + + if item.contentLanguage == '': + pass + elif type(item.contentLanguage) == list and len(item.contentLanguage) ==1: + title += support.typo(item.contentLanguage[0], '_ [] color kod') + elif type(item.contentLanguage) != '': + title += support.typo(item.contentLanguage, '_ [] color kod') + elif type(item.contentLanguage) == list: + title += item.contentLanguage + + if item.quality: + title += support.typo(item.quality, '_ [] color kod') + + # season_ = support.typo(config.get_localized_string(70736), '_ [] color white bold') if (type(item.args) != bool and 'season_completed' in item.news and not item.episode) else '' + # if season_: + # title += season_ + return title + + +def no_group(list_result_canal): + itemlist = [] + global channels_id_name + + for i in list_result_canal: + # logger.debug("NO GROUP i -> ", i) + canale = channels_id_name[i.channel] + canale = canale # to differentiate it from the color of the other items + i.title = get_title(i) + " [" + canale + "]" +# i.text_color = color3 + + itemlist.append(i.clone()) + if config.get_setting('order','news') == 1: + itemlist = sorted(itemlist, key=lambda it: it.title.lower()) + return itemlist + + +def group_by_channel(list_result_canal): + global channels_id_name + dict_canales = {} + itemlist = [] + + for i in list_result_canal: + if i.channel not in dict_canales: + dict_canales[i.channel] = [] + # Format title + i.title = get_title(i) + # We add the content to the list of each channel + dict_canales[i.channel].append(i) + + # We add the content found in the list_result list + for c in sorted(dict_canales): + channel_params = channeltools.get_channel_parameters(c) + itemlist.append(Item(channel="news", title=support.typo(channel_params['title'],'bullet bold color kod'), thumbnail=channel_params['thumbnail'])) + + for i in dict_canales[c]: + itemlist.append(i.clone()) + + return itemlist + + +def group_by_content(list_result_canal): + global channels_id_name + dict_contenidos = {} + list_result = [] + + for i in list_result_canal: + # Format title + i.title = get_title(i) + + # Remove tildes and other special characters for the key + import unicodedata + try: + new_key = i.title.lower().strip().decode("UTF-8") + new_key = ''.join((c for c in unicodedata.normalize('NFD', new_key) if unicodedata.category(c) != 'Mn')) + + except: + new_key = i.title + + if new_key in dict_contenidos: + #If the content was already in the dictionary add it to the list of options ... + dict_contenidos[new_key].append(i) + else: # ...but add it to the dictionary + dict_contenidos[new_key] = [i] + + # We add the content found in the list_result list + for v in list(dict_contenidos.values()): + title = v[0].title + if len(v) > 1: + # Remove duplicate q's from the channel names list + canales_no_duplicados = [] + for i in v: + if i.channel not in canales_no_duplicados: + canales_no_duplicados.append(channels_id_name[i.channel]) + + if len(canales_no_duplicados) > 1: + canales = ', '.join([i for i in canales_no_duplicados[:-1]]) + title += config.get_localized_string(70210) % (canales, canales_no_duplicados[-1]) + else: + title += config.get_localized_string(70211) % (', '.join([i for i in canales_no_duplicados])) + + new_item = v[0].clone(channel="news", title=title, action="show_channels", sub_list=[i.tourl() for i in v], extra=channels_id_name) + else: + new_item = v[0].clone(title=title) + + list_result.append(new_item) + + return sorted(list_result, key=lambda it: it.title.lower()) + + +def show_channels(item): + logger.debug() + global channels_id_name + channels_id_name = item.extra + itemlist = [] + + for i in item.sub_list: + new_item = Item() + new_item = new_item.fromurl(i) + # logger.debug(new_item.tostring()) +## if new_item.contentQuality: +## new_item.title += ' (%s)' % new_item.contentQuality +## if new_item.language: +## new_item.title += ' [%s]' % new_item.language +## new_item.title += ' (%s)' % channels_id_name[new_item.channel] + new_item.text_color = color1 + new_item.title += typo(new_item.channel, '[]') + + itemlist.append(new_item.clone()) + + return itemlist + + +def menu_opciones(item): + itemlist = list() + itemlist.append(Item(channel=item.channel, title=config.get_localized_string(60525), + text_bold = True, thumbnail=thumb("setting"), + folder=False)) + itemlist.append(Item(channel=item.channel, action="setting_channel", extra="movies", title=config.get_localized_string(60526), + thumbnail=thumb("movie"), + folder=False)) + # itemlist.append(Item(channel=item.channel, action="setting_channel", extra="4K", title=config.get_localized_string(70207), + # thumbnail=thumb("movie"), folder=False)) + # itemlist.append(Item(channel=item.channel, action="setting_channel", extra="infantiles", title=config.get_localized_string(60527), + # thumbnail=thumb("children"), + # folder=False)) + itemlist.append(Item(channel=item.channel, action="setting_channel", extra="series", + title=config.get_localized_string(60528), + thumbnail=thumb("tvshow"), + folder=False)) + itemlist.append(Item(channel=item.channel, action="setting_channel", extra="anime", + title=config.get_localized_string(60529), + thumbnail=thumb("anime"), + folder=False)) + # itemlist.append( + # Item(channel=item.channel, action="setting_channel", extra="castellano", title=config.get_localized_string(70212), + # thumbnail=thumb("documentary"), folder=False)) + + # itemlist.append(Item(channel=item.channel, action="setting_channel", extra="latino", title=config.get_localized_string(70213), + # thumbnail=thumb("documentary"), folder=False)) + + # itemlist.append(Item(channel=item.channel, action="setting_channel", extra="torrent", title=config.get_localized_string(70214), + # thumbnail=thumb("documentary"), folder=False)) + + itemlist.append(Item(channel=item.channel, action="setting_channel", extra="documentales", + title=config.get_localized_string(60530), + thumbnail=thumb("documentary"), + folder=False)) + itemlist.append(Item(channel=item.channel, action="settings", title=config.get_localized_string(60531), + thumbnail=thumb("setting"), + folder=False)) + return itemlist + + +def settings(item): + return platformtools.show_channel_settings(caption=config.get_localized_string(60532)) + + +def setting_channel(item): + channels_path = os.path.join(config.get_runtime_path(), "channels", '*.json') + channel_language = config.get_setting("channel_language", default="auto") + if channel_language == 'auto': + channel_language = auto_filter() + + + list_controls = [] + for infile in sorted(glob.glob(channels_path)): + channel_id = os.path.basename(infile)[:-5] + channel_parameters = channeltools.get_channel_parameters(channel_id) + + # Do not include if it is an inactive channel + if not channel_parameters["active"]: + continue + + # Do not include if the channel is in a filtered language + if channel_language != "all" and channel_language not in str(channel_parameters["language"]) \ + and "*" not in channel_parameters["language"]: + continue + + # Do not include if the channel does not exist 'include_in_newest' in your configuration + include_in_newest = config.get_setting("include_in_newest_" + item.extra, channel_id) + if include_in_newest is None: + continue + + control = {'id': channel_id, + 'type': "bool", + 'label': channel_parameters["title"], + 'default': include_in_newest, + 'enabled': True, + 'visible': True} + + list_controls.append(control) + + caption = config.get_localized_string(60533) + item.title.replace(config.get_localized_string(60525), "- ").strip() + if config.get_setting("custom_button_value_news", item.channel): + custom_button_label = config.get_localized_string(59992) + else: + custom_button_label = config.get_localized_string(59991) + + return platformtools.show_channel_settings(list_controls=list_controls, + caption=caption, + callback="save_settings", item=item, + custom_button={'visible': True, + 'function': "cb_custom_button", + 'close': False, + 'label': custom_button_label}) + + +def save_settings(item, dict_values): + for v in dict_values: + config.set_setting("include_in_newest_" + item.extra, dict_values[v], v) + + +def cb_custom_button(item, dict_values): + value = config.get_setting("custom_button_value_news", item.channel) + if value == "": + value = False + + for v in list(dict_values.keys()): + dict_values[v] = not value + + if config.set_setting("custom_button_value_news", not value, item.channel) == True: + return {"label": config.get_localized_string(59992)} + else: + return {"label": config.get_localized_string(59991)} + diff --git a/specials/search.py b/specials/search.py index 6db08e96..7486390a 100644 --- a/specials/search.py +++ b/specials/search.py @@ -44,7 +44,7 @@ def sub_menu(item): Item(channel=channel, action='genres_menu', title=config.get_localized_string(70310), mode='tvshow'), Item(channel=channel, action='years_menu', title=config.get_localized_string(70743), mode='tvshow'), Item(channel=channel, action='discover_list', title=config.get_localized_string(70311), search_type='list', list_type='tv/popular', mode='tvshow'), - Item(channel=channel, action='discover_list', title=config.get_localized_string(70312), search_type='list', list_type='tv/on_air', mode='tvshow'), + Item(channel=channel, action='discover_list', title=config.get_localized_string(70312), search_type='list', list_type='tv/on_the_air', mode='tvshow'), Item(channel=channel, action='discover_list', title=config.get_localized_string(70313), search_type='list', list_type='tv/top_rated', mode='tvshow')] itemlist = set_context(itemlist) diff --git a/specials/tvmoviedb.py b/specials/tvmoviedb.py index f65f805f..796738c2 100644 --- a/specials/tvmoviedb.py +++ b/specials/tvmoviedb.py @@ -53,7 +53,7 @@ def tmdbMenu(item): itemlist = [item.clone(title=config.get_localized_string(70028), action='tmdbResults', args=item.args + '/popular'), item.clone(title=config.get_localized_string(70029), action='tmdbResults', args=item.args + '/top_rated'), - item.clone(title=config.get_localized_string(50001), action='tmdbResults', args=item.args + '/now_playing' if item.args == 'movie' else '/on_the_air'), + item.clone(title=config.get_localized_string(50001), action='tmdbResults', args=item.args + '/now_playing' if item.args == 'movie' else 'tv/on_the_air'), item.clone(title=config.get_localized_string(70032), action='tmdbIndex', mode='genre'), item.clone(title=config.get_localized_string(70042), action='tmdbIndex', mode='year')] @@ -67,6 +67,7 @@ def tmdbMenu(item): def tmdbResults(item): itemlist = [] + logger.dbg() if not item.page: item.page = 1 _search = item.search if item.search else {'url': item.args, 'language': lang.tmdb, 'page': item.page} obj = tmdb.discovery(item, _search)