Initial Commit
This commit is contained in:
18
include/download.hpp
Normal file
18
include/download.hpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
constexpr int ON = 1;
|
||||
constexpr int OFF = 0;
|
||||
|
||||
#include <json.hpp>
|
||||
|
||||
namespace download {
|
||||
|
||||
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);
|
||||
std::vector<std::pair<std::string, std::string>> getLinks(const std::string& url);
|
||||
std::vector<std::pair<std::string, std::string>> getLinksFromJson(const nlohmann::ordered_json& json_object);
|
||||
std::string fetchTitle(const std::string& url);
|
||||
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 = "");
|
||||
|
||||
} // namespace download
|
||||
Reference in New Issue
Block a user