mirror of
https://github.com/misiektoja/instagram_monitor.git
synced 2026-04-25 22:35:49 +03:00
[GH-ISSUE #51] Webhook Enhancement Request #39
Labels
No labels
Stale
Stale
bug
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/instagram_monitor#39
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @tomballgithub on GitHub (Jan 22, 2026).
Original GitHub issue: https://github.com/misiektoja/instagram_monitor/issues/51
I'd work on a PR, but I don't even know how to approach this.
Is there a way to make the WEBHOOK support more configurable? Right now, it's very focused on discord.
For instance, here are two method of using NTFY via webhooks (examples from the official documentation):
Would need a method to configure the URL and use GET
requests.get("https://ntfy.sh/mywebhook/publish?message=Webhook+triggered&priority=high&tags=warning,skull")Would need a method to configure the payload and use POST
I use custom code to do NTFY alerts, but I'd prefer to use your official mechanism, especially if you end up taking this and putting it into your other utilities next (any tool that sends email alerts).
@misiektoja commented on GitHub (Jan 22, 2026):
Yes, right now we are tied to Discord's specific implementation. To support other services properly, we would need a generic webhook mode where the user can define the template of the payload and switch between GET and POST.
@tomballgithub commented on GitHub (Jan 24, 2026):
Developed a PR that works with --send-test-webhook
Need to test it in normal operation
@misiektoja commented on GitHub (Jan 25, 2026):
Cool, looking forward to it!
@tomballgithub commented on GitHub (Jan 25, 2026):
Submitted #56
@tomballgithub commented on GitHub (Jan 26, 2026):
The new feature is working well for me with NTFY both for updates and errors (account was flagged overnight)
Note for release is that it's a breaking change from the last release for anyone using the webhook feature. They need to update their configuration file with the default Discord information.
@Sha-Dox Can you test this out since you implemented the Discord webhook feature? It's in the Dev branch.
@tomballgithub commented on GitHub (Jan 26, 2026):
I've seen this twice now. I'm not sure if it's something with the code under certain situations or if it's something else.
I am restarting to see if it reproduces under same situation/changes.
* Error sending webhook: HTTPSConnectionPool(host='ntfy.sh', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLEOFError(8, '[SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1081)')))@Sha-Dox commented on GitHub (Jan 26, 2026):
@tomballgithub hi, I sadly cannot test it out as discord is sadly banned in my country but I'll se what I can do
@tomballgithub commented on GitHub (Jan 26, 2026):
OK, for the PR, I created a server and channel and tested it, but I don't know all of the nuances to this.
And if I run NTFY, I cannot also run DISCORD as a compare.
@tomballgithub commented on GitHub (Jan 26, 2026):
On the SSL Error above, I reran and got the same email content as last time (order of the added followings was different), but the webhook didn't get the SSL error above. That indicates to me that it's not something in the payload or request that is causing this (weird character in header or body, etc)
At a minimum, feels like we need our own wait/retry loop because that retry warning seems to be coming from requests.
@misiektoja commented on GitHub (Jan 26, 2026):
These are some strange transient connection issues. I implemented a simple retry mechanism that attempts connection up to three times and added a user agent (not sure if it will help, but it shouldn't cause any harm). Let me know if it made it any better.
@tomballgithub commented on GitHub (Jan 27, 2026):
Great. I see it. I will likely hack the code to brute force the payload that failed and just repeat the webhook sending on a loop and see what happens
@tomballgithub commented on GitHub (Jan 27, 2026):
I updated send_webhook and then uses the test webhook command line argument to run 100 cycles, which I did > out.txt to capture the output
There were no errors but then I noticed that at some point I started to see tests that didn't make it past the "final_headers" line, indicating that the code didn't make it past the 'request' execution. But there were also no exception messages (and I verified that each one prints a message) or errors on the screen
I am rerunning without the try/catch and not redirecting to a file.
@misiektoja commented on GitHub (Jan 29, 2026):
It looks like the SSL error is still happening, but the new retry logic is successfully catching it and trying again in the background. Because the retries are silent (no print unless in debug mode) and likely running in parallel threads, the logs look like the script is skipping tests or hanging.
To verify this, you can temporarily change the debug_print inside send_webhook to a regular print to see the failures as they happen:
This will confirm if those missing log sections are actually just failed attempts that are currently waiting to retry.
@tomballgithub commented on GitHub (Jan 30, 2026):
Assumed fixed. I'll reopen if observed again.