From 6c7adadf6d5c85d5e280e965d4dee1563bf46821 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 1 Dec 2019 18:05:16 +0100 Subject: Add 4chan posting --- include/DownloadUtils.hpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 include/DownloadUtils.hpp (limited to 'include/DownloadUtils.hpp') diff --git a/include/DownloadUtils.hpp b/include/DownloadUtils.hpp new file mode 100644 index 0000000..78fc859 --- /dev/null +++ b/include/DownloadUtils.hpp @@ -0,0 +1,25 @@ +#pragma once + +#include +#include + +namespace QuickMedia { + enum class DownloadResult { + OK, + ERR, + NET_ERR + }; + + struct CommandArg { + std::string option; + std::string value; + }; + + struct FormData { + std::string key; + std::string value; + }; + + DownloadResult download_to_string(const std::string &url, std::string &result, const std::vector &additional_args = {}, bool use_tor = false); + std::vector create_command_args_from_form_data(const std::vector &form_data); +} \ No newline at end of file -- cgit v1.2.3