YouTube has an option to download the maximum resolution thumbnail available ("maxresdefault"). It seems like we should use the highest resolution possible, so that the image styles can resize down to bigger images than is currently possible without much fuzzy image action.

The attached patch accomplishes this.

Files: 
CommentFileSizeAuthor
#20 media_youtube-highres-thumbnails-1893388-20.patch1.45 KBtim_dj
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]
#16 media_youtube-highres-thumbnails-1893388-16.patch1.21 KBtim_dj
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]
#14 media_youtube-highres-thumbnails-1893388-14.patch1.4 KBsamhassell
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch media_youtube-highres-thumbnails-1893388-14.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#10 media_youtube-highres-thumbnails-1893388-10.patch1.65 KBrobbt
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]
high-res-thumbnail.patch599 bytesjoelstein
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]

Comments

Great, is it possible to reload the thumbs I already have?

Yeah, you'd just delete the folder which has your downloaded YouTube thumbnails, and then the module will download the new version when it tries to load it.

Yeah! That's exactly what I was looking for the last three weeks!
I uploaded 40HD-Videos to YouTube and was thinking how to solve the thumb-problem with those low-res thumbs!

Thanks a lot!!!

Any suggestion on how to get hi-rez thumbnails in Drupal 6 module version?

It would be nice to delete those folders in an update, but I'm not certain how much work that will be. Meanwhile, this looks pretty good to me.

What is the maximum size that the maxresdefault image could be? Do we need to worry about it being too large?

That does seem like a blocker. We would at least need to check for the existence for the larger thumbnail, and if not, then download the smaller. For the potential issue around the image size, perhaps we would need a new setting to control whether to even control the maximum size.

The other thing to consider is that the if there is no highres version the thumbnail file still exists, but it is 120px × 90px box vs. the larger 720px image. So I wonder how complex the code would be to pull the highres thumbnail, check to make sure it's larger than the 1kb 120x90x and if not default to the 320x240 1.jpg. Because it definitely makes sense to use the high res thumbnail if it is available. I just solved this problem independently and then was searching to make the suggestion and found that someone else already figured it out but it hasn't been completely solved yet.

Status:Needs work» Needs review
StatusFileSize
new1.65 KB
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]

I've written the code to do this and it works for me. Here's my first drupal patch. Basically I pulled a tmp file of the high-res thumbnail, if it exists then we pass that, otherwise if the file is empty fall back to the default.

I was also looking for this. Are these patches going to be committed? It's easier to use the dev version than to apply a patch. :)

Status:Needs review» Needs work

Thanks for the patch, robbt! It looks as if the code would work (didn't test it myself) but I'm going to mark this as "needs work" because the patch does not adhere to the coding standards (indentation, comment length, trailing spaces etc.). For performance, it's better to call check_plain($parts['v']) only once and store the return value in a variable.

Status:Needs work» Needs review
StatusFileSize
new1.4 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch media_youtube-highres-thumbnails-1893388-14.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Fix the coding standards stuff and rerolled against rc4.

Thanks for the re-roll, looks much better :-)

Issue summary:View changes
StatusFileSize
new1.21 KB
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]

#14 works perfect here. Patch is just not easy to apply since it contains a fullpath. Here same patch but without the full path.

Status:Needs review» Reviewed & tested by the community

#16 Works with current DEV version (2014-Feb-12) as well. Checked my files directory and the 1920x1080 .jpgs were there.

The last submitted patch, 14: media_youtube-highres-thumbnails-1893388-14.patch, failed testing.

Status:Reviewed & tested by the community» Needs work

The patch at #16 no longer applies.

StatusFileSize
new1.45 KB
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]

Please retest and let's get this thing in before it doesn't apply to DEV again.

Status:Needs work» Needs review