Nuovo Server HighLoad

This commit is contained in:
Alhaziel01
2021-09-28 15:18:59 +02:00
parent 86e4bebb3c
commit 612921b61d
4 changed files with 129 additions and 3 deletions

View File

@@ -467,12 +467,12 @@ def play_from_library(item):
logger.debug()
# Modify the action (currently the video library needs "findvideos" since this is where the sources are searched
item.action = "findvideos"
item.action = item.next_action if item.next_action else "findvideos"
window_type = config.get_setting("window_type", "videolibrary") if config.get_setting('next_ep') < 3 and item.contentType != 'movie' else 1
# and launch kodi again
if xbmc.getCondVisibility('Window.IsMedia') and not window_type == 1:
if (xbmc.getCondVisibility('Window.IsMedia') and not window_type == 1) or item.action != 'findvideos':
xbmc.executebuiltin("Container.Update(" + sys.argv[0] + "?" + item.tourl() + ")")
else:

View File

@@ -4,7 +4,7 @@
"ignore_urls": [],
"patterns": [
{
"pattern": "((?:https?://).\\S+.(m3u8|mp4|mpeg|mpd|flv)[^\"'\n]*)",
"pattern": "(https?://.\\S+.(?:m3u8|mpd)[^\"'\n]*)",
"url": "\\1"
},
{

42
servers/highload.json Normal file
View File

@@ -0,0 +1,42 @@
{
"active": true,
"find_videos": {
"ignore_urls": [],
"patterns": [
{
"pattern": "(https://highload.to/[ef]/[A-z0-9]+)",
"url": "\\1"
}
]
},
"free": true,
"id": "highload",
"name": "HighLoad",
"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://i.postimg.cc/3JrRZv5w/highload.png"
}

84
servers/highload.py Normal file
View File

@@ -0,0 +1,84 @@
# -*- coding: utf-8 -*-
try:
from urllib.parse import urlparse
except:
from urlparse import urlparse
from core import httptools, support
from platformcode import logger, config
from functools import reduce
import base64
def test_video_exists(page_url):
logger.info('page_url="{}"'.format(page_url))
global data
data = httptools.downloadpage(page_url)
if data.code == 404 or "We can't find the video" in data.data or 'sorry' in data.data:
return False, config.get_localized_string(70449) % "HighLoad"
data = data.data
return True, ""
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
logger.info("url=" + page_url)
global data
media_url = ''
video_urls = []
host = 'https://' + urlparse(page_url).netloc
first = unhunt(support.match(data, patron =r'<head>(.+?)</head>').match)
second_url = host + support.match(data, patron=r'src="(/assets/js/(?:master|tabber).js)').match
second = unhunt(httptools.downloadpage(second_url).data)
v, r1, r2 = support.match(second, patron=r'var\s*res\s*=\s*([^.]+)\.replace\("([^"]+).+?replace\("([^"]+)').match
match = support.match(first, patron=r'var\s*{}\s*=\s*"([^"]+)'.format(v)).match
if match:
media_url = base64.b64decode(match.replace(r1, '').replace(r2, '')).decode('utf-8')
if media_url:
video_urls.append([media_url.split('.')[-1] +' [HighLoad]', media_url])
return video_urls
def unhunt(source):
def decode(params):
h = params[0]
n = params[1]
t = int(params[2])
e = int(params[3])
r = ""
i = 0
while i < len(h):
s = ""
while h[i] != n[e]:
s += h[i]
i += 1
for j in enumerate(n):
s = s.replace(j[1], str(j[0]))
r += chr(int(dehunt(s, e, 10)) - t)
i += 1
return r
def dehunt(d, e, f):
g = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/"
h = g[0:e]
i = g[0:f]
d = d[::-1]
j = reduce(lambda a, b: a + int(h[int(b[1])]) * (e ** int(b[0])) if int(h[int(b[1])]) != -1 else None, enumerate(d), 0)
k = ""
while j > 0:
k = i[int(j % f)] + k
j = (j - (j % f)) / f
return k or "0"
return decode(support.match(source, patron=r'\(h,\s*u,\s*n,\s*t,\s*e,\s*r\).+}\("([^"]+)",[^,]+,\s*"([^"]+)",\s*(\d+),\s*(\d+)').match)