From c3026dd70c4a0d74dc6079331cd037ed6fa7a479 Mon Sep 17 00:00:00 2001 From: Bart Broere Date: Sun, 20 Oct 2024 12:08:50 +0200 Subject: [PATCH] Apply suggestion from PR --- youtube_dl/extractor/npo.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/youtube_dl/extractor/npo.py b/youtube_dl/extractor/npo.py index a53a3c3d9..4bb70ad53 100644 --- a/youtube_dl/extractor/npo.py +++ b/youtube_dl/extractor/npo.py @@ -198,9 +198,10 @@ class BNNVaraIE(NPOIE): headers={ 'Content-Type': 'application/json', }) - product_id = media.get('data', {}).get('player', {}).get('pomsProductId') - - formats = self._extract_formats_by_product_id(product_id, video_id) + + 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) return { 'id': product_id,