meyt / linkpreview

Get link preview in python
MIT License
46 stars 9 forks source link

Add serializer #20

Closed narayanan-ka closed 1 year ago

narayanan-ka commented 1 year ago

Its a great package @meyt. Thanks. I;m trying to integrate this to my django app and facing issues. If you could help? https://stackoverflow.com/questions/76818922/typeerror-object-of-type-linkpreview-is-not-json-serializable

meyt commented 1 year ago

Thanks @narayanan-ka, Please update to v0.7.0, I've added a serializer method.

Based on your question, you should use it like this:


...

return Response(link_preview(link).to_dict(), status=status.HTTP_200_OK)

...
narayanan-ka commented 1 year ago
meyt commented 1 year ago

@narayanan-ka services like Peekalink do a lot of stuff to get the preview. things like full browser render is overkill. what is next? generate the preview by using AI?! site owners must take care of right meta tags.

about the twitter (X🤡) and most of websites use bot user-agents.

narayanan-ka commented 1 year ago

Understood.