From 5e430a59c6783e859da59d10f5c1b5f679342971 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E8=AB=8F=E8=A8=AA=E5=AD=90?= Date: Thu, 2 May 2024 18:30:55 +0900 Subject: [PATCH] =?utf8?q?Clownflare=E3=81=AF=E9=9D=A2=E5=80=92=E3=81=8F?= =?utf8?q?=E3=81=95=E3=81=84=E3=82=8F=E3=81=AD=E3=83=BB=E3=83=BB=E3=83=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + main.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3022e80..302b9b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # 0.5.0 * .desktopファイルの追加 +* CDNを回避する様に # 0.4.0 * URLから画像ファイルを開ける様に diff --git a/main.c b/main.c index bee2ce5..6042fd4 100644 --- a/main.c +++ b/main.c @@ -31,6 +31,12 @@ bool dlfile(const char* url, const char* filename) { } curl_easy_setopt(curl, CURLOPT_URL, url); + // Clownflareは面倒くさいわね・・・ + curl_easy_setopt( + curl, + CURLOPT_USERAGENT, + "Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101 Firefox/102.0" + ); curl_easy_setopt(curl, CURLOPT_WRITEDATA, file); CURLcode res = curl_easy_perform(curl); fclose(file); -- 2.43.0