mirror of
https://github.com/jaxperro/winning-wallet-finder.git
synced 2026-07-27 15:57:47 +00:00
webhook_receiver: add User-Agent to Discord POST (Discord 403s default urllib UA)
This commit is contained in:
+2
-1
@@ -74,7 +74,8 @@ def post_discord(content):
|
||||
try:
|
||||
body = json.dumps({"content": content}).encode()
|
||||
req = urllib.request.Request(WEBHOOK, data=body, method="POST",
|
||||
headers={"Content-Type": "application/json"})
|
||||
headers={"Content-Type": "application/json",
|
||||
"User-Agent": "Mozilla/5.0"}) # Discord 403s default UA
|
||||
urllib.request.urlopen(req, timeout=10, context=SSL_CTX).read()
|
||||
except (urllib.error.URLError, TimeoutError):
|
||||
log("⚠ Discord post failed")
|
||||
|
||||
Reference in New Issue
Block a user