Автор.*?onmouseover="popup_user_info\\(.*?\'([^\']+)\'\\);">',
video_page, u'uploader id', fatal=False, flags=re.MULTILINE|re.DOTALL)
video_view_count = self._html_search_regex(
- ur'Общее количество просмотров.*?(\d+)',
+ u'Общее количество просмотров.*?(\\d+)',
video_page, u'view count', fatal=False, flags=re.MULTILINE|re.DOTALL)
return {
'id': video_id,
'url': video_url,
'title': video_title,
- 'ext': video_ext,
'thumbnail': video_thumbnail,
'description': video_description,
'uploader': video_uploader,
@@ -197,43 +206,47 @@ class SmotriIE(InfoExtractor):
'video_page_url': video_page_url
}
+
class SmotriCommunityIE(InfoExtractor):
IE_DESC = u'Smotri.com community videos'
IE_NAME = u'smotri:community'
- _VALID_URL = r'^(?:http://)?(?:www\.)?smotri\.com/community/video/(?P[0-9A-Za-z_\'-]+)'
+ _VALID_URL = r'^https?://(?:www\.)?smotri\.com/community/video/(?P[0-9A-Za-z_\'-]+)'
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
community_id = mobj.group('communityid')
-
+
url = 'http://smotri.com/export/rss/video/by/community/-/%s/video.xml' % community_id
rss = self._download_xml(url, community_id, u'Downloading community RSS')
-
+
entries = [self.url_result(video_url.text, 'Smotri')
for video_url in rss.findall('./channel/item/link')]
-
+
+ description_text = rss.find('./channel/description').text
community_title = self._html_search_regex(
- ur'^Видео сообщества "([^"]+)"$', rss.find('./channel/description').text, u'community title')
+ u'^Видео сообщества "([^"]+)"$', description_text, u'community title')
return self.playlist_result(entries, community_id, community_title)
-
+
+
class SmotriUserIE(InfoExtractor):
IE_DESC = u'Smotri.com user videos'
IE_NAME = u'smotri:user'
- _VALID_URL = r'^(?:http://)?(?:www\.)?smotri\.com/user/(?P[0-9A-Za-z_\'-]+)'
-
+ _VALID_URL = r'^https?://(?:www\.)?smotri\.com/user/(?P[0-9A-Za-z_\'-]+)'
+
def _real_extract(self, url):
- mobj = re.match(self._VALID_URL, url);
+ mobj = re.match(self._VALID_URL, url)
user_id = mobj.group('userid')
-
+
url = 'http://smotri.com/export/rss/user/video/-/%s/video.xml' % user_id
rss = self._download_xml(url, user_id, u'Downloading user RSS')
-
+
entries = [self.url_result(video_url.text, 'Smotri')
for video_url in rss.findall('./channel/item/link')]
-
+
+ description_text = rss.find('./channel/description').text
user_nickname = self._html_search_regex(
- ur'^Видео режиссера (.*)$', rss.find('./channel/description').text, u'user nickname')
+ u'^Видео режиссера (.*)$', description_text,
+ u'user nickname')
return self.playlist_result(entries, user_id, user_nickname)
-
\ No newline at end of file