Problem/Motivation
Some video thumbnails are not found when we used the theme youtube_thumbnail.
Actually, we try to get the remote video image (maxresdefault version).
Example :
https://www.youtube.com/watch?v=OOWAUAWy7rs
http://img.youtube.com/vi/OOWAUAWy7rs/maxresdefault.jpg => 404
http://img.youtube.com/vi/OOWAUAWy7rs/0.jpg => 200
Proposed resolution
I suggest to try to retrieve the 'maxresdefault' version, and the '0' version as fallback.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | youtube-404-maxres-thumbnails-2576953-4.patch | 3.81 KB | guschilds |
| #2 | some-video-thumbnails-are-not-found-2576953-2.patch | 632 bytes | jeanfei |
Comments
Comment #2
jeanfei commentedThe patch try to get the 'maxresdefault' version, then '0' version, remote image will be displayed as fallback.
Comment #3
jeanfei commentedComment #4
guschilds commentedHi jeanfei,
Thanks for pointing this out!
There was code from the Drupal 7 port that should retrieve the smaller image if the bigger one wasn't found. When the bigger one isn't found, such as your example, a 404 is returned. When that 404 was returned, an exception was being thrown. Before throwing that exception, it should try again, but look for the smaller image. This second attempt wasn't happening.
That code and functionality was not correctly ported. While your patch added a second attempt in that one spot, it was better to fix the existing code that wasn't working for anywhere the function is called from. I've attached a patch which fixes it that I had success with when testing in all situations.
Please test the patch and if it works for you, I'd like to get it committed soon.
Thanks again,
Gus
Comment #6
guschilds commentedI went ahead and committed the patch in #4 so I could create a beta1 release. Please let me know if you continue to experience problems. Thanks again!
Comment #7
jeanfei commentedThanks for the new patch which is better !
I've use it in my project, works fine for me !