From 855521313ea1724011f2e2b49e06395ba8703995 Mon Sep 17 00:00:00 2001 From: khuxkm Date: Fri, 3 Aug 2018 01:34:27 -0400 Subject: [PATCH] Fix bug where lines were causing crashes --- transgrab.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transgrab.py b/transgrab.py index 81ea442..1f737a3 100644 --- a/transgrab.py +++ b/transgrab.py @@ -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: