Skip to content

Commit dc3d03d

Browse files
committedNov 29, 2020
Make sure we have result field in json
1 parent 84df407 commit dc3d03d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎python/example/test_srt.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ def transcribe():
4040

4141
for i, res in enumerate(results):
4242
jres = json.loads(res)
43+
if not 'result' in jres:
44+
continue
4345
words = jres['result']
4446
for j in range(0, len(words), WORDS_PER_LINE):
4547
line = words[j : j + WORDS_PER_LINE]
@@ -51,4 +53,3 @@ def transcribe():
5153
return subs
5254

5355
print (srt.compose(transcribe()))
54-

0 commit comments

Comments
 (0)
Please sign in to comment.