How do I download a publicly shared OneDrive file?

How do I download a publicly shared file (e.g., this)? Preferably without logging in.

I guess you are looking for rclone copyurl

Example:

rclone copyurl --progress "https://onedrive.live.com/?authkey=%21AOaPhONxGCKIlrg&cid=910FC0C1DD8E9B39&id=910FC0C1DD8E9B39%21163&parId=910FC0C1DD8E9B39%21104&o=OneUp" ./your/folder/yourFileName

Does this actually work for you? For me, it just download an HTML page.

You are right, my mistake. You need to use the URL of the video, like this:

rclone copyurl --progress "https://public.db.files.1drv.com/y4mly6m6H2Y0vfzsXvzIY30bn5_JW3f-3YI633g2oft1mvlxCX9ARgoOBt7KR4Sogcojl9l1qJZKqeDwYeUiFNUvaRh0FXKoCkCdcIy_lEpzJOMVGqKRxd-JpZbxwF7QqNGDvYVFA6_cixAFGkL3pvzbdlastQZ8xvfHPvRHVKSuqfe1pbETsgTmCT6or-tGzHYr8JUatmEsf_JWoFr8i7AbfRzYHiaNQgMr2mbVVVim2Y?" ./your/folder/yourFileName

I found it by doing a right click and then "Copy video address" on the video in Google Chrome (Windows).

Any reason why you aren't just using the download option on the OneDrive webpage, or right click on the video and then "save video as"?

I want to automate downloading a batch of OneDrive files. So opening the browser is useless.

I guess that will require some very clever scripting.

The URL to the video doesn't seem to be present in the HTML page, so somebody need to reverse engineer the javascript used by OneDrive to check if it it is possibly find a way to load the right resource and then extract the URL from it. This goes beyond the time that I am prepared to invest.

Perhaps you will get a better answer if asking how to extract the video URL in a forum for javascript developers.

1 Like

I thought that rclone might have already done the heavylifting. I actually found a script that uses Microsoft APIs to get the download links:

Nice script. The API doesn't look too complicated - it is the kind of thing we could put into an rclone backend copypublic onedrive: wherever backend command fairly easily...

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.