From 93e0ba9a4b31e905f276d190e512b21d8da675f8 Mon Sep 17 00:00:00 2001 From: MaxE <29448127+EMaX0@users.noreply.github.com> Date: Sun, 22 Mar 2020 03:01:36 +0800 Subject: [PATCH] Updated akvideo.py (#199) Fixed situation when no vres are found. Trying to get it from data unpacked or excluding any usage of it --- servers/akvideo.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/servers/akvideo.py b/servers/akvideo.py index c756cb35..3782780e 100644 --- a/servers/akvideo.py +++ b/servers/akvideo.py @@ -54,14 +54,24 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= data = block if block else data # URL # logger.info(data) - matches = scrapertools.find_multiple_matches(data, '''src:\s*["']?(http.*?\.mp4)''') - # logger.info(str(matches)) + 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) i = 0 for media_url in matches: # URL del vĂ­deo - video_urls.append([vres[i] + " mp4 [Akvideo] ", media_url.replace('https://', 'http://') + '|' + _headers]) + video_urls.append([vres[i] if i