Comments (13)
Probably, the Discord webhook has this curl command : https://birdie0.github.io/discord-webhooks-guide/tools/curl.html and an example:
url='https://discordapp.com/api/webhooks/"203019812404264973/rptBmYgoehu70kw2rItSlhRqKi7kMJh1bM2KCUUD2vR6grZckvtdl62h4xR7XWUS5463'
curl -H "Content-Type: application/json" \
-X POST \
-d '{"username": "test", "content": "hello"}' $url
which is pretty similar to to my Telegram command:
curl --silent --request POST "${notification_url}" \
--data chat_id="${telegram_chat_id}" \
--data parse_mode="markdown" \
--data text="${2}"
My Webhooks one would probably look like:
notification_url='https://discordapp.com/api/webhooks/"203019812404264973/rptBmYgoehu70kw2rItSlhRqKi7kMJh1bM2KCUUD2vR6grZckvtdl62h4xR7XWUS5463'
curl --silent --request POST "${notification_url}" \
--data username="${webhook_username}" \
--data content="${2}"
I don't have a webhooks notification system I can test with though... To be honest, I don't even know if the PushBullet notification method works coz I don't have that either, but it looks like it should as the API is pretty much the same lol.
What webhooks service in particular are you using?
from docker-icloudpd.
I'm using Home Assistant as a notifier service that would generate the webhook which would then send a notification to my phone depending on the message json payload passed from icloud-pd.
If it helps, I think i used the pushbullet notification previously and pretty sure it was working good!
from docker-icloudpd.
Hi,
I've just pushed a new version that has untested Webhook support. It probably won't work as I'm unsure of the format of the data that I should be sending.
I've found this link which suggests it should be formatted as:
curl --request POST \
--url http://HomeAsisstant:8123/api/webhook/MyWebhookID\
--header 'content-type: application/json' \
--data '{
"data":"Forwarded"
}'
So I've just imitated this, but changed "Forwarded" to the message I send via Telegram.
Give it a test and let me know what you find.
from docker-icloudpd.
Thanks so much for this, I've pulled the new image and updated my compose, just a couple of questions, should the host ip address be the full http://HomeAsisstant:8123/api/webhook/MyWebhookID
or just the host ip and the port as I specify the webhook id separately.
from docker-icloudpd.
Host IP is just the IP address, nothing else... You could put the hostname of the computer in it if you like... in fact, I’ll rename that variable to webhook_server in the next push, I’ll sort that tonight.
I’ll also add a webhook_port variable just in case people run on non-default.
I combine the webhook_https, host_ip_address and webhook_id variable to generate the server’s URL.
from docker-icloudpd.
I've pushed this to Dockerhub now. The variables it uses for the webhooks URL are now:
webhook_server
webhook_port
webhook_id
webhook_https (if set True webhook_scheme=https, otherwise webhook_scheme=http)
It puts them all together to generate the notification URL like this:
notification_url="${webhook_scheme}://${webhook_server}:${webhook_port}/api/webhook/${webhook_id}"
Let me know how you get on and I'll either update again, or close the issue.
Thanks.
from docker-icloudpd.
I've pulled the latest image but I get the following in the logs
020-05-28 14:28:56 WARNING Webhook notifications enabled, but API key/token not set - disabling notifications
My compose looks like this?
- notification_days=14
- webhook_server=192.168.68.110
- webhook_port=8123
- webhook_id=VCyx4YOljF0apiIEK3Gu7ssWj9hSDT9T
- webhook_https=false
- synchronisation_interval=43200
Have I gone wrong somewhere?
from docker-icloudpd.
My mistake. There was an additional check when configuring notifications that I had missed. I've updated and pushed to Dockerhub again.
from docker-icloudpd.
That worked! Thanks so much again, the message is being passed to home assistant so now I just need to configure the payload in my notification on my phone
from docker-icloudpd.
No worries. I use some emoji characters in it which may not be translated well on the receiving system.
If you need me to amend the message, then just reply back here.
from docker-icloudpd.
That would be amazing if you could, this character ↵ is causing some issues?
from docker-icloudpd.
and the backslashes and carriage return?
from docker-icloudpd.
I've removed those all. That's going to make the downloaded/deleted files previews look a little weird. Let me know if you need those removing too.
from docker-icloudpd.
Related Issues (20)
- Permission Denied HOT 2
- Failed check for new files files Failed to execute script 'icloudpd' due to unhandled exception! HOT 3
- Error: Invalid value for '-d' / '--directory': Path '/home/apps/iCloud' is not readable HOT 3
- Docker compose setup
- Telegram Bot has not been initialised or needs reinitialising HOT 2
- auto_delete not deleting photos HOT 4
- icloud.com.cn : Failed to download new files HOT 13
- Error debug - traceroute: bad address 'icloud.com.cn' HOT 1
- Remote Re-authentication error HOT 8
- Connection error in the log HOT 2
- Telegram support for multiple docker containers HOT 1
- Container Not Downloading (No Errors) HOT 1
- error HOT 2
- Error: Invalid value for '-d' / '--directory': Path is not readable HOT 2
- Failed to execute script 'icloud' due to unhandled exception! HOT 5
- Update broke .mounted file HOT 1
- 'tzlocal() does not support non-zoneinfo timezones
- These log messages indicate errors that occurred while attempting to log in to iCloud, including an invalid email/password combination, as well as the inability to find the stored password in the system's keychain. The fact is that the password is entirely correct, and the login attempts are being made in China. Despite numerous attempts, the issue remains unresolved. HOT 4
- how to use reauth.sh now HOT 1
- using folder in icloud HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-icloudpd.