Fix #9: Make sure that in case of error returned by the YouTube Data API v3 the algorithm treats it correctly
Note that in case of error the algorithm used to skip the received content, as if just no `items` were in it.
This commit is contained in:
parent
34bbc216f6
commit
71e4bd95a9
6
main.cpp
6
main.cpp
@ -342,6 +342,12 @@ json getJson(unsigned short threadId, string url, string directoryPath)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(data.contains("error"))
|
||||||
|
{
|
||||||
|
PRINT(threadId, "Found error in JSON at URL: " << finalUrl << " for content: " << content << " !")
|
||||||
|
return getJson(threadId, url, directoryPath);
|
||||||
|
}
|
||||||
|
|
||||||
ostringstream toString;
|
ostringstream toString;
|
||||||
toString << CHANNELS_DIRECTORY << directoryPath << "/" << requestsPerChannel << ".json";
|
toString << CHANNELS_DIRECTORY << directoryPath << "/" << requestsPerChannel << ".json";
|
||||||
requestsPerChannel++;
|
requestsPerChannel++;
|
||||||
|
Loading…
Reference in New Issue
Block a user