Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

reddit badge returning "private" when subreddit is actually public #9817

Open
ReenigneArcher opened this issue Dec 17, 2023 · 6 comments
Open
Labels
question Support questions, usage questions, unconfirmed bugs, discussions, ideas

Comments

@ReenigneArcher
Copy link

Are you experiencing an issue with...

shields.io

馃悶 Description

I was asked to open a new issue in #9256

For the past week or so, reddit badge says my subreddit is private even though it is public.

image

image

馃敆 Link to the badge

https://img.shields.io/reddit/subreddit-subscribers/lizardbyte?labelColor=FF4500&color=FF4500&logoColor=ffffff&label=Reddit&style=for-the-badge&logo=reddit

馃挕 Possible Solution

No response

@ReenigneArcher ReenigneArcher added the question Support questions, usage questions, unconfirmed bugs, discussions, ideas label Dec 17, 2023
Copy link
Contributor

Badge tested using npm run badge https://img.shields.io/reddit/subreddit-subscribers/lizardbyte?labelColor=FF4500&color=FF4500&logoColor=ffffff&label=Reddit&style=for-the-badge&logo=reddit
Output is available here

@chris48s
Copy link
Member

OK. This is interesting.

In production, all (non-cached) badges seem to be returning this subreddit is private error.

Locally, I get a response from https://www.reddit.com/r/lizardbyte/about.json just fine and the badge renders.

Staging and CI. Also getting the 403. The response body is:

<!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>Your request has been blocked due to a network policy.</p>

<p>Try logging in or creating an account <a href=https://www.reddit.com/login/>here</a> to get back to browsing.</p>

<p>If you're running a script or application, please register or sign in with your developer credentials <a href=https://www.reddit.com/wiki/api/>here</a>. Additionally make sure your User-Agent is not empty and is something unique and descriptive and try again. if you're supplying an alternate User-Agent string,
try changing back to default as that can sometimes result in a block.</p>

<p>You can read Reddit's Terms of Service <a href=https://www.reddit.com/wiki/api/>here</a>.</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 file a ticket <a href=https://support.reddithelp.com/hc/en-us/requests/new?ticket_form_id=21879292693140>here</a>.</p>

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

So it looks like we are explicitly being blocked, probably by IPs rather than user-agent as I have a shields user agent set locally.

Up to 5 days ago, we were seeing 429 calling https://www.reddit.com being logged but that has stopped.

So.. looks like this is probably related to #9256 (sorry - you were right first time). We'll need to implement auth to fix.

@ReenigneArcher
Copy link
Author

Interesting... I also cannot access this URL from a GitHub runner.

@chris48s
Copy link
Member

Yep - same for us. Staging and CI/GH actions also blocked

@chris48s
Copy link
Member

I filled in https://reddithelp.com/hc/en-us/requests/new?ticket_form_id=14868593862164 requesting either an API key or an unban. I linked to this issue and #9256

We'll see where it goes.

@ReenigneArcher
Copy link
Author

I have a reddit bot written in Python which uses PRAW.

I was able to create my own application and authenticate to that, without any support ticket.

https://praw.readthedocs.io/en/stable/getting_started/authentication.html

I definitely am not making as many API requests as Shields would though, so not sure how that would affect everything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Support questions, usage questions, unconfirmed bugs, discussions, ideas
Projects
None yet
Development

No branches or pull requests

3 participants
@chris48s @ReenigneArcher and others