bluesky-social / social-app

The Bluesky Social application for Web, iOS, and Android
https://bsky.app
MIT License
11.8k stars 1.51k forks source link

Reddit link cards are not working correctly #6538

Open jimsimon opened 2 days ago

jimsimon commented 2 days ago

Steps to Reproduce

Full transparency: I work for Reddit :smile:

  1. Create a new post
  2. Paste almost any Reddit URL into the post (e.g. https://www.reddit.com/r/DetroitRedWings/comments/1guqp02/post_game_thread_detroit_red_wings_at_san_jose)
  3. The link card is not formatted correctly

Current link card: image

Expected link card: image

Attachments

No response

What platform(s) does this occur on?

iOS, Android, Web (Desktop), Web (Mobile)

Device Info

No response

What version of the app are you using?

Latest web version as of 11/19/2024, Android app version 1.93.0

Additional Information

I had previously reached out to @haileyok to get the appropriate user-agent being used for link previews so that we could properly allowlist and identify Bluesky's requests. The user agent I was provided was:

Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Bluesky Cardyb/1.1; +mailto:support@bsky.app) Chrome/W.X.Y.Z Safari/537.36

but after doing a ton of debugging on our end, it looks like we're getting:

web:app.bsky:v0.0.1 (by support@bsky.app)

I noticed there have been a handful of other issues opened around link previews, so I figured I'd open an issue here to hopefully resolve this where others can see the answer as well. Could we get confirmation on what the user agent should be? It's not clear if the user agent we're getting is correct or if there is some bug and it's supposed to be the one that Hailey provided. Thanks!

andresochoas commented 16 hours ago

The endpoint https://cardyb.bsky.app/v1/extract?url= is responsible for doing this. Would love to help, but I'm unable to find the source code. Any help will be welcome!

jimsimon commented 14 hours ago

I was also unable to find the source code for that endpoint after some extensive searching.

surfdude29 commented 13 hours ago

It's one of the few parts of Bluesky (the video processing service is another) that hasn't been open-sourced.