2015-04-22 19:32:04 +02:00
|
|
|
#ifndef YOUTUBEDOWNLOAD_H
|
|
|
|
#define YOUTUBEDOWNLOAD_H
|
|
|
|
|
2015-09-08 17:05:59 +02:00
|
|
|
#include "./httpdownloadwithinforequst.h"
|
2015-04-22 19:32:04 +02:00
|
|
|
|
|
|
|
#include <QHash>
|
|
|
|
#include <QJsonObject>
|
2017-05-01 03:22:50 +02:00
|
|
|
#include <QStringList>
|
2015-04-22 19:32:04 +02:00
|
|
|
|
|
|
|
namespace Network {
|
|
|
|
|
2017-05-01 03:22:50 +02:00
|
|
|
class YoutubeDownload : public HttpDownloadWithInfoRequst {
|
2015-04-22 19:32:04 +02:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit YoutubeDownload(const QUrl &url, QObject *parent = nullptr);
|
|
|
|
explicit YoutubeDownload(const QString &id, 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 videoInfo(QString field, const QString &defaultValue);
|
|
|
|
QString suitableFilename() const;
|
|
|
|
QString typeName() const;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void evalVideoInformation(Download *, QBuffer *videoInfoBuffer);
|
|
|
|
|
|
|
|
private:
|
|
|
|
QHash<QString, QString> m_fields;
|
|
|
|
QStringList m_itags;
|
|
|
|
static QJsonObject m_itagInfo;
|
|
|
|
};
|
2019-07-20 20:20:58 +02:00
|
|
|
} // namespace Network
|
2015-04-22 19:32:04 +02:00
|
|
|
|
|
|
|
#endif // YOUTUBEDOWNLOAD_H
|