Skip to content

Commit

Permalink
Case insensitive replacement of synopsis tags
Browse files Browse the repository at this point in the history
- Some pages have tags using capital letters:

  https://www.audible.com/pd/B002V8N9VG
  • Loading branch information
jmeosbn committed Dec 27, 2017
1 parent 8f0a91a commit 5c03554
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions Contents/Code/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,17 +542,9 @@ def update(self, metadata, media, lang, force=False):


#cleanup synopsis
synopsis = synopsis.replace("<i>", "")
synopsis = synopsis.replace("</i>", "")
synopsis = synopsis.replace("<u>", "")
synopsis = synopsis.replace("</u>", "")
synopsis = synopsis.replace("<b>", "")
synopsis = synopsis.replace("</b>", "")
synopsis = synopsis.replace("<br />", "")
synopsis = synopsis.replace("<p>", "")
synopsis = synopsis.replace("</p>", "\n")


synopsis = re.sub(r'<(/p|P|br ?/)>', '\n', synopsis)
synopsis = re.sub(r'<(/?[iIuUbBp])>', '', synopsis)

self.Log('date: %s', date)
self.Log('title: %s', title)
self.Log('author: %s', author)
Expand Down

0 comments on commit 5c03554

Please sign in to comment.