Update app.py
Browse files
app.py
CHANGED
@@ -174,7 +174,7 @@ async def get_transcript(youtube_url: str):
|
|
174 |
if subtitle_file.endswith('.json3'):
|
175 |
import json
|
176 |
subs = json.loads(content)
|
177 |
-
text = ' '.join([e['segs'][0]['utf8'] for e in subs['events'] if e.get('segs'))
|
178 |
elif subtitle_file.endswith('.vtt'):
|
179 |
text = ' '.join(line.strip() for line in content.split('\n')
|
180 |
if not line.startswith('WEBVTT')
|
|
|
174 |
if subtitle_file.endswith('.json3'):
|
175 |
import json
|
176 |
subs = json.loads(content)
|
177 |
+
text = ' '.join([e['segs'][0]['utf8'] for e in subs['events'] if e.get('segs')])
|
178 |
elif subtitle_file.endswith('.vtt'):
|
179 |
text = ' '.join(line.strip() for line in content.split('\n')
|
180 |
if not line.startswith('WEBVTT')
|