From 9e014aead36adf6ca936dd7f355c1ce5dc18139b Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 27 Jun 2020 20:58:23 +0200 Subject: Use mpv default ui instead of overlay --- src/DownloadUtils.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/DownloadUtils.cpp') diff --git a/src/DownloadUtils.cpp b/src/DownloadUtils.cpp index 129234f..8193c90 100644 --- a/src/DownloadUtils.cpp +++ b/src/DownloadUtils.cpp @@ -4,6 +4,8 @@ #include #include +static const bool debug_download = false; + static int accumulate_string(char *data, int size, void *userdata) { std::string *str = (std::string*)userdata; str->append(data, size); @@ -31,6 +33,13 @@ namespace QuickMedia { args.push_back("--"); args.push_back(url.c_str()); args.push_back(nullptr); + if(debug_download) { + for(const char *arg : args) { + if(arg) + fprintf(stderr, "%s ", arg); + } + fprintf(stderr, "\n"); + } if(exec_program(args.data(), accumulate_string, &result) != 0) return DownloadResult::NET_ERR; fprintf(stderr, "Download duration for %s: %d ms\n", url.c_str(), timer.getElapsedTime().asMilliseconds()); @@ -49,7 +58,7 @@ namespace QuickMedia { return DownloadResult::ERR; } } else { - DownloadResult download_result = download_to_string(url, result, additional_args, use_tor); + DownloadResult download_result = download_to_string(url, result, additional_args, use_tor, use_browser_useragent); if(download_result == DownloadResult::OK) { if(create_directory_recursive(media_dir) == 0 && file_overwrite(media_file_path, result) == 0) { create_lock_file(media_finished_path); -- cgit v1.2.3