diff --git a/specials/filmontv.py b/specials/filmontv.py index 1a8de3ab..33c4bb95 100644 --- a/specials/filmontv.py +++ b/specials/filmontv.py @@ -54,13 +54,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) - else: - guide = open(xmlName).read() - return guide + fStream = gzip.GzipFile(archiveName, mode='rb') + # guide = fStream.read() + # with open(xmlName, 'w') as f: + # f.write(guide) + # else: + # guide = open(xmlName).read() + return fStream def category(item): @@ -90,76 +90,79 @@ def peliculas(item, f=None, ): country = '' skip = False - for i, line in enumerate(f.splitlines()): - if i >= pag: - if '([^<]+?)(?: - 1\s*\^\s*TV)?<') - if title in titles: - 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 '([^<]+)<') - elif not skip and '([^<]+)<') - if item.contentType == 'movie': - skip = True - elif not skip and '([^<]+?)(?: - 1\s*\^\s*TV)?<') + if title in titles: + 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 '([^<]+)<') + elif not skip and '([^<]+)<') + if item.contentType == 'movie': + skip = True + elif not skip and '= 40: - itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), pag= i + 1, thumbnail=support.thumb(), lastTitle=titles[-1])) - break + if len(itemlist) >= 40: + itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), pag= f.tell(), thumbnail=support.thumb(), lastTitle=titles[-1])) + break support.tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) + f.close() return itemlist def listaCanali(item): @@ -167,8 +170,9 @@ def listaCanali(item): f = getEpg() thumbnail = None skip = False - - for line in f.splitlines(): + line = True + while line: + line = f.readline() if '([^<]+?)<') - elif '([^<]+)<') - elif '([^<]+)<') actors.append([match[1], match[0]]) - elif '([^<]+)<') - elif '([^<]+)<') - elif '([^<]+)<')) - elif '([^<]+)<') - elif '([^<]+)<') - elif '