Add files via upload

This commit is contained in:
shlibidon
2019-04-07 14:31:08 +02:00
committed by GitHub
parent 904973be83
commit 8857bcfd39
2 changed files with 75 additions and 0 deletions

View File

@@ -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"
}

View File

@@ -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 "<title>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