From 649c622876e9df34468616ff13d1628c425033c7 Mon Sep 17 00:00:00 2001 From: Intel1 <25161862+Intel11@users.noreply.github.com> Date: Sun, 20 May 2018 09:06:15 -0500 Subject: [PATCH] dailymotion: fix live stream --- plugin.video.alfa/servers/dailymotion.py | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/plugin.video.alfa/servers/dailymotion.py b/plugin.video.alfa/servers/dailymotion.py index 9a8d8d9a..3cb282e0 100755 --- a/plugin.video.alfa/servers/dailymotion.py +++ b/plugin.video.alfa/servers/dailymotion.py @@ -7,31 +7,21 @@ from platformcode import logger def test_video_exists(page_url): logger.info("(page_url='%s')" % page_url) - response = httptools.downloadpage(page_url) if response.code == 404: return False, "[Dailymotion] El archivo no existe o ha sido borrado" - return True, "" def get_video_url(page_url, premium=False, user="", password="", video_password=""): logger.info("(page_url='%s')" % page_url) video_urls = [] - response = httptools.downloadpage(page_url, cookies=False) cookie = {'Cookie': response.headers["set-cookie"]} data = response.data.replace("\\", "") - - ''' - "240":[{"type":"video/mp4","url":"http://www.dailymotion.com/cdn/H264-320x240/video/x33mvht.mp4?auth=1441130963-2562-u49z9kdc-84796332ccab3c7ce84e01c67a18b689"}] - ''' - subtitle = scrapertools.find_single_match(data, '"subtitles":.*?"es":.*?urls":\["([^"]+)"') qualities = scrapertools.find_multiple_matches(data, '"([^"]+)":(\[\{"type":".*?\}\])') for calidad, urls in qualities: - if calidad == "auto": - continue patron = '"type":"(?:video|application)/([^"]+)","url":"([^"]+)"' matches = scrapertools.find_multiple_matches(urls, patron) for stream_type, stream_url in matches: @@ -41,10 +31,10 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= follow_redirects=False).headers.get("location", stream_url) else: data_m3u8 = httptools.downloadpage(stream_url).data - stream_url = scrapertools.find_single_match(data_m3u8, '(http:.*?\.m3u8)') + stream_url_http = scrapertools.find_single_match(data_m3u8, '(http:.*?\.m3u8)') + if stream_url_http: + stream_url = stream_url_http video_urls.append(["%sp .%s [dailymotion]" % (calidad, stream_type), stream_url, 0, subtitle]) - for video_url in video_urls: logger.info("%s - %s" % (video_url[0], video_url[1])) - return video_urls