From d9f0fe6d83fbcd9b047e0e1284c6f7d4046c2758 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 29 Mar 2022 16:58:17 +0200 Subject: Reduce youtube response size by disabling pretty json --- src/plugins/Youtube.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/Youtube.cpp b/src/plugins/Youtube.cpp index e7ff38f..1cbf477 100644 --- a/src/plugins/Youtube.cpp +++ b/src/plugins/Youtube.cpp @@ -1285,7 +1285,7 @@ namespace QuickMedia { return PluginResult::OK; std::vector cookies = get_cookies(); - std::string next_url = "https://www.youtube.com/youtubei/v1/next?key=" + url_param_encode(api_key) + "&gl=US&hl=en"; + std::string next_url = "https://www.youtube.com/youtubei/v1/next?key=" + url_param_encode(api_key) + "&gl=US&hl=en&prettyPrint=false"; Json::Value request_json(Json::objectValue); Json::Value context_json(Json::objectValue); @@ -1373,7 +1373,7 @@ namespace QuickMedia { return plugin_result_to_search_result(lazy_fetch(result_items)); std::vector cookies = get_cookies(); - std::string next_url = "https://www.youtube.com/youtubei/v1/browse?key=" + url_param_encode(api_key) + "&gl=US&hl=en"; + std::string next_url = "https://www.youtube.com/youtubei/v1/browse?key=" + url_param_encode(api_key) + "&gl=US&hl=en&prettyPrint=false"; Json::Value request_json(Json::objectValue); Json::Value context_json(Json::objectValue); @@ -1462,7 +1462,7 @@ namespace QuickMedia { return PluginResult::OK; std::vector cookies = get_cookies(); - std::string next_url = "https://www.youtube.com/youtubei/v1/browse?key=" + url_param_encode(api_key) + "&gl=US&hl=en"; + std::string next_url = "https://www.youtube.com/youtubei/v1/browse?key=" + url_param_encode(api_key) + "&gl=US&hl=en&prettyPrint=false"; Json::Value request_json(Json::objectValue); Json::Value context_json(Json::objectValue); @@ -2474,7 +2474,7 @@ R"END( additional_args.insert(additional_args.end(), cookies.begin(), cookies.end()); Json::Value json_root; - DownloadResult download_result = download_json(json_root, "https://www.youtube.com/youtubei/v1/player?key=" + api_key + "&gl=US&hl=en", additional_args, true); + DownloadResult download_result = download_json(json_root, "https://www.youtube.com/youtubei/v1/player?key=" + api_key + "&gl=US&hl=en&prettyPrint=false", additional_args, true); if(download_result != DownloadResult::OK) continue; -- cgit v1.2.3