about summary refs log tree commit diff
path: root/youtube_dl/extractor/funnyordie.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-11-10 21:32:54 +0600
committerSergey M․ <dstftw@gmail.com>2015-11-10 21:32:54 +0600
commit9b738b2caa20e13d0a56d05aa56af44be75476bc (patch)
treee49abb4e703ae50d95df2694ab2f5955c524db0c /youtube_dl/extractor/funnyordie.py
parent37ca7b22b5521d7797ffefcd1456b4eb31320460 (diff)
downloadyoutube-dl-9b738b2caa20e13d0a56d05aa56af44be75476bc.tar.gz
youtube-dl-9b738b2caa20e13d0a56d05aa56af44be75476bc.tar.xz
youtube-dl-9b738b2caa20e13d0a56d05aa56af44be75476bc.zip
[funnyordie] Fix extraction and extract m3u8 formats
Diffstat (limited to 'youtube_dl/extractor/funnyordie.py')
-rw-r--r--youtube_dl/extractor/funnyordie.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/youtube_dl/extractor/funnyordie.py b/youtube_dl/extractor/funnyordie.py
index f5f13689c..7f21d7410 100644
--- a/youtube_dl/extractor/funnyordie.py
+++ b/youtube_dl/extractor/funnyordie.py
@@ -45,11 +45,20 @@ class FunnyOrDieIE(InfoExtractor):
 
         links.sort(key=lambda link: 1 if link[1] == 'mp4' else 0)
 
-        bitrates = self._html_search_regex(r'<source src="[^"]+/v,((?:\d+,)+)\.mp4\.csmil', webpage, 'video bitrates')
-        bitrates = [int(b) for b in bitrates.rstrip(',').split(',')]
-        bitrates.sort()
+        m3u8_url = self._search_regex(
+            r'<source[^>]+src=(["\'])(?P<url>.+?/master\.m3u8)\1',
+            webpage, 'm3u8 url', default=None, group='url')
 
         formats = []
+
+        m3u8_formats = self._extract_m3u8_formats(
+            m3u8_url, video_id, 'mp4', 'm3u8_native', m3u8_id='hls', fatal=False)
+        if m3u8_formats:
+            formats.extend(m3u8_formats)
+
+        bitrates = [int(bitrate) for bitrate in re.findall(r'[,/]v(\d+)[,/]', m3u8_url)]
+        bitrates.sort()
+
         for bitrate in bitrates:
             for link in links:
                 formats.append({