Spaces:
Paused
Paused
WIP
Browse files
app.py
CHANGED
|
@@ -229,9 +229,17 @@ def transcribe_youtube(url, return_timestamps, generate_subs, chunk_length_s=30,
|
|
| 229 |
# Check API health first
|
| 230 |
check_api_health()
|
| 231 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 232 |
# Get audio URL from Sieve
|
| 233 |
audio_url = download_youtube_audio(url)
|
| 234 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 235 |
# Prepare request parameters
|
| 236 |
params = {
|
| 237 |
"source_language": "tg", # Tajik language
|
|
|
|
| 229 |
# Check API health first
|
| 230 |
check_api_health()
|
| 231 |
|
| 232 |
+
# Validate URL scheme
|
| 233 |
+
if not url.startswith(('http://', 'https://')):
|
| 234 |
+
raise gr.Error("URL must start with http:// or https://")
|
| 235 |
+
|
| 236 |
# Get audio URL from Sieve
|
| 237 |
audio_url = download_youtube_audio(url)
|
| 238 |
|
| 239 |
+
# Validate audio URL scheme
|
| 240 |
+
if not audio_url.startswith(('http://', 'https://')):
|
| 241 |
+
raise gr.Error("Invalid audio URL scheme received from Sieve")
|
| 242 |
+
|
| 243 |
# Prepare request parameters
|
| 244 |
params = {
|
| 245 |
"source_language": "tg", # Tajik language
|