simplify if statements by using walrus operators (#7671)

This commit is contained in:
Mike Fährmann
2025-07-22 18:34:38 +02:00
parent e8b2a496ba
commit a097a373a9
83 changed files with 239 additions and 466 deletions

View File

@@ -144,8 +144,7 @@ class BoostyExtractor(Extractor):
url = block["url"]
sep = "&" if "?" in url else "?"
signed_query = post.get("signedQuery")
if signed_query:
if signed_query := post.get("signedQuery"):
url += sep + signed_query[1:]
sep = "&"
@@ -280,8 +279,7 @@ class BoostyAPI():
}
if not access_token:
auth = self.extractor.cookies.get("auth", domain=".boosty.to")
if auth:
if auth := self.extractor.cookies.get("auth", domain=".boosty.to"):
access_token = text.extr(
auth, "%22accessToken%22%3A%22", "%22")
if access_token: