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.

Support from Acquia helps fund testing for Drupal Acquia logo

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
FileSize
1.65 KB

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
FileSize
1.4 KB

Fix the coding standards stuff and rerolled against rc4.

marcvangend’s picture

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

tim_dj’s picture

#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

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

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.

travelertt’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev
Status: Closed (fixed) » Active

New version 3.x isn't grabbing the maxresdefault.jpg.

travelertt’s picture

heshanlk solved this issue again over at https://www.drupal.org/node/2594731. I rerolled his patch.

travelertt’s picture

Status: Active » Needs review
steinmb’s picture

Status: Needs review » Reviewed & tested by the community

Tested and applies cleanly. The code look sane too and that always help :) RTBC

Ollie222’s picture

The patch in #32 looks to work well for me too.

Thanks guys just what I needed.

joseph.olstad’s picture

Status: Reviewed & tested by the community » Fixed

patch #32 committed to 7.x-3.x dev branch

rozh’s picture

Status: Fixed » Needs work

This is cause regression. Low-res videos have broken thumbnails now.

I get http://s.ytimg.com/yts/img/image-hh-404-vflvCykRp.png for every thumbnail.

joseph.olstad’s picture

Status: Needs work » Fixed

Follow up in the new issue for low res thumbs
#2886546: low resolution thumbnails

Status: Fixed » Closed (fixed)

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