use 'str.partition()'

The (r)partition method is always faster then split() or any other
method that has been replaced in this commit.
This commit is contained in:
Mike Fährmann
2017-08-21 18:29:50 +02:00
parent 017a72f448
commit c45770331a
7 changed files with 10 additions and 13 deletions

View File

@@ -76,11 +76,9 @@ class FoolslideChapterExtractor(Extractor):
chapter, pos = text.extract(page, 'title="', '"', pos)
chapter = text.unescape(chapter)
parts = chapter.split(":", maxsplit=1)
title = parts[1].strip() if len(parts) > 1 else ""
self.data["manga"] = text.unescape(manga).strip()
self.data["title"] = title
self.data["title"] = chapter.partition(":")[2].strip()
self.data["language"] = util.code_to_language(self.data["lang"])
self.data["chapter_string"] = chapter
return self.data