]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/instagram.py
3 from .common
import InfoExtractor
5 class InstagramIE(InfoExtractor
):
6 _VALID_URL
= r
'(?:http://)?instagram.com/p/(.*?)/'
8 u
'url': u
'http://instagram.com/p/aye83DjauH/?foo=bar#abc',
9 u
'file': u
'aye83DjauH.mp4',
10 u
'md5': u
'0d2da106a9d2631273e192b372806516',
12 u
"uploader_id": u
"naomipq",
13 u
"title": u
"Video by naomipq",
14 u
'description': u
'md5:1f17f0ab29bd6fe2bfad705f58de3cb8',
18 def _real_extract(self
, url
):
19 mobj
= re
.match(self
._VALID
_URL
, url
)
20 video_id
= mobj
.group(1)
21 webpage
= self
._download
_webpage
(url
, video_id
)
22 uploader_id
= self
._search
_regex
(r
'"owner":{"username":"(.+?)"',
23 webpage
, u
'uploader id', fatal
=False)
24 desc
= self
._search
_regex
(r
'"caption":"(.*?)"', webpage
, u
'description',
29 'url': self
._og
_search
_video
_url
(webpage
),
31 'title': u
'Video by %s' % uploader_id
,
32 'thumbnail': self
._og
_search
_thumbnail
(webpage
),
33 'uploader_id' : uploader_id
,