]>
jfr.im git - yt-dlp.git/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/484091715184808010_284179915',
9 u
'file': u
'484091715184808010_284179915.mp4',
10 u
'md5': u
'deda4ff333abe2e118740321e992605b',
12 u
"uploader_id": u
"videoseconds",
13 u
"title": u
"Instagram photo by @videoseconds"
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 video_url
= self
._html
_search
_regex
(
22 r
'<meta property="og:video:secure_url" content="(.+?)">',
23 webpage
, u
'video URL')
24 thumbnail_url
= self
._html
_search
_regex
(
25 r
'<meta property="og:image" content="(.+?)" />',
26 webpage
, u
'thumbnail URL', fatal
=False)
27 html_title
= self
._html
_search
_regex
(
28 r
'<title>(.+?)</title>',
30 title
= re
.sub(r
'(?: *\(Videos?\))? \| Statigram$', '', html_title
)
31 uploader_id
= self
._html
_search
_regex
(
32 r
'@([^ ]+)', title
, u
'uploader name', fatal
=False)
40 'thumbnail': thumbnail_url
,
41 'uploader_id' : uploader_id