Skip to content

Commit 0613453

Browse files
committed
Add imgur NSFW filter
1 parent 89af770 commit 0613453

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

plugins/imgur.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
# yes, it's kinda dirty, but it works :)
1414
ImgurClient.logged_in = lambda x: None
1515

16+
NO_NSFW = False
17+
1618

1719
def get_items(text):
1820
if text:
@@ -37,6 +39,9 @@ def get_items(text):
3739
reddit_search = False
3840
items = imgur_api.gallery()
3941

42+
if NO_NSFW:
43+
items = [item for item in items if not item.nsfw]
44+
4045
return items, reddit_search
4146

4247

0 commit comments

Comments
 (0)