def categories(): #search.item() util.add_local_dir(__language__(30037),__addon__.getSetting('downloads'),util.icon('download.png')) util.add_dir('Všechny',{'list-all':''}) for index,letter in enumerate(letters): util.add_dir(letter,{'list':str(index)}) xbmcplugin.endOfDirectory(int(sys.argv[1]))
def list_letter(index): letter = letters[int(index)] data = util.request(BASE_URL+'system/load-vypis/?znak='+letter+'&typ=1&zar=hp') pattern = '<a href=\"(?P<url>[^\"]+)[^>]+>(?P<name>[^<]+)' for m in re.finditer(pattern,data,re.IGNORECASE | re.DOTALL ): image,plot = _get_meta(m.group('name'),furl(m.group('url'))) util.add_dir(m.group('name'),{'tale':furl(m.group('url')+'video/')},image,infoLabels={'Plot':plot}) xbmcplugin.endOfDirectory(int(sys.argv[1]))
def categories(): # util.add_dir(__addon__.getLocalizedString(30001),{'top':BASE_URL+'/videozebricky/poslednich-50-videi'},util.icon('new.png')) util.add_dir('Top 200',{'top':furl('/videozebricky/top-100')},util.icon('top.png')) util.add_local_dir(__language__(30037),__addon__.getSetting('downloads'),util.icon('download.png')) data = util.request(BASE_URL) data = util.substr(data,'<ul id=\"headerMenu2\">','</ul>') pattern = '<a href=\"(?P<url>[^\"]+)(.+?)>(?P<name>[^<]+)' for m in re.finditer(pattern, data, re.IGNORECASE | re.DOTALL ): if m.group('url') == '/': continue util.add_dir(m.group('name'),{'cat':furl(m.group('url'))})
def parse_page(page,url): data = util.substr(page,'<div class=\"vypis','<div class=\"right') pattern = '<div class=\"tale_char_div\"(.+?)<img(.+?)src=\"(?P<img>[^\"]+)(.+?)<a(.+?)href=\"(?P<url>[^\"]+)[^>]+>(?P<name>[^<]+)<(.+?)<p[^>]*>(?P<plot>[^<]+)' for m in re.finditer(pattern, data, re.IGNORECASE | re.DOTALL): util.add_video( m.group('name'), {'play':furl(m.group('url'))}, m.group('img'), infoLabels={'Plot':m.group('plot')}, menuItems={xbmc.getLocalizedString(33003):{'name':m.group('name'),'download':furl(m.group('url'))}} ) data = util.substr(page,'<p class=\"p_wrapper','</p>') index = url.find('?') if index > 0: url = url[:index] n = re.search('<a(.+?)href=\"(?P<url>[^\"]+)\"[^>]*>><',data) if n: util.add_dir(__language__(30012),{'tale':furl(url+n.group('url'))},util.icon('next.png')) xbmcplugin.endOfDirectory(int(sys.argv[1]))
def list_content(page,url=BASE_URL): data = util.substr(page,'<div class=\"contentArea','<div class=\"pagination\">') pattern = '<h\d class=\"postTitle\"><a href=\"(?P<url>[^\"]+)(.+?)<span>(?P<name>[^<]+)</span></a>(.+?)<div class=\"postContent\">[^<]+<a[^>]+[^<]+<img src=\"(?P<img>[^\"]+)[^<]+</a>[^<]*<div class=\"obs\">[^>]+>(?P<plot>(.+?))</p>' for m in re.finditer(pattern, data, re.IGNORECASE | re.DOTALL ): plot = re.sub('<br[^>]*>','',m.group('plot')) util.add_video( m.group('name'), {'play':furl(m.group('url'))}, m.group('img'), infoLabels={'plot':plot}, menuItems={xbmc.getLocalizedString(33003):{'name':m.group('name'),'download':furl(m.group('url'))}} ) data = util.substr(page,'<div class=\"pagination\">','</div>') m = re.search('<li class=\"info\"><span>([^<]+)',data) n = re.search('<li class=\"prev\"[^<]+<a href=\"(?P<url>[^\"]+)[^<]+<span>(?P<name>[^<]+)',data) k = re.search('<li class=\"next\"[^<]+<a href=\"(?P<url>[^\"]+)[^<]+<span>(?P<name>[^<]+)',data) # replace last / + everyting till the end myurl = re.sub('\/[\w\-]+$','/',url) if not m == None: if not n == None: util.add_dir('%s - %s' % (m.group(1),n.group('name')),{'cat':myurl+n.group('url')}) if not k == None: util.add_dir('%s - %s' % (m.group(1),k.group('name')),{'cat':myurl+k.group('url')})