def epizod_lista_izaura(): r = client.request(url + page) r = client.parseDOM(r, 'div', attrs={'class': 'leftblock'}) r = r[0].replace('\n', '') result = client.parseDOM(r, 'div', attrs={'class': 'cikk_listaelem'}) for i in result: try: name = client.parseDOM(i, 'a', attrs={'class': 'cim'})[0] name = client.replaceHTMLCodes(name) link = client.parseDOM(i, 'a', ret='href')[0] img = client.parseDOM(i, 'img', ret='src')[0] addFile(name.encode('utf-8'), "%s%s" % (base_url, link), 20, "%s%s" % (base_url, img), '', 'Izaura TV', IsPlayable=True) except: pass if '/pager_next' in r: addDir('[COLOR green]' 'Következő oldal' '[/COLOR]', url, 12, '', '', '', str(int(page) + 1)) return
def supertv2_filmek(): r = client.request(url + page) result = client.parseDOM(r, 'div', attrs={'id': 'leftblock'}) result = client.parseDOM(result, 'div', attrs={'class': 'cikk_listaelem_nagy'}) for i in result: try: name = client.parseDOM(i, 'a', attrs={'class': 'cim'})[0] name = client.replaceHTMLCodes(name) link = client.parseDOM(i, 'a', ret='href')[0] img = client.parseDOM(i, 'img', ret='src')[0] addFile(name.encode('utf-8'), "%s%s" % (base_url, link), 20, "%s%s" % (base_url, img), '', 'TV2', IsPlayable=True) except: pass if 'következő' in r: addDir('[COLOR green]' 'Következő oldal' '[/COLOR]', url, 26, '', '', '', str(int(page) + 1)) return
def musor_lista_TV2_class(): #TV2 Klasszikusok r = client.request(url) m = client.parseDOM(r, 'div', attrs={'id': 'musorokdropdown'}) m = client.parseDOM(m, 'a'), client.parseDOM(m, 'a', ret='href') m = zip(m[0], m[1]) for name, link in m: try: name = client.replaceHTMLCodes(name) except: pass addDir(name.encode('utf-8'), "%s%s" % (base_url, link), 8, iconimage, fanart, '', '1')
def musor_lista_fem3(): addDir('[COLOR orange]' 'Összes videó' '[/COLOR]', url, 10, iconimage, fanart, '', '1') r = client.request(url + '/videok/') m = re.compile('value="([0-9]+)" > (.+?) </').findall(r) for musor_id, musor_cim in m: try: name = client.replaceHTMLCodes(musor_cim.decode('utf-8')) except: name = musor_cim if 'fem3' in url: mode = 10 addDir(name.encode('utf-8'), url, mode, iconimage, fanart, musor_id, '1')
def musor_lista_sTV2(): #SuperTv2 addDir('[COLOR orange]' 'Teljes filmek' '[/COLOR]', url + '/musoraink/teljes_filmek/oldal', 26, os.path.join(artPath, 'movie.png'), fanart, '', '1') addDir('[COLOR orange]' 'Összes videó' '[/COLOR]', url, 9, iconimage, fanart, '', '1') r = client.request(url + '/videok/') m = re.compile('value="([0-9]+)" > (.+?) </').findall(r) for musor_id, musor_cim in m: try: name = client.replaceHTMLCodes(musor_cim.decode('utf-8')).strip() except: name = musor_cim.musor_cim.strip() addDir(name.encode('utf-8'), url, 9, iconimage, fanart, musor_id, '1')
def musor_lista_izaura(): addDir('[COLOR orange]' 'Videók' '[/COLOR]', url + '/search/', 28, os.path.join(artPath, 'video.png'), fanart, '', '1') r = client.request(url) m = client.parseDOM(r, 'div', attrs={'id': 'dropdown_sorozataink'}) m = client.parseDOM(m, 'a'), client.parseDOM(m, 'a', ret='href') m = zip(m[0], m[1]) for name, link in m: try: name = client.replaceHTMLCodes(name) except: pass addDir(name.encode('utf-8'), "%s%s/oldal" % (base_url, link), 12, iconimage, fanart, '', '1')
def getEpisodes(): query = urlparse.urljoin(m4_url, '/wp-content/plugins/telesport.hu.widgets/widgets/newSubCategory/ajax_loadmore.php?cat_id={0}&post_type=video&blog_id=4&page_number={1}'.format(category, page)) r = client.request(query) result = json.loads(r) for i in result: #if i['has_video'] != True: continue title = client.replaceHTMLCodes(i['title']) title = py2_encode(title) link = py2_encode(i['link']) if link.startswith('//'): link = 'http:' + link img = py2_encode(i['image']) if img.startswith('//'): img = 'http:' + img addDir({'title': title, 'url': link, 'action': 'getVideo', 'image': img, 'isFolder': 'false'}) if len(result) >= 10: addDir({'title': '[COLOR green]Következő oldal[/COLOR]', 'action': 'getEpisodes', 'page': str(int(page) + 1), 'category': category, 'isFolder': 'true'}) xbmcplugin.endOfDirectory(syshandle)
def get_epg(channel, active=None): items = get_list(channel) if not active == True: return items else: try: item = [i for i in items if i['start'] < current_time < i['stop']] if not len(item) == 0: item = item[0] else: item = [i for i in items if i['start'] < current_time] if len(item) == 0: raise Exception() item = item[-1] title = client.replaceHTMLCodes(item['title'].decode('utf-8')) return '%s -> %s' % (item['channel'], title.encode('utf-8')) except: return channel.encode('utf-8')
def epizod_lista_kids(): r = client.request("%s%s/oldal%s" % (url, keyword, page)) if len(keyword) == 0: addDir('[COLOR orange]' 'Szűkítés' '[/COLOR]', url, 29, '', '', description, '15') else: addDir( '[COLOR orange]' 'TV2 Kids szűrés: [COLOR lime]%s[/COLOR]' '[/COLOR]' % urllib.unquote_plus(keyword), url, 15, os.path.join(artPath, 'kids.png'), '', description, page, keyword) r = client.parseDOM(r, 'div', attrs={'class': 'leftblock'}) r = r[0].replace('\n', '') result = zip(client.parseDOM(r, 'a', ret='href'), client.parseDOM(r, 'a')) for i in result: try: name = client.parseDOM(i[1], 'div', attrs={'class': 'cim'})[0] name = client.replaceHTMLCodes(name) img = client.parseDOM(i[1], 'img', ret='src')[0] img = urlparse.urljoin(url, img) addFile(name.encode('utf-8'), "%s%s" % (base_url, i[0]), 20, img, '', 'Kiwi TV', IsPlayable=True) except: pass if '/pager_next' in r: addDir('[COLOR green]' 'Következő oldal' '[/COLOR]', url, 15, '', '', description, str(int(page) + 1), keyword) return
def epizod_lista_zenebutik(): r = client.request("%s%s/oldal%s" % (url, keyword, page)) if len(keyword) == 0: addDir('[COLOR orange]' 'Szűkítés' '[/COLOR]', url, 29, '', '', description, '17') else: addDir( '[COLOR orange]' 'Zenebutik szűrés: [COLOR lime]%s[/COLOR]' '[/COLOR]' % urllib.unquote_plus(keyword), url, 17, os.path.join(artPath, 'zenebutik.png'), '', description, page, keyword) result = client.parseDOM(r, 'div', attrs={'class': 'pagewrapper'}) result = client.parseDOM(result, 'div', attrs={'class': 'cikk_listaelem'}) for i in result: try: name = client.parseDOM(i, 'a', attrs={'class': 'cim'})[0] name = client.replaceHTMLCodes(name) link = client.parseDOM(i, 'a', ret='href')[0] img = client.parseDOM(i, 'img', ret='src')[0] addFile(name.encode('utf-8'), "%s%s" % (base_url, link), 20, "%s%s" % (base_url, img), '', 'Zenebutik', IsPlayable=True) except: pass if '/assets/next' in r: addDir('[COLOR green]' 'Következő oldal' '[/COLOR]', url, 17, '', '', description, str(int(page) + 1), keyword) return
def epizod_lista_sef(): r = client.request("%s%s/oldal%s" % (url, keyword, page)) if len(keyword) == 0: addDir('[COLOR orange]' 'Szűkítés' '[/COLOR]', url, 29, '', '', description, '14') else: addDir( '[COLOR orange]' 'TV2 Séf szűrés: [COLOR lime]%s[/COLOR]' '[/COLOR]' % urllib.unquote_plus(keyword), url, 14, os.path.join(artPath, 'sef.png'), '', description, page, keyword) result = client.parseDOM(r, 'div', attrs={'class': 'leftblock'}) result = client.parseDOM(result, 'div', attrs={'class': 'cikk_listaelem'}) for i in result: try: name = client.parseDOM(i, 'div', attrs={'class': 'cim'})[0] name = re.search('>([^<]+)', name).group(1) name = client.replaceHTMLCodes(name) link = client.parseDOM(i, 'a', ret='href')[0] img = client.parseDOM(i, 'img', ret='src')[0] addFile(name.encode('utf-8'), "%s%s" % (base_url, link), 20, "%s%s" % (base_url, img), '', 'TV2 Séf', IsPlayable=True) except: pass if '/pager_next' in r: addDir('[COLOR green]' 'Következő oldal' '[/COLOR]', url, 14, '', '', description, str(int(page) + 1), keyword) return