Use traverse_obj in another place as well

This commit is contained in:
Bart Broere 2024-09-21 20:08:53 +00:00
parent bf91db4846
commit 6de650f51f

View File

@ -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')),
}