]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/iconosquare.py
1d5a10a3b6349d95387aee00d4be5e6deac618b8
1 from __future__
import unicode_literals
5 from .common
import InfoExtractor
8 class IconosquareIE(InfoExtractor
):
9 _VALID_URL
= r
'https?://(www\.)?(?:iconosquare\.com|statigr\.am)/p/(?P<id>[^/]+)'
11 'url': 'http://statigr.am/p/522207370455279102_24101272',
12 'md5': '6eb93b882a3ded7c378ee1d6884b1814',
14 'id': '522207370455279102_24101272',
16 'uploader_id': 'aguynamedpatrick',
17 'title': 'Instagram photo by @aguynamedpatrick (Patrick Janelle)',
18 'description': 'md5:644406a9ec27457ed7aa7a9ebcd4ce3d',
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 html_title
= self
._html
_search
_regex
(
27 r
'<title>(.+?)</title>',
29 title
= re
.sub(r
'(?: *\(Videos?\))? \| (?:Iconosquare|Statigram)$', '', html_title
)
30 uploader_id
= self
._html
_search
_regex
(
31 r
'@([^ ]+)', title
, 'uploader name', fatal
=False)
35 'url': self
._og
_search
_video
_url
(webpage
),
37 'description': self
._og
_search
_description
(webpage
),
38 'thumbnail': self
._og
_search
_thumbnail
(webpage
),
39 'uploader_id': uploader_id