From 468570a1d6aff068c890fc7d8a6cb0fbb8a4e6b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sun, 14 Dec 2025 17:08:23 +0100 Subject: [PATCH] [boosty] warn about expired 'auth' cookie tokens (#8704) --- gallery_dl/extractor/boosty.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gallery_dl/extractor/boosty.py b/gallery_dl/extractor/boosty.py index 87ab82a6..e393e6c4 100644 --- a/gallery_dl/extractor/boosty.py +++ b/gallery_dl/extractor/boosty.py @@ -280,8 +280,12 @@ class BoostyAPI(): if not access_token: if auth := self.extractor.cookies.get("auth", domain=".boosty.to"): - access_token = text.extr( - text.unquote(auth), '"accessToken":"', '"') + auth = text.unquote(auth) + access_token = text.extr(auth, '"accessToken":"', '"') + if expires := text.extr(auth, '"expiresAt":', ','): + import time + if text.parse_int(expires) < time.time() * 1000: + extractor.log.warning("'auth' cookie tokens expired") if access_token: self.headers["Authorization"] = "Bearer " + access_token