OrchardCMS / Orchard

Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.
https://orchardproject.net
BSD 3-Clause "New" or "Revised" License
2.38k stars 1.12k forks source link

Fix to import Vimeo videos #8804

Open AndreaPiovanelli opened 2 months ago

AndreaPiovanelli commented 2 months ago

In reference to #8803 , added a fix to avoid the scraping of the "vimeo.com/xxxx" page (which replies with a 429 http error) by forcing the direct api call if Vimeo domain is recognized.

sebastienros commented 1 month ago

I think this is really wrong. If Vimeo doesn't support OEmbed then it's better to have another feature dedicated to vimeo, or just drop vimeo support altogether.

AndreaPiovanelli commented 1 month ago

I think this is really wrong. If Vimeo doesn't support OEmbed then it's better to have another feature dedicated to vimeo, or just drop vimeo support altogether.

Vimeo still supports embed (and the xml format is still the same) but it doesn't include the link to the video metadata xml in its markup anymore, so it cannot be automatically imported by directly reading the video page content.

While investigating further, we also noticed Youtube stopped working too. This is caused by the fact it blocks video output when trying to watch a video from a server (a bot protection). This is what happened when I tried to debug the Youtube issue directly from the server: I was trying to find a way to get the meta link in the page, but that's what the page shows: image

For this reason, we worked on a patch on the code, similar to what has already been done to get Vimeo's oembed xml data: to properly get the provider, we check for the url we're redirected to and, with that information, call the right api.

BenedekFarkas commented 6 days ago

I think this is really wrong. If Vimeo doesn't support OEmbed then it's better to have another feature dedicated to vimeo, or just drop vimeo support altogether.

Vimeo still supports embed (and the xml format is still the same) but it doesn't include the link to the video metadata xml in its markup anymore, so it cannot be automatically imported by directly reading the video page content.

While investigating further, we also noticed Youtube stopped working too. This is caused by the fact it blocks video output when trying to watch a video from a server (a bot protection). This is what happened when I tried to debug the Youtube issue directly from the server: I was trying to find a way to get the meta link in the page, but that's what the page shows: image

For this reason, we worked on a patch on the code, similar to what has already been done to get Vimeo's oembed xml data: to properly get the provider, we check for the url we're redirected to and, with that information, call the right api.

@sebastienros what do you think? BTW I tested the YouTube import (but couldn't test Vimeo), works fine.

sebastienros commented 4 days ago

Let's keep oembed as is, it's oembed. Add some other option called youtube, another one for vimeo and they are dedicated. Or a single one called "video" which would support whatever we want. Copy as much as you want from the current oembed.