tuna-agent 0.1.135 → 0.1.136
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.
|
@@ -232,6 +232,14 @@ export async function analyzeVideo(url, onProgress) {
|
|
|
232
232
|
progress('Đang tải video...');
|
|
233
233
|
console.log('[analyze_video] Downloading:', url);
|
|
234
234
|
await run(YT_DLP, ['-f', 'best[height<=720]/best', '-o', videoPath, '--no-playlist', '--quiet', url]);
|
|
235
|
+
// Grab the original video title (metadata only, no extra download) so the
|
|
236
|
+
// clone idea gets a real name instead of "Clone: www.youtube.com".
|
|
237
|
+
let source_title = '';
|
|
238
|
+
try {
|
|
239
|
+
const t = await run(YT_DLP, ['--skip-download', '--no-warnings', '--no-playlist', '--print', '%(title)s', url]);
|
|
240
|
+
source_title = (t.out || '').trim().split('\n')[0].slice(0, 200);
|
|
241
|
+
}
|
|
242
|
+
catch { /* title is best-effort — analysis still proceeds without it */ }
|
|
235
243
|
progress('Đang tách audio...');
|
|
236
244
|
console.log('[analyze_video] Extracting audio');
|
|
237
245
|
await run(FFMPEG, ['-y', '-i', videoPath, '-vn', '-ar', '16000', '-ac', '1', '-b:a', '64k', audioPath, '-loglevel', 'error']);
|
|
@@ -399,6 +407,7 @@ export async function analyzeVideo(url, onProgress) {
|
|
|
399
407
|
}
|
|
400
408
|
const scenes = sceneResults.sort((a, b) => a.scene_number - b.scene_number);
|
|
401
409
|
return {
|
|
410
|
+
source_title,
|
|
402
411
|
duration_sec: Math.round(durationSec),
|
|
403
412
|
language: transcript.language || 'unknown',
|
|
404
413
|
transcript: transcript.text || '',
|