Chatterino / api

API powering some Chatterino2 features
MIT License
38 stars 19 forks source link

Reddit previews do not work #416

Closed M4tthewDE closed 1 year ago

M4tthewDE commented 1 year ago

Example URL: https://www.reddit.com/r/AnimalCrossing/comments/10ifbfb/why_is_she_hated_she_looks_beautiful/

Reddit returns 403, I have tried removing the custom User-Agent and the error persists.

<!doctype html>
     <html>
  <head>
    <title>Blocked</title>
    <style>
      body {
          font: small verdana, arial, helvetica, sans-serif;
          width: 600px;
          margin: 0 auto;
      }

      h1 {
          height: 40px;
          background: transparent url(//www.redditstatic.com/reddit.com.header.png) no-repeat scroll top right;
      }
    </style>
  </head>
  <body>
    <h1>whoa there, pardner!</h1>

<p>reddit's awesome and all, but you may have a bit of a
problem.</p>

<p>if you're supplying an alternate User-Agent string, try changing back to default as that
can sometimes result in a block.</p>

<p>if you think that we've incorrectly blocked you or you would like to discuss
easier ways to get the data you want, please contact us at <a href=mailto:REDACTED>this email address</a>.</p>

<p>when contacting us, please include your ip address which is: <strong>REDACTED</strong> and reddit account</p>
  </body>
</html>

This seems to be due to reddit picking up golangs http client as malicious. There is a hacky workaround referenced in this reddit comment which disables http2 as a "solution".

pajlada commented 1 year ago

I imagine using reddit's API would be an alternative fix for this

M4tthewDE commented 1 year ago

It sadly seems like the official reddit API is also affected by the issue, as can be seen in the parent post of the comment.

zneix commented 1 year ago

Seems like Reddit previews have randomly got fixed(?) feel free to reopen if it occurs again reddit link preview