]>
jfr.im git - yt-dlp.git/blob - youtube_dl/extractor/videott.py
1 from __future__
import unicode_literals
6 from .common
import InfoExtractor
13 class VideoTtIE(InfoExtractor
):
15 IE_DESC
= 'video.tt - Your True Tube'
16 _VALID_URL
= r
'http://(?:www\.)?video\.tt/(?:video\/|embed\/|watch_video\.php\?v=)(?P<id>[\da-zA-Z]{9})'
19 'url': 'http://www.video.tt/watch_video.php?v=amd5YujV8',
20 'md5': 'b13aa9e2f267effb5d1094443dff65ba',
24 'title': 'Motivational video Change your mind in just 2.50 mins',
26 'upload_date': '20130827',
27 'uploader': 'joseph313',
31 def _real_extract(self
, url
):
32 mobj
= re
.match(self
._VALID
_URL
, url
)
33 video_id
= mobj
.group('id')
35 settings
= self
._download
_json
(
36 'http://www.video.tt/player_control/settings.php?v=%s' % video_id
, video_id
,
37 'Downloading video JSON')['settings']
39 video
= settings
['video_details']['video']
43 'url': base64
.b64decode(res
['u']).decode('utf-8'),
45 'format_id': res
['l'],
46 } for res
in settings
['res'] if res
['u']
51 'title': video
['title'],
52 'description': video
['description'],
53 'thumbnail': settings
['config']['thumbnail'],
54 'upload_date': unified_strdate(video
['added']),
55 'uploader': video
['owner'],
56 'view_count': int_or_none(video
['view_count']),
57 'comment_count': None if video
.get('comment_count') == '--' else int_or_none(video
['comment_count']),
58 'like_count': int_or_none(video
['liked']),
59 'dislike_count': int_or_none(video
['disliked']),