1 from __future__ import unicode_literals
6 from .common import InfoExtractor
13 class VideoTtIE(InfoExtractor):
16 IE_DESC = 'video.tt - Your True Tube'
17 _VALID_URL = r'https?://(?:www\.)?video\.tt/(?:(?:video|embed)/|watch_video\.php\?v=)(?P<id>[\da-zA-Z]{9})'
20 'url': 'http://www.video.tt/watch_video.php?v=amd5YujV8',
21 'md5': 'b13aa9e2f267effb5d1094443dff65ba',
25 'title': 'Motivational video Change your mind in just 2.50 mins',
27 'upload_date': '20130827',
28 'uploader': 'joseph313',
31 'url': 'http://video.tt/embed/amd5YujV8',
32 'only_matching': True,
35 def _real_extract(self, url):
36 mobj = re.match(self._VALID_URL, url)
37 video_id = mobj.group('id')
39 settings = self._download_json(
40 'http://www.video.tt/player_control/settings.php?v=%s' % video_id, video_id,
41 'Downloading video JSON')['settings']
43 video = settings['video_details']['video']
47 'url': base64.b64decode(res['u'].encode('utf-8')).decode('utf-8'),
49 'format_id': res['l'],
50 } for res in settings['res'] if res['u']
55 'title': video['title'],
56 'description': video['description'],
57 'thumbnail': settings['config']['thumbnail'],
58 'upload_date': unified_strdate(video['added']),
59 'uploader': video['owner'],
60 'view_count': int_or_none(video['view_count']),
61 'comment_count': None if video.get('comment_count') == '--' else int_or_none(video['comment_count']),
62 'like_count': int_or_none(video['liked']),
63 'dislike_count': int_or_none(video['disliked']),