• Resolved Lazza

    (@lazza)


    Old Vimeo embedded videos might show one or two of the following:

    • HTTP instead of HTTPS in the protocol
    • www.vimeo.com instead of vimeo.com

    Currently, the code handling thumbnails does not work for these cases. It seems that the whole URL is matched, so only HTTPS and no-www Vimeo URLs are accounted for.

    • This topic was modified 1 year, 11 months ago by Lazza. Reason: Removed automatic link that triggered spam alert
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Matthias Kittsteiner

    (@kittmedia)

    Hi there!

    Since you already noticed that the thumbnail generation by default won’t touch existing embeds, I can’t see any bug here. It works as defined. Especially regarding the protocol mismatch: there’s absolutely no reason why you still should use these links. Please convert them to strict HTTPS.

    Additionally, there is no plan in changing the current behavior. If you wish to show thumbnails for these URLs, please adjust them.

    Best regards,
    Matthias

    Thread Starter Lazza

    (@lazza)

    OK that’s fine for old embeds, but my general point was that splitting strings is not bullet-proof and risks breaking in the future.

    All of these are valid Vimeo URLs:

    http://vimeo.com/14736353
    
    
    https://www.vimeo.com/14736353

    The embedded iframe itself ends up the same, so no issues here. We are just talking about a string to trigger the oEmbed feature.

    As you said, the problem for now can be bypassed with the workaround of editing each and every post written in the past when Vimeo used the www prefix, so it’s not critical.

    Maybe the title of this topic can be reworded as “do not rely on full URL string split to identify the provider and isolate the video ID for videos”, that’s probably a better way to word it and it’s not necessarily related to Vimeo. ??

    Extending the idea a bit more…

    Ideally, there could be a unique piece of code that extracts the domain for each embed, so that we can extend it in the future to support more providers. Contributors could just write a function that turns the embed URL into the thumbnail URL and each function would be associated with a whitelist of domains.

    That would be really neat and could speed up contributions for additional embed.

    Something like this (pseudo-code, not actual PHP):

    function fetch_vimeo_thumb($url) {
    get json from "https://vimeo.com/api/oembed.json?url=" . $url;
    return json["thumbnail_url"];
    }
    
    $thumbnail_functions = [
    "vimeo.com" => fetch_vimeo_thumb,
    "youtube.com" => fetch_yt_thumb,
    "youtu.be" => fetch_yt_thumb,
    // [...]
    ];

    The plugin could just use the array of functions and take care of the rest, like figuring out the domain of an embed, getting the thumbnail URL with the proper function, fetching the picture and storing the thumbnail in the correct place.

    OK, this one is a feature idea and not a bug, I just thought it would be nice to write it down.

    I’d like to add support for thumbnails of Slideshare embeds, let’s see if I can figure it out.

    Plugin Author Matthias Kittsteiner

    (@kittmedia)

    I’m not saying that these links are invalid. Just outdated. And that the plugin doesn’t process outdated links.

    And at the moment I process these links, especially in order to make thumbnails also available to embeds using plain HTML tags, I don’t have any other information aside the embedded URL. Otherwise I would need to fetch the oEmbed response manually again, which I want to prevent as it results in additional load on both sides the API as well as the own server.

    There’s also currently no plan from my side to extend the functionality to allow other developers in using the thumbnail functionality since I simply have not the time to implement that and especially to test that reliably. I believe that it’s much easier for me to implement the thumbnail functionality for additional providers by myself.

    However, you’re free to extend the plugin yourself for your provider as you are not required to use the thumbnail functionality of Embed Privacy to do so. Since I rely on the output of the filter oembed_dataparse here, you can do that as well. Additionally, if you want to use my functionality, everything you need is in public methods of a public class, which can be extended. ??

    Thread Starter Lazza

    (@lazza)

    OK, sorry. I did not understand that you prefer not to accept pull requests.

    Apologies for wasting your time.

    Plugin Author Matthias Kittsteiner

    (@kittmedia)

    This is not true and was not what I said. What I said was that I will not implement it by myself.

    Thread Starter Lazza

    (@lazza)

    This is not true and was not what I said

    Then I probably misunderstood something. It was not clear to me what you meant by this:

    There’s also currently no plan from my side to extend the functionality to allow other developers in using the thumbnail functionality

    What I read is you did not plan to let other developers extend thumbnails to work for more sites. I assumed you meant regarding your codebase, as anyone could fork the project and do it themeselves but that would be very inconvenient.

    Viceversa, if there was a kind of “plug-in architecture” (OK maybe that’s a big too much of a word for the simple thing I had in mind) more people could propose their own PR with the added code that only deals with thumbnails for a specific domain.

    However, you’re free to extend the plugin yourself for your provider as you are not required to use the thumbnail functionality of Embed Privacy to do so

    Thank you for this suggestion, I will try to see if I can come up with something useful and maybe try to fit into the code of your plug-in as a PR. I can’t promise I will be successful, though. ??

    Plugin Author Matthias Kittsteiner

    (@kittmedia)

    It just means that I’m not going to implement it, you need to read the sentence completely without extracting a specific part of it. Pull requests are appreciated, though.

    Maybe I can add some filters and actions to allow extending the thumbnail functionality, though.

    Thread Starter Lazza

    (@lazza)

    Pull requests are appreciated

    Happy to hear that! I hope I will be able to contribute some code for Slideshare embeds.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Bug: thumbnails are not downloaded for some Vimeo videos’ is closed to new replies.