Added User-Agent header, still getting 405s
This commit is contained in:
parent
18dad6d922
commit
cdbaa552fb
1 changed files with 5 additions and 3 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue