def search_m3u(self, query, shows): words = query.lower().split(' ') br = 0 pom = 0 out = [] for show in shows: try: if 'ODRASLE' in show.title: if not parental.Parental().isVisible(): break except: pass for word in words: try: if word in show.title.lower(): br += 1 except: pass if br > 0: tup = (br, pom) out.append(tup) br = 0 pom += 1 from operator import itemgetter out = sorted(out, key=lambda x: x[0], reverse=True) outt = [] for i in range(len(out)): index = out[i][1] track = shows[index] outt.append(track) return outt
def channels(self): out = [] tracks = m3u_parser.parseM3U(self.url) for track in tracks: title = track.title try: if 'ODRASLE' in title: if not parental.Parental().isVisible(): return out except: pass url = track.path img = icon_path(info().icon) out.append((url, title, img)) return out
'next': source.next_page() }, {'title': 'Next Page >>'}, img=icon_path(info.icon), fanart=fanart, is_folder=True) else: source = eval(site + ".main()") categories = source.categories() for cat in categories: from resources.lib.modules import constants adult = False for a in constants.adult: if a in cat[1].lower(): adult = True from resources.lib.modules import parental parent = parental.Parental() if not adult or parent.isVisible(): addon.add_item( { 'mode': 'open_p2p_cat', 'url': cat[0], 'site': info.mode, 'adult': adult }, {'title': cat[1]}, img=icon_path(cat[2]), fanart=fanart, is_folder=True) addon.end_of_directory() elif mode[0] == 'open_p2p_cat':