question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

praw/praw/models/reddit/subreddit.py/ missing feature

See original GitHub issue

Issue Description

Class: Subreddit function: search() Parameter include_over_18 is missing which allows the search to show NSFW submissions in the result.

System Information

  • PRAW Version: latest (6.0.0)
  • Python Version: 3.6.5
  • Operating System: Win10 x64

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jarhill0commented, Jan 18, 2019

I’m closing this as already supported. As I said above, when there is a user context, the setting is ignored. However, it is not ignored when there is no user context, and it works as intended. See this example:

In [1]: import praw

In [2]: reddit = praw.Reddit(user_agent='search test', client_id='<REDACTED>, client_secret='<REDACTED>')

In [3]: reddit.read_only
Out[3]: True

In [4]: subreddit = reddit.subreddit('gonewilder')

In [5]: for post in subreddit.search('a', limit=5):
   ...:     print(post.title)
   ...:     

In [6]: for post in subreddit.search('a', limit=5, params={'include_over_18': 'on'}):
   ...:     print(post.title)
   ...:     
Hot a[m]ateur gangbanged in first scene ever!
Stud takes a smoke break during 🔥 threesome.
Any ladies like a little licking?
I've made a white sticky [m]ess
The look that says "Come ride this face like a blazing saddle"

In [7]: for post in subreddit.search('a', limit=5, params={'include_over_18': 'off'}):
   ...:     print(post.title)
   ...:     

This feature is indeed supported as params={'include_over_18': 'on'}.

1reaction
jarhill0commented, Jan 7, 2019

Not neccessarily. I was trying to add more information. I’m not sure whether what @MichaelSaah suggests is possible.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found