1
0
mirror of https://github.com/snobu/destreamer.git synced 2026-02-13 10:09:43 +00:00

Add personal to URL regex to apply to more sites (#437)

* Add personal URL for new MS Teams recordings
* Encode URI components to avoid unescape char
This commit is contained in:
WilliamWsyHK
2022-05-19 21:54:06 +08:00
committed by GitHub
parent d2a79442df
commit 9b8d341e5b
2 changed files with 2 additions and 2 deletions

View File

@@ -175,7 +175,7 @@ export class ShareApiClient {
AddRequiredFields: true 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}'`); logger.verbose(`Requesting video info for '${url}'`);
const info = await this.axiosInstance.post(url, payload, { const info = await this.axiosInstance.post(url, payload, {

View File

@@ -177,7 +177,7 @@ export async function downloadStreamVideo(videoUrls: Array<VideoUrl>): Promise<v
// TODO: complete overhaul of this function // TODO: complete overhaul of this function
export async function downloadShareVideo(videoUrls: Array<VideoUrl>): Promise<void> { export async function downloadShareVideo(videoUrls: Array<VideoUrl>): Promise<void> {
const shareUrlRegex = new RegExp(/(?<domain>https:\/\/.+\.sharepoint\.com).*?(?<baseSite>\/(?:teams|sites)\/.*?)(?:(?<filename>\/.*\.mp4)|\/.*id=(?<paramFilename>.*mp4))/); const shareUrlRegex = new RegExp(/(?<domain>https:\/\/.+\.sharepoint\.com).*?(?<baseSite>\/(?:teams|sites|personal)\/.*?)(?:(?<filename>\/.*\.mp4)|\/.*id=(?<paramFilename>.*mp4))/);
logger.info('Downloading SharePoint videos...\n\n'); logger.info('Downloading SharePoint videos...\n\n');