replace old %-formatted and .format(…) strings with f-strings (#7671)
mostly using flynt https://github.com/ikamensh/flynt
This commit is contained in:
@@ -46,8 +46,8 @@ class YiffverseExtractor(BooruExtractor):
|
||||
|
||||
post_id = post["id"]
|
||||
root = self.root_cdn if files[fmt][0] else self.root
|
||||
post["file_url"] = url = "{}/posts/{}/{}/{}.{}".format(
|
||||
root, post_id // 1000, post_id, post_id, extension)
|
||||
post["file_url"] = url = \
|
||||
f"{root}/posts/{post_id // 1000}/{post_id}/{post_id}.{extension}"
|
||||
post["format_id"] = fmt
|
||||
post["format"] = extension.partition(".")[0]
|
||||
|
||||
@@ -73,11 +73,11 @@ class YiffverseExtractor(BooruExtractor):
|
||||
post["tags_" + types[type]] = values
|
||||
|
||||
def _fetch_post(self, post_id):
|
||||
url = "{}/api/v2/post/{}".format(self.root, post_id)
|
||||
url = f"{self.root}/api/v2/post/{post_id}"
|
||||
return self.request(url).json()
|
||||
|
||||
def _pagination(self, endpoint, params=None):
|
||||
url = "{}/api{}".format(self.root, endpoint)
|
||||
url = f"{self.root}/api{endpoint}"
|
||||
|
||||
if params is None:
|
||||
params = {}
|
||||
|
||||
Reference in New Issue
Block a user