15#include <giomm/memoryinputstream.h>
16#include <gdkmm/pixbuf.h>
17#include <curlpp/Easy.hpp>
18#include <curlpp/Options.hpp>
19#include <curlpp/Infos.hpp>
20#include <curlpp/cURLpp.hpp>
21#include <json/value.h>
22#include <json/reader.h>
23#include <json/writer.h>
24#include <openssl/bio.h>
25#include <openssl/evp.h>
26#include <openssl/buffer.h>
40 static constexpr const char*
BASE_URL =
"https://api.spotify.com/v1/";
55 std::vector<AlbumArt>
album_art(
const std::string& artist,
const std::string& title,
const int width,
const int height)
override;
75 static std::string
url(
const Method method,
const std::map<std::string, std::string>& params);
AlbumArtProvider()
AlbumArtProvider constructor.
static std::string base64_encode(const std::string &input)
Encodes a string into base64. Used to encode an HTTP authorization header.
static std::string url(const Method method, const std::map< std::string, std::string > ¶ms)
Calls url_with_params() with the Spotify API method URL.
void init() override
Retrieves the Spotify client ID and secret as environment variables.
Method
Spotify API methods.
std::vector< AlbumArt > album_art(const std::string &artist, const std::string &title, const int width, const int height) override
Retrieves all album art matching the artist and title.
static constexpr const char * BASE_URL
The Spotify API base URL.
static std::string method_name(const Method method)
Conversion method to convert a Spotify::Method to a string.
static std::string _accessToken
The Spotify API key retrieved.
Spotify()
Spotify constructor.