need help youtube APIs with qt
hi
i need some links where i can learn how to use youtube APIs with qt.i google it but i could not find any useful links. Please help
thanks
6 replies
Basically, you need to send some HTTP request using e.g. QNetworkAccessManager, then parse the received data.
For example, if you send a HTTP GET request like this:
- http://gdata.youtube.com/feeds/api/videos?q=football+-soccer&orderby=published&start-index=11&max-results=10&v=2
You can get a ATOM-formatted reply, containing the query result, from which you can parse e.g. the URL of the content and thumbnail, etc., then you can send another request to get the data.
doforumda, here goes some basic samples to send some request:
- {
- Q_OBJECT
- public:
- private slots:
- void processReply();
- };
- {
- QNetworkRequest request;
- request.setUrl(QUrl("http://gdata.youtube.com/feeds/api/videos?q=football&orderby=published&max-results=1&v=2"));
- connect(reply, SIGNAL(finished()), SLOT(processReply()));
- }
- void MyObject::processReply()
- {
- qDebug() << "Error found: " << reply->error();
- return;
- }
- qDebug() << content;
- // Here, you can use, e.g. QXmlStreamReader, to parse the received content
- reply->deleteLater();
- }
You must log in to post a reply. Not a member yet? Register here!

