From 7fcc8b09fab92794e4ee808f07c37571cf0c67f0 Mon Sep 17 00:00:00 2001 From: Benjamin Loison Date: Fri, 10 Feb 2023 12:02:39 +0100 Subject: [PATCH] Fix #36: Make the program stops by crashing on YouTube operational API instance being detected as sending unusual traffic --- main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.cpp b/main.cpp index 71207c8..d51318f 100644 --- a/main.cpp +++ b/main.cpp @@ -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")