Fix VUP e miglioria upstream
This commit is contained in:
@@ -12,7 +12,7 @@ def test_video_exists(page_url):
|
||||
logger.debug("(page_url='%s')" % page_url)
|
||||
global data
|
||||
data = httptools.downloadpage(page_url).data
|
||||
if "<h2>WE ARE SORRY</h2>" in data or '<title>404 Not Found</title>' in data:
|
||||
if "as it expired or has been deleted" in data:
|
||||
return False, config.get_localized_string(70449) % "UPstream"
|
||||
return True, ""
|
||||
|
||||
|
||||
@@ -16,24 +16,14 @@ def test_video_exists(page_url):
|
||||
|
||||
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
|
||||
logger.debug("url=" + page_url)
|
||||
video_urls = []
|
||||
global data
|
||||
|
||||
return support.get_jwplayer_mediaurl(data, 'VUP')
|
||||
# patron = r'sources:\s*\[\{src:\s*"([^"]+)"'
|
||||
# matches = scrapertools.find_multiple_matches(data, patron)
|
||||
# if not matches:
|
||||
# data = scrapertools.find_single_match(data, r"<script type='text/javascript'>(eval.function.p,a,c,k,e,.*?)\s*</script>")
|
||||
# if data:
|
||||
# from lib import jsunpack
|
||||
# data = jsunpack.unpack(data)
|
||||
# matches = scrapertools.find_multiple_matches(data, patron)
|
||||
# for url in matches:
|
||||
# quality = 'm3u8'
|
||||
# video_url = url
|
||||
# if 'label' in url:
|
||||
# url = url.split(',')
|
||||
# video_url = url[0]
|
||||
# quality = url[1].replace('label:','')
|
||||
# video_urls.append(['VUP Player [%s]' % quality, video_url.replace(',','')])
|
||||
# return video_urls
|
||||
matches = support.get_jwplayer_mediaurl(data, 'VUP')
|
||||
if not matches:
|
||||
data = scrapertools.find_single_match(data, r"<script type='text/javascript'>(eval.function.p,a,c,k,e,.*?)\s*</script>")
|
||||
if data:
|
||||
from lib import jsunpack
|
||||
data = jsunpack.unpack(data)
|
||||
matches = support.get_jwplayer_mediaurl(data, 'VUP')
|
||||
|
||||
return matches
|
||||
|
||||
Reference in New Issue
Block a user