replace old %-formatted and .format(…) strings with f-strings (#7671)
mostly using flynt https://github.com/ikamensh/flynt
This commit is contained in:
@@ -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",
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user