开发者

How do I list all videos uploaded to Youtube?

开发者 https://www.devze.com 2023-03-14 15:59 出处:网络
I\'m working with Youtube API and PHP library: http://code.google.com/apis/youtube/2.0/developers_guide_php.html

I'm working with Youtube API and PHP library: http://code.google.com/apis/youtube/2.0/developers_guide_php.html

I'm modifying existing app: http://googlecodesamples.com/youtube/php/YouTubeVideoApp/index.php

That is also available in Zend Gdata library: [no link due to "new users can only post a maximum of two hyperlinks"]

My problem is: "retrieve my videos" retrieves only 25 and links "back" / "next" are not working :(

The workflow of Youtube API and ZendFramework is really complicated:

  1. index.php calls a javascript function declared in video_app.js
  2. ytVideoApp.listVideos calls ytVideoApp.presentFeed
  3. ytVideoApp.presentFeed sends ajax request operations.php
  4. operations.php strips parameters and calls proper function within itself, that is searchVideos
  5. searchVideos calls echoVideoList
  6. echoVideoList prints the data foreach ($feed as $entry)
  7. ytVideoApp.listVideos updates navigation (back/next buttons)

Existing value: ytVideoApp.MAX_RESULTS_LIST = 200; I开发者_运维百科 also tried to hardcode it, rather than passing via parameter across php, js, ajax. In each case the I receive only 25 results. I tested in on two separate accounts (I do have 2 accounts with more than 25 uploads).

Is there any limitation that remains unknown to me?

Any hints, clues, whatever?


Here is your solution: http://markmail.org/message/n2px7yheizakzt7y#query:+page:1+mid:vcrj4gmyzfxdtpao+state:results (click on 'Peter December 5, 2010 - at the top')

As quoted from that link:

Here is the solution that I've come up [with]:

  1. In operations.php find the line: $query->setQuery($searchTerm); and comment it out.

  2. A few lines below, right under $query->setMaxResults($maxResults); add this: $query->setAuthor('millenniumpromise');

  3. That's basically it! You can now use the all search type and get the results published only by millenniumpromise.

I also needed to display the results by published date (most recent first), so I added $query->setParam('orderby', 'published'); right below $query->setAuthor('millenniumpromise'); in operations.php

And here is more help from the same players as above: http://osdir.com/ml/youtube-api-gdata/2010-11/msg00426.html

I must commend Peter and Neil for I have just spent the past week trying to nut this same problem out myself until I found their solution...

Regards, Adam

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号