1 from __future__ import unicode_literals
3 from .common import InfoExtractor
11 class VeohIE(InfoExtractor):
12 _VALID_URL = r'https?://(?:www\.)?veoh\.com/(?:watch|embed|iphone/#_Watch)/(?P<id>(?:v|e|yapi-)[\da-zA-Z]+)'
15 'url': 'http://www.veoh.com/watch/v56314296nk7Zdmz3',
16 'md5': '9e7ecc0fd8bbee7a69fe38953aeebd30',
18 'id': 'v56314296nk7Zdmz3',
20 'title': 'Straight Backs Are Stronger',
21 'uploader': 'LUMOback',
22 'description': 'At LUMOback, we believe straight backs are stronger. The LUMOback Posture & Movement Sensor: It gently vibrates when you slouch, inspiring improved posture and mobility. Use the app to track your data and improve your posture over time. ',
25 'url': 'http://www.veoh.com/embed/v56314296nk7Zdmz3',
26 'only_matching': True,
28 'url': 'http://www.veoh.com/watch/v27701988pbTc4wzN?h1=Chile+workers+cover+up+to+avoid+skin+damage',
29 'md5': '4a6ff84b87d536a6a71e6aa6c0ad07fa',
33 'title': 'Chile workers cover up to avoid skin damage',
34 'description': 'md5:2bd151625a60a32822873efc246ba20d',
35 'uploader': 'afp-news',
38 'skip': 'This video has been deleted.',
40 'url': 'http://www.veoh.com/watch/v69525809F6Nc4frX',
41 'md5': '4fde7b9e33577bab2f2f8f260e30e979',
42 'note': 'Embedded ooyala video',
46 'title': 'Doctors Alter Plan For Preteen\'s Weight Loss Surgery',
47 'description': 'md5:f5a11c51f8fb51d2315bca0937526891',
48 'uploader': 'newsy-videos',
50 'skip': 'This video has been deleted.',
52 'url': 'http://www.veoh.com/watch/e152215AJxZktGS',
53 'only_matching': True,
56 def _extract_video(self, source):
58 'id': source.get('videoId'),
59 'title': source.get('title'),
60 'description': source.get('description'),
61 'thumbnail': source.get('highResImage') or source.get('medResImage'),
62 'uploader': source.get('username'),
63 'duration': int_or_none(source.get('length')),
64 'view_count': int_or_none(source.get('views')),
65 'age_limit': 18 if source.get('isMature') == 'true' or source.get('isSexy') == 'true' else 0,
66 'formats': self._extract_formats(source),
69 def _real_extract(self, url):
70 video_id = self._match_id(url)
71 video = self._download_json(
72 'https://www.veoh.com/watch/getVideo/' + video_id,
74 title = video['title']
77 q = qualities(['HQ', 'Regular'])
79 for f_id, f_url in video.get('src', {}).items():
90 self._sort_formats(formats)
95 'description': video.get('description'),
96 'thumbnail': thumbnail_url,
97 'uploader': video.get('author', {}).get('nickname'),
98 'duration': int_or_none(video.get('lengthBySec')) or parse_duration(video.get('length')),
99 'view_count': int_or_none(video.get('views')),
101 'average_rating': int_or_none(video.get('rating')),
102 'comment_count': int_or_none(video.get('numOfComments')),