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