Still debugging errors, seems to be json encoding issue?
This commit is contained in:
parent
35c3e11b6e
commit
38e78bcdf4
1 changed files with 8 additions and 4 deletions
12
discorss.py
12
discorss.py
|
@ -59,15 +59,19 @@ def main():
|
||||||
"description": getDescription(feed),
|
"description": getDescription(feed),
|
||||||
"provider": "DiscoRSS",
|
"provider": "DiscoRSS",
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
customHeader = {
|
customHeader = {
|
||||||
"User-Agent": "DiscoRSS (https://git.frzn.dev/amr/discorss.git, 0.1)"
|
"user-agent": "DiscoRSS (https://git.frzn.dev/amr/discorss, 0.1)",
|
||||||
|
"content-type": "application/json",
|
||||||
}
|
}
|
||||||
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, headers=customHeader)
|
print(json.dumps(webhook))
|
||||||
|
r = requests.post(
|
||||||
|
hook["webhook"], data=json.dumps(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.json())
|
||||||
app_config["lastupdate"] = now
|
app_config["lastupdate"] = now
|
||||||
with open(config_file_path, "w") as config_file:
|
with open(config_file_path, "w") as config_file:
|
||||||
json.dump(app_config, config_file, indent=4)
|
json.dump(app_config, config_file, indent=4)
|
||||||
|
|
Loading…
Add table
Reference in a new issue