From f175e6e52481cdd5d6513a64fd7b8605decab6bb Mon Sep 17 00:00:00 2001 From: Heru J Date: Mon, 19 Apr 2021 21:11:42 -0400 Subject: [PATCH] Key passed in not working bug fix --- cocktaildb/cocktaildb.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocktaildb/cocktaildb.py b/cocktaildb/cocktaildb.py index a7061de..68effdf 100644 --- a/cocktaildb/cocktaildb.py +++ b/cocktaildb/cocktaildb.py @@ -25,7 +25,7 @@ async def glasses(key: str = None): # Returns a list of glasses key = key or 1 - category_url = 'www.thecocktaildb.com/api/json/v1/1/list.php?g=list' + category_url = f'www.thecocktaildb.com/api/json/v1/{key}/list.php?g=list' data_glasses = await Reqs.get(category_url) l = [glasses['strGlass'] for glasses in data_glasses['drinks']] @@ -36,7 +36,7 @@ async def ingredients(key: str = None): # Returns a list of ingredients key = key or 1 - ingrs_url = 'https://www.thecocktaildb.com/api/json/v1/1/list.php?i=list' + ingrs_url = f'https://www.thecocktaildb.com/api/json/v1/{key}/list.php?i=list' data_ingrs = await Reqs.get(ingrs_url) l = [ingrs['strIngredient1'] for ingrs in data_ingrs['drinks']]