Download & Extend

Documentation does not specify correct feed URL to use (it's counter to what one would expect)

Project:Youtube API
Version:5.x-1.x-dev
Component:Documentation
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

Did YouTube change their feed format? Trying with this URL:

http://gdata.youtube.com/feeds/base/users/citizens4giannoulias/uploads

I get a fatal error:

Fatal error: Call to a member function attributes() on a non-object in /.../modules/youtube_api/youtube_api.module on line 486

On that line, it's trying to do this:

<?php
$attrs
= $media->group->player->attributes();
?>

Looks like it isn't getting squat from $media = $entry->children('http://search.yahoo.com/mrss/'); a couple lines above.

Comments

#1

Title:Fatal error: Call to a member function attributes() on a non-object in youtube_api.module on line 486» Fatal error: Call to a member function attributes() on a non-object in youtube_api.module on line 484

Correction on the line number - should be 484 not 486 (my debug attempts pushed it down two lines).

#2

bumped - client is asking about this.

#3

Status:active» fixed

Thanks for bumping this again to put it back on my to-do list. I feel silly for not noticing this earlier, but you're actually using the wrong URL for this feed. It looks like you may be using the RSS feed for the account, when in reality you need to be using the YouTube API user feed URL. For this account that URL would be http://gdata.youtube.com/feeds/api/users/citizens4giannoulias/uploads. Looking at the YouTube API Documentation it looks like they have updated some documentation and that isn't as clear as it used to be. Sorry for the confusion.

In addition to updating the URL you are using, you might want to look at standard and custom URL parameters you can use to further restrict feed data. That URL is http://code.google.com/apis/youtube/2.0/reference.html#Standard_parameters. Of particular interest is the ?format=5 parameter, which will restrict the result set to only those videos which can be embedded.

Definitely let me know if anything else comes up, your feedback thus far has already given me a few to-do's to clean up some stuff and make it a little bit easier to use (better url validation on feeds for one).

#4

Component:Code» Documentation
Priority:critical» normal
Status:fixed» active

OK, Thanks for your help. I think this warrants reopening the bug and reassigning it as a documentation issue, then. Since we have no control over YouTube's docs, I'd suggest updating at a bare minimum the description field of the YouTube FeedAPI fieldset to better explain how to find the correct feed URL. I think the average user is going to assume you'd get this feed URL the same as any other (why wouldn't you?). If the module can't auto-correct it for the user (which seems doable to me), then the help text needs to be much clearer.

#5

Title:Fatal error: Call to a member function attributes() on a non-object in youtube_api.module on line 484» Documentation does not specify correct feed URL to use (it's counter to what one would expect)

Updating the title

nobody click here