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

Is possible to choose when parse OG and when HTML? #45

Closed And96 closed 1 year ago

And96 commented 1 year ago

How to choose if use open Graph Parser or html or other? Some sites return wrong result

sur950 commented 1 year ago

Hi @And96

Right now there is no provision for choosing what parser you will need to use to extract metadata as I am traversing in the following order. When we get the results, Simply break the traversing and return the results.

final parsers = [
      _openGraph(document),
      _twitterCard(document),
      _jsonLdSchema(document),
      _htmlMeta(document),
      _otherParser(document),
    ];

Probably what I can do is give the flexibility to choose the order. Meaning, I will define 4-5 different orders and choose whatever order that is required. As this change is requested by very minimal people, Kindly expect some delay in accommodating the same.

Regards, Suresh

And96 commented 1 year ago

The problem is that some page dont return img and text.

Example: https://www.hdblog.it/hardware/articoli/n564801/nvidia-geforce-rtx-4090-4060-prestazioni/

While, sharing link to WhatsApp or telegram on other online service i can got both text description and image.

Any ideas why?

And96 commented 1 year ago

Confirm it dont work. It cannot decode utf8 with some sites. Solved manually parsing via external way.