Wget – ICS Calendar File Does Not Exist Error

calendarwget

I'm trying to load this calendar:
https://bushnellbeacons.com/calendar.ics
to another internal websystem. The calendar feed is fine – I can click the link above and download the feed. The problem is that other site gives a generic error "Feed could not be found".

Doing some investigation, if I download the ICS file in my browser, then upload it on another webserver, I have no problem adding that URL to the target calendar system. My working theory is that server one generates the ICS file when the browser requests it, but server two is trying to grab a file that has not yet been generated. This question isn't about the target calendar system/server and troubleshooting it.

My proposed solution right now is to regularly use wget in a cron script on a server two to grab the file. Unfortunately, wget produces:

HTTP request sent, awaiting response... 404 Not Found
2021-11-01 17:13:20 ERROR 404: Not Found.

Interestingly enough, PowerShell can do an Invoke-WebRequest https://bushnellbeacons.com/calendar.ics and returns something that looks like a calendar feed:


StatusCode        : 200
StatusDescription : OK
Content           : BEGIN:VCALENDAR
                    VERSION:2.0
                    PRODID:-//SIDEARM Sports//NONSGML SIDEARM//EN
                    X-WR-CALNAME: Athletics
                    X-PUBLISHED-TTL:PT120M
                    BEGIN:VEVENT
                    UID:vcal_4644-bushnellbeacons.com
                    DTSTAMP:20211102T001441Z...
RawContent        : HTTP/1.1 200 OK
                    Strict-Transport-Security: max-age=0;
                    X-Content-Type-Options: nosniff
                    X-XSS-Protection: 1; mode=block
                    Referrer-Policy: no-referrer-when-downgrade
                    Content-Length: 113757
                    Cache-Con...
Forms             : {}
Headers           : {[Strict-Transport-Security, max-age=0;], [X-Content-Type-Options, nosniff], [X-XSS-Protection, 1;
                    mode=block], [Referrer-Policy, no-referrer-when-downgrade]...}
Images            : {}
InputFields       : {}
Links             : {}
ParsedHtml        : mshtml.HTMLDocumentClass
RawContentLength  : 113757

My questions are:

  • Is there a way to get wget perform the web request that seems to generate the ICS file? (like powershell appears to be doing)
  • Is there a more elegant solution?

Thank you! I'm happy to clarify as needed.

Best Answer

wget -U 'Mozilla/4.0' https://bushnellbeacons.com/calendar.ics

You're welcome.

Related Topic