2 from __future__ import unicode_literals
5 from .common import InfoExtractor
7 from ..utils import int_or_none
10 class VidioIE(InfoExtractor):
11 _VALID_URL = r'https?://(?:www\.)?vidio\.com/watch/(?P<id>\d{6})-(?P<display_id>[^/?]+)'
13 'url': 'http://www.vidio.com/watch/165683-dj_ambred-booyah-live-2015',
16 'title': 'DJ_AMBRED - Booyah (Live 2015)',
18 'thumbnail': 'https://cdn0-a.production.vidio.static6.com/uploads/video/image/165683/dj_ambred-booyah-live-2015-bfb2ba.jpg',
19 'description': 'md5:27dc15f819b6a78a626490881adbadf8',
28 def _real_extract(self, url):
29 mobj = re.match(self._VALID_URL, url)
30 video_id, display_id = mobj.group('id', 'display_id')
32 webpage = self._download_webpage(url, display_id)
34 video_data = self._parse_json(self._html_search_regex(
35 r'data-json-clips\s*=\s*"\[(.+)\]"', webpage, 'video data'), display_id)
37 formats = self._extract_m3u8_formats(
38 video_data['sources'][0]['file'],
39 display_id, ext='mp4')
43 'title': self._og_search_title(webpage),
45 'thumbnail': video_data.get('image'),
46 'description': self._og_search_description(webpage),
47 'duration': int_or_none(video_data.get('clip_duration')),