From dde1e0b672dc9829de4120f87464d00a79535e15 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Sat, 24 Aug 2024 11:42:13 +0200 Subject: fix(update_raw.py): Only return the needed fields to rust This avoids a spurious failure, when the processed dict contains values, that can't be serialized as JSON (e.g. a LazyList). --- python_update/raw_update.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'python_update/raw_update.py') diff --git a/python_update/raw_update.py b/python_update/raw_update.py index c443960..21569d2 100755 --- a/python_update/raw_update.py +++ b/python_update/raw_update.py @@ -118,10 +118,16 @@ class Fetcher: with yt_dlp.YoutubeDL(self.ydl_opts) as ydl: processed = ydl.process_ie_result(entry, False) - # walk through the ie_result dictionary to force evaluation of lazily loaded resources - repr(processed) - - return processed + return { + "description": processed.get("description"), + "duration": processed.get("duration"), + "upload_date": processed.get("upload_date"), + "thumbnails": processed.get("thumbnails"), + "thumbnail": processed.get("thumbnail"), + "title": processed.get("title"), + "webpage_url": processed.get("webpage_url"), + "id": processed.get("id") + } async def process_entry(self, url: str, entry: Any) -> Optional[Any]: try: -- cgit 1.4.1