I'm using PRAW to scrape for some content from reddit. I can get info on a submission (praw.objects.Submission), but I don't see from the documentation how to tell if the post is flagged as NSFW or not. Is it possible to figure this out through PRAW or should I use another api wrapper?
You may figure it out through PRAW by retrieving a submission object, and then applying over_18
to the object itself (as @Kevin suggested).
Here's an example:
if submission.over_18:
...
else:
...
And for future references, by using "dir(object)," you'll be able to see both attributes and methods that pertain to the Reddit API (which you may use to test and see all properties that effect the given object being tested). You can ignore everything that starts with an underscore (most likely).
Or you can go straight to source where PRAW is getting its data. The variable names are not set by PRAW, they come from this JSON (linked above).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With