vertelenovelas: fix
This commit is contained in:
@@ -11,21 +11,17 @@ from platformcode import logger
|
|||||||
|
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
itemlist.append(Item(channel=item.channel, title="Catálogo", action="series", url="http://www.vertelenovelas.cc/",
|
itemlist.append(Item(channel=item.channel, title="Ultimos capítulos", action="ultimos", url="http://www.vertelenovelas.cc/",
|
||||||
viewmode="movie"))
|
viewmode="movie"))
|
||||||
itemlist.append(Item(channel=item.channel, title="Buscar", action="search"))
|
itemlist.append(Item(channel=item.channel, title="Buscar", action="search"))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def search(item, texto):
|
def search(item, texto):
|
||||||
logger.info()
|
logger.info()
|
||||||
|
|
||||||
texto = texto.replace(" ", "+")
|
texto = texto.replace(" ", "+")
|
||||||
item.url = "http://www.vertelenovelas.cc/ajax/autocompletex.php?q=" + texto
|
item.url = "http://www.vertelenovelas.cc/ajax/autocompletex.php?q=" + texto
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return series(item)
|
return series(item)
|
||||||
|
|
||||||
@@ -37,16 +33,38 @@ def search(item, texto):
|
|||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def ultimos(item):
|
||||||
|
logger.info()
|
||||||
|
itemlist = []
|
||||||
|
data = httptools.downloadpage(item.url).data
|
||||||
|
patron = '<article.*?</article>'
|
||||||
|
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||||
|
for match in matches:
|
||||||
|
title = scrapertools.find_single_match(match, '<span>([^<]+)</span>')
|
||||||
|
if title == "":
|
||||||
|
title = scrapertools.find_single_match(match, '<a href="[^"]+" class="title link">([^<]+)</a>')
|
||||||
|
url = urlparse.urljoin(item.url, scrapertools.find_single_match(match, '<a href="([^"]+)"'))
|
||||||
|
thumbnail = scrapertools.find_single_match(match, '<div data-src="([^"]+)"')
|
||||||
|
if thumbnail == "":
|
||||||
|
thumbnail = scrapertools.find_single_match(match, '<img src="([^"]+)"')
|
||||||
|
logger.debug("title=[" + title + "], url=[" + url + "]")
|
||||||
|
itemlist.append(Item(channel=item.channel, action="findvideos", title=title, url=url, thumbnail=thumbnail))
|
||||||
|
|
||||||
|
next_page_url = scrapertools.find_single_match(data, '<a href="([^"]+)" class="next">')
|
||||||
|
if next_page_url != "":
|
||||||
|
itemlist.append(Item(channel=item.channel, action="series", title=">> Pagina siguiente",
|
||||||
|
url=urlparse.urljoin(item.url, next_page_url), viewmode="movie", thumbnail="", plot="",
|
||||||
|
folder=True))
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def series(item):
|
def series(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
# Descarga la página
|
|
||||||
data = httptools.downloadpage(item.url).data
|
data = httptools.downloadpage(item.url).data
|
||||||
|
|
||||||
patron = '<article.*?</article>'
|
patron = '<article.*?</article>'
|
||||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||||
|
|
||||||
for match in matches:
|
for match in matches:
|
||||||
title = scrapertools.find_single_match(match, '<span>([^<]+)</span>')
|
title = scrapertools.find_single_match(match, '<span>([^<]+)</span>')
|
||||||
if title == "":
|
if title == "":
|
||||||
@@ -57,60 +75,43 @@ def series(item):
|
|||||||
thumbnail = scrapertools.find_single_match(match, '<img src="([^"]+)"')
|
thumbnail = scrapertools.find_single_match(match, '<img src="([^"]+)"')
|
||||||
logger.debug("title=[" + title + "], url=[" + url + "]")
|
logger.debug("title=[" + title + "], url=[" + url + "]")
|
||||||
itemlist.append(Item(channel=item.channel, action="episodios", title=title, url=url, thumbnail=thumbnail))
|
itemlist.append(Item(channel=item.channel, action="episodios", title=title, url=url, thumbnail=thumbnail))
|
||||||
|
|
||||||
next_page_url = scrapertools.find_single_match(data, '<a href="([^"]+)" class="next">')
|
next_page_url = scrapertools.find_single_match(data, '<a href="([^"]+)" class="next">')
|
||||||
if next_page_url != "":
|
if next_page_url != "":
|
||||||
itemlist.append(Item(channel=item.channel, action="series", title=">> Pagina siguiente",
|
itemlist.append(Item(channel=item.channel, action="series", title=">> Pagina siguiente",
|
||||||
url=urlparse.urljoin(item.url, next_page_url), viewmode="movie", thumbnail="", plot="",
|
url=urlparse.urljoin(item.url, next_page_url), viewmode="movie", thumbnail="", plot="",
|
||||||
folder=True))
|
folder=True))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def episodios(item):
|
def episodios(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
# Descarga la página
|
|
||||||
data = httptools.downloadpage(item.url).data
|
data = httptools.downloadpage(item.url).data
|
||||||
data = scrapertools.find_single_match(data, '<h2>Cap(.*?)</ul>')
|
data = scrapertools.find_single_match(data, '<h2>Cap(.*?)</ul>')
|
||||||
patron = '<li><a href="([^"]+)"><span>([^<]+)</span></a>'
|
patron = '<li><a href="([^"]+)"><span>([^<]+)</span></a>'
|
||||||
|
|
||||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||||
|
|
||||||
for scrapedurl, scrapedtitle in matches:
|
for scrapedurl, scrapedtitle in matches:
|
||||||
title = scrapertools.htmlclean(scrapedtitle)
|
title = scrapertools.htmlclean(scrapedtitle)
|
||||||
plot = ""
|
|
||||||
thumbnail = ""
|
|
||||||
url = urlparse.urljoin(item.url, scrapedurl)
|
url = urlparse.urljoin(item.url, scrapedurl)
|
||||||
|
|
||||||
logger.debug("title=[" + title + "], url=[" + url + "], thumbnail=[" + thumbnail + "]")
|
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
Item(channel=item.channel, action="findvideos", title=title, url=url, thumbnail=thumbnail, plot=plot,
|
Item(channel=item.channel, action="findvideos", title=title, url=url,
|
||||||
folder=True, fulltitle=title))
|
folder=True, fulltitle=title))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
data = httptools.downloadpage(item.url).data
|
data = httptools.downloadpage(item.url).data
|
||||||
|
|
||||||
pattern = 'data-id="([^"]+)"'
|
pattern = 'data-id="([^"]+)"'
|
||||||
list_servers = re.compile(pattern, re.DOTALL).findall(data)
|
list_servers = re.compile(pattern, re.DOTALL).findall(data)
|
||||||
|
|
||||||
logger.debug("llist_servers %s" % list_servers)
|
|
||||||
list_urls = []
|
list_urls = []
|
||||||
|
|
||||||
for _id in list_servers:
|
for _id in list_servers:
|
||||||
post = "id=%s" % _id
|
post = "id=%s" % _id
|
||||||
data = httptools.downloadpage("http://www.vertelenovelas.cc/goto/", post=post).data
|
data = httptools.downloadpage("http://www.vertelenovelas.cc/goto/", post=post).data
|
||||||
list_urls.append(scrapertools.find_single_match(data, 'document\.location = "([^"]+)";'))
|
list_urls.append(scrapertools.find_single_match(data, 'document\.location = "([^"]+)";'))
|
||||||
|
|
||||||
from core import servertools
|
from core import servertools
|
||||||
itemlist = servertools.find_video_items(data=", ".join(list_urls))
|
itemlist = servertools.find_video_items(data=", ".join(list_urls))
|
||||||
for videoitem in itemlist:
|
for videoitem in itemlist:
|
||||||
# videoitem.title = item.title
|
# videoitem.title = item.title
|
||||||
videoitem.channel = item.channel
|
videoitem.channel = item.channel
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|||||||
Reference in New Issue
Block a user