mirror of
https://github.com/l1ving/youtube-dl
synced 2025-03-09 09:39:57 +08:00
[zdf] Validate existence of videos (closes #16798)
This commit is contained in:
parent
74bc299453
commit
c546414377
@ -17,6 +17,8 @@ from ..utils import (
|
|||||||
update_url_query,
|
update_url_query,
|
||||||
url_or_none,
|
url_or_none,
|
||||||
urljoin,
|
urljoin,
|
||||||
|
ExtractorError,
|
||||||
|
bool_or_none
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -194,6 +196,11 @@ class ZDFIE(ZDFBaseIE):
|
|||||||
|
|
||||||
formats = []
|
formats = []
|
||||||
format_urls = set()
|
format_urls = set()
|
||||||
|
|
||||||
|
hasVideo = bool_or_none(document.get('hasVideo'))
|
||||||
|
if not hasVideo:
|
||||||
|
raise ExtractorError('The video ID %s does not contain any videos.' % video_id, expected=True)
|
||||||
|
|
||||||
for f in document['formitaeten']:
|
for f in document['formitaeten']:
|
||||||
self._extract_format(video_id, formats, format_urls, f)
|
self._extract_format(video_id, formats, format_urls, f)
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user