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 87d67e4e85
commit 7fcc8b09fa

View File

@ -705,6 +705,10 @@ json getJson(unsigned short threadId, string url, bool usingYoutubeDataApiv3, st
if(data.contains("error")) 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"]; 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. // 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") if(reason == "quotaExceeded")