File indexing completed on 2024-12-15 04:23:42
0001 #pragma once 0002 0003 #include <QObject> 0004 #include <QUrl> 0005 #include <QByteArray> 0006 0007 #include <MauiKit3/Core/fmh.h> 0008 0009 class YouTube : public QObject 0010 { 0011 Q_OBJECT 0012 0013 public: 0014 explicit YouTube(QObject *parent = nullptr); 0015 0016 void getQuery(const QString &query, const int &limit = 5); 0017 bool packQueryResults(const QByteArray &array); 0018 void getId(const QString &results); 0019 void getUrl(const QString &id); 0020 0021 void setKey(const QString &key); 0022 QString getKey() const; 0023 0024 static QUrl fromUserInput(const QString &userInput); 0025 private: 0026 QString KEY; 0027 const QString API = "https://www.googleapis.com/youtube/v3/search?"; 0028 0029 Q_SIGNALS: 0030 void queryResultsReady(FMH::MODEL_LIST res); 0031 };