I had a bat file which downloaded my iCloud calendar every hour. the link used was found via the iCloud site (the calendar is public shared). It has an webcal:// url but according to Apple's support you have to change this to http.
Using explorer of chrome, this file does not download. In Chrome: {"reason":"Invalid or missing Origin header","error":1} In Explorer: file seems to start, but then it says: "can't download ..."
My bat file:
@echo off
powershell -Command "(New-Object Net.WebClient).DownloadFile('http://p20-calendarws.icloud.com/ca/subscribe/1/...', 'D:\Backup\cal.ics')"
pause
The code above gives me:
Exception calling "downloadfile" with "2" arguments: the remote server returned an error: 421 misdirected request.
This used to work fine, not anymore it seems.
Any thoughts? Anyone else doing something similar?
Tried replacing http with https, but no luck. Searching if iCloud made some changes didn't turn up any results.
I found a solution to this issue that worked for me.
I had some calendars that had the error
{"reason":"Invalid or missing Origin header","error":1}
and some that didn't. Then I noticed that the ones that I could download without any trouble started with 'webcal://p05-' while those that had the error started with 'webcal://p45-'. So I simply unticked Public Calendar and clicked OK before selecting the calendar again and ticking Public Calendar. If that generates a URL starting with 'webcal://p45-', copy it to the browser and try downloading it, if not, try again until you get the right URL.