fix hdmario
This commit is contained in:
10
lib/jsunpack_js2py.py
Normal file
10
lib/jsunpack_js2py.py
Normal file
@@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
from lib import js2py
|
||||
import re
|
||||
|
||||
def unpack(source):
|
||||
fun, data = re.match("""eval\((function\(p,a,c,k,e,d\){.*?})\((['"].*?)\)\)$""", source.strip(), re.MULTILINE).groups()
|
||||
funPy = js2py.eval_js(fun)
|
||||
return eval('funPy(' + data + ')')
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
{
|
||||
"active": true,
|
||||
"find_videos": {
|
||||
"ignore_urls": [],
|
||||
"patterns": [
|
||||
{
|
||||
"pattern": "http://www.drtuber.com/embed/([0-9]+)",
|
||||
"url": "\\1"
|
||||
}
|
||||
]
|
||||
},
|
||||
"free": true,
|
||||
"id": "drtuber",
|
||||
"name": "drtuber",
|
||||
"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": ""
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from core import httptools
|
||||
from core import scrapertools
|
||||
from platformcode import logger
|
||||
|
||||
|
||||
|
||||
def get_video_url(page_url, video_password):
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
video_urls = []
|
||||
url = "https://www.drtuber.com/player_config_json/?vid=%s&aid=0&domain_id=0&embed=0&ref=null&check_speed=0" %page_url
|
||||
data = httptools.downloadpage(url).data
|
||||
data = scrapertools.find_single_match(data, '"files":(.*?)"quality"')
|
||||
patron = '"([lh])q":"([^"]+)"'
|
||||
matches = scrapertools.find_multiple_matches(data, patron)
|
||||
for quality, scrapedurl in matches:
|
||||
url = scrapedurl.replace("\/", "/")
|
||||
if "l" in quality: quality = "360"
|
||||
if "h" in quality: quality = "720"
|
||||
video_urls.append(["[drtuber] %s" %quality, url])
|
||||
return video_urls
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import xbmc
|
||||
|
||||
from core import httptools, scrapertools, filetools
|
||||
from platformcode import logger, config, platformtools
|
||||
from platformcode import logger, config
|
||||
|
||||
baseUrl = 'https://hdmario.live'
|
||||
|
||||
@@ -39,8 +39,10 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
||||
page = httptools.downloadpage(page_url + '?code=' + code)
|
||||
data = page.data
|
||||
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.*)'))
|
||||
# p,a,c,k,e,d data -> xhr.setRequestHeader
|
||||
secureProof = scrapertools.find_single_match(data, '\|(\w{22})\|')
|
||||
secureProof = scrapertools.find_single_match(unpacked, """X-Secure-Proof['"]\s*,\s*['"]([^"']+)""")
|
||||
logger.info('X-Secure-Proof=' + secureProof)
|
||||
|
||||
data = httptools.downloadpage(baseUrl + '/pl/' + page_url.split('/')[-1].replace('?', '') + '.m3u8', headers=[['X-Secure-Proof', secureProof]]).data
|
||||
|
||||
Reference in New Issue
Block a user