1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-23 00:54:31 +01:00

[megavideoz] Check non-existing videos

This commit is contained in:
Sergey M․ 2015-04-19 04:09:01 +06:00
parent cc9b9df0b6
commit 6e218b3f9a

View File

@ -5,6 +5,7 @@ import re
from .common import InfoExtractor from .common import InfoExtractor
from ..utils import ( from ..utils import (
ExtractorError,
float_or_none, float_or_none,
xpath_text, xpath_text,
) )
@ -31,6 +32,9 @@ class MegaVideozIE(InfoExtractor):
webpage = self._download_webpage(url, display_id) webpage = self._download_webpage(url, display_id)
if '>Video Not Found<' in webpage:
raise ExtractorError('Video %s does not exist' % video_id, expected=True)
config = self._download_xml( config = self._download_xml(
self._search_regex( self._search_regex(
r"var\s+cnf\s*=\s*'([^']+)'", webpage, 'cnf url'), r"var\s+cnf\s*=\s*'([^']+)'", webpage, 'cnf url'),