Reputation: 1891
So I know that I can retrieve the youtube thumbnail by going here:
http://img.youtube.com/vi/BoVBdxftEF8/0.jpg
obviously the ID changes based on the video. I want to write a script that I can get save the photo from that URL to a folder say called 'video_thumbnails'. Is there a somewhat simple way of doing this in PHP?
Upvotes: 2
Views: 3536
Reputation: 23552
Quite simple:
file_put_contents ("video_thumbnails/thumb.jpg",file_get_contents("http://img.youtube.com/vi/BoVBdxftEF8/0.jpg"));
Upvotes: 3