Spaces:
Sleeping
Sleeping
Update index.js
Browse files
index.js
CHANGED
@@ -132,7 +132,7 @@ const html = `
|
|
132 |
</head>
|
133 |
<body>
|
134 |
<div class="container">
|
135 |
-
<h1
|
136 |
<form id="transcriptForm">
|
137 |
<input type="text" id="videoUrl" name="videoUrl" placeholder="Enter YouTube Video URL..." required>
|
138 |
<button type="submit" id="submitBtn">
|
@@ -178,16 +178,16 @@ const html = `
|
|
178 |
if (response.ok) {
|
179 |
const data = await response.json();
|
180 |
resultDiv.textContent = data.transcript;
|
181 |
-
statusDiv.textContent =
|
182 |
} else {
|
183 |
const error = await response.text();
|
184 |
resultDiv.textContent = `Error: ${error}`;
|
185 |
-
statusDiv.textContent = '
|
186 |
}
|
187 |
} catch (error) {
|
188 |
console.error('Error:', error);
|
189 |
resultDiv.textContent = 'Network error occurred. Please try again.';
|
190 |
-
statusDiv.textContent = '
|
191 |
} finally {
|
192 |
// Reset UI
|
193 |
submitBtn.disabled = false;
|
@@ -348,7 +348,7 @@ const PORT = process.env.PORT || 7860;
|
|
348 |
// Initialize browser on startup
|
349 |
initBrowser().then(() => {
|
350 |
app.listen(PORT, () => {
|
351 |
-
console.log(
|
352 |
-
console.log(
|
353 |
});
|
354 |
}).catch(console.error);
|
|
|
132 |
</head>
|
133 |
<body>
|
134 |
<div class="container">
|
135 |
+
<h1>Fast YouTube Transcript</h1>
|
136 |
<form id="transcriptForm">
|
137 |
<input type="text" id="videoUrl" name="videoUrl" placeholder="Enter YouTube Video URL..." required>
|
138 |
<button type="submit" id="submitBtn">
|
|
|
178 |
if (response.ok) {
|
179 |
const data = await response.json();
|
180 |
resultDiv.textContent = data.transcript;
|
181 |
+
statusDiv.textContent = `[SUCCESS] Transcript extracted in ${duration}s`;
|
182 |
} else {
|
183 |
const error = await response.text();
|
184 |
resultDiv.textContent = `Error: ${error}`;
|
185 |
+
statusDiv.textContent = '[ERROR] Failed to extract transcript';
|
186 |
}
|
187 |
} catch (error) {
|
188 |
console.error('Error:', error);
|
189 |
resultDiv.textContent = 'Network error occurred. Please try again.';
|
190 |
+
statusDiv.textContent = '[ERROR] Network error';
|
191 |
} finally {
|
192 |
// Reset UI
|
193 |
submitBtn.disabled = false;
|
|
|
348 |
// Initialize browser on startup
|
349 |
initBrowser().then(() => {
|
350 |
app.listen(PORT, () => {
|
351 |
+
console.log(`Fast YouTube Transcript Server running on port ${PORT}`);
|
352 |
+
console.log(`Access the web interface at http://localhost:${PORT}`);
|
353 |
});
|
354 |
}).catch(console.error);
|