Treat the remaining forgotten top level comments having more than 5 answers
This commit is contained in:
parent
2888f5973d
commit
6dd2f42eb9
@ -31,6 +31,7 @@ while True:
|
|||||||
data = getContentFromURL(f'commentThreads?part=snippet,replies&videoId={VIDEO_ID}&maxResults=100&pageToken={nextPageToken}')
|
data = getContentFromURL(f'commentThreads?part=snippet,replies&videoId={VIDEO_ID}&maxResults=100&pageToken={nextPageToken}')
|
||||||
for item in data['items']:
|
for item in data['items']:
|
||||||
snippet = item['snippet']
|
snippet = item['snippet']
|
||||||
|
treatComment(snippet['topLevelComment'])
|
||||||
totalReplyCount = snippet['totalReplyCount']
|
totalReplyCount = snippet['totalReplyCount']
|
||||||
if totalReplyCount > 5:
|
if totalReplyCount > 5:
|
||||||
parentId = item['id']
|
parentId = item['id']
|
||||||
@ -43,7 +44,6 @@ while True:
|
|||||||
break
|
break
|
||||||
commentsNextPageToken = commentsData['nextPageToken']
|
commentsNextPageToken = commentsData['nextPageToken']
|
||||||
else:
|
else:
|
||||||
treatComment(snippet['topLevelComment'])
|
|
||||||
if totalReplyCount > 0:
|
if totalReplyCount > 0:
|
||||||
for comment in item['replies']['comments']:
|
for comment in item['replies']['comments']:
|
||||||
treatComment(comment)
|
treatComment(comment)
|
||||||
|
Reference in New Issue
Block a user