Since Microsoft doesn’t give an obvious way to download sharepoint files through their links, this needed a bit of research. The trick is to share the file (where anyone with the link can download it) and change the link manually.

At the end of the link there’s a question mark. Replace the text after the question mark to download=1

For example,

gets replaced to

Now you can use wget or curl on the link. The problem is that the filename may be wrong, so you have to specify it yourself with -O. for example,

wget -O /path/to/new/file.avi