]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/vine.py
1 from __future__
import unicode_literals
5 from .common
import InfoExtractor
8 class VineIE(InfoExtractor
):
9 _VALID_URL
= r
'https?://(?:www\.)?vine\.co/v/(?P<id>\w+)'
11 'url': 'https://vine.co/v/b9KOOWX7HUx',
12 'md5': '2f36fed6235b16da96ce9b4dc890940d',
16 'uploader': 'Jack Dorsey',
21 def _real_extract(self
, url
):
22 mobj
= re
.match(self
._VALID
_URL
, url
)
24 video_id
= mobj
.group('id')
25 webpage_url
= 'https://vine.co/v/' + video_id
26 webpage
= self
._download
_webpage
(webpage_url
, video_id
)
28 self
.report_extraction(video_id
)
30 video_url
= self
._html
_search
_meta
('twitter:player:stream', webpage
,
33 uploader
= self
._html
_search
_regex
(r
'<p class="username">(.*?)</p>',
34 webpage
, 'uploader', fatal
=False, flags
=re
.DOTALL
)
40 'title': self
._og
_search
_title
(webpage
),
41 'thumbnail': self
._og
_search
_thumbnail
(webpage
),