animeflv.ru: actualizado findvideos
This commit is contained in:
@@ -162,27 +162,20 @@ def novedades_anime(item):
|
|||||||
|
|
||||||
def listado(item):
|
def listado(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
|
|
||||||
data = httptools.downloadpage(item.url).data
|
data = httptools.downloadpage(item.url).data
|
||||||
data = re.sub(r"\n|\r|\t|\s{2}|-\s", "", data)
|
data = re.sub(r"\n|\r|\t|\s{2}|-\s", "", data)
|
||||||
# logger.debug("datito %s" % data)
|
|
||||||
|
|
||||||
url_pagination = scrapertools.find_single_match(data, '<li class="current">.*?</li>[\s]<li><a href="([^"]+)">')
|
url_pagination = scrapertools.find_single_match(data, '<li class="current">.*?</li>[\s]<li><a href="([^"]+)">')
|
||||||
|
|
||||||
data = scrapertools.find_single_match(data, '</div><div class="full">(.*?)<div class="pagination')
|
data = scrapertools.find_single_match(data, '</div><div class="full">(.*?)<div class="pagination')
|
||||||
|
|
||||||
matches = re.compile('<img.+?src="([^"]+)".+?<a href="([^"]+)">(.*?)</a>.+?'
|
matches = re.compile('<img.+?src="([^"]+)".+?<a href="([^"]+)">(.*?)</a>.+?'
|
||||||
'<div class="full item_info genres_info">(.*?)</div>.+?class="full">(.*?)</p>',
|
'<div class="full item_info genres_info">(.*?)</div>.+?class="full">(.*?)</p>',
|
||||||
re.DOTALL).findall(data)
|
re.DOTALL).findall(data)
|
||||||
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
for thumbnail, url, title, genres, plot in matches:
|
for thumbnail, url, title, genres, plot in matches:
|
||||||
|
|
||||||
title = clean_title(title)
|
title = clean_title(title)
|
||||||
url = urlparse.urljoin(HOST, url)
|
url = urlparse.urljoin(HOST, url)
|
||||||
thumbnail = urlparse.urljoin(HOST, thumbnail)
|
thumbnail = urlparse.urljoin(HOST, thumbnail)
|
||||||
|
|
||||||
new_item = Item(channel=item.channel, action="episodios", title=title, url=url, thumbnail=thumbnail,
|
new_item = Item(channel=item.channel, action="episodios", title=title, url=url, thumbnail=thumbnail,
|
||||||
fulltitle=title, plot=plot)
|
fulltitle=title, plot=plot)
|
||||||
|
|
||||||
@@ -192,28 +185,22 @@ def listado(item):
|
|||||||
else:
|
else:
|
||||||
new_item.show = title
|
new_item.show = title
|
||||||
new_item.context = renumbertools.context(item)
|
new_item.context = renumbertools.context(item)
|
||||||
|
|
||||||
itemlist.append(new_item)
|
itemlist.append(new_item)
|
||||||
|
|
||||||
if url_pagination:
|
if url_pagination:
|
||||||
url = urlparse.urljoin(HOST, url_pagination)
|
url = urlparse.urljoin(HOST, url_pagination)
|
||||||
title = ">> Pagina Siguiente"
|
title = ">> Pagina Siguiente"
|
||||||
|
|
||||||
itemlist.append(Item(channel=item.channel, action="listado", title=title, url=url))
|
itemlist.append(Item(channel=item.channel, action="listado", title=title, url=url))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def episodios(item):
|
def episodios(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
data = httptools.downloadpage(item.url).data
|
data = httptools.downloadpage(item.url).data
|
||||||
data = re.sub(r"\n|\r|\t|\s{2}|-\s", "", data)
|
data = re.sub(r"\n|\r|\t|\s{2}|-\s", "", data)
|
||||||
|
|
||||||
if item.plot == "":
|
if item.plot == "":
|
||||||
item.plot = scrapertools.find_single_match(data, 'Description[^>]+><p>(.*?)</p>')
|
item.plot = scrapertools.find_single_match(data, 'Description[^>]+><p>(.*?)</p>')
|
||||||
|
|
||||||
data = scrapertools.find_single_match(data, '<div class="Sect Episodes full">(.*?)</div>')
|
data = scrapertools.find_single_match(data, '<div class="Sect Episodes full">(.*?)</div>')
|
||||||
matches = re.compile('<a href="([^"]+)"[^>]+>(.+?)</a', re.DOTALL).findall(data)
|
matches = re.compile('<a href="([^"]+)"[^>]+>(.+?)</a', re.DOTALL).findall(data)
|
||||||
|
|
||||||
@@ -221,7 +208,6 @@ def episodios(item):
|
|||||||
title = title.strip()
|
title = title.strip()
|
||||||
url = urlparse.urljoin(item.url, url)
|
url = urlparse.urljoin(item.url, url)
|
||||||
thumbnail = item.thumbnail
|
thumbnail = item.thumbnail
|
||||||
|
|
||||||
try:
|
try:
|
||||||
episode = int(scrapertools.find_single_match(title, "Episodio (\d+)"))
|
episode = int(scrapertools.find_single_match(title, "Episodio (\d+)"))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
@@ -229,42 +215,36 @@ def episodios(item):
|
|||||||
episode = 1
|
episode = 1
|
||||||
else:
|
else:
|
||||||
season, episode = renumbertools.numbered_for_tratk(item.channel, item.show, 1, episode)
|
season, episode = renumbertools.numbered_for_tratk(item.channel, item.show, 1, episode)
|
||||||
|
|
||||||
title = "%s: %sx%s" % (item.title, season, str(episode).zfill(2))
|
title = "%s: %sx%s" % (item.title, season, str(episode).zfill(2))
|
||||||
|
|
||||||
itemlist.append(item.clone(action="findvideos", title=title, url=url, thumbnail=thumbnail, fulltitle=title,
|
itemlist.append(item.clone(action="findvideos", title=title, url=url, thumbnail=thumbnail, fulltitle=title,
|
||||||
fanart=thumbnail, contentType="episode"))
|
fanart=thumbnail, contentType="episode"))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
_id = scrapertools.find_single_match(item.url, 'https://animeflv.ru/ver/([^/]+)/')
|
_id = scrapertools.find_single_match(item.url, 'https://animeflv.ru/ver/([^/]+)/')
|
||||||
post = "embed_id=%s" % _id
|
post = "embed_id=%s" % _id
|
||||||
data = httptools.downloadpage("https://animeflv.ru/get_video_info", post=post).data
|
data = httptools.downloadpage("https://animeflv.ru/get_video_info", post=post).data
|
||||||
dict_data = jsontools.load(data)
|
dict_data = jsontools.load(data)
|
||||||
|
|
||||||
headers = dict()
|
headers = dict()
|
||||||
headers["Referer"] = item.url
|
headers["Referer"] = item.url
|
||||||
data = httptools.downloadpage("https:" + dict_data["value"], headers=headers).data
|
data = httptools.downloadpage("https:" + dict_data["value"], headers=headers).data
|
||||||
dict_data = jsontools.load(data)
|
dict_data = jsontools.load(data)
|
||||||
|
if not dict_data:
|
||||||
list_videos = dict_data["playlist"][0]["sources"]
|
return itemlist
|
||||||
|
list_videos = dict_data["playlist"][0]
|
||||||
if isinstance(list_videos, list):
|
if isinstance(list_videos, list):
|
||||||
for video in list_videos:
|
for video in list_videos:
|
||||||
itemlist.append(Item(channel=item.channel, action="play", url=video["file"], show=re.escape(item.show),
|
itemlist.append(Item(channel=item.channel, action="play", url=video["file"],
|
||||||
title="Ver en calidad [%s]" % video["label"], plot=item.plot, fulltitle=item.title,
|
show=re.escape(item.show),
|
||||||
|
title=item.title, plot=item.plot, fulltitle=item.title,
|
||||||
thumbnail=item.thumbnail))
|
thumbnail=item.thumbnail))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
for video in list_videos.values():
|
for video in list_videos.values():
|
||||||
itemlist.append(Item(channel=item.channel, action="play", url=video["file"], show=re.escape(item.show),
|
video += "|User-Agent=Mozilla/5.0"
|
||||||
title="Ver en calidad [%s]" % video["label"], plot=item.plot, fulltitle=item.title,
|
itemlist.append(Item(channel=item.channel, action="play", url=video, show=re.escape(item.show),
|
||||||
|
title=item.title, plot=item.plot, fulltitle=item.title,
|
||||||
thumbnail=item.thumbnail))
|
thumbnail=item.thumbnail))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|||||||
Reference in New Issue
Block a user