From 2ddc783e9dd1ab41af08618894051883b8f586ec Mon Sep 17 00:00:00 2001 From: CeruleanSky Date: Mon, 18 Jan 2016 17:10:16 -0500 Subject: [PATCH 1/2] [OraTV] update extractor "current" is now "video" "hls_stream" is now hls_stream without quotes video_id is now id duration for current video is not present(for other videos it is) --- youtube_dl/extractor/ora.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/youtube_dl/extractor/ora.py b/youtube_dl/extractor/ora.py index 02de1502a..c6d613879 100644 --- a/youtube_dl/extractor/ora.py +++ b/youtube_dl/extractor/ora.py @@ -21,7 +21,6 @@ class OraTVIE(InfoExtractor): 'ext': 'mp4', 'title': 'Vine & YouTube Stars Zach King & King Bach On Their Viral Videos!', 'description': 'md5:ebbc5b1424dd5dba7be7538148287ac1', - 'duration': 1477, } } @@ -30,9 +29,9 @@ class OraTVIE(InfoExtractor): webpage = self._download_webpage(url, display_id) video_data = self._search_regex( - r'"current"\s*:\s*({[^}]+?})', webpage, 'current video') + r'"video"\s*:\s*({[^}]+?})', webpage, 'current video') m3u8_url = self._search_regex( - r'"hls_stream"\s*:\s*"([^"]+)', video_data, 'm3u8 url', None) + r'hls_stream\s*:\s*"([^"]+)', video_data, 'm3u8 url', None) if m3u8_url: formats = self._extract_m3u8_formats( m3u8_url, display_id, 'mp4', 'm3u8_native', @@ -62,14 +61,12 @@ class OraTVIE(InfoExtractor): return { 'id': self._search_regex( - r'"video_id"\s*:\s*(\d+)', video_data, 'video id'), + r'"id"\s*:\s*(\d+)', video_data, 'video id'), 'display_id': display_id, 'title': unescapeHTML(self._og_search_title(webpage)), 'description': get_element_by_attribute( 'class', 'video_txt_decription', webpage), 'thumbnail': self._proto_relative_url(self._search_regex( r'"thumb"\s*:\s*"([^"]+)', video_data, 'thumbnail', None)), - 'duration': int(self._search_regex( - r'"duration"\s*:\s*(\d+)', video_data, 'duration')), 'formats': formats, } From 7ad9628b08d07e762e9f4711bd1fa067ebd7ca89 Mon Sep 17 00:00:00 2001 From: CeruleanSky Date: Wed, 20 Jan 2016 10:02:53 -0500 Subject: [PATCH 2/2] modified regex to find hls_stream variable to work reguardless of whether it is quoted or not. --- youtube_dl/extractor/ora.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/ora.py b/youtube_dl/extractor/ora.py index c6d613879..fe8baf847 100644 --- a/youtube_dl/extractor/ora.py +++ b/youtube_dl/extractor/ora.py @@ -31,7 +31,7 @@ class OraTVIE(InfoExtractor): video_data = self._search_regex( r'"video"\s*:\s*({[^}]+?})', webpage, 'current video') m3u8_url = self._search_regex( - r'hls_stream\s*:\s*"([^"]+)', video_data, 'm3u8 url', None) + r'"?hls_stream"?\s*:\s*"([^"]+)', video_data, 'm3u8 url', None) if m3u8_url: formats = self._extract_m3u8_formats( m3u8_url, display_id, 'mp4', 'm3u8_native',