From 7d1d40c84eb3055aac7c6f92d0709bdc1032ddbc 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:46:09 +0900 Subject: [PATCH] =?utf8?q?CDN=E3=81=AE=E5=9B=9E=E9=81=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 +++ main.c | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1290c22..b55b2ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 0.3.0 +* CDNの回避 + # 0.2.0 * ファイル名はパラメートルを付いたら、ファイル名は拡張子に * 名前として保存オプション diff --git a/main.c b/main.c index a3e1800..8fde87c 100644 --- a/main.c +++ b/main.c @@ -7,7 +7,7 @@ #include const char* sofname = "odl"; -const char* version = "0.2.0"; +const char* version = "0.3.0"; const char* avalopt = "opv"; char* filename; @@ -129,6 +129,12 @@ int downloader(CURL* curl, char* filename, const char* url) { } 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