From 579e36b23cc51fe9f1bf575c1d37501a45e201ac Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Sat, 27 Jun 2020 19:51:35 +0200 Subject: [PATCH] Aggiornamento filmontv --- channelselector.py | 10 ++-- specials/filmontv.py | 117 ++++++++++++++++++++++++------------------- 2 files changed, 70 insertions(+), 57 deletions(-) diff --git a/channelselector.py b/channelselector.py index 10452461..87d5b075 100644 --- a/channelselector.py +++ b/channelselector.py @@ -76,7 +76,7 @@ def getchanneltypes(view="thumb_"): logger.info() # Category List - channel_types = ["movie", "tvshow", "anime", "documentary", "vos", "direct", "live", "torrent", "music"] + channel_types = ["movie", "tvshow", "anime", "documentary", "vos", "live", "torrent", "music"] #, "direct" # Channel Language channel_language = auto_filter() @@ -296,7 +296,7 @@ def thumb(item_or_itemlist=None, genre=False, thumb=''): import re icon_dict = {'movie':['film', 'movie'], 'tvshow':['serie','tv','episodi','episodio','fiction', 'show'], - 'documentary':['documentari','documentario', 'documentary'], + 'documentary':['documentari','documentario', 'documentary', 'documentaristico'], 'teenager':['ragazzi','teenager', 'teen'], 'learning':['learning'], 'all':['tutti', 'all'], @@ -308,17 +308,17 @@ def thumb(item_or_itemlist=None, genre=False, thumb=''): 'action':['azione', 'arti marziali', 'action'], 'adventure': ['avventura', 'adventure'], 'biographical':['biografico', 'biographical'], - 'comedy':['comico', 'commedia', 'demenziale', 'comedy'], + 'comedy':['comico', 'commedia', 'demenziale', 'comedy', 'brillante'], 'adult':['erotico', 'hentai', 'harem', 'ecchi', 'adult'], 'drama':['drammatico', 'drama', 'dramma'], 'syfy':['fantascienza', 'science fiction', 'syfy', 'sci'], - 'fantasy':['fantasy', 'magia', 'magic'], + 'fantasy':['fantasy', 'magia', 'magic', 'fantastico'], 'crime':['gangster','poliziesco', 'crime', 'crimine'], 'grotesque':['grottesco', 'grotesque'], 'war':['guerra', 'war'], 'children':['bambini', 'kids'], 'horror':['horror'], - 'music':['musical', 'musica', 'music'], + 'music':['musical', 'musica', 'music', 'musicale'], 'mistery':['mistero', 'giallo', 'mystery'], 'noir':['noir'], 'popular' : ['popolari','popolare', 'più visti'], diff --git a/specials/filmontv.py b/specials/filmontv.py index 8944fd3c..2b5c5bc9 100644 --- a/specials/filmontv.py +++ b/specials/filmontv.py @@ -9,15 +9,16 @@ from core.item import Item from platformcode import logger host = "http://epg-guide.com/kltv.gz" +blacklisted_genres = ['attualita', 'scienza', 'religione', 'cucina', 'notiziario', 'altro', 'soap opera', 'viaggi', 'economia', 'tecnologia', 'magazine', 'show', 'reality show', 'lifestyle', 'societa', 'wrestling', 'azione', 'Musica', 'real life', 'real adventure', 'dplay original', 'natura', 'news', 'food', 'sport', 'moda', 'arte e cultura', 'crime', 'box set e serie tv', 'casa', 'storia', 'talk show', 'motori', 'attualit\xc3\xa0 e inchiesta', 'documentari', 'musica', 'spettacolo', 'medical', 'talent show', 'sex and love', 'beauty and style', 'news/current affairs', "children's/youth programmes", 'leisure hobbies', 'social/political issues/economics', 'education/science/factual topics', 'undefined content', 'show/game show', 'music/ballet/dance', 'sports', 'arts/culture', 'biografico', 'informazione'] def mainlist(item): support.log() - itemlist = [Item(title=support.typo('Film in onda oggi', 'bold'), channel=item.channel, action='category', contentType='movie'), - Item(title=support.typo('Serie Tv in onda oggi', 'bold'), channel=item.channel, action='peliculas', contentType='tvshow'), - Item(title=support.typo('Guida tv per canale', 'bold'), channel=item.channel, action='listaCanali'), - Item(title=support.typo('Canali live (Rai Play)', 'bold'), channel=item.channel, action='live')] + itemlist = [Item(title=support.typo('Film in onda oggi', 'bold'), channel=item.channel, action='category', contentType='movie', thumbnail=support.thumb(thumb='movie.png')), + Item(title=support.typo('Serie Tv in onda oggi', 'bold'), channel=item.channel, action='peliculas', contentType='tvshow', thumbnail=support.thumb(thumb='tvshow.png')), + Item(title=support.typo('Guida tv per canale', 'bold'), channel=item.channel, action='listaCanali', thumbnail=support.thumb(thumb='on_the_air.png')), + Item(title=support.typo('Canali live (Rai Play)', 'bold'), channel=item.channel, action='live', thumbnail=support.thumb(thumb='tvshow_on_the_air.png'))] return itemlist @@ -46,11 +47,11 @@ def getEpg(): def category(item): itemlist = [Item(title="Tutti", all=True, channel=item.channel, action='peliculas', contentType=item.contentType)] - category = ['Famiglia', 'Documentario', 'Thriller', 'Azione', 'Crime', 'Drammatico', 'Western', 'Avventura', 'Commedia', 'Fantascienza', 'Fantastico', 'Animazione', 'Horror', 'Mistero', 'Sport', 'Mondo e Tendenze', 'Intrattenimento', 'Musicale', 'Guerra', 'Storico', 'Biografico', 'Poliziesco'] + category = ['Animazione', 'Avventura', 'Azione', 'Biografico', 'Brillante', 'Comico', 'Commedia', 'Crime', 'Documentario', 'Documentaristico', 'Drammatico', 'Famiglia', 'Fantascienza', 'Fantastico', 'Giallo', 'Guerra', 'Horror', 'Mistero', 'Musicale', 'Poliziesco', 'Sexy', 'Storico', 'Thriller', 'Western'] for cat in category: itemlist.append(Item(title=cat, category=cat, channel=item.channel, action='peliculas', contentType=item.contentType)) - return itemlist + return support.thumb(itemlist) def peliculas(item, f=None, ): @@ -78,34 +79,36 @@ def peliculas(item, f=None, ): if '([^<]+?)(?: - 1\s*\^\s*TV)?<') - if title in titles: + title = scrapertools.find_single_match(line, r'>([^<]+?)(?: - (?:1\s*\^\s*TV|Prima\s*T[Vv]))?<') + if not title or title in titles: skip = True elif not skip and '(?:\[(?P[^\]]+)\])?(?PS[0-9]+\s*Ep?[0-9]+)?(?P[^<]+)'): - if match['genre']: - genres.append(match['genre']) - episode = match['episode'] - plot = match['plot'] - - if episode and item.contentType == 'movie': - skip = True - elif not skip and '([^<]+)<') - actors.append([match[1], match[0]]) - elif not skip and '([^<]+)<') - elif not skip and '([^<]+)<') - elif not skip and '([^<]+)<') - elif not skip and '([^<]+)<') - if item.contentType == 'movie': - skip = True - elif not skip and '(?:\[([^\]]+)\])?(S[0-9]+\s*Ep?[0-9]+)?(?:\s*-\s*)?([^<]+)') + if plot: + CY = scrapertools.find_single_match(plot, r'(\D{3}) (\d{4})') + if CY: country, year = CY + director = scrapertools.find_single_match(plot, r'Regia di ([^;|<]+)') + if episode and item.contentType == 'movie': skip = True + elif not skip and '([^<]+)<') + # elif not skip and '([^<]+)<') + # actors.append([match[1], match[0]]) + # elif not skip and '([^<]+)<') + # elif not skip and '([^<]+)<') + # elif not skip and '([^<]+)<') + # elif not skip and '([^<]+)<') + # if item.contentType == 'movie': + # skip = True + # elif not skip and '([^<]+)<') elif not skip and '([^<]+?)<') if title == 'EPG non disponibile': skip = True elif not skip and '([^<]+)<') - elif not skip and '([^<]+)<') - actors.append([match[1], match[0]]) - elif not skip and '([^<]+)<') - elif not skip and '([^<]+)<') + genre, episode, plot = scrapertools.find_single_match(line, r'>(?:\[([^\]]+)\])?(S[0-9]+\s*Ep?[0-9]+)?(?:\s*-\s*)?([^<]+)') + if plot: + CY = scrapertools.find_single_match(plot, r'(\D{3}) (\d{4})') + if CY: country, year = CY + director = scrapertools.find_single_match(plot, r'Regia di ([^;|<]+)') + if genre: genres.append(genre) + if episode and item.contentType == 'movie':skip = True elif not skip and '([^<]+)<')) - elif not skip and '([^<]+)<') - elif not skip and '([^<]+)<') - elif not skip and '([^<]+)<') + # elif not skip and '([^<]+)<') + # actors.append([match[1], match[0]]) + # elif not skip and '([^<]+)<') + # elif not skip and '([^<]+)<') + # elif not skip and '([^<]+)<')) + # elif not skip and '([^<]+)<') + # elif not skip and '([^<]+)<') + # elif not skip and '