replace more '.format(…)' calls with f-strings (#7671)
This commit is contained in:
@@ -19,11 +19,10 @@ class PixnetExtractor(Extractor):
|
||||
category = "pixnet"
|
||||
filename_fmt = "{num:>03}_{id}.{extension}"
|
||||
archive_fmt = "{id}"
|
||||
url_fmt = ""
|
||||
|
||||
def __init__(self, match):
|
||||
Extractor.__init__(self, match)
|
||||
self.blog, self.item_id = match.groups()
|
||||
self.blog, self.item_id = self.groups
|
||||
self.root = f"https://{self.blog}.pixnet.net"
|
||||
|
||||
def items(self):
|
||||
@@ -91,14 +90,13 @@ class PixnetImageExtractor(PixnetExtractor):
|
||||
class PixnetSetExtractor(PixnetExtractor):
|
||||
"""Extractor for images from a pixnet set"""
|
||||
subcategory = "set"
|
||||
url_fmt = "{}/album/set/{}"
|
||||
directory_fmt = ("{category}", "{blog}",
|
||||
"{folder_id} {folder_title}", "{set_id} {set_title}")
|
||||
pattern = BASE_PATTERN + r"/album/set/(\d+)"
|
||||
example = "https://USER.pixnet.net/album/set/12345"
|
||||
|
||||
def items(self):
|
||||
url = self.url_fmt.format(self.root, self.item_id)
|
||||
url = f"{self.root}/album/set/{self.item_id}"
|
||||
page = self.request(url, encoding="utf-8").text
|
||||
data = self.metadata(page)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user