From 45f455070d2187dcc5dc2d046da7fdd6d1947d15 Mon Sep 17 00:00:00 2001 From: dot-mike <586280+dot-mike@users.noreply.github.com> Date: Mon, 11 Mar 2024 17:56:18 +0100 Subject: [PATCH] Fix rare edge case where comment author is None. (#676) This happens mostly for older YT profiles that has not set-up a @-handle. --- tubearchivist/home/src/index/comments.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tubearchivist/home/src/index/comments.py b/tubearchivist/home/src/index/comments.py index 84e6cdd..91b18ff 100644 --- a/tubearchivist/home/src/index/comments.py +++ b/tubearchivist/home/src/index/comments.py @@ -115,6 +115,9 @@ class Comments: time_text = time_text_datetime.strftime(format_string) + if not comment.get("author"): + comment["author"] = comment.get("author_id", "Unknown") + cleaned_comment = { "comment_id": comment["id"], "comment_text": comment["text"].replace("\xa0", ""),