Exemple #1
0
def findurl(code,server):
	mediaurl = "ERROR"
	if server == "Megavideo":
		mediaurl = megavideo.Megavideo(code)
		
	if server == "Megaupload":
		mediaurl = megaupload.getvideo(code)
		
	if server == "Wuapi":
		mediaurl = wuapi.Wuapi(code)
		
	if server == "Vreel":
		mediaurl = vreel.Vreel(code)

	if server == "Stagevu":
		mediaurl = stagevu.Stagevu(code)
	
	if server == "tu.tv":
		mediaurl = tutv.Tutv(code)
	
	if server == "movshare":
		mediaurl = movshare.getvideo(code)
	
	if server == "veoh":
		mediaurl = veoh.getvideo(code)
	
	if server == "Directo":
		mediaurl = code
	return mediaurl
def findurl(code,server):
	mediaurl = "ERROR"
	server = server.lower() #Para hacer el procedimiento case insensitive
	if server == "megavideo":
		mediaurl = megavideo.Megavideo(code)

	if server == "megaupload":
		mediaurl = megaupload.getvideo(code)
		
	if server == "wuapi":
		mediaurl = wuapi.Wuapi(code)
		
	if server == "vreel":
		mediaurl = vreel.Vreel(code)

	if server == "stagevu":
		mediaurl = stagevu.Stagevu(code)
	
	if server == "tu.tv":
		mediaurl = tutv.Tutv(code)
	
	if server == "movshare":
		mediaurl = movshare.getvideo(code)
	
	if server == "veoh":
		mediaurl = veoh.getvideo(code)
	
	if server == "directo":
		mediaurl = code
		
	if server == "metadivx":
		mediaurl = metadivx.geturl(code)

	if server == "divxden":
		mediaurl = divxden.geturl(code)

	if server == "divxlink":
		mediaurl = divxlink.geturl(code)

	if server == "videoweed":
		mediaurl = videoweed.geturl(code)
	
	if server == "youtube":
		mediaurl = youtube.geturl(code)
	
	if server == "cinshare":
		mediaurl = cinshare.geturl(code)
		
	if server == "facebook":
		mediaurl = code
		
	if server == "xml":
		mediaurl = xmltoplaylist.geturl(code)
		
	return mediaurl
Exemple #3
0
def findurl(code, server):
    mediaurl = "ERROR"
    server = server.lower()  #Para hacer el procedimiento case insensitive
    if server == "megavideo":
        mediaurl = megavideo.Megavideo(code)

    if server == "megaupload":
        mediaurl = megaupload.getvideo(code)

    if server == "wuapi":
        mediaurl = wuapi.Wuapi(code)

    if server == "vreel":
        mediaurl = vreel.Vreel(code)

    if server == "stagevu":
        mediaurl = stagevu.Stagevu(code)

    if server == "tu.tv":
        mediaurl = tutv.Tutv(code)

    if server == "movshare":
        mediaurl = movshare.getvideo(code)

    if server == "veoh":
        mediaurl = veoh.getvideo(code)

    if server == "directo":
        mediaurl = code

    if server == "metadivx":
        mediaurl = metadivx.geturl(code)

    if server == "divxden":
        mediaurl = divxden.geturl(code)

    if server == "divxlink":
        mediaurl = divxlink.geturl(code)

    if server == "videoweed":
        mediaurl = videoweed.geturl(code)

    if server == "youtube":
        mediaurl = youtube.geturl(code)

    if server == "cinshare":
        mediaurl = cinshare.geturl(code)

    if server == "facebook":
        mediaurl = code

    return mediaurl
def detail(params,url,category):
	logger.info("[peliculaseroticas.py] detail")

	title = urllib.unquote_plus( params.get("title") )
	thumbnail = urllib.unquote_plus( params.get("thumbnail") )
	thumnbail = thumbnail
	logger.info("[peliculaseroticas.py] title="+title)
	logger.info("[peliculaseroticas.py] thumbnail="+thumbnail)

	# Descarga la página
	data = scrapertools.cachePage(url)
        #logger.info(data)
        #detalle = "<div class='post-body entry-content'>([^<]+).*?"
        #matches = re.compile(detalle,re.DOTALL).findall(data)
        #matches += thumnbail
	#scrapertools.printMatches(matches)
        thumbnail = thumnbail
        plot = urllib.unquote_plus( params.get("plot") )
        
	# ------------------------------------------------------------------------------------
	# Busca los enlaces a los videos
	# ------------------------------------------------------------------------------------
	listavideos = servertools.findvideos(data)

	for video in listavideos:
                
                titulo = title.replace("%28"," ")
                titulo = titulo.replace("%29"," ")
                server = video[2]
        #	xbmctools.addvideo( CHANNELNAME , video[0], video[1] , category ,         #plot )
                xbmctools.addnewvideo( CHANNELNAME , "play" , category , server , titulo.strip().replace("(Megavideo)","").replace("+"," ") +" - "+video[0]  , video[1] ,thumbnail, plot )
	# ------------------------------------------------------------------------------------



       # Extrae los enlaces a los vídeos (Directo)

         # Extrae los videos para el servidor mystream.to

        patronvideos = '(http://www.mystream.to/.*?)"'
        matches = re.compile(patronvideos,re.DOTALL).findall(data)
        #logger.info(data)
        #logger.info("[peliculaseroticas.py] matches="+matches[0])  
        if len(matches)>0:
            data = scrapertools.cachePage(matches[0])
            patronvideos = 'flashvars" value="file=(.*?)"'
            videosdirecto = re.compile(patronvideos,re.DOTALL).findall(data)
            #logger.info("[peliculaseroticas.py] videosdirecto="+videosdirecto[0])
            if len(videosdirecto)>0:
              xbmctools.addnewvideo( CHANNELNAME , "play" , category , "Directo" , title+" - Directo con mystream.to"  , videosdirecto[0] ,thumbnail, plot )
       
        patronvideos = "<div class='post-body entry-content'>.*?</span><a href=\"(.*?)\" target="
        matches = re.compile(patronvideos,re.DOTALL).findall(data) 
        if len(matches)>0: 
        # extrae los videos para servidor movshare
              data = scrapertools.cachePage(matches[0])
              patronvideos ='param name="src" value="http://stream.movshare.net/(.*?).avi'   
              videosdirecto = re.compile(patronvideos,re.DOTALL).findall(data)
            #logger.info("[peliculaseroticas.py] videosdirecto="+videosdirecto[0])
              if len(videosdirecto)>0:
                 import movshare
                 mediaurl = "http://www.movshare.net/video/" + videosdirecto[0]
                 logger.info("[peliculaseroticas.py] mediaurl = "+ mediaurl)
                 mediaurl = movshare.getvideo(mediaurl)
                 xbmctools.addnewvideo( CHANNELNAME , "play" , category , "Directo" , title+" - Video en movshare"  , mediaurl ,thumbnail, plot )

	      patronvideos = 'file=(http://www.wildscreen.tv.*?)\?'
	      matches = re.compile(patronvideos,re.DOTALL).findall(data)
	      if len(matches)>0:
				xbmctools.addnewvideo( CHANNELNAME , "play" , category , "Directo" , title+" - Video en wildscreen.tv"  , matches[0] ,thumbnail, plot )
				
             # extrae los videos para servidor stagevu
              patronvideos ="http://stagevu.com/.*?uid=(.*?)'"   
              videosdirecto = re.compile(patronvideos,re.DOTALL).findall(data)
            #logger.info("[peliculaseroticas.py] videosdirecto="+videosdirecto[0])
              if len(videosdirecto)>0:
                 import stagevu
                 mediaurl = "http://stagevu.com/video/" + videosdirecto[0]
                 logger.info("[peliculaseroticas.py] mediaurl = "+ mediaurl)
                 mediaurl = stagevu.Stagevu(mediaurl)
                 xbmctools.addnewvideo( CHANNELNAME , "play" , category , "Directo" , title+" - Video en stagevu"  , mediaurl ,thumbnail, plot ) 
                
	# --------------------------------------------------------------------------------             

        # extrae los videos para servidor myspacecdn      
  
        data = scrapertools.cachePage(url)
        patronvideos = 'flashvars.*?file=(.*?.flv).*?'
        videosdirecto = re.compile(patronvideos,re.DOTALL).findall(data)
        #logger.info("[peliculaseroticas.py] videosdirecto="+videosdirecto[0])
        if len(videosdirecto)>0:
              xbmctools.addnewvideo( CHANNELNAME , "play" , category , "Directo" , title+" - Video en myspacecdn"  , videosdirecto[0] ,thumbnail, plot )
	# --------------------------------------------------------------------------------
        
        # extrae los videos para del servidor adnstream.com
          
        patronvideos = '<a href=\"http://www.adnstream.tv/video/(.*?)/.*?"'
        matches = re.compile(patronvideos,re.DOTALL).findall(data)
        #logger.info("[peliculaseroticas.py] matches="+matches[0])
        if len(matches)>0:
              mediaurl = "http://www.adnstream.tv/get_playlist.php?lista=video&param="+matches[0]+"&c=463"
              logger.info(" mediaurl -------"+mediaurl)
              data = scrapertools.cachePage(mediaurl)
              #logger.info("[peliculaseroticas.py] data="+data)
              patronvideos = '</description>.*?<enclosure type="video/x-flv" url="(.*?)"'
              matchvideo = re.compile(patronvideos,re.DOTALL).findall(data)
              if len(matchvideo)>0:
                 logger.info("[peliculaseroticas.py] videoflv = "+ matchvideo[0])
                 xbmctools.addnewvideo( CHANNELNAME , "play" , category , "Directo" , title+" - Video en adnstream.tv"  , matchvideo[0] ,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 listarvideos(params,url,category,data):
    titulo = params.get("title")
    xbmc.output("[dospuntocerovision.py] listarvideos ")
    plot = params.get("plot")
    patronmovshare   = 'href="(http://www.movshare.net/.*?)"[^>]+>(.*?)<'         
    patronmegavideoflv= 'href="(http://www.megavideoflv.com/.*?)"'
    patronmegavideo  = 'href="http://www.megavideo.com/.*?v=(.*?)\&.*?>(.*?)</a>'
    patronmegavideo2 = '(<b[^"]+|<b[^<]+<b[^"]+)".*?http\:\/\/www.megavideo.com/\?(v\=|d\=)([A-Z0-9]{8})".*?>(.*?)</a>(.*?)<'
    patronvideo      = "<a href='.*?'>(.*?)<.*?src=\"([^\"]+)\".*? alt=.*?;\">(.*?)</div>"
    patroncinegratis = 'href="(http://www.cinegratis24h.com/.*?)"'
    patronflv        = 'flashvars="file=(http.*?.flv)'	
    scrapedtitle     = ""
    scrapedthumbnail = ""
    scrapedplot      = ""
#-------------------------------------------------------------------------------
    matchesvideo     = re.compile(patronvideo,re.DOTALL).findall(data)
    for match in matchesvideo:
        scrapedtitle = match[0]
        scrapedthumbnail = match[1]
        scrapedplot = match [2]
        scrapedplot = re.sub("<[^>]+>"," ",scrapedplot)
        scrapedplot = scrapedplot.replace("&#191;","�")
        scrapedplot = acentos(scrapedplot)
        
    if DEBUG and ("+" == plot):
		
		detalle = "Esta opcion permite buscar el trailer en youtube para esta pelicula y muestra hasta seis titulos mas aproximados si los hay \n "
		xbmctools.addnewfolder( "trailertools" , "buscartrailer" , category ,"Buscar trailer para : "+scrapedtitle  , titulo , os.path.join(IMAGES_PATH, 'trailertools.png'), detalle )
#-------------------------------------------------------------------------------    
       
    matchesmegavideo = re.compile(patronmegavideo,re.DOTALL).findall(data) # busca los links de megavideo
#http://www.megavideo.com/?s=dospuntocerovision&amp;v=R30GGEMG&amp;confirmed=1
    #xbmc.output("videos Match " +matchesmegavideo[0])
    for match in matchesmegavideo:
	scrapedurl = match[0]
	# A�ade al listado de XBMC
        xbmctools.addnewvideo( CHANNELNAME , "detail" , category , "Megavideo" , scrapedtitle+" - "+match[1]+" - (Megavideo)" , scrapedurl , scrapedthumbnail , scrapedplot ) 

  #http://www.megavideo.com/?v=0I5DDHA8

    matchesmegavideo = re.compile(patronmegavideo2,re.DOTALL).findall(data) # busca los links de megavideo
    for match in matchesmegavideo:
        scrapedurl = match[2]
        titulo = re.sub("<[^>]+>","",match[0])
        titulo = titulo.replace("<a href=","")
        titulo = titulo.replace("<a style=","")
        titulo = titulo.replace("<span style=","")
        titulo = titulo.replace("<div style=","")
        if "megavideo" in match[3]:titulo=titulo +match[4]
        else: titulo = titulo+match[3]+match[4]
        
        if "v" in match[1]:
			xbmctools.addnewvideo( CHANNELNAME , "detail" , category , "Megavideo" , scrapedtitle+" - "+titulo+" - (Megavideo)" , scrapedurl , scrapedthumbnail , scrapedplot )
        elif "d" in match[1]:
			xbmctools.addnewvideo( CHANNELNAME , "detail" , category , "Megaupload" , scrapedtitle+" - "+titulo+" - (Megaupload)" , scrapedurl , scrapedthumbnail , scrapedplot )	
			
#-------------------------------------------------------------------------------
	
    matchescinegratis= re.compile(patroncinegratis,re.DOTALL).findall(data) # busca los links de la pagina de cinegratis24h.com
    if len(matchescinegratis)>0:
        #xbmc.output("videos Match " +matchescinegratis[0])
        data1 = scrapertools.cachePage(matchescinegratis[0])
        matchesflv   = re.compile(patronflv,re.DOTALL).findall(data1)
        c = 0
        for match in matchesflv:
            c = c + 1
            scrapedurl = match
            # A�ade al listado de XBMC
            xbmctools.addnewvideo( CHANNELNAME , "detail" , category , "Directo" , scrapedtitle +" - "+"parte "+str(c)+" (FLV) (V.O.S.)", scrapedurl , scrapedthumbnail , scrapedplot )

#-------------------------------------------------------------------------------
    
    matchesmegavideoflv = re.compile(patronmegavideoflv,re.DOTALL).findall(data)  # Busca los link de megavideoflv.com
    if len(matchesmegavideoflv)>0:
        #xbmc.output("videos Match " +matchesmegavideoflv[0])
        data1 = scrapertools.cachePage(matchesmegavideoflv[0])
        matchesflv   = re.compile(patronflv,re.DOTALL).findall(data1)
        c = 0
        for match in matchesflv:
            c = c + 1
            scrapedurl = match
            # A�ade al listado de XBMC
            xbmctools.addnewvideo( CHANNELNAME , "detail" , category , "Directo" , scrapedtitle +" - "+"parte "+str(c)+" (FLV)", scrapedurl , scrapedthumbnail , scrapedplot )
    matchesmovshare = re.compile(patronmovshare,re.DOTALL).findall(data)
    if len(matchesmovshare)>0:
       #import movshare
        
       total = len(matchesmovshare)
       for match in matchesmovshare:
		xbmc.output("movshare link : "+match[0])
		
		import movshare
		scrapedurl = movshare.getvideo(match[0])
		if len(scrapedurl)>0:
			
			xbmctools.addnewvideo( CHANNELNAME , "detail" , category , "Directo" , scrapedtitle +" - "+match[1]+" (Movshare)", scrapedurl , scrapedthumbnail , scrapedplot )     

#-------------------------------------------------------------------------------
   
    matchesvideoflv = re.compile(patronflv,re.DOTALL).findall(data)  # busca los link flashvar directos
    if len(matchesvideoflv)>0:
      for match in matchesvideoflv:
          scrapedurl = match 
	  # A�ade al listado de XBMC
          xbmctools.addnewvideo( CHANNELNAME , "detail" , category , "Directo" , scrapedtitle +" - "+"Directo  (FLV)", scrapedurl , scrapedthumbnail , scrapedplot ) 
 
    # Busca la lista de los videos documentales de suricato.com para youtube  

    patronyoutube = '<param name="movie" value="http://www.youtube.com/p/(.*?)\&'
    matchyoutube  = re.compile(patronyoutube,re.DOTALL).findall(data)
    if len(matchyoutube)>0:
      for match in matchyoutube:
        listyoutubeurl = 'http://www.youtube.com/view_play_list?p='+match
        data1 = scrapertools.cachePage(listyoutubeurl)
        newpatronyoutube = '<a class="video-thumb-120" href="(.*?)"   ><img title="(.*?)"    src="(.*?)"'
        matchnewyoutube  = re.compile(newpatronyoutube,re.DOTALL).findall(data1)
        if len(matchnewyoutube)>0:
           for match2 in matchnewyoutube:
               scrapedthumbnail = match2[2]
               scrapedtitle     = match2[1]
               scrapedurl       = match2[0]
     
               xbmc.output(" lista de links encontrados U "+str(len(matchnewyoutube)))
            
               xbmctools.addnewvideo( CHANNELNAME , "youtubeplay" , category , "Directo" , scrapedtitle +" - "+"(youtube) ", scrapedurl , scrapedthumbnail , scrapedplot )
            
#-------------------------------------------------------------------------------
    patronyoutube = '<a href="http://www.youtube.com(/watch\?v\=.*?)".*?>(.*?)</a>'
    matchyoutube  = re.compile(patronyoutube,re.DOTALL).findall(data)
    for match in matchyoutube:
		scrapedtitle = match[1]
		scrapedtitle = re.sub("<[^>]+>"," ",scrapedtitle)
		scrapedurl   = match[0]
		xbmctools.addnewvideo( CHANNELNAME , "youtubeplay" , category , "Directo" , scrapedtitle +" - "+"(youtube) ", scrapedurl , scrapedthumbnail , scrapedplot )
		
    # busca los link directos de Google

    patrongoogle  = 'href="(http://video.google.com/videoplay.*?)"'
    matchesgoogle = re.compile(patrongoogle,re.DOTALL).findall(data)
    for match in matchesgoogle:
        urllink = "http://www.flashvideodownloader.org/download.php?u="+match
        xbmc.output(" Url = "+urllink[0])
        data1 = scrapertools.cachePage(urllink)
        newpatron = '</script><div.*?<a href="(.*?)" title="Click to Download">'
        newmatches = re.compile(newpatron,re.DOTALL).findall(data1)
        if len(newmatches)>0:
          scrapedurl = newmatches[0]
          xbmctools.addnewvideo( CHANNELNAME , "detail" , category , "Directo" , scrapedtitle +" - "+"(Google) ", scrapedurl , scrapedthumbnail , scrapedplot )
          
    # busca las url de los videos alojados en tu.tv
    patronvideotv = '(http://www.tu.tv/videos/.*?)"><img src="(.*?)" alt="(.*?)".*?'
    #xbmc.output("dataa "+data)
    matchestv  = re.compile(patronvideotv,re.DOTALL).findall(data)
    for match in matchestv:
		xbmctools.addnewfolder( CHANNELNAME , "listvideosTVmirror" , category , match[2] , match[0] , match[1], scrapedplot ) 
def findurl(code,server):
    mediaurl = "ERROR"
    server = server.lower() #Para hacer el procedimiento case insensitive

    if server == "megavideo":
        import megavideo
        mediaurl = megavideo.Megavideo(code)

    if server == "megaupload":
        import megaupload
        mediaurl = megaupload.getvideo(code)
        
    if server == "vreel":
        import vreel
        mediaurl = vreel.Vreel(code)

    if server == "stagevu":
        import stagevu
        mediaurl = stagevu.Stagevu(code)
    
    if server == "tu.tv":
        import tutv
        mediaurl = tutv.Tutv(code)
    
    if server == "movshare":
        import movshare
        mediaurl = movshare.getvideo(code)
    
    if server == "veoh":
        import veoh
        mediaurl = veoh.getvideo(code)
    
    if server == "directo":
        mediaurl = code
        
    if server == "metadivx":
        import metadivx
        mediaurl = metadivx.geturl(code)

    if server == "divxden":
        import divxden
        mediaurl = divxden.geturl(code)

    if server == "divxlink":
        import divxlink
        mediaurl = divxlink.geturl(code)

    if server == "videoweed":
        import videoweed
        mediaurl = videoweed.geturl(code)
    
    if server == "youtube":
        import youtube
        mediaurl = youtube.geturl(code)
    
    if server == "zshare":
        import zshare
        mediaurl = zshare.geturl(code)

    if server == "4shared":
        import fourshared
        mediaurl = fourshared.geturl(code)
    
    if server == "cinshare":
        import cinshare
        mediaurl = cinshare.geturl(code)
        
    if server == "facebook":
        mediaurl = code
        
    if server == "xml":
        import xmltoplaylist
        mediaurl = xmltoplaylist.geturl(code)

    if server == "vimeo":
        import vimeo
        mediaurl = vimeo.geturl(code)
        
    return mediaurl