Página 3 de 6

Re: alguien sabe como añadir una web a pelisalacarta

Publicado: 08 Oct 2014, 15:16
por robalo
no se, pero creo que poniendo en enlce completo d bería ser igual.

#id_torrent = scrapertools.get_match(item.url,"(\d+)-")
url_torrent = scrapertools.get_match(item.url,"id="file" href="([^"]+)")

Re: alguien sabe como añadir una web a pelisalacarta

Publicado: 08 Oct 2014, 18:22
por neno1978
el enlace completo? a que te refieres?

Re: alguien sabe como añadir una web a pelisalacarta

Publicado: 08 Oct 2014, 18:40
por neno1978
nada,nadan perdona robalo, ya lo he conseguido ;) fue con ;

def findvideos(item):
logger.info("pelisalacarta.cuelgame findvideos")

itemlist = []
data = scrapertools.cache_page(item.url)

#id_torrent = scrapertools.get_match(item.url,"(\d+)-")
patron = '<a id.*? href="([^"]+)"'

url_torrent = scrapertools.get_match(data, patron)

itemlist.append( Item(channel=__channel__, title = "[torrent]", action="play", url=url_torrent, server="torrent", folder=False) )

Pues no que con la cabezonería, voy aprendiendo algo? gracias por todo ;)

Re: alguien sabe como añadir una web a pelisalacarta

Publicado: 08 Oct 2014, 21:09
por robalo
a eso me refería y si lo haces de esta forma

Código: Seleccionar todo

    patron = 'id="([^"]+)" href="([^"]+)"'

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

    for title_torrent, url_torrent in matches:
        title_torrent = "["+title_torrent.replace("file","torrent")+"]"
        itemlist.append( Item(channel=__channel__, title = title_torrent , action="play", url=url_torrent, server="torrent", folder=False) )
scarás tambien el magnet y en el caso de las series, si hay más de un episodio te los sacará todos. Faltaría currase un poco más el title para tener más claro que clickeas

Re: alguien sabe como añadir una web a pelisalacarta

Publicado: 09 Oct 2014, 08:42
por neno1978
si lo hago de la forma que me indicas solo sale un capitulo (habiendo mas) y ademas selecciona el magnet. Con esta :

Código: Seleccionar todo

def findvideos(item):
    logger.info("pelisalacarta.cuelgame findvideos")
    
    itemlist = []
    data = scrapertools.cache_page(item.url)
    
    #id_torrent = scrapertools.get_match(item.url,"(\d+)-")
    patron = '<a id.*? href="([^"]+)"'
    
    url_torrent = scrapertools.get_match(data, patron)
    
    itemlist.append( Item(channel=__channel__, title = "[torrent]", action="play", url=url_torrent, server="torrent", folder=False) )
Me funciona series y películas y aparece enlace [torrent] y al darle sale el nombre del capitulo perfecto, pero eso si, solo sale un capitulo habiendo mas, el ultimo ;)

NOOOO!, miento, me sale el primer capitulo solo y no el ultimo; con lo cual es una p****a!! ;)

he intentado hacer un def series que me lleve luego a def episodios y después finvideos...pero ahí estoy que no se como salir jajajaj

Re: alguien sabe como añadir una web a pelisalacarta

Publicado: 09 Oct 2014, 09:49
por robalo
es muy raro que sólo te salga un episodio, lo acabo de probar con y me salen todos los episodios. Lo he probado con el primero que sale de la lista series 'Ray Donovan' y me han salido del 201 al 207 torrent y magnet. Eso si, duplicados

Re: alguien sabe como añadir una web a pelisalacarta

Publicado: 09 Oct 2014, 12:06
por neno1978
joe pues a mi no , miralo que yo ya toy mareao, haber en que falle ;)

Código: Seleccionar todo

# -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os, sys

from core import logger
from core import config
from core import scrapertools
from core.item import Item
from servers import servertools

__channel__ = "cuelgame"
__category__ = "F"
__type__ = "generic"
__title__ = "Cuélgame"
__language__ = "ES"

DEBUG = config.get_setting("debug")

def isGeneric():
    return True

def mainlist(item):
    logger.info("pelisalacarta.cuelgame mainlist")

    itemlist = []
    itemlist.append( Item(channel=__channel__, title="Películas"      , action="peliculas", url="http://www.bricocine.com/c/hd-microhd/"))
    itemlist.append( Item(channel=__channel__, title="Series"         , action="peliculas", url="http://www.bricocine.com/c/series"))
    

    return itemlist

def peliculas(item):
    logger.info("pelisalacarta.cuelgame peliculas")
    itemlist = []

    # Descarga la página
    data = scrapertools.cache_page(item.url)
    '''
   <div class="post-10888 post type-post status-publish format-standard hentry category-the-leftovers tag-ciencia-ficcion tag-drama tag-fantasia tag-misterio"><div class="entry"> <a href="http://www.bricocine.com/10888/leftovers-temporada-1/"> <img src="http://www.bricocine.com/wp-content/plugins/wp_movies/files/thumb_185_the_leftovers_.jpg" alt="The Leftovers " /> </a></div><div class="entry-meta"><div class="clearfix"><div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating" class="rating"  title="Puntos IMDB: 7.4"><div class="rating-stars imdb-rating"><div class="stars" style="width:74%"></div></div><div itemprop="ratingValue" class="rating-number"> 7.4</div></div><div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating" class="rating"  title="Puntos Bricocine: 6.2"><div class="rating-stars brico-rating"><div class="stars" style="width:62%"></div></div><div itemprop="ratingValue" class="rating-number"> 6.2</div></div> <span class="vcard author none"> Publicado por <a class="fn" href="" rel="author" target="_blank"></a> </span> <span class="date updated none">2014-10-07T23:36:17+00:00</span></div></div><h2 class="title2 entry-title"> <a href="http://www.bricocine.com/10888/leftovers-temporada-1/"> The Leftovers  &#8211; Temporada 1 </a></h2></div> </article> <article class="hentry item-entry"><div class="post-10088 post type-post status-publish format-standard hentry category-the-last-ship tag-accion tag-ciencia-ficcion tag-drama tag-the tag-thriller"><div class="entry"> <a href="http://www.bricocine.com/10088/last-ship-temporada-1/"> <img src="http://www.bricocine.com/wp-content/plugins/wp_movies/files/thumb_185_the_last_ship_.jpg" alt="The Last Ship " /> </a></div><div class="entry-meta"><div class="clearfix"><div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating" class="rating"  title="Puntos IMDB: 7.4"><div class="rating-stars imdb-rating"><div class="stars" style="width:74%"></div></div><div itemprop="ratingValue" class="rating-number"> 7.4</div></div><div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating" class="rating"  title="Puntos Bricocine: 7.0"><div class="rating-stars brico-rating"><div class="stars" style="width:70%"></div></div><div itemprop="ratingValue" class="rating-number"> 7.0</div></div> <span class="vcard author none"> Publicado por <a class="fn" href="" rel="author" target="_blank"></a> </span> <span class="date updated none">2014-10-07T23:32:25+00:00</span></div></div><h2 class="title2 entry-title"> <a href="http://www.bricocine.com/10088/last-ship-temporada-1/"> The Last Ship &#8211; Temporada 1 </a></h2></div> </article> <article class="hentry item-entry">

    '''

    patron = '<div class=.*?> '
    patron += '<a href="([^"]+)"> '
    patron += '<img src="([^"]+)".*?'
    patron += 'alt="([^"]+)".*?'
    patron += 'class="rating-number">([^<]+)</div></div>'

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

    for scrapedurl, scrapedthumbnail, scrapedtitle, scrapedcreatedate in matches:
        scrapedtitle = scrapedtitle + "(Puntuación:" + scrapedcreatedate + ")"
       
        itemlist.append( Item(channel=__channel__, title=scrapedtitle, url=scrapedurl, action="findvideos", thumbnail=scrapedthumbnail, folder=True) )
    
    # Extrae el paginador
    patronvideos  = '<a href="([^"]+)" title="Siguiente">Siguiente</a>'
    matches = re.compile(patronvideos,re.DOTALL).findall(data)
    scrapertools.printMatches(matches)
    
    if len(matches)>0:
        scrapedurl = urlparse.urljoin(item.url,matches[0])
        itemlist.append( Item(channel=__channel__, action="peliculas", title="siguiente>>" , url=scrapedurl , folder=True) )
    
    return itemlist

def findvideos(item):
    logger.info("pelisalacarta.cuelgame findvideos")
    
    itemlist = []
    data = scrapertools.cache_page(item.url)
    
    #id_torrent = scrapertools.get_match(item.url,"(\d+)-")
    patron = 'id="([^"]+)" href="([^"]+)"'
    
    matches = re.compile(patron,re.DOTALL).findall(data)
    
    for title_torrent, url_torrent in matches:
        title_torrent = "["+title_torrent.replace("file","torrent")+"]"

    itemlist.append( Item(channel=__channel__, title = title_torrent , action="play", url=url_torrent, server="torrent", folder=False) )
    
    return itemlist

Re: alguien sabe como añadir una web a pelisalacarta

Publicado: 09 Oct 2014, 12:40
por neno1978
ya lo vi, si uso esto

Código: Seleccionar todo

 
    #id_torrent = scrapertools.get_match(item.url,"(\d+)-")
    patron = 'id="([^"]+)" href="([^"]+)"'
    
    matches = re.compile(patron,re.DOTALL).findall(data)
    
    for title_torrent, url_torrent in matches:
        title_torrent = "["+title_torrent.replace("file","torrent")+"]"
        itemlist.append( Item(channel=__channel__, title = title_torrent , action="play", url=url_torrent, server="torrent", folder=False) )
me salen todos, sin números y duplicado magnet torrent

se me ocurrió esto

Código: Seleccionar todo

patron =  '<table class="table table-series".*? '
    patron += '<span class="title">([^<]+)</span>.*?'
    patron += '<a id.*? href="([^"]+)"'
y me da nombre ty numero de capitulo, solopor torrent, pero no me los da todos cambien el ultimo patrón a

Código: Seleccionar todo

patron = 'id="([^"]+)" href="([^"]+)"'
y da error script ??? :|

Re: alguien sabe como añadir una web a pelisalacarta

Publicado: 09 Oct 2014, 20:42
por neno1978
LO CONSEGUI!!! :D Seguramente de la forma mas curte posible, pero ya me saca el nombre serie , capitulo y calidad. ;)

Código: Seleccionar todo

def findvideos(item):
    logger.info("pelisalacarta.cuelgame findvideos")
    
    itemlist = []
    data = scrapertools.cache_page(item.url)
    
    #id_torrent = scrapertools.get_match(item.url,"(\d+)-")
    patron = '<span class="title">([^"]+)</span>.*?'
    patron += 'id="([^"]+)" href="([^"]+)"'
    
    
    matches = re.compile(patron,re.DOTALL).findall(data)
    
    for title_torrent, scrapedtitle, url_torrent in matches:
        title_torrent = "["+title_torrent.replace("file","torrent")+"]"
        itemlist.append( Item(channel=__channel__, title = title_torrent , action="play", url=url_torrent, server="torrent", folder=False) )
    
    return itemlist

Re: alguien sabe como añadir una web a pelisalacarta

Publicado: 09 Oct 2014, 22:32
por robalo
Muy bien :)

Si quieres que se vean tambien los enlaces magnet prueba esto

Código: Seleccionar todo

    patron = '<span class="title">([^"]+)</span>.*?'
    patron += 'id="([^"]+)" href="([^"]+)".*?'
    patron += 'id="([^"]+)" href="([^"]+)"'

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

    for title_links, title_torrent, url_torrent, title_magnet, url_magnet in matches:
        ## torrent
        title_torrent = "["+title_torrent.replace("file","torrent")+"]"
        title_torrent = title_links+"- "+title_torrent 
        itemlist.append( Item(channel=__channel__, title = title_torrent , action="play", url=url_torrent, server="torrent", folder=False) )
        ## magnet
        title_magnet = "["+title_magnet+"]"
        title_magnet = title_links+"- "+title_magnet 
        itemlist.append( Item(channel=__channel__, title = title_magnet , action="play", url=url_magnet, server="torrent", folder=False) )