]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/statigram.py
3 from .common
import InfoExtractor
5 class StatigramIE(InfoExtractor
):
6 _VALID_URL
= r
'(?:http://)?(?:www\.)?statigr\.am/p/([^/]+)'
8 u
'url': u
'http://statigr.am/p/522207370455279102_24101272',
9 u
'file': u
'522207370455279102_24101272.mp4',
10 u
'md5': u
'6eb93b882a3ded7c378ee1d6884b1814',
12 u
'uploader_id': u
'aguynamedpatrick',
13 u
'title': u
'Instagram photo by @aguynamedpatrick (Patrick Janelle)',
17 def _real_extract(self
, url
):
18 mobj
= re
.match(self
._VALID
_URL
, url
)
19 video_id
= mobj
.group(1)
20 webpage
= self
._download
_webpage
(url
, video_id
)
21 html_title
= self
._html
_search
_regex
(
22 r
'<title>(.+?)</title>',
24 title
= re
.sub(r
'(?: *\(Videos?\))? \| Statigram$', '', html_title
)
25 uploader_id
= self
._html
_search
_regex
(
26 r
'@([^ ]+)', title
, u
'uploader name', fatal
=False)
31 'url': self
._og
_search
_video
_url
(webpage
),
34 'thumbnail': self
._og
_search
_thumbnail
(webpage
),
35 'uploader_id' : uploader_id