commit cf0c9d5af91d87fc3d535fe3a17e4caec0a8cb69 from: Aleksey Ryndin date: Tue Nov 07 07:17:52 2023 UTC Pass content as form-data Fix: requests.exceptions.HTTPError: 413 Client Error: Payload Too Large for url: https://honk.any-key.press/api?action=honk&<...> commit - a7533b7945437f0626003eda0df5f721ab8875c4 commit + cf0c9d5af91d87fc3d535fe3a17e4caec0a8cb69 blob - 67a7a48deaaa2fb00495fe971ca158094acf50c1 blob + 0e894836b8d9aa942337fd7d810487038c5aebd8 --- ronk.py +++ ronk.py @@ -34,8 +34,8 @@ with dbm.open(args.db, 'c') as db: a = ET.SubElement(p, 'a') a.attrib.update(href=link) a.text = item.get('title') or link - params["noise"] = ET.tostring(p, encoding="unicode") - params["noise"] += item.get("description", "").strip() - resp = honk_server.post(args.honk, params=params, timeout=10) + noise = ET.tostring(p, encoding="unicode") + noise += item.get("description", "").strip() + resp = honk_server.post(args.honk, params=params, files={"noise": (None, noise)}, timeout=10) resp.raise_for_status() db[link] = resp.text or "1"