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
10
main.cpp
10
main.cpp
@ -357,9 +357,13 @@ void treatChannelOrVideo(unsigned short threadId, bool isChannel, string id, str
|
|||||||
items = data["items"];
|
items = data["items"];
|
||||||
for(const auto& item : items)
|
for(const auto& item : items)
|
||||||
{
|
{
|
||||||
json snippet = item["snippet"]["topLevelComment"]["snippet"];
|
json snippet = item["snippet"]["topLevelComment"]["snippet"],
|
||||||
string channelId = snippet["authorChannelId"]["value"];
|
authorChannelId = snippet["authorChannelId"];
|
||||||
addChannelToTreat(threadId, channelId);
|
if(!authorChannelId["value"].is_null())
|
||||||
|
{
|
||||||
|
string channelId = authorChannelId["value"];
|
||||||
|
addChannelToTreat(threadId, channelId);
|
||||||
|
}
|
||||||
string pageToken = snippet["nextPageToken"];
|
string pageToken = snippet["nextPageToken"];
|
||||||
while(pageToken != "")
|
while(pageToken != "")
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user