Closed benwilkins closed 7 years ago
Hmm, I have just tried the same link and it worked for me
Then I added a typo to the URL on purpose to see whether it will throw an exception and it did throw a ConnectionErrorException
LinkPreview catches Guzzle exceptions and throws its own exception, for the sake of convenience
That's weird. I wonder if it has to do with my Guzzle version? If I just try to do a GET request with Guzzle for a YouTube link without using this library - in other words just using Guzzle itself - the script just terminates with no exceptions thrown. What version of Guzzle are you using?
@benwilkins It's in composer.json: "guzzlehttp/guzzle": "^6.1"
. Maybe your root SSL certificates are missing and your Guzzle cannot make any SSL requests at all? Having said that, it would probably still throw some exception
Also, are you 100% sure you are using the last/current version of link-preview?
When trying to get all previews for a YouTube or Vimeo URL, the request fails. It appears that the error is in Guzzle rather than your script, but perhaps there should be a way in the
canParseLink
method of theHtmlParser
to check to see if it's a YouTube or Vimeo request first before trying to parse it.Steps to reproduce (in Laravel):
Tracing this, I found that it is the
HtmlParser
that is causing the script to fail. Particularly, Guzzle dies when trying to make the request inHttpReader:93
. The same thing happens with a Vimeo URL.