@qodestack/dl-yt-playlist
Advanced tools
Comparing version 6.3.0 to 6.4.0
@@ -7,3 +7,3 @@ { | ||
"types": "./dist/main.d.ts", | ||
"version": "6.3.0", | ||
"version": "6.4.0", | ||
"publishConfig": { | ||
@@ -10,0 +10,0 @@ "access": "public" |
@@ -407,3 +407,3 @@ import {$} from 'bun' | ||
id: snippet.resourceId.videoId, | ||
title: sanitizeTitle(snippet.title), | ||
title: snippet.title, | ||
description: snippet.description, | ||
@@ -694,5 +694,2 @@ channelId: snippet.videoOwnerChannelId, | ||
const startProcessing = performance.now() | ||
const makeTemplate = (title: string, type: 'audio' | 'video') => { | ||
return `${directory}/${type}/${title} [%(id)s].%(ext)s` | ||
} | ||
const videoProgressBar = new cliProgress.SingleBar( | ||
@@ -716,7 +713,7 @@ { | ||
>((acc, partialVideoWithDuration) => { | ||
const {id, title, url} = partialVideoWithDuration | ||
const {id, url} = partialVideoWithDuration | ||
const audioExistsOnDisk = !!existingAudioFilesObj[id] | ||
const videoExistsOnDisk = !!existingVideoFilesObj[id] | ||
const audioTemplate = makeTemplate(title, 'audio') | ||
const videoTemplate = makeTemplate(title, 'video') | ||
const audioTemplate = `${directory}/audio/%(id)s.%(ext)s` | ||
const videoTemplate = `${directory}/video/%(id)s.%(ext)s` | ||
@@ -767,4 +764,4 @@ const bothPromiseFxn = () => { | ||
const audioFileExtension = requested_downloads[0]!.ext | ||
const oldAudioPath = `${videoDir}/${title} [${id}].${audioFileExtension}` | ||
const newAudioPath = `${audioDir}/${title} [${id}].${audioFileExtension}` | ||
const oldAudioPath = `${videoDir}/${id}.${audioFileExtension}` | ||
const newAudioPath = `${audioDir}/${id}.${audioFileExtension}` | ||
@@ -1630,9 +1627,2 @@ fs.renameSync(oldAudioPath, newAudioPath) | ||
function sanitizeTitle(str: string): string { | ||
const safeTitle = sanitizeFilename(str, {replacement: ' '}) | ||
// Use a regular expression to replace consecutive spaces with a single space. | ||
return safeTitle.replace(/\s+/g, ' ') | ||
} | ||
export type FileStatCategoryInfo = { | ||
@@ -1963,3 +1953,3 @@ totalSize: number | ||
) | ||
const title = sanitizeTitle(rawTitle) | ||
const title = sanitizeFilename(rawTitle, {replacement: ' '}) | ||
@@ -1966,0 +1956,0 @@ /** |
Sorry, the diff of this file is too big to display
196364
4507