| 24 | #define USERAGENT "Mozilla/5.0 (rv:109.0) Gecko/20100101 Firefox/112.0" |
| 25 | |
| 26 | CURLWrapper::CURLWrapper(const std::string &proxy) |
| 27 | { |
| 28 | mCurl = curl_easy_init(); |
| 29 | if (mCurl) { |
| 30 | curl_easy_setopt(mCurl, CURLOPT_NOPROGRESS, 0); |
| 31 | // curl_easy_setopt(mCurl, CURLOPT_PROGRESSFUNCTION, progressCallback); |
| 32 | // curl_easy_setopt(mCurl, CURLOPT_PROGRESSDATA, feedReader); |
| 33 | curl_easy_setopt(mCurl, CURLOPT_FOLLOWLOCATION, 1); |
| 34 | curl_easy_setopt(mCurl, CURLOPT_CONNECTTIMEOUT, 60); |
| 35 | curl_easy_setopt(mCurl, CURLOPT_TIMEOUT, 120); |
| 36 | |
| 37 | if (!proxy.empty()) { |
| 38 | curl_easy_setopt(mCurl, CURLOPT_PROXY, proxy.c_str()); |
| 39 | } |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | CURLWrapper::~CURLWrapper() |
| 44 | { |