From 6de650f51fc9da6ae8a261b3f57e26f4ec78a2d1 Mon Sep 17 00:00:00 2001 From: Bart Broere Date: Sat, 21 Sep 2024 20:08:53 +0000 Subject: [PATCH] Use traverse_obj in another place as well --- youtube_dl/extractor/npo.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/youtube_dl/extractor/npo.py b/youtube_dl/extractor/npo.py index 70e297e19..e130f2dbd 100644 --- a/youtube_dl/extractor/npo.py +++ b/youtube_dl/extractor/npo.py @@ -5,7 +5,7 @@ import json import re from .common import InfoExtractor -from ..utils import ExtractorError, join_nonempty +from ..utils import ExtractorError, join_nonempty, traverse_obj class NPOIE(InfoExtractor): @@ -140,9 +140,9 @@ class BNNVaraIE(NPOIE): return { 'id': product_id, - 'title': media.get('data', {}).get('player', {}).get('title'), + 'title': traverse_obj(media, ('data', 'player', 'title')), 'formats': formats, - 'thumbnail': media.get('data', {}).get('player', {}).get('image').get('url'), + 'thumbnail': traverse_obj(media, ('data', 'player', 'image', 'url')), }