From da8246b56d0beaa00612f3290345da74e320685e Mon Sep 17 00:00:00 2001 From: Intel1 <25161862+Intel11@users.noreply.github.com> Date: Sat, 10 Feb 2018 14:39:26 -0500 Subject: [PATCH] rapidvideo: update --- plugin.video.alfa/servers/rapidvideo.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/plugin.video.alfa/servers/rapidvideo.py b/plugin.video.alfa/servers/rapidvideo.py index b92df605..57ff5c27 100755 --- a/plugin.video.alfa/servers/rapidvideo.py +++ b/plugin.video.alfa/servers/rapidvideo.py @@ -35,11 +35,17 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= data = httptools.downloadpage(page_url).data patron = 'https://www.rapidvideo.com/e/[^"]+' match = scrapertools.find_multiple_matches(data, patron) - for url1 in match: - res = scrapertools.find_single_match(url1, '=(\w+)') - data = httptools.downloadpage(url1).data - url = scrapertools.find_single_match(data, 'source src="([^"]+)') - ext = scrapertools.get_filename_from_url(url)[-4:] - video_urls.append(['%s %s [rapidvideo]' % (ext, res), url]) - + if match: + for url1 in match: + res = scrapertools.find_single_match(url1, '=(\w+)') + data = httptools.downloadpage(url1).data + url = scrapertools.find_single_match(data, 'source src="([^"]+)') + ext = scrapertools.get_filename_from_url(url)[-4:] + video_urls.append(['%s %s [rapidvideo]' % (ext, res), url]) + else: + patron = 'data-setup.*?src="([^"]+)".*?' + patron += 'type="([^"]+)"' + match = scrapertools.find_multiple_matches(data, patron) + for url, ext in match: + video_urls.append(['%s [rapidvideo]' % (ext), url]) return video_urls