Posted on 06-01-2017 10:26 AM
Hoping someone can help. Trying to write a script to download the latest version of Microsoft Teams for OS X. Using the following URL in Safari reveals the download location. However, using CURL does not. Anyone have any insight on how to retrieve the download path with CURL?
https://teams.microsoft.com/downloads/DesktopUrl?env=production&plat=osx&arch=64
Solved! Go to Solution.
Posted on 06-01-2017 10:51 AM
Try this. It seems to need to be surrounded in double quotes.
echo $(curl -s "https://teams.microsoft.com/downloads/DesktopUrl?env=production&plat=osx&arch=64")
The above produces this for me:
https://statics.teams.microsoft.com/production-osx/1.0.00.14454/Teams_osx.dmg
I can then curl against that to get info on size and other details, or just download it
curl -sI https://statics.teams.microsoft.com/production-osx/1.0.00.14454/Teams_osx.dmg
Putting some of the above together with a few other items
#!/bin/sh
TeamsURL="https://teams.microsoft.com/downloads/DesktopUrl?env=production&plat=osx&arch=64"
## Get the actual download URL
DownloadURL=$(curl -s "$TeamsURL")
## Extract the DMG Name from the path
DMGName="${DownloadURL##*/}"
## Download the DMG into /tmp/
curl -s "$DownloadURL" -o "/tmp/$DMGName"
I'll leave the rest to you to work out how to mount it and install it if that's what you were looking to do.
Posted on 06-01-2017 10:51 AM
Try this. It seems to need to be surrounded in double quotes.
echo $(curl -s "https://teams.microsoft.com/downloads/DesktopUrl?env=production&plat=osx&arch=64")
The above produces this for me:
https://statics.teams.microsoft.com/production-osx/1.0.00.14454/Teams_osx.dmg
I can then curl against that to get info on size and other details, or just download it
curl -sI https://statics.teams.microsoft.com/production-osx/1.0.00.14454/Teams_osx.dmg
Putting some of the above together with a few other items
#!/bin/sh
TeamsURL="https://teams.microsoft.com/downloads/DesktopUrl?env=production&plat=osx&arch=64"
## Get the actual download URL
DownloadURL=$(curl -s "$TeamsURL")
## Extract the DMG Name from the path
DMGName="${DownloadURL##*/}"
## Download the DMG into /tmp/
curl -s "$DownloadURL" -o "/tmp/$DMGName"
I'll leave the rest to you to work out how to mount it and install it if that's what you were looking to do.
Posted on 06-01-2017 11:31 AM
Now I just feel stupid. Thanks.
Posted on 06-01-2017 11:42 AM
Don't forget to check package and app signatures.