medium-editor-insert-plugin icon indicating copy to clipboard operation
medium-editor-insert-plugin copied to clipboard

Youtube video import no longer works

Open boussou opened this issue 6 years ago • 2 comments

Describe the bug Youtube video import no longer works.

url like this is generated by the plugin:

https://medium.iframe.ly/api/oembed?iframe=1&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D17ZPd17-iP4%26feature%3Dyoutu.be&_=1570655298549

answer from iframely is:

  1. a https cert error (!) -> net::ERR_CERT_COMMON_NAME_INVALID
  2. the following json:
{
    "status": 403,
    "error": "Valid api_key is required to access API"
}

I found out that you can access through http not https, but same pb, you still need an api key. 

boussou avatar Oct 09 '19 21:10 boussou

you have to create an account on https://iframely.com/ Free level allows for Trial and 10 000 hits 1 000 hits/mo afterwords

then you have to add to the initalisation of the plugin the API key to the URL. Something like "&api_key=…" as below:


defaults = {
            oembedProxy: 'http://medium.iframe.ly/api/oembed?api_key=XXXX&iframe=1',
            captions: true,
            captionPlaceholder: 'Type caption (optional)',
...etc

Replace XXXX by your own key given at account creation

boussou avatar Oct 09 '19 21:10 boussou

oembedProxy needs to be changed to the production-ready endpoint at //iframe.ly/..... The demo endpoint at medium subdomain was never meant for production, and has never had SSL certificate.

Regardless, we have fixed SSL certificate on Iframely demo endpoint, it should work out of the box. Just make sure that your SSL site sends referrer header if you don't supply api_key (by default browsers don't send ssl referrers).

@orthes this can now be closed. As well as #496

iparamonau avatar Oct 26 '19 14:10 iparamonau