Skip to content
This repository was archived by the owner on Sep 23, 2023. It is now read-only.

Commit

Permalink
fix: better sanitize fetched recording name
Browse files Browse the repository at this point in the history
  • Loading branch information
beryxz committed Oct 2, 2021
1 parent dbd79f7 commit 2149a7d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ async function processCourseRecordings(course, recordings, downloadConfigs) {

for (const recording of chunk) {
// filename
let filename = `${recording.name}.${recording.format}`.replace(/[\\/:"*?<>| ]/g, '_');
let filename = `${recording.name}.${recording.format}`.replace(/[\\/:"*?<>| \r\n]/g, '_');
if (course.prepend_date)
filename = `${getUTCDateTimestamp(recording.created_at, '')}-${filename}`;

Expand All @@ -164,6 +164,7 @@ async function processCourseRecordings(course, recordings, downloadConfigs) {
downloadConfigs.base_path,
course.name ? `${course.name}_${course.id}` : `${course.id}`
);

let downloadPath = join(folderPath, filename);
let tmpDownloadPath = join('./tmp/', filename);
try {
Expand Down

0 comments on commit 2149a7d

Please sign in to comment.