aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/streamango.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2018-02-25 18:34:52 +0700
committerSergey M․ <dstftw@gmail.com>2018-02-25 18:34:52 +0700
commitff274e3c16e751169e54e55955f3301ac6cb363a (patch)
tree4a278a76b333fca7a809e520b3ec212cbb267081 /youtube_dl/extractor/streamango.py
parentc106237d5652e659071114f9d16661df335ae93c (diff)
[streamango] Capture and output error messages
Diffstat (limited to 'youtube_dl/extractor/streamango.py')
-rw-r--r--youtube_dl/extractor/streamango.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/youtube_dl/extractor/streamango.py b/youtube_dl/extractor/streamango.py
index 08d84495a..238bba87f 100644
--- a/youtube_dl/extractor/streamango.py
+++ b/youtube_dl/extractor/streamango.py
@@ -7,6 +7,7 @@ from .common import InfoExtractor
from ..compat import compat_chr
from ..utils import (
determine_ext,
+ ExtractorError,
int_or_none,
js_to_json,
)
@@ -100,6 +101,16 @@ class StreamangoIE(InfoExtractor):
'height': int_or_none(video.get('height')),
'tbr': int_or_none(video.get('bitrate')),
})
+
+ if not formats:
+ error = self._search_regex(
+ r'<p[^>]+\bclass=["\']lead[^>]+>(.+?)</p>', webpage,
+ 'error', default=None)
+ if not error and '>Sorry' in webpage:
+ error = 'Video %s is not available' % video_id
+ if error:
+ raise ExtractorError(error, expected=True)
+
self._sort_formats(formats)
return {