wrav / oembed

A simple plugin to extract media information from websites, like youtube videos, twitter statuses or blog articles.
MIT License
37 stars 36 forks source link

[Question] how Instagram oEmbed works? #89

Closed watarutmnh closed 9 months ago

watarutmnh commented 3 years ago

Instagram url is not working on preview and not displayed at site front. It errors "Please check your URL." at CP. Twitter and Youtube, Vimeo work well but Instagram and Facebook are not. How I can get it work properly?

PHP version: 7.4.21 Craft: 3.6.17 oEmbed: 1.3.11

iparr commented 2 years ago

I am now suffering from this.

I have a feeling it has something to do with this: https://github.com/oscarotero/Embed/blob/v4.4.4/CHANGELOG.md#435---2021-10-10

reganlawton commented 2 years ago

Have you tried the dev-embed4 I added the update of the plugin to support the updated embed package which resolved a ton of issues but no one seems to be wanting to test that branch.

I have an update for Craft 4 coming up I'm gonna be porting everything to that branch so might be a good time to see if that resolves it.

iparr commented 2 years ago

I'm happy to test!

I'm on Craft 3.7.41 and PHP 7.4. With a previously broken Instagram link I get: wrav\oembed\models\OembedModel::valid(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "Embed\Adapters\Instagram" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition and "Please check your URL." in the dashboard.

With a previously working YouTube link, it's fine in the dashboard but the front-end says: Call to undefined method Embed\OEmbed::getCode()

reganlawton commented 9 months ago

Instagram works as expected but instagram is changed things around. The /embed is key here, as I found this from this discussion

{# WORKING #}
{{
    craft.oembed.render(
        'https://www.instagram.com/reel/C0ZMDDgPlSB/embed',
        {
            params: {},
            attributes: {
                width: 640,
                height: 480,
                title: 'Main title',
            }
        }
    )
}}