Home > Projects > QYouTube

QYouTube

Contents

About

QYouTube provides a series of request classes and data models enabling read/write access to YouTube Data API resources. The library also supports authentication and retrieval of video streams and subtitles. Each of the request classes and data models are available for use in QML via the QYouTube import.

Example usage:

C++

using namespace QYouTube;
...
request.get("/video/VIDEO_ID");
connect(&request, SIGNAL(finished()), this, SLOT(onRequestFinished()));
...
void MyClass::onRequestFinished() {
if (request.status() == ResourcesRequest::Ready) {
QMapIterator<QString, QVariant> iterator(request.result().toMap());
while (iterator.hasNext()) {
iterator.next();
qDebug() << iterator.key() << "=" << iterator.value();
}
}
else {
qDebug() << request.errorString();
}
}

QML

import QtQuick 1.0
import QYouTube 1.0
id: request
onFinished: {
if (status == ResourcesRequest.Ready) {
for (var k in result) {
console.log(att + " = " + result[k]);
}
}
else {
console.log(errorString);
}
}
Component.onCompleted: get("/video/VIDEO_ID")
}

Documentation

Full documentation of QYouTube is available here.

Source code

QYouTube is licensed under GPLv3. The project is hosted at GitHub.