Opera8 commited on
Commit
9629d6a
·
verified ·
1 Parent(s): 54a4629

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +3 -11
templates/index.html CHANGED
@@ -227,17 +227,11 @@
227
  </header>
228
 
229
  <main class="main-content">
230
- <!-- PART 12: Setup Section (YouTube input, File Upload, Language Select, Analyze Button) -->
231
  <div id="setup-section">
232
  <div class="form-group" style="text-align: center;">
233
  <label style="text-align: right;">🎥 انتخاب ویدیو</label>
234
 
235
- <div style="display: flex; justify-content: center; width: 100%;">
236
- <input type="text" id="youtube-url" class="modern-input" placeholder="🔗 لینک یوتیوب را اینجا قرار دهید..." style="max-width: 500px; width: 100%;">
237
- </div>
238
-
239
- <div style="text-align: center; font-weight: bold; color: var(--text-tertiary); margin: 1rem 0;">یا</div>
240
-
241
  <div style="display: flex; justify-content: center; width: 100%;">
242
  <div class="file-input-wrapper" style="max-width: 500px; width: 100%;">
243
  <div class="file-input-btn">
@@ -731,11 +725,10 @@
731
 
732
  // PART 17: JS Analyze Video Function
733
  analyzeBtn.addEventListener('click', async () => {
734
- const ytUrl = document.getElementById('youtube-url').value;
735
  const fileInput = document.getElementById('video-file');
736
  const lang = document.getElementById('target-lang').value;
737
 
738
- if (!ytUrl && fileInput.files.length === 0) return alert("لطفا لینک یوتیوب یا فایل ویدیو را وارد کنید.");
739
 
740
  analyzeBtn.disabled = true;
741
  studioSection.style.display = 'none';
@@ -743,8 +736,7 @@
743
 
744
  const formData = new FormData();
745
  formData.append('language', lang);
746
- if (ytUrl) formData.append('youtube_url', ytUrl);
747
- if (fileInput.files.length > 0) formData.append('video_file', fileInput.files[0]);
748
 
749
  try {
750
  await clearAudioDB();
 
227
  </header>
228
 
229
  <main class="main-content">
230
+ <!-- PART 12: Setup Section (File Upload, Language Select, Analyze Button) -->
231
  <div id="setup-section">
232
  <div class="form-group" style="text-align: center;">
233
  <label style="text-align: right;">🎥 انتخاب ویدیو</label>
234
 
 
 
 
 
 
 
235
  <div style="display: flex; justify-content: center; width: 100%;">
236
  <div class="file-input-wrapper" style="max-width: 500px; width: 100%;">
237
  <div class="file-input-btn">
 
725
 
726
  // PART 17: JS Analyze Video Function
727
  analyzeBtn.addEventListener('click', async () => {
 
728
  const fileInput = document.getElementById('video-file');
729
  const lang = document.getElementById('target-lang').value;
730
 
731
+ if (fileInput.files.length === 0) return alert("لطفا فایل ویدیو را انتخاب کنید.");
732
 
733
  analyzeBtn.disabled = true;
734
  studioSection.style.display = 'none';
 
736
 
737
  const formData = new FormData();
738
  formData.append('language', lang);
739
+ formData.append('video_file', fileInput.files[0]);
 
740
 
741
  try {
742
  await clearAudioDB();