mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-15 07:42:42 +00:00
[streamango] Capture and output error messages
This commit is contained in:
parent
c106237d56
commit
ff274e3c16
1 changed files with 11 additions and 0 deletions
|
@ -7,6 +7,7 @@ from .common import InfoExtractor
|
||||||
from ..compat import compat_chr
|
from ..compat import compat_chr
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
determine_ext,
|
determine_ext,
|
||||||
|
ExtractorError,
|
||||||
int_or_none,
|
int_or_none,
|
||||||
js_to_json,
|
js_to_json,
|
||||||
)
|
)
|
||||||
|
@ -100,6 +101,16 @@ class StreamangoIE(InfoExtractor):
|
||||||
'height': int_or_none(video.get('height')),
|
'height': int_or_none(video.get('height')),
|
||||||
'tbr': int_or_none(video.get('bitrate')),
|
'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)
|
self._sort_formats(formats)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in a new issue