X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fwebsurg.py;h=43953bfdd566c2a17b58c124f92ad7dab5c2312b;hb=d981cef6b977ccd070bf2c26f3ec496a95c8f802;hp=efc8029af794eed63218b6ac4d29a911d06c6a52;hpb=cc6943e86aef74bef767be7f4027ab6122c95d55;p=youtube-dl diff --git a/youtube_dl/extractor/websurg.py b/youtube_dl/extractor/websurg.py index efc8029af..43953bfdd 100644 --- a/youtube_dl/extractor/websurg.py +++ b/youtube_dl/extractor/websurg.py @@ -18,7 +18,8 @@ class WeBSurgIE(InfoExtractor): u'file': u'vd01en4012.mp4', u'params': { u'skip_download': True, - } + }, + u'skip': u'Requires login information', } _LOGIN_URL = 'http://www.websurg.com/inc/login/login_div.ajax.php?login=1' @@ -36,21 +37,19 @@ class WeBSurgIE(InfoExtractor): request.add_header( 'Content-Type', 'application/x-www-form-urlencoded;charset=utf-8') compat_urllib_request.urlopen(request).info() + webpage = self._download_webpage(self._LOGIN_URL, '', 'Logging in') - def _real_extract(self, url): - - request = compat_urllib_request.Request(url) - webpage = unicode( - compat_urllib_request.urlopen(request).read(), 'utf-8') + if webpage != 'OK': + self._downloader.report_error( + u'Unable to log in: bad username/password') + def _real_extract(self, url): video_id = re.match(self._VALID_URL, url).group(1) + webpage = self._download_webpage(url, video_id) + url_info = re.search(r'streamer="(.*?)" src="(.*?)"', webpage) - if url_info is None: - self._downloader.report_warning( - u'Unable to log in: bad username/password') - return return {'id': video_id, 'title': self._og_search_title(webpage), 'description': self._og_search_description(webpage),