onedrive: fix onedrive personal direct share link

This adapts to changes in the share URL provided by onedrive personal.

Before it looked like this

    https://1drv.ms/t/XXX

Now it sometimes looks like this

    https://1drv.ms/v/c/XXX/YYY

Fixes #7898
This commit is contained in:
Nick Craig-Wood 2024-06-12 11:42:35 +01:00
parent d068e0b1a9
commit 65889395d5

View File

@ -1933,7 +1933,9 @@ func (f *Fs) PublicLink(ctx context.Context, remote string, expire fs.Duration,
switch f.driveType {
case driveTypePersonal:
// Method: https://stackoverflow.com/questions/37951114/direct-download-link-to-onedrive-file
if len(segments) != 5 {
// https://1drv.ms/t/XXX
// https://1drv.ms/v/c/XXX/YYY
if len(segments) < 5 {
fs.Logf(f, cnvFailMsg)
return shareURL, nil
}