import itertools
from .common import InfoExtractor
+from .subtitles import SubtitlesInfoExtractor
from ..utils import (
compat_urllib_parse,
compat_urllib_request,
)
-class VimeoIE(InfoExtractor):
+class VimeoIE(SubtitlesInfoExtractor):
"""Information extractor for vimeo.com."""
# _VALID_URL matches Vimeo URLs
'videopassword': 'youtube-dl',
},
},
+ {
+ 'url': 'http://vimeo.com/76979871',
+ 'md5': '3363dd6ffebe3784d56f4132317fd446',
+ 'note': 'Video with subtitles',
+ 'info_dict': {
+ 'id': '76979871',
+ 'ext': 'mp4',
+ 'title': 'The New Vimeo Player (You Know, For Videos)',
+ 'description': 'md5:2ec900bf97c3f389378a96aee11260ea',
+ 'upload_date': '20131015',
+ 'uploader_id': 'staff',
+ 'uploader': 'Vimeo Staff',
+ }
+ },
]
def _login(self):
if len(formats) == 0:
raise ExtractorError('No known codec found')
+ subtitles = {}
+ text_tracks = config['request'].get('text_tracks')
+ if text_tracks:
+ for tt in text_tracks:
+ subtitles[tt['lang']] = 'http://vimeo.com' + tt['url']
+
+ video_subtitles = self.extract_subtitles(video_id, subtitles)
+ if self._downloader.params.get('listsubtitles', False):
+ self._list_available_subtitles(video_id, subtitles)
+ return
+
return {
'id': video_id,
'uploader': video_uploader,
'view_count': view_count,
'like_count': like_count,
'comment_count': comment_count,
+ 'subtitles': video_subtitles,
}