Fix #36: Make the program stops by crashing on YouTube operational API instance being detected as sending unusual traffic

This commit is contained in:
Benjamin Loison 2023-02-10 12:02:39 +01:00
parent 4508b12b6c
commit 9b792015fa
Signed by: Benjamin_Loison
SSH Key Fingerprint: SHA256:BtnEgYTlHdOg1u+RmYcDE0mnfz1rhv5dSbQ2gyxW8B8

View File

@ -705,6 +705,10 @@ json getJson(unsigned short threadId, string url, bool usingYoutubeDataApiv3, st
if(data.contains("error"))
{
if(!usingYoutubeDataApiv3)
{
EXIT_WITH_ERROR("Found error in JSON retrieve from YouTube operational API at URL: " << finalUrl << " for content: " << content << " !")
}
string reason = data["error"]["errors"][0]["reason"];
// Contrarily to YouTube operational API no-key service we don't rotate keys in `KEYS_FILE_PATH`, as we keep them in memory here.
if(reason == "quotaExceeded")