Added Wstream

This commit is contained in:
lozioangie
2019-03-27 21:10:29 +01:00
committed by mac12m99
parent b6681e6c84
commit 9304a70165
2 changed files with 107 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
{
"id": "wstream",
"name": "wstream",
"active": true,
"free": true,
"thumbnail": "http:\/\/media.tvalacarta.info\/servers\/server_wstream.png",
"find_videos": {
"patterns": [
{
"pattern": "wstream.video\/(?:embed-)?([a-z0-9A-Z]+)",
"url": "http:\/\/wstream.video\/\\1"
}
],
"ignore_urls": [ ]
},
"settings": [
{
"default": false,
"enabled": true,
"id": "black_list",
"label": "$ADDON[plugin.video.kod 60654]",
"type": "bool",
"visible": true
},
{
"default": "100",
"enabled": true,
"id": "favorites_servers_list",
"label": "$ADDON[plugin.video.kod 60655]",
"lvalues": [
"No",
"1",
"2",
"3",
"4",
"5"
],
"type": "list",
"visible": false
}
]
}

View File

@@ -0,0 +1,65 @@
# -*- coding: utf-8 -*-
# Kodi on Demand - Kodi Addon - Kodi Addon
# by DrZ3r0 - Fix Alhaziel
import re
import urllib
from core import httptools, scrapertools
from platformcode import logger, config
headers = [['User-Agent', 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:54.0) Gecko/20100101 Firefox/54.0']]
# Returns an array of possible video url's from the page_url
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
# import web_pdb; web_pdb.set_trace()
logger.info("[wstream.py] url=" + page_url)
video_urls = []
data = scrapertools.cache_page(page_url, headers=headers).replace('https','http')
# logger.info("[wstream.py] data=" + data)
vid = scrapertools.find_multiple_matches(data,'download_video.*?>.*?<.*?<td>([^\,,\s]+)')
headers.append(['Referer', page_url])
post_data = scrapertools.find_single_match(data, "</div>\s*<script type='text/javascript'>(eval.function.p,a,c,k,e,.*?)\s*</script>")
if post_data != "":
from lib import jsunpack
data = jsunpack.unpack(post_data)
media_url = scrapertools.find_multiple_matches(data, '(http.*?\.mp4)')
_headers = urllib.urlencode(dict(headers))
i=0
for media_url in media_url:
video_urls.append([vid[i] + " mp4 [wstream] ", media_url + '|' + _headers])
i=i+1
for video_url in video_urls:
logger.info("[wstream.py] %s - %s" % (video_url[0], video_url[1]))
return video_urls
def find_videos(data):
encontrados = set()
devuelve = []
patronvideos = r"wstream.video/(?:embed-)?([a-z0-9A-Z]+)"
logger.info("[wstream.py] find_videos #" + patronvideos + "#")
matches = re.compile(patronvideos, re.DOTALL).findall(data)
for match in matches:
titulo = "[wstream]"
url = 'http://wstream.video/%s' % match
if url not in encontrados:
logger.info(" url=" + url)
devuelve.append([titulo, url, 'wstream'])
encontrados.add(url)
else:
logger.info(" url duplicada=" + url)
return devuelve