直接下载 link 到 OneDrive 文件?
Direct download link to OneDrive file?
可共享的 OneDrive link 如下所示:https://1drv.ms/w/s!AqmFiI7maXrRgT7PGcK_7JyZlBco。我如何获得直接下载 link 版本?我知道使用 onedrive。live/redir?<...> link 我可以将 'redir' 替换为 'download',但是对于 [=17] 我该怎么做=] 看起来像上面那个?谢谢
如果您按照说明 here 进行操作,您可以生成一个 URL 来对共享项目执行操作,包括能够获取其内容。
在你的情况下 URL 看起来像 https://api.onedrive.com/v1.0/shares/u!aHR0cHM6Ly8xZHJ2Lm1zL3cvcyFBcW1GaUk3bWFYclJnVDdQR2NLXzdKeVpsQmNv/root/content
您还可以在 .bashrc 中添加一个简单的函数来实现同样的效果:
onelink() { echo -n ""|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
可共享的 OneDrive link 如下所示:https://1drv.ms/w/s!AqmFiI7maXrRgT7PGcK_7JyZlBco。我如何获得直接下载 link 版本?我知道使用 onedrive。live/redir?<...> link 我可以将 'redir' 替换为 'download',但是对于 [=17] 我该怎么做=] 看起来像上面那个?谢谢
如果您按照说明 here 进行操作,您可以生成一个 URL 来对共享项目执行操作,包括能够获取其内容。
在你的情况下 URL 看起来像 https://api.onedrive.com/v1.0/shares/u!aHR0cHM6Ly8xZHJ2Lm1zL3cvcyFBcW1GaUk3bWFYclJnVDdQR2NLXzdKeVpsQmNv/root/content
您还可以在 .bashrc 中添加一个简单的函数来实现同样的效果:
onelink() { echo -n ""|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