Add a verification that snippet/authorChannelId/value
isn't null when using commentThreads
for COMMUNITY
As it can happen cf https://www.youtube.com/channel/UCWeg2Pkate69NFdBeuRFTAw/community?lc=UgwGfjNxGuwqP8qYPPN4AaABAg&lb=UgkxYiEAo9-b1vWPasxFy13f959rrctQpZwW
This commit is contained in:
parent
d0dee043c6
commit
01aac3f66e
8
main.cpp
8
main.cpp
@ -357,9 +357,13 @@ void treatChannelOrVideo(unsigned short threadId, bool isChannel, string id, str
|
||||
items = data["items"];
|
||||
for(const auto& item : items)
|
||||
{
|
||||
json snippet = item["snippet"]["topLevelComment"]["snippet"];
|
||||
string channelId = snippet["authorChannelId"]["value"];
|
||||
json snippet = item["snippet"]["topLevelComment"]["snippet"],
|
||||
authorChannelId = snippet["authorChannelId"];
|
||||
if(!authorChannelId["value"].is_null())
|
||||
{
|
||||
string channelId = authorChannelId["value"];
|
||||
addChannelToTreat(threadId, channelId);
|
||||
}
|
||||
string pageToken = snippet["nextPageToken"];
|
||||
while(pageToken != "")
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user