mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-16 17:55:26 -04:00
fix: youtube (services) comment formatter crashes on a non-dict comment (#1746)
This commit is contained in:
@@ -256,6 +256,8 @@ def format_comments_for_context(comments_data: Dict[str, Any], url: str) -> str:
|
||||
ctx += f"URL: {url}\n\n"
|
||||
|
||||
for i, c in enumerate(comments, 1):
|
||||
if not isinstance(c, dict):
|
||||
continue
|
||||
likes = c.get("likes", 0)
|
||||
likes_str = f" [{likes} likes]" if likes else ""
|
||||
ctx += f"{i}. @{c['author']}{likes_str}: {c['text']}\n\n"
|
||||
|
||||
Reference in New Issue
Block a user