Signed-off-by: Sam Therapy <sam@samtherapy.net>
This commit is contained in:
Sam Therapy 2022-06-19 18:11:54 +02:00
parent 31d9cc44b7
commit 519f89fa7a
Signed by: sam
GPG Key ID: 4D8B07C18F31ACBD
3 changed files with 12 additions and 7 deletions

View File

@ -19,11 +19,13 @@ you may need to add this to your PATH. An alternative I have is setting
`DENO_INSTALL_ROOT` to `~/.local/bin`, which I have in my PATH.
## Upgrading
You can upgrade in a similar way to installing:
```bash
deno cache --reload "https://git.froth.zone/sam/cytube-json-generator/raw/branch/master/generator.ts"
```
then [install](#installation) again.
## Usage

View File

@ -3,21 +3,21 @@ import { assertEquals } from "https://deno.land/std@0.141.0/testing/asserts.ts";
const files = new Map<string, string>();
files.set(
"8.Mile.2002.720p.BluRay.999MB.HQ.x265.10bit.mp4",
"8.Mile.2002.720p.BluRay.999MB.HQ.x265.10bit.srt"
"8.Mile.2002.720p.BluRay.999MB.HQ.x265.10bit.srt",
);
files.set("Blade.Runner (1997).mp4", "Blade.Runner (1997).srt");
files.set(
"Total.Recall.1990.REMASTERED.720p.BluRay.999MB.HQ.x265.mp4",
"Total.Recall.1990.REMASTERED.720p.BluRay.999MB.HQ.x265.srt"
"Total.Recall.1990.REMASTERED.720p.BluRay.999MB.HQ.x265.srt",
);
files.set("", "");
files.set(
"[Biraru] Chi's Sweet Home - 022 [DVD][576p][10-bit][x264][AC3][3CBD659E].mkv",
"[Biraru] Chi's Sweet Home - 022 [DVD][576p][10-bit][x264][AC3][3CBD659E].srt"
"[Biraru] Chi's Sweet Home - 022 [DVD][576p][10-bit][x264][AC3][3CBD659E].srt",
);
files.set(
"[Reaktor] Legend of the Galactic Heroes - Ginga Eiyuu Densetsu - Gaiden - Arc 1 - E1 [720p][x265][10-bit].mp4",
"[Reaktor] Legend of the Galactic Heroes - Ginga Eiyuu Densetsu - Gaiden - Arc 1 - E1 [720p][x265][10-bit].srt"
"[Reaktor] Legend of the Galactic Heroes - Ginga Eiyuu Densetsu - Gaiden - Arc 1 - E1 [720p][x265][10-bit].srt",
);
Deno.test({

View File

@ -60,9 +60,12 @@ async function main(): Promise<void> {
// Get video file length
const videoFile: string = args._[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 videoName = videoFile.split("/").pop()!.slice(
0,
videoFile.length - 4,
) as string;
const stats = await ffprobe(videoFile).catch(() => {
Deno.exit(1);
});
@ -94,7 +97,7 @@ async function main(): Promise<void> {
// Upload the subtitles
const subtitlesUrl = await upload(`./${videoName}.vtt`);
const subtitleName = `${videoName}.vtt`
const subtitleName = `${videoName}.vtt`;
// Generate the JSON
const json = {
title: videoName,