Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,7 +11,7 @@ from gtts import gTTS
|
|
| 11 |
import gradio as gr
|
| 12 |
import os
|
| 13 |
import speech_recognition as sr
|
| 14 |
-
from
|
| 15 |
from pprint import pprint
|
| 16 |
from moviepy.editor import *
|
| 17 |
from pytube import YouTube
|
|
@@ -288,7 +288,7 @@ def video_to_translate(url,initial_language,final_language):
|
|
| 288 |
|
| 289 |
|
| 290 |
try:
|
| 291 |
-
translation = translator.translate(text,
|
| 292 |
except Exception:
|
| 293 |
print("This text cannot be translated")
|
| 294 |
cleanup()
|
|
|
|
| 11 |
import gradio as gr
|
| 12 |
import os
|
| 13 |
import speech_recognition as sr
|
| 14 |
+
from googletrans import Translator, constants
|
| 15 |
from pprint import pprint
|
| 16 |
from moviepy.editor import *
|
| 17 |
from pytube import YouTube
|
|
|
|
| 288 |
|
| 289 |
|
| 290 |
try:
|
| 291 |
+
translation = translator.translate(text, dest=lang)
|
| 292 |
except Exception:
|
| 293 |
print("This text cannot be translated")
|
| 294 |
cleanup()
|