diff --git a/specials/filmontv.py b/specials/filmontv.py index 33c4bb95..8944fd3c 100644 --- a/specials/filmontv.py +++ b/specials/filmontv.py @@ -8,26 +8,7 @@ from core import filetools, downloadtools, support, scrapertools from core.item import Item from platformcode import logger -host = "http://www.epgitalia.tv/xml/guide.gzip" -lCanali = ['Rai 1', 'Rai 2', 'Rai 3', 'Rete 4', 'Canale 5', 'Italia 1', 'Italia 2', 'Mediaset Extra', 'TeleTicino', - 'la5@it', 'La7D', 'Sky TG24 HD', 'TG Norba24', 'Rai Premium', 'Rai News DTT', 'Rai Movie', 'Rai 4 DTT', - 'Iris', 'GIALLO DTT', 'Alice', 'RAI Sport', 'Automoto TV', 'Sky Cinema Uno HD', 'Sky Cinema Uno +24 HD', - 'Sky Cinema Collection HD', 'Sky Cinema Family HD', 'Sky Cinema Romance HD', 'Sky Cinema Comedy HD', - 'Sky Cinema Action HD', 'Sky Cinema Due HD', 'Sky Cinema Due +24 HD', 'Sky Cinema Drama HD', - 'Sky Cinema Suspense HD', 'Comedy Central', 'Laeffe', 'Sky Uno HD', 'Classica HD', 'Sky Atlantic', 'Fox HD', - 'Fox Life HD', 'Fox Crime HD', 'Blaze', 'Paramount Channel Italia', 'Lei', 'Dove', 'CI Crime+ Investigation', - 'Sky Sport F1 HD', 'Sky Sport MotoGP', 'RaiSportpiuHD', 'Class Horse TV', 'SuperTennis HD', 'Eurosport HD', - 'Eurosport 2HD', 'Sky Sport 24', 'Sky Sport Uno', 'Sky Sport Football HD', 'Sky Sport Arena', - 'Sky Sport Serie A', 'Sky Sport NBA', 'Sky Sport Collection HD', 'Inter Channel', 'Lazio Style Channel', - 'Milan TV', 'Roma TV', 'Torino Channel', 'Sky Arte HD-400', 'Discovery Science HD', 'National Geo HD', - 'Nat Geo Wild HD', 'History Channel', 'FOCUS', 'DMAX HD', 'Caccia e Pesca', 'Gambero Rosso HD', 'Cielo DTT', - 'Cartoon Network', 'Baby TV', 'Nickelodeon', 'DeAKids', 'Super! DTT', 'MAN-GA', 'MTV', 'Telelombardia', - 'Spike tv', 'TV8', 'NOVE', 'Premium Cinema HD', 'Premium Cinema Energy', 'Premium Cinema Emotion', - 'Premium Cinema Comedy', 'Premium Cinema +24 HD', 'Premium Stories', 'Premium Crime DTT', 'Premium Action', - 'Top Crime', 'Sportitalia', 'MySports One F', 'MySports 2/Sky 2 F', 'MySports 3/Sky 3 F', - 'MySports 4/Sky 4 F', 'MySports 5/Sky 5 F', 'MySports 6/Sky 6 F', 'MySports 7/Sky 7 F', 'MySports 8/Sky 8 F', - 'MySports 9/Sky 9 F', 'Rai Italia', 'Radionorba TV', 'SMtv San Marino', 'Radio 1', 'Italia 7 Gold', - 'Mediaset', 'HSE 24'] +host = "http://epg-guide.com/kltv.gz" def mainlist(item): @@ -54,13 +35,13 @@ def getEpg(): # inmemory = io.BytesIO(httptools.downloadpage(host).data) downloadtools.downloadfile(host, archiveName) support.log('opening gzip and writing xml') - fStream = gzip.GzipFile(archiveName, mode='rb') - # guide = fStream.read() - # with open(xmlName, 'w') as f: - # f.write(guide) + fStream = gzip.GzipFile(archiveName, mode='rb') + guide = fStream.read().replace('\n', ' ').replace('><', '>\n<') + with open(xmlName, 'w') as f: + f.write(guide) # else: - # guide = open(xmlName).read() - return fStream + guide = open(xmlName) + return guide def category(item): @@ -96,14 +77,19 @@ def peliculas(item, f=None, ): line = f.readline() if '([^<]+?)(?: - 1\s*\^\s*TV)?<') if title in titles: skip = True elif not skip and '([^<]+)<') + for match in scrapertools.find_multiple_matches_groups(line, r'>(?:\[(?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]]) @@ -111,8 +97,6 @@ def peliculas(item, f=None, ): director = scrapertools.find_single_match(line, r'>([^<]+)<') elif not skip and '([^<]+)<') - elif not skip and '([^<]+)<')) elif not skip and '([^<]+)<') elif not skip and '([^<]+?)<') + if title == 'EPG non disponibile': + skip = True elif not skip and '([^<]+)<') elif not skip and '