Fix rare edge case where comment author is None. (#676)
This happens mostly for older YT profiles that has not set-up a @-handle.
This commit is contained in:
parent
6dcef70b8e
commit
45f455070d
|
@ -115,6 +115,9 @@ class Comments:
|
||||||
|
|
||||||
time_text = time_text_datetime.strftime(format_string)
|
time_text = time_text_datetime.strftime(format_string)
|
||||||
|
|
||||||
|
if not comment.get("author"):
|
||||||
|
comment["author"] = comment.get("author_id", "Unknown")
|
||||||
|
|
||||||
cleaned_comment = {
|
cleaned_comment = {
|
||||||
"comment_id": comment["id"],
|
"comment_id": comment["id"],
|
||||||
"comment_text": comment["text"].replace("\xa0", ""),
|
"comment_text": comment["text"].replace("\xa0", ""),
|
||||||
|
|
Loading…
Reference in New Issue