]> git.aero2k.de Git - urlbot-v3.git/commitdiff
fix giphy integration
authorThorsten <mail@aero2k.de>
Mon, 27 Dec 2021 12:59:06 +0000 (13:59 +0100)
committerThorsten <mail@aero2k.de>
Mon, 27 Dec 2021 12:59:06 +0000 (13:59 +0100)
distbot/common/utils.py

index b3bac4d59f26922d49809f95e26ea69f45dedc87..c115ab9fd347723ad215f8449ccd1af2cb3df1b6 100644 (file)
@@ -59,12 +59,12 @@ def retry(ExceptionToCheck, tries=4, delay=3, backoff=2, logger=None):
 
 
 def giphy(subject, api_key):
-    url = 'http://api.giphy.com/v1/gifs/random?tag={}&api_key={}&limit=1&offset=0'.format(subject, api_key)
+    url = 'https://api.giphy.com/v1/gifs/random?tag={}&api_key={}&limit=1&offset=0'.format(subject, api_key)
     response = requests.get(url)
     giphy_url = None
     try:
         data = response.json()
-        giphy_url = data['data']['image_url']
+        giphy_url = data['data']['images']['original']['url']
     except:
         pass
     return giphy_url