diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-06-27 20:58:23 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-06-27 20:58:23 +0200 |
commit | 9e014aead36adf6ca936dd7f355c1ce5dc18139b (patch) | |
tree | 8b3d3c5728aa6e8f92e0559fea4c89a6ca745609 /src/DownloadUtils.cpp | |
parent | 99915ba9ec15a5018be4e7793c1482a032c3ca14 (diff) |
Use mpv default ui instead of overlay
Diffstat (limited to 'src/DownloadUtils.cpp')
-rw-r--r-- | src/DownloadUtils.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
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 <SFML/System/Clock.hpp> #include <cppcodec/base64_rfc4648.hpp> +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); |