+ {
+ 'url': 'http://vk.com/video-8871596_164049491',
+ 'md5': 'a590bcaf3d543576c9bd162812387666',
+ 'note': 'Only available for registered users',
+ 'info_dict': {
+ 'id': '164049491',
+ 'ext': 'mp4',
+ 'uploader': 'Триллеры',
+ 'title': '► Бойцовский клуб / Fight Club 1999 [HD 720]\u00a0',
+ 'duration': 8352,
+ },
+ 'skip': 'Requires vk account credentials',
+ },
+ ]
+
+ def _login(self):
+ (username, password) = self._get_login_info()
+ if username is None:
+ return
+
+ login_form = {
+ 'act': 'login',
+ 'role': 'al_frame',
+ 'expire': '1',
+ 'email': username,
+ 'pass': password,
+ }
+
+ request = compat_urllib_request.Request('https://login.vk.com/?act=login',
+ compat_urllib_parse.urlencode(login_form).encode('utf-8'))
+ login_page = self._download_webpage(request, None, note='Logging in as %s' % username)
+
+ if re.search(r'onLoginFailed', login_page):
+ raise ExtractorError('Unable to login, incorrect username and/or password', expected=True)
+
+ def _real_initialize(self):
+ self._login()