aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-03-29 16:58:17 +0200
committerdec05eba <dec05eba@protonmail.com>2022-03-29 16:58:17 +0200
commitd9f0fe6d83fbcd9b047e0e1284c6f7d4046c2758 (patch)
tree621fe6a647498f1f9a523c55f013be2e6bdca09b
parentb906a7cf106d2df7d52278c111fc71404143960f (diff)
Reduce youtube response size by disabling pretty json
-rw-r--r--src/plugins/Youtube.cpp8
1 files 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<CommandArg> 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<CommandArg> 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<CommandArg> 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;