alex
alex

Reputation: 490567

Can I get larger thumbnail dimensions using the YouTube API?

I'm using the YouTube API to get thumbnails.

I have noticed the thumbnails are all 90 × 120 pixels.

Is there a way I can get them larger?

I'm using PHP 5.3 & SimpleXML to parse the XML.

Upvotes: 2

Views: 2807

Answers (2)

Paulo Henrique
Paulo Henrique

Reputation: 192

Youtube Max size, large

http://i1.ytimg.com/vi/w1_-0T8JTfc/maxresdefault.jpg

Replace (w1_-0T8JTfc) by your youtube id

Upvotes: 0

alex
alex

Reputation: 490567

Yes, you can sir!

// Get the thumbnail
$thumb = $media->group->thumbnail[0]->attributes();
$thumbnailSrc = preg_replace('/default\.jpg$/', '0.jpg', $thumb['url']);

I figured out that replacing the default.jpg with 0.jpg, I can get a 480 × 360 px image.

Upvotes: 3

Related Questions