Added User-Agent header, still getting 405s

This commit is contained in:
A.M. Rowsell 2025-01-29 20:13:48 -05:00
parent 18dad6d922
commit cdbaa552fb
Signed by: amr
GPG key ID: 0B6E2D8375CF79A9

View file

@ -53,14 +53,16 @@ def main():
{ {
"title": str(feed.entries[0]["title"]), "title": str(feed.entries[0]["title"]),
"url": str(feed.entries[0]["link"]), "url": str(feed.entries[0]["link"]),
"timestamp": str(feed.entries[0]["published"]),
"description": getDescription(feed), "description": getDescription(feed),
"provider": "DiscoRSS", "provider": "DiscoRSS",
} }
] ],
}
customHeader = {
"User-Agent": "DiscoRSS (https://git.frzn.dev/amr/discorss.git, 0.1)"
} }
if published_time > last_check and published_time < now: 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(webhook["embeds"][0]["title"])
print(r.text, r.status_code, r.headers) print(r.text, r.status_code, r.headers)
app_config["lastupdate"] = now app_config["lastupdate"] = now