- """Information Extractor for Vbox7"""
- _VALID_URL = r'(?:http://)?(?:www\.)?vbox7\.com/play:([^/]+)'
+ _VALID_URL = r'http://(?:www\.)?vbox7\.com/play:(?P<id>[^/]+)'
+ _TEST = {
+ 'url': 'http://vbox7.com/play:249bb972c2',
+ 'md5': '99f65c0c9ef9b682b97313e052734c3f',
+ 'info_dict': {
+ 'id': '249bb972c2',
+ 'ext': 'mp4',
+ 'title': 'Смях! Чудо - чист за секунди - Скрита камера',
+ },
+ }
+
+ def _real_extract(self, url):
+ video_id = self._match_id(url)
+
+ # need to get the page 3 times for the correct jsSecretToken cookie
+ # which is necessary for the correct title
+ def get_session_id():
+ redirect_page = self._download_webpage(url, video_id)
+ session_id_url = self._search_regex(
+ r'var\s*url\s*=\s*\'([^\']+)\';', redirect_page,
+ 'session id url')
+ self._download_webpage(
+ compat_urlparse.urljoin(url, session_id_url), video_id,
+ 'Getting session id')