From 8f406aee767d38324f752efb2e959dd3962b02c2 Mon Sep 17 00:00:00 2001 From: Intel1 <25161862+Intel11@users.noreply.github.com> Date: Wed, 4 Jul 2018 09:08:39 -0500 Subject: [PATCH] animeflv: fix --- plugin.video.alfa/channels/animeflv.py | 166 +++---------------------- 1 file changed, 19 insertions(+), 147 deletions(-) diff --git a/plugin.video.alfa/channels/animeflv.py b/plugin.video.alfa/channels/animeflv.py index 84b4fd07..14787bcc 100644 --- a/plugin.video.alfa/channels/animeflv.py +++ b/plugin.video.alfa/channels/animeflv.py @@ -1,9 +1,7 @@ # -*- coding: utf-8 -*- import re -import time import urlparse -import urllib from channels import renumbertools from core import httptools @@ -18,13 +16,10 @@ HOST = "https://animeflv.net/" def mainlist(item): logger.info() - itemlist = list() - itemlist.append(Item(channel=item.channel, action="novedades_episodios", title="Últimos episodios", url=HOST)) itemlist.append(Item(channel=item.channel, action="novedades_anime", title="Últimos animes", url=HOST)) itemlist.append(Item(channel=item.channel, action="listado", title="Animes", url=HOST + "browse?order=title")) - itemlist.append(Item(channel=item.channel, title="Buscar por:")) itemlist.append(Item(channel=item.channel, action="search", title=" Título")) itemlist.append(Item(channel=item.channel, action="search_section", title=" Género", url=HOST + "browse", @@ -35,9 +30,7 @@ def mainlist(item): extra="year")) itemlist.append(Item(channel=item.channel, action="search_section", title=" Estado", url=HOST + "browse", extra="status")) - itemlist = renumbertools.show_option(item.channel, itemlist) - return itemlist @@ -48,36 +41,29 @@ def search(item, texto): texto = texto.replace(" ", "+") post = "value=%s" % texto data = httptools.downloadpage(item.url, post=post).data - try: dict_data = jsontools.load(data) - for e in dict_data: if e["id"] != e["last_id"]: _id = e["last_id"] else: _id = e["id"] - url = "%sanime/%s/%s" % (HOST, _id, e["slug"]) title = e["title"] thumbnail = "%suploads/animes/covers/%s.jpg" % (HOST, e["id"]) new_item = item.clone(action="episodios", title=title, url=url, thumbnail=thumbnail) - if e["type"] != "movie": new_item.show = title new_item.context = renumbertools.context(item) else: new_item.contentType = "movie" new_item.contentTitle = title - itemlist.append(new_item) - except: import sys for line in sys.exc_info(): logger.error("%s" % line) return [] - return itemlist @@ -88,39 +74,30 @@ def search_section(item): data = re.sub(r"\n|\r|\t|\s{2}|-\s", "", data) patron = 'id="%s_select"[^>]+>(.*?)' % item.extra data = scrapertools.find_single_match(data, patron) - matches = re.compile('', re.DOTALL).findall(data) - for _id, title in matches: url = "%s?%s=%s&order=title" % (item.url, item.extra, _id) itemlist.append(Item(channel=item.channel, action="listado", title=title, url=url, context=renumbertools.context(item))) - return itemlist def newest(categoria): itemlist = [] - if categoria == 'anime': itemlist = novedades_episodios(Item(url=HOST)) - return itemlist def novedades_episodios(item): logger.info() - data = httptools.downloadpage(item.url).data data = re.sub(r"\n|\r|\t|\s{2}|-\s", "", data) data = scrapertools.find_single_match(data, '

Últimos episodios

.+?