From 0c02644006c736a25ac2b3ce89f61409900d5391 Mon Sep 17 00:00:00 2001 From: Kcchouette Date: Sat, 14 Jan 2017 12:30:31 +0100 Subject: [PATCH] Change the backslash with a - --- crunchy-xml-decoder/ultimate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crunchy-xml-decoder/ultimate.py b/crunchy-xml-decoder/ultimate.py index 770e358..8f019ef 100644 --- a/crunchy-xml-decoder/ultimate.py +++ b/crunchy-xml-decoder/ultimate.py @@ -230,8 +230,8 @@ def ultimate(page_url, seasonnum, epnum): # title = h.unescape(unidecode(title)).replace('/', ' - ').replace(':', '-'). # replace('?', '.').replace('"', "''").replace('|', '-').replace('"',"''").strip() - ### Taken from http://stackoverflow.com/questions/6116978/python-replace-multiple-strings ### - rep = {' / ': ' - ', '/': ' - ', ':': '-', '?': '.', '"': "''", '|': '-', '"': "''", 'a*G':'a G', '*': '#', u'\u2026': '...'} + ### Taken from http://stackoverflow.com/questions/6116978/python-replace-multiple-strings and imrpoved to include the backslash### + rep = {' / ': ' - ', '/': ' - ', ':': '-', '?': '.', '"': "''", '|': '-', '"': "''", 'a*G':'a G', '*': '#', u'\u2026': '...', ' \ ': ' - '} rep = dict((re.escape(k), v) for k, v in rep.iteritems()) pattern = re.compile("|".join(rep.keys()))