mirror of
https://github.com/ytdl-org/youtube-dl
synced 2024-08-27 18:15:14 +02:00
[zdf] fix rtmpt format downloading handle errors
This commit is contained in:
parent
141a273a8b
commit
6b46102661
@ -13,6 +13,7 @@ from ..utils import (
|
|||||||
determine_ext,
|
determine_ext,
|
||||||
qualities,
|
qualities,
|
||||||
float_or_none,
|
float_or_none,
|
||||||
|
ExtractorError,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -59,7 +60,6 @@ class ZDFIE(InfoExtractor):
|
|||||||
'ext': 'flv',
|
'ext': 'flv',
|
||||||
'format_id': '%s-%d' % (proto, bitrate),
|
'format_id': '%s-%d' % (proto, bitrate),
|
||||||
'tbr': bitrate,
|
'tbr': bitrate,
|
||||||
'protocol': proto,
|
|
||||||
})
|
})
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
return formats
|
return formats
|
||||||
@ -70,6 +70,15 @@ class ZDFIE(InfoExtractor):
|
|||||||
note='Downloading video info',
|
note='Downloading video info',
|
||||||
errnote='Failed to download video info')
|
errnote='Failed to download video info')
|
||||||
|
|
||||||
|
status_code = doc.find('./status/statuscode')
|
||||||
|
if status_code is not None and status_code.text != 'ok':
|
||||||
|
code = status_code.text
|
||||||
|
if code == 'notVisibleAnymore':
|
||||||
|
message = 'Video %s is not available' % video_id
|
||||||
|
else:
|
||||||
|
message = '%s returned error: %s' % (self.IE_NAME, code)
|
||||||
|
raise ExtractorError(message, expected=True)
|
||||||
|
|
||||||
title = doc.find('.//information/title').text
|
title = doc.find('.//information/title').text
|
||||||
description = xpath_text(doc, './/information/detail', 'description')
|
description = xpath_text(doc, './/information/detail', 'description')
|
||||||
duration = int_or_none(xpath_text(doc, './/details/lengthSec', 'duration'))
|
duration = int_or_none(xpath_text(doc, './/details/lengthSec', 'duration'))
|
||||||
@ -129,10 +138,10 @@ class ZDFIE(InfoExtractor):
|
|||||||
video_url, video_id, fatal=False))
|
video_url, video_id, fatal=False))
|
||||||
elif ext == 'm3u8':
|
elif ext == 'm3u8':
|
||||||
formats.extend(self._extract_m3u8_formats(
|
formats.extend(self._extract_m3u8_formats(
|
||||||
video_url, video_id, 'mp4', m3u8_id='hls', fatal=False))
|
video_url, video_id, 'mp4', m3u8_id=format_id, fatal=False))
|
||||||
elif ext == 'f4m':
|
elif ext == 'f4m':
|
||||||
formats.extend(self._extract_f4m_formats(
|
formats.extend(self._extract_f4m_formats(
|
||||||
video_url, video_id, f4m_id='hds', fatal=False))
|
video_url, video_id, f4m_id=format_id, fatal=False))
|
||||||
else:
|
else:
|
||||||
proto = format_m.group('proto').lower()
|
proto = format_m.group('proto').lower()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user