KoD 1.3.1
- aggiunti nuovi canali: film4k, animealtadefinizione, streamingcommunity, animeuniverse , guardaserieICU - HDmario ora supporta l'utilizzo di account - Miglioramenti sezione news, è ora possibile raggruppare per canale o per contenuto, e settare l'ordinamento - risolto il fastidioso problema per cui poteva capitare che la ricerca ripartisse dopo un refresh di kodi (tipicamente quando l'aggiornamento della videoteca finiva) - alcuni fix ai canali
This commit is contained in:
+1
-1
@@ -25,7 +25,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
||||
global data
|
||||
|
||||
post = urllib.urlencode({k: v for k, v in scrapertools.find_multiple_matches(data, "name='([^']+)' value='([^']*)'")})
|
||||
time.sleep(2.1)
|
||||
time.sleep(2.5)
|
||||
data = httptools.downloadpage(page_url, post=post).data
|
||||
|
||||
videos_packed = scrapertools.find_single_match(data, r"</div>\s*<script type='text/javascript'>(eval.function.p,a,c,k,e,.*?)\s*</script>")
|
||||
|
||||
+17
-1
@@ -4,7 +4,7 @@
|
||||
"ignore_urls": [],
|
||||
"patterns": [
|
||||
{
|
||||
"pattern": "https?://hdmario.live/embed/([0-9]+)",
|
||||
"pattern": "https?://hdmario.live/\\w+/([0-9]+)",
|
||||
"url": "https://hdmario.live/embed/\\1"
|
||||
}
|
||||
]
|
||||
@@ -36,6 +36,22 @@
|
||||
],
|
||||
"type": "list",
|
||||
"visible": false
|
||||
},
|
||||
{
|
||||
"default": "",
|
||||
"enabled": true,
|
||||
"id": "username",
|
||||
"label": "username",
|
||||
"type": "text",
|
||||
"visible": true
|
||||
},
|
||||
{
|
||||
"default": "",
|
||||
"enabled": true,
|
||||
"id": "password",
|
||||
"label": "password",
|
||||
"type": "text",
|
||||
"visible": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
+54
-1
@@ -2,7 +2,7 @@
|
||||
import xbmc
|
||||
|
||||
from core import httptools, scrapertools, filetools
|
||||
from platformcode import logger, config
|
||||
from platformcode import logger, config, platformtools
|
||||
|
||||
baseUrl = 'https://hdmario.live'
|
||||
|
||||
@@ -19,10 +19,56 @@ def test_video_exists(page_url):
|
||||
return True, ""
|
||||
|
||||
|
||||
def login():
|
||||
httptools.downloadpage(page.url.replace('/unauthorized', '/login'),
|
||||
post={'email': config.get_setting('username', server='hdmario'),
|
||||
'password': config.get_setting('password', server='hdmario')})
|
||||
|
||||
|
||||
def registerOrLogin(page_url, forced=False):
|
||||
if not forced and config.get_setting('username', server='hdmario') and config.get_setting('password', server='hdmario'):
|
||||
login()
|
||||
else:
|
||||
if platformtools.dialog_yesno('HDmario',
|
||||
'Questo server necessita di un account, ne hai già uno oppure vuoi tentare una registrazione automatica?',
|
||||
yeslabel='Accedi', nolabel='Tenta registrazione'):
|
||||
from specials import setting
|
||||
from core.item import Item
|
||||
setting.server_config(Item(config='hdmario'))
|
||||
login()
|
||||
else:
|
||||
logger.info('Registrazione automatica in corso')
|
||||
import random
|
||||
import string
|
||||
randEmail = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(random.randint(9, 14))) + '@gmail.com'
|
||||
randPsw = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(10))
|
||||
logger.info('email: ' + randEmail)
|
||||
logger.info('pass: ' + randPsw)
|
||||
nTry = 0
|
||||
while nTry < 5:
|
||||
nTry += 1
|
||||
rq = 'loggedin' in httptools.downloadpage(baseUrl + '/register/',
|
||||
post={'email': randEmail, 'email_confirmation': randEmail,
|
||||
'password': randPsw,
|
||||
'password_confirmation': randPsw}).url
|
||||
if rq:
|
||||
config.set_setting('username', randEmail, server='hdmario')
|
||||
config.set_setting('password', randPsw, server='hdmario')
|
||||
platformtools.dialog_ok('HDmario',
|
||||
'Registrato automaticamente con queste credenziali:\nemail:' + randEmail + '\npass: ' + randPsw)
|
||||
break
|
||||
else:
|
||||
platformtools.dialog_ok('HDmario', 'Impossibile registrarsi automaticamente')
|
||||
logger.info('Registrazione completata')
|
||||
global page, data
|
||||
page = httptools.downloadpage(page_url)
|
||||
data = page.data
|
||||
|
||||
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
|
||||
global page, data
|
||||
page_url = page_url.replace('?', '')
|
||||
logger.info("url=" + page_url)
|
||||
|
||||
if 'unconfirmed' in page.url:
|
||||
from lib import onesecmail
|
||||
id = page_url.split('/')[-1]
|
||||
@@ -38,6 +84,13 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
||||
code = jsonMail['subject'].split(' - ')[0]
|
||||
page = httptools.downloadpage(page_url + '?code=' + code)
|
||||
data = page.data
|
||||
|
||||
if '/unauthorized' in page.url:
|
||||
registerOrLogin(page_url)
|
||||
|
||||
if 'Registrati' in data:
|
||||
platformtools.dialog_ok('HDmario', 'Username/password non validi')
|
||||
registerOrLogin(page_url, True)
|
||||
logger.info(data)
|
||||
from lib import jsunpack_js2py
|
||||
unpacked = jsunpack_js2py.unpack(scrapertools.find_single_match(data, '<script type="text/javascript">\n*\s*\n*(eval.*)'))
|
||||
|
||||
+43
-7
@@ -6,6 +6,7 @@ from core import httptools
|
||||
from core import scrapertools
|
||||
from lib import js2py
|
||||
from platformcode import logger, config
|
||||
import re
|
||||
|
||||
|
||||
def test_video_exists(page_url):
|
||||
@@ -23,12 +24,47 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
video_urls = []
|
||||
global page_data
|
||||
dec = scrapertools.find_single_match(page_data, '(\$=~\[\];.*?\(\)\))\(\);')
|
||||
# needed to increase recursion
|
||||
import sys
|
||||
sys.setrecursionlimit(10000)
|
||||
video_url = scrapertools.find_single_match(decode(page_data), r"'src',\s*'([^']+)")
|
||||
video_urls.append([video_url.split('.')[-1] + ' [MyStream]', video_url])
|
||||
return video_urls
|
||||
|
||||
deObfCode = js2py.eval_js(dec)
|
||||
def decode(data):
|
||||
# adapted from ResolveURL code - https://github.com/jsergio123/script.module.resolveurl
|
||||
|
||||
video_urls.append(['mp4 [mystream]', scrapertools.find_single_match(str(deObfCode), "'src',\s*'([^']+)")])
|
||||
return video_urls
|
||||
first_group = scrapertools.find_single_match(data, r'"\\"("\+.*?)"\\""\)\(\)\)\(\)')
|
||||
match = scrapertools.find_single_match(first_group, r"(\(!\[\]\+\"\"\)\[.+?\]\+)")
|
||||
if match:
|
||||
first_group = first_group.replace(match, 'l').replace('$.__+', 't').replace('$._+', 'u').replace('$._$+', 'o')
|
||||
|
||||
tmplist = []
|
||||
js = scrapertools.find_single_match(data, r'(\$={.+?});')
|
||||
if js:
|
||||
js_group = js[3:][:-1]
|
||||
second_group = js_group.split(',')
|
||||
|
||||
i = -1
|
||||
for x in second_group:
|
||||
a, b = x.split(':')
|
||||
|
||||
if b == '++$':
|
||||
i += 1
|
||||
tmplist.append(("$.{}+".format(a), i))
|
||||
|
||||
elif b == '(![]+"")[$]':
|
||||
tmplist.append(("$.{}+".format(a), 'false'[i]))
|
||||
|
||||
elif b == '({}+"")[$]':
|
||||
tmplist.append(("$.{}+".format(a), '[object Object]'[i]))
|
||||
|
||||
elif b == '($[$]+"")[$]':
|
||||
tmplist.append(("$.{}+".format(a), 'undefined'[i]))
|
||||
|
||||
elif b == '(!""+"")[$]':
|
||||
tmplist.append(("$.{}+".format(a), 'true'[i]))
|
||||
|
||||
tmplist = sorted(tmplist, key=lambda z: str(z[1]))
|
||||
for x in tmplist:
|
||||
first_group = first_group.replace(x[0], str(x[1]))
|
||||
|
||||
first_group = first_group.replace('\\"', '\\').replace("\"\\\\\\\\\"", "\\\\").replace('\\"', '\\').replace('"', '').replace("+", "")
|
||||
return first_group.encode('ascii').decode('unicode-escape').encode('ascii').decode('unicode-escape')
|
||||
Reference in New Issue
Block a user