diff --git a/src/ApiClient.ts b/src/ApiClient.ts index 1bd4af7..a8dab50 100644 --- a/src/ApiClient.ts +++ b/src/ApiClient.ts @@ -175,7 +175,7 @@ export class ShareApiClient { AddRequiredFields: true } }; - const url = `${this.site}/_api/web/GetListUsingPath(DecodedUrl=@a1)/RenderListDataAsStream?@a1='${filePath}'`; + const url = `${this.site}/_api/web/GetListUsingPath(DecodedUrl=@a1)/RenderListDataAsStream?@a1='${encodeURIComponent(filePath)}'`; logger.verbose(`Requesting video info for '${url}'`); const info = await this.axiosInstance.post(url, payload, { diff --git a/src/Downloaders.ts b/src/Downloaders.ts index 6f35de1..c167e15 100644 --- a/src/Downloaders.ts +++ b/src/Downloaders.ts @@ -177,7 +177,7 @@ export async function downloadStreamVideo(videoUrls: Array): Promise): Promise { - const shareUrlRegex = new RegExp(/(?https:\/\/.+\.sharepoint\.com).*?(?\/(?:teams|sites)\/.*?)(?:(?\/.*\.mp4)|\/.*id=(?.*mp4))/); + const shareUrlRegex = new RegExp(/(?https:\/\/.+\.sharepoint\.com).*?(?\/(?:teams|sites|personal)\/.*?)(?:(?\/.*\.mp4)|\/.*id=(?.*mp4))/); logger.info('Downloading SharePoint videos...\n\n');