From 7f1c09bea173bd9bb6a81d793e85e49ddd0882c0 Mon Sep 17 00:00:00 2001 From: Bart Broere Date: Sun, 20 Oct 2024 12:11:30 +0200 Subject: [PATCH] Use _sort_formats util --- youtube_dl/extractor/npo.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/youtube_dl/extractor/npo.py b/youtube_dl/extractor/npo.py index 4bb70ad53..96e854ae6 100644 --- a/youtube_dl/extractor/npo.py +++ b/youtube_dl/extractor/npo.py @@ -198,7 +198,7 @@ class BNNVaraIE(NPOIE): headers={ 'Content-Type': 'application/json', }) - + product_id = traverse_obj(media, ('data', 'player', 'pomsProductId')) formats = self._download_by_product_id(product_id, video_id) if product_id else [] self._sort_formats(formats) @@ -231,9 +231,7 @@ class ONIE(NPOIE): for result in results: formats.extend(self._extract_formats_by_product_id(result, video_id)) - if not formats: - raise ExtractorError('Could not find a POMS product id in the provided URL, ' - 'perhaps because all stream URLs are DRM protected.') + self._sort_formats(formats) return { 'id': video_id,