mikestecker/craft-videoembedder

Experiencing similar issues to #7

Opened this issue · 3 comments

We are using this plugin and recently we have started having the plugin throw an Internal Server Error when embedding Vimeo videos.

The logs are showing Embed\Exceptions\InvalidUrlException: Invalid url 'https://vimeo.com/294536324' (Status code 403) but unlike Issue #7 this video has no restrictions on access or embedding.

Not at all sure why this particular video would be throwing a 403 error from the Embed service.

Any thoughts on resolution appreciated.

Craft CMS 3.3.0.1
Video Embedder 1.1.3
PHP version 7.1.31

For further info this may be an issue with the Embed library - see issue at oscarotero/Embed#326

Yeah, we are getting this as well. Sad times. Are you on Digital Ocean @cole007?

@b3nhartl3y yep - have had to fallback on a simple macro for time being:

{%- macro video(url) -%}
    {% if 'youtu' in url %}
        {% set id = '?v=' in url ? url\|split('?v=') : url\|split('youtu.be/') %}
        {% set embedCode = id is iterable ? 'https://www.youtube.com/embed/' ~ id[1] : null %}
    {% elseif 'vimeo' in url %}
        {% set id = url\|split('vimeo.com/') %}
        {% set embedCode = id is iterable ? 'http://player.vimeo.com/video/' ~ id[1] : null %}
    {% endif %}
    {% if embedCode %}
       {{ ('<iframe src="' ~ embedCode ~ '"></iframe>')|raw }}
    {% endif %}
{%- endmacro -%}

Would be simple enough to pass additional parameters into the macro if needed as per the plugin.