Fix #4: Provide a version relying on the no-key service of https://yt.lemnoslife.com
This commit is contained in:
parent
68800a25a0
commit
dfd9ee9c41
5
main.cpp
5
main.cpp
@ -18,6 +18,7 @@ size_t writeCallback(void* contents, size_t size, size_t nmemb, void* userp);
|
|||||||
bool doesFileExist(string filePath),
|
bool doesFileExist(string filePath),
|
||||||
writeFile(string filePath, string option, string toWrite);
|
writeFile(string filePath, string option, string toWrite);
|
||||||
|
|
||||||
|
#define USE_YT_LEMNOSLIFE_COM_NO_KEY_SERVICE
|
||||||
#define API_KEY "AIzaSy..."
|
#define API_KEY "AIzaSy..."
|
||||||
|
|
||||||
// Note that this printing approach is only safe in a mono-thread context.
|
// Note that this printing approach is only safe in a mono-thread context.
|
||||||
@ -185,7 +186,11 @@ vector<string> getFileContent(string filePath)
|
|||||||
|
|
||||||
json getJson(string url)
|
json getJson(string url)
|
||||||
{
|
{
|
||||||
|
#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;
|
url = "https://www.googleapis.com/youtube/v3/" + url + "&key=" + API_KEY;
|
||||||
|
#endif
|
||||||
string content = getHttps(url);
|
string content = getHttps(url);
|
||||||
json data = json::parse(content);
|
json data = json::parse(content);
|
||||||
return data;
|
return data;
|
||||||
|
Loading…
Reference in New Issue
Block a user