From f02cb3d8709869245c6398c7aeed8b2db26f4809 Mon Sep 17 00:00:00 2001 From: McCloudS <64094529+McCloudS@users.noreply.github.com> Date: Thu, 21 Dec 2023 08:48:40 -0700 Subject: [PATCH] Update subgen.py Added some warning messages if you try to access webhooks via GET (Browsers or wget for example) instead of how you're supposed to. Can also be used to troubleshoot network stuff a bit. --- subgen/subgen.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/subgen/subgen.py b/subgen/subgen.py index 5606452..d41e8c4 100644 --- a/subgen/subgen.py +++ b/subgen/subgen.py @@ -88,6 +88,15 @@ def convert_to_bool(in_bool): else: logging.basicConfig(stream=sys.stderr, level=logging.INFO) +@app.get("/plex") +@app.get("/webhook") +@app.get("/jellyfin") +@app.get("/asr") +@app.get("/emby") +@app.get("/detect-language") +def handle_get_request(request: Request): + return "You accessed this request incorrectly via a GET request. See https://github.com/McCloudS/subgen for proper configuration" + @app.post("/webhook") async def print_warning(): print("*** This is the legacy webhook. You need to update to webhook urls to end in plex, tautulli, or jellyfin instead of webhook. ***")