aboutsummaryrefslogtreecommitdiff
path: root/src/DownloadUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/DownloadUtils.cpp')
-rw-r--r--src/DownloadUtils.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/DownloadUtils.cpp b/src/DownloadUtils.cpp
index e546bd1..afef072 100644
--- a/src/DownloadUtils.cpp
+++ b/src/DownloadUtils.cpp
@@ -65,10 +65,6 @@ namespace QuickMedia {
if(end_of_header_found) {
download_userdata->body->append(download_userdata->header->begin() + end_of_headers_index, download_userdata->header->end());
- if(download_userdata->body->find("Content-Type") != std::string::npos) {
- fprintf(stderr, "Found header in body!!!!, header: |%s|, body: |%s|\n", download_userdata->header->c_str(), download_userdata->body->c_str());
- abort();
- }
download_userdata->header->erase(download_userdata->header->begin() + end_of_headers_index, download_userdata->header->end());
download_userdata->header_finished = true;
}
@@ -266,7 +262,7 @@ namespace QuickMedia {
}
}
- DownloadResult download_to_file(const std::string &url, const std::string &destination_filepath, const std::vector<CommandArg> &additional_args, bool use_browser_useragent) {
+ DownloadResult download_to_file(const std::string &url, const std::string &destination_filepath, const std::vector<CommandArg> &additional_args, bool use_browser_useragent, bool cloudflare_bypass) {
Path tmp_filepath = destination_filepath;
tmp_filepath.append(".tmp");
@@ -279,7 +275,7 @@ namespace QuickMedia {
args.push_back({ "-o", tmp_filepath.data.c_str() });
std::string dummy;
- DownloadResult res = download_to_string(url, dummy, std::move(args), use_browser_useragent);
+ DownloadResult res = download_to_string(url, dummy, std::move(args), use_browser_useragent, true, cloudflare_bypass);
if(res != DownloadResult::OK) return res;
if(rename_atomic(tmp_filepath.data.c_str(), destination_filepath.c_str()) != 0) {
@@ -353,4 +349,4 @@ namespace QuickMedia {
fprintf(stderr, "Download duration for %s: %d ms\n", url.c_str(), timer.getElapsedTime().asMilliseconds());
return parse_result.IsError() ? DownloadResult::ERR : DownloadResult::OK;
}
-} \ No newline at end of file
+}