123456789101112131415161718192021222324252627282930 |
- #pragma once
- #include <glibmm/ustring.h>
- #include <string>
- #include <curl/curl.h>
- #include <vector>
- #include <sstream>
- #include <nlohmann/json.hpp>
- #include <iostream>
- #include <Database/entities.hpp>
- #include <Database/database.hpp>
- namespace ytapi {
- // Функция записи данных в std::ostringstream
- size_t write_http_data(char *ptr, size_t size, size_t nmemb, void *userdata);
- // Кодирует URL-строку
- // https://stackoverflow.com/a/154627
- std::string urlencode(const std::string& decoded);
- // Раскодирует URL-строку
- std::string urldecode(const std::string& encoded);
- // Получает список видео по запросу
- std::vector<db::video> getVideosByQuery(std::string api_key, std::string query);
-
- // Возвращает список видео из JSON
- std::vector<db::video> getVideosFromJSON(std::string input);
- }
|