一个OneDrive可共享的链接如下:https://1drv.ms/w/s!AqmFiI7maXrRgT7PGcK_7JyZlBco。我该如何获取直接下载链接版本呢? 我知道对于一个 onedrive.live/redir?<...> 链接,我只需将“redir”替换为“download”,但是对于像上面那样的链接,我该怎么做呢?谢谢。
你也可以在你的.bashrc文件中添加一个简单的函数来实现同样的功能:
onelink() { echo -n "$1"|base64|sed "s/=$//;s/\//\_/g;s/\+/\-/g;s/^/https:\/\/api\.onedrive\.com\/v1\.0\/shares\/u\!/;s/$/\/root\/content/"; }
结果是相同的:
$ onelink 'https://1drv.ms/w/s!AqmFiI7maXrRgT7PGcK_7JyZlBco'
https://api.onedrive.com/v1.0/shares/u!aHR0cHM6Ly8xZHJ2Lm1zL3cvcyFBcW1GaUk3bWFYclJnVDdQR2NLXzdKeVpsQmNv/root/content
api.onedrive.com
上使用,只需要进行一些小的调整(如主机名等)。 - Brad
https://onedrive.live.com/?authkey=%21AOaPhONxGCKIlrg&cid=910FC0C1DD8E9B39&id=910FC0C1DD8E9B39%21163&parId=910FC0C1DD8E9B39%21104&o=OneUp
。 - HappyFace