Tanza3D / reddark

reddark, but it's in realtime
GNU Affero General Public License v3.0
298 stars 41 forks source link

reddark does not properly identify restricted subs #16

Open zsarge opened 1 year ago

zsarge commented 1 year ago

For the reasons outlined by the moderator u/RamsesThePigeon in this post, some subreddits are not going completely dark, but instead protesting by going restricted.

For example, r/edc announced they were going restricted in response to the unsatisfying AMA from u/spez. However, reddark still identifies them as "public", despite them joining the protest.

I think it can be debated whether it's worth making a distinction between going private and going restricted, but either way, I don't think the sub should be marked as public.

(Thanks so much for the site btw :sparkles: Such a great idea :smile:)

Tanza3D commented 1 year ago

yep, i need to add an alternate "restricted" tag or such to detect, plan to do this tomorrow morning!

Tanza3D commented 1 year ago

i've looked into it and sadly can't quite see a way to detect when they're restricted like so, will keep trying

adeleke5140 commented 1 year ago

@Tanza3D I believe that restricted subs are going private. Maybe that could help?

Tanza3D commented 1 year ago

yeah, if they go private they'll show up as privated, but if they just disable submissions and such then i can't see any way to detect that with the data i get, atleast

judge-red commented 1 year ago

I'm not a developer, so I can't offer a PR, but if I understand your code correctly, you're fetching reddit.com/r/${subreddit}.json and then built some logic to determine whether it's public or private.

IF it's what you call "public", look for subreddit_type in the json data and you'll get either public or restricted (or I think there's other types, there could be all of gold_restricted, archived, restricted, private, employees_only, gold_only, public, user - see type at https://www.reddit.com/dev/api/#POST_api_site_admin).

So this should help you improve "public" detection and add more non-private statuses, I hope.

DavidCano98 commented 1 year ago

@Tanza3D you can do GET reddit.com/r/${subreddit}/about.json instead, which has a boolean in the return data saying if the sub has restricted posting. If they are private you'll get the standard reason message, so you don't even need to do additional requests.

judge-red commented 1 year ago

@DavidCano98 Are you sure about that? r/games is not restricted, but restrict_posting is set to true in https://www.reddit.com/r/games/about.json

Meanwhile the subreddit_type in https://www.reddit.com/r/Games.json is correctly showing public, not restricted.