Skip to content

Commit

Permalink
Use new endpoint for file download
Browse files Browse the repository at this point in the history
  • Loading branch information
jacopo-j committed Jan 22, 2022
1 parent d885b27 commit 3259c9e
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions src/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,6 @@ function composeStreamURL(params) {
return url;
}

function composeDownloadURL(params, filename) {
const url = new URL("apis/download.do", params.host);
url.searchParams.set("recordingDir", params.recordingDir);
url.searchParams.set("timestamp", params.timestamp);
url.searchParams.set("token", params.token);
url.searchParams.set("fileName", filename);

//return params.fallbackPlaySrc
return url;
}

function sanitizeFilename(filename) {
const allowedChars = /[^\w\s\d\-_~,;\[\]\(\).]/g;
return filename.replaceAll(allowedChars, "_");
Expand Down Expand Up @@ -154,7 +143,7 @@ function addDownloadButtonToPage(text, params) {
const savename = `${sanitizeFilename(params.recordName)}.mp4`;

// Compose the download link of the video
const downloadURL = composeDownloadURL(params, filename);
const downloadURL = params.fallbackPlaySrc;

// Create the download button
const downloadButton = createDownloadButton(downloadURL.toString(), savename);
Expand Down

0 comments on commit 3259c9e

Please sign in to comment.