Closed nerg4l closed 9 months ago
The initial request to the original URL is to resolve redirects, ensure the URL exists and it's valid, etc.
If you only want the OEmbed data, I think your workaround is the only way. Note that there are some extractors adapted to specific sites, so maybe you should use the ExtractorFactory
class (https://github.com/oscarotero/Embed/blob/master/src/ExtractorFactory.php).
I thought that I didn't need to follow the redirections in my case and that the oEmbed would be enough but I was wrong. It's good as is.
I think it would be a great addition if there would be an option to fetch OEmbed information only. At the moment, there will be a call to the original URL and then when a value of
\Embed\OEmbed
is accessed, there will be a new HTTP call to fetch the JSON document.At the moment the only workaround I could find is to do the following:
The main problem I think is the coupling with
\Embed\Extractor
.If this is something that not planned, that's not a problem.