1 from .common
import InfoExtractor
8 class ViddlerIE(InfoExtractor
):
9 _VALID_URL
= r
'https?://(?:www\.)?viddler\.com/(?:v|embed|player)/(?P<id>[a-z0-9]+)(?:.+?\bsecret=(\d+))?'
10 _EMBED_REGEX
= [r
'<(?:iframe[^>]+?src|param[^>]+?value)=(["\'])(?P
<url
>(?
:https?
:)?
//(?
:www\
.)?viddler\
.com
/(?
:embed|player
)/.+?
)\
1']
13 'url
': 'http
://www
.viddler
.com
/v
/43903784',
14 'md5
': '9eee21161d2c7f5b39690c3e325fab2f
',
18 'title
': 'Video Made Easy
',
19 'description
': 'md5
:6a697ebd844ff3093bd2e82c37b409cd
',
20 'uploader
': 'viddler
',
21 'timestamp
': 1335371429,
22 'upload_date
': '20120425',
24 'thumbnail
': r're
:^https?
://.*\
.jpg$
',
27 'categories
': ['video content
', 'high quality video
', 'video made easy
', 'how to produce video with limited resources
', 'viddler
'],
30 'url
': 'http
://www
.viddler
.com
/v
/4d03aad9
/',
31 'md5
': 'f12c5a7fa839c47a79363bfdf69404fb
',
35 'title
': 'WALL
-TO
-GORTAT
',
36 'upload_date
': '20150126',
37 'uploader
': 'deadspin
',
38 'timestamp
': 1422285291,
43 'url
': 'http
://www
.viddler
.com
/player
/221ebbbd
/0/',
44 'md5
': '740511f61d3d1bb71dc14a0fe01a1c10
',
48 'title
': 'LETeens
-Grammar
-snack
-third
-conditional
',
50 'upload_date
': '20140929',
51 'uploader
': 'BCLETeens
',
52 'timestamp
': 1411997190,
58 'url
': 'http
://www
.viddler
.com
/v
/890c0985?secret
=34051570',
62 'title
': 'Complete Property Training
- Traineeships
',
64 'upload_date
': '20130606',
65 'uploader
': 'TiffanyBowtell
',
66 'timestamp
': 1370496993,
71 'skip_download
': True,
75 def _real_extract(self, url):
76 video_id, secret = self._match_valid_url(url).groups()
80 'key
': 'v0vhrt7bg2xq1vyxhkct
',
83 query['secret
'] = secret
85 data = self._download_json(
86 'http
://api
.viddler
.com
/api
/v2
/viddler
.videos
.getPlaybackDetails
.json
',
87 video_id, headers={'Referer
': url}, query=query)['video
']
90 for filed in data['files
']:
91 if filed.get('status
', 'ready
') != 'ready
':
93 format_id = filed.get('profile_id
') or filed['profile_name
']
95 'format_id
': format_id,
96 'format_note
': filed['profile_name
'],
97 'url
': self._proto_relative_url(filed['url
']),
98 'width
': int_or_none(filed.get('width
')),
99 'height
': int_or_none(filed.get('height
')),
100 'filesize
': int_or_none(filed.get('size
')),
101 'ext
': filed.get('ext
'),
102 'source_preference
': -1,
106 if filed.get('cdn_url
'):
108 f['url
'] = self._proto_relative_url(filed['cdn_url
'], 'http
:')
109 f['format_id
'] = format_id + '-cdn
'
110 f['source_preference
'] = 1
113 if filed.get('html5_video_source
'):
115 f['url
'] = self._proto_relative_url(filed['html5_video_source
'])
116 f['format_id
'] = format_id + '-html5
'
117 f['source_preference
'] = 0
121 t.get('text
') for t in data.get('tags
', []) if 'text
' in t]
125 'title
': data['title
'],
127 'description
': data.get('description
'),
128 'timestamp
': int_or_none(data.get('upload_time
')),
129 'thumbnail
': self._proto_relative_url(data.get('thumbnail_url
')),
130 'uploader
': data.get('author
'),
131 'duration
': float_or_none(data.get('length
')),
132 'view_count
': int_or_none(data.get('view_count
')),
133 'comment_count
': int_or_none(data.get('comment_count
')),
134 'categories
': categories,