agregados

This commit is contained in:
alfa-addon
2017-08-01 17:46:11 -04:00
parent b12cbca299
commit bde00ddc4f
6 changed files with 719 additions and 0 deletions
@@ -0,0 +1,49 @@
{
"active": true,
"changes": [
{
"date": "28/06/2017",
"description": "Nuevo conector"
}
],
"find_videos": {
"ignore_urls": [],
"patterns": [
{
"pattern": "streamcherry.com/(?:embed|f)/([A-z0-9]+)",
"url": "http://streamcherry.com/embed/\\1"
}
]
},
"free": true,
"id": "streamcherry",
"name": "streamcherry",
"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": "http://i.imgur.com/l45Tk0G.png",
"version": 1
}
+61
View File
@@ -0,0 +1,61 @@
# -*- coding: utf-8 -*-
# --------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para streamcherry
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
# --------------------------------------------------------
from core import httptools
from core import logger
from core import scrapertools
def test_video_exists(page_url):
logger.info("(page_url='%s')" % page_url)
data = httptools.downloadpage(page_url).data
if "We are unable to find the video" in data:
return False, "[streamcherry] El archivo no existe o ha sido borrado"
return True, ""
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
logger.info("(page_url='%s')" % page_url)
data = httptools.downloadpage(page_url).data
video_urls = []
matches = scrapertools.find_multiple_matches(data, 'type\s*:\s*"([^"]+)"\s*,\s*src:"([^"]+)",height\s*:\s*(\d+)')
for ext, media_url, calidad in matches:
ext = ext.replace("video/", "")
if not media_url.startswith("http"):
media_url = "http:%s" % media_url
video_urls.append([".%s %sp [streamcherry]" % (ext, calidad), media_url])
video_urls.reverse()
for video_url in video_urls:
logger.info("%s - %s" % (video_url[0], video_url[1]))
return video_urls
# Encuentra vídeos del servidor en el texto pasado
def find_videos(data):
encontrados = set()
devuelve = []
patronvideos = 'streamcherry.com/(?:embed|f)/([A-z0-9]+)'
logger.info("#" + patronvideos + "#")
matches = re.compile(patronvideos, re.DOTALL).findall(data)
for match in matches:
titulo = "[streamcherry]"
url = "http://streamcherry.com/embed/%s" % match
if url not in encontrados:
logger.info(" url="+url)
devuelve.append([titulo, url, 'streamcherry'])
encontrados.add(url)
else:
logger.info(" url duplicada=" + url)
return devuelve