Fix bug where lines were causing crashes

This commit is contained in:
Robert Miles 2018-08-03 01:34:27 -04:00
parent e0ced00db2
commit 855521313e
1 changed files with 1 additions and 1 deletions

View File

@ -17,7 +17,7 @@ def getTranscript(eptitle="Gem Glow",raw=False,dir_style=1):
def processTranscript(r,dir_style=1):
text = jsonpath(r,"$.query.pages.[0]")[0]["*"].split("\n")[2:-1]
text = ["".join(filter(lambda x: ord(x) in range(128),s)) for s in text] # filter music notes and other unicode chars
text = ["".join(filter(lambda x: ord(x) in range(128),s)) for s in text if "|" in s] # filter music notes and other unicode chars, as well as empty lines
text = [x for x in filter(lambda x: len(x.split("|")[1])>0,text)]
text = [x.split("|",2)[2][:-2] for x in text]
if dir_style==1: