iamcal / oembed

The oEmbed Spec
http://oembed.com
MIT License
1.32k stars 651 forks source link

Youtube now requires SSL for oembed endpoint #506

Closed idgserpro closed 3 years ago

idgserpro commented 3 years ago

The video example documentation gives:

http://www.youtube.com/oembed?url=http%3A//youtube.com/watch%3Fv%3DM3r2XDceM6A&format=json

But calling

curl 'http://www.youtube.com/oembed?url=http%3A//youtube.com/watch%3Fv%3DM3r2XDceM6A&format=json'

Gives:

{
  "error": {
    "code": 403,
    "message": "SSL is required to perform this operation.",
    "status": "PERMISSION_DENIED"
  }
}

Calling with https solves the problem.

curl 'https://www.youtube.com/oembed?url=http%3A//youtube.com/watch%3Fv%3DM3r2XDceM6A&format=json'

{"title":"Amazing Nintendo Facts","author_name":"ZackScott","author_url":"https://www.youtube.com/c/ZackScott","type":"video","height":113,"width":200,"version":"1.0","provider_name":"YouTube","provider_url":"https://www.youtube.com/","thumbnail_height":360,"thumbnail_width":480,"thumbnail_url":"https://i.ytimg.com/vi/M3r2XDceM6A/hqdefault.jpg","html":"\u003ciframe width=\u0022200\u0022 height=\u0022113\u0022 src=\u0022https://www.youtube.com/embed/M3r2XDceM6A?feature=oembed\u0022 frameborder=\u00220\u0022 allow=\u0022accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\u0022 allowfullscreen\u003e\u003c/iframe\u003e"}
idgserpro commented 3 years ago

https://github.com/iamcal/oembed/commit/bfacd30d944c8cbbb2eaca9b4a5588fdb912df4f