From b3b704357cbbd231679add4f6eb364c605ca4dae Mon Sep 17 00:00:00 2001 From: Intel1 <25161862+Intel11@users.noreply.github.com> Date: Mon, 18 Sep 2017 16:17:06 -0500 Subject: [PATCH] Add files via upload --- plugin.video.alfa/servers/pelismundo.json | 49 +++++++++++++++++++++++ plugin.video.alfa/servers/pelismundo.py | 33 +++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 plugin.video.alfa/servers/pelismundo.json create mode 100644 plugin.video.alfa/servers/pelismundo.py diff --git a/plugin.video.alfa/servers/pelismundo.json b/plugin.video.alfa/servers/pelismundo.json new file mode 100644 index 00000000..1d9e3395 --- /dev/null +++ b/plugin.video.alfa/servers/pelismundo.json @@ -0,0 +1,49 @@ +{ + "active": true, + "changes": [ + { + "date": "18/09/2017", + "description": "Versión inicial" + } + ], + "find_videos": { + "ignore_urls": [], + "patterns": [ + { + "pattern": "http://www.pelismundo.com/gkvip/vip/playervip3/.*?id=([A-z0-9]+)", + "url": "http://www.pelismundo.com/gkvip/vip/playervip3/player.php?id=\\1" + } + ] + }, + "free": true, + "id": "pelismundo", + "name": "pelismundo", + "settings": [ + { + "default": false, + "enabled": true, + "id": "black_list", + "label": "Incluir en lista negra", + "type": "bool", + "visible": true + }, + { + "default": 0, + "enabled": true, + "id": "favorites_servers_list", + "label": "Incluir en lista de favoritos", + "lvalues": [ + "No", + "1", + "2", + "3", + "4", + "5" + ], + "type": "list", + "visible": false + } + ], + "thumbnail": "https://s26.postimg.org/72c9mr3ux/pelismundo1.png", + "version": 1 +} diff --git a/plugin.video.alfa/servers/pelismundo.py b/plugin.video.alfa/servers/pelismundo.py new file mode 100644 index 00000000..c86ad7f3 --- /dev/null +++ b/plugin.video.alfa/servers/pelismundo.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +# ------------------------------------------------------------ +# Alfa addon - KODI Plugin +# Conector para pelismundo +# https://github.com/alfa-addon +# ------------------------------------------------------------ + +from core import httptools +from core import scrapertools +from platformcode import logger + + +def test_video_exists(page_url): + logger.info("(page_url='%s')" % page_url) + data = httptools.downloadpage(page_url).data + if "Object not found" in data or "no longer exists" in data or '"sources": [false]' in data: + return False, "[pelismundo] El archivo no existe o ha sido borrado" + + return True, "" + + +def get_video_url(page_url, user="", password="", video_password=""): + logger.info("(page_url='%s')" % page_url) + video_urls = [] + data = httptools.downloadpage(page_url, add_referer = True).data + patron = 'sources.*?}],' + bloque = scrapertools.find_single_match(data, patron) + patron = 'file.*?"([^"]+)".*?label:"([^"]+)"' + match = scrapertools.find_multiple_matches(bloque, patron) + for scrapedurl, scrapedquality in match: + video_urls.append([scrapedquality + " [pelismundo]", scrapedurl]) + #video_urls.sort(key=lambda it: int(it[0].split("p ", 1)[0])) + return video_urls