mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-01-07 17:16:08 +00:00
[funnyordie] Fix extraction and extract m3u8 formats
This commit is contained in:
parent
37ca7b22b5
commit
9b738b2caa
|
@ -45,11 +45,20 @@ class FunnyOrDieIE(InfoExtractor):
|
||||||
|
|
||||||
links.sort(key=lambda link: 1 if link[1] == 'mp4' else 0)
|
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')
|
m3u8_url = self._search_regex(
|
||||||
bitrates = [int(b) for b in bitrates.rstrip(',').split(',')]
|
r'<source[^>]+src=(["\'])(?P<url>.+?/master\.m3u8)\1',
|
||||||
bitrates.sort()
|
webpage, 'm3u8 url', default=None, group='url')
|
||||||
|
|
||||||
formats = []
|
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 bitrate in bitrates:
|
||||||
for link in links:
|
for link in links:
|
||||||
formats.append({
|
formats.append({
|
||||||
|
|
Loading…
Reference in a new issue