From 8857bcfd395f9ff4c6b637f2b8d88531b73e2e5f Mon Sep 17 00:00:00 2001 From: shlibidon <39755626+shlibidon@users.noreply.github.com> Date: Sun, 7 Apr 2019 14:31:08 +0200 Subject: [PATCH] Add files via upload --- plugin.video.alfa/servers/xstreamcdn.json | 42 +++++++++++++++++++++++ plugin.video.alfa/servers/xstreamcdn.py | 33 ++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 plugin.video.alfa/servers/xstreamcdn.json create mode 100644 plugin.video.alfa/servers/xstreamcdn.py diff --git a/plugin.video.alfa/servers/xstreamcdn.json b/plugin.video.alfa/servers/xstreamcdn.json new file mode 100644 index 00000000..24852ce3 --- /dev/null +++ b/plugin.video.alfa/servers/xstreamcdn.json @@ -0,0 +1,42 @@ +{ + "active": true, + "find_videos": { + "ignore_urls": [], + "patterns": [ + { + "pattern": "(https://www.xstreamcdn.com/v/[A-z0-9_-]+)", + "url": "\\1" + } + ] + }, + "free": true, + "id": "xstream", + "name": "xstream", + "settings": [ + { + "default": false, + "enabled": true, + "id": "black_list", + "label": "@60654", + "type": "bool", + "visible": true + }, + { + "default": 0, + "enabled": true, + "id": "favorites_servers_list", + "label": "@60655", + "lvalues": [ + "No", + "1", + "2", + "3", + "4", + "5" + ], + "type": "list", + "visible": false + } + ], + "thumbnail": "https://library.vodkr.com/media/24364/xstreamlogo.jpg" +} diff --git a/plugin.video.alfa/servers/xstreamcdn.py b/plugin.video.alfa/servers/xstreamcdn.py new file mode 100644 index 00000000..12dde5e2 --- /dev/null +++ b/plugin.video.alfa/servers/xstreamcdn.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- + +import urllib +from core import httptools +from core import scrapertools +from core import jsontools +from platformcode import logger, config + + +def test_video_exists(page_url): + logger.info("(page_url='%s')" % page_url) + data = httptools.downloadpage(page_url).data + if "ile was deleted" in data or "Page Cannot Be Found" in data or "Sorry 404 not found" in data: + return False, "[xstreamcdn.com] El archivo ha sido eliminado o no existe" + return True, "" + + +def get_video_url(page_url, premium=False, user="", password="", video_password=""): + logger.info("url=" + page_url) + video_urls = [] + post = {} + post = urllib.urlencode(post) + data = httptools.downloadpage("https://xstreamcdn.com/api/source/" + scrapertools.find_single_match(page_url, "/v/([A-z0-9_-]+)"), post=post, add_referer=page_url).data + + json_data = jsontools.load(data) + check = json_data['success'] + if check == True: + for element in json_data['data']: + media_url = element['file'] + res = element['label'] + tipo = element['type'] + video_urls.append([tipo + " (" + res + ") [xstreamcdn]", media_url]) + return video_urls