From 254f0f6179bd9f57a3828515699e59c5c3a1bcc7 Mon Sep 17 00:00:00 2001 From: ein Date: Thu, 28 Jan 2021 10:20:52 -0800 Subject: [PATCH] Changing random.dog to a different API --- app/animals.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/animals.py b/app/animals.py index 3fc98819..4824b763 100644 --- a/app/animals.py +++ b/app/animals.py @@ -28,10 +28,8 @@ def random_sheeb(): def random_dog(): dog_url = None while not dog_url: - dog_url = requests.get('https://random.dog/woof').text - if 'mp4' in dog_url[-3:]: - dog_url = None - return "https://random.dog/{}".format(dog_url) + dog_url = requests.get('https://dog.ceo/api/breeds/image/random').json()['message'] + return dog_url def random_bird(): bird = None