jg-l / metadata_fetch

A dart library for extracting metadata in web pages. Supports Open Graph, Meta, Twitter Cards, and Structured Data (Json-LD)
BSD 3-Clause "New" or "Revised" License
44 stars 73 forks source link

Google News link return Google News icon instead of article image #44

Open And96 opened 1 year ago

And96 commented 1 year ago

Example url: https://news.google.com/rss/articles/CBMiiwFodHRwczovL3d3dy50dXR0b21lcmNhdG93ZWIuY29tL3NlcmllLWIvc3BhbC1iYXJpLWktY29udm9jYXRpLWRpLW1pZ25hbmktb3V0LW1hdGluby1lLW1haXRhLW1hLXNvbm8tYS1kaXNwb3NpemlvbmUtaS1udW92by1hY3F1aXN0aS0xNzg3ODI10gEA?oc=5

But same for all google news url.

it return this image https://lh3.googleusercontent.com/J6_coFbogxhRI9iM864NL_liGXvsQp2AupsKei7z0cNNfDvGUmWUy20nuUhkREQyrpY4bEeIBuc=s0-w300

Whatsapp/Telegram link preview etc... return correct site article img.

metadata_fetch should allow redirect

iraycd commented 1 month ago

@And96 You should be looking for a server based solutions, not flutter or dart based solutions.

The Example URL has the open graph which is Google New URL. Screenshot 2024-10-14 at 11 18 43 AM

WhatsApp and Telegram, do this from their backend services, so they can update this. Also you need to specifically cover these use cases of redirecting. So, it has to cover all the edge cases.

My solution would be to use hybrid approach, use metadata_fetch for remaining and use server side solution for edge cases like these.