- correzioni di alcuni bug (citiamo ad esempio il crash con il refresh rate e l'impossibilita di entrare nel menu server bloccati) - fix per cambio di struttura a qualche canale/server - migliorie interne
34 lines
1.1 KiB
Python
34 lines
1.1 KiB
Python
# -*- coding: utf-8 -*-
|
|
import json
|
|
from lib import jsunpack
|
|
from core import support, httptools
|
|
from platformcode import logger, config
|
|
|
|
def test_video_exists(page_url):
|
|
global data
|
|
logger.debug('page url=', page_url)
|
|
response = httptools.downloadpage(page_url)
|
|
|
|
if response.code == 404:
|
|
return False, config.get_localized_string(70449) % 'Userload'
|
|
else:
|
|
data = response.data
|
|
return True, ""
|
|
|
|
|
|
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
|
|
global data
|
|
logger.debug("URL", page_url)
|
|
video_urls = []
|
|
packed = support.match(data, patron=r"(eval\(function\(p,a,c,k,e,d\).*?)\s*<").match
|
|
unpack = jsunpack.unpack(packed)
|
|
var = support.match(unpack, patron= r'baffffbd="([^"]+)".*?edecbade="([^"]+)').match
|
|
|
|
if var:
|
|
post = 'morocco={}&mycountry={}'.format(var[1], var[0])
|
|
logger.debug(post)
|
|
url = support.match('https://userload.co/api/request/', post=post, patron=r'([^\s\r\n]+)').match
|
|
if url:
|
|
video_urls.append(["{} [Userload]".format(url.split('.')[-1]), url])
|
|
|
|
return video_urls |