A OneDrive sharable link looks like this: https://1drv.ms/w/s!AqmFiI7maXrRgT7PGcK_7JyZlBco. How do I get the direct download link version of this? I know with a onedrive.live/re
You can also add a simple function to your .bashrc that will do the same trick:
onelink() { echo -n "$1"|base64|sed "s/=$//;s/\//\_/g;s/\+/\-/g;s/^/https:\/\/api\.onedrive\.com\/v1\.0\/shares\/u\!/;s/$/\/root\/content/"; }
Result is the same:
$ onelink 'https://1drv.ms/w/s!AqmFiI7maXrRgT7PGcK_7JyZlBco'
https://api.onedrive.com/v1.0/shares/u!aHR0cHM6Ly8xZHJ2Lm1zL3cvcyFBcW1GaUk3bWFYclJnVDdQR2NLXzdKeVpsQmNv/root/content
If you follow the instruction here you can generate a URL that will act on the shared item, including being able to get its content.
In your case the URL would look like https://api.onedrive.com/v1.0/shares/u!aHR0cHM6Ly8xZHJ2Lm1zL3cvcyFBcW1GaUk3bWFYclJnVDdQR2NLXzdKeVpsQmNv/root/content