2020-09-20 02:21:28 +02:00
|
|
|
#pragma once
|
|
|
|
|
2021-09-11 15:48:13 +02:00
|
|
|
constexpr int ON = 1;
|
|
|
|
constexpr int OFF = 0;
|
2020-09-20 02:21:28 +02:00
|
|
|
|
2021-03-16 03:43:48 +01:00
|
|
|
#include <json.hpp>
|
2020-09-20 02:21:28 +02:00
|
|
|
|
2021-03-16 03:04:21 +01:00
|
|
|
namespace download {
|
2021-09-11 15:48:13 +02:00
|
|
|
|
2021-09-27 21:56:41 +02:00
|
|
|
long downloadFile(const std::string& url, std::vector<std::uint8_t>& res, const std::string& output = "", int api = OFF);
|
|
|
|
long downloadFile(const std::string& url, const std::string& output = "", int api = OFF);
|
2021-05-22 18:10:34 +02:00
|
|
|
std::vector<std::pair<std::string, std::string>> getLinks(const std::string& url);
|
2021-06-28 00:46:00 +02:00
|
|
|
std::vector<std::pair<std::string, std::string>> getLinksFromJson(const nlohmann::ordered_json& json_object);
|
2021-05-22 18:10:34 +02:00
|
|
|
std::string fetchTitle(const std::string& url);
|
2021-06-28 00:46:00 +02:00
|
|
|
long downloadPage(const std::string& url, std::string& res, const std::vector<std::string>& headers = {}, const std::string& body = "");
|
|
|
|
long getRequest(const std::string& url, nlohmann::ordered_json& res, const std::vector<std::string>& headers = {}, const std::string& body = "");
|
2021-03-16 03:04:21 +01:00
|
|
|
|
2021-09-11 15:48:13 +02:00
|
|
|
} // namespace download
|