From cdbaa552fb5a75fee01618f3ee49f9f06adb57df Mon Sep 17 00:00:00 2001 From: "A.M. Rowsell" Date: Wed, 29 Jan 2025 20:13:48 -0500 Subject: [PATCH] Added User-Agent header, still getting 405s --- discorss.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/discorss.py b/discorss.py index 683ea55..9dc64b1 100755 --- a/discorss.py +++ b/discorss.py @@ -53,14 +53,16 @@ def main(): { "title": str(feed.entries[0]["title"]), "url": str(feed.entries[0]["link"]), - "timestamp": str(feed.entries[0]["published"]), "description": getDescription(feed), "provider": "DiscoRSS", } - ] + ], + } + customHeader = { + "User-Agent": "DiscoRSS (https://git.frzn.dev/amr/discorss.git, 0.1)" } if published_time > last_check and published_time < now: - r = requests.post(hook["webhook"], json=webhook) + r = requests.post(hook["webhook"], json=webhook, headers=customHeader) print(webhook["embeds"][0]["title"]) print(r.text, r.status_code, r.headers) app_config["lastupdate"] = now