aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/funnyordie.py
diff options
context:
space:
mode:
authorremitamine <remitamine@gmail.com>2015-12-03 20:05:11 +0100
committerremitamine <remitamine@gmail.com>2015-12-03 20:05:11 +0100
commit640bb54e73779f4a941eae1f17e4be049ca575db (patch)
treeba0c50db3ad5bb0932a56cda66d4f386b145bb22 /youtube_dl/extractor/funnyordie.py
parent497f5fd93fe1efd0df8dc58d518c328ed1409457 (diff)
parente0977d7686e5df524b1a024484e7a4bb9cfa261d (diff)
Merge branch 'master' of https://github.com/rg3/youtube-dl into bilibili
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({