def get_feature(url): #6 r = client._basic_request(url, headers=headers) r = client.parseDOM(r, 'div', attrs={'class': 'fullbody ptb-60 bg-dark'})[0] # class="fvl-productBox shadow-hover" posts = client.parseDOM(r, 'div', attrs={'class': 'fvl-productBox shadow-hover'}) for post in posts: if 'FREE' in post: link = client.parseDOM(post, 'a', ret='href')[0] poster = client.parseDOM(post, 'img', ret='src')[0] desc = client.parseDOM(post, 'div', attrs={'class': 'fvl-productDescription'})[0] title = client.parseDOM(desc, 'h5')[0] plot = client.parseDOM(desc, 'span')[0] rate = client.parseDOM(post, 'div', attrs={'class': 'starrr'}, ret='data-rating')[0] desc = title + '\n' + str(plot) title += '[' + str(rate) + ']' addDir('[B]%s[/B]' % title, link, 5, poster, '', str(desc)) else: pass xbmcplugin.setContent(int(sys.argv[1]), 'movies')
def get_content(url): #5 <div class="products-list__item shadow-hover"> r = client._basic_request(url, headers=headers) # data = client.parseDOM(r, 'div', attrs={'class': 'products-view'})[0] data = client.parseDOM(r, 'div', attrs={'class': 'products-view__list.+?'}) xbmc.log('DATAAA: %s' % str(data)) for item in data: if 'FREE' in item: link = client.parseDOM(item, 'a', ret='href')[0] link = client.replaceHTMLCodes(link) link = link.encode('utf-8') name = client.parseDOM(item, 'a')[1] name = client.replaceHTMLCodes(name) name = name.encode('utf-8') desc = client.parseDOM( item, 'div', attrs={'class': 'product-card__description'})[0] desc = clear_Title(desc) desc = desc.decode('ascii', errors='ignore') univ = client.parseDOM(item, 'div', attrs={'class': 'product-card__category'})[0] un_name, un_link = [ client.parseDOM(univ, 'a')[0], client.parseDOM(univ, 'a', ret='href')[0] ] un_name = re.sub('<.+?>', '', un_name) un_name = un_name.encode('utf-8') poster = client.parseDOM(item, 'img', ret='src')[0] poster = client.replaceHTMLCodes(poster) poster = 'https:' + poster if poster.startswith('//') else poster poster = poster.encode('utf-8') addDir('[B]%s[/B]' % name, link, 10, poster, '', desc) if not 'university' in url: addDir('[B]Find lectures from %s[/B]' % un_name, un_link, 5, poster, '', desc) else: pass try: np = re.findall('''<li><a href="(.+?)">Next''', r, re.DOTALL)[0] page = np.split('/')[:-1][-1] page = '[B][COLORlime]{}[B][COLORwhite])[/B][/COLOR]'.format(page) np = client.replaceHTMLCodes(np) addDir( '[B][COLORgold]Next Page>>>[/COLOR] [COLORwhite]({}'.format(page), np, 5, ICON, '', 'Next Page') except: pass xbmcplugin.setContent(int(sys.argv[1]), 'movies')
def get_categories(url): r = client._basic_request(url, headers=headers) r = client.parseDOM(r, 'div', attrs={'class': 'fullbody ptb-60'})[1] xbmc.log('CaTAEGORIES: %s' % str(r)) cats = client.parseDOM(r, 'li') xbmc.log('CTAEGORIES: %s' % str(cats)) for cat in cats: link = client.parseDOM(cat, 'a', ret='href')[0] title = client.parseDOM(cat, 'h5')[0] addDir('[B]%s[/B]' % str(title), link, 5, ICON, '', str(title)) xbmcplugin.setContent(int(sys.argv[1]), 'movies')
def get_lectures(name, url, poster, desc): r = client._basic_request(url, headers=headers) posts = client.parseDOM(r, 'li', attrs={'class': 'class-list__row'}) for post in posts: link = client.parseDOM(post, 'a', ret='href')[0] link = client.replaceHTMLCodes(link) link = link.encode('utf-8') name = client.parseDOM(post, 'a')[0] name = client.replaceHTMLCodes(name) name = name.encode('utf-8') addDir('[B]%s[/B]' % name, link, 100, poster, '', desc) xbmcplugin.setContent(int(sys.argv[1]), 'movies')
def resolve(name, url, iconimage, description): url = BASEURL + url if url.startswith('/') else url info = client._basic_request(url, headers=headers) # title = client.parseDOM(info, 'meta', ret='content', attrs={'name': 'description'})[0].encode('utf-8') # name = '{0} - {1}'.format(head, title) #<div class="youtube-player" data-id="0Eeuqh9QfNI"></div> link_id = client.parseDOM(info, 'div', ret='data-id', attrs={'class': 'youtube-player'})[0] link = yout_vid.format(link_id) liz = xbmcgui.ListItem(name, iconImage=ICON, thumbnailImage=iconimage) try: liz.setInfo(type="Video", infoLabels={"Title": description}) liz.setProperty("IsPlayable", "true") liz.setPath(link) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz) except: control.infoDialog( "[COLOR red]Dead Link[/COLOR]!\n[COLOR white]Please Try Another[/COLOR]", NAME, '')