]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/vine.py
c4ec1f06ffe3ccce17598aeb319047f0890f9a02
3 from .common
import InfoExtractor
6 class VineIE(InfoExtractor
):
7 _VALID_URL
= r
'(?:https?://)?(?:www\.)?vine\.co/v/(?P<id>\w+)'
9 u
'url': u
'https://vine.co/v/b9KOOWX7HUx',
10 u
'file': u
'b9KOOWX7HUx.mp4',
11 u
'md5': u
'2f36fed6235b16da96ce9b4dc890940d',
13 u
"uploader": u
"Jack Dorsey",
18 def _real_extract(self
, url
):
19 mobj
= re
.match(self
._VALID
_URL
, url
)
21 video_id
= mobj
.group('id')
22 webpage_url
= 'https://vine.co/v/' + video_id
23 webpage
= self
._download
_webpage
(webpage_url
, video_id
)
25 self
.report_extraction(video_id
)
27 video_url
= self
._html
_search
_regex
(r
'<meta property="twitter:player:stream" content="(.+?)"',
28 webpage
, u
'video URL')
30 uploader
= self
._html
_search
_regex
(r
'<div class="user">.*?<h2>(.+?)</h2>',
31 webpage
, u
'uploader', fatal
=False, flags
=re
.DOTALL
)
37 'title': self
._og
_search
_title
(webpage
),
38 'thumbnail': self
._og
_search
_thumbnail
(webpage
),