reddark icon indicating copy to clipboard operation
reddark copied to clipboard

reddark does not properly identify restricted subs

Open zsarge opened this issue 1 year ago • 7 comments

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:)

zsarge avatar Jun 10 '23 00:06 zsarge

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

Tanza3D avatar Jun 10 '23 00:06 Tanza3D

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

Tanza3D avatar Jun 10 '23 13:06 Tanza3D

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

adeleke5140 avatar Jun 10 '23 16:06 adeleke5140

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

Tanza3D avatar Jun 10 '23 18:06 Tanza3D

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.

judge-red avatar Jun 11 '23 15:06 judge-red

@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.

DavidCano98 avatar Jun 12 '23 11:06 DavidCano98

@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.

judge-red avatar Jun 12 '23 12:06 judge-red