altryne commited on
Commit
70bd663
·
unverified ·
1 Parent(s): 805009b

Added vtt_text to generated subtitles call

Browse files
Files changed (1) hide show
  1. download.py +2 -0
download.py CHANGED
@@ -183,6 +183,7 @@ def caption_generator(social_media_url,uid, language="Autodetect", model_size=mo
183
  whisper_result_captions = [
184
  {
185
  "language_tag": transcribe_whisper_result["language"],
 
186
  "vtt_file": anvil.BlobMedia(content_type="text/plain", content=vtt_path.read_bytes(),
187
  name=f"{uid}.{transcribe_whisper_result['language']}.vtt")
188
  },
@@ -198,6 +199,7 @@ def caption_generator(social_media_url,uid, language="Autodetect", model_size=mo
198
  whisper_result_captions.append(
199
  {
200
  "language_tag": "en",
 
201
  "vtt_file": anvil.BlobMedia(content_type="text/plain", content=en_vtt_path.read_bytes(), name=f"{uid}.en.vtt")
202
  }
203
  )
 
183
  whisper_result_captions = [
184
  {
185
  "language_tag": transcribe_whisper_result["language"],
186
+ "vtt_text": vtt_path.read_text(encoding="utf-8"),
187
  "vtt_file": anvil.BlobMedia(content_type="text/plain", content=vtt_path.read_bytes(),
188
  name=f"{uid}.{transcribe_whisper_result['language']}.vtt")
189
  },
 
199
  whisper_result_captions.append(
200
  {
201
  "language_tag": "en",
202
+ "vtt_text": en_vtt_path.read_text(encoding="utf-8"),
203
  "vtt_file": anvil.BlobMedia(content_type="text/plain", content=en_vtt_path.read_bytes(), name=f"{uid}.en.vtt")
204
  }
205
  )