diff --git a/app/templates/_video_comment.html b/app/templates/_video_comment.html index ee10a7a..6cc1478 100644 --- a/app/templates/_video_comment.html +++ b/app/templates/_video_comment.html @@ -3,23 +3,28 @@
{% if comment.authorIsChannelOwner %} - {{comment.author}} + {{comment.author}} {% else %} {{comment.author}} {% endif %} -
-
{{comment.date}}
-
- - {{comment.likes}} + -
- - {{comment.replies}} +
+ {{comment.text}} +
+ -
-
- {{comment.text}} -
\ No newline at end of file diff --git a/youtube_data/comments.py b/youtube_data/comments.py index 15f1499..2f47535 100644 --- a/youtube_data/comments.py +++ b/youtube_data/comments.py @@ -82,6 +82,7 @@ def concat_texts(strings): def parse_comment(raw_comment): cmnt = {} + print(raw_comment) raw_comment = raw_comment['commentThreadRenderer']['comment']['commentRenderer'] imgHostName = urllib.parse.urlparse(raw_comment['authorThumbnail']['thumbnails'][0]['url']).netloc cmnt['author'] = raw_comment['authorText']['runs'][0]['text'] @@ -89,6 +90,11 @@ def parse_comment(raw_comment): cmnt['channel'] = raw_comment['authorEndpoint']['commandMetadata']['webCommandMetadata']['url'] cmnt['text'] = Markup(bleach.linkify(concat_texts(raw_comment['contentText']['runs']).replace("\n", "
"))) cmnt['date'] = raw_comment['publishedTimeText']['runs'][0]['text'] + + try: + cmnt['creatorHeart'] = raw_comment['creatorHeart']['creatorHeartRenderer']['creatorThumbnail']['thumbnails'][0]['url'] + except: + cmnt['creatorHeart'] = False try: cmnt['likes'] = raw_comment['likeCount']