replace 2-element f-strings with simple '+' concatenations
Python's 'ast' module and its 'NodeVisitor' class were incredibly helpful in identifying these
This commit is contained in:
@@ -64,7 +64,7 @@ class SchalenetworkExtractor(Extractor):
|
||||
|
||||
def _token(self, required=True):
|
||||
if token := self.config("token"):
|
||||
return f"Bearer {token.rpartition(' ')[2]}"
|
||||
return "Bearer " + token.rpartition(' ')[2]
|
||||
if required:
|
||||
raise exception.AuthRequired("'token'", "your favorites")
|
||||
|
||||
@@ -172,7 +172,7 @@ class SchalenetworkGalleryExtractor(SchalenetworkExtractor, GalleryExtractor):
|
||||
if self.config("cbz", False):
|
||||
headers["Authorization"] = self._token()
|
||||
dl = self.request_json(
|
||||
f"{url}&action=dl", method="POST", headers=headers)
|
||||
url + "&action=dl", method="POST", headers=headers)
|
||||
# 'crt' parameter here is necessary for 'hdoujin' downloads
|
||||
url = f"{dl['base']}?crt={self._crt()}"
|
||||
info = text.nameext_from_url(url)
|
||||
@@ -259,7 +259,7 @@ class SchalenetworkFavoriteExtractor(SchalenetworkExtractor):
|
||||
params = text.parse_query(self.groups[1])
|
||||
params["page"] = text.parse_int(params.get("page"), 1)
|
||||
self.headers["Authorization"] = self._token()
|
||||
return self._pagination(f"/books/favorites?crt={self._crt()}", params)
|
||||
return self._pagination("/books/favorites?crt=" + self._crt(), params)
|
||||
|
||||
|
||||
SchalenetworkExtractor.extr_class = SchalenetworkGalleryExtractor
|
||||
|
||||
Reference in New Issue
Block a user