def schedule(url): href = "http://thvl.vn/jwplayer/?l=rtmp" if "THVL1" in url: href = "http://thvl.vn/jwplayer/?l=rtmp2" s = xsearch('(<table.+?/table>)',xread(url)) s = [' '.join(re.sub('<.+?>',' ',i).split()) for i in re.findall('(<tr.+?/tr>)',s)] return [(i,href,"","live",False) for i in s if i]
def schedule1(url): href = "http://thvl.vn/jwplayer/?l=rtmp" if "THVL1" in url: href = "http://thvl.vn/jwplayer/?l=rtmp2" s = xsearch('(<table.+?/table>)',xread(url)) s = [' '.join(re.sub('<.+?>',' ',i).split()) for i in re.findall('(<tr.+?/tr>)',s)] return [(i,href,"","live",False) for i in s if i]
def episode(name, url, img): b = xread(url) if 'paged=' not in url and '<h3>» <a href="' not in b: hrefs = re.findall( '<a href="(http://thvl.vn/\?cat=\d+)" title="(.+?)">', b) if not hrefs: return [(namecolor(name), url, img, "live", False)] href = [i for i in hrefs if i[1] in name] if href: href = href[0][0] else: href = hrefs[0][0] b = xread(href) if '<h3>» <a href="' not in b: b = b[b.find('<div id="main-content">'):] else: b = b[b.find('<h3>» <a href="'):] s = re.findall('(<div class="video-clip-box".+?/div)', b, re.S) if not s: s = re.findall( '(<div class="post-content clearfix".+?"content clearfix">)', b, re.S) items = [] for s in s: title = xsearch('class="date">([^<].+?)<', s) if title: title = '[COLOR cyan]%s[/COLOR] ' % title title = title + s2c(xsearch('alt="([^"].+?)"', s)) href = xsearch('href="([^"].+?)"', s) img = xsearch('src="([^"].+?)"', s) items.append((title, fixLink(href), img, 'live', False)) pageNext(b, items, 'eps') return items
def episode(name, url, img): b = xread(url) if 'paged=' not in url and '<h3>» <a href="' not in b: hrefs = re.findall('<a href="(http://thvl.vn/\?cat=\d+)" title="(.+?)">',b) if not hrefs: return [(namecolor(name), url, img, "live", False)] href = [i for i in hrefs if i[1] in name] if href: href = href[0][0] else: href = hrefs[0][0] b = xread(href) if '<h3>» <a href="' not in b: b = b[b.find('<div id="main-content">'):] else: b = b[b.find('<h3>» <a href="'):] s = re.findall('(<div class="video-clip-box".+?/div)',b,re.S) if not s: s = re.findall('(<div class="post-content clearfix".+?"content clearfix">)',b,re.S) items = [] for s in s: title = xsearch('class="date">([^<].+?)<',s) if title: title = '[COLOR cyan]%s[/COLOR] '%title title = title + s2c(xsearch('alt="([^"].+?)"',s)) href = xsearch('href="([^"].+?)"',s) img = xsearch('src="([^"].+?)"',s) items.append((title, fixLink(href), img, 'live', False)) pageNext(b, items, 'eps') return items
def pageNext(b, items, query): s = xsearch("(<div class='wp-pagenavi'.+?/div>)",b,1,re.S) href = xsearch("<span class='current'>\d+</span><a href='([^']+?)'",s).replace('#038;','') if href: next = xsearch('paged=(\d+)',href) last = xsearch("<a href='[^']+?(\d+)' class='last'>Cuối »</a>",s) if not last: last = re.findall('>(\d+)</a>',s) last = last[-1] if last else '' title = "Trang kế: %s/%s"%(next, last) items.append((namecolor(title,'lime'), fixLink(href), "", query, True))
def chuongtrinh21h(url): b = xread(url) items = [] for s in re.findall('(<h3>».+?"post-info">)',b,re.S): title = s2c(xsearch('>([^<]+?)</a>',s)) href = xsearch('href="([^"]+?)"',s) if not title or not href: continue img = xsearch('src="([^"].+?)"',s) items.append((namecolor(title, c), fixLink(href), img, 'eps', True)) return items
def tonghop(url): b = xread(url) items = [] for s in re.findall('(<div class="post-content clearfix".+?"content clearfix">)',b,re.S): title = '[COLOR cyan]%s[/COLOR]'%xsearch('class="date">([^<].+?)<',s) title = title + ' ' + s2c(xsearch('alt="([^"].+?)"',s)) href = xsearch('href="([^"].+?)"',s) img = xsearch('src="([^"].+?)"',s) items.append((namecolor(title,c), fixLink(href), img, 'eps', True)) pageNext(b, items, 'tonghop') return items
def phim(url): b = xread(url) b = b[b.find('<div id="main-content">'):] s = re.findall('(<div class="video-clip-box".+?/div)', b, re.S) items = [] for s in s: title = xsearch('class="date">([^<].+?)<', s) if title: title = '[COLOR cyan]%s[/COLOR] ' % title title = title + s2c(xsearch('alt="([^"].+?)"', s)) href = xsearch('href="([^"].+?)"', s) img = xsearch('src="([^"].+?)"', s) items.append((namecolor(title, c), fixLink(href), img, 'eps', True)) pageNext(b, items, 'phim') return items
def phim(url): b = xread(url) b = b[b.find('<div id="main-content">'):] s = re.findall('(<div class="video-clip-box".+?/div)',b,re.S) items = [] for s in s: title = xsearch('class="date">([^<].+?)<',s) if title: title = '[COLOR cyan]%s[/COLOR] '%title title = title + s2c(xsearch('alt="([^"].+?)"',s)) href = xsearch('href="([^"].+?)"',s) img = xsearch('src="([^"].+?)"',s) items.append((namecolor(title, c), fixLink(href), img, 'eps', True)) pageNext(b, items, 'phim') return items