Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
For all my nodes created today, video playback works well, but the generated thumbnails are from a support video.
According to the official YouTube blog post,
UPDATE 05/06/15: Starting today, YouTube Data API v2 video feeds will only return the support video.
I think this means an update is needed for this module, is it correct?
Comment | File | Size | Author |
---|---|---|---|
#15 | youtube-thumbnails-showing-support-video-2484357-13.patch | 865 bytes | Proteo |
#4 | youtube-thumbnails-showing-support-video-2484357-2.patch | 1.16 KB | Proteo |
#1 | youtube-thumbnails-showing-support-video-2484357-1.patch | 1.29 KB | mstrelan |
Comments
Comment #1
mstrelan CreditAttribution: mstrelan commentedThumbnails can be accessed via a certain URL, so really no need to use the API to access them. This patch should do the trick.
Comment #2
mrchristophy CreditAttribution: mrchristophy commentedI am also experiencing this. The patch doesn't seem to work either - these are the type of URL it is now returning: http://i.ytimg.com/vi/UKY3scPIMd8/sddefault.jpg
Comment #3
Funksmaname CreditAttribution: Funksmaname commentedI can confirm that the patch is not working... :(
Will keep an eye here for updates - thanks!
Comment #4
Proteo CreditAttribution: Proteo commented@mstrelan is right, there's a way to access previews via URL and since the new v3 API requires the use of private key, this may be the best route. However there maybe be other reasons to rely on the API which I'm not aware of.
Anyway, in the meantime, here's another patch which solved the problem for me (it's done against the current release).
If you created videos recently and want to get ride of the bogus preview files, you'll have to delete them manually from your sites/files/youtube (or similar) folder in order to force the module to recreate them, otherwise the patch will work only for new nodes.
Comment #5
ANDiTKO CreditAttribution: ANDiTKO commentedPatch from #4 works like a charm. Thanks @Proteo!
Dont forget to refresh the image cache and delete the "/sites/default/files/youtube" broken thumbnails.
Or run
drush image-flush youtube
via SSH or your Local Drush environment.If you have a lot of videos and dont want to re-create all thumbnails just delete the latest files ordering them by date. Thats what i did.
Comment #6
Proteo CreditAttribution: Proteo commentedGlad it worked. Actually, the patch is intedended as an "emergency measure", not to be added to the code base. I'd like to hear the thoughts from guschilds (the maintainer) about using the API vs using a plain URL. I have the feeling that relying on a hardcoded URL may be "flimsy" in the long run, but I really don't know.
If sticking to the URL makes sense, we need to check what's the best URL to use (there's something like a "canonical" URL??). After submitting the patch, I learned that people around the net are using a few different URLs all of which seems to be working now, but that doesn't mean they always will work.
Comment #7
Funksmaname CreditAttribution: Funksmaname commentedThanks for patch #4 Proteo, worked a treat.
Comment #8
ashvam CreditAttribution: ashvam commentedMy youtube thumbnails started showing support thumbnails. Can someone tell me the best way to resolve this. There were some doubts raised in #6.
Comment #9
mstrelan CreditAttribution: mstrelan commentedFWIW the media_youtube module uses the direct URL method.
Comment #10
biblos CreditAttribution: biblos commentedI'd like to confirm that patch from #4 works. Thank you, @Proteo!
For those who don't see changes after patching -- you should also "Refresh existing thumbnail image files" on page /admin/config/media/youtube .
If you are using thumbnails with styles, then imagestyleflush module will be very helpful.
ps: will be great to add ability to upload custom thumbnail for video to suffer such issue in the future.
Comment #11
ginorodrigues CreditAttribution: ginorodrigues commentedI also confirm, #4 works perfectly.
Thanks Proteo!
Comment #12
guschilds CreditAttribution: guschilds commentedThanks to everyone who has contributed to this issue!
Proteo's solution in #4 is exactly what I'd have done. As for his concerns in #6, I don't honestly know if there are any advantages to using the API rather than hitting the image path directly. The module was already using the API to fetch the image path when I inherited the codebase. I added the direct image path approach when grabbing the high res image because it wasn't available through the API. I'm willing to bet that the API is theoretically more reliable, but I'm not sure that I've ever run into the direct URL not returning a proper thumbnail for a video. I'm also willing to bet that any increase in reliability the API brings is not worth requiring everyone that uses the module to register an API key. I think it'd be best to avoid that as long as possible.
Developers: Go ahead and use the patch in #4, as it will likely be what is committed. Follow the directions in the previous comments to clear the support video images that were downloaded before you applied the patch.
Proteo (thank you!): my one question about your patch is why you've switched the image path base to
i1.ytimg.com
?img.youtube.com
seems to still work and I'm hesitant to change it unless there is a known reason. I haven't researched this in a while. As far as I know, the URLs constructed inyoutube_build_remote_image_path()
are still the most commonly used. Have you seen evidence for otherwise?Once we've determined the answer to that question I'll commit the result and, due to the priority of the issue, will probably create a 7.x-1.6 release. It may just require widespread use to determine whether or not this is the right long term solution.
Comment #13
Proteo CreditAttribution: Proteo as a volunteer commentedYou're welcome Gus. About the URL: there's no reason to change the URL. I used i1.ytimg.com just because I saw it in some examples in the net and it worked: After submitting the patch I also noticed that the current one works just fine and is more widely used.
So, I think that settles this thing! I'm attaching a proper patch done against the current 7.x-1.x branch, in case you need it. Best regards.
Comment #14
Proteo CreditAttribution: Proteo commentedComment #15
Proteo CreditAttribution: Proteo as a volunteer commentedSorry, the previous patch file was empty for some reason. Attaching another one.
Comment #16
anthony.bouch CreditAttribution: anthony.bouch commentedHi @Proteo - are you sure the final patch submitted on #15 is complete? It appears to be missing the function call to build the remote image url - or am I reading this wrong - and you're using the previous url (probably I'm reading this wrong). Thanks for the patch.
Comment #17
rachidik CreditAttribution: rachidik commentedI'd like to confirm that patch from #15 works.
Thank you @Proteo
Comment #18
Proteo CreditAttribution: Proteo as a volunteer commented@blue_waters yes the patch in #15 is complete. All it does is to remove the code which makes the Youtube API call, no other changes needed since the currently used URL works fine.
Comment #19
simon_s CreditAttribution: simon_s commentedThanks Proteo, I can also confirm that patch #15 works. (just don't forget to clear your image-caches...)
Comment #20
SoportePRO CreditAttribution: SoportePRO commentedPatch from #15 works, but it eliminate v2 lines.
If Google continue deprecating v2 things, this module can be patched to use v3 api key?
Comment #21
Proteo CreditAttribution: Proteo as a volunteer commented@SoportePRO: so far, there's no evidence that the API offer any advantages (see the comments in #12), and v3 makes the use of a private key mandatory (which is not a problem per se, but it is inconvenient for many).
Comment #22
dasginganinjaDoes this patch need a review still?
Comment #25
guschilds CreditAttribution: guschilds at Chromatic commentedThis fix has been committed and is included in the 7.x-1.6 release. If support video thumbnails persist after updating the module, please be sure to flush your download YouTube thumbnails as mentioned earlier in this thread.
I've also committed the same fix to the 8.x-1.x branch.
Thanks for everyones help with patches and reviews!