From 2472bc97cd34f4efe83310a480517a73c35938ca Mon Sep 17 00:00:00 2001 From: Nodude <75137537+NodudeWasTaken@users.noreply.github.com> Date: Mon, 1 Jul 2024 13:41:35 +0200 Subject: [PATCH] [PMVHaven] Follow guidelines with traverse_obj --- yt_dlp/extractor/pmvhaven.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/yt_dlp/extractor/pmvhaven.py b/yt_dlp/extractor/pmvhaven.py index ab02a0cfe..f1e3eb70c 100644 --- a/yt_dlp/extractor/pmvhaven.py +++ b/yt_dlp/extractor/pmvhaven.py @@ -1,6 +1,7 @@ import json from .common import InfoExtractor +from ..utils import traverse_obj class PMVHavenIE(InfoExtractor): @@ -90,10 +91,10 @@ class PMVHavenProfileIE(InfoExtractor): def transform(data): return { - 'id': data['_id'], - 'title': data['title'], - 'uploader': data['uploader'], - 'url': data['url'], + 'id': traverse_obj(data, ('_id')), + 'title': traverse_obj(data, ('title')), + 'uploader': traverse_obj(data, ('uploader')), + 'url': traverse_obj(data, ('url')), 'thumbnails': [{'url': i} for i in data['thumbnails'] if i != 'placeholder'], } entries = map(transform, entries)