Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Youtube Thumbnails [duplicate]

I have made an RSS reader app in Xcode, which gets it's information from a YouTube channel. How can I get the thumbails from the videos?

I am able to use this link: http://gdata.youtube.com/feeds/mobile/users/HaatFilms/uploads?alt=rss

To get the uploads text, but what would I use to get the thumbnail for each specific video?

like image 446
RafeeJ Avatar asked Sep 15 '13 12:09

RafeeJ


People also ask

How do I save a YouTube thumbnail as a picture?

To save this thumbnail to your device, right-click it and select “Save Image As.” Select a folder to save the thumbnail in, and you're all set.

Can I use same thumbnail on YouTube?

Yes, you could use exactly the same thumbnail each time but when someone looks through your catalog to watch older videos, having exactly the same thumbnail may discourage them from binging on your past videos.

How do you find the source of a YouTube thumbnail?

Step 1: Open the youtube video (that you want to see the thumbnail for) in your browser. Step 2: View the HTML source of the video by clicking 'CTRL + U' or 'CMD + U' if you are on a mac. You can also view the source by right clicking on a black area of the screen and then selecting 'View Source'.

How do I download pictures from YouTube?

Just play the youtube video that has the background image you wanted and click on the Youtube Image Downloader chrome extension icon, and that's it! The image will immediately start downloading.


2 Answers

Using the listed RSS feed:

You'll see links that include:

LKk6SvGmJj4

Previous episode: http://youtu.be/LKk6SvGmJj4 http://gdata.youtube.com/feeds/mobile/videos/LKk6SvGmJj4

That's the youtube ID.

Take that ID and use it with a straight image tag.

http://img.youtube.com/vi/LKk6SvGmJj4/0.jpg
http://img.youtube.com/vi/LKk6SvGmJj4/1.jpg

Use those images to populate your tables. Personally, I use Afnetworking's UIImageView category.

https://github.com/AFNetworking/AFNetworking

 UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 100.0f, 100.0f)];
 [imageView setImageWithURL:[NSURL URLWithString:@"http://img.youtube.com/vi/LKk6SvGmJj4/1.jpg"] placeholderImage:[UIImage imageNamed:@"placeholder-avatar"]];
like image 198
warpedspeed Avatar answered Sep 20 '22 18:09

warpedspeed


I have used UIImageView+AFNetworking category to load image to an UIImageView. UIImageView+AFNetworking

NSString * youtubeID = @"TJkmc8-eyvE";
NSURL *youtubeURL = [NSURL URLWithString:[NSString stringWithFormat:@"http://img.youtube.com/vi/%@/0.jpg",youtubeId];

[imageView setImageWithURL:youtubeURL] placeholderImage:[UIImage imageNamed:@"placeHolderImage"]];
like image 34
Ayush Avatar answered Sep 17 '22 18:09

Ayush