Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Need help youtube APIs with qt
QtWS25 Last Chance

Need help youtube APIs with qt

Scheduled Pinned Locked Moved Mobile and Embedded
7 Posts 3 Posters 5.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    doforumda
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • X Offline
      X Offline
      xizzhu
      wrote on last edited by
      #2

      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.

      My Blog: http://xzis.me/

      1 Reply Last reply
      0
      • D Offline
        D Offline
        doforumda
        wrote on last edited by
        #3

        thanks but any link would be help full

        1 Reply Last reply
        0
        • X Offline
          X Offline
          xizzhu
          wrote on last edited by
          #4

          YouTube API: http://code.google.com/apis/youtube/2.0/developers_guide_protocol_audience.html

          My Blog: http://xzis.me/

          1 Reply Last reply
          0
          • D Offline
            D Offline
            doforumda
            wrote on last edited by
            #5

            well i have used youtube api in past with PHP. i know how to do this in PHP. but i need to how can i access youtube stuff using QT. I mean i need some examples. if there are any links for this then provide it here i ll really appreciate that.

            1 Reply Last reply
            0
            • I Offline
              I Offline
              Irfan
              wrote on last edited by
              #6

              doforumda: Were you able to do it with Qt?? please sher if you got any success

              1 Reply Last reply
              0
              • X Offline
                X Offline
                xizzhu
                wrote on last edited by
                #7

                doforumda, here goes some basic samples to send some request:
                @class MyObject : public QObject
                {
                Q_OBJECT
                public:
                explicit MyObject(QObject *parent = 0);

                private slots:
                void processReply();
                };

                MyObject::MyObject(QObject *parent) :
                QObject(parent)
                {
                QNetworkAccessManager *nam = new QNetworkAccessManager(this);

                QNetworkRequest request;
                request.setUrl(QUrl("http://gdata.youtube.com/feeds/api/videos?q=football&orderby=published&max-results=1&v=2"));
                
                QNetworkReply *reply = nam->get(request);
                connect(reply, SIGNAL(finished()), SLOT(processReply()));
                

                }

                void MyObject::processReply()
                {
                QNetworkReply *reply = static_cast<QNetworkReply *>(sender());

                if (reply->error() != QNetworkReply::NoError) {
                    qDebug() << "Error found: " << reply->error();
                    return;
                }
                
                QByteArray content = reply->readAll();
                qDebug() << content;
                
                // Here, you can use, e.g. QXmlStreamReader, to parse the received content
                
                reply->deleteLater();
                

                }@

                My Blog: http://xzis.me/

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved