Update app.py
Browse files
app.py
CHANGED
@@ -283,10 +283,10 @@ def read_srt_file(file_path):
|
|
283 |
print(f"An error occurred: {e}")
|
284 |
|
285 |
def clean_text(text):
|
286 |
-
# Remove 'srt ' from the start
|
287 |
text = re.sub(r'^srt ', '', text, flags=re.MULTILINE)
|
288 |
# Remove ''' from the start and end
|
289 |
-
text = re.sub(r"
|
290 |
return text
|
291 |
|
292 |
def enhance_text(api_key, text, google):
|
|
|
283 |
print(f"An error occurred: {e}")
|
284 |
|
285 |
def clean_text(text):
|
286 |
+
# Remove 'srt ' from the start of each line
|
287 |
text = re.sub(r'^srt ', '', text, flags=re.MULTILINE)
|
288 |
# Remove ''' from the start and end
|
289 |
+
text = re.sub(r"^```|```$", '', text)
|
290 |
return text
|
291 |
|
292 |
def enhance_text(api_key, text, google):
|