]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/vzaar.py
02fcd52c74c268ea8274359af46810a6beeb0636
2 from __future__
import unicode_literals
6 from .common
import InfoExtractor
13 class VzaarIE(InfoExtractor
):
14 _VALID_URL
= r
'https?://(?:(?:www|view)\.)?vzaar\.com/(?:videos/)?(?P<id>\d+)'
16 'url': 'https://vzaar.com/videos/1152805',
17 'md5': 'bde5ddfeb104a6c56a93a06b04901dbf',
21 'title': 'sample video (public)',
24 'url': 'https://view.vzaar.com/27272/player',
25 'md5': '3b50012ac9bbce7f445550d54e0508f2',
34 def _extract_urls(webpage
):
36 r
'<iframe[^>]+src=["\']((?
:https?
:)?
//(?
:view\
.vzaar\
.com
)/[0-9]+)',
39 def _real_extract(self, url):
40 video_id = self._match_id(url)
41 video_data = self._download_json(
42 'http
://view
.vzaar
.com
/v2
/%s/video
' % video_id, video_id)
43 source_url = video_data['sourceUrl
']
47 'title
': video_data['videoTitle
'],
49 'thumbnail
': self._proto_relative_url(video_data.get('poster
')),
50 'duration
': float_or_none(video_data.get('videoDuration
')),
52 if 'audio
' in source_url:
59 'width
': int_or_none(video_data.get('width
')),
60 'height
': int_or_none(video_data.get('height
')),