mirror of
https://github.com/blackjack4494/yt-dlc.git
synced 2024-12-24 00:38:05 +00:00
[wat] Capture and output error message
This commit is contained in:
parent
f7d159cf95
commit
86916dae4b
1 changed files with 9 additions and 1 deletions
|
@ -5,7 +5,10 @@ import re
|
||||||
import hashlib
|
import hashlib
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..utils import unified_strdate
|
from ..utils import (
|
||||||
|
ExtractorError,
|
||||||
|
unified_strdate,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class WatIE(InfoExtractor):
|
class WatIE(InfoExtractor):
|
||||||
|
@ -57,6 +60,11 @@ class WatIE(InfoExtractor):
|
||||||
|
|
||||||
video_info = self.download_video_info(real_id)
|
video_info = self.download_video_info(real_id)
|
||||||
|
|
||||||
|
error_desc = video_info.get('error_desc')
|
||||||
|
if error_desc:
|
||||||
|
raise ExtractorError(
|
||||||
|
'%s returned error: %s' % (self.IE_NAME, error_desc), expected=True)
|
||||||
|
|
||||||
geo_list = video_info.get('geoList')
|
geo_list = video_info.get('geoList')
|
||||||
country = geo_list[0] if geo_list else ''
|
country = geo_list[0] if geo_list else ''
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue