ai-tube / src /app /api /actions /ai-tube-hf /downloadPlainText.ts
jbilcke-hf's picture
jbilcke-hf HF staff
working on some new features
3d4392e
raw
history blame
No virus
317 Bytes
export async function downloadPlainText(url: string): Promise<string> {
// Fetch the plain text file
const response = await fetch(url)
if (!response.ok) {
throw new Error(`Failed to download the plain/text file: ${response.statusText}`)
}
const plainText = await response.text()
return plainText
}