From 50b4a2398e9edaee33cdcdfff6bbbf70836f5ad8 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 21 Sep 2023 15:36:26 +0100 Subject: [PATCH] onedrive: fix the configurator to allow /teams/ID in the config See: https://forum.rclone.org/t/sharepoint-to-google/41548/ --- backend/onedrive/onedrive.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/backend/onedrive/onedrive.go b/backend/onedrive/onedrive.go index d6e1793948b1d..e793f01110e63 100644 --- a/backend/onedrive/onedrive.go +++ b/backend/onedrive/onedrive.go @@ -572,15 +572,18 @@ func Config(ctx context.Context, name string, m configmap.Mapper, config fs.Conf case "url": return fs.ConfigInput("url_end", "config_site_url", `Site URL -Example: "https://contoso.sharepoint.com/sites/mysite" or "mysite" +Examples: +- "mysite" +- "https://XXX.sharepoint.com/sites/mysite" +- "https://XXX.sharepoint.com/teams/ID" `) case "url_end": siteURL := config.Result - re := regexp.MustCompile(`https://.*\.sharepoint\.com/sites/(.*)`) + re := regexp.MustCompile(`https://.*\.sharepoint\.com(/.*)`) match := re.FindStringSubmatch(siteURL) if len(match) == 2 { return chooseDrive(ctx, name, m, srv, chooseDriveOpt{ - relativePath: "/sites/" + match[1], + relativePath: match[1], }) } return chooseDrive(ctx, name, m, srv, chooseDriveOpt{