From 6dd2f42eb9b19e17cf14638e45560c4b55d96337 Mon Sep 17 00:00:00 2001 From: Benjamin Loison Date: Tue, 16 May 2023 01:42:21 +0200 Subject: [PATCH] Treat the remaining forgotten top level comments having more than 5 answers --- search_in_youtube_video_comments.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/search_in_youtube_video_comments.py b/search_in_youtube_video_comments.py index 1d8a8ca..b4c3c29 100755 --- a/search_in_youtube_video_comments.py +++ b/search_in_youtube_video_comments.py @@ -31,6 +31,7 @@ while True: data = getContentFromURL(f'commentThreads?part=snippet,replies&videoId={VIDEO_ID}&maxResults=100&pageToken={nextPageToken}') for item in data['items']: snippet = item['snippet'] + treatComment(snippet['topLevelComment']) totalReplyCount = snippet['totalReplyCount'] if totalReplyCount > 5: parentId = item['id'] @@ -43,7 +44,6 @@ while True: break commentsNextPageToken = commentsData['nextPageToken'] else: - treatComment(snippet['topLevelComment']) if totalReplyCount > 0: for comment in item['replies']['comments']: treatComment(comment)