- title = title.replace('\r', '').replace('\n', ' ').strip()
- if self.log: self.log(" final title : %s" % title)
+ parts = [s.strip() for s in title.replace('\r', '').split('\n')]
+ title = ' '.join([s for s in parts if s])
+ if log: log(" final title : %s" % title)