replace old %-formatted and .format(…) strings with f-strings (#7671)

mostly using flynt
https://github.com/ikamensh/flynt
This commit is contained in:
Mike Fährmann
2025-06-28 19:36:16 +02:00
parent f77e98b57d
commit 9dbe33b6de
167 changed files with 756 additions and 891 deletions

View File

@@ -70,8 +70,7 @@ class HotleakPostExtractor(HotleakExtractor):
self.creator, self.type, self.id = match.groups()
def posts(self):
url = "{}/{}/{}/{}".format(
self.root, self.creator, self.type, self.id)
url = f"{self.root}/{self.creator}/{self.type}/{self.id}"
page = self.request(url).text
page = text.extr(
page, '<div class="movie-image thumb">', '</article>')
@@ -106,7 +105,7 @@ class HotleakCreatorExtractor(HotleakExtractor):
self.creator = match[1]
def posts(self):
url = "{}/{}".format(self.root, self.creator)
url = f"{self.root}/{self.creator}"
return self._pagination(url)
def _pagination(self, url):
@@ -159,7 +158,7 @@ class HotleakCategoryExtractor(HotleakExtractor):
self._category, self.params = match.groups()
def items(self):
url = "{}/{}".format(self.root, self._category)
url = f"{self.root}/{self._category}"
if self._category in ("hot", "creators"):
data = {"_extractor": HotleakCreatorExtractor}