diff --git a/files/routes/__init__.py b/files/routes/__init__.py index 3af165546..d24a74ee3 100644 --- a/files/routes/__init__.py +++ b/files/routes/__init__.py @@ -15,7 +15,6 @@ from .users import * from .votes import * from .feeds import * from .awards import * -from .giphy import * from .volunteer import * if app.debug: from .dev import * diff --git a/files/routes/giphy.py b/files/routes/giphy.py deleted file mode 100644 index e89951689..000000000 --- a/files/routes/giphy.py +++ /dev/null @@ -1,24 +0,0 @@ -from flask import * -from os import environ -import requests -from files.helpers.wrappers import * - -from files.__main__ import app - -GIPHY_KEY = environ.get('GIPHY_KEY').rstrip() - - -@app.get("/giphy") -@app.get("/giphy") -@auth_required -def giphy(v=None, path=None): - - 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}" - elif searchTerm and not limit: - url = f"https://api.giphy.com/v1/gifs/search?q={searchTerm}&api_key={GIPHY_KEY}&limit=48" - else: - url = f"https://api.giphy.com/v1/gifs?api_key={GIPHY_KEY}&limit=48" - return jsonify(requests.get(url, timeout=5).json()) diff --git a/files/routes/posts.py b/files/routes/posts.py index 4d6f8bb8c..8f05f0bc5 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -618,7 +618,6 @@ def thumbnail_thread(pid): @app.post("/is_repost") def api_is_repost(): - url = request.values.get('url') if not url: abort(400)