From 938ae4b0fb5fef84d4fae9d55839a49c089fe893 Mon Sep 17 00:00:00 2001 From: Benjamin Loison Date: Mon, 2 Jan 2023 18:30:18 +0100 Subject: [PATCH] Fix #4: Provide a version relying on the no-key service of https://yt.lemnoslife.com --- main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 24692b9..5982e21 100644 --- a/main.cpp +++ b/main.cpp @@ -18,6 +18,7 @@ size_t writeCallback(void* contents, size_t size, size_t nmemb, void* userp); bool doesFileExist(string filePath), writeFile(string filePath, string option, string toWrite); +#define USE_YT_LEMNOSLIFE_COM_NO_KEY_SERVICE #define API_KEY "AIzaSy..." // Note that this printing approach is only safe in a mono-thread context. @@ -185,7 +186,11 @@ vector getFileContent(string filePath) json getJson(string url) { - url = "https://www.googleapis.com/youtube/v3/" + url + "&key=" + API_KEY; + #ifdef USE_YT_LEMNOSLIFE_COM_NO_KEY_SERVICE + url = "https://yt.lemnoslife.com/noKey/" + url; + #else + url = "https://www.googleapis.com/youtube/v3/" + url + "&key=" + API_KEY; + #endif string content = getHttps(url); json data = json::parse(content); return data;