videodownloader/network/spotifydownload.h

41 lines
1.0 KiB
C
Raw Normal View History

2015-04-22 19:32:04 +02:00
#ifndef SPOTIFYDOWNLOAD_H
#define SPOTIFYDOWNLOAD_H
2015-09-08 17:05:59 +02:00
#include "./httpdownloadwithinforequst.h"
2015-04-22 19:32:04 +02:00
namespace Network {
2017-05-01 03:22:50 +02:00
enum class SpotifyRequestType { Invalid, GetAuthenticationData, Authenticate };
2015-04-22 19:32:04 +02:00
2017-05-01 03:22:50 +02:00
class SpotifyDownload : public HttpDownloadWithInfoRequst {
2015-04-22 19:32:04 +02:00
Q_OBJECT
public:
explicit SpotifyDownload(const QString &songid, QObject *parent = nullptr);
2015-10-14 23:08:57 +02:00
Download *infoRequestDownload(bool &success, QString &reasonForFail);
2015-04-22 19:32:04 +02:00
QString typeName() const;
static void resetSession();
protected:
void evalVideoInformation(Download *, QBuffer *videoInfoBuffer);
private:
// static fields
static const QUrl m_spotifyUrl;
static bool m_authenticationCredentialsValidated;
static QString m_csrftoken;
static QString m_trackingId;
static QString m_referrer;
static QString m_creationFlow;
static QStringList m_supportedUseragents;
// fields
SpotifyRequestType m_currentRequest;
int m_triesToGetAuthenticationData;
};
2019-07-20 20:20:58 +02:00
} // namespace Network
2015-04-22 19:32:04 +02:00
#endif // SPOTIFYDOWNLOAD_H