From 718fca9ddd41caf329f73c16602fa629c26085b9 Mon Sep 17 00:00:00 2001 From: ELY M <> Date: Mon, 14 Oct 2024 17:34:35 -0500 Subject: [PATCH] trying to fix download --- source/download.c | 8 ++++---- weather.txt | 8 ++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 weather.txt diff --git a/source/download.c b/source/download.c index e7f27de..f3906cd 100644 --- a/source/download.c +++ b/source/download.c @@ -69,9 +69,9 @@ bool downloadFile(const char *url, const char *filename) - curl_slist_append(headers, "Accept: text/html"); - curl_slist_append(headers, "Content-Type: text/html"); - //curl_slist_append(headers, "charsets: utf-8"); + curl_slist_append(headers, "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8"); + curl_slist_append(headers, "Content-Type: application/json"); + curl_slist_append(headers, "charsets: utf-8"); curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); curl_easy_setopt(curl, CURLOPT_USERAGENT, "Weather Text for Nintendo Switch by ELY M. contact money@mboca.com"); @@ -148,7 +148,7 @@ int xferinfo(curl_off_t dltotal, curl_off_t dlnow) { } if (dlnow == dltotal && dltotal > 0 && once == false) { - printf("\n "); // lol, is required + printf("\n"); // lol, is required once = true; } diff --git a/weather.txt b/weather.txt new file mode 100644 index 0000000..53bf160 --- /dev/null +++ b/weather.txt @@ -0,0 +1,8 @@ + +
+Your browser sent a request that this server could not understand.
+