This commit is contained in:
Aevann1 2021-10-12 07:23:17 +02:00
parent 05696a6aef
commit 49c399b66a
10 changed files with 28 additions and 28 deletions

View file

@ -11,7 +11,7 @@ GIPHY_KEY = environ.get('GIPHY_KEY').rstrip()
@app.get("/giphy<path>")
def giphy(path=None):
searchTerm = request.values.get("searchTerm", "")
searchTerm = request.values.get("searchTerm", "").strip()
limit = int(request.values.get("limit", 48))
if searchTerm and limit:
url = f"https://api.giphy.com/v1/gifs/search?q={searchTerm}&api_key={GIPHY_KEY}&limit={limit}"