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 ]
#22 media_youtube-highres-thumbnails-1893388-22.patch1.08 KBesolano
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch media_youtube-highres-thumbnails-1893388-22.patch. Unable to apply patch. See the log in the details link for more information.
[ 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

JoergPf’s picture

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

joelstein’s picture

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.

JoergPf’s picture

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!!!

yadranko’s picture

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

aaron’s picture

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.

Dave Reid’s picture

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

Dave Reid’s picture

aaron’s picture

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.

robbt’s picture

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.

robbt’s picture

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.

westis’s picture

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. :)

Devin Carlson’s picture

marcvangend’s picture

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.

samhassell’s picture

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.

marcvangend’s picture

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

tim_dj’s picture

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.

travelertt’s picture

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.

aaron’s picture

Status:Reviewed & tested by the community» Needs work

The patch at #16 no longer applies.

tim_dj’s picture

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.

tim_dj’s picture

Status:Needs work» Needs review
esolano’s picture

StatusFileSize
new1.08 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch media_youtube-highres-thumbnails-1893388-22.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Hi,

How about adding HTTPS (SSL) support for here?

Regards!

Status:Needs review» Needs work

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

tim_dj’s picture

Why would you want to add https support for downloading images from youtube? besides that is not the current issue! Please review patch #20!

tim_dj’s picture

Status:Needs work» Needs review
thijsvdanker’s picture

Status:Needs review» Reviewed & tested by the community

Patch works as advertised

travelertt’s picture

I can confirm that the patch media_youtube-highres-thumbnails-1893388-20.patch works correctly as well.

  • aaron committed 4912276 on 7.x-2.x
    Issue #1893388 by tim_dj, esolano, samhassell, robbt, joelstein: fixed...
aaron’s picture

Status:Reviewed & tested by the community» Fixed

Status:Fixed» Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.