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

@@ -24,7 +24,7 @@ class PixnetExtractor(Extractor):
def __init__(self, match):
Extractor.__init__(self, match)
self.blog, self.item_id = match.groups()
self.root = "https://{}.pixnet.net".format(self.blog)
self.root = f"https://{self.blog}.pixnet.net"
def items(self):
url = self.url_fmt.format(self.root, self.item_id)
@@ -72,8 +72,8 @@ class PixnetImageExtractor(PixnetExtractor):
def items(self):
url = "https://api.pixnet.cc/oembed"
params = {
"url": "https://{}.pixnet.net/album/photo/{}".format(
self.blog, self.item_id),
"url": (f"https://{self.blog}.pixnet.net"
f"/album/photo/{self.item_id}"),
"format": "json",
}