diff --git a/generator.ts b/generator.ts index 04042de..cca53ef 100644 --- a/generator.ts +++ b/generator.ts @@ -59,7 +59,9 @@ async function main(): Promise { // Get video file length const videoFile: string = args._[0] as string; - const videoName = videoFile.split("/").pop()!.split(".")[0] as string; + + //preserve file name for JSON file and strip file extension and final . + const videoName = videoFile.split('/').pop()!.slice(0,videoFile.length-4) as string; const stats = await ffprobe(videoFile).catch(() => { Deno.exit(1); }); @@ -91,7 +93,7 @@ async function main(): Promise { // Upload the subtitles const subtitlesUrl = await upload(`./${videoName}.vtt`); - + const subtitleName = `${videoName}.vtt` // Generate the JSON const json = { title: videoName, @@ -107,7 +109,7 @@ async function main(): Promise { { url: subtitlesUrl, contentType: "text/vtt", - name: "Subs or shit IDK", + name: subtitleName, default: true, }, ],