83 lines
1.9 KiB
Python
83 lines
1.9 KiB
Python
import random
|
|
import requests
|
|
|
|
import get_from_reddit
|
|
from pybooru import Danbooru
|
|
|
|
|
|
def get_from_danbooru(boards):
|
|
"""
|
|
get_from_danbooru(boards)
|
|
|
|
returns a URL to an image on danbooru that matches a random tag
|
|
defined in the tag_list list
|
|
"""
|
|
booru = Danbooru('danbooru')
|
|
tag_list = [
|
|
'1girl',
|
|
'2girls',
|
|
'ass_visible_through_thighs',
|
|
'bare_legs'
|
|
'bikini',
|
|
'black_bikini',
|
|
'black_panties',
|
|
'blue_eyes',
|
|
'bra_pull',
|
|
'bra',
|
|
'breasts',
|
|
'cameltoe',
|
|
'clevage',
|
|
'condom_in_mouth',
|
|
'condom',
|
|
'from_below',
|
|
'gloves',
|
|
'highleg_bikini',
|
|
'highleg',
|
|
'highres',
|
|
'horns',
|
|
'large_breasts',
|
|
'leash',
|
|
'medium_breasts'
|
|
'miniskirt',
|
|
'nier_automata',
|
|
'nier',
|
|
'nipples',
|
|
'partially_visible_vulva',
|
|
'pencil_skirt',
|
|
'pussy_juice',
|
|
'pussy',
|
|
'skirt',
|
|
'small_breasts',
|
|
'thong_bikini',
|
|
'topless',
|
|
'wet_clothes',
|
|
'wet_panties',
|
|
'wet',
|
|
]
|
|
|
|
tag = random.choice(tag_list)
|
|
return "https://danbooru.donmai.us{}".format(
|
|
random.choice(
|
|
booru.post_list(
|
|
limit=500,
|
|
tags=tag,
|
|
random=True,
|
|
)
|
|
)['large_file_url'])
|
|
|
|
|
|
def get_lewd(channel_name):
|
|
if 'nsfw' in channel_name:
|
|
boards = [
|
|
'2Booty',
|
|
'bakunyuu_hentai',
|
|
'ecchi',
|
|
'hentai',
|
|
'rule34',
|
|
'WesternHentai',
|
|
]
|
|
|
|
# This is really bad practice but pass boards to get_from_reddit AND danbooru so it doesnt error
|
|
return random.choice([get_from_reddit.get_image, get_from_danbooru])(boards=boards)
|
|
return 'You can only use this command in NSFW channels'
|