Forked from cdeitrick/Download OneDrive files in terminal.txt
Last active
December 2, 2025 14:07
-
-
Save sparks-gen/15ac67109b128ac5d49269cb221960ab to your computer and use it in GitHub Desktop.
Download OneDrive files in terminal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Google Chrome as well as Mozilla Firerfox both provide an option to copy download link specifically for cURL. This option will generate cURL with all required things such as User agent for downloading things from the side. To get that, | |
| 1. Open the URL of the shared file in either of the above mentioned browsers. | |
| 2. Open Developer options using Ctrl+Shift+I (CMD+Option+I for Mac). | |
| 3. Go to Network tab. | |
| 4. Now click on download in the OneDrive view. Saving file isn't required. We only need the network activity while browser requests the file from the server. | |
| 5. A new entry will appear which would look like "download.aspx?...". You can also find it by filtering at the top left. | |
| 6. Right click on that and Copy → Copy as cURL. | |
| 7. Paste the copied content directly in the terminal and append `--output <file.extension>` to save the content in `file.extension` since terminal isn't capable of showing binary data. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment