From fa43753614912c73d6dbcb8d234e7e0d8c320732 Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 5 Aug 2023 09:53:21 +0700 Subject: [PATCH] better error handling in comment extraction --- tubearchivist/home/src/index/comments.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tubearchivist/home/src/index/comments.py b/tubearchivist/home/src/index/comments.py index b67735d..5f25602 100644 --- a/tubearchivist/home/src/index/comments.py +++ b/tubearchivist/home/src/index/comments.py @@ -63,6 +63,7 @@ class Comments: "check_formats": None, "skip_download": True, "getcomments": True, + "ignoreerrors": True, "extractor_args": { "youtube": { "max_comments": max_comments_list, @@ -119,14 +120,14 @@ class Comments: "comment_text": comment["text"].replace("\xa0", ""), "comment_timestamp": comment["timestamp"], "comment_time_text": time_text, - "comment_likecount": comment["like_count"], - "comment_is_favorited": comment.get( - "is_favorited" - ), # temporary fix for yt-dlp upstream issue 7389 + "comment_likecount": comment.get("like_count", None), + "comment_is_favorited": comment.get("is_favorited", False), "comment_author": comment["author"], "comment_author_id": comment["author_id"], "comment_author_thumbnail": comment["author_thumbnail"], - "comment_author_is_uploader": comment["author_is_uploader"], + "comment_author_is_uploader": comment.get( + "comment_author_is_uploader", False + ), "comment_parent": comment["parent"], }