mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2026-06-12 05:04:00 +03:00
@@ -47,10 +47,12 @@ class YoutubeTranscript {
|
||||
let transcript = "";
|
||||
const chunks = transcriptXML.getElementsByTagName("text");
|
||||
for (const chunk of chunks) {
|
||||
transcript += chunk.textContent;
|
||||
// Add space after each text chunk
|
||||
transcript += chunk.textContent + " ";
|
||||
}
|
||||
|
||||
return transcript;
|
||||
// Trim extra whitespace
|
||||
return transcript.trim().replace(/\s+/g, " ");
|
||||
} catch (e) {
|
||||
throw new YoutubeTranscriptError(e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user