]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/vine.py
bdd3522ebf5a7385a80c54a6e85c808d54346cc4
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 video_title
= self
._html
_search
_regex
(r
'<meta property="og:title" content="(.+?)"',
33 thumbnail
= self
._html
_search
_regex
(r
'<meta property="og:image" content="(.+?)(\?.*?)?"',
34 webpage
, u
'thumbnail', fatal
=False)
36 uploader
= self
._html
_search
_regex
(r
'<div class="user">.*?<h2>(.+?)</h2>',
37 webpage
, u
'uploader', fatal
=False, flags
=re
.DOTALL
)
44 'thumbnail': thumbnail
,