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.
Problem/Motivation
This seems to be a problem in both versions.
Proposed resolution
Download a version of the thumbnail without black bars.
Remaining tasks
Patch.
User interface changes
None.
API changes
None.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#19 | Screen Shot 2018-12-12 at 4.29.42 PM.png | 1.51 MB | awm |
#15 | hint-correct.patch | 1.78 KB | Sam152 |
#14 | 2711323-fix-the-mock.patch | 1.29 KB | Sam152 |
#8 | 2711323-download-multiple-youtube-sizes-7.patch | 844 bytes | Sam152 |
#6 | iaf3Sl2r3jE.jpg | 5.24 KB | Sam152 |
Comments
Comment #2
Sam152 CreditAttribution: Sam152 at PreviousNext commentedThe solution to this is http://i1.ytimg.com/vi/ID/maxresdefault.jpg, however this seems to work arbitrarily, not returning anything in some cases. The "mqdefault.jpg" seems to be the only one without the black bars, but isn't very high res.
Comment #3
Sam152 CreditAttribution: Sam152 at PreviousNext commentedI've attached a simple table which compares the different thumbnails. mqdefault and maxresdefault are the only two that do not include black bars. maxresdefault also is not reliable, sometimes appearing, sometimes not. The issue with mqdefault is that it only appears at, 320x180, which is quite low resolution.
Possible solutions:
Comment #4
Sam152 CreditAttribution: Sam152 at PreviousNext commentedI couldn't see how, in this version of guzzle, to just get the headers instead of downloading the whole response.
Comment #5
Sam152 CreditAttribution: Sam152 at PreviousNext commentedComment #6
Sam152 CreditAttribution: Sam152 at PreviousNext commentedIn my test here are two of the thumbnails downloaded. One at the smaller size (where a large was not available) and one at the large size. Neither have black bars.
Comment #8
Sam152 CreditAttribution: Sam152 at PreviousNext commentedThere it is, example in install_check_localization_server. Doesn't hint for some reason.
Also, like this implementation better.
Comment #14
Sam152 CreditAttribution: Sam152 at PreviousNext commentedComment #15
Sam152 CreditAttribution: Sam152 at PreviousNext commentedComment #17
Sam152 CreditAttribution: Sam152 at PreviousNext commentedComment #19
awm CreditAttribution: awm commentedI am getting black bars when using it but when I reference youtube maxresults directly I do not. See screenshot.
Comment #20
awm CreditAttribution: awm commentednevermind I needed to remove the images from the files directory to have them re-generated.
hope this helps others .