Changing random.dog to a different API

This commit is contained in:
ein 2021-01-28 10:20:52 -08:00
parent e654bdfcd3
commit 769d497be5

View File

@ -28,10 +28,8 @@ def random_sheeb():
def random_dog(): def random_dog():
dog_url = None dog_url = None
while not dog_url: while not dog_url:
dog_url = requests.get('https://random.dog/woof').text dog_url = requests.get('https://dog.ceo/api/breeds/image/random').json()['message']
if 'mp4' in dog_url[-3:]: return dog_url
dog_url = None
return "https://random.dog/{}".format(dog_url)
def random_bird(): def random_bird():
bird = None bird = None