Exemple #1
0
def chuongtrinh21h(url):
	b     = xread(url)
	items = []
	for s in re.findall('(<h3>&raquo;.+?"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
Exemple #2
0
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
Exemple #3
0
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
Exemple #4
0
def chuongtrinh21h(url):
	b     = xread(url)
	items = []
	for s in re.findall('(<h3>&raquo;.+?"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
Exemple #5
0
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
Exemple #6
0
def episode(name, url, img):
    b = xread(url)

    if 'paged=' not in url and '<h3>&raquo; <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>&raquo; <a href="' not in b:
        b = b[b.find('<div id="main-content">'):]
    else:
        b = b[b.find('<h3>&raquo; <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
Exemple #7
0
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

	
Exemple #8
0
def episode(name, url, img):
	b     = xread(url)
	
	if 'paged=' not in url and '<h3>&raquo; <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>&raquo; <a href="' not in b:
		b = b[b.find('<div id="main-content">'):]
	else:
		b = b[b.find('<h3>&raquo; <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
Exemple #9
0
def addir(name, url, img='', mode='', page=1, query='', isFolder=False, menu=[]):
	def addMenu(menu):
		items = []
		for item in menu:
			label, name, url, img, mode, page, query = item
			arg = {
				'name' : u2s(name),
				'url'  : url,
				'img'  : img,
				'mode' : mode,
				'page' : page,
				'query':query
			}
			command = 'RunPlugin(%s?%s)'%(PATH, urlencode(arg))
			color = 'red' if 'emove' in query or 'elete' in query else 'lime'
			label = '[COLOR %s]%s[/COLOR]' % (color, label)
			items.append((label,command))
		return items

	from urllib import urlencode
	from utils import u2s, s2c
	
	name = u2s(s2c(name))
	
	servers = [
		("fshare.vn", "gold"),
		("vaphim.com", "gold"),
		("fsharefilm.com", "FFF08080"),
		("taiphimhd.net", "FF1E90FF"),
		("fcine.net", "orangered"),
		("subscene.com", "green")
	]
	
	srv = [i for i in servers if i[0] in str(url)]
	
	
	if 'fshare.vn' in str(url):
		mode = 'fshare.vn'
		if '/file/' in str(url):
			name = '[COLOR gold]Fshare [/COLOR] ' + name
			query = 'play'
			isFolder = False
		else:
			name = '[COLOR gold]Fshare %s[/COLOR] ' % name
			query = 'folder'
			isFolder = True
	
	elif 'fsharefilm.com' in str(url):
		if '/xem-phim/' in str(url):
			isFolder = False
		else:
			srv = srv[0]
			name = '[COLOR %s]%s[/COLOR] ' % (srv[1], srv[0].split('.')[0]) + name
			mode = srv[0]
			isFolder = True
			
	elif srv:
		srv = srv[0]
		name = '[COLOR %s]%s[/COLOR] ' % (srv[1], srv[0].split('.')[0]) + name
		mode = srv[0]
		isFolder = True
	
	if not img:
		img = os.path.join(addon.getAddonInfo('path'),'icon.png')
	
	listitem = listItem(name, iconImage=img, thumbnailImage=img)
	if not isFolder and url!='sepItem':
		listitem.setInfo(type="video", infoLabels={})
		listitem.setProperty('IsPlayable', 'true')
	
	if menu:
		if isinstance(menu,basestring):
			url += '|%s' % menu
		else:
			listitem.addContextMenuItems(addMenu(menu))
	
	args = {
		'name' : name,
		'url'  : url,
		'img'  : img,
		'mode' : mode,
		'page' : page,
		'query':query
	}
	xbmcplugin.addDirectoryItem(int(sys.argv[1]),PATH+'?'+urlencode(args),listitem,isFolder)