def mirrorlist(params,url,category):
	xbmc.output("[seriespepito.py] mirrorlist")

	title = urllib.unquote_plus( params.get("title") )
	thumbnail = urllib.unquote_plus( params.get("thumbnail") )
	plot = urllib.unquote_plus( params.get("plot") )

	# Descarga la página
	data = scrapertools.cachePage(url)
	#xbmc.output(data)

	# ------------------------------------------------------------------------------------
	# Busca los enlaces a los videos
	# ------------------------------------------------------------------------------------
	listavideos = servertools.findvideos(data)

	for video in listavideos:
		videotitle = video[0]
		url = video[1]
		server = video[2]
		xbmctools.addnewvideo( CHANNELNAME , "play" , category , server , title.strip() + " - " + videotitle , url , thumbnail , plot )
	# ------------------------------------------------------------------------------------

	# Label (top-right)...
	xbmcplugin.setPluginCategory( handle=pluginhandle, category=category )
		
	# Disable sorting...
	xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE )

	# End of directory...
	xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )
def mainlist(params,url,category):
	logger.info("[favoritos.py] mainlist")

	import xbmctools

	# Crea un listado con las entradas de favoritos
	if usingsamba:
		ficheros = samba.get_files(BOOKMARK_PATH)
	else:
		ficheros = os.listdir(BOOKMARK_PATH)
	ficheros.sort()
	for fichero in ficheros:

		try:
			# Lee el bookmark
			titulo,thumbnail,plot,server,url = readbookmark(fichero)

			# Crea la entrada
			# En la categoría va el nombre del fichero para poder borrarlo
			xbmctools.addnewvideo( CHANNELNAME , "play" , os.path.join( BOOKMARK_PATH, fichero ) , server , titulo , url , thumbnail, plot )
		except:
			pass

	# Label (top-right)...
	xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category )
	xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE )
	xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
Пример #3
0
def loadvideo(params,data,category,title,thumbnail,plot):
	# ----------------------------------------------------------
	# the loading of series with a lot of seasons is very slow
	# this system prevents freeze everytime in loading screen
	# ----------------------------------------------------------
	max_len = 3000
	while (len(data) > max_len): 
		data_all = data
		data_trunc = data[:max_len].rfind('<a ')
		if(data_trunc <= 0):
			data = data = data_all[max_len:]
		else:
			data = data[:data_trunc]
			listavideos = servertools.findvideos(data)
			for video in listavideos:
				videotitle = video[0]
				url = video[1]
				server = video[2]
				patronvideos  = url+'[^>]+>([^<]+)'
				matches = re.compile(patronvideos,re.DOTALL).findall(data)
				scrapertools.printMatches(matches)
				if (matches): videotitle = matches[0]
				xbmctools.addnewvideo( CHANNELNAME , "play" , category , server , title.strip() + " - " + videotitle + " ["+server+"]" , url , thumbnail , plot )
			data = data_all[data_trunc:]
	#end while
	listavideos = servertools.findvideos(data)
	for video in listavideos:
		videotitle = video[0]
		url = video[1]
		server = video[2]
		patronvideos  = url+'[^>]+>([^<]+)'
		matches = re.compile(patronvideos,re.DOTALL).findall(data)
		scrapertools.printMatches(matches)
		if (matches): videotitle = matches[0]
		xbmctools.addnewvideo( CHANNELNAME , "play" , category , server , title.strip() + " - " + videotitle + " ["+server+"]" , url , thumbnail , plot )
Пример #4
0
def parsewebcategorias(params, url, category):
    logger.info("[redestv.py] buscacategorias")
    data = scrapertools.cachePage(
        "http://www.redes-tv.com/index.php?option=com_xmap&sitemap=1&Itemid=31"
    )
    #href='http://www.redestv.com/category/arte/' title="ARTE">ARTE</a></li><li><a
    #href="/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=1&amp;Itemid=9" title="Biotecnolog\xc3\xada y Salud"
    patronvideos = "index.php." + url + '(.*?)</ul>'
    #patronvideos=patronvideos.replace("&","\&")
    #patronvideos=patronvideos.replace(";","\;")
    #patronvideos=patronvideos.replace("=","\=")
    #patronvideos=patronvideos.replace("_","\_")
    #logger.info(patronvideos)
    #logger.info("web"+data)
    matches = re.compile(patronvideos, re.DOTALL).findall(data)
    if DEBUG:
        scrapertools.printMatches(matches)
    if len(matches) > 0:
        #href="/index.php?option=com_content&amp;view=article&amp;id=65:473-farmacos-para-las-emociones&amp;catid=1:biosalud&amp;Itemid=9" title="473: Fármacos para las emociones"
        patronvideos = 'href="(.+?)" title="(.+?)"'
        matches1 = re.compile(patronvideos).findall(matches[0])
        for i in range(len(matches1)):
            #xbmctools.addnewvideo( CHANNELNAME , "buscavideos" , category, matches1[i][1] , matches1[i][0] , "thumbnail" , "")
            xbmctools.addnewvideo(CHANNELNAME, "buscavideos", category,
                                  "redestv", matches1[i][1], matches1[i][0],
                                  "thumbnail", "")

    xbmcplugin.setPluginCategory(handle=int(sys.argv[1]), category=category)
    xbmcplugin.addSortMethod(handle=int(sys.argv[1]),
                             sortMethod=xbmcplugin.SORT_METHOD_NONE)
    xbmcplugin.endOfDirectory(handle=int(sys.argv[1]), succeeded=True)
Пример #5
0
def detail(params, url, category):
    logger.info("[dibujosanimadosgratis.py] detail")

    # Recupera los parámetros
    title = urllib.unquote_plus(params.get("title"))
    thumbnail = urllib.unquote_plus(params.get("thumbnail"))
    plot = urllib.unquote_plus(params.get("plot"))

    # Descarga la página de detalle
    '''
	<div class="post">
	<h2 class="postTitle"><a href="http://dibujosanimadosgratis.net/ranma/ranma-%c2%bd-episodio-142-33-audio-latino-dvdrip-hq.html">Ranma ½ Episodio 142 3/3 Audio Latino DVDRip HQ</a></h2>
	<div class="postMeta">
	<span class="date">May.08, 2010</span> en
	<span class="filed"><a href="http://dibujosanimadosgratis.net/category/ranma" title="Ver todas las entradas en Ranma" rel="category tag">Ranma</a></span>
	</div>
	<div class="postContent"><p>				<img src="http://i4.ytimg.com/vi/3k4YsDCdfoA/default.jpg" align="right" border="0" width="120" height="90" vspace="4" hspace="4" />
	</p>
	<p>					Author: <a href="http://youtube.com/profile?user=AlucardReturn08">AlucardReturn08</a><br/>					Keywords:  <br/>					Added: May 8, 2010<br/>				</p>
	<p><object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/3k4YsDCdfoA"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/3k4YsDCdfoA" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object></p>
	</div>
	'''
    data = scrapertools.cachePage(url)
    patron = '<div class="post">(.*?<div class="postMeta">.*?<div class="postContent">.*?)</div>'
    matches = re.compile(patron, re.DOTALL).findall(data)
    if len(matches) > 0:
        data = matches[0]
        logger.info(data)

        # Plot
        scrapedplot = scrapertools.htmlclean(data)
        scrapedplot = scrapedplot.replace("\n", " ")
        scrapedplot = scrapedplot.replace("\r", " ")

        # Thumbnail
        patron = '<img src="([^"]+)"'
        matches = re.compile(patron, re.DOTALL).findall(data)
        scrapedthumbnail = ""
        if len(matches) > 0:
            scrapedthumbnail = matches[0]

        # ------------------------------------------------------------------------------------
        # Busca los enlaces a los videos conocidos en el iframe
        # ------------------------------------------------------------------------------------
        listavideos = servertools.findvideos(data)

        for video in listavideos:
            videotitle = video[0]
            url = video[1]
            server = video[2]
            xbmctools.addnewvideo(CHANNELNAME, "play", category, server,
                                  title.strip() + " - " + videotitle, url,
                                  scrapedthumbnail, scrapedplot)
        # ------------------------------------------------------------------------------------

    # Label (top-right)...
    xbmcplugin.setPluginCategory(handle=pluginhandle, category=category)
    xbmcplugin.addSortMethod(handle=pluginhandle,
                             sortMethod=xbmcplugin.SORT_METHOD_NONE)
    xbmcplugin.endOfDirectory(handle=pluginhandle, succeeded=True)
def detail(params,url,category):
	logger.info("[edumanmovies.py] detail")

	title = urllib.unquote_plus( params.get("title") )
	thumbnail = urllib.unquote_plus( params.get("thumbnail") )
	plot = urllib.unquote_plus( params.get("plot") )

	# Descarga la página
	data = scrapertools.cachePage(url)
	#logger.info(data)
	#<iframe name="frame" marginwidth="0" marginheight="0" src="/p.php?f=43&#038;n=negrologoxd" scrolling="no" frameborder="0"

	# ------------------------------------------------------------------------------------
	# Busca los enlaces a los videos
	# ------------------------------------------------------------------------------------
	listavideos = servertools.findvideos(data)

	for video in listavideos:
		videotitle = video[0]
		url = video[1]
		server = video[2]
		xbmctools.addnewvideo( CHANNELNAME , "play" , category , server , title.strip() + " - " + videotitle , url , thumbnail , plot )
	# ------------------------------------------------------------------------------------

	# Cierra el directorio
	xbmcplugin.setPluginCategory( handle=pluginhandle, category=category )
	xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE )
	xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )
Пример #7
0
def detail(params,url,category):
	logger.info("[divxonline.py] detail")
	title=''
	thumbnail=''
	plot=''

	try:
		title = urllib.unquote_plus( params.get("title") )
		thumbnail = urllib.unquote_plus( params.get("thumbnail") )
		plot = urllib.unquote_plus( params.get("plot") )
	except:
		pass
	# Descarga la página
	data = scrapertools.cachePage(url)
	#logger.info(data)

	# ------------------------------------------------------------------------------------
	# Busca los enlaces a los videos
	# ------------------------------------------------------------------------------------
	
	data=decryptinks(data);
	listavideos = servertools.findvideos(data)

	for video in listavideos:
		videotitle = video[0]
		url = video[1]
		server = video[2]
		xbmctools.addnewvideo( CHANNELNAME , "play" , category , server , title.strip() + " - " + videotitle , url , thumbnail , plot )
	# ------------------------------------------------------------------------------------

	# Cierra el directorio
	xbmcplugin.setPluginCategory( handle=pluginhandle, category=category )
	xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE )
	xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )
def searchresults(params,url,category):
	xbmc.output("[peliculasyonkis.py] searchresults")

	if xbmctools.getPluginSetting("forceview")=="true":
		xbmc.executebuiltin("Container.SetViewMode(53)")  #53=icons

	# Descarga la página
	data = scrapertools.cachePage(url)
	#xbmc.output(data)

	# Extrae las entradas (carpetas)
	#<li> <a href="http://www.peliculasyonkis.com/pelicula/las-edades-de-lulu-1990/" title="Las edades de Lulú (1990)"><img width="77" height="110" src="http://images.peliculasyonkis.com/thumbs/las-edades-de-lulu-1990.jpg" alt="Las edades de Lulú (1990)" align="right" />
	
	patronvideos  = '<li> <a href="([^"]+)" title="([^"]+)"><img.*?src="([^"]+)"'
	matches = re.compile(patronvideos,re.DOTALL).findall(data)
	scrapertools.printMatches(matches)

	for match in matches:
		scrapedtitle = match[1]
		scrapedurl = match[0]
		scrapedthumbnail = match[2]
		scrapedplot = ""
		if (DEBUG): xbmc.output("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]")
		xbmctools.addnewvideo( CHANNELNAME , "detail" , category , "Megavideo" , scrapedtitle , scrapedurl , scrapedthumbnail , scrapedplot )

	# Label (top-right)...
	xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category )

	# Disable sorting...
	xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE )

	# End of directory...
	xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
def listvideos(params,url,category):
	logger.info("[letmewatchthis.py] listvideos")

	title = urllib.unquote_plus( params.get("title") )
	thumbnail = urllib.unquote_plus( params.get("thumbnail") )
	plot = urllib.unquote_plus( params.get("plot") )
	url = url.replace(" ","%20")
	logger.info("url="+url)

	# ------------------------------------------------------------------------------------
	# Descarga la página
	# ------------------------------------------------------------------------------------
	data = scrapertools.cachePage(url)
	#logger.info(data)
	listavideos = servertools.findvideos(data)
	
	for video in listavideos:
		videotitle = video[0]
		scrapedurl = video[1]
		server = video[2]
		xbmctools.addnewvideo( CHANNELNAME , "play" , category , server , title.strip()+" "+videotitle , scrapedurl , thumbnail , plot )

	# Label (top-right)...
	xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category )
	xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE )
	xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
def detail(params,url,category):
	logger.info("[veranime.py] detail")

	title = urllib.unquote_plus( params.get("title") )
	thumbnail = urllib.unquote_plus( params.get("thumbnail") )
	plot = urllib.unquote_plus( params.get("plot") )

	# Descarga la página
	data = scrapertools.cachePage(url)
	#logger.info(data)

	patron  = '<div id="listacapdd"><div class="listddserie">[^<]+'
	patron += '<a title="[^"]+" href="([^"]+)"><strong>[^<]+</strong></a>[^<]+'
	patron += '</div>'
	matches = re.compile(patron,re.DOTALL).findall(data)
	if len(matches)>0:
		url = matches[0]
		data = scrapertools.cachePage(url)

	# ------------------------------------------------------------------------------------
	# Busca los enlaces a los videos
	# ------------------------------------------------------------------------------------
	listavideos = servertools.findvideos(data)

	for video in listavideos:
		videotitle = video[0]
		url = video[1]
		server = video[2]
		xbmctools.addnewvideo( CHANNELNAME , "play" , category , server , title.strip() + " - " + videotitle , url , thumbnail , plot )
	# ------------------------------------------------------------------------------------

	# Asigna el título, desactiva la ordenación, y cierra el directorio
	xbmcplugin.setPluginCategory( handle=pluginhandle, category=category )
	xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE )
	xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )
def listar(title,thumbnail,plot,matches,category):
	
	for match in matches:
		# Titulo
		
		scrapedtitle = title + match[0]
		# URL
		scrapedurl = match[1]
		# Thumbnail
		scrapedthumbnail = thumbnail
		# Argumento
		scrapedplot = plot
		

		# Depuracion
		if (DEBUG):
			logger.info("scrapedtitle="+scrapedtitle)
			logger.info("scrapedurl="+scrapedurl)
			logger.info("scrapedthumbnail="+scrapedthumbnail)

		
			# A�ade al listado de XBMC
			xbmctools.addnewvideo( CHANNELNAME , "play" , category , match[2], scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot )
	# Label (top-right)...
	xbmcplugin.setPluginCategory( handle=pluginhandle, category=category )

	# Disable sorting...
	xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE )

	# End of directory...
	xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )
Пример #12
0
def detail(params, url, category):
    logger.info("[edumanmovies.py] detail")

    title = urllib.unquote_plus(params.get("title"))
    thumbnail = urllib.unquote_plus(params.get("thumbnail"))
    plot = urllib.unquote_plus(params.get("plot"))

    # Descarga la página
    data = scrapertools.cachePage(url)
    #logger.info(data)
    #<iframe name="frame" marginwidth="0" marginheight="0" src="/p.php?f=43&#038;n=negrologoxd" scrolling="no" frameborder="0"

    # ------------------------------------------------------------------------------------
    # Busca los enlaces a los videos
    # ------------------------------------------------------------------------------------
    listavideos = servertools.findvideos(data)

    for video in listavideos:
        videotitle = video[0]
        url = video[1]
        server = video[2]
        xbmctools.addnewvideo(CHANNELNAME, "play", category, server,
                              title.strip() + " - " + videotitle, url,
                              thumbnail, plot)
    # ------------------------------------------------------------------------------------

    # Cierra el directorio
    xbmcplugin.setPluginCategory(handle=pluginhandle, category=category)
    xbmcplugin.addSortMethod(handle=pluginhandle,
                             sortMethod=xbmcplugin.SORT_METHOD_NONE)
    xbmcplugin.endOfDirectory(handle=pluginhandle, succeeded=True)
def detail(params,url,category):
	logger.info("[internautastv.py] detail")

	title = urllib.unquote_plus( params.get("title") )
	thumbnail = urllib.unquote_plus( params.get("thumbnail") )

	# Descarga la página
	data = scrapertools.cachePage(url)
	#logger.info(data)

	# Busca los videos del mes
	patron  = '<div class="c">.*?<span class="t2">([^<]+)</span>.*?'
	patron += '<div class="v1"><a href="([^"]+)"><img src="\/graficos\/lmp4\.jpg"'
	matches = re.compile(patron,re.DOTALL).findall(data)
	scrapertools.printMatches(matches)

	for match in matches:
		# Atributos del vídeo
		scrapedtitle = title
		scrapedurl = match[1]
		scrapedthumbnail = thumbnail
		scrapedplot = match[0]
		if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]")

		# Añade al listado de XBMC
		xbmctools.addnewvideo( CHANNELCODE , "play" , category , "Directo" , scrapedtitle , scrapedurl , scrapedthumbnail , scrapedplot )

	# Label (top-right)...
	xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category )
	xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE )
	xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
Пример #14
0
def ListaEpisodios(params, url, category):
    """Lists the episodes in a show
    """
    logger.info("[tvshack.py] ListaEpisodios")

    if params.has_key("Serie"):
        serie = params.get("Serie")
        logger.info("[tvshack.py] ListaEpisodios: Serie = " + serie)
    else:
        serie = ""

    # Adds "Add all to Library" option
    if category != 'Musica':
        xbmctools.addnewvideo(
            CHANNELNAME, "addlist2Library", category, "", getStr(30920), url,
            "", "", serie)  #"A�ADIR TODOS LOS EPISODIOS A LA BIBLIOTECA"

    listaEp = devuelveListaEpisodios(params, url, category)

    for ep in listaEp:
        xbmctools.addnewvideo(CHANNELNAME,
                              "listaVideosEpisodio",
                              category,
                              "",
                              ep['title'],
                              ep['url'],
                              ep['thumbnail'],
                              ep['plot'],
                              Serie=serie)

    FinalizaPlugin(pluginhandle, category)
def novedades(params,url,category):
	logger.info("[redestv.py] parseweb")
 
	# ------------------------------------------------------
	# Descarga la página
	# ------------------------------------------------------
	data = scrapertools.cachePage(url)
	#logger.info(data)
 
	#<div style="text-align: justify;">Cre?amos que el ser humano era el ?nico animal capaz de sentir empat?a.  Sin embargo, el altruismo existe en muchos otros animales. Estar  conectado con los dem?s, entenderlos y sentir su dolor no es exclusivo  del ser humano. El prim?tologo Frans de Waal, gran estudiador de las  emociones animales, habla con Punset sobre empat?a y simpat?a,  capacidades clave para el ?xito en la vida social.</div><div class="jcomments-links"> <a href="/index.php?option=com_content&amp;view=article&amp;id=161:501-nuestro-cerebro-altruista&amp;catid=2:cermen&amp;Itemid=10#addcomments" class="comment-link">Escribir un comentario</a></div> 
 
	patronvideos  = '<td class="contentheading" width="100%">.+?<a href="(.+?)" class="contentpagetitle">\s+(\d+.+?)</a>'
	#patronvideos  = '<div style="text-align: justify;">.+?</div>.+?<a href="(.+?)#'
 
	#logger.info("web"+data)
	matches = re.compile(patronvideos,re.DOTALL).findall(data)
	if DEBUG:
		scrapertools.printMatches(matches)
	#xbmctools.addnewfolder( CHANNELNAME , "buscavideos" , category, "redestv" , "http://www.redes-tv.com"+matches[0][0] , "" , "")
	#scrapertools.printMatches(matches)
 
	#	patronvideos1 = 'src="http://www.megavideo.com/v/(.{8}).+?".+?></embed>.*?<p>(.+?)</p><div'
	#	matches1 = re.compile(patronvideos1,re.DOTALL).findall(data)
	#	if DEBUG:
	#		scrapertools.printMatches(matches1)
 
	for i in range(len(matches)):
		xbmctools.addnewvideo( CHANNELNAME , "buscavideos" , category , "redestv" , matches[i][1] , matches[i][0] , "thumbnail" , "")
 
	xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category )
	xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE )
	xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
Пример #16
0
def buscartrailer(params,url,category):
	logger.info("[dospuntocerovision.py] buscartrailer")
	titulo = url
	#thumbnail = urllib.unquote_plus( params.get("thumbnail") )
	plot = urllib.unquote_plus( params.get("plot") )
	# ------------------------------------------------------------------------------------
	# Busca los enlaces a los videos
	# ------------------------------------------------------------------------------------
	listavideos = trailertools.gettrailer(titulo)
	if len(listavideos)>0:
		for video in listavideos:
			videotitle = video[1]
			url        = video[0]
			thumbnail  = video[2]
			xbmctools.addnewvideo( CHANNELNAME , "youtubeplay" , category , "Directo" ,  videotitle , url , thumbnail , "Ver Video" )
			
	#else:
	#	respuesta = trailertools.alertnoencontrado(titulo)
	#	if respuesta:
	#		listavideos = trailertools.trailerbykeyboard(titulo)
	#		for video in listavideos:
	#			videotitle = video[1]
	#			url        = video[0]
	#			thumbnail  = video[2]
	#			xbmctools.addnewvideo( CHANNELNAME , "youtubeplay" , category , "Directo" ,  videotitle , url , thumbnail , "Ver Video" )
	# ------------------------------------------------------------------------------------
	# Label (top-right)...
	xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category )

	# Disable sorting...
	xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE )

	# End of directory...
	xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
Пример #17
0
def listvideosTVmirror(params,url,category):
	logger.info("[dospuntocerovision.py] listvideosTVmirror")
	title = urllib.unquote_plus( params.get("title") )
	thumbnail = urllib.unquote_plus( params.get("thumbnail") )

	# Descarga la p�gina
	data = scrapertools.cachePage(url)
	# ------------------------------------------------------------------------------------
	# Busca los enlaces a los videos
	# ------------------------------------------------------------------------------------
	listavideos = servertools.findvideos(data)
	
	for video in listavideos:
		#logger.info("")
		if video[2] == "tu.tv":
			url = urllib.unquote_plus(servertools.findurl(video[1],video[2]))
			xbmctools.addnewvideo( CHANNELNAME , "detail" , category , "Directo" , title +" - "+video[0], url, thumbnail , "" )
		else:
			xbmctools.addnewvideo( CHANNELNAME , "detail" , category , video[2] , title +" - "+video[0], video[1], thumbnail , "" )
	# ------------------------------------------------------------------------------------

	# Label (top-right)...
	xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category )
		
	# Disable sorting...
	xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE )

	# End of directory...
	xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
Пример #18
0
def addvideopage(data, params, url, category):

    # Extrae los vídeos
    patron = '<div id="VideoClip">.*?'
    patron += '<div id="SearchThumbnail">[^<]+<a href="([^"]+)">.*?'
    patron += '<img src=([^\ ]+) .*?'
    patron += '<span class="VideoTitles"><h1>([^<]+)</h1>.*?'
    patron += '<span class="VideoDesc">([^<]+)</span>'
    matches = re.compile(patron, re.DOTALL).findall(data)
    if DEBUG:
        scrapertools.printMatches(matches)

    # Los añade al directorio
    for match in matches:
        # Titulo
        scrapedtitle = match[2]
        # URL
        scrapedurl = urlparse.urljoin(url, match[0])
        # Thumbnail
        scrapedthumbnail = urlparse.urljoin(url, match[1])
        # Argumento
        scrapedplot = match[3]

        # Depuracion
        if (DEBUG):
            xbmc.output("scrapedtitle=" + scrapedtitle)
            xbmc.output("scrapedurl=" + scrapedurl)
            xbmc.output("scrapedthumbnail=" + scrapedthumbnail)

        # Añade al listado de XBMC
        xbmctools.addnewvideo(CHANNELNAME, "play", category, "youtube",
                              scrapedtitle, scrapedurl, scrapedthumbnail,
                              scrapedplot)
def errorlist(params,url,category):
	xbmc.output("[descargadoslist.py] errorlist")

	# Crea el directorio de la lista de descargas con error si no existe
	try:
		os.mkdir(DOWNLOAD_PATH)
	except:
		pass
	try:
		os.mkdir(ERROR_PATH)
	except:
		pass

	# Crea un listado con las entradas de favoritos
	xbmc.output("[downloadall.py] ERROR_PATH="+ERROR_PATH)
	ficheros = os.listdir(ERROR_PATH)
	for fichero in ficheros:
		xbmc.output("[downloadall.py] fichero="+fichero)
		try:
			# Lee el bookmark
			titulo,thumbnail,plot,server,url = readbookmarkfile(fichero,ERROR_PATH)

			# Crea la entrada
			# En la categoría va el nombre del fichero para poder borrarlo
			xbmctools.addnewvideo( CHANNELNAME , "playerror" , os.path.join( ERROR_PATH, fichero ) , server , titulo , url , thumbnail, plot )
		except:
			pass
			xbmc.output("[downloadall.py] error al leer bookmark")
			for line in sys.exc_info():
				xbmc.output( "%s" % line , xbmc.LOGERROR )

	# Label (top-right)...
	xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category )
	xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE )
	xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
Пример #20
0
def detail(params,url,category):
	logger.info("[terrorygore.py] detail")

	title = urllib.unquote_plus( params.get("title") )
	thumbnail = urllib.unquote_plus( params.get("thumbnail") )

	# Descarga la página
	data = scrapertools.cachePage(url)
	#logger.info(data)

	# ------------------------------------------------------------------------------------
	# Busca los enlaces a los videos
	# ------------------------------------------------------------------------------------
	listavideos = servertools.findvideos(data)

	for video in listavideos:
		xbmctools.addnewvideo( CHANNELNAME , "play" , category , video[2] , title + " - " + video[0] , video[1] , thumbnail , "" )
	# ------------------------------------------------------------------------------------

	# Label (top-right)...
	xbmcplugin.setPluginCategory( handle=pluginhandle, category=category )
		
	# Disable sorting...
	xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE )

	# End of directory...
	xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )
def videos(params,url,category):
	logger.info("[delatv.py] videos")

	title = urllib.unquote_plus( params.get("title") )
	thumbnail = urllib.unquote_plus( params.get("thumbnail") )
	plot = unicode( xbmc.getInfoLabel( "ListItem.Plot" ), "utf-8" )

	data = scrapertools.cachePage(url)
	patron = '<div class="reproductor-contenido">(.*?)</div>'
	matches = re.compile(patron,re.DOTALL).findall(data)
	scrapertools.printMatches(matches)
	
	if len(matches)>0:
		data = matches[0]
		patron  = '<iframe src="([^"]+)"'
		matches = re.compile(patron,re.DOTALL).findall(data)
		scrapertools.printMatches(matches)

		for match in matches:
			scrapedtitle = "[VIDEO] "+title
			scrapedurl = match
			scrapedthumbnail = thumbnail
			scrapedplot = plot
			if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]")
			xbmctools.addnewvideo( CHANNELNAME , "play" , category , "", scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot )

	# Cierra el directorio
	xbmcplugin.setPluginCategory( handle=pluginhandle, category=category )
	xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE )
	xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )
def homedetail(params, url, category):
    logger.info("[mcanime.py] homedetail")

    title = urllib.unquote_plus(params.get("title"))
    thumbnail = urllib.unquote_plus(params.get("thumbnail"))
    plot = urllib.unquote_plus(params.get("plot"))
    extradata = urllib.unquote_plus(params.get("extradata"))

    # ------------------------------------------------------------------------------------
    # Busca los enlaces a los videos
    # ------------------------------------------------------------------------------------
    listavideos = servertools.findvideos(extradata)

    for video in listavideos:
        videotitle = video[0]
        url = video[1]
        server = video[2]
        xbmctools.addnewvideo(
            CHANNELNAME, "play", category, server, title.strip() + " - " + videotitle, url, thumbnail, plot
        )
        # ------------------------------------------------------------------------------------

        # Cierra el directorio
    xbmcplugin.setPluginCategory(handle=int(sys.argv[1]), category=category)
    xbmcplugin.addSortMethod(handle=int(sys.argv[1]), sortMethod=xbmcplugin.SORT_METHOD_NONE)
    xbmcplugin.endOfDirectory(handle=int(sys.argv[1]), succeeded=True)
def detail(params,url,category):
	xbmc.output("[pintadibujos.py] detail")

	if xbmctools.getPluginSetting("forceview")=="true":
		xbmc.executebuiltin("Container.SetViewMode(50)") #full list

	title = urllib.unquote_plus( params.get("title") )
	thumbnail = urllib.unquote_plus( params.get("thumbnail") )

	# Descarga la página
	data = scrapertools.cachePage(url)
	#xbmc.output(data)

	# ------------------------------------------------------------------------------------
	# Busca los enlaces a los videos
	# ------------------------------------------------------------------------------------
	listavideos = servertools.findvideos(data)

	for video in listavideos:
		xbmctools.addnewvideo( CHANNELNAME , "play" , category , video[2] , title + " - " + video[0] , video[1] , thumbnail , "" )
	# ------------------------------------------------------------------------------------

	# Label (top-right)...
	xbmcplugin.setPluginCategory( handle=pluginhandle, category=category )
		
	# Disable sorting...
	xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE )

	# End of directory...
	xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )
Пример #24
0
def addvideopage(data,params,url,category):
	# Pone el enlace para continuar con la siguiente página
	# La URL tiene el id de vídeo de youtube: http://www.totlol.com/watch/Bxu3jfqpItE/Pocoyo-Dance/0/
	patron  = '<table id="videoitem[^"]+" class="videoitem basic"><tr>[^<]+'
	patron += '<td class="thumb">[^<]+'
	patron += '<div class="videothumb smallthumb">[^<]+'
	patron += '<a href="([^"]+)"><img.*?src="([^"]+)".*?'
	patron += '<div class="title"><a.*?>([^<]+)</a></div>[^<]+'
	patron += '<span class="info">Runtime\:</span>([^<]+)<.*?'
	patron += '<span class="info">Language\:</span>([^<]+)<'
	matches = re.compile(patron,re.DOTALL).findall(data)
	scrapertools.printMatches(matches)		

	for match in matches:
		# Titulo
		scrapedtitle = match[2]+' ('+match[3].strip()+') ('+match[4].strip()+')'
		# URL
		scrapedurl = urlparse.urljoin(url,match[0])
		# Thumbnail
		scrapedthumbnail = urlparse.urljoin(url,match[1])
		# Argumento
		scrapedplot = ""

		# Depuracion
		if (DEBUG):
			try:
				xbmc.output("scrapedtitle="+scrapedtitle)
			except:
				xbmc.output("scrapedtitle=<unicode>")
			xbmc.output("scrapedurl="+scrapedurl)
			xbmc.output("scrapedthumbnail="+scrapedthumbnail)

		# Añade al listado de XBMC
		xbmctools.addnewvideo( CHANNELNAME , "play" , category , "youtube" , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot )
Пример #25
0
def novedades(params, url, category):
    logger.info("[redestv.py] parseweb")

    # ------------------------------------------------------
    # Descarga la página
    # ------------------------------------------------------
    data = scrapertools.cachePage(url)
    #logger.info(data)

    #<div style="text-align: justify;">Cre?amos que el ser humano era el ?nico animal capaz de sentir empat?a.  Sin embargo, el altruismo existe en muchos otros animales. Estar  conectado con los dem?s, entenderlos y sentir su dolor no es exclusivo  del ser humano. El prim?tologo Frans de Waal, gran estudiador de las  emociones animales, habla con Punset sobre empat?a y simpat?a,  capacidades clave para el ?xito en la vida social.</div><div class="jcomments-links"> <a href="/index.php?option=com_content&amp;view=article&amp;id=161:501-nuestro-cerebro-altruista&amp;catid=2:cermen&amp;Itemid=10#addcomments" class="comment-link">Escribir un comentario</a></div>

    patronvideos = '<td class="contentheading" width="100%">.+?<a href="(.+?)" class="contentpagetitle">\s+(\d+.+?)</a>'
    #patronvideos  = '<div style="text-align: justify;">.+?</div>.+?<a href="(.+?)#'

    #logger.info("web"+data)
    matches = re.compile(patronvideos, re.DOTALL).findall(data)
    if DEBUG:
        scrapertools.printMatches(matches)
    #xbmctools.addnewfolder( CHANNELNAME , "buscavideos" , category, "redestv" , "http://www.redes-tv.com"+matches[0][0] , "" , "")
    #scrapertools.printMatches(matches)

    #	patronvideos1 = 'src="http://www.megavideo.com/v/(.{8}).+?".+?></embed>.*?<p>(.+?)</p><div'
    #	matches1 = re.compile(patronvideos1,re.DOTALL).findall(data)
    #	if DEBUG:
    #		scrapertools.printMatches(matches1)

    for i in range(len(matches)):
        xbmctools.addnewvideo(CHANNELNAME, "buscavideos", category, "redestv",
                              matches[i][1], matches[i][0], "thumbnail", "")

    xbmcplugin.setPluginCategory(handle=int(sys.argv[1]), category=category)
    xbmcplugin.addSortMethod(handle=int(sys.argv[1]),
                             sortMethod=xbmcplugin.SORT_METHOD_NONE)
    xbmcplugin.endOfDirectory(handle=int(sys.argv[1]), succeeded=True)
def detail(params,url,category):
	xbmc.output("[tumejortv.py] detail")

	title = urllib.unquote_plus( params.get("title") )
	thumbnail = urllib.unquote_plus( params.get("thumbnail") )
	plot = ""

	# Descarga la página
	data = scrapertools.cachePage(url)
	#xbmc.output(data)

	patron = '<div id="blogitem">[^<]+<p>([^<]+)</p>'
	matches = re.compile(patron,re.DOTALL).findall(data)
	if len(matches)>0:
		plot = matches[0]

	listavideos = servertools.findvideos(data)
	
	for video in listavideos:
		xbmctools.addnewvideo( CHANNELNAME , "play" , CHANNELNAME , video[2] , title + " (" + video[2] + ")" , video[1] , thumbnail, plot )

	# Label (top-right)...
	xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category )
	xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE )
	xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
def detail2(params,url,category):
	logger.info("[animeid.py] detail2")

	title = urllib.unquote_plus( params.get("title") )
	thumbnail = urllib.unquote_plus( params.get("thumbnail") )
	plot = unicode( xbmc.getInfoLabel( "ListItem.Plot" ), "utf-8" )
	
	scrapedurl = ""
	# Lee la página con el player
	data = scrapertools.downloadpageGzip(url)
	#logger.info(data)
	
	patronvideos = 'file=([^\&]+)\&'
	matches = re.compile(patronvideos,re.DOTALL).findall(data)
	if len(matches)>0:
		scrapedurl = matches[0]
		server = 'Directo'
		
		if (DEBUG): logger.info("title=["+title+"], url=["+scrapedurl+"], thumbnail=["+thumbnail+"]")
		xbmctools.addnewvideo( CHANNELNAME , "play2" , category , server , title + " - [%s]" %server , scrapedurl , thumbnail, plot )
	patronvideos = 'http://[^\.]+.megavideo.com[^\?]+\?v=([A-Z0-9a-z]{8})'
	matches = re.compile(patronvideos,re.DOTALL).findall(data)
	if len(matches)>0:
		scrapedurl = matches[0]
		server = 'Megavideo'
		
		if (DEBUG): logger.info("title=["+title+"], url=["+scrapedurl+"], thumbnail=["+thumbnail+"]")
		xbmctools.addnewvideo( CHANNELNAME , "play2" , category , server , title + " - [%s]" %server , scrapedurl , thumbnail, plot )
		
	# Label (top-right)...
	xbmcplugin.setPluginCategory( handle=pluginhandle, category=category )
	xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE )
	xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )
Пример #28
0
def MovieScan(params,url,category):
    try:
        data = get_page(url)
        
        #Intentamos filtrar y solo parsear el primer post
        messages =re.compile("<!-- message -->.*?<!-- / message -->", re.S).findall(data)
        if (len(messages)>0):
            for message in messages:
                data = message
                break
                
        title = urllib.unquote_plus( params.get("title") )      
        imagen = findimage (data)
                
        videos = findvideos(data,False)    
        if(len(videos)>0):
            numvideo=0
            for video in videos:
                numvideo+=1
                if(len(videos)>1):
                    vtitle= str(numvideo) + ".- " + title
                else:
                    vtitle=title
                                
                xbmctools.addnewvideo( CHANNELNAME , "play" , category , video[2] , vtitle +" ["+video[2]+"]", video[1] , imagen , "" )
    except:
        printText("Error al obtener videos de" + title)    
           
    # Propiedades
    xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category )
    xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE )
    xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )   
def videolist(params,url,category):
	xbmc.output("[berriatb.py] videolist")

	# Page downloading
	data = scrapertools.cachePage(url)
	#xbmc.output(data)
	
	# Get #Next url
	'''
<span class="gehiago"><a class="hurrengoa" href="http://berria.info/berriatb/esanahala/zerrenda/6/">Hurrengoak &raquo;</a></span>
	'''
	pattern = '<a class="hurrengoa" href="([^"]+)">Hurrengoak' # 0: url
	matches = re.compile(pattern,re.DOTALL).findall(data)
	
	try:
		urlnextpage = matches[0]
	except:
		urlnextpage = url
	
	if (DEBUG):
		xbmc.output("urlnextpage="+urlnextpage)
	
	# Add NEXT (as first item)
	xbmctools.addnewfolder( CHANNELCODE , "videolist" , CHANNELNAME , "#Hurrengoa" , urlnextpage , "" , "" )
	
	# Parse video list
	'''
<div class="garbitzailea"></div>
    <div class="bideotxikiak">
    <p><a href="http://berria.info/berriatb/esanahala/5/" title="" class="thickbox"><img src="http://208.79.203.90/berria/bideoak/bideoa653.jpg" width="158" alt="Aintzane Ezenarro" /></a></p>
    <p class="titularra"><a href="http://berria.info/berriatb/esanahala/5/" title="Aintzane Ezenarro">Aintzane Ezenarro</a></p>

	<div class="garbitzailea"></div>
    <p><span class="sinadura_data">2009-09-20</span></p>
  </div>
	'''
	pattern  = '<div class="bideotxikiak">.*?<p><a href="([^"]+)" title.*?'		# 0: url
	pattern += '<img src="([^"]+)".*?' 											# 1: thumbnail
	pattern += '<p class="titularra">.*?title="([^"]+)".*?'						# 2: title
	#pattern += 'sinadura_data">(.*?)<.*?'										# 3: date
	matches = re.compile(pattern,re.DOTALL).findall(data)
	scrapertools.printMatches(matches)

	for match in matches:
		#scrapedtitle = match[2].strip()+" ("+match[3]+")"
		scrapedtitle = match[2].replace("&#39;","'").strip()
		scrapedurl = match[0].replace("&amp;","&")
		scrapedthumbnail = match[1].replace("&amp;","&")
		scrapedplot = scrapedtitle # Same as title
		if (DEBUG): xbmc.output("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]")

		# Add item
		xbmctools.addnewvideo( CHANNELCODE , "play" , category , "Directo" , scrapedtitle , scrapedurl , scrapedthumbnail , scrapedplot )
	
	# Label (top-right)...
	xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category )
	# Disable sorting...
	xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE )
	# End of directory...
	xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
def buscartrailer(params,url,category):
	logger.info("[dospuntocerovision.py] buscartrailer")
	titulo = url
	#thumbnail = urllib.unquote_plus( params.get("thumbnail") )
	plot = urllib.unquote_plus( params.get("plot") )
	# ------------------------------------------------------------------------------------
	# Busca los enlaces a los videos
	# ------------------------------------------------------------------------------------
	listavideos = trailertools.gettrailer(titulo)
	if len(listavideos)>0:
		for video in listavideos:
			videotitle = video[1]
			url        = video[0]
			thumbnail  = video[2]
			xbmctools.addnewvideo( CHANNELNAME , "youtubeplay" , category , "Directo" ,  videotitle , url , thumbnail , "Ver Video" )
			
	#else:
	#	respuesta = trailertools.alertnoencontrado(titulo)
	#	if respuesta:
	#		listavideos = trailertools.trailerbykeyboard(titulo)
	#		for video in listavideos:
	#			videotitle = video[1]
	#			url        = video[0]
	#			thumbnail  = video[2]
	#			xbmctools.addnewvideo( CHANNELNAME , "youtubeplay" , category , "Directo" ,  videotitle , url , thumbnail , "Ver Video" )
	# ------------------------------------------------------------------------------------
	# Label (top-right)...
	xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category )

	# Disable sorting...
	xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE )

	# End of directory...
	xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
Пример #31
0
def searchresults(params,Url,category):
    logger.info("[peliculasyonkis.py] searchresults")
    
    buscador.salvar_busquedas(params,Url,category)
    
    url = "http://www.peliculasyonkis.com/buscarPelicula.php?s="+Url.replace(" ", "+")
    
    # Descarga la página
    data = scrapertools.cachePage(url)
    #logger.info(data)

    # Extrae las entradas (carpetas)
    #<li> <a href="http://www.peliculasyonkis.com/pelicula/las-edades-de-lulu-1990/" title="Las edades de Lulú (1990)"><img width="77" height="110" src="http://images.peliculasyonkis.com/thumbs/las-edades-de-lulu-1990.jpg" alt="Las edades de Lulú (1990)" align="right" />
    
    patronvideos  = '<li> <a href="([^"]+)" title="([^"]+)"><img.*?src="([^"]+)"'
    matches = re.compile(patronvideos,re.DOTALL).findall(data)
    scrapertools.printMatches(matches)

    for match in matches:
        scrapedtitle = match[1]
        scrapedurl = match[0]
        scrapedthumbnail = match[2]
        scrapedplot = ""
        if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]")
        xbmctools.addnewvideo( CHANNELNAME , "detail" , category , "Megavideo" , scrapedtitle , scrapedurl , scrapedthumbnail , scrapedplot )

    # Label (top-right)...
    xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category )

    # Disable sorting...
    xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE )

    # End of directory...
    xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
Пример #32
0
def detalle(params, url, category):
    logger.info("[filmstreaming.py] detalle")

    title = urllib.unquote_plus(params.get("title"))
    thumbnail = urllib.unquote_plus(params.get("thumbnail"))
    plot = urllib.unquote_plus(params.get("plot"))

    # Descarga la página
    data = scrapertools.cachePage(url)

    # ------------------------------------------------------------------------------------
    # Busca los enlaces a los videos
    # ------------------------------------------------------------------------------------
    listavideos = servertools.findvideos(data)

    for video in listavideos:
        videotitle = video[0]
        url = video[1]
        server = video[2]
        xbmctools.addnewvideo(
            CHANNELNAME, "play", category, server,
            title.strip() + " - " + videotitle + " [" + server + "]", url,
            thumbnail, plot)
    # ------------------------------------------------------------------------------------

    # Cierra el directorio
    xbmcplugin.setPluginCategory(handle=pluginhandle, category=category)
    xbmcplugin.addSortMethod(handle=pluginhandle,
                             sortMethod=xbmcplugin.SORT_METHOD_NONE)
    xbmcplugin.endOfDirectory(handle=pluginhandle, succeeded=True)
Пример #33
0
def addvideopage(data,params,url,category):

	# Extrae los vídeos
	patron =  '<div id="VideoClip">.*?'
	patron += '<div id="SearchThumbnail">[^<]+<a href="([^"]+)">.*?'
	patron += '<img src=([^\ ]+) .*?'
	patron += '<span class="VideoTitles"><h1>([^<]+)</h1>.*?'
	patron += '<span class="VideoDesc">([^<]+)</span>'
	matches = re.compile(patron,re.DOTALL).findall(data)
	if DEBUG:
		scrapertools.printMatches(matches)		

	# Los añade al directorio
	for match in matches:
		# Titulo
		scrapedtitle = match[2]
		# URL
		scrapedurl = urlparse.urljoin(url,match[0])
		# Thumbnail
		scrapedthumbnail = urlparse.urljoin(url,match[1])
		# Argumento
		scrapedplot = match[3]

		# Depuracion
		if (DEBUG):
			xbmc.output("scrapedtitle="+scrapedtitle)
			xbmc.output("scrapedurl="+scrapedurl)
			xbmc.output("scrapedthumbnail="+scrapedthumbnail)

		# Añade al listado de XBMC
		xbmctools.addnewvideo( CHANNELNAME , "play" , category , "youtube" , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot )
Пример #34
0
def detail(params,url,category):
	logger.info("[newcineonline.py] detail")

	title = urllib.unquote_plus( params.get("title") )
	thumbnail = urllib.unquote_plus( params.get("thumbnail") )

	# Descarga la página
	data = scrapertools.cachePage(url)
	#logger.info(data)
	
	# La siguiente página
	patronvideos  = '<embed src\="http\:\/\/wwwstatic.megavideo.com\/mv\_player\.swf\?image=[^\&]+\&amp\;v\=([^"]+)"'
	matches = re.compile(patronvideos,re.DOTALL).findall(data)
	scrapertools.printMatches(matches)
	if len(matches)>0:
		xbmctools.addnewvideo( CHANNELNAME , "play" , category , "Megavideo" , title + " - [Megavideo]" , matches[0], thumbnail , "" )

	# ------------------------------------------------------------------------------------
	# Busca los enlaces a los videos
	# ------------------------------------------------------------------------------------
	listavideos = servertools.findvideos(data)
	
	for video in listavideos:
		xbmctools.addnewvideo( CHANNELNAME , "play" , category , video[2] , title +" - "+video[0], video[1], thumbnail , "" )
	# ------------------------------------------------------------------------------------

	# Label (top-right)...
	xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category )
		
	# Disable sorting...
	xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE )

	# End of directory...
	xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
Пример #35
0
def list(params,url,category):
    logger.info("[seriesyonkis.py] list")

    title = urllib.unquote_plus( params.get("title") )

    if params.has_key("Serie"):
        Serie = params.get("Serie")
    else:
        Serie = ""

    if params.has_key("thumbnail"):
        thumbnail = params.get("thumbnail")
    else:
        thumbnail = ""

    from item import Item

    item = Item(channel=CHANNELNAME, title=title , url=url , thumbnail=thumbnail )
    itemlist = getlist(item)
    
    # Añade "Agregar todos a la librería"
    xbmctools.addnewvideo( CHANNELNAME , "addlist2Library" , category , "Megavideo", "AÑADIR TODOS LOS EPISODIOS A LA BIBLIOTECA" , url , thumbnail , "" , Serie)

    for item in itemlist:
        xbmctools.addnewvideo(item.channel , item.action , category , "Megavideo" , item.title , item.url , item.thumbnail, item.plot , Serie)

    xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category )
    xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE )
    xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
Пример #36
0
def homedetail(params, url, category):
    logger.info("[mcanime.py] homedetail")

    title = urllib.unquote_plus(params.get("title"))
    thumbnail = urllib.unquote_plus(params.get("thumbnail"))
    plot = urllib.unquote_plus(params.get("plot"))
    extradata = urllib.unquote_plus(params.get("extradata"))

    # ------------------------------------------------------------------------------------
    # Busca los enlaces a los videos
    # ------------------------------------------------------------------------------------
    listavideos = servertools.findvideos(extradata)

    for video in listavideos:
        videotitle = video[0]
        url = video[1]
        server = video[2]
        xbmctools.addnewvideo(CHANNELNAME, "play", category, server,
                              title.strip() + " - " + videotitle, url,
                              thumbnail, plot)
    # ------------------------------------------------------------------------------------

    # Cierra el directorio
    xbmcplugin.setPluginCategory(handle=int(sys.argv[1]), category=category)
    xbmcplugin.addSortMethod(handle=int(sys.argv[1]),
                             sortMethod=xbmcplugin.SORT_METHOD_NONE)
    xbmcplugin.endOfDirectory(handle=int(sys.argv[1]), succeeded=True)
def detail(params,url,category):
	xbmc.output("[vertelenovelasonline.py] detail")

	title = urllib.unquote_plus( params.get("title") )
	thumbnail = urllib.unquote_plus( params.get("thumbnail") )
	plot = urllib.unquote_plus( params.get("plot") )

	# Descarga la página
	data = scrapertools.cachePage(url)
	#xbmc.output(data)

	# ------------------------------------------------------------------------------------
	# Busca los enlaces a los videos
	# ------------------------------------------------------------------------------------
	listavideos = servertools.findvideos(data)

	for video in listavideos:
		videotitle = video[0]
		url = video[1]
		server = video[2]
		xbmctools.addnewvideo( CHANNELNAME , "play" , category , server , title.strip() + " - " + videotitle , url , thumbnail , plot )
	# ------------------------------------------------------------------------------------

	# Asigna el título, desactiva la ordenación, y cierra el directorio
	xbmcplugin.setPluginCategory( handle=pluginhandle, category=category )
	xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE )
	xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )
def mirrors(params,url,category):
	logger.info("[capitancinema.py] mirrors")

	title = urllib.unquote_plus( params.get("title") )
	thumbnail = urllib.unquote_plus( params.get("thumbnail") )
	plot = urllib.unquote_plus( params.get("plot") )

	# Descarga la página
	data = scrapertools.cachePage(url)
	patronvideos  = '<li><strong>DISPONIBLE EN EL FORO</strong>[^<]+<a href="([^"]+)"'
	matches = re.compile(patronvideos,re.DOTALL).findall(data)
	if len(matches)>0:
		url = matches[0]
		data = scrapertools.cachePage(url)

		# ------------------------------------------------------------------------------------
		# Busca los enlaces a los videos
		# ------------------------------------------------------------------------------------
		listavideos = servertools.findvideos(data)

		for video in listavideos:
			videotitle = video[0]
			url = video[1]
			server = video[2]
			xbmctools.addnewvideo( CHANNELNAME , "play" , category , server , title.strip() + " - " + videotitle , url , thumbnail , plot )
		# ------------------------------------------------------------------------------------

	# Cierra el directorio
	xbmcplugin.setPluginCategory( handle=pluginhandle, category=category )
	xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE )
	xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )
def detail(params,url,category):
	xbmc.output("[newcineonline.py] detail")

	title = urllib.unquote_plus( params.get("title") )
	thumbnail = urllib.unquote_plus( params.get("thumbnail") )

	# Descarga la página
	data = scrapertools.cachePage(url)
	#xbmc.output(data)
	
	# La siguiente página
	patronvideos  = '<embed src\="http\:\/\/wwwstatic.megavideo.com\/mv\_player\.swf\?image=[^\&]+\&amp\;v\=([^"]+)"'
	matches = re.compile(patronvideos,re.DOTALL).findall(data)
	scrapertools.printMatches(matches)
	if len(matches)>0:
		xbmctools.addnewvideo( CHANNELNAME , "play" , category , "Megavideo" , title + " - [Megavideo]" , matches[0], thumbnail , "" )

	# ------------------------------------------------------------------------------------
	# Busca los enlaces a los videos
	# ------------------------------------------------------------------------------------
	listavideos = servertools.findvideos(data)
	
	for video in listavideos:
		xbmctools.addnewvideo( CHANNELNAME , "play" , category , video[2] , title +" - "+video[0], video[1], thumbnail , "" )
	# ------------------------------------------------------------------------------------

	# Label (top-right)...
	xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category )
		
	# Disable sorting...
	xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE )

	# End of directory...
	xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
Пример #40
0
def mainlist(params,url,category):
    logger.info("[favoritos.py] mainlist")

    import xbmctools

    # Crea un listado con las entradas de favoritos
    if usingsamba:
        ficheros = samba.get_files(BOOKMARK_PATH)
    else:
        ficheros = os.listdir(BOOKMARK_PATH)
    ficheros.sort()
    for fichero in ficheros:

        try:
            # Lee el bookmark
            titulo,thumbnail,plot,server,url = readbookmark(fichero)

            # Crea la entrada
            # En la categoría va el nombre del fichero para poder borrarlo
            xbmctools.addnewvideo( CHANNELNAME , "play" , os.path.join( BOOKMARK_PATH, fichero ) , server , titulo , url , thumbnail, plot )
        except:
            pass

    # Label (top-right)...
    xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category )
    xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE )
    xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
Пример #41
0
def detail(params, url, category):
    logger.info("[terrorygore.py] detail")

    title = urllib.unquote_plus(params.get("title"))
    thumbnail = urllib.unquote_plus(params.get("thumbnail"))

    # Descarga la página
    data = scrapertools.cachePage(url)
    #logger.info(data)

    # ------------------------------------------------------------------------------------
    # Busca los enlaces a los videos
    # ------------------------------------------------------------------------------------
    listavideos = servertools.findvideos(data)

    for video in listavideos:
        xbmctools.addnewvideo(CHANNELNAME, "play", category, video[2],
                              title + " - " + video[0], video[1], thumbnail,
                              "")
    # ------------------------------------------------------------------------------------

    # Label (top-right)...
    xbmcplugin.setPluginCategory(handle=pluginhandle, category=category)

    # Disable sorting...
    xbmcplugin.addSortMethod(handle=pluginhandle,
                             sortMethod=xbmcplugin.SORT_METHOD_NONE)

    # End of directory...
    xbmcplugin.endOfDirectory(handle=pluginhandle, succeeded=True)
Пример #42
0
def mainlist(params,url,category):
    logger.info("[descargadoslist.py] mainlist")

    import xbmctools

    # Crea un listado con las entradas de la lista
    if usingsamba:
        ficheros = samba.get_files(DOWNLOAD_PATH)
    else:
        ficheros = os.listdir(DOWNLOAD_PATH)
    ficheros.sort()
    
    for fichero in ficheros:
        #xbmc.output("fichero="+fichero)
        try:
            # Lee el bookmark
            titulo,thumbnail,plot,server,url = readbookmark(fichero)

            # Crea la entrada
            # En la categoría va el nombre del fichero para poder borrarlo
            xbmctools.addnewvideo( CHANNELNAME , "play" , os.path.join( DOWNLOAD_PATH, fichero ) , server , titulo , url , thumbnail, plot )
        except:
            pass
            logger.info("[downloadall.py] error al leer bookmark")
            for line in sys.exc_info():
                logger.error( "%s" % line )

    xbmctools.addnewvideo( CHANNELNAME , "downloadall" , "category" , "server" , "(Empezar la descarga de la lista)" , "" , os.path.join(IMAGES_PATH, "Crystal_Clear_action_db_update.png"), "" )

    # Label (top-right)...
    xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category )
    xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE )
    xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
def listvideosTVmirror(params,url,category):
	logger.info("[dospuntocerovision.py] listvideosTVmirror")
	title = urllib.unquote_plus( params.get("title") )
	thumbnail = urllib.unquote_plus( params.get("thumbnail") )

	# Descarga la p�gina
	data = scrapertools.cachePage(url)
	# ------------------------------------------------------------------------------------
	# Busca los enlaces a los videos
	# ------------------------------------------------------------------------------------
	listavideos = servertools.findvideos(data)
	
	for video in listavideos:
		#logger.info("")
		if video[2] == "tu.tv":
			url = urllib.unquote_plus(servertools.findurl(video[1],video[2]))
			xbmctools.addnewvideo( CHANNELNAME , "detail" , category , "Directo" , title +" - "+video[0], url, thumbnail , "" )
		else:
			xbmctools.addnewvideo( CHANNELNAME , "detail" , category , video[2] , title +" - "+video[0], video[1], thumbnail , "" )
	# ------------------------------------------------------------------------------------

	# Label (top-right)...
	xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category )
		
	# Disable sorting...
	xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE )

	# End of directory...
	xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
Пример #44
0
def detail(params, url, category):
    logger.info("[descargapelis.py] detail")

    title = urllib.unquote_plus(params.get("title"))
    thumbnail = urllib.unquote_plus(params.get("thumbnail"))
    plot = ""

    # Descarga la página
    data = scrapertools.cachePage(url)
    #logger.info(data)

    patron = '<table width="100%" cellpadding="0" cellspacing="0">[^<]+?'
    patron += '<tr>[^<]+?<td align="center"><img src="(.+?)".+?'
    patron += '<td align="justify" valign="top" class="texto_peli"><b>Sinopsis de (.+?):</b>(.+?)<br />'
    matches = re.compile(patron, re.DOTALL).findall(data)
    if len(matches) > 0:
        if DEBUG:
            scrapertools.printMatches(matches)
            #xbmc.output('test')

    listavideos = servertools.findvideos(data)
    thumbnail = matches[0][0]
    plot = matches[0][2]
    title = matches[0][1]
    for video in listavideos:
        xbmctools.addnewvideo(CHANNELNAME, "play", CHANNELNAME, video[2],
                              title + " (" + video[2] + ")", video[1],
                              thumbnail, plot)

    # Label (top-right)...
    xbmcplugin.setPluginCategory(handle=int(sys.argv[1]), category=category)
    xbmcplugin.addSortMethod(handle=int(sys.argv[1]),
                             sortMethod=xbmcplugin.SORT_METHOD_NONE)
    xbmcplugin.endOfDirectory(handle=int(sys.argv[1]), succeeded=True)
Пример #45
0
def buscartrailer(params,url,category):
	print "[trailertools.py] Modulo: buscartrailer()"
	thumbnail = ""
	solo = "false"
	videotitle = title = urllib.unquote_plus( params.get("title") ).strip()
	if ":]" in videotitle:
		solo = "true"
		videotitle = re.sub("\[[^\]]+\]","",videotitle).strip()
	if config.getLocalizedString(30110) in videotitle: #"Buscar trailer para"
		videotitle = videotitle.replace(config.getLocalizedString(30110),"").strip()
	if config.getLocalizedString(30111) in videotitle: #"Insatisfecho?, busca otra vez : "
		videotitle = videotitle.replace(config.getLocalizedString(30111),"").strip()
	
		listavideos = GetTrailerbyKeyboard(videotitle.strip(),category)
	else:
		listavideos = gettrailer(videotitle.strip().strip(),category,solo)
	
	if len(listavideos)>0:
		for video in listavideos:
			titulo = video[1]
			url        = video[0]
			thumbnail  = video[2]
			duracion = video[3]
			xbmctools.addnewvideo( "trailertools" , "youtubeplay" , category , "Directo" ,  titulo , url , thumbnail , "Ver Video","",duracion )
	
	xbmctools.addnewfolder( CHANNELNAME , "buscartrailer" , category , config.getLocalizedString(30111)+" "+videotitle , url , os.path.join(IMAGES_PATH, 'trailertools.png'), "" ) #"Insatisfecho?, busca otra vez : "		
	# Propiedades
	xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category )
	xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE )
	xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
Пример #46
0
def ddpostdetail(params,url,category):
	logger.info("[mcanime.py] ddpostdetail")

	title = urllib.unquote_plus( params.get("title") )
	thumbnail = urllib.unquote_plus( params.get("thumbnail") )
	plot = unicode( xbmc.getInfoLabel( "ListItem.Plot" ), "utf-8" )

	# Descarga la p·gina
	data = scrapertools.cachePage(url)
	#logger.info(data)

	# Foto de la serie de la enciclopedia
	patron = '<img src="([^"]+)" width="300".*?class="title_pic" />'
	matches = re.compile(patron,re.DOTALL).findall(data)
	if len(matches)>0:
		thumbnail = matches[0]
	
	# Argumento - texto del post
	patron = '<div id="download_detail">(.*?)</div>'
	matches = re.compile(patron,re.DOTALL).findall(data)
	if len(matches)>0:
		plot = scrapertools.htmlclean(matches[0])
		plot = plot.replace("\r\n"," ")
		plot = plot.replace("\r"," ")
		plot = plot.replace("\n"," ")
		plot = plot.strip()

	# ------------------------------------------------------------------------------------
	# Busca los enlaces a los videos
	# ------------------------------------------------------------------------------------
	listavideos = servertools.findvideos(data)

	i = 1

	for video in listavideos:
		try:
			fulltitle = unicode( title.strip() + " (%d) " + video[0], "utf-8" ).encode("iso-8859-1")
		except:
			fulltitle = title.strip() + " (%d) " + video[0]
		fulltitle = fulltitle % i
		i = i + 1
		videourl = video[1]
		server = video[2]
		#logger.info("videotitle="+urllib.quote_plus( videotitle ))
		#logger.info("plot="+urllib.quote_plus( plot ))
		#plot = ""
		#logger.info("title="+urllib.quote_plus( title ))

		xbmctools.addnewvideo( CHANNELNAME , "play" , category , server , fulltitle , videourl , thumbnail , plot )
	# ------------------------------------------------------------------------------------

	# ------------------------------------------------------------------------------------
	# AÒade la opciÛn "AÒadir todos los vÌdeos a la lista de descarga"
	# ------------------------------------------------------------------------------------
	xbmctools.addnewvideo( CHANNELNAME , "addalltodownloadlist" , title , "" , "(AÒadir todos los vÌdeos a la lista de descarga)" , url , thumbnail , plot )
	
	# Cierra el directorio
	xbmcplugin.setPluginCategory( handle=pluginhandle, category=category )
	xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE )
	xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )
Пример #47
0
def listnovedades(params, url, category):
    logger.info("[peliculasyonkis.py] listnovedades")

    # Descarga la página
    data = scrapertools.cachePage(url)
    #logger.info(data)

    # Extrae las entradas (carpetas)
    '''
    <td align='center'>
    <center><span style='font-size: 0.7em'>
    <a href="http://www.peliculasyonkis.com/pelicula/otra-vez-tu-you-again-2010-/" title="Otra vez tu (You again) (2010 )">
    <img width='100' height='144' src='http://simages.peliculasyonkis.com/thumbs/otra-vez-tu-you-again-2010-.jpg' alt='Otra vez tu (You again) (2010 )'/><br />Otra vez tu (You again) (2010 )</a></span><br />
    <img height="30" src="http://simages.seriesyonkis.com/images/f/latino.png" alt="Audio Latino" style="vertical-align: middle;" /><img height="30" src="http://simages.peliculasyonkis.com/images/tdescargar2.png" title="Tiene Descarga Directa" style="vertical-align: middle;"/></center></td>
    '''
    patronvideos = '<td align=\'center\'>'
    patronvideos += '<center><span style=\'font-size: 0.7em\'>'
    patronvideos += '<a href="([^"]+)" title="([^"]+)">'
    patronvideos += '<img.*?src=\'([^\']+)\'[^>]+>.*?'
    patronvideos += '<img.*?src="(http://simages[^"]+)"'
    matches = re.compile(patronvideos, re.DOTALL).findall(data)
    scrapertools.printMatches(matches)

    for match in matches:
        # Titulo
        try:
            scrapedtitle = unicode(match[1], "utf-8").encode("iso-8859-1")
        except:
            scrapedtitle = match[1]

        # URL
        scrapedurl = match[0]

        # Thumbnail
        scrapedthumbnail = match[2]

        # procesa el resto
        scrapedplot = ""

        # Depuracion
        if (DEBUG):
            logger.info("scrapedtitle=" + scrapedtitle)
            logger.info("scrapedurl=" + scrapedurl)
            logger.info("scrapedthumbnail=" + scrapedthumbnail)

        # Añade al listado de XBMC
        xbmctools.addnewvideo(CHANNELNAME, "detail", category, "Megavideo",
                              scrapedtitle, scrapedurl, scrapedthumbnail,
                              scrapedplot)

    # Label (top-right)...
    xbmcplugin.setPluginCategory(handle=int(sys.argv[1]), category=category)

    # Disable sorting...
    xbmcplugin.addSortMethod(handle=int(sys.argv[1]),
                             sortMethod=xbmcplugin.SORT_METHOD_NONE)

    # End of directory...
    xbmcplugin.endOfDirectory(handle=int(sys.argv[1]), succeeded=True)
Пример #48
0
def list(params,url,category):
	logger.info("[megavideosite.py] list")

	xbmctools.addnewvideo( CHANNELNAME , "play" , category , "Megavideo" , "Ver el vídeo [Megavídeo]" , url , "" , "" )

	# Asigna el título, desactiva la ordenación, y cierra el directorio
	xbmcplugin.setPluginCategory( handle=pluginhandle, category=category )
	xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE )
	xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )
Пример #49
0
def lastepisodeslist(params,url,category):
    logger.info("[seriesyonkis.py] lastepisodeslist")

    # Descarga la página
    data = scrapertools.cachePage(url)
    #logger.info(data)

    # Extrae las entradas (carpetas)
    #<div class="ficha" style="background:url(http://images.seriesyonkis.com/images/house.jpg) #000000 center top no-repeat"><a href="http://www.seriesyonkis.com/capitulo/house/capitulo-01/44647/" title="(y 6x2) Broken">House - 6x01 - (y 6x2) Broken</a><br /><br /><img src="http://images.peliculasyonkis.com/images/tmegavideo.png" alt="Megavideo" style="vertical-align: middle;" /><img height="30" src="http://images.seriesyonkis.com/images/f/spanish.png" alt="Audio Español" title="Audio Español" style="vertical-align: middle;" /></div>
    #<div class="ficha" style="background:url(http://images.seriesyonkis.com/images/cinco-hermanos.jpg) #000000 center top no-repeat"><a href="http://www.seriesyonkis.com/capitulo/cinco-hermanos/capitulo-15/29162/" title="Capitulo 15">Cinco Hermanos - 3x15 - Capitulo 15</a><br /><br /><img src="http://images.peliculasyonkis.com/
    
    patronvideos  = '<div class="ficha" style="background:url\(([^\)]+)\)[^>]+><a.*?href="([^"]+)".*?>([^<]+)</a>(.*?)</div>'
    matches = re.compile(patronvideos,re.DOTALL).findall(data)
    scrapertools.printMatches(matches)

    for match in matches:
        # Titulo
        esp=eng=latino=vos= ""
        if "Audio Espa\xc3\xb1ol" in match[3]:
            esp = "(Esp)"
        if "Subt\xc3\xadtulos en Espa\xc3\xb1ol" in match[3]:
            vos = "(V.O.S)"
        if "Audio Latino" in match[3]:
            latino = "(Latino)"
        if "Audio Ingl\xc3\xa9s" in match[2]:
            eng = "(Eng)"            
        scrapedtitle = "%s    %s%s%s%s" %(match[2],esp,vos,eng,latino)
        
        scrapedtitle2 = match[2]

        # URL
        scrapedurl = match[1]
        
        # Thumbnail
        scrapedthumbnail = match[0]
        
        # procesa el resto
        scrapedplot = ""

        #Serie - Trata de extraerla del título (no hay carpeta de serie aquí)
        #Esto son pruebas "muy preliminares" esto puede dar problemas con series añadidas completas
        try:
            Serie = scrapedtitle2[:scrapedtitle2.find("- ")-1]
        except:
            logger.info ("[seriesyonkis.py] ERROR extrayendo y limpiando nombre de serie de:"+scrapedtitle)
            Serie = ""

        # Depuracion
        if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]")

        # Añade al listado de XBMC
        xbmctools.addnewvideo( CHANNELNAME , "detail" , category , "Megavideo" , scrapedtitle , scrapedurl , scrapedthumbnail , scrapedplot ,Serie)

    # Label (top-right)...
    xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category )
    xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE )
    xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
Пример #50
0
def videolist2(params,url,category):
	xbmc.output("[tva.py] videolist2")

	# --------------------------------------------------------
	# Descarga la página
	# --------------------------------------------------------
	data = scrapertools.cachePage(url)
	#xbmc.output(data)

	# --------------------------------------------------------
	# Extrae los videos
	# --------------------------------------------------------
	#patron = '<div class="texto">.*?<a href="([^"]+)">([^<]+)(.*?)</div>.*?<img src="([^"]+)"'
	titulo = params.get("title")
	patron='urlToPlay=([^"]+)\'>'
	match = re.compile(patron,re.DOTALL).findall(data)
	
	if DEBUG:
		scrapertools.printMatches(match)

	
	xbmc.output(match[0])
	scrapedtitle = scrapertools.entityunescape(match[0])
	# TODO: Sacar la fecha de la descripcion
	#patronfechas = "<p>Emissi&oacute;: ([^<]+)<"
	#matchesfechas = re.compile(patronfechas,re.DOTALL).findall(match[2])
	#if len(matchesfechas)>0:
	#	scrapedtitle = scrapedtitle + " (" + matchesfechas[0] + ")"

	scrapedurl = match[0]
	scrapedthumbnail = ""
	scrapedplot = ""
	
	#scrapedplot = "%s" % match[2]
	#scrapedplot = scrapedplot.strip()
	#scrapedplot = scrapedplot.replace("</a>","")
	#scrapedplot = scrapedplot.replace("</p>","")
	#scrapedplot = scrapedplot.replace("<p>","")
	#scrapedplot = scrapertools.entityunescape(scrapedplot)

	if (DEBUG): xbmc.output("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]")

	# Añade al listado de XBMC
	#addvideo( scrapedtitle , scrapedurl , category )
	xbmctools.addnewvideo( CHANNELCODE , "play" , CHANNELNAME , "" , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot )
	#server = "Directo"
	#xbmctools.playvideo(CHANNELNAME,server,scrapedurl,CHANNELNAME,scrapedtitle,scrapedthumbnail,scrapedplot)

	# Label (top-right)...
	xbmcplugin.setPluginCategory( handle=pluginhandle, category=category )
	#xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE )
	xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )	
Пример #51
0
def detallecapitulo(params, url, category):
    logger.info("[watchanimeon.py] detallecapitulo")

    title = urllib.unquote_plus(params.get("title"))
    thumbnail = urllib.unquote_plus(params.get("thumbnail"))
    plot = urllib.unquote_plus(params.get("plot"))

    # Descarga la página
    data = scrapertools.cachePage(url)
    #logger.info(data)

    # ------------------------------------------------------------------------------------
    # Busca los enlaces a los videos
    # ------------------------------------------------------------------------------------
    listavideos = servertools.findvideos(data)

    for video in listavideos:
        videotitle = video[0]
        url = video[1]
        server = video[2]
        xbmctools.addnewvideo(CHANNELNAME, "play", category, server,
                              title.strip() + " - " + videotitle, url,
                              thumbnail, plot)
    # ------------------------------------------------------------------------------------

    # Extrae el enlace a la serie completa
    patron = '<a href="([^"]+)" title="View all posts in'
    matches = re.compile(patron, re.DOTALL).findall(data)
    scrapertools.printMatches(matches)

    # Las añade a XBMC
    for match in matches:
        scrapedtitle = "Ver serie completa"
        scrapedurl = urlparse.urljoin(url, match)
        scrapedthumbnail = thumbnail
        scrapedplot = plot
        if (DEBUG):
            logger.info("title=[" + scrapedtitle + "], url=[" + scrapedurl +
                        "], thumbnail=[" + scrapedthumbnail + "]")

        # Añade al listado de XBMC
        xbmctools.addnewfolder(CHANNELNAME, "detalleserie", category,
                               scrapedtitle, scrapedurl, scrapedthumbnail,
                               scrapedplot)

    # Label (top-right)...
    xbmcplugin.setPluginCategory(handle=pluginhandle, category=category)
    xbmcplugin.addSortMethod(handle=pluginhandle,
                             sortMethod=xbmcplugin.SORT_METHOD_NONE)
    xbmcplugin.endOfDirectory(handle=pluginhandle, succeeded=True)
Пример #52
0
def extraevideos(patronvideos, data, category, title, thumbnail, plot,
                 servidor):
    logger.info("patron=" + patronvideos)
    matches = re.compile(patronvideos, re.DOTALL).findall(data)
    scrapertools.printMatches(matches)

    if len(matches) > 0:
        # A�ade al listado de XBMC
        if servidor == "Directo":

            xbmctools.addnewvideo(CHANNELNAME, "play", category, "Directo",
                                  title, matches[0], thumbnail, plot)

        elif servidor == "Veoh":

            veohurl = servertools.findurl(matches[0], "veoh")
            logger.info(" veohurl = " + veohurl)

            if len(veohurl) > 0:
                if veohurl == "http://./default.asp":
                    advertencia = xbmcgui.Dialog()
                    resultado = advertencia.ok(
                        'The Documental video', title, 'not exist in Veoh',
                        'visit the web www.documentariestv.net for report this'
                    )
                    return
                logger.info(" newmatches = " + veohurl)
                xbmctools.addnewvideo(CHANNELNAME, "play", category, "Directo",
                                      title, veohurl, thumbnail, plot)
            else:
                advertencia = xbmcgui.Dialog()
                resultado = advertencia.ok('The Documental video', title,
                                           'not exist in Veoh')
                return

        elif servidor == "Google":
            url = "http://www.flashvideodownloader.org/download.php?u=http://video.google.com/videoplay?docid=" + matches[
                0]
            logger.info(" Url = " + url)
            data = scrapertools.cachePage(url)
            newpatron = '</script><div.*?<a href="(.*?)" title="Click to Download">'
            newmatches = re.compile(newpatron, re.DOTALL).findall(data)
            if len(newmatches) > 0:
                logger.info(" newmatches = " + newmatches[0])
                xbmctools.addnewvideo(CHANNELNAME, "play", category, "Directo",
                                      title, newmatches[0], thumbnail, plot)

        elif servidor == "Stagevu":
            url = "http://stagevu.com/video/" + matches[0]
            url = servertools.findurl(url, servidor)

            logger.info(" url = " + url)
            if DEBUG:

                videotitle = "Video en Stagevu"
                server = servidor
                xbmctools.addnewvideo(
                    CHANNELNAME, "play", category, "Directo",
                    title.strip().replace(server, "").replace("  ", " ") +
                    " - " + videotitle, url, thumbnail, plot)
Пример #53
0
def mainlist(params,url,category):
	xbmc.output("[trailertools.py] mainlist")
	titulo = ""
	listavideos = GetTrailerbyKeyboard(titulo,category)
	if len(listavideos)>0:
		for video in listavideos:
			titulo = video[1]
			url        = video[0]
			thumbnail  = video[2]
			xbmctools.addnewvideo( "trailertools" , "youtubeplay" , category , "Directo" ,  titulo , url , thumbnail , "Ver Video" )
			
	xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category )
	xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE )
	xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )		
Пример #54
0
def listmirrors(params, url, category):
    logger.info("[veocine.py] listmirrors")

    #50=full list
    #xbmc.executebuiltin("Container.SetViewMode(50)")

    title = urllib.unquote_plus(params.get("title"))
    thumbnail = urllib.unquote_plus(params.get("thumbnail"))
    plot = urllib.unquote_plus(params.get("plot"))

    # Descarga la página de detalle
    data = scrapertools.cachePage(url)
    #logger.info(data)

    # Extrae los enlaces a los vídeos (Megavídeo)
    #reproductor.php?video=53842&media=tutv&titulo=Obsesion Extraterrestre - Mirror 1&titulop=Obsesion Extraterrestre
    #reproductor.php?video=KXLMR3C2&media=megavideo&titulo=Ciencia al desnudo: Jupiter - Mirror 1&titulop=Ciencia al desnudo: Jupiter&des=http%3A%2F%2Fwww.veodescargas.com%2Fdocumentales%2F13743-ciencia-al-desnudo-jupiter-dvb-s-national-geographic.html%23post30969
    patron = 'reproductor.php\?video=([^\&]+)\&(?:amp\;)?media=([^\&]+)\&(?:amp\;)?titulo=([^"]+)"'
    matches = re.compile(patron, re.DOTALL).findall(data)
    scrapertools.printMatches(matches)

    for match in matches:
        try:
            scrapedtitle = unicode(
                match[2], "utf-8").encode("iso-8859-1") + " (" + match[0] + ")"
        except:
            scrapedtitle = match[2] + " (" + match[0] + ")"
        scrapedurl = match[0]

        if match[1] == "megavideo":
            server = "Megavideo"
        elif match[1] == "tutv":
            server = "tu.tv"
        else:
            server = "Megavideo"

        # Añade al listado de XBMC
        xbmctools.addnewvideo(CHANNELNAME, "play", category, server,
                              scrapedtitle, scrapedurl, thumbnail, plot)

    # Label (top-right)...
    xbmcplugin.setPluginCategory(handle=pluginhandle, category=category)

    # Disable sorting...
    xbmcplugin.addSortMethod(handle=pluginhandle,
                             sortMethod=xbmcplugin.SORT_METHOD_NONE)

    # End of directory...
    xbmcplugin.endOfDirectory(handle=pluginhandle, succeeded=True)
Пример #55
0
def detailfolder(params, url, category):
    logger.info("[peliculasyonkis.py] detail")

    title = urllib.unquote_plus(params.get("title"))
    thumbnail = urllib.unquote_plus(params.get("thumbnail"))
    plot = unicode(xbmc.getInfoLabel("ListItem.Plot"), "utf-8")

    xbmctools.addnewvideo(CHANNELNAME, "detail", category, "Megavideo", title,
                          url, thumbnail, plot)

    # Label (top-right)...
    xbmcplugin.setPluginCategory(handle=int(sys.argv[1]), category=category)
    xbmcplugin.addSortMethod(handle=int(sys.argv[1]),
                             sortMethod=xbmcplugin.SORT_METHOD_NONE)
    xbmcplugin.endOfDirectory(handle=int(sys.argv[1]), succeeded=True)
Пример #56
0
def videos(params,url,category):
	xbmc.output("[delicast.py] videos")

	# --------------------------------------------------------
	# Descarga la página
	# --------------------------------------------------------
	data = scrapertools.cachePage(url)
	#xbmc.output(data)

	# --------------------------------------------------------
	# Extrae las cadenas
	# --------------------------------------------------------
	patron = '<a class=s1 href="([^"]+)">([^<]+)</a></TD><TD width=100%><a class=s href="[^"]+">([^<]+)</a>'
	matches = re.compile(patron,re.DOTALL).findall(data)
	if DEBUG: scrapertools.printMatches(matches)

	for match in matches:
		scrapedtitle = match[2]+" ("+match[1]+")"
		scrapedurl = match[0]
		scrapedthumbnail = ""
		scrapedplot = scrapedurl
		if (DEBUG): xbmc.output("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]")

		# Añade al listado de XBMC
		xbmctools.addnewvideo( CHANNELCODE , "play" , CHANNELNAME , "" , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot )

	# --------------------------------------------------------
	# Página siguiente
	# --------------------------------------------------------
	patron = "<a class=n href='([^']+)'><U>Siguiente .raquo.</U></a>"
	matches = re.compile(patron,re.DOTALL).findall(data)
	if DEBUG: scrapertools.printMatches(matches)

	for match in matches:
		scrapedtitle = "Página siguiente"
		scrapedurl = match
		scrapedthumbnail = ""
		scrapedplot = ""
		if (DEBUG): xbmc.output("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]")

		# Añade al listado de XBMC
		xbmctools.addnewfolder( CHANNELCODE , "videos" , CHANNELNAME , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot )

	# Cierra el directorio
	xbmcplugin.setPluginCategory( handle=pluginhandle, category=category )
	xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE )
	xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )
Пример #57
0
def detail(params, url, category):
    logger.info("[mocosoftx.py] detail")

    title = urllib.unquote_plus(params.get("title"))
    thumbnail = urllib.unquote_plus(params.get("thumbnail"))
    plot = unicode(xbmc.getInfoLabel("ListItem.Plot"), "utf-8")
    if "CDATA" in url:
        data = url
        patronthumb = '<img src="([^"]+)"'
        matches = re.compile(patronthumb, re.DOTALL).findall(data)
        scrapertools.printMatches(matches)
    else:
        #Descarga la página
        sid = GetSessionID()
        data = scrapertools.cachePage(url + sid)
        patronthumb = '<img src="([^"]+)" alt="" border="0" />[</a>|<br />]+'
        matches = re.compile(patronthumb, re.DOTALL).findall(data)
        scrapertools.printMatches(matches)
    #logger.info(data)


#addnewvideo( canal , accion , category , server , title , url , thumbnail, plot ):
# ------------------------------------------------------------------------------------
# Busca los enlaces a los videos
# ------------------------------------------------------------------------------------
    listavideos = servertools.findvideos(data)
    c = 0
    for video in listavideos:
        c = c + 1
        try:
            imagen = matches[c]
        except:
            imagen = thumbnail
        xbmctools.addnewvideo(CHANNELNAME, "play", category, video[2],
                              title + " - [" + video[2] + "]", video[1],
                              imagen, plot)
    # ------------------------------------------------------------------------------------

    # Label (top-right)...
    xbmcplugin.setPluginCategory(handle=pluginhandle, category=category)

    # Disable sorting...
    xbmcplugin.addSortMethod(handle=pluginhandle,
                             sortMethod=xbmcplugin.SORT_METHOD_NONE)

    # End of directory...
    xbmcplugin.endOfDirectory(handle=pluginhandle, succeeded=True)
Пример #58
0
def mainlist(params, url, category):
    xbmc.output("[descargadoslist.py] mainlist")

    # Crea el directorio de la lista de descargas si no existe
    try:
        os.mkdir(DOWNLOAD_PATH)
    except:
        pass
    try:
        os.mkdir(ERROR_PATH)
    except:
        pass

    # Crea un listado con las entradas de favoritos
    ficheros = os.listdir(DOWNLOAD_PATH)
    for fichero in ficheros:

        try:
            # Lee el bookmark
            titulo, thumbnail, plot, server, url = readbookmark(fichero)

            # Crea la entrada
            # En la categoría va el nombre del fichero para poder borrarlo
            xbmctools.addnewvideo(CHANNELNAME, "play",
                                  os.path.join(DOWNLOAD_PATH, fichero), server,
                                  titulo, url, thumbnail, plot)
        except:
            pass
            xbmc.output("[downloadall.py] error al leer bookmark")
            for line in sys.exc_info():
                xbmc.output("%s" % line, xbmc.LOGERROR)

    xbmctools.addnewvideo(
        CHANNELNAME, "downloadall", "category", "server",
        "(Empezar la descarga de la lista)", "",
        os.path.join(IMAGES_PATH, "Crystal_Clear_action_db_update.png"), "")

    # Label (top-right)...
    xbmcplugin.setPluginCategory(handle=int(sys.argv[1]), category=category)

    # Disable sorting...
    xbmcplugin.addSortMethod(handle=int(sys.argv[1]),
                             sortMethod=xbmcplugin.SORT_METHOD_NONE)

    # End of directory...
    xbmcplugin.endOfDirectory(handle=int(sys.argv[1]), succeeded=True)