2 from __future__ import unicode_literals
6 from .common import InfoExtractor
17 class SnotrIE(InfoExtractor):
18 _VALID_URL = r'http?://(?:www\.)?snotr\.com/video/(?P<id>\d+)/([\w]+)'
20 'url': 'http://www.snotr.com/video/13708/Drone_flying_through_fireworks',
24 'title': 'Drone flying through fireworks!',
34 'url': 'http://www.snotr.com/video/530/David_Letteman_-_George_W_Bush_Top_10',
38 'title': 'David Letteman - George W. Bush Top 10',
45 def _real_extract(self, url):
46 mobj = re.match(self._VALID_URL, url)
47 video_id = mobj.group('id')
49 # TODO more code goes here, for example ...
50 webpage = self._download_webpage(url, video_id)
51 title = self._og_search_title(webpage)
53 description = self._og_search_description(webpage)
55 video_url = "http://cdn.videos.snotr.com/%s.flv" % video_id
57 view_count = str_to_int(self._html_search_regex(r'<p>\n<strong>Views:</strong>\n([\d,\.]+)</p>',webpage,'view count'))
59 duration = self._html_search_regex(r'<p>\n<strong>Length:</strong>\n(.*?)</p>',webpage,'duration')
60 duration = str_to_int(duration[:1])*60 + str_to_int(duration[2:4])
62 file_size = self._html_search_regex(r'<p>\n<strong>Filesize:</strong>\n(.*?)</p>',webpage,'filesize')
63 file_size = str_to_int(re.match(r'\d+',file_size).group())*131072
69 'view_count':view_count,