]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/statigram.py
d602e817a076cbfbdfb5c50da8e3b1f23583b8d0
   1 from __future__ 
import unicode_literals
 
   5 from .common 
import InfoExtractor
 
   8 class StatigramIE(InfoExtractor
): 
   9     _VALID_URL 
= r
'https?://(www\.)?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)', 
  21     def _real_extract(self
, url
): 
  22         mobj 
= re
.match(self
._VALID
_URL
, url
) 
  23         video_id 
= mobj
.group('id') 
  24         webpage 
= self
._download
_webpage
(url
, video_id
) 
  25         html_title 
= self
._html
_search
_regex
( 
  26             r
'<title>(.+?)</title>', 
  28         title 
= re
.sub(r
'(?: *\(Videos?\))? \| Statigram$', '', html_title
) 
  29         uploader_id 
= self
._html
_search
_regex
( 
  30             r
'@([^ ]+)', title
, 'uploader name', fatal
=False) 
  34             'url': self
._og
_search
_video
_url
(webpage
), 
  36             'thumbnail': self
._og
_search
_thumbnail
(webpage
), 
  37             'uploader_id': uploader_id