fix userload e wstream

This commit is contained in:
mac12m99
2021-03-24 20:24:49 +01:00
parent 88f4d57039
commit 76a2637aa6
4 changed files with 16 additions and 16 deletions
+11 -8
View File
@@ -1,9 +1,10 @@
# -*- coding: utf-8 -*-
import json
from lib import aadecode
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)
@@ -22,13 +23,15 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
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'"([a-zA-Z0-9]{31,32})"').matches[2:]
for m in support.match(unpack, patron='var (\w+)="([^"]+)').matches:
globals()[m[0]] = m[1]
if var:
post = 'morocco={}&mycountry={}'.format(var[0], var[1])
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])
videojs = httptools.downloadpage('https://userload.co/api/assets/userload/js/videojs.js').data
videojs_decoded = aadecode.decode(videojs)
post = eval(support.match(videojs_decoded, patron="t.send\(([^\)]+)").match)
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