def performsearch(texto):
    logger.info("[sesionvip.py] performsearch")
    url = "http://www.sesionvip.com/?s="+texto

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

    # Extrae las entradas (carpetas)
    patronvideos  = '<div class="entry">.*?'
    patronvideos += '<a href="([^"]+)" rel="bookmark">([^<]+)</a>'
    matches = re.compile(patronvideos,re.DOTALL).findall(data)
    scrapertools.printMatches(matches)
    
    resultados = []

    for match in matches:
        # Titulo
        scrapedtitle = match[1]
        if not scrapedtitle.startswith("Descargar"):
            scrapedtitle = scrapertools.unseo(scrapedtitle)
            scrapedurl = urlparse.urljoin(url,match[0])
            scrapedthumbnail = ""
            scrapedplot = ""

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

        # Añade al listado de XBMC
        resultados.append( [CHANNELNAME , "listmirrors" , "buscador" , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot ] )
        


    return resultados
Exemplo n.º 2
0
def performsearch(texto):
    logger.info("[sesionvip.py] performsearch")
    url = "http://www.sesionvip.com/?s=" + texto

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

    # Extrae las entradas (carpetas)
    patronvideos = '<div class="entry">.*?'
    patronvideos += '<a href="([^"]+)" rel="bookmark">([^<]+)</a>'
    matches = re.compile(patronvideos, re.DOTALL).findall(data)
    scrapertools.printMatches(matches)

    resultados = []

    for match in matches:
        # Titulo
        scrapedtitle = match[1]
        if not scrapedtitle.startswith("Descargar"):
            scrapedtitle = scrapertools.unseo(scrapedtitle)
            scrapedurl = urlparse.urljoin(url, match[0])
            scrapedthumbnail = ""
            scrapedplot = ""

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

        # Añade al listado de XBMC
        resultados.append([
            CHANNELNAME, "listmirrors", "buscador", scrapedtitle, scrapedurl,
            scrapedthumbnail, scrapedplot
        ])

    return resultados
Exemplo n.º 3
0
def searchresults(params, url, category):
    logger.info("[sesionvip.py] searchresults")

    # Descarga la página
    data = scrapertools.cachePage(url)
    patronvideos = '<div class="entry">.*?'
    patronvideos += '<a href="([^"]+)" rel="bookmark">([^<]+)</a>'
    matches = re.compile(patronvideos, re.DOTALL).findall(data)
    scrapertools.printMatches(matches)

    for match in matches:
        # Titulo
        scrapedtitle = match[1]
        if not scrapedtitle.startswith("Descargar"):
            #Elimina todos los prefijos SEO
            scrapedtitle = scrapertools.unseo(scrapedtitle)
            # URL
            scrapedurl = urlparse.urljoin(url, match[0])
            # Thumbnail
            scrapedthumbnail = ""
            # Argumento
            scrapedplot = ""

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

            # Añade al listado de XBMC
            xbmctools.addthumbnailfolder(CHANNELNAME, scrapedtitle, scrapedurl,
                                         scrapedthumbnail, "listmirrors")

    # 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)
Exemplo n.º 4
0
def novedades(params,url,category):
    logger.info("[sevillista.py] novedades")
    
    # Descarga la página
    data = scrapertools.cachePage(url)
    #logger.info(data)

    # Extrae las entradas
    patron  = "<div class='post hentry'>[^<]+"
    patron += "<a name='[^']+'></a>[^<]+"
    patron += "<h3 class='post-title entry-title'>[^<]+"
    patron += "<a href='([^']+)'>([^<]+)</a>[^<]+"
    patron += "</h3>.*?"
    patron += '<img.*?src="([^"]+)"'

    matches = re.compile(patron,re.DOTALL).findall(data)
    scrapertools.printMatches(matches)

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

    patron  = "<div id='blog-pager'>.*?a href='([^']+)' id='[^']+' title='Entradas antiguas'>"
    matches = re.compile(patron,re.DOTALL).findall(data)
    scrapertools.printMatches(matches)
    if len(matches)>0:
        scrapedtitle = "!Página siguiente"
        scrapedurl = urlparse.urljoin(url,matches[0])
        scrapedthumbnail = ""
        scrapedplot = ""
        if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]")
        xbmctools.addnewfolder( CHANNELNAME , "novedades" , 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 searchresults(params,url,category):
    logger.info("[sesionvip.py] searchresults")

    # Descarga la página
    data = scrapertools.cachePage(url)
    patronvideos  = '<div class="entry">.*?'
    patronvideos += '<a href="([^"]+)" rel="bookmark">([^<]+)</a>'
    matches = re.compile(patronvideos,re.DOTALL).findall(data)
    scrapertools.printMatches(matches)

    for match in matches:
        # Titulo
        scrapedtitle = match[1]
        if not scrapedtitle.startswith("Descargar"):
            #Elimina todos los prefijos SEO
            scrapedtitle = scrapertools.unseo(scrapedtitle)
            # URL
            scrapedurl = urlparse.urljoin(url,match[0])
            # Thumbnail
            scrapedthumbnail = ""
            # Argumento
            scrapedplot = ""

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

            # Añade al listado de XBMC
            xbmctools.addthumbnailfolder( CHANNELNAME , scrapedtitle , scrapedurl , scrapedthumbnail, "listmirrors" )

    # 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 newlist(params,url,category):
    logger.info("[sesionvip.py] newlist")

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

    '''
    <div class="entry"><!-- Entry -->
    <h3 class="post-title">
    <a href="http://www.sesionvip.com/ver-online-millennium-2-la-chica-que-sonaba-con-una-cerilla-y-un-bidon-de-gasolina-en-alta-calidad" rel="bookmark">ver online millennium 2 La Chica Que Soñaba Con Una Cerilla Y Un Bidón De Gasolina en alta calidad</a>
    </h3>
    <p style="text-align: center;">YA DISPONIBLE &#8211; CALIDAD TS-SCREENER ALTO</p>
    <p style="text-align: center;"><img class="aligncenter size-medium wp-image-9125" title="peliculas online" src="http://www.sesionvip.com/wp-content/uploads/2009/08/1843318212-222x300.jpg" alt="peliculas online" width="222" height="300" /></p>
    <p style="text-align: left;"> <a href="http://www.sesionvip.com/ver-online-millennium-2-la-chica-que-sonaba-con-una-cerilla-y-un-bidon-de-gasolina-en-alta-calidad#more-9124" class="more-link">PULSA AQUI PARA <strong>Ver la pelicula online</strong></a></p>
    <div id="postmeta" class="postmetabox">
    Categoria: <a href="http://www.sesionvip.com/category/estrenos-online" title="Ver todas las entradas en Estrenos Online" rel="category tag">Estrenos Online</a>                                                <br/><a href="http://www.sesionvip.com/ver-online-millennium-2-la-chica-que-sonaba-con-una-cerilla-y-un-bidon-de-gasolina-en-alta-calidad#comments" title="Comentarios en ver online millennium 2 La Chica Que Soñaba Con Una Cerilla Y Un Bidón De Gasolina en alta calidad"><strong>Comments (3)</strong></a>
    </div>
    </div><!--/entry-->
    '''
    # Extrae las entradas (carpetas)
    
    patronvideos  = '<div class="entry"><!-- Entry -->(.*?)<!--/entry-->'
    matches = re.compile(patronvideos,re.DOTALL).findall(data)
    scrapertools.printMatches(matches)
    for match in matches:
        logger.info("match="+match)
        nuevopatron = '<a href="([^"]+)" rel="bookmark">([^<]+)</a>'#<img.*?src="([^"]+)"'
        nuevomatches = re.compile(nuevopatron,re.DOTALL).findall(match)
        logger.info("len(nuevomatches)=%d" % len(nuevomatches))
        scrapertools.printMatches(nuevomatches)

        # Titulo
        scrapedtitle = nuevomatches[0][1]
        if not scrapedtitle.startswith("Descargar"):
            #Elimina todos los prefijos SEO
            scrapedtitle = scrapertools.unseo(scrapedtitle)
            # URL
            scrapedurl = urlparse.urljoin(url,nuevomatches[0][0])
            # Thumbnail
            scrapedthumbnail = ""#urlparse.urljoin(url,nuevomatches[2])
            # Argumento
            scrapedplot = ""

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

            # Añade al listado de XBMC
            xbmctools.addthumbnailfolder( CHANNELNAME , scrapedtitle , scrapedurl , scrapedthumbnail, "listmirrors" )

    # Página siguiente
    patronvideos  = '<div class="back"><a href="([^"]+)"'
    matches = re.compile(patronvideos,re.DOTALL).findall(data)
    scrapertools.printMatches(matches)

    for match in matches:
        # Titulo
        scrapedtitle = "Página siguiente"
        # URL
        scrapedurl = urlparse.urljoin(url,match)
        # Thumbnail
        scrapedthumbnail = ""
        # Argumento
        scrapedplot = ""

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

        # Añade al listado de XBMC
        xbmctools.addthumbnailfolder( CHANNELNAME , scrapedtitle , scrapedurl , scrapedthumbnail, "newlist" )

    # 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 )
Exemplo n.º 7
0
def newlist(params, url, category):
    logger.info("[sesionvip.py] newlist")

    # Descarga la página
    data = scrapertools.cachePage(url)
    #logger.info(data)
    '''
    <div class="entry"><!-- Entry -->
    <h3 class="post-title">
    <a href="http://www.sesionvip.com/ver-online-millennium-2-la-chica-que-sonaba-con-una-cerilla-y-un-bidon-de-gasolina-en-alta-calidad" rel="bookmark">ver online millennium 2 La Chica Que Soñaba Con Una Cerilla Y Un Bidón De Gasolina en alta calidad</a>
    </h3>
    <p style="text-align: center;">YA DISPONIBLE &#8211; CALIDAD TS-SCREENER ALTO</p>
    <p style="text-align: center;"><img class="aligncenter size-medium wp-image-9125" title="peliculas online" src="http://www.sesionvip.com/wp-content/uploads/2009/08/1843318212-222x300.jpg" alt="peliculas online" width="222" height="300" /></p>
    <p style="text-align: left;"> <a href="http://www.sesionvip.com/ver-online-millennium-2-la-chica-que-sonaba-con-una-cerilla-y-un-bidon-de-gasolina-en-alta-calidad#more-9124" class="more-link">PULSA AQUI PARA <strong>Ver la pelicula online</strong></a></p>
    <div id="postmeta" class="postmetabox">
    Categoria: <a href="http://www.sesionvip.com/category/estrenos-online" title="Ver todas las entradas en Estrenos Online" rel="category tag">Estrenos Online</a>                                                <br/><a href="http://www.sesionvip.com/ver-online-millennium-2-la-chica-que-sonaba-con-una-cerilla-y-un-bidon-de-gasolina-en-alta-calidad#comments" title="Comentarios en ver online millennium 2 La Chica Que Soñaba Con Una Cerilla Y Un Bidón De Gasolina en alta calidad"><strong>Comments (3)</strong></a>
    </div>
    </div><!--/entry-->
    '''
    # Extrae las entradas (carpetas)

    patronvideos = '<div class="entry"><!-- Entry -->(.*?)<!--/entry-->'
    matches = re.compile(patronvideos, re.DOTALL).findall(data)
    scrapertools.printMatches(matches)
    for match in matches:
        logger.info("match=" + match)
        nuevopatron = '<a href="([^"]+)" rel="bookmark">([^<]+)</a>'  #<img.*?src="([^"]+)"'
        nuevomatches = re.compile(nuevopatron, re.DOTALL).findall(match)
        logger.info("len(nuevomatches)=%d" % len(nuevomatches))
        scrapertools.printMatches(nuevomatches)

        # Titulo
        scrapedtitle = nuevomatches[0][1]
        if not scrapedtitle.startswith("Descargar"):
            #Elimina todos los prefijos SEO
            scrapedtitle = scrapertools.unseo(scrapedtitle)
            # URL
            scrapedurl = urlparse.urljoin(url, nuevomatches[0][0])
            # Thumbnail
            scrapedthumbnail = ""  #urlparse.urljoin(url,nuevomatches[2])
            # Argumento
            scrapedplot = ""

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

            # Añade al listado de XBMC
            xbmctools.addthumbnailfolder(CHANNELNAME, scrapedtitle, scrapedurl,
                                         scrapedthumbnail, "listmirrors")

    # Página siguiente
    patronvideos = '<div class="back"><a href="([^"]+)"'
    matches = re.compile(patronvideos, re.DOTALL).findall(data)
    scrapertools.printMatches(matches)

    for match in matches:
        # Titulo
        scrapedtitle = "Página siguiente"
        # URL
        scrapedurl = urlparse.urljoin(url, match)
        # Thumbnail
        scrapedthumbnail = ""
        # Argumento
        scrapedplot = ""

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

        # Añade al listado de XBMC
        xbmctools.addthumbnailfolder(CHANNELNAME, scrapedtitle, scrapedurl,
                                     scrapedthumbnail, "newlist")

    # 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)