[vodlocker] Capture file not found error (Closes #7696)

This commit is contained in:
Sergey M․ 2015-11-30 03:58:39 +06:00
parent d53a4af1a4
commit af284305d5

View File

@ -3,11 +3,14 @@
from .common import InfoExtractor from .common import InfoExtractor
from ..compat import compat_urllib_parse from ..compat import compat_urllib_parse
from ..utils import sanitized_Request from ..utils import (
ExtractorError,
sanitized_Request,
)
class VodlockerIE(InfoExtractor): class VodlockerIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?vodlocker\.com/(?P<id>[0-9a-zA-Z]+)(?:\..*?)?' _VALID_URL = r'https?://(?:www\.)?vodlocker\.com/(?:embed-)?(?P<id>[0-9a-zA-Z]+)(?:\..*?)?'
_TESTS = [{ _TESTS = [{
'url': 'http://vodlocker.com/e8wvyzz4sl42', 'url': 'http://vodlocker.com/e8wvyzz4sl42',
@ -24,6 +27,12 @@ def _real_extract(self, url):
video_id = self._match_id(url) video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id) webpage = self._download_webpage(url, video_id)
if any(p in webpage for p in (
'>THIS FILE WAS DELETED<',
'>File Not Found<',
'The file you were looking for could not be found, sorry for any inconvenience.<')):
raise ExtractorError('Video %s does not exist' % video_id, expected=True)
fields = self._hidden_inputs(webpage) fields = self._hidden_inputs(webpage)
if fields['op'] == 'download1': if fields['op'] == 'download1':