From f4076bb73686484310a3a2b7c0c4c20db6e186bc Mon Sep 17 00:00:00 2001 From: remitamine Date: Sat, 10 Oct 2015 19:56:55 +0100 Subject: [PATCH 1/4] [vimeo] extract m3u8 manifest and bitrate --- youtube_dl/extractor/vimeo.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/youtube_dl/extractor/vimeo.py b/youtube_dl/extractor/vimeo.py index 7dd52627da..93638d6b2a 100644 --- a/youtube_dl/extractor/vimeo.py +++ b/youtube_dl/extractor/vimeo.py @@ -397,8 +397,12 @@ def _real_extract(self, url): 'format_id': format_id, 'width': file_info.get('width'), 'height': file_info.get('height'), + 'tbr': file_info.get('bitrate'), }) formats = [] + hls = config_files.get("hls") + if hls: + formats = self._extract_m3u8_formats(hls['all'], video_id, m3u8_id='hls') for key in ('other', 'sd', 'hd'): formats += files[key] if len(formats) == 0: From e5c209a1bcea206bee684914599c84acf886487c Mon Sep 17 00:00:00 2001 From: remitamine Date: Sat, 10 Oct 2015 20:34:10 +0100 Subject: [PATCH 2/4] [vimeo] add parameters to _extract_m3u8_formats and sort formats --- youtube_dl/extractor/vimeo.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/vimeo.py b/youtube_dl/extractor/vimeo.py index 93638d6b2a..2ea5f0b79e 100644 --- a/youtube_dl/extractor/vimeo.py +++ b/youtube_dl/extractor/vimeo.py @@ -402,11 +402,12 @@ def _real_extract(self, url): formats = [] hls = config_files.get("hls") if hls: - formats = self._extract_m3u8_formats(hls['all'], video_id, m3u8_id='hls') + formats = self._extract_m3u8_formats(hls['all'], video_id, 'mp4', 'm3u8_native', 0, 'hls', fatal=False) for key in ('other', 'sd', 'hd'): formats += files[key] if len(formats) == 0: raise ExtractorError('No known codec found') + self._sort_formats(formats) subtitles = {} text_tracks = config['request'].get('text_tracks') From fff496c689e44ac96909cf55c9ae746fb6b14e07 Mon Sep 17 00:00:00 2001 From: remitamine Date: Sat, 10 Oct 2015 20:45:34 +0100 Subject: [PATCH 3/4] [vimeo] remove check for empty formats --- youtube_dl/extractor/vimeo.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/youtube_dl/extractor/vimeo.py b/youtube_dl/extractor/vimeo.py index 2ea5f0b79e..2051ac9de5 100644 --- a/youtube_dl/extractor/vimeo.py +++ b/youtube_dl/extractor/vimeo.py @@ -405,8 +405,6 @@ def _real_extract(self, url): formats = self._extract_m3u8_formats(hls['all'], video_id, 'mp4', 'm3u8_native', 0, 'hls', fatal=False) for key in ('other', 'sd', 'hd'): formats += files[key] - if len(formats) == 0: - raise ExtractorError('No known codec found') self._sort_formats(formats) subtitles = {} From 35a3ff1d337edd527c73db133d87ed23ca4469f5 Mon Sep 17 00:00:00 2001 From: remitamine Date: Sat, 10 Oct 2015 21:05:29 +0100 Subject: [PATCH 4/4] [vimeo] always convert width, height and bitrate to int --- youtube_dl/extractor/vimeo.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/youtube_dl/extractor/vimeo.py b/youtube_dl/extractor/vimeo.py index 2051ac9de5..97590d220d 100644 --- a/youtube_dl/extractor/vimeo.py +++ b/youtube_dl/extractor/vimeo.py @@ -395,14 +395,14 @@ def _real_extract(self, url): 'ext': codec_extension, 'url': video_url, 'format_id': format_id, - 'width': file_info.get('width'), - 'height': file_info.get('height'), - 'tbr': file_info.get('bitrate'), + 'width': int_or_none(file_info.get('width')), + 'height': int_or_none(file_info.get('height')), + 'tbr': int_or_none(file_info.get('bitrate')), }) formats = [] - hls = config_files.get("hls") - if hls: - formats = self._extract_m3u8_formats(hls['all'], video_id, 'mp4', 'm3u8_native', 0, 'hls', fatal=False) + m3u8_url = config_files.get('hls', {}).get('all') + if m3u8_url: + formats = self._extract_m3u8_formats(m3u8_url, video_id, 'mp4', 'm3u8_native', 0, 'hls', fatal=False) for key in ('other', 'sd', 'hd'): formats += files[key] self._sort_formats(formats)