diff --git a/Backend/transcript-fetcher.js b/Backend/transcript-fetcher.js index 95c1aa1..127cd83 100644 --- a/Backend/transcript-fetcher.js +++ b/Backend/transcript-fetcher.js @@ -40,11 +40,11 @@ const fetchTranscriptWithRetry = async (videoId, maxRetries = RETRY_CONFIG.maxRe if (transcript && transcript.length > 0) { console.log(`✅ Successfully fetched transcript with ${transcript.length} segments`); - return transcript.map(item => ({ - text: item.text, - start: parseFloat(item.offset) / 1000, - duration: parseFloat(item.duration) / 1000 - })); + return transcript.map(item => ({ + text: item.text, + start: parseFloat(item.offset), + duration: parseFloat(item.duration) + })); } } catch (error) { lastError = error; @@ -86,11 +86,11 @@ const fetchTranscriptWithRetry = async (videoId, maxRetries = RETRY_CONFIG.maxRe if (transcript && transcript.length > 0) { console.log(`✅ Success with alternative format!`); - return transcript.map(item => ({ - text: item.text, - start: parseFloat(item.offset) / 1000, - duration: parseFloat(item.duration) / 1000 - })); + return transcript.map(item => ({ + text: item.text, + start: parseFloat(item.offset), + duration: parseFloat(item.duration) + })); } } catch (altError) { console.log(`Alternative format failed: ${altError.message}`); @@ -135,11 +135,11 @@ const tryManualTranscriptExtraction = async (videoId) => { if (transcript && transcript.length > 0) { console.log('✅ Manual extraction successful!'); - return transcript.map(item => ({ - text: item.text, - start: parseFloat(item.start || item.offset) / 1000, - duration: parseFloat(item.dur || item.duration) / 1000 - })); + return transcript.map(item => ({ + text: item.text, + start: parseFloat(item.start || item.offset), + duration: parseFloat(item.dur || item.duration) + })); } }