Fix square bracket file name issue

This commit is contained in:
David Cameron
2023-06-18 19:07:58 -04:00
parent 35c35b3ffa
commit 613aab8ef7
2 changed files with 97 additions and 0 deletions

View File

@@ -11,6 +11,9 @@ def parse_chat(chat): # -> List[Tuple[str, str]]:
# Strip the filename of any non-allowed characters and convert / to \
path = re.sub(r'[<>"|?*]', "", match.group(1))
# Remove leading and trailing brackets
path = re.sub(r"^\[(.*)\]$", r"\1", path)
# Get the code
code = match.group(2)