From 4c5b956fa52a4d62a62b5054e53f90099c1da662 Mon Sep 17 00:00:00 2001 From: leca Date: Tue, 3 Sep 2024 20:55:58 +0300 Subject: [PATCH] getting rid of CPR --- CMakeLists.txt | 10 +++++----- TODO | 3 ++- ofd/ofd.cpp | 16 ++++++++-------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b446c0..23b6bc8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,11 +80,11 @@ if(QT_VERSION_MAJOR EQUAL 6) qt_finalize_executable(checks-parser) endif() -include(FetchContent) -FetchContent_Declare(cpr GIT_REPOSITORY https://github.com/libcpr/cpr.git - GIT_TAG 3b15fa82ea74739b574d705fea44959b58142eb8) -FetchContent_MakeAvailable(cpr) -target_link_libraries(checks-parser PRIVATE cpr::cpr) +# include(FetchContent) +# FetchContent_Declare(cpr GIT_REPOSITORY https://github.com/libcpr/cpr.git +# GIT_TAG 3b15fa82ea74739b574d705fea44959b58142eb8) +# FetchContent_MakeAvailable(cpr) +# target_link_libraries(checks-parser PRIVATE cpr::cpr) find_package(PkgConfig REQUIRED) diff --git a/TODO b/TODO index d3082fc..4417d4d 100644 --- a/TODO +++ b/TODO @@ -7,4 +7,5 @@ Complete module "image-to-text": Add features: autodetect store type auto download of stores modules - +Refactor: + Get rid of CPR, use libcurl instead diff --git a/ofd/ofd.cpp b/ofd/ofd.cpp index fdd0fdf..82d92ff 100644 --- a/ofd/ofd.cpp +++ b/ofd/ofd.cpp @@ -1,7 +1,6 @@ #include "ofd.h" #include "../settings.h" #include "../utils/utils.h" -#include #include #include #include @@ -68,12 +67,13 @@ std::string OFD::get_check_data(std::string fn, std::string fd, -H 'sec-ch-ua-mobile: ?0' \ -H 'sec-ch-ua-platform: "Linux"' - // cpr::Response r = cpr::Get(cpr::Url{"https://httpbin.org/get"}); - std::cout << fn << " " << fd << " " << fp << std::endl; - cpr::Response r = - //to_utf8(module.get_url()) - cpr::Get(cpr::Url{"https://ofd.beeline.ru/api/ofdcheck/checkf"}, - cpr::Parameters{{"fn", fn}, {"fd", fd}, {"fp", fp}, {"format", "4"}}); + // // cpr::Response r = cpr::Get(cpr::Url{"https://httpbin.org/get"}); + // std::cout << fn << " " << fd << " " << fp << std::endl; + // cpr::Response r = + // //to_utf8(module.get_url()) + // cpr::Get(cpr::Url{"https://ofd.beeline.ru/api/ofdcheck/checkf"}, + // cpr::Parameters{{"fn", fn}, {"fd", fd}, {"fp", fp}, {"format", "4"}}); - return r.text; + // return r.text; + return ""; }