oscarotero / Embed

Get info from any web service or page
MIT License
2.08k stars 310 forks source link

[Youtube] blocked server ip when using Embed::create . #337

Closed mahmoudps closed 4 years ago

mahmoudps commented 4 years ago

Hi , my server ip get blocked from Youtube when i use Embed::create($url);

Fatal error: Uncaught Embed\Exceptions\InvalidUrlException: Invalid url 'https://www.youtube.com/watch?v=xxxxxxx' (Status code 429)

but server ip can get youtube embed data from Youtube embed provider [https://www.youtube.com/oembed?url=$url] . can we grab the oembed data with your Embed provider directly without use curl the youtube link before extraction it's data ?

oscarotero commented 4 years ago

The new version (v4.x) should work with this. If you decide to upgrade, could you test it?

lenvanessen commented 4 years ago

@oscarotero can a fix also be applied to the 3.* branch?

oscarotero commented 4 years ago

In theory, the status code 429 is valid in youtube as I can see here: https://github.com/oscarotero/Embed/blob/v3.x/src/Adapters/Youtube.php#L18

lenvanessen commented 4 years ago

We're having it on Twitter actually

Op za 27 jun. 2020 23:29 schreef Oscar Otero notifications@github.com:

In theory, the status code 429 is valid in youtube as I can see here: https://github.com/oscarotero/Embed/blob/v3.x/src/Adapters/Youtube.php#L18

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/oscarotero/Embed/issues/337#issuecomment-650631863, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFPVGRGDZG3WJU647C3A5XDRYZQCBANCNFSM4K2GYJHQ .

oscarotero commented 4 years ago

Could you work on a PR with a fix for twitter? Just duplicate the Youtube adapter changing the name to Twitter, and let me know if it works

oscarotero commented 4 years ago

Fixed in v3.4.7