Skip to content

Commit

Permalink
Merge pull request #7 from Kcchouette/patch-1
Browse files Browse the repository at this point in the history
Change the backslash with a -
  • Loading branch information
jaw20 authored Jan 18, 2017
2 parents 0e3b2fc + 42d22fc commit 6651524
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crunchy-xml-decoder/ultimate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 improved 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()))
Expand Down

0 comments on commit 6651524

Please sign in to comment.