From 5e5459337cf2348b202ed1fc29ed221f3f6c1d75 Mon Sep 17 00:00:00 2001 From: Intel1 <25161862+Intel11@users.noreply.github.com> Date: Sat, 30 Jun 2018 08:27:19 -0500 Subject: [PATCH 01/20] config.py: add get_addon_version() --- plugin.video.alfa/platformcode/config.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/plugin.video.alfa/platformcode/config.py b/plugin.video.alfa/platformcode/config.py index ac49a136..ad13942b 100644 --- a/plugin.video.alfa/platformcode/config.py +++ b/plugin.video.alfa/platformcode/config.py @@ -15,6 +15,27 @@ __settings__ = xbmcaddon.Addon(id="plugin.video." + PLUGIN_NAME) __language__ = __settings__.getLocalizedString +def get_addon_version(linea_inicio=0, total_lineas=2): + ''' + Devuelve el número de de versión del addon, obtenido desde el archivo addon.xml + ''' + path = get_runtime_path() + "\\addon.xml" + f = open(path, "rb") + data = [] + for x, line in enumerate(f): + if x < linea_inicio: continue + if len(data) == total_lineas: break + data.append(line) + f.close() + data1 = "".join(data) + # + aux = re.findall(' 0: + version = aux[0] + return version + + def get_platform(full_version=False): """ Devuelve la información la version de xbmc o kodi sobre el que se ejecuta el plugin From ac1b346019718c767fecbd5095ab58c1adeed231 Mon Sep 17 00:00:00 2001 From: Intel1 <25161862+Intel11@users.noreply.github.com> Date: Sat, 30 Jun 2018 08:41:34 -0500 Subject: [PATCH 02/20] config.py: add get_addon.version() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Método para obtener la versión de alfa --- mediaserver/platformcode/config.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/mediaserver/platformcode/config.py b/mediaserver/platformcode/config.py index 12b0c80b..4caf5486 100644 --- a/mediaserver/platformcode/config.py +++ b/mediaserver/platformcode/config.py @@ -14,6 +14,27 @@ settings_dic = {} adult_setting = {} +def get_addon_version(linea_inicio=0, total_lineas=2): + ''' + Devuelve el número de de versión del addon, obtenido desde el archivo addon.xml + ''' + path = get_runtime_path() + "\\addon.xml" + f = open(path, "rb") + data = [] + for x, line in enumerate(f): + if x < linea_inicio: continue + if len(data) == total_lineas: break + data.append(line) + f.close() + data1 = "".join(data) + # + aux = re.findall(' 0: + version = aux[0] + return version + + def get_platform(full_version=False): # full_version solo es util en xbmc/kodi ret = { From ba1523f2fc2a405eb9f15ae49aa3acd5c8135d8f Mon Sep 17 00:00:00 2001 From: Intel1 <25161862+Intel11@users.noreply.github.com> Date: Mon, 2 Jul 2018 08:35:54 -0500 Subject: [PATCH 03/20] =?UTF-8?q?httptools:=20Agregado=20versi=C3=B3n=20de?= =?UTF-8?q?l=20addon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin.video.alfa/core/httptools.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugin.video.alfa/core/httptools.py b/plugin.video.alfa/core/httptools.py index 460f4f37..9829f714 100755 --- a/plugin.video.alfa/core/httptools.py +++ b/plugin.video.alfa/core/httptools.py @@ -18,6 +18,9 @@ from core.cloudflare import Cloudflare from platformcode import config, logger from platformcode.logger import WebErrorException +## Obtiene la versión del addon +__version = config.get_addon_version() + cookies_lock = Lock() cj = cookielib.MozillaCookieJar() @@ -123,7 +126,7 @@ def downloadpage(url, post=None, headers=None, timeout=None, follow_redirects=Tr url = urllib.quote(url, safe="%/:=&?~#+!$,;'@()*[]") logger.info("----------------------------------------------") - logger.info("downloadpage") + logger.info("downloadpage Alfa: %s" %__version) logger.info("----------------------------------------------") logger.info("Timeout: %s" % timeout) logger.info("URL: " + url) @@ -270,3 +273,5 @@ class NoRedirectHandler(urllib2.HTTPRedirectHandler): http_error_301 = http_error_302 http_error_303 = http_error_302 http_error_307 = http_error_302 + + From 3fca1d07fad7dc5aee3f60e2f5f1aecd2f69b503 Mon Sep 17 00:00:00 2001 From: Intel1 <25161862+Intel11@users.noreply.github.com> Date: Mon, 2 Jul 2018 08:39:52 -0500 Subject: [PATCH 04/20] =?UTF-8?q?html.py:=20Actualizado=20obtenci=C3=B3n?= =?UTF-8?q?=20de=20la=20versi=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mediaserver/platformcode/controllers/html.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/mediaserver/platformcode/controllers/html.py b/mediaserver/platformcode/controllers/html.py index 573171a1..77dfe820 100644 --- a/mediaserver/platformcode/controllers/html.py +++ b/mediaserver/platformcode/controllers/html.py @@ -15,14 +15,9 @@ from platformcode import config from core.item import Item from core.tmdb import Tmdb from platformcode import launcher, logger -from core import filetools -# -data = filetools.read(filetools.join(config.get_runtime_path(), "addon.xml")) -aux = re.findall(' 0: - version = aux[0] +## Obtiene la versión del addon +version = config.get_addon_version() class html(Controller): pattern = re.compile("##") From f4198b61c2e05dbb95ecad5b505854c508163496 Mon Sep 17 00:00:00 2001 From: Intel1 <25161862+Intel11@users.noreply.github.com> Date: Mon, 2 Jul 2018 08:43:40 -0500 Subject: [PATCH 05/20] alfa.py: Agregado version al show_info --- mediaserver/alfa.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mediaserver/alfa.py b/mediaserver/alfa.py index f90710ee..87b61dc2 100644 --- a/mediaserver/alfa.py +++ b/mediaserver/alfa.py @@ -20,6 +20,7 @@ import WebSocket http_port = config.get_setting("server.port") websocket_port = config.get_setting("websocket.port") myip = config.get_local_ip() +version = config.get_addon_version() def thread_name_wrap(func): @@ -43,7 +44,7 @@ if sys.version_info < (2, 7, 11): def show_info(): os.system('cls' if os.name == 'nt' else 'clear') print ("--------------------------------------------------------------------") - print ("Alfa Iniciado") + print ("Alfa %s Iniciado" %version) print ("La URL para acceder es http://%s:%s" % (myip, http_port)) print ("WebSocket Server iniciado en ws://%s:%s" % (myip, websocket_port)) print ("--------------------------------------------------------------------") From a7dccc0f361be3b808a2c561fbac535ceaaabde8 Mon Sep 17 00:00:00 2001 From: Intel1 <25161862+Intel11@users.noreply.github.com> Date: Mon, 2 Jul 2018 08:53:06 -0500 Subject: [PATCH 06/20] allcalidad: cambios cosmeticos --- plugin.video.alfa/channels/allcalidad.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugin.video.alfa/channels/allcalidad.py b/plugin.video.alfa/channels/allcalidad.py index 8c607370..7a84ae36 100755 --- a/plugin.video.alfa/channels/allcalidad.py +++ b/plugin.video.alfa/channels/allcalidad.py @@ -147,10 +147,12 @@ def findvideos(item): match = scrapertools.find_multiple_matches(bloque, '(?is)(?:iframe|script) .*?src="([^"]+)') for url in match: titulo = "Ver en: %s" + text_color = "white" if "goo.gl" in url: url = httptools.downloadpage(url, follow_redirects=False, only_headers=True).headers.get("location", "") if "youtube" in url: - titulo = "[COLOR = yellow]Ver trailer: %s[/COLOR]" + titulo = "Ver trailer: %s" + text_color = "yellow" if "ad.js" in url or "script" in url or "jstags.js" in url: continue elif "vimeo" in url: @@ -158,6 +160,7 @@ def findvideos(item): itemlist.append( item.clone(channel = item.channel, action = "play", + text_color = text_color, title = titulo, url = url )) From 7c25db464402d72c7c156da127f2be0f35b5f6d3 Mon Sep 17 00:00:00 2001 From: Intel1 <25161862+Intel11@users.noreply.github.com> Date: Tue, 3 Jul 2018 08:55:49 -0500 Subject: [PATCH 07/20] url: tengourl cambios cosmeticos --- plugin.video.alfa/channels/url.json | 4 ++-- plugin.video.alfa/channels/url.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugin.video.alfa/channels/url.json b/plugin.video.alfa/channels/url.json index 9c22b22b..2ae39f42 100755 --- a/plugin.video.alfa/channels/url.json +++ b/plugin.video.alfa/channels/url.json @@ -3,6 +3,6 @@ "name": "Tengo una URL", "active": false, "adult": false, - "thumbnail": "url.png", - "banner": "url.png" + "thumbnail": "tengourl.png", + "banner": "tengourl.png" } \ No newline at end of file diff --git a/plugin.video.alfa/channels/url.py b/plugin.video.alfa/channels/url.py index db9879dc..6e0e61e9 100755 --- a/plugin.video.alfa/channels/url.py +++ b/plugin.video.alfa/channels/url.py @@ -24,7 +24,7 @@ def mainlist(item): def search(item, texto): logger.info("texto=" + texto) - if not texto.startswith("http://"): + if not texto.startswith("http"): texto = "http://" + texto itemlist = [] @@ -38,7 +38,7 @@ def search(item, texto): itemlist.append( Item(channel=item.channel, action="play", url=texto, server="directo", title="Ver enlace directo")) else: - data = scrapertools.downloadpage(texto) + data = httptools.downloadpage(texto).data itemlist = servertools.find_video_items(data=data) for item in itemlist: item.channel = "url" From a1cb798faa4f3c15b79918213e0fa0abbf1cdea7 Mon Sep 17 00:00:00 2001 From: Intel1 <25161862+Intel11@users.noreply.github.com> Date: Tue, 3 Jul 2018 09:02:16 -0500 Subject: [PATCH 08/20] Add files via upload --- plugin.video.alfa/channels/url.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plugin.video.alfa/channels/url.py b/plugin.video.alfa/channels/url.py index 6e0e61e9..44ab2769 100755 --- a/plugin.video.alfa/channels/url.py +++ b/plugin.video.alfa/channels/url.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- +from core import httptools from core import scrapertools from core import servertools from core.item import Item From 708548e7f3a37cd3a821e7c0a717700c98c922bd Mon Sep 17 00:00:00 2001 From: Intel1 <25161862+Intel11@users.noreply.github.com> Date: Tue, 3 Jul 2018 09:33:34 -0500 Subject: [PATCH 09/20] poseidonhd: fix --- plugin.video.alfa/channels/poseidonhd.py | 32 +++++++++++++++--------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/plugin.video.alfa/channels/poseidonhd.py b/plugin.video.alfa/channels/poseidonhd.py index ded2a793..b9e9dbf0 100644 --- a/plugin.video.alfa/channels/poseidonhd.py +++ b/plugin.video.alfa/channels/poseidonhd.py @@ -256,24 +256,30 @@ def findvideos(item): for url in urls: final_url = httptools.downloadpage('https:'+url).data - if 'vip' in url: + + if language == 'VOSE': + sub = scrapertools.find_single_match(url, 'sub=(.*?)&') + subs = 'https:%s' % sub + + if 'index' in url: file_id = scrapertools.find_single_match(url, 'file=(.*?)&') - if language=='VOSE': - sub = scrapertools.find_single_match(url, 'sub=(.*?)&') - subs = 'https:%s' % sub - post = {'link':file_id} + post = {'link': file_id} post = urllib.urlencode(post) - hidden_url = 'https://streamango.poseidonhd.com/repro//plugins/gkpluginsphp.php' + hidden_url = 'https://streamango.poseidonhd.com/repro/plugins/gkpluginsphp.php' data_url = httptools.downloadpage(hidden_url, post=post).data dict_vip_url = jsontools.load(data_url) url = dict_vip_url['link'] else: - url = 'https:%s' % url - new_url = url.replace('embed','stream') - url = httptools.downloadpage(new_url, follow_redirects=False).headers.get('location') - #title = '%s [%s]' % (item.title, language) - itemlist.append(item.clone(title='[%s] [%s]', url=url, action='play', subtitle=subs, - language=language, quality=quality, infoLabels = item.infoLabels)) + file_id = scrapertools.find_single_match(url, 'url=(.*?)&') + post = {'url': file_id} + post = urllib.urlencode(post) + hidden_url = 'https://streamango.poseidonhd.com/repro/r.php' + data_url = httptools.downloadpage(hidden_url, post=post, follow_redirects=False) + url = data_url.headers['location'] + + itemlist.append(item.clone(title = '[%s] [%s]', url=url, action='play', subtitle=subs, + language=language, quality=quality, infoLabels=item.infoLabels)) + itemlist = servertools.get_servers_itemlist(itemlist, lambda x: x.title % (x.server.capitalize(), x.language)) # Requerido para Filtrar enlaces @@ -289,6 +295,8 @@ def findvideos(item): autoplay.start(itemlist, item) + itemlist = sorted(itemlist, key=lambda it: it.language) + if item.contentType != 'episode': if config.get_videolibrary_support() and len(itemlist) > 0 and item.extra != 'findvideos': itemlist.append( From 89744269900bbb88397bdb3dcdbb98f58b0a7466 Mon Sep 17 00:00:00 2001 From: Intel1 <25161862+Intel11@users.noreply.github.com> Date: Tue, 3 Jul 2018 09:55:59 -0500 Subject: [PATCH 10/20] html: fix erorr thumbs --- mediaserver/platformcode/controllers/html.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/mediaserver/platformcode/controllers/html.py b/mediaserver/platformcode/controllers/html.py index 77dfe820..f44554a2 100644 --- a/mediaserver/platformcode/controllers/html.py +++ b/mediaserver/platformcode/controllers/html.py @@ -105,7 +105,7 @@ class platform(Platformtools): thumbnail=channelselector.get_thumb("back.png", "banner_"))) else: itemlist.insert(0, Item(title="Atrás", action="go_back", - thumbnail=channelselector.get_thumb("back.png"))) + thumbnail=channelselector.get_thumb("back.png", "banner_"))) JsonData = {} JsonData["action"] = "EndItems" @@ -119,17 +119,9 @@ class platform(Platformtools): # Recorremos el itemlist for item in itemlist: - if not item.thumbnail and item.action == "search": item.thumbnail = channelselector.get_thumb("search.png") - if not item.thumbnail and item.folder == True: item.thumbnail = channelselector.get_thumb("folder.png", "banner") - if not item.thumbnail and item.folder == False: item.thumbnail = channelselector.get_thumb("nofolder.png") - if "http://media.xxxxx/" in item.thumbnail and not item.thumbnail.startswith( - "http://media.xxxxxxxx/thumb_"): - - if parent_item.viewmode in ["banner", "channel"]: - item.thumbnail = channelselector.get_thumbnail_path("banner") + os.path.basename(item.thumbnail) - else: - item.thumbnail = channelselector.get_thumbnail_path() + os.path.basename(item.thumbnail) - + if not item.thumbnail and item.action == "search": item.thumbnail = channelselector.get_thumb("search.png", "banner_") + #if not item.thumbnail and item.folder == True: item.thumbnail = channelselector.get_thumb("folder.png", "banner_") + if not item.thumbnail and item.folder == False: item.thumbnail = channelselector.get_thumb("nofolder.png", "banner_") # Estas imagenes no estan en banner, asi que si queremos banner, para que no se vean mal las quitamos elif parent_item.viewmode in ["banner", "channel"] and item.thumbnail.startswith( "http://media.xxxxx/thumb_"): From f31a46f5d7762191a62d2edeba302c63e8ff426e Mon Sep 17 00:00:00 2001 From: Intel1 <25161862+Intel11@users.noreply.github.com> Date: Tue, 3 Jul 2018 09:57:30 -0500 Subject: [PATCH 11/20] alfa.py: agregado version a alfa.log --- mediaserver/alfa.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediaserver/alfa.py b/mediaserver/alfa.py index 87b61dc2..119c192b 100644 --- a/mediaserver/alfa.py +++ b/mediaserver/alfa.py @@ -73,7 +73,7 @@ def start(): # Da por levantado el servicio logger.info("--------------------------------------------------------------------") - logger.info("Alfa Iniciado") + logger.info("Alfa %s Iniciado" %version) logger.info("La URL para acceder es http://%s:%s" % (myip, http_port)) logger.info("WebSocket Server iniciado en ws://%s:%s" % (myip, websocket_port)) logger.info("--------------------------------------------------------------------") From ba66e4106b3d4704ee469aad7cb5e4077d41e224 Mon Sep 17 00:00:00 2001 From: Intel1 <25161862+Intel11@users.noreply.github.com> Date: Tue, 3 Jul 2018 10:12:07 -0500 Subject: [PATCH 12/20] tvvip: fix --- plugin.video.alfa/channels/tvvip.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin.video.alfa/channels/tvvip.py b/plugin.video.alfa/channels/tvvip.py index 4487b3bc..4b47bd66 100644 --- a/plugin.video.alfa/channels/tvvip.py +++ b/plugin.video.alfa/channels/tvvip.py @@ -612,8 +612,9 @@ def play(item): uri_request = host + "/video-prod/s/uri?uri=%s&_=%s" % (uri, int(time.time())) data = httptools.downloadpage(uri_request).data data = jsontools.load(data) - url = item.url.replace(".tv-vip.com/transcoder/", ".tv-vip.info/c/transcoder/") + "?tt=" + str(data['tt']) + \ + url = item.url.replace(".tv-vip.com/transcoder/", ".tv-vip.in/c/transcoder/") + "?tt=" + str(data['tt']) + \ "&mm=" + data['mm'] + "&bb=" + data['bb'] + url += "|User-Agent=Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Mobile Safari/537.36" itemlist.append(item.clone(action="play", server="directo", url=url, folder=False)) return itemlist From 1cb13c09b0b5806f691eb2ccb2e4ca987c503b30 Mon Sep 17 00:00:00 2001 From: Intel1 <25161862+Intel11@users.noreply.github.com> Date: Tue, 3 Jul 2018 10:13:51 -0500 Subject: [PATCH 13/20] help: fix mediaserver --- plugin.video.alfa/channels/help.py | 80 +++++++++++++++--------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/plugin.video.alfa/channels/help.py b/plugin.video.alfa/channels/help.py index 2454c9c6..6bd24cb3 100644 --- a/plugin.video.alfa/channels/help.py +++ b/plugin.video.alfa/channels/help.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- import os -import xbmc from core.item import Item from platformcode import config, logger, platformtools @@ -41,50 +40,50 @@ def mainlist(item): logger.info() itemlist = [] + itemlist.append(Item(channel=item.channel, action="", title="FAQ:", + thumbnail=get_thumb("help.png"), + folder=False)) if config.is_xbmc(): - itemlist.append(Item(channel=item.channel, action="", title="FAQ:", - thumbnail=get_thumb("help.png"), - folder=False)) itemlist.append(Item(channel=item.channel, action="faq", title=" - ¿Cómo reportar un error?", thumbnail=get_thumb("help.png"), folder=False, extra="report_error")) - itemlist.append(Item(channel=item.channel, action="faq", - title=" - ¿Se pueden activar/desactivar los canales?", - thumbnail=get_thumb("help.png"), - folder=False, extra="onoff_canales")) - itemlist.append(Item(channel=item.channel, action="faq", - title=" - ¿Es posible la sincronización automática con Trakt?", - thumbnail=get_thumb("help.png"), - folder=False, extra="trakt_sync")) - itemlist.append(Item(channel=item.channel, action="faq", - title=" - ¿Es posible mostrar todos los resultados juntos en el buscador global?", - thumbnail=get_thumb("help.png"), - folder=False, extra="buscador_juntos")) - itemlist.append(Item(channel=item.channel, action="faq", - title=" - Los enlaces tardan en aparecer.", - thumbnail=get_thumb("help.png"), - folder=False, extra="tiempo_enlaces")) - itemlist.append(Item(channel=item.channel, action="faq", - title=" - La búsqueda de contenido no se hace correctamente.", - thumbnail=get_thumb("help.png"), - folder=False, extra="prob_busquedacont")) - itemlist.append(Item(channel=item.channel, action="faq", - title=" - Algún canal no funciona correctamente.", - thumbnail=get_thumb("help.png"), - folder=False, extra="canal_fallo")) - itemlist.append(Item(channel=item.channel, action="faq", - title=" - Los enlaces Torrent no funcionan.", - thumbnail=get_thumb("help.png"), - folder=False, extra="prob_torrent")) - itemlist.append(Item(channel=item.channel, action="faq", - title=" - No se actualiza correctamente la videoteca.", - thumbnail=get_thumb("help.png"), - folder=True, extra="prob_bib")) - itemlist.append(Item(channel=item.channel, action="faq", - title=" - Enlaces de interés", - thumbnail=get_thumb("help.png"), - folder=False, extra="")) + itemlist.append(Item(channel=item.channel, action="faq", + title=" - ¿Se pueden activar/desactivar los canales?", + thumbnail=get_thumb("help.png"), + folder=False, extra="onoff_canales")) + itemlist.append(Item(channel=item.channel, action="faq", + title=" - ¿Es posible la sincronización automática con Trakt?", + thumbnail=get_thumb("help.png"), + folder=False, extra="trakt_sync")) + itemlist.append(Item(channel=item.channel, action="faq", + title=" - ¿Es posible mostrar todos los resultados juntos en el buscador global?", + thumbnail=get_thumb("help.png"), + folder=False, extra="buscador_juntos")) + itemlist.append(Item(channel=item.channel, action="faq", + title=" - Los enlaces tardan en aparecer.", + thumbnail=get_thumb("help.png"), + folder=False, extra="tiempo_enlaces")) + itemlist.append(Item(channel=item.channel, action="faq", + title=" - La búsqueda de contenido no se hace correctamente.", + thumbnail=get_thumb("help.png"), + folder=False, extra="prob_busquedacont")) + itemlist.append(Item(channel=item.channel, action="faq", + title=" - Algún canal no funciona correctamente.", + thumbnail=get_thumb("help.png"), + folder=False, extra="canal_fallo")) + itemlist.append(Item(channel=item.channel, action="faq", + title=" - Los enlaces Torrent no funcionan.", + thumbnail=get_thumb("help.png"), + folder=False, extra="prob_torrent")) + itemlist.append(Item(channel=item.channel, action="faq", + title=" - No se actualiza correctamente la videoteca.", + thumbnail=get_thumb("help.png"), + folder=True, extra="prob_bib")) + itemlist.append(Item(channel=item.channel, action="faq", + title=" - Enlaces de interés", + thumbnail=get_thumb("help.png"), + folder=False, extra="")) return itemlist @@ -192,6 +191,7 @@ def faq(item): search.settings("") elif item.extra == "report_error": + import xbmc if config.get_platform(True)['num_version'] < 14: log_name = "xbmc.log" else: From 05f18490e5e7e7d08d270cdac298be415a30b8b5 Mon Sep 17 00:00:00 2001 From: Intel1 <25161862+Intel11@users.noreply.github.com> Date: Wed, 4 Jul 2018 08:57:24 -0500 Subject: [PATCH 14/20] mp4upload: fix --- plugin.video.alfa/servers/mp4upload.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugin.video.alfa/servers/mp4upload.py b/plugin.video.alfa/servers/mp4upload.py index 2efbcf56..83134cb1 100644 --- a/plugin.video.alfa/servers/mp4upload.py +++ b/plugin.video.alfa/servers/mp4upload.py @@ -18,6 +18,8 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= data = data.replace("\\'", "'") media_url = scrapertools.find_single_match(data, '{type:"video/mp4",src:"([^"]+)"}') + if not media_url: + media_url = scrapertools.find_single_match(data, '"file":"([^"]+)') logger.info("media_url=" + media_url) video_urls = list() 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 15/20] 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

.+?