aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2017-10-15 22:12:34 +0700
committerSergey M․ <dstftw@gmail.com>2017-10-15 22:12:34 +0700
commit8cc1840ccb2f17837fc7f12ceea91826eb925ecc (patch)
tree35e1111c022247aaa28fbdb2783ef48f9995139a /youtube_dl
parenta9ee4f6e49a5910b432d0ba4d8dc60231aa7deba (diff)
[arte] Capture and output error message
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/arte.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/youtube_dl/extractor/arte.py b/youtube_dl/extractor/arte.py
index 5cde90c5b..ffc321821 100644
--- a/youtube_dl/extractor/arte.py
+++ b/youtube_dl/extractor/arte.py
@@ -6,6 +6,7 @@ import re
from .common import InfoExtractor
from ..compat import (
compat_parse_qs,
+ compat_str,
compat_urllib_parse_urlparse,
)
from ..utils import (
@@ -15,6 +16,7 @@ from ..utils import (
int_or_none,
NO_DEFAULT,
qualities,
+ try_get,
unified_strdate,
)
@@ -80,12 +82,15 @@ class ArteTVBaseIE(InfoExtractor):
info = self._download_json(json_url, video_id)
player_info = info['videoJsonPlayer']
- vsr = player_info['VSR']
-
+ vsr = try_get(player_info, lambda x: x['VSR'], dict)
if not vsr:
- raise ExtractorError(
- 'Video %s is not available' % player_info.get('VID') or video_id,
- expected=True)
+ error = None
+ if try_get(player_info, lambda x: x['custom_msg']['type']) == 'error':
+ error = try_get(
+ player_info, lambda x: x['custom_msg']['msg'], compat_str)
+ if not error:
+ error = 'Video %s is not available' % player_info.get('VID') or video_id
+ raise ExtractorError(error, expected=True)
upload_date_str = player_info.get('shootingDate')
if not upload_date_str: