reddit not pulling scraping image on link post
Asked Answered
S

1

2

On link posts, the reddit scraper is not scraping an image from my site for a thumbnail and I cannot see why. I have followed any small snippet I could find about it which basically said.

  1. Use a squareish image, less than 1.5:1 ration on the sides.
  2. make the size as small as possible.
  3. link it with the open graph protocol http://ogp.me/

I have done all of these and added this in the html with no luck, and nowhere else to turn to.

<meta property="og:image:secure_url" content="static/screenshot.png" />
Smalto answered 5/1, 2017 at 6:24 Comment(0)
C
3

If the scraping code finds an og:image, it will return the url unmodified. This url is then passed directly to _fetch_url(), which calls _initialize_request(), which ignores non-absolute urls. So, try specifying an absolute url for your image and it should work.

From a brief look at the Open Graph spec, I don't see anything about requiring absolute urls, so this might be considered a bug in reddit. It would be fairly easy to solve, since the relevant code already has access to the requested page for the purposes of setting the referrer, so you may wish to post about it on r/bugs.

Claudioclaudius answered 6/1, 2017 at 3:17 Comment(3)
thanks for the answer, it sounded promising, but unfortunately my text posts are still not showing imagesSmalto
You might need to get in contact with someone at reddit itself so they can poke at the underlying object in the database and see what's up with it.Claudioclaudius
i have the same issue but still did not find solution :(Fallon

© 2022 - 2024 — McMap. All rights reserved.