SPACERUNNER99 commited on
Commit
92ea8a8
·
verified ·
1 Parent(s): 93b36e1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -288,6 +288,7 @@ def clean_text(text):
288
  text = re.sub(r"^```|```$", '', text)
289
  text = re.sub(r'^srt', '', text, flags=re.MULTILINE)
290
  return text
 
291
  def split_srt_file(input_file, max_chars=3000):
292
  # Read the contents of the SRT file
293
  with open(input_file, 'r', encoding='utf-8') as file:
@@ -378,7 +379,7 @@ def translate_text(api_key, source_lang, target_lang, text):
378
 
379
  def write_google(google_translate):
380
  google = "google_translate.srt"
381
- with open(google, 'w', encoding="utf-8") as f:
382
  f.write(google_translate)
383
 
384
  def time_to_seconds(time_obj):
 
288
  text = re.sub(r"^```|```$", '', text)
289
  text = re.sub(r'^srt', '', text, flags=re.MULTILINE)
290
  return text
291
+
292
  def split_srt_file(input_file, max_chars=3000):
293
  # Read the contents of the SRT file
294
  with open(input_file, 'r', encoding='utf-8') as file:
 
379
 
380
  def write_google(google_translate):
381
  google = "google_translate.srt"
382
+ with open(google, 'a', encoding="utf-8") as f:
383
  f.write(google_translate)
384
 
385
  def time_to_seconds(time_obj):