migliorati test per i server e alcuni fix
This commit is contained in:
+2
-23
@@ -1,9 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# by DrZ3r0
|
||||
|
||||
import urllib
|
||||
|
||||
from core import httptools
|
||||
from core import httptools, support
|
||||
from core import scrapertools
|
||||
from platformcode import logger, config
|
||||
|
||||
@@ -54,28 +53,8 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
||||
from lib import jsunpack
|
||||
data = jsunpack.unpack(data_pack)
|
||||
|
||||
block = scrapertools.find_single_match(data, "sources:\s\[([^\]]+)\]")
|
||||
data = block if block else data
|
||||
# URL
|
||||
# logger.info(data)
|
||||
if vres:
|
||||
matches = scrapertools.find_multiple_matches(data, '''src:\s*["']?(http.*?\.mp4)''')
|
||||
else:
|
||||
matches = scrapertools.find_multiple_matches(data, '''src:\s*["']?(http.*?\.mp4)(?:[^,]+,[^,]+,res:([^,]+))?''')
|
||||
if matches:
|
||||
if len(matches[0])==2:
|
||||
i=0
|
||||
for m in matches:
|
||||
vres.append("%sx" % m[1])
|
||||
matches[i]=m[0]
|
||||
i+=1
|
||||
|
||||
_headers = urllib.urlencode(httptools.default_headers)
|
||||
video_urls = support.get_jwplayer_mediaurl(data, 'akvideo', onlyHttp=True)
|
||||
|
||||
i = 0
|
||||
for media_url in matches:
|
||||
# URL del vídeo
|
||||
video_urls.append([vres[i] if i<len(vres) else "" + " mp4 [Akvideo] ", media_url.replace('https://', 'http://') + '|' + _headers])
|
||||
i = i + 1
|
||||
|
||||
return sorted(video_urls, key=lambda x: int(x[0].split('x')[0])) if vres else video_urls
|
||||
|
||||
@@ -12,8 +12,8 @@ def test_video_exists(page_url):
|
||||
html = httptools.downloadpage(page_url)
|
||||
global data
|
||||
data = html.data
|
||||
if html.code == 404:
|
||||
return False, config.get_localized_string(70292) % "CloudVideo"
|
||||
if html.code == 404 or 'No Signal 404 Error Page' in data:
|
||||
return False, config.get_localized_string(70449) % "CloudVideo"
|
||||
return True, ""
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
from platformcode import logger, config
|
||||
|
||||
|
||||
def test_video_exists(page_url):
|
||||
return True, ""
|
||||
|
||||
# Returns an array of possible video url's from the page_url
|
||||
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
|
||||
+8
-1
@@ -3,7 +3,7 @@
|
||||
# Conector Mixdrop By Alfa development Group
|
||||
# --------------------------------------------------------
|
||||
|
||||
from core import httptools
|
||||
from core import httptools, servertools
|
||||
from core import scrapertools
|
||||
from lib import jsunpack
|
||||
from platformcode import logger, config
|
||||
@@ -13,6 +13,12 @@ def test_video_exists(page_url):
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
global data
|
||||
data = httptools.downloadpage(page_url).data
|
||||
|
||||
if 'window.location' in data:
|
||||
domain = 'https://' + servertools.get_server_host('mixdrop')[0]
|
||||
url = domain + scrapertools.find_single_match(data, "window\.location\s*=\s*[\"']([^\"']+)")
|
||||
data = httptools.downloadpage(url).data
|
||||
|
||||
if "<h2>WE ARE SORRY</h2>" in data or '<title>404 Not Found</title>' in data:
|
||||
return False, config.get_localized_string(70449) % "MixDrop"
|
||||
return True, ""
|
||||
@@ -23,6 +29,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
||||
video_urls = []
|
||||
ext = '.mp4'
|
||||
|
||||
global data
|
||||
packed = scrapertools.find_single_match(data, r'(eval.*?)</script>')
|
||||
unpacked = jsunpack.unpack(packed)
|
||||
|
||||
|
||||
@@ -17,6 +17,9 @@ monitor = filetools.join(config.get_data_path(), 'elementum_monitor.json')
|
||||
extensions_list = ['.aaf', '.3gp', '.asf', '.avi', '.flv', '.mpeg', '.m1v', '.m2v', '.m4v', '.mkv', '.mov', '.mpg', '.mpe', '.mp4', '.ogg', '.wmv']
|
||||
|
||||
|
||||
def test_video_exists(page_url):
|
||||
return True, ""
|
||||
|
||||
|
||||
# Returns an array of possible video url's from the page_url
|
||||
def get_video_url(page_url, premium=False, user='', password='', video_password=''):
|
||||
|
||||
+4
-4
@@ -92,7 +92,7 @@ def test_video_exists(page_url):
|
||||
|
||||
data = httptools.downloadpage(page_url).data
|
||||
|
||||
if "File was deleted" in data:
|
||||
if "File was deleted" in data or "Video non disponibile" in data:
|
||||
return False, config.get_localized_string(70449) % "Youtube"
|
||||
return True, ""
|
||||
|
||||
@@ -107,7 +107,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
||||
video_id = scrapertools.find_single_match(page_url, '(?:v=|embed/)([A-z0-9_-]{11})')
|
||||
video_urls = extract_videos(video_id)
|
||||
|
||||
return video_urls
|
||||
return sorted(video_urls, reverse=True)
|
||||
|
||||
|
||||
def remove_additional_ending_delimiter(data):
|
||||
@@ -215,8 +215,8 @@ def extract_videos(video_id):
|
||||
url = re.search('url=(.*)', opt["cipher"]).group(1)
|
||||
s = cipher.get('s')
|
||||
url = "%s&sig=%s" % (urllib.unquote(url), signature([s]))
|
||||
video_urls.append(["%s" % itag_list.get(opt["itag"], "audio"), url])
|
||||
video_urls.append(["%s" % itag_list.get(opt["itag"], "video"), url])
|
||||
elif opt["itag"] in itag_list:
|
||||
video_urls.append(["%s" % itag_list.get(opt["itag"], "video"), opt["url"]])
|
||||
|
||||
return video_urls
|
||||
return video_urls
|
||||
Reference in New Issue
Block a user