sur950 / any_link_preview

A flutter Plugin/Package to show the preview of any web link that starts with HTTP/HTTPS. Mostly useful for application that had chat.
MIT License
70 stars 70 forks source link

Some urls could not be parsed #63

Closed hungcaovn closed 5 months ago

hungcaovn commented 9 months ago

I got "Unable to parse the url" message for several urls. It works well on Facebook but not with our library. This is an example: https://www.nationalgeographic.com/animals

image
cmerchant commented 5 months ago

Same issue here

cmerchant commented 5 months ago

Looks like we get this message when the url doesn't have a description. In this case, the code uses the default errorBody shown above. Here is the code,

https://github.com/sur950/any_link_preview/blob/de948f8a2d524f2c412e1b165372bfbba4c872ff/lib/src/helpers/link_preview.dart#L334-L336

My work around here is passing a more descriptive error body into the constructor, AnyLinkPreview( link: linkText, errorBody: "No description available", )

hungcaovn commented 5 months ago

Looks like we get this message when the url doesn't have a description. In this case, the code uses the default errorBody shown above. Here is the code,

https://github.com/sur950/any_link_preview/blob/de948f8a2d524f2c412e1b165372bfbba4c872ff/lib/src/helpers/link_preview.dart#L334-L336

My work around here is passing a more descriptive error body into the constructor, AnyLinkPreview( link: linkText, errorBody: "No description available", )

Yeah I am using the same workaround

sur950 commented 5 months ago

Hi @hungcaovn & @cmerchant

I have verified the link shared above, but I don't see the description metadata available for the shared link.

Screenshot 2024-04-08 at 5 09 24 PM

The plugin is working as expected, Feel free to log a new bug or reopen this one if you find there's issue with the plugin. Thank-you for using it, Keep supporting :)