Compare commits

...

2 Commits

Author SHA1 Message Date
Elan Ruusamäe
5c758e9580
Update yt_dlp/extractor/err.py - let Python throw error on unexpected input
I said it should be fatal. As in it should not be caught.
There is nothing logical we can do without the data, we don't need to prevent the error to then immediately throw a new error due no data.
We also don't expect the API to ever not return this data and if it does the extractor will most likely need to be updated.

Co-authored-by: sepro <4618135+seproDev@users.noreply.github.com>
2024-01-25 13:27:49 +02:00
Elan Ruusamäe
6d40d2137f
Update yt_dlp/extractor/err.py
Oh this should have just been

Co-authored-by: sepro <4618135+seproDev@users.noreply.github.com>
2024-01-25 12:59:16 +02:00

View File

@ -152,15 +152,13 @@ class ERRJupiterIE(InfoExtractor):
def _real_extract(self, url):
video_id = self._match_id(url)
data = try_call(lambda: self._download_json(
data = self._download_json(
'https://services.err.ee/api/v2/vodContent/getContentPageData', video_id,
query={'contentId': video_id})['data']['mainContent'])
if not data:
raise ExtractorError('Failed to get video data', expected=True)
query={'contentId': video_id})['data']['mainContent']
media_data = traverse_obj(data, ('medias', ..., {dict}), get_all=False)
if traverse_obj(media_data, ('restrictions', 'drm', {bool})):
self.raise_no_formats('This video is DRM protected', expected=True)
self.report_drm(video_id)
formats, subtitles = [], {}
for url in set(traverse_obj(media_data, ('src', ('hls', 'hls2', 'hlsNew'), {url_or_none}))):