Treat the remaining forgotten top level comments having more than 5 answers

This commit is contained in:
Benjamin Loison 2023-05-16 01:42:21 +02:00
parent 2888f5973d
commit 6dd2f42eb9
No known key found for this signature in database

View File

@ -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)