ctx-reels 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +38 -0
- package/README.md +120 -0
- package/bin/ctx.js +172 -0
- package/package.json +53 -0
- package/scripts/setup.sh +77 -0
- package/src/modules/engine.js +194 -0
- package/src/modules/pipeline.js +96 -0
- package/src/modules/script.js +70 -0
- package/src/modules/subs.js +142 -0
- package/src/modules/voice.js +211 -0
- package/src/python/whisper_runner.py +139 -0
- package/src/utils/fileConfig.js +38 -0
- package/templates/backgrounds/default.jpg +0 -0
- package/templates/backgrounds/minecraft.mp4 +0 -0
- package/templates/bg.jpg +0 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import os from 'os';
|
|
4
|
+
|
|
5
|
+
// Output base: defaults to ~/Desktop/ctx, overridable via CTX_OUTPUT env
|
|
6
|
+
const OUTPUT_BASE = process.env.CTX_OUTPUT || path.join(os.homedir(), 'Desktop', 'ctx');
|
|
7
|
+
|
|
8
|
+
// Output directories
|
|
9
|
+
export const DIRS = {
|
|
10
|
+
SCRIPTS: path.join(OUTPUT_BASE, 'scripts'),
|
|
11
|
+
AUDIO: path.join(OUTPUT_BASE, 'audio'),
|
|
12
|
+
SUBTITLES: path.join(OUTPUT_BASE, 'subtitles'),
|
|
13
|
+
REELS: path.join(OUTPUT_BASE, 'reels'),
|
|
14
|
+
LOGS: path.join(OUTPUT_BASE, 'logs'),
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Ensures all required output directories exist.
|
|
19
|
+
*/
|
|
20
|
+
export function ensureDirectories() {
|
|
21
|
+
Object.values(DIRS).forEach((dir) => {
|
|
22
|
+
if (!fs.existsSync(dir)) {
|
|
23
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Creates a slug from a given string (e.g., topic name).
|
|
30
|
+
*/
|
|
31
|
+
export function slugify(text) {
|
|
32
|
+
return text
|
|
33
|
+
.toString()
|
|
34
|
+
.toLowerCase()
|
|
35
|
+
.trim()
|
|
36
|
+
.replace(/[\s\W-]+/g, '-') // Replace spaces and non-word chars with -
|
|
37
|
+
.replace(/^-+|-+$/g, ''); // Remove leading/trailing -
|
|
38
|
+
}
|
|
Binary file
|
|
Binary file
|
package/templates/bg.jpg
ADDED
|
Binary file
|