Skip to content

Commit

Permalink
Update subgen.py
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
McCloudS authored Dec 21, 2023
1 parent d9e924f commit f02cb3d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions subgen/subgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -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. ***")
Expand Down

0 comments on commit f02cb3d

Please sign in to comment.