A Simple php API to get onedrive direct link from its sharelink.
- Upload to your web server.
- Access the api via browser:
http(s)://xxx/od.php?l=<shared short link>
- Through rewrite:
(nginx)Then you just need to use:rewrite ^/od/(.*)$ /od.php?l=$1?;
Moreover,I recommend you change the setting of $finallink to be like this in od.php:http(s)://xxx/od/<shared short link>
$finallink = 'od/{link}'; /*设置生成后给出的链接,{link}是生成的链接*/
First , have the file shared.
Second , set the permission to let everyone access.
Third , access http(s)://xxx/od.php and paste the link,click 'submit' to get shared short link.
- Change the setting of $key to your own key in md5 encryption.
$key = '179ad45c6ce2cb97cf1029e212046e81'; /*(example)md5加密的key*/
- After pasting the onedrive link , type the key in the Secretkey inputbox while your custom link in another one.
- Enjoy your privilege!
- Please pay attention to the official limit -A- .
https://docs.microsoft.com/zh-cn/sharepoint/dev/general-development/how-to-avoid-getting-throttled-or-blocked-in-sharepoint-online
Let's be BAI PIAO GUAI.