From 65889395d5a2c343035d2a738e4114274cca64ef Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 12 Jun 2024 11:42:35 +0100 Subject: [PATCH] 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 --- backend/onedrive/onedrive.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/onedrive/onedrive.go b/backend/onedrive/onedrive.go index 1ac8090de..e5ca7f17d 100644 --- a/backend/onedrive/onedrive.go +++ b/backend/onedrive/onedrive.go @@ -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 }