]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/instagram.py
63141af272ac077ed97dcd5baf4c5a0dcb7d3b47
1 from __future__
import unicode_literals
5 from .common
import InfoExtractor
8 class InstagramIE(InfoExtractor
):
9 _VALID_URL
= r
'http://instagram\.com/p/(?P<id>.*?)/'
11 'url': 'http://instagram.com/p/aye83DjauH/?foo=bar#abc',
12 'md5': '0d2da106a9d2631273e192b372806516',
16 'uploader_id': 'naomipq',
17 'title': 'Video by naomipq',
18 'description': 'md5:1f17f0ab29bd6fe2bfad705f58de3cb8',
22 def _real_extract(self
, url
):
23 mobj
= re
.match(self
._VALID
_URL
, url
)
24 video_id
= mobj
.group('id')
25 webpage
= self
._download
_webpage
(url
, video_id
)
26 uploader_id
= self
._search
_regex
(r
'"owner":{"username":"(.+?)"',
27 webpage
, 'uploader id', fatal
=False)
28 desc
= self
._search
_regex
(r
'"caption":"(.*?)"', webpage
, 'description',
33 'url': self
._og
_search
_video
_url
(webpage
, secure
=False),
35 'title': 'Video by %s' % uploader_id
,
36 'thumbnail': self
._og
_search
_thumbnail
(webpage
),
37 'uploader_id': uploader_id
,